Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const config: StorybookConfig = {
viteFinal(config) {
// Storybook's vue3-vite framework adds its own Vue plugin with default options.
// We need to configure `isCustomElement` so Vue treats `craft-*` tags as web
// components (from @craftcms/cp) rather than trying to resolve them as Vue
// components (from @craftcms/ui) rather than trying to resolve them as Vue
// components. Since Vite's mergeConfig doesn't deep-merge plugin options,
// we remove Storybook's Vue plugin and add our own with the correct config.
const filteredPlugins = (config.plugins || []).flat().filter((plugin) => {
Expand Down
2 changes: 1 addition & 1 deletion .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {Preview} from '@storybook/vue3';
import {setup} from '@storybook/vue3';
import {withThemeByDataAttribute} from '@storybook/addon-themes';
import '@craftcms/cp';
import '@craftcms/ui';
import '../resources/css/cp.css';
import './preview.css';
import {installInertiaMock, setPageProps} from './inertia-mock';
Expand Down
3,480 changes: 1,496 additions & 1,984 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@
"build:bundles": "cd ./packages/craftcms-legacy && npm run build",
"dev:bundles": "cd ./packages/craftcms-legacy && npm run dev",
"serve:bundles": "cd ./packages/craftcms-legacy && npm run serve",
"dev:cp": "cd ./packages/craftcms-cp && npm run dev",
"build:cp": "cd ./packages/craftcms-cp && npm run build",
"dev:cp": "cd ./packages/craftcms-ui && npm run dev",
"build:cp": "cd ./packages/craftcms-ui && npm run build",
"build:garnish": "cd ./packages/craftcms-garnish && npm run build",
"test": "vitest run",
"test:cp": "cd ./packages/craftcms-cp && npm run test",
"test:cp": "cd ./packages/craftcms-ui && npm run test",
"storybook": "storybook dev -p 6007",
"build:storybook": "storybook build",
"storybook:cp": "cd ./packages/craftcms-cp && npm run storybook",
"storybook:cp": "cd ./packages/craftcms-ui && npm run storybook",
"build:all": "npm run build:garnish && npm run build:cp && npm run build:bundles && npm run build"
},
"workspaces": [
Expand Down Expand Up @@ -69,6 +69,7 @@
"typescript": "^6.0.3",
"typescript-eslint": "^8.60.0",
"vite": "^8.0.10",
"vitest": "^4.1.8",
"vue-tsc": "^3.2.7"
},
"optionalDependencies": {
Expand All @@ -77,8 +78,8 @@
"dependencies": {
"@atlaskit/pragmatic-drag-and-drop": "^1.8.1",
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
"@craftcms/cp": "file:packages/craftcms-cp",
"@craftcms/graphiql": "file:packages/craftcms-graphiql",
"@craftcms/ui": "file:packages/craftcms-ui",
"@headlessui/vue": "^1.7.23",
"@inertiajs/vite": "^3.0.3",
"@inertiajs/vue3": "^3.0.3",
Expand Down
55 changes: 0 additions & 55 deletions packages/craftcms-cp/src/services/Config.ts

This file was deleted.

79 changes: 0 additions & 79 deletions packages/craftcms-cp/src/types/globals.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/craftcms-garnish/docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Garnish widgets are **imperative** — `new Modal(container)`,
`new DisclosureMenu(trigger)`, `new HUD(trigger, body)` — operating on plain DOM,
**not** web components. So we use the **`@storybook/html-vite`** renderer: each
story's `render()` returns an `HTMLElement` and instantiates the Garnish class
inside it. (By contrast, `@craftcms/cp` uses `@storybook/web-components-vite`
inside it. (By contrast, `@craftcms/ui` uses `@storybook/web-components-vite`
because its components are custom elements.) We otherwise match cp's Storybook:
version **10.4.1** and the **docs / a11y / themes** addons.

Expand Down
2 changes: 1 addition & 1 deletion packages/craftcms-legacy/cp/src/css/_compat.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Legacy Token Mapping
*
* This file maps legacy CSS variables to the new token system defined in
* @craftcms/cp tokens.css. Import this file to provide backwards compatibility
* @craftcms/ui tokens.css. Import this file to provide backwards compatibility
* for legacy styles.
*
* Variables mapped to --CHANGE require manual review and update.
Expand Down
33 changes: 15 additions & 18 deletions packages/craftcms-legacy/cp/src/js/CP.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
// Import from the deep service module rather than the package root. The root
// entry (`@craftcms/cp`) side-effect-registers WebAwesome components (e.g.
// `wa-icon`); pulling that into this separately-webpacked legacy bundle causes
// a duplicate custom-element registration when it loads alongside the Vite app.
import {QueueService} from '@craftcms/cp/services/Queue';
/** global: Craft */
/** global: Garnish */
/** global: $ */
Expand Down Expand Up @@ -81,8 +76,10 @@ Craft.CP = Garnish.Base.extend(

resizeTimeout: null,

/** @type QueueService */
QueueService: QueueService.getInstance(),
/** @deprecated since 6.0. Access via Craft.$queue */
get QueueService() {
return Craft.$queue;
},

init: function () {
this.elementThumbLoader = new Craft.ElementThumbLoader();
Expand Down Expand Up @@ -1679,29 +1676,29 @@ Craft.CP = Garnish.Base.extend(
/** @deprecated since 6.0. */
runQueue: function () {
if (Craft.runQueueAutomatically) {
Craft.queue.push(() => this.QueueService.runQueue());
Craft.queue.push(() => Craft.$queue.runQueue());
} else {
this.QueueService.startTracking(false, true);
Craft.$queue.startTracking(false, true);
}
},

/** @deprecated since 6.0. Use QueueService.startTracking() instead */
/** @deprecated since 6.0. Use Craft.$queue.startTracking() instead */
trackJobProgress: function (delay, force) {
this.QueueService.startTracking(delay, force);
Craft.$queue.startTracking(delay, force);
},

/** @deprecated since 6.0. Use QueueService.setJobData() instead */
/** @deprecated since 6.0. Use Craft.$queue.setJobData() instead */
setJobData: function (data) {
this.QueueService.setJobData(data);
Craft.$queue.setJobData(data);
},

get jobInfo() {
return this.QueueService.jobInfo;
return Craft.$queue.jobInfo;
},

/** @deprecated since 6.0. Use QueueService.setJobData() instead */
/** @deprecated since 6.0. Use Craft.$queue.setJobData() instead */
setJobInfo: function (jobInfo) {
this.QueueService.setJobData({
Craft.$queue.setJobData({
jobs: jobInfo,
total: jobInfo.length,
});
Expand All @@ -1710,9 +1707,9 @@ Craft.CP = Garnish.Base.extend(
this.trigger('setJobInfo');
},

/** @deprecated since 6.0. Use QueueService.stopTracking() instead */
/** @deprecated since 6.0. Use Craft.$queue.stopTracking() instead */
cancelJobTracking: function () {
this.QueueService.stopTracking();
Craft.$queue.stopTracking();
},

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/craftcms-legacy/cp/src/js/Craft.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {formatMessage, t} from '@craftcms/cp/utilities/translate';
import {formatMessage, t} from '@craftcms/ui/utilities/translate';
import * as d3 from 'd3';

/** global: Craft */
Expand Down
4 changes: 2 additions & 2 deletions packages/craftcms-legacy/cp/src/js/ElementThumbLoader.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {ThumbnailLoader} from '@craftcms/cp/utilities/thumbnail-loader';
import {ThumbnailLoader} from '@craftcms/ui/utilities/thumbnail-loader';

/** global: Craft */
/**
* Legacy `Craft.ElementThumbLoader` — a thin bridge over `@craftcms/cp`'s
* Legacy `Craft.ElementThumbLoader` — a thin bridge over `@craftcms/ui`'s
* `ThumbnailLoader` (see the package's `components/thumbnail-loader/README.md`).
*
* Callers (`Craft.cp.elementThumbLoader`, element index views, slideouts,
Expand Down
2 changes: 1 addition & 1 deletion packages/craftcms-legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"dependencies": {
"@benmajor/jquery-touch-events": "^2.0.3",
"@craftcms/cp": "file:../craftcms-cp",
"@craftcms/ui": "file:../craftcms-ui",
"@craftcms/sass": "file:../craftcms-sass",
"@craftcms/vue": "file:../craftcms-vue",
"@floating-ui/dom": "^1.7.6",
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type {
Preview,
WebComponentsRenderer,
} from '@storybook/web-components-vite';
import '../src/styles/cp.css';
import '../src/styles/base.css';
import './preview.css';
import {withThemeByDataAttribute} from '@storybook/addon-themes';
import {setCustomElementsManifest} from '@storybook/web-components';
Expand Down
Loading
Loading