Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
8434475
Baseline compatibilty
brianjhanson Mar 24, 2026
097d174
Cleaning up a bit
brianjhanson Mar 24, 2026
83416e6
Stop some style bleeding
brianjhanson Mar 24, 2026
ab86773
Fix legacy pages
brianjhanson Mar 25, 2026
666adaf
Minor styling updates
brianjhanson Mar 25, 2026
107b8e2
Clean up types
brianjhanson Mar 25, 2026
20d9995
Apply reset to `.menu--disclosure`
brianjhanson Mar 25, 2026
df32f7d
Ensure global Craft variable is defined
brianjhanson Mar 25, 2026
31590f9
Minor styling updates
brianjhanson Mar 25, 2026
ec083ba
POST request success
brianjhanson Mar 25, 2026
8efc0a0
Merge branch '6.x' into feature/js-compat
brianjhanson Mar 26, 2026
a941d86
Add reset class to legacy templates
brianjhanson Mar 27, 2026
109abd4
Update EntryTypeSelect.vue
brianjhanson Mar 30, 2026
ae44904
Use an EntryTypeResource
brianjhanson Mar 31, 2026
dc84db2
Prefix classes with .cp
brianjhanson Mar 31, 2026
c82b018
Ignore `craft-icon` and `slot` from namespacing
brianjhanson Mar 31, 2026
72ae3b0
Remove resource wrap by default
brianjhanson Mar 31, 2026
10e5020
Show overrides properly on form
brianjhanson Apr 1, 2026
6a729c4
Merge branch '6.x' into feature/js-compat
brianjhanson Apr 1, 2026
f39082f
Fix prettier
brianjhanson Apr 1, 2026
52f6e91
Merge branch '6.x' into feature/js-compat
brianjhanson Apr 7, 2026
4c55ced
Contain legacy styles
brianjhanson Apr 7, 2026
9dbdc37
Update tooltip styles a bit
brianjhanson Apr 7, 2026
d7c2b46
Working through EntryTyper overrides
brianjhanson Apr 7, 2026
db76f1d
Working Entry Type selection
brianjhanson Apr 7, 2026
b5a1342
A little janky, but it works
brianjhanson Apr 7, 2026
3a376b8
Handle more complex icons
brianjhanson Apr 7, 2026
d097371
Remove bespoke flex utility
brianjhanson Apr 8, 2026
7f3f1c9
Initial drag and drop on entryTypeSelect component
brianjhanson Apr 8, 2026
e6937bf
Remove debug styles
brianjhanson Apr 8, 2026
6ed3ac9
Add legacy styles
brianjhanson Apr 8, 2026
1872a02
Build assets
brianjhanson Apr 8, 2026
f5bf87c
Rebuild cp asset
brianjhanson Apr 8, 2026
6dcb9fa
Merge branch '6.x' of github.com:craftcms/cms into feature/js-compat
brianjhanson Apr 8, 2026
70fe939
Add tests
brianjhanson Apr 8, 2026
6e636d5
cp-colorable -> cp-color
brianjhanson Apr 8, 2026
24a2f5b
Rework color tokens a bit
brianjhanson Apr 8, 2026
51599bb
Add dom.ts tests
brianjhanson Apr 8, 2026
3729bed
Move menu styles out of the cp-legacy class
brianjhanson Apr 8, 2026
927517a
Paint over javascript error for now
brianjhanson Apr 8, 2026
166b9b2
Fix the HUD styling
brianjhanson Apr 8, 2026
d59880e
Fix test
brianjhanson Apr 8, 2026
a32abd8
EntryTypeResource cleanup
brianjhanson Apr 8, 2026
d4f68f4
Fix icon picker
brianjhanson Apr 8, 2026
2f4c874
Cleanup markup
brianjhanson Apr 8, 2026
0009aa9
Cleanup
brianjhanson Apr 8, 2026
256d070
Deleted _variables.scss a bit too early
brianjhanson Apr 8, 2026
4813932
Build
brianjhanson Apr 8, 2026
9b74009
Fix login
brianjhanson Apr 9, 2026
a4d1328
Merge branch '6.x' into feature/js-compat
brianjhanson Apr 14, 2026
bc138f9
Build
brianjhanson Apr 14, 2026
e322a8e
Inital craft-info-icon
brianjhanson Apr 8, 2026
13eb47c
Replace AdminTable info icon
brianjhanson Apr 9, 2026
6d83f06
Deprecation warning
brianjhanson Apr 9, 2026
79e1b35
Only one info-icon at a time
brianjhanson Apr 9, 2026
7633539
Update link field instructions with new icon
brianjhanson Apr 9, 2026
ee9d811
Port Entry Type and Fields index page
brianjhanson Apr 9, 2026
ff0f7cc
Make things more consistent
brianjhanson Apr 10, 2026
f400cb5
Remove extra prop
brianjhanson Apr 10, 2026
442aea9
Style "new" buttons
brianjhanson Apr 10, 2026
b40050d
Empty state
brianjhanson Apr 10, 2026
b4d7d08
Delete entry types
brianjhanson Apr 10, 2026
512feb3
Deprecation messages
brianjhanson Apr 10, 2026
75f8979
CSS grid cp-table
brianjhanson Apr 10, 2026
7c8e4e5
Translation and search icon badges
brianjhanson Apr 10, 2026
cfe840a
A bit more table cleanup
brianjhanson Apr 10, 2026
9aa358f
Improve styling of usages
brianjhanson Apr 10, 2026
07a3fc2
Minor styling updates
brianjhanson Apr 10, 2026
dc15ff7
Initial port of volumes
brianjhanson Apr 10, 2026
d8626d1
Reorder volumes
brianjhanson Apr 11, 2026
fcc465f
Switching out columnHelper for our custom one
brianjhanson Apr 11, 2026
0030699
Convert the image transforms page
brianjhanson Apr 11, 2026
8435f8b
Filesystems
brianjhanson Apr 13, 2026
f38e53d
Remove the old template
brianjhanson Apr 13, 2026
6ca7334
Build assets
brianjhanson Apr 14, 2026
d673815
Port GraphQL Schemas
brianjhanson Apr 14, 2026
742d8c2
Port GraphQL Tokens
brianjhanson Apr 14, 2026
230db5c
Port user groups
brianjhanson Apr 14, 2026
15aef75
Cleanup
brianjhanson Apr 14, 2026
10589ab
Merge branch '6.x' of github.com:craftcms/cms into feature/inertia-ui
brianjhanson Apr 14, 2026
a979004
Merge branch 'feature/inertia-ui' of github.com:craftcms/cms into fea…
brianjhanson Apr 14, 2026
af2440e
Add `whereNumber` for fields
brianjhanson Apr 14, 2026
902c9ff
Cleanup comment
brianjhanson Apr 14, 2026
bfcae1f
Update test
brianjhanson Apr 14, 2026
574c567
Fix PHPStan errors
brianjhanson Apr 14, 2026
4975d05
Fix type errors
brianjhanson Apr 14, 2026
e299043
Add docs for Admin Table
brianjhanson Apr 14, 2026
57597a4
Fix another type error
brianjhanson Apr 14, 2026
83be0ab
Update PagesTest
brianjhanson Apr 14, 2026
aa7d473
Fix info-icon display
brianjhanson Apr 14, 2026
4dc1b5b
Merge branch '6.x' of github.com:craftcms/cms into feature/inertia-ui
brianjhanson Apr 15, 2026
7349ffa
Update render test
brianjhanson Apr 15, 2026
7d9d71b
Merge branch 'feature/inertia-ui' of github.com:craftcms/cms into fea…
brianjhanson Apr 15, 2026
cf18ffb
Edit user groups page to inertia
brianjhanson Apr 20, 2026
d613c22
logical properties
brianjhanson Apr 20, 2026
8f2641b
Consolidate a bit of logic
brianjhanson Apr 20, 2026
6d39a04
Inertia links to user group
brianjhanson Apr 20, 2026
bcec45b
Disable pagination
brianjhanson Apr 20, 2026
c840183
inertiaProps isn't nullable
brianjhanson Apr 21, 2026
1f81c2b
Merge branch '6.x' into feature/inertia-ui
brianjhanson Apr 21, 2026
76e5a5a
Merge branch 'feature/inertia-ui' of github.com:craftcms/cms into fea…
brianjhanson Apr 21, 2026
1ee3980
Updates field settings tests
brianjhanson Apr 21, 2026
887d5e0
Merge branch 'feature/admin-table-pages' of github.com:craftcms/cms i…
brianjhanson Apr 21, 2026
84d0cd6
Cleanup email settings pae
brianjhanson Apr 21, 2026
cdbcd06
Consolidation and cleanup
brianjhanson Apr 21, 2026
3205047
Update tests
brianjhanson Apr 21, 2026
94927f4
Fix PHPStan error
brianjhanson Apr 21, 2026
ca8e39d
Fix token tests
brianjhanson Apr 21, 2026
6000ebe
Merge branch 'feature/admin-table-pages' of github.com:craftcms/cms i…
brianjhanson Apr 21, 2026
893c651
Merge pull request #18710 from craftcms/feature/admin-table-pages
brianjhanson Apr 21, 2026
523c96a
Merge branch 'feature/inertia-ui' into feature/edit-user-group
brianjhanson Apr 22, 2026
2ef502a
Update UserGroupsController test
brianjhanson Apr 22, 2026
f9128de
Merge pull request #18737 from craftcms/feature/edit-user-group
brianjhanson Apr 22, 2026
099fb1f
Refactor copy-button
brianjhanson Apr 23, 2026
fe4df28
Move shortcut support into action-item
brianjhanson Apr 23, 2026
594bac0
Fix admin table bug
brianjhanson Apr 23, 2026
ef1cd72
Majority of plugins index page
brianjhanson Apr 23, 2026
b8b2fc1
Fix random type error
brianjhanson Apr 23, 2026
995dd3a
Implement an action system via the plugins index page
brianjhanson Apr 23, 2026
4c86085
Fix type error
brianjhanson Apr 23, 2026
4761658
Update PluginsController
brianjhanson Apr 23, 2026
ceeb71a
Move some changes from the other branch
brianjhanson Apr 23, 2026
ccd5311
Add server-driven menu actions documentation
brianjhanson Apr 24, 2026
ab99350
Merge branch '6.x' of github.com:craftcms/cms into feature/inertia-ui
brianjhanson Apr 24, 2026
7059687
Merge branch 'feature/inertia-ui' of github.com:craftcms/cms into fea…
brianjhanson Apr 24, 2026
831bd55
Add a storybook for the Vue side
brianjhanson Apr 24, 2026
8009732
Feature parity with legacy code
brianjhanson Apr 24, 2026
d9cf65e
Fix PluginsControllerTest test
brianjhanson Apr 24, 2026
7d18115
Merge branch 'feature/plugins-page' of github.com:craftcms/cms into f…
brianjhanson Apr 24, 2026
6e50eba
Add copy package name action
brianjhanson Apr 24, 2026
8c72e31
Merge pull request #18750 from craftcms/feature/plugins-page
brandonkelly Apr 24, 2026
1c68083
Merge branch '6.x' of github.com:craftcms/cms into feature/inertia-ui
brianjhanson Apr 27, 2026
f2c5fb7
Merge branch '6.x' of github.com:craftcms/cms into feature/actions
brianjhanson Apr 27, 2026
e0e945e
Round out the plugin page functionality
brianjhanson Apr 27, 2026
4b050f5
Cleanup
brianjhanson Apr 27, 2026
acaae56
Merge branch 'feature/inertia-ui' of github.com:craftcms/cms into fea…
brianjhanson Apr 27, 2026
ef313e1
Fix legacy asset registration
brianjhanson Apr 28, 2026
2727ab9
Fix element chip reordering
brianjhanson Apr 28, 2026
3623a65
Fix logi
brianjhanson Apr 28, 2026
34f3d60
Update docs note a bit
brianjhanson Apr 28, 2026
ac2bf31
Cleaning up
brianjhanson Apr 28, 2026
45a1395
Merge pull request #18749 from craftcms/feature/actions
brianjhanson Apr 28, 2026
b26540c
Merge branch 'ui-cleaning-pass' into feature/inertia-ui
brianjhanson Apr 28, 2026
59afd30
Merge branch '6.x' of github.com:craftcms/cms into feature/inertia-ui
brianjhanson Apr 28, 2026
ef3609e
Merge branch '6.x' of github.com:craftcms/cms into feature/inertia-ui
brianjhanson May 4, 2026
a45cecb
Remove debug
brianjhanson May 4, 2026
bf4e34c
Merge branch '6.x' of github.com:craftcms/cms into feature/inertia-ui
brianjhanson May 4, 2026
7d16d89
Merge branch '6.x' of github.com:craftcms/cms into feature/inertia-ui
brianjhanson May 5, 2026
f9cf6f0
Merge branch '6.x' of github.com:craftcms/cms into feature/inertia-ui
brianjhanson May 6, 2026
bd68848
Minor fix from merge conflict
brianjhanson May 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
360 changes: 360 additions & 0 deletions .storybook/inertia-mock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,360 @@
import {defineComponent, h, reactive} from 'vue';

/**
* Default page props for Storybook
* These can be overridden per-story using parameters.inertia
*/
export const defaultPageProps = {
craft: {
system: {
name: 'Craft CMS',
icon: null,
},
app: {
version: '6.0.0',
edition: {
name: 'Pro',
handle: 'pro',
value: 2,
},
},
site: {
url: 'https://example.com',
},
currentUser: {
id: 1,
username: 'admin',
email: 'admin@example.com',
admin: true,
},
nav: [],
actionUrl: '/actions/',
cpUrl: '/admin/',
baseApiUrl: '/api/',
},
flash: {
success: null,
error: null,
},
readOnly: false,
};

/**
* Reactive page state that can be modified by stories
*/
export const pageState = reactive({
props: {...defaultPageProps, errors: {}, deferred: {}},
url: '/',
component: 'Story',
version: '1',
clearHistory: false,
encryptHistory: false,
flash: {},
rememberedState: {},
});

/**
* Reset page props to defaults, optionally merging with overrides
*/
export function setPageProps(overrides = {}) {
pageState.props = deepMerge({...defaultPageProps}, overrides);
}

/**
* Deep merge utility
*/
function deepMerge(target, source) {
const result = {...target};

for (const key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
const sourceValue = source[key];
const targetValue = result[key];

if (
sourceValue &&
typeof sourceValue === 'object' &&
!Array.isArray(sourceValue) &&
targetValue &&
typeof targetValue === 'object' &&
!Array.isArray(targetValue)
) {
result[key] = deepMerge(targetValue, sourceValue);
} else {
result[key] = sourceValue;
}
}
}

return result;
}

/**
* Mock usePage composable
*/
export function usePage() {
return pageState;
}

/**
* Mock router for Inertia
*/
export const router = {
visit(url, options) {
console.log('[Storybook] router.visit:', url, options);
},
get(url, data, options) {
console.log('[Storybook] router.get:', url, data, options);
},
post(url, data, options) {
console.log('[Storybook] router.post:', url, data, options);
},
put(url, data, options) {
console.log('[Storybook] router.put:', url, data, options);
},
patch(url, data, options) {
console.log('[Storybook] router.patch:', url, data, options);
},
delete(url, options) {
console.log('[Storybook] router.delete:', url, options);
},
reload(options) {
console.log('[Storybook] router.reload:', options);
},
replace(url, options) {
console.log('[Storybook] router.replace:', url, options);
},
on(event, callback) {
console.log('[Storybook] router.on:', event);
return () => {};
},
};

/**
* Mock useForm composable
*/
export function useForm(rememberKeyOrData, maybeData) {
const initialValues =
typeof rememberKeyOrData === 'string' ? maybeData : rememberKeyOrData;
const formData = reactive({...initialValues});
const errors = {};

const formProps = {
errors,
hasErrors: false,
processing: false,
progress: null,
wasSuccessful: false,
recentlySuccessful: false,
isDirty: false,
data: () => formData,
transform: () => formProps,
defaults: () => formProps,
reset(...fields) {
if (fields.length === 0) {
Object.assign(formData, initialValues);
} else {
fields.forEach((field) => {
formData[field] = initialValues[field];
});
}
return formProps;
},
clearErrors(...fields) {
if (fields.length === 0) {
Object.keys(errors).forEach((key) => delete errors[key]);
} else {
fields.forEach((field) => delete errors[field]);
}
formProps.hasErrors = Object.keys(errors).length > 0;
return formProps;
},
resetAndClearErrors(...fields) {
formProps.reset(...fields);
formProps.clearErrors(...fields);
return formProps;
},
setError(fieldOrErrors, maybeValue) {
if (typeof fieldOrErrors === 'string') {
errors[fieldOrErrors] = maybeValue;
} else {
Object.assign(errors, fieldOrErrors);
}
formProps.hasErrors = true;
return formProps;
},
submit(...args) {
console.log('[Storybook] form.submit:', ...args);
},
get(url, options) {
console.log('[Storybook] form.get:', url, options);
},
post(url, options) {
console.log('[Storybook] form.post:', url, options);
},
put(url, options) {
console.log('[Storybook] form.put:', url, options);
},
patch(url, options) {
console.log('[Storybook] form.patch:', url, options);
},
delete(url, options) {
console.log('[Storybook] form.delete:', url, options);
},
cancel() {
console.log('[Storybook] form.cancel');
},
dontRemember: () => formProps,
optimistic: () => formProps,
withPrecognition: () => formProps,
};

return reactive({...formData, ...formProps});
}

/**
* Mock Head component
*/
export const Head = defineComponent({
name: 'Head',
props: {
title: String,
},
setup() {
return () => null;
},
});

/**
* Mock Link component
*/
export const Link = defineComponent({
name: 'Link',
props: {
href: {
type: String,
required: true,
},
method: {
type: String,
default: 'get',
},
data: Object,
replace: Boolean,
preserveScroll: Boolean,
preserveState: Boolean,
only: Array,
headers: Object,
as: {
type: String,
default: 'a',
},
},
setup(props, {slots, attrs}) {
return () =>
h(
props.as,
{
...attrs,
href: props.href,
onClick: (e) => {
e.preventDefault();
console.log(
'[Storybook] Link clicked:',
props.href,
props.method,
props.data
);
},
},
slots.default?.()
);
},
});

/**
* Mock Form component
*/
export const Form = defineComponent({
name: 'Form',
props: {
method: {
type: String,
default: 'post',
},
action: String,
data: Object,
preserveScroll: Boolean,
preserveState: Boolean,
only: Array,
headers: Object,
},
setup(props, {slots, attrs}) {
const formState = reactive({
processing: false,
errors: {},
hasErrors: false,
wasSuccessful: false,
recentlySuccessful: false,
});

return () =>
h(
'form',
{
...attrs,
action: props.action,
method: props.method === 'get' ? 'get' : 'post',
onSubmit: (e) => {
e.preventDefault();
console.log(
'[Storybook] Form submitted:',
props.action,
props.method,
props.data
);
},
},
slots.default?.(formState)
);
},
});

/**
* Mock Deferred component - renders children immediately in Storybook
*/
export const Deferred = defineComponent({
name: 'Deferred',
props: {
data: {
type: [String, Array],
required: true,
},
},
setup(props, {slots}) {
return () => slots.default?.();
},
});

/**
* Mock createInertiaApp - not typically used in Storybook stories
*/
export function createInertiaApp(options) {
console.log('[Storybook] createInertiaApp called - this is a mock');
return Promise.resolve();
}

/**
* Install the Inertia mock as a Vue plugin
*/
export function installInertiaMock(app) {
app.config.globalProperties.$page = pageState;
app.config.globalProperties.$inertia = router;

app.component('Head', Head);
app.component('Link', Link);
app.component('InertiaLink', Link);

app.provide('$inertia', router);
app.provide('$page', pageState);
}
Loading
Loading