diff --git a/src/Umbraco.Web.UI.Client/.github/workflows/build_test.yml b/src/Umbraco.Web.UI.Client/.github/workflows/build_test.yml index 931f3bd5b3..7c5ee7ee44 100644 --- a/src/Umbraco.Web.UI.Client/.github/workflows/build_test.yml +++ b/src/Umbraco.Web.UI.Client/.github/workflows/build_test.yml @@ -25,23 +25,30 @@ env: jobs: build: runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [20] - steps: - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version-file: .nvmrc cache: npm - cache-dependency-path: package-lock.json + cache-dependency-path: ./package-lock.json - run: npm ci --no-audit --no-fund --prefer-offline - run: npm run lint:errors - - run: npm run build + - run: npm run build:for:cms - run: npm run generate:jsonschema:dist + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + cache: npm + cache-dependency-path: ./package-lock.json + - run: npm ci --no-audit --no-fund --prefer-offline - run: npx playwright install --with-deps - run: npm test - name: Upload Code Coverage reports @@ -51,13 +58,3 @@ jobs: name: code-coverage path: coverage/ retention-days: 30 - # Commented out since it is outdated and is quite spammy - # - name: Report code coverage - # uses: zgosalvez/github-actions-report-lcov@v2 - # if: always() - # continue-on-error: true - # with: - # coverage-files: coverage/lcov.info - # artifact-name: code-coverage-report - # github-token: ${{ secrets.GITHUB_TOKEN }} - # working-directory: ./ diff --git a/src/Umbraco.Web.UI.Client/.github/workflows/devskim.yml b/src/Umbraco.Web.UI.Client/.github/workflows/devskim.yml deleted file mode 100644 index fbb9d054cd..0000000000 --- a/src/Umbraco.Web.UI.Client/.github/workflows/devskim.yml +++ /dev/null @@ -1,38 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -name: DevSkim - -on: - push: - branches: - - main - - release/* - schedule: - - cron: '19 14 * * 5' - -jobs: - lint: - name: DevSkim - runs-on: ubuntu-20.04 - permissions: - actions: read - contents: read - security-events: write - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Run DevSkim scanner - uses: microsoft/DevSkim-Action@v1 - with: - directory-to-scan: src - should-scan-archives: false - ignore-globs: '**/.git/**,*.md,*.mdx,*.stories.ts,*.js' - - - name: Upload DevSkim scan results to GitHub Security tab - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: devskim-results.sarif diff --git a/src/Umbraco.Web.UI.Client/devops/icons/index.js b/src/Umbraco.Web.UI.Client/devops/icons/index.js index 19e684c7dd..0e35e7815c 100644 --- a/src/Umbraco.Web.UI.Client/devops/icons/index.js +++ b/src/Umbraco.Web.UI.Client/devops/icons/index.js @@ -1,4 +1,4 @@ -import { readFileSync, writeFile, mkdir } from 'fs'; +import { readFileSync, writeFile, mkdir, rmSync } from 'fs'; import * as globModule from 'tiny-glob'; import * as pathModule from 'path'; @@ -15,6 +15,9 @@ const lucideSvgDirectory = 'node_modules/lucide-static/icons'; const simpleIconsSvgDirectory = 'node_modules/simple-icons/icons'; const run = async () => { + // Empty output directory: + rmSync(iconsOutputDirectory, { recursive: true }); + var icons = await collectDictionaryIcons(); icons = await collectDiskIcons(icons); writeIconsToDisk(icons); diff --git a/src/Umbraco.Web.UI.Client/package-lock.json b/src/Umbraco.Web.UI.Client/package-lock.json index 814ac54bb0..4727d4c626 100644 --- a/src/Umbraco.Web.UI.Client/package-lock.json +++ b/src/Umbraco.Web.UI.Client/package-lock.json @@ -20,7 +20,8 @@ "./src/packages/umbraco-news", "./src/packages/webhook", "./src/packages/health-check", - "./src/packages/tags" + "./src/packages/tags", + "./src/packages/templating" ], "dependencies": { "@types/diff": "^5.2.1", @@ -89,7 +90,7 @@ "rollup-plugin-esbuild": "^6.1.1", "rollup-plugin-import-css": "^3.5.0", "rollup-plugin-web-worker-loader": "^1.6.1", - "simple-icons": "^12.0.0", + "simple-icons": "^13.0.0", "storybook": "^7.6.17", "tiny-glob": "^0.2.9", "tsc-alias": "^1.8.8", @@ -7667,6 +7668,10 @@ "resolved": "src/packages/tags", "link": true }, + "node_modules/@umbraco-backoffice/templating": { + "resolved": "src/packages/templating", + "link": true + }, "node_modules/@umbraco-backoffice/umbraco-news": { "resolved": "src/packages/umbraco-news", "link": true @@ -19369,9 +19374,9 @@ "dev": true }, "node_modules/simple-icons": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/simple-icons/-/simple-icons-12.4.0.tgz", - "integrity": "sha512-2uL8PHFDyBLQGhZsAvYcaHqm5KjNzIepPshTLZky9Dc6HgPFI83SAVC8of3KYtr+7O8zJggrGYTxyUu/9hyYgA==", + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/simple-icons/-/simple-icons-13.0.0.tgz", + "integrity": "sha512-emybHoFXO9IorOH8Uy8GwavS1oOQk6bVMxrIAXztNn/EcRc17yHmJM6XpUUd1CcDpax0dHAbpqvGp4hqWlQapg==", "dev": true, "engines": { "node": ">=0.12.18" @@ -22278,6 +22283,9 @@ "src/packages/tags": { "name": "@umbraco-backoffice/tag" }, + "src/packages/templating": { + "name": "@umbraco-backoffice/templating" + }, "src/packages/umbraco-news": { "name": "@umbraco-backoffice/umbraco-news" }, diff --git a/src/Umbraco.Web.UI.Client/package.json b/src/Umbraco.Web.UI.Client/package.json index 58c00a258d..3f2b6baa11 100644 --- a/src/Umbraco.Web.UI.Client/package.json +++ b/src/Umbraco.Web.UI.Client/package.json @@ -138,7 +138,8 @@ "./src/packages/umbraco-news", "./src/packages/webhook", "./src/packages/health-check", - "./src/packages/tags" + "./src/packages/tags", + "./src/packages/templating" ], "scripts": { "backoffice:test:e2e": "npx playwright test", @@ -256,7 +257,7 @@ "rollup-plugin-esbuild": "^6.1.1", "rollup-plugin-import-css": "^3.5.0", "rollup-plugin-web-worker-loader": "^1.6.1", - "simple-icons": "^12.0.0", + "simple-icons": "^13.0.0", "storybook": "^7.6.17", "tiny-glob": "^0.2.9", "tsc-alias": "^1.8.8", diff --git a/src/Umbraco.Web.UI.Client/src/apps/backoffice/components/backoffice-main.element.ts b/src/Umbraco.Web.UI.Client/src/apps/backoffice/components/backoffice-main.element.ts index b4584ee573..3a9ac24397 100644 --- a/src/Umbraco.Web.UI.Client/src/apps/backoffice/components/backoffice-main.element.ts +++ b/src/Umbraco.Web.UI.Client/src/apps/backoffice/components/backoffice-main.element.ts @@ -2,7 +2,7 @@ import type { UmbBackofficeContext } from '../backoffice.context.js'; import { UMB_BACKOFFICE_CONTEXT } from '../backoffice.context.js'; import { css, html, customElement, state, nothing } from '@umbraco-cms/backoffice/external/lit'; import { UmbSectionContext, UMB_SECTION_CONTEXT, UMB_SECTION_PATH_PATTERN } from '@umbraco-cms/backoffice/section'; -import type { UmbRoute, UmbRouterSlotChangeEvent } from '@umbraco-cms/backoffice/router'; +import type { PageComponent, UmbRoute, UmbRouterSlotChangeEvent } from '@umbraco-cms/backoffice/router'; import type { ManifestSection, UmbSectionElement } from '@umbraco-cms/backoffice/extension-registry'; import type { UmbExtensionManifestInitializer } from '@umbraco-cms/backoffice/extension-api'; import { createExtensionElement } from '@umbraco-cms/backoffice/extension-api'; @@ -11,7 +11,7 @@ import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; @customElement('umb-backoffice-main') export class UmbBackofficeMainElement extends UmbLitElement { @state() - private _routes: Array = []; + private _routes: Array = []; @state() private _sections: Array> = []; @@ -43,28 +43,41 @@ export class UmbBackofficeMainElement extends UmbLitElement { private _createRoutes() { if (!this._sections) return; - const oldValue = this._routes; // TODO: Refactor this for re-use across the app where the routes are re-generated at any time. - this._routes = this._sections + const newRoutes = this._sections .filter((x) => x.manifest) .map((section) => { - const existingRoute = this._routes.find((r) => r.alias === section.alias); + const existingRoute = this._routes.find( + (r) => r.path === UMB_SECTION_PATH_PATTERN.generateLocal({ sectionName: section.manifest!.meta.pathname }), + ); if (existingRoute) { return existingRoute; } else { return { - alias: section.alias, + //alias: section.alias, path: UMB_SECTION_PATH_PATTERN.generateLocal({ sectionName: section.manifest!.meta.pathname }), component: () => createExtensionElement(section.manifest!, 'umb-section-default'), - setup: (component) => { - (component as UmbSectionElement).manifest = section.manifest as ManifestSection; + setup: (component: PageComponent) => { + (component as UmbSectionElement).manifest = section.manifest; }, }; } }); - this.requestUpdate('_routes', oldValue); + if (newRoutes.length > 0) { + newRoutes.push({ + path: ``, + redirectTo: newRoutes[0].path, + }); + + newRoutes.push({ + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }); + } + + this._routes = newRoutes; } private _onRouteChange = async (event: UmbRouterSlotChangeEvent) => { diff --git a/src/Umbraco.Web.UI.Client/src/assets/lang/da-dk.ts b/src/Umbraco.Web.UI.Client/src/assets/lang/da-dk.ts index 6ab593af97..0a0ec7595d 100644 --- a/src/Umbraco.Web.UI.Client/src/assets/lang/da-dk.ts +++ b/src/Umbraco.Web.UI.Client/src/assets/lang/da-dk.ts @@ -2521,4 +2521,8 @@ export default { detailedLevelDescription: '\n We will send:\n
    \n
  • Anonymized site ID, Umbraco version, and packages installed.
  • \n
  • Number of: Root nodes, Content nodes, Media, Document Types, Templates, Languages, Domains, User Group, Users, Members, Backoffice external login providers, and Property Editors in use.
  • \n
  • System information: Webserver, server OS, server framework, server OS language, and database provider.
  • \n
  • Configuration settings: Modelsbuilder mode, if custom Umbraco path exists, ASP environment, whether the delivery API is enabled, and allows public access, and if you are in debug mode.
  • \n
\n We might change what we send on the Detailed level in the future. If so, it will be listed above.\n
By choosing "Detailed" you agree to current and future anonymized information being collected.
\n ', }, + routing: { + routeNotFoundTitle: 'Ikke fundet', + routeNotFoundDescription: 'Den side du leder efter kunne ikke findes. Kontroller adressen og prøv igen.', + }, } as UmbLocalizationDictionary; diff --git a/src/Umbraco.Web.UI.Client/src/assets/lang/en-us.ts b/src/Umbraco.Web.UI.Client/src/assets/lang/en-us.ts index 05eb1f3739..020b2f5683 100644 --- a/src/Umbraco.Web.UI.Client/src/assets/lang/en-us.ts +++ b/src/Umbraco.Web.UI.Client/src/assets/lang/en-us.ts @@ -2522,4 +2522,8 @@ export default { detailedLevelDescription: '\n We will send:\n
    \n
  • Anonymized site ID, Umbraco version, and packages installed.
  • \n
  • Number of: Root nodes, Content nodes, Media, Document Types, Templates, Languages, Domains, User Group, Users, Members, Backoffice external login providers, and Property Editors in use.
  • \n
  • System information: Webserver, server OS, server framework, server OS language, and database provider.
  • \n
  • Configuration settings: Modelsbuilder mode, if custom Umbraco path exists, ASP environment, whether the delivery API is enabled, and allows public access, and if you are in debug mode.
  • \n
\n We might change what we send on the Detailed level in the future. If so, it will be listed above.\n
By choosing "Detailed" you agree to current and future anonymized information being collected.
\n ', }, + routing: { + routeNotFoundTitle: 'Not found', + routeNotFoundDescription: 'The requested route could not be found. Please check the URL and try again.', + }, } as UmbLocalizationDictionary; diff --git a/src/Umbraco.Web.UI.Client/src/assets/lang/en.ts b/src/Umbraco.Web.UI.Client/src/assets/lang/en.ts index 089b563372..52d3d86a1a 100644 --- a/src/Umbraco.Web.UI.Client/src/assets/lang/en.ts +++ b/src/Umbraco.Web.UI.Client/src/assets/lang/en.ts @@ -2591,4 +2591,8 @@ export default { detailedLevelDescription: 'We will send:\n
    \n
  • Anonymized site ID, Umbraco version, and packages installed.
  • \n
  • Number of: Root nodes, Content nodes, Macros, Media, Document Types, Templates, Languages, Domains, User Group, Users, Members, Backoffice external login providers, and Property Editors in use.
  • \n
  • System information: Webserver, server OS, server framework, server OS language, and database provider.
  • \n
  • Configuration settings: Modelsbuilder mode, if custom Umbraco path exists, ASP environment, whether the delivery API is enabled, and allows public access, and if you are in debug mode.
  • \n
\nWe might change what we send on the Detailed level in the future. If so, it will be listed above.\n
By choosing "Detailed" you agree to current and future anonymized information being collected.
', }, + routing: { + routeNotFoundTitle: 'Not found', + routeNotFoundDescription: 'The requested route could not be found. Please check the URL and try again.', + }, } as UmbLocalizationDictionary; diff --git a/src/Umbraco.Web.UI.Client/src/external/router-slot/router-slot.ts b/src/Umbraco.Web.UI.Client/src/external/router-slot/router-slot.ts index 6f8e91af83..1a2bec962f 100644 --- a/src/Umbraco.Web.UI.Client/src/external/router-slot/router-slot.ts +++ b/src/Umbraco.Web.UI.Client/src/external/router-slot/router-slot.ts @@ -45,6 +45,11 @@ ensureAnchorHistory(); * @event changestate - Dispatched when the router slot state changes. */ export class RouterSlot extends HTMLElement implements IRouterSlot { + /** + * Method to cancel navigation if changed. + */ + private _cancelNavigation ?:() => void; + /** * Listeners on the router. */ @@ -197,8 +202,17 @@ export class RouterSlot extends HTMLElement implements IRouter this._routes.push(...routes); if (navigate === undefined) { - // If navigate is not determined, then we will check if we have a route match. If not then we will re-render. + // If navigate is not determined, then we will check if we have a route match. If not then we will re-render. [NL] navigate = this._routeMatch === null; + if (navigate === false) { + if (this.isConnected) { + const newMatch = this.getRouteMatch(); + // Check if this match matches the current match (aka. If the path has changed), if so we should navigate. [NL] + if(newMatch) { + navigate = shouldNavigate(this.match, newMatch); + } + } + } } // Navigate fallback: @@ -232,13 +246,21 @@ export class RouterSlot extends HTMLElement implements IRouter // Either choose the parent fragment or the current path if no parent exists. // The root router slot will always use the entire path. - const pathFragment = - this.parent != null && this.parent.fragments != null ? this.parent.fragments.rest : pathWithoutBasePath(); + const pathFragment = this.getPathFragment(); // Route to the path await this.renderPath(pathFragment); } + protected getPathFragment() { + return this.parent != null && this.parent.fragments != null ? this.parent.fragments.rest : pathWithoutBasePath(); + } + + protected getRouteMatch() { + // Find the corresponding route. + return matchRoutes(this._routes, this.getPathFragment()); + } + /** * Attaches listeners, either globally or on the parent router. */ @@ -296,6 +318,8 @@ export class RouterSlot extends HTMLElement implements IRouter * Returns true if a navigation was made to a new page. */ protected async renderPath(path: string | PathFragment): Promise { + + // Notice: Since this is never called from any other place than one higher in this file(when writing this...), we could just retrieve the path and find a match by using this.getRouteMatch() [NL] // Find the corresponding route. const match = matchRoutes(this._routes, path); @@ -312,10 +336,17 @@ export class RouterSlot extends HTMLElement implements IRouter // Only change route if its a new route. const navigate = shouldNavigate(this.match, match); if (navigate) { + + // If another navigation is still begin resolved in this very moment, then we need to cancel that so it does not end up overriding this new navigation.[NL] + this._cancelNavigation?.(); // Listen for another push state event. If another push state event happens // while we are about to navigate we have to cancel. let navigationInvalidated = false; - const cancelNavigation = () => (navigationInvalidated = true); + const cancelNavigation = () => { + navigationInvalidated = true; + this._cancelNavigation = undefined; + }; + this._cancelNavigation = cancelNavigation; const removeChangeListener: EventListenerSubscription = addListener( GLOBAL_ROUTER_EVENTS_TARGET, 'changestate', @@ -378,16 +409,23 @@ export class RouterSlot extends HTMLElement implements IRouter return cancel(); } - // Remove the old page by clearing the slot - this.clearChildren(); + // We have some routes that share the same component instance, those should not be removed and re-appended [NL] + const isTheSameComponent = this.firstChild === page; + + if(!isTheSameComponent) { + // Remove the old page by clearing the slot + this.clearChildren(); + } // Store the new route match before we append the new page to the DOM. // We do this to ensure that we can find the match in the connectedCallback of the page. this._routeMatch = match; - if (page) { - // Append the new page - this.appendChild(page); + if(!isTheSameComponent) { + if (page) { + // Append the new page + this.appendChild(page); + } } } diff --git a/src/Umbraco.Web.UI.Client/src/libs/extension-api/controller/base-extension-initializer.controller.ts b/src/Umbraco.Web.UI.Client/src/libs/extension-api/controller/base-extension-initializer.controller.ts index 07443ad840..be3570a7ba 100644 --- a/src/Umbraco.Web.UI.Client/src/libs/extension-api/controller/base-extension-initializer.controller.ts +++ b/src/Umbraco.Web.UI.Client/src/libs/extension-api/controller/base-extension-initializer.controller.ts @@ -211,6 +211,7 @@ export abstract class UmbBaseExtensionInitializer< // Check if we already have a controller for this config: const existing = this.#conditionControllers.find((controller) => controller.config === conditionConfig); if (!existing) { + // TODO: Be aware that we might not have a host element any longer at this moment, but I did not want to make a fix for it jet, as its a good indication to if something else is terrible wrong [NL] const conditionController = await createExtensionApi(this, conditionManifest, [ { manifest: conditionManifest, diff --git a/src/Umbraco.Web.UI.Client/src/libs/observable-api/observer.ts b/src/Umbraco.Web.UI.Client/src/libs/observable-api/observer.ts index 8f32bf88d9..d41d1aaae0 100644 --- a/src/Umbraco.Web.UI.Client/src/libs/observable-api/observer.ts +++ b/src/Umbraco.Web.UI.Client/src/libs/observable-api/observer.ts @@ -5,12 +5,13 @@ export type ObserverCallback = (value: T) => void; export class UmbObserver { #source!: Observable; - #callback!: ObserverCallback; + #callback?: ObserverCallback; #subscription!: Subscription; constructor(source: Observable, callback?: ObserverCallback) { this.#source = source; if (callback) { + this.#callback = callback; this.#subscription = source.subscribe(callback); } } @@ -44,7 +45,7 @@ export class UmbObserver { hostConnected() { // Notice: This will not re-subscribe if this controller was destroyed. Only if the subscription was closed. - if (this.#subscription?.closed) { + if (this.#subscription?.closed && this.#callback) { this.#subscription = this.#source.subscribe(this.#callback); } } diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/components/block-grid-areas-container/block-grid-areas-container.element.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/components/block-grid-areas-container/block-grid-areas-container.element.ts index 567c471be8..17e2187888 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/components/block-grid-areas-container/block-grid-areas-container.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/components/block-grid-areas-container/block-grid-areas-container.element.ts @@ -1,7 +1,7 @@ import { UMB_BLOCK_GRID_MANAGER_CONTEXT } from '../../context/block-grid-manager.context-token.js'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; -import { UMB_BLOCK_GRID_ENTRY_CONTEXT, type UmbBlockGridTypeAreaType } from '@umbraco-cms/backoffice/block-grid'; import { css, customElement, html, repeat, state } from '@umbraco-cms/backoffice/external/lit'; +import { UMB_BLOCK_GRID_ENTRY_CONTEXT, type UmbBlockGridTypeAreaType } from '@umbraco-cms/backoffice/block-grid'; import '../block-grid-entries/index.js'; /** diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/context/block-grid-entry.context.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/context/block-grid-entry.context.ts index e22d99612a..f072e4f164 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/context/block-grid-entry.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/context/block-grid-entry.context.ts @@ -5,10 +5,6 @@ import { type UmbBlockGridScalableContext, UmbBlockGridScaleManager, } from './block-grid-scale-manager/block-grid-scale-manager.controller.js'; -import { UmbBlockEntryContext } from '@umbraco-cms/backoffice/block'; -import type { UmbContentTypeModel, UmbPropertyTypeModel } from '@umbraco-cms/backoffice/content-type'; -import type { UmbBlockGridTypeModel, UmbBlockGridLayoutModel } from '@umbraco-cms/backoffice/block-grid'; -import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbArrayState, UmbBooleanState, @@ -17,6 +13,10 @@ import { appendToFrozenArray, observeMultiple, } from '@umbraco-cms/backoffice/observable-api'; +import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; +import type { UmbContentTypeModel, UmbPropertyTypeModel } from '@umbraco-cms/backoffice/content-type'; +import { UmbBlockEntryContext } from '@umbraco-cms/backoffice/block'; +import type { UmbBlockGridTypeModel, UmbBlockGridLayoutModel } from '@umbraco-cms/backoffice/block-grid'; export class UmbBlockGridEntryContext extends UmbBlockEntryContext< diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/property-editors/block-grid-areas-config/property-editor-ui-block-grid-areas-config.element.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/property-editors/block-grid-areas-config/property-editor-ui-block-grid-areas-config.element.ts index 64b8879589..3f102682ed 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/property-editors/block-grid-areas-config/property-editor-ui-block-grid-areas-config.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block-grid/property-editors/block-grid-areas-config/property-editor-ui-block-grid-areas-config.element.ts @@ -1,6 +1,6 @@ -import type { UmbBlockGridTypeAreaType } from '../../index.js'; -import { UMB_BLOCK_GRID_DEFAULT_LAYOUT_STYLESHEET } from '../../context/block-grid-manager.context.js'; import { UMB_BLOCK_GRID_AREA_TYPE_WORKSPACE_MODAL } from '../../components/block-grid-area-config-entry/index.js'; +import { UMB_BLOCK_GRID_DEFAULT_LAYOUT_STYLESHEET } from '../../context/block-grid-manager.context.js'; +import type { UmbBlockGridTypeAreaType } from '../../index.js'; import { UmbBlockGridAreaTypeEntriesContext } from './block-grid-area-type-entries.context.js'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; import { html, customElement, property, state, repeat } from '@umbraco-cms/backoffice/external/lit'; @@ -127,7 +127,6 @@ export class UmbPropertyEditorUIBlockGridAreasConfigElement //TODO: open area edit workspace } - // TODO: Needs localizations: override render() { return this._areaGridColumns ? html`${this._styleElement} diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block-list/property-editors/block-list-editor/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block-list/property-editors/block-list-editor/manifests.ts index bbb50aafbc..c3d07105cc 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block-list/property-editors/block-list-editor/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block-list/property-editors/block-list-editor/manifests.ts @@ -1,5 +1,5 @@ -import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; import { manifest as blockListSchemaManifest } from './Umbraco.BlockList.js'; +import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; export const UMB_BLOCK_LIST_PROPERTY_EDITOR_ALIAS = 'Umbraco.BlockList'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block-type/workspace/block-type-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block-type/workspace/block-type-workspace.context.ts index 6fc9ab947f..cbfba97bfc 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block-type/workspace/block-type-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block-type/workspace/block-type-workspace.context.ts @@ -27,7 +27,7 @@ export class UmbBlockTypeWorkspaceContext 'block'); + readonly name = this.#data.asObservablePart(() => 'block'); readonly unique = this.#data.asObservablePart((data) => data?.contentElementTypeKey); #properties = new UmbArrayState([], (x) => x.alias); diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/manifests.ts index 8789293ab5..5a2c47ed35 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/manifests.ts @@ -24,7 +24,7 @@ export const manifests: Array = [ { type: 'workspace', kind: 'routable', - name: 'Block List Type Workspace', + name: 'Block Workspace', alias: UMB_BLOCK_WORKSPACE_ALIAS, api: () => import('./block-workspace.context.js'), meta: { @@ -61,7 +61,7 @@ export const manifests: Array = [ alias: 'Umb.WorkspaceView.Block.Settings', name: 'Block Workspace Settings View', js: () => import('./views/edit/block-workspace-view-edit.element.js'), - weight: 1000, + weight: 900, meta: { label: '#general_settings', pathname: 'settings', diff --git a/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/views/edit/block-workspace-view-edit.element.ts b/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/views/edit/block-workspace-view-edit.element.ts index 609ba7cab9..1677f4ba5b 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/views/edit/block-workspace-view-edit.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/block/block/workspace/views/edit/block-workspace-view-edit.element.ts @@ -116,6 +116,10 @@ export class UmbBlockWorkspaceViewEditElement extends UmbLitElement implements U path: '', redirectTo: routes[0]?.path, }); + routes.push({ + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }); } this._routes = routes; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/collection/collection-view.manager.ts b/src/Umbraco.Web.UI.Client/src/packages/core/collection/collection-view.manager.ts index 7fc6f58e72..7d380142c3 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/collection/collection-view.manager.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/collection/collection-view.manager.ts @@ -98,6 +98,11 @@ export class UmbCollectionViewManager extends UmbControllerBase { }); } + routes.push({ + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }); + this.#routes.setValue(routes); } } diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/components/table/table.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/components/table/table.element.ts index 279c064ffe..cb2b5cbba9 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/components/table/table.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/components/table/table.element.ts @@ -1,3 +1,4 @@ +import type { UmbUfmRenderElement } from '../../../ufm/components/ufm-render/index.js'; import { css, customElement, @@ -9,7 +10,6 @@ import { when, LitElement, } from '@umbraco-cms/backoffice/external/lit'; -import type { UmbUfmRenderElement } from '../../../ufm/components/ufm-render/index.js'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; // TODO: move to UI Library - entity actions should NOT be moved to UI Library but stay in an UmbTable element diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/content-type/workspace/views/design/content-type-design-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/content-type/workspace/views/design/content-type-design-editor.element.ts index 5870d71547..109077161d 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/content-type/workspace/views/design/content-type-design-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/content-type/workspace/views/design/content-type-design-editor.element.ts @@ -207,7 +207,14 @@ export class UmbContentTypeDesignEditorElement extends UmbLitElement implements redirectTo: routes[0]?.path, guards: [() => this._activeTabId === undefined], }); - // TODO: Look at this case. + } + + if (routes.length !== 0) { + routes.push({ + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + guards: [() => this._activeTabId === undefined], + }); } // If we have an active tab name, then we might have a active tab name re-name, then we will redirect to the new name if it has been changed: [NL] @@ -226,6 +233,11 @@ export class UmbContentTypeDesignEditorElement extends UmbLitElement implements } } + routes.push({ + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }); + this._routes = routes; } diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/content/workspace/views/edit/content-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/content/workspace/views/edit/content-editor.element.ts index d13e1ac804..f37657e16d 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/content/workspace/views/edit/content-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/content/workspace/views/edit/content-editor.element.ts @@ -106,14 +106,13 @@ export class UmbContentWorkspaceViewEditElement extends UmbLitElement implements path: '', redirectTo: routes[0]?.path, }); + + routes.push({ + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }); } - // Find the routes who are removed: - //const removedRoutes = this._routes.filter((route) => !routes.find((r) => r.path === route.path)); - - // Find the routes who are new: - //const newRoutes = routes.filter((route) => !this._routes.find((r) => r.path === route.path)); - this._routes = routes; } diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icon-dictionary.json b/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icon-dictionary.json index c9667aae86..e6e06752d4 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icon-dictionary.json +++ b/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icon-dictionary.json @@ -2451,10 +2451,6 @@ } ], "simpleIcons": [ - { - "name": "icon-azure", - "file": "microsoftazure.svg" - }, { "name": "icon-facebook", "file": "facebook.svg" @@ -2483,10 +2479,6 @@ "name": "icon-mastodon", "file": "mastodon.svg" }, - { - "name": "icon-microsoft", - "file": "microsoft.svg" - }, { "name": "icon-twitter-x", "file": "x.svg" diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icons.ts b/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icons.ts index a6f123db8a..8f0b5beb5f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icons.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icons.ts @@ -2099,10 +2099,6 @@ name: "icon-database", path: () => import("./icons/icon-database.js"), },{ -name: "icon-azure", - -path: () => import("./icons/icon-azure.js"), -},{ name: "icon-facebook", path: () => import("./icons/icon-facebook.js"), @@ -2131,10 +2127,6 @@ name: "icon-mastodon", path: () => import("./icons/icon-mastodon.js"), },{ -name: "icon-microsoft", - -path: () => import("./icons/icon-microsoft.js"), -},{ name: "icon-twitter-x", path: () => import("./icons/icon-twitter-x.js"), @@ -2155,6 +2147,10 @@ name: "icon-auction-hammer", legacy: true, path: () => import("./icons/icon-auction-hammer.js"), },{ +name: "icon-azure", +legacy: true, +path: () => import("./icons/icon-azure.js"), +},{ name: "icon-baby-stroller", legacy: true, path: () => import("./icons/icon-baby-stroller.js"), @@ -2351,6 +2347,10 @@ name: "icon-male-symbol", legacy: true, path: () => import("./icons/icon-male-symbol.js"), },{ +name: "icon-microsoft", +legacy: true, +path: () => import("./icons/icon-microsoft.js"), +},{ name: "icon-molecular-network", legacy: true, path: () => import("./icons/icon-molecular-network.js"), diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icons/icon-azure.ts b/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icons/icon-azure.ts index c12ff1b97a..812b7e83ee 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icons/icon-azure.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icons/icon-azure.ts @@ -1 +1,6 @@ -export default `Microsoft Azure`; \ No newline at end of file +export default ` + Microsoft Azure + + +`; \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icons/icon-microsoft.ts b/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icons/icon-microsoft.ts index 48d6ba0e9a..61caa12b42 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icons/icon-microsoft.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/icons/icon-microsoft.ts @@ -1 +1,6 @@ -export default `Microsoft`; \ No newline at end of file +export default ` + Microsoft + + +`; \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/svgs/icon-azure.svg b/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/svgs/icon-azure.svg new file mode 100644 index 0000000000..a42782c0bb --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/svgs/icon-azure.svg @@ -0,0 +1,5 @@ + + Microsoft Azure + + diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/svgs/icon-microsoft.svg b/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/svgs/icon-microsoft.svg new file mode 100644 index 0000000000..aceab2c2d7 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/icon-registry/svgs/icon-microsoft.svg @@ -0,0 +1,5 @@ + + Microsoft + + diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/property/property/property.context.ts b/src/Umbraco.Web.UI.Client/src/packages/core/property/property/property.context.ts index 433cc5c813..9d1ea7be5d 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/property/property/property.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/property/property/property.context.ts @@ -1,5 +1,4 @@ import { UMB_PROPERTY_DATASET_CONTEXT } from '../property-dataset/index.js'; -import type { UmbVariantId } from '@umbraco-cms/backoffice/variant'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbContextBase } from '@umbraco-cms/backoffice/class-api'; import { @@ -11,6 +10,7 @@ import { UmbStringState, } from '@umbraco-cms/backoffice/observable-api'; import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; +import type { UmbVariantId } from '@umbraco-cms/backoffice/variant'; import type { UmbPropertyEditorConfigProperty } from '@umbraco-cms/backoffice/property-editor'; import { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor'; import type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/extension-registry'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/router/components/not-found/route-not-found.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/router/components/not-found/route-not-found.element.ts new file mode 100644 index 0000000000..091b0d1473 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/core/router/components/not-found/route-not-found.element.ts @@ -0,0 +1,55 @@ +import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; +import { css, html, customElement } from '@umbraco-cms/backoffice/external/lit'; +import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; + +/** + * A fallback view to be used in Workspace Views, maybe this can be upgraded at a later point. + */ +// TODO: Rename and move this file to a more generic place. +@customElement('umb-route-not-found') +export class UmbRouteNotFoundElement extends UmbLitElement { + override render() { + return html` +
+

+ +
+ `; + } + + static override styles = [ + UmbTextStyles, + css` + :host { + display: block; + width: 100%; + height: 100%; + min-width: 0; + } + + :host > div { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + height: 100%; + opacity: 0; + animation: fadeIn 4s 0.2s forwards; + } + + @keyframes fadeIn { + 100% { + opacity: 100%; + } + } + `, + ]; +} + +export default UmbRouteNotFoundElement; + +declare global { + interface HTMLElementTagNameMap { + 'umb-route-not-found': UmbRouteNotFoundElement; + } +} diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/router/index.ts b/src/Umbraco.Web.UI.Client/src/packages/core/router/index.ts index fc2663470f..387eb72b4e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/router/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/router/index.ts @@ -9,3 +9,4 @@ export * from './path-pattern.class.js'; export * from './modal-registration/modal-route-registration.interface.js'; export * from './modal-registration/modal-route-registration.controller.js'; export * from './types.js'; +export * from './components/not-found/route-not-found.element.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/router/router-slot.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/router/router-slot.element.ts index 019d1324f0..ae9f336236 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/router/router-slot.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/router/router-slot.element.ts @@ -28,7 +28,8 @@ export class UmbRouterSlotElement extends UmbLitElement { value ??= []; const oldValue = this.#router.routes; if ( - value.filter((route) => (oldValue ? oldValue.findIndex((r) => r.path === route.path) === -1 : true)).length > 0 + value.length !== oldValue?.length || + value.filter((route) => oldValue?.findIndex((r) => r.path === route.path) === -1).length > 0 ) { this.#router.routes = value; } diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/section/section-default.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/section/section-default.element.ts index 7a842e0cc1..863afb248f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/section/section-default.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/section/section-default.element.ts @@ -13,12 +13,12 @@ import type { IRoute, IRoutingInfo, PageComponent, UmbRoute } from '@umbraco-cms import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; import type { UmbExtensionElementInitializer } from '@umbraco-cms/backoffice/extension-api'; import { - UmbExtensionsApiInitializer, UmbExtensionsElementInitializer, UmbExtensionsManifestInitializer, createExtensionApi, + createExtensionElement, } from '@umbraco-cms/backoffice/extension-api'; -import { aliasToPath, debounce } from '@umbraco-cms/backoffice/utils'; +import { aliasToPath } from '@umbraco-cms/backoffice/utils'; /** * @export @@ -90,11 +90,7 @@ export class UmbSectionDefaultElement extends UmbLitElement implements UmbSectio api?.getPath?.() || extensionController.manifest.meta?.path || aliasToPath(extensionController.manifest.alias), - // TODO: look into removing the "as PageComponent" type hack - // be aware that this is kind of a hack to pass the manifest element to the router. But as the two resolve components - // in a similar way. I currently find it more safe to let the router do the component resolving instead - // of replicating it as a custom resolver here. - component: extensionController.manifest.element as PageComponent | PromiseLike, + component: () => createExtensionElement(extensionController.manifest), setup: (element: PageComponent, info: IRoutingInfo) => { api?.setup?.(element, info); }, @@ -102,14 +98,12 @@ export class UmbSectionDefaultElement extends UmbLitElement implements UmbSectio }), ); - this.#debouncedCreateRoutes(routes); + this.#createRoutes(routes); }, 'umbRouteExtensionApisInitializer', ); } - #debouncedCreateRoutes = debounce(this.#createRoutes, 50); - #createRoutes(routes: Array) { this._routes = [ ...routes, diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/section/section-main-views/section-main-views.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/section/section-main-views/section-main-views.element.ts index d8b7f49b4e..c7ad6fc056 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/section/section-main-views/section-main-views.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/section/section-main-views/section-main-views.element.ts @@ -79,7 +79,15 @@ export class UmbSectionMainViewElement extends UmbLitElement { }); const routes = [...dashboardRoutes, ...viewRoutes]; - this._routes = routes?.length > 0 ? [...routes, { path: '', redirectTo: routes?.[0]?.path }] : []; + if (routes.length > 0) { + routes.push({ path: '', redirectTo: routes?.[0]?.path }); + + routes.push({ + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }); + } + this._routes = routes; } override render() { diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-editor/workspace-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-editor/workspace-editor.element.ts index cd43be73f3..3a8195caf2 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-editor/workspace-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-editor/workspace-editor.element.ts @@ -71,15 +71,13 @@ export class UmbWorkspaceEditorElement extends UmbLitElement { } as UmbRoute; }); - // If we have a post fix then we need to add a direct from the empty url of the split-view-index: - // TODO: This is problematic, cause if a workspaceView appears later, then this takes over. And it is also a problem if it does not use redirect, but just a view defined with and empty path. - const firstRoute = newRoutes[0]; - if (firstRoute) { - newRoutes.push({ - path: ``, - redirectTo: firstRoute.path, - }); - } + // Duplicate first workspace and use it for the empty path scenario. [NL] + newRoutes.push({ ...newRoutes[0], path: '' }); + + newRoutes.push({ + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }); } this._routes = newRoutes; @@ -115,15 +113,18 @@ export class UmbWorkspaceEditorElement extends UmbLitElement { ${repeat( this._workspaceViews, (view) => view.alias, - (view) => html` - - - ${view.meta.label ? this.localize.string(view.meta.label) : view.name} - - `, + (view, index) => + // Notice how we use index 0 to determine which workspace that is active with empty path. [NL] + html` + + + ${view.meta.label ? this.localize.string(view.meta.label) : view.name} + + `, )} ` diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view-variant-selector.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view-variant-selector.element.ts index 96097c23a8..2fd9078243 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view-variant-selector.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view-variant-selector.element.ts @@ -1,17 +1,17 @@ import type { ActiveVariant } from '../../controllers/index.js'; import { UMB_WORKSPACE_SPLIT_VIEW_CONTEXT } from './workspace-split-view.context.js'; -import { UmbVariantId } from '@umbraco-cms/backoffice/variant'; -import { UMB_PROPERTY_DATASET_CONTEXT, isNameablePropertyDatasetContext } from '@umbraco-cms/backoffice/property'; import { type UUIInputElement, UUIInputEvent, type UUIPopoverContainerElement, } from '@umbraco-cms/backoffice/external/uui'; import { css, html, nothing, customElement, state, query } from '@umbraco-cms/backoffice/external/lit'; -import { UmbLitElement, umbFocus } from '@umbraco-cms/backoffice/lit-element'; import { DocumentVariantStateModel } from '@umbraco-cms/backoffice/external/backend-api'; -import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; import type { UmbDocumentWorkspaceContext } from '@umbraco-cms/backoffice/document'; +import { UmbVariantId } from '@umbraco-cms/backoffice/variant'; +import { UMB_PROPERTY_DATASET_CONTEXT, isNameablePropertyDatasetContext } from '@umbraco-cms/backoffice/property'; +import { UmbLitElement, umbFocus } from '@umbraco-cms/backoffice/lit-element'; +import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; type UmbDocumentVariantOption = { culture: string | null; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view.context.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view.context.ts index 73c074a102..1672a2f81b 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view.context.ts @@ -1,9 +1,9 @@ import { UMB_VARIANT_WORKSPACE_CONTEXT } from '../../contexts/index.js'; -import { UmbVariantId } from '@umbraco-cms/backoffice/variant'; import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbContextBase } from '@umbraco-cms/backoffice/class-api'; import { UmbNumberState } from '@umbraco-cms/backoffice/observable-api'; +import { UmbVariantId } from '@umbraco-cms/backoffice/variant'; import type { UmbPropertyDatasetContext } from '@umbraco-cms/backoffice/property'; export class UmbWorkspaceSplitViewContext extends UmbContextBase { diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view.element.ts index 78ae74b82b..0c3209b02b 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/components/workspace-split-view/workspace-split-view.element.ts @@ -1,6 +1,6 @@ import { UmbWorkspaceSplitViewContext } from './workspace-split-view.context.js'; -import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; import { css, html, customElement, property, ifDefined } from '@umbraco-cms/backoffice/external/lit'; +import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; // import local components diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/controllers/workspace-route-manager.controller.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/controllers/workspace-route-manager.controller.ts index 6fedc8a00e..44eb95bdfb 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/controllers/workspace-route-manager.controller.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/controllers/workspace-route-manager.controller.ts @@ -8,6 +8,12 @@ export class UmbWorkspaceRouteManager extends UmbControllerBase { public readonly routes = this.#routes.asObservable(); setRoutes(routes: Array) { - this.#routes.setValue(routes); + this.#routes.setValue([ + ...routes, + { + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }, + ]); } } diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/controllers/workspace-split-view-manager.controller.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/controllers/workspace-split-view-manager.controller.ts index 63bbf04d0a..47ac07b29f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/controllers/workspace-split-view-manager.controller.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/controllers/workspace-split-view-manager.controller.ts @@ -1,5 +1,5 @@ -import { UmbVariantId } from '@umbraco-cms/backoffice/variant'; import { UmbArrayState } from '@umbraco-cms/backoffice/observable-api'; +import { UmbVariantId } from '@umbraco-cms/backoffice/variant'; export type ActiveVariant = { index: number; @@ -13,7 +13,9 @@ export type ActiveVariant = { * @description - Class managing the split view state for a workspace context. */ export class UmbWorkspaceSplitViewManager { - #activeVariantsInfo = new UmbArrayState([], (x) => x.index); + #activeVariantsInfo = new UmbArrayState([], (x) => x.index).sortBy( + (a, b) => (a.index || 0) - (b.index || 0), + ); public readonly activeVariantsInfo = this.#activeVariantsInfo.asObservable(); private _routeBase?: string; @@ -25,7 +27,7 @@ export class UmbWorkspaceSplitViewManager { } setActiveVariant(index: number, culture: string | null, segment: string | null) { - this.#activeVariantsInfo.appendOne({ index, culture: culture || null, segment: segment || null }); + this.#activeVariantsInfo.appendOneAt({ index, culture: culture ?? null, segment: segment ?? null }, index); } getActiveVariants() { @@ -39,7 +41,7 @@ export class UmbWorkspaceSplitViewManager { } public activeVariantByIndex(index: number) { - return this.#activeVariantsInfo.asObservablePart((data) => data[index] || undefined); + return this.#activeVariantsInfo.asObservablePart((data) => data.find((x) => x.index === index) || undefined); } public switchVariant(index: number, variantId: UmbVariantId) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/kinds/editable/editable-workspace.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/kinds/editable/editable-workspace.element.ts deleted file mode 100644 index 66b74b929d..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/kinds/editable/editable-workspace.element.ts +++ /dev/null @@ -1,38 +0,0 @@ -import type { UmbSubmittableWorkspaceContext } from '../../contexts/tokens/submittable-workspace-context.interface.js'; -import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry'; -import { html, customElement, state, css } from '@umbraco-cms/backoffice/external/lit'; -import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; -import type { UmbRoute } from '@umbraco-cms/backoffice/router'; -import { UmbExtensionsApiInitializer } from '@umbraco-cms/backoffice/extension-api'; - -@customElement('umb-editable-workspace') -export class UmbEditableWorkspaceElement extends UmbLitElement { - @state() - _routes: UmbRoute[] = []; - - public set api(api: UmbSubmittableWorkspaceContext) { - this.observe(api.routes.routes, (routes) => (this._routes = routes)); - - new UmbExtensionsApiInitializer(this, umbExtensionsRegistry, 'workspaceContext', [api]); - } - - override render() { - return html` `; - } - - static override styles = [ - css` - form { - display: contents; - } - `, - ]; -} - -export default UmbEditableWorkspaceElement; - -declare global { - interface HTMLElementTagNameMap { - 'umb-editable-workspace': UmbEditableWorkspaceElement; - } -} diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/kinds/editable/editable-workspace.kind.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/kinds/editable/editable-workspace.kind.ts deleted file mode 100644 index 81ddb39fda..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/kinds/editable/editable-workspace.kind.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry'; - -export const manifest: UmbBackofficeManifestKind = { - type: 'kind', - alias: 'Umb.Kind.Workspace.Editable', - matchKind: 'editable', - matchType: 'workspace', - manifest: { - type: 'workspace', - kind: 'editable', - element: () => import('./editable-workspace.element.js'), - }, -}; diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/kinds/editable/editable-workspace.test.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/kinds/editable/editable-workspace.test.ts deleted file mode 100644 index e73403c457..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/kinds/editable/editable-workspace.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { UmbEditableWorkspaceElement } from './editable-workspace.element.js'; -import { expect, fixture, html } from '@open-wc/testing'; -import { type UmbTestRunnerWindow, defaultA11yConfig } from '@umbraco-cms/internal/test-utils'; - -describe('UmbEditableWorkspaceElement', () => { - let element: UmbEditableWorkspaceElement; - - beforeEach(async () => { - element = await fixture(html``); - }); - - it('is defined with its own instance', () => { - expect(element).to.be.instanceOf(UmbEditableWorkspaceElement); - }); - - if ((window as UmbTestRunnerWindow).__UMBRACO_TEST_RUN_A11Y_TEST) { - it('passes the a11y audit', async () => { - // TODO: should we use shadowDom here? - await expect(element).to.be.accessible(defaultA11yConfig); - }); - } -}); diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/kinds/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/kinds/manifests.ts index f36f36118d..380b26b726 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/workspace/kinds/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/workspace/kinds/manifests.ts @@ -1,5 +1,4 @@ -import { manifest as editableKindManifest } from './editable/editable-workspace.kind.js'; import { manifest as routableKindManifest } from './routable/routable-workspace.kind.js'; import type { ManifestTypes, UmbBackofficeManifestKind } from '@umbraco-cms/backoffice/extension-registry'; -export const manifests: Array = [routableKindManifest, editableKindManifest]; +export const manifests: Array = [routableKindManifest]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/data-type/workspace/data-type-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/data-type/workspace/data-type-workspace.context.ts index 4bf9c93fc6..b5182fd07e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/data-type/workspace/data-type-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/data-type/workspace/data-type-workspace.context.ts @@ -1,5 +1,5 @@ -import { UmbDataTypeDetailRepository } from '../repository/detail/data-type-detail.repository.js'; import type { UmbDataTypeDetailModel, UmbDataTypePropertyModel } from '../types.js'; +import { UmbDataTypeDetailRepository } from '../repository/detail/data-type-detail.repository.js'; import { UmbDataTypeWorkspaceEditorElement } from './data-type-workspace-editor.element.js'; import type { UmbPropertyDatasetContext } from '@umbraco-cms/backoffice/property'; import type { @@ -10,7 +10,6 @@ import { UmbSubmittableWorkspaceContextBase, UmbInvariantWorkspacePropertyDatasetContext, UmbWorkspaceIsNewRedirectController, - UmbWorkspaceRouteManager, } from '@umbraco-cms/backoffice/workspace'; import { appendToFrozenArray, @@ -29,7 +28,6 @@ import { UmbRequestReloadChildrenOfEntityEvent, UmbRequestReloadStructureForEntityEvent, } from '@umbraco-cms/backoffice/entity-action'; -import { UMB_PROPERTY_EDITOR_SCHEMA_ALIAS_DEFAULT } from '@umbraco-cms/backoffice/property-editor'; type EntityType = UmbDataTypeDetailModel; export class UmbDataTypeWorkspaceContext diff --git a/src/Umbraco.Web.UI.Client/src/packages/data-type/workspace/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/data-type/workspace/manifests.ts index d8887e858d..62232d9507 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/data-type/workspace/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/data-type/workspace/manifests.ts @@ -10,7 +10,7 @@ const DATA_TYPE_WORKSPACE_ALIAS = 'Umb.Workspace.DataType'; const workspace: ManifestWorkspaces = { type: 'workspace', - kind: 'editable', + kind: 'routable', alias: DATA_TYPE_WORKSPACE_ALIAS, name: 'Data Type Workspace', api: () => import('./data-type-workspace.context.js'), diff --git a/src/Umbraco.Web.UI.Client/src/packages/dictionary/workspace/dictionary-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/dictionary/workspace/dictionary-workspace.context.ts index d31e233c52..0445c105ae 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/dictionary/workspace/dictionary-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/dictionary/workspace/dictionary-workspace.context.ts @@ -1,10 +1,9 @@ -import { UmbDictionaryDetailRepository } from '../repository/index.js'; import type { UmbDictionaryDetailModel } from '../types.js'; +import { UmbDictionaryDetailRepository } from '../repository/index.js'; import { UmbDictionaryWorkspaceEditorElement } from './dictionary-workspace-editor.element.js'; import { type UmbSubmittableWorkspaceContext, UmbSubmittableWorkspaceContextBase, - UmbWorkspaceRouteManager, UmbWorkspaceIsNewRedirectController, type UmbRoutableWorkspaceContext, } from '@umbraco-cms/backoffice/workspace'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/document-blueprints/entity-actions/create/create.action.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/document-blueprints/entity-actions/create/create.action.ts index 25bdcb52dc..8f8e477785 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/document-blueprints/entity-actions/create/create.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/document-blueprints/entity-actions/create/create.action.ts @@ -1,11 +1,11 @@ -import { UMB_DOCUMENT_BLUEPRINT_ENTITY_TYPE } from '../../entity.js'; -import { UMB_DOCUMENT_BLUEPRINT_OPTIONS_CREATE_MODAL } from './modal/index.js'; import type { UmbEntityActionArgs } from '@umbraco-cms/backoffice/entity-action'; import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; +import { UMB_DOCUMENT_BLUEPRINT_ENTITY_TYPE } from '../../entity.js'; +import { UMB_DOCUMENT_BLUEPRINT_OPTIONS_CREATE_MODAL } from './modal/index.js'; -export class UmbCreateEntityAction extends UmbEntityActionBase { +export class UmbCreateDocumentBlueprintEntityAction extends UmbEntityActionBase { constructor(host: UmbControllerHost, args: UmbEntityActionArgs) { super(host, args); } @@ -31,4 +31,4 @@ export class UmbCreateEntityAction extends UmbEntityActionBase { } } -export default UmbCreateEntityAction; +export default UmbCreateDocumentBlueprintEntityAction; diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/document-blueprints/workspace/document-blueprint-workspace-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/document-blueprints/workspace/document-blueprint-workspace-editor.element.ts index d0cf8ed639..0f75fd2ac0 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/document-blueprints/workspace/document-blueprint-workspace-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/document-blueprints/workspace/document-blueprint-workspace-editor.element.ts @@ -1,6 +1,6 @@ import type { UmbDocumentBlueprintVariantOptionModel } from '../types.js'; -import { UmbDocumentBlueprintWorkspaceSplitViewElement } from './document-blueprint-workspace-split-view.element.js'; import { UMB_DOCUMENT_BLUEPRINT_WORKSPACE_CONTEXT } from './document-blueprint-workspace.context-token.js'; +import { UmbDocumentBlueprintWorkspaceSplitViewElement } from './document-blueprint-workspace-split-view.element.js'; import { customElement, state, css, html } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; @@ -83,17 +83,12 @@ export class UmbDocumentBlueprintWorkspaceEditorElement extends UmbLitElement { }); } - const oldValue = this._routes; + routes.push({ + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }); - // is there any differences in the amount ot the paths? [NL] - // TODO: if we make a memorization function as the observer, we can avoid this check and avoid the whole build of routes. [NL] - if (oldValue && oldValue.length === routes.length) { - // is there any differences in the paths? [NL] - const hasDifferences = oldValue.some((route, index) => route.path !== routes[index].path); - if (!hasDifferences) return; - } this._routes = routes; - this.requestUpdate('_routes', oldValue); } private _gotWorkspaceRoute = (e: UmbRouterSlotInitEvent) => { @@ -101,7 +96,7 @@ export class UmbDocumentBlueprintWorkspaceEditorElement extends UmbLitElement { }; override render() { - return this._routes && this._routes.length > 0 + return this._routes ? html`` : ''; } diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/workspace/document-type-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/workspace/document-type-workspace.context.ts index 723a64861e..a2eb3f1b9c 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/workspace/document-type-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/document-types/workspace/document-type-workspace.context.ts @@ -1,6 +1,3 @@ -import { UmbDocumentTypeDetailRepository } from '../repository/detail/document-type-detail.repository.js'; -import { UMB_DOCUMENT_TYPE_ENTITY_TYPE } from '../entity.js'; -import type { UmbDocumentTypeDetailModel } from '../types.js'; import { UMB_CREATE_DOCUMENT_TYPE_WORKSPACE_PATH_PATTERN, UMB_CREATE_DOCUMENT_TYPE_WORKSPACE_PRESET_ELEMENT, @@ -8,6 +5,9 @@ import { UMB_EDIT_DOCUMENT_TYPE_WORKSPACE_PATH_PATTERN, type UmbCreateDocumentTypeWorkspacePresetType, } from '../paths.js'; +import type { UmbDocumentTypeDetailModel } from '../types.js'; +import { UMB_DOCUMENT_TYPE_ENTITY_TYPE } from '../entity.js'; +import { UmbDocumentTypeDetailRepository } from '../repository/detail/document-type-detail.repository.js'; import { UmbDocumentTypeWorkspaceEditorElement } from './document-type-workspace-editor.element.js'; import { UmbContentTypeStructureManager } from '@umbraco-cms/backoffice/content-type'; import { UmbObjectState } from '@umbraco-cms/backoffice/observable-api'; @@ -18,7 +18,6 @@ import { import { UmbSubmittableWorkspaceContextBase, UmbWorkspaceIsNewRedirectController, - UmbWorkspaceRouteManager, } from '@umbraco-cms/backoffice/workspace'; import { UmbTemplateDetailRepository } from '@umbraco-cms/backoffice/template'; import { UMB_ACTION_EVENT_CONTEXT } from '@umbraco-cms/backoffice/action'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/tree/tree-item/document-tree-item.element.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/tree/tree-item/document-tree-item.element.ts index 3fae384c2f..3c5c94c536 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/tree/tree-item/document-tree-item.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/tree/tree-item/document-tree-item.element.ts @@ -1,9 +1,9 @@ +import type { UmbDocumentTreeItemModel, UmbDocumentTreeItemVariantModel } from '../types.js'; import { css, html, nothing, customElement, state, classMap } from '@umbraco-cms/backoffice/external/lit'; import type { UmbAppLanguageContext } from '@umbraco-cms/backoffice/language'; import { UMB_APP_LANGUAGE_CONTEXT } from '@umbraco-cms/backoffice/language'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; import { UmbTreeItemElementBase } from '@umbraco-cms/backoffice/tree'; -import type { UmbDocumentTreeItemModel, UmbDocumentTreeItemVariantModel } from '../types.js'; @customElement('umb-document-tree-item') export class UmbDocumentTreeItemElement extends UmbTreeItemElementBase { diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/workspace/document-workspace-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/workspace/document-workspace-editor.element.ts index 5252f6f369..0482a812a3 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/workspace/document-workspace-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/workspace/document-workspace-editor.element.ts @@ -101,7 +101,8 @@ export class UmbDocumentWorkspaceEditorElement extends UmbLitElement { const route = routes.find((route) => route.path === this.#appCulture); if (!route) { - history.pushState({}, '', `${this.#workspaceRoute}/${routes[routes.length - 2].path}`); + // TODO: Notice: here is a specific index used for fallback, this could be made more solid [NL] + history.pushState({}, '', `${this.#workspaceRoute}/${routes[routes.length - 3].path}`); return; } @@ -110,16 +111,12 @@ export class UmbDocumentWorkspaceEditorElement extends UmbLitElement { }); } - const oldValue = this._routes; + routes.push({ + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }); - // is there any differences in the amount ot the paths? [NL] - if (oldValue && oldValue.length === routes.length) { - // is there any differences in the paths? [NL] - const hasDifferences = oldValue.some((route, index) => route.path !== routes[index].path); - if (!hasDifferences) return; - } this._routes = routes; - this.requestUpdate('_routes', oldValue); } private _gotWorkspaceRoute = (e: UmbRouterSlotInitEvent) => { @@ -128,7 +125,7 @@ export class UmbDocumentWorkspaceEditorElement extends UmbLitElement { }; override render() { - return this._routes && this._routes.length > 0 + return this._routes ? html`` : ''; } diff --git a/src/Umbraco.Web.UI.Client/src/packages/health-check/dashboard-health-check.element.ts b/src/Umbraco.Web.UI.Client/src/packages/health-check/dashboard-health-check.element.ts index 8ddaf1166a..ffb79db0a0 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/health-check/dashboard-health-check.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/health-check/dashboard-health-check.element.ts @@ -25,6 +25,10 @@ export class UmbDashboardHealthCheckElement extends UmbLitElement { path: ``, component: () => import('./views/health-check-overview.element.js'), }, + { + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }, ]; private _healthCheckDashboardContext = new UmbHealthCheckDashboardContext(this); diff --git a/src/Umbraco.Web.UI.Client/src/packages/language/workspace/language/language-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/language/workspace/language/language-workspace.context.ts index 189056abe8..87d2816bd5 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/language/workspace/language/language-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/language/workspace/language/language-workspace.context.ts @@ -4,7 +4,6 @@ import { UmbLanguageWorkspaceEditorElement } from './language-workspace-editor.e import { type UmbSubmittableWorkspaceContext, UmbSubmittableWorkspaceContextBase, - UmbWorkspaceRouteManager, UmbWorkspaceIsNewRedirectController, type UmbRoutableWorkspaceContext, } from '@umbraco-cms/backoffice/workspace'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/workspace/media-type-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/workspace/media-type-workspace.context.ts index cc72c0ac24..e5c23009f2 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/media/media-types/workspace/media-type-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media-types/workspace/media-type-workspace.context.ts @@ -6,7 +6,6 @@ import { UmbSubmittableWorkspaceContextBase, type UmbRoutableWorkspaceContext, UmbWorkspaceIsNewRedirectController, - UmbWorkspaceRouteManager, } from '@umbraco-cms/backoffice/workspace'; import { UmbContentTypeStructureManager } from '@umbraco-cms/backoffice/content-type'; import { UmbObjectState } from '@umbraco-cms/backoffice/observable-api'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media/section-view/media-section-view.element.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media/section-view/media-section-view.element.ts index 5a2b075a8d..8a1f3c6a11 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/media/media/section-view/media-section-view.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media/section-view/media-section-view.element.ts @@ -52,6 +52,10 @@ export class UmbMediaSectionViewElement extends UmbLitElement { path: '', redirectTo: 'collection', }, + { + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }, ]; }, '_observeConfigDataType', diff --git a/src/Umbraco.Web.UI.Client/src/packages/media/media/workspace/media-workspace-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/media/media/workspace/media-workspace-editor.element.ts index 2912be0036..d7eaa87ced 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/media/media/workspace/media-workspace-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/media/media/workspace/media-workspace-editor.element.ts @@ -83,17 +83,12 @@ export class UmbMediaWorkspaceEditorElement extends UmbLitElement { }); } - const oldValue = this._routes; + routes.push({ + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }); - // is there any differences in the amount ot the paths? [NL] - // TODO: if we make a memorization function as the observer, we can avoid this check and avoid the whole build of routes. [NL] - if (oldValue && oldValue.length === routes.length) { - // is there any differences in the paths? [NL] - const hasDifferences = oldValue.some((route, index) => route.path !== routes[index].path); - if (!hasDifferences) return; - } this._routes = routes; - this.requestUpdate('_routes', oldValue); } private _gotWorkspaceRoute = (e: UmbRouterSlotInitEvent) => { diff --git a/src/Umbraco.Web.UI.Client/src/packages/members/member-group/section-view/member-group-section-view.element.ts b/src/Umbraco.Web.UI.Client/src/packages/members/member-group/section-view/member-group-section-view.element.ts index c8f50f65dd..b4809053c8 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/members/member-group/section-view/member-group-section-view.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/members/member-group/section-view/member-group-section-view.element.ts @@ -28,6 +28,10 @@ export class UmbMemberGroupSectionViewElement extends UmbLitElement { path: '', redirectTo: 'collection', }, + { + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }, ]; override render() { diff --git a/src/Umbraco.Web.UI.Client/src/packages/members/member-group/workspace/member-group-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/members/member-group/workspace/member-group-workspace.context.ts index 16d3dcbf0b..1258127044 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/members/member-group/workspace/member-group-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/members/member-group/workspace/member-group-workspace.context.ts @@ -5,7 +5,6 @@ import { UmbMemberGroupWorkspaceEditorElement } from './member-group-workspace-e import { type UmbSubmittableWorkspaceContext, UmbSubmittableWorkspaceContextBase, - UmbWorkspaceRouteManager, UmbWorkspaceIsNewRedirectController, type UmbRoutableWorkspaceContext, } from '@umbraco-cms/backoffice/workspace'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/members/member-type/workspace/member-type-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/members/member-type/workspace/member-type-workspace.context.ts index 7aa6614fdb..e791fc1e19 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/members/member-type/workspace/member-type-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/members/member-type/workspace/member-type-workspace.context.ts @@ -5,7 +5,6 @@ import { UmbMemberTypeWorkspaceEditorElement } from './member-type-workspace-edi import { UmbSubmittableWorkspaceContextBase, type UmbRoutableWorkspaceContext, - UmbWorkspaceRouteManager, UmbWorkspaceIsNewRedirectController, } from '@umbraco-cms/backoffice/workspace'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/members/member/section-view/member-section-view.element.ts b/src/Umbraco.Web.UI.Client/src/packages/members/member/section-view/member-section-view.element.ts index a5fc58ae48..c5ed738500 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/members/member/section-view/member-section-view.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/members/member/section-view/member-section-view.element.ts @@ -28,6 +28,10 @@ export class UmbMemberSectionViewElement extends UmbLitElement { path: '', redirectTo: 'collection', }, + { + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }, ]; override render() { diff --git a/src/Umbraco.Web.UI.Client/src/packages/members/member/workspace/member-workspace-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/members/member/workspace/member-workspace-editor.element.ts index b44cf47bd6..5bbe5e974e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/members/member/workspace/member-workspace-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/members/member/workspace/member-workspace-editor.element.ts @@ -85,17 +85,12 @@ export class UmbMemberWorkspaceEditorElement extends UmbLitElement { }); } - const oldValue = this._routes; + routes.push({ + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }); - // is there any differences in the amount ot the paths? [NL] - // TODO: if we make a memorization function as the observer, we can avoid this check and avoid the whole build of routes. [NL] - if (oldValue && oldValue.length === routes.length) { - // is there any differences in the paths? [NL] - const hasDifferences = oldValue.some((route, index) => route.path !== routes[index].path); - if (!hasDifferences) return; - } this._routes = routes; - this.requestUpdate('_routes', oldValue); } private _gotWorkspaceRoute = (e: UmbRouterSlotInitEvent) => { diff --git a/src/Umbraco.Web.UI.Client/src/packages/packages/package-section/views/created/created-packages-section-view.element.ts b/src/Umbraco.Web.UI.Client/src/packages/packages/package-section/views/created/created-packages-section-view.element.ts index f0f862cf48..d19f3286d2 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/packages/package-section/views/created/created-packages-section-view.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/packages/package-section/views/created/created-packages-section-view.element.ts @@ -61,6 +61,10 @@ export class UmbCreatedPackagesSectionViewElement extends UmbLitElement implemen path: '', redirectTo: 'overview', }); + routes.push({ + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }); this._routes = routes; } diff --git a/src/Umbraco.Web.UI.Client/src/packages/search/examine-management-dashboard/dashboard-examine-management.element.ts b/src/Umbraco.Web.UI.Client/src/packages/search/examine-management-dashboard/dashboard-examine-management.element.ts index 889d33f035..dd9e6043aa 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/search/examine-management-dashboard/dashboard-examine-management.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/search/examine-management-dashboard/dashboard-examine-management.element.ts @@ -29,6 +29,10 @@ export class UmbDashboardExamineManagementElement extends UmbLitElement { path: ``, component: () => import('./views/section-view-examine-overview.js'), }, + { + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }, ]; @state() diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/components/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/components/index.ts deleted file mode 100644 index f70c22af23..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/components/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './templating-item-menu/index.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/components/templating-item-menu/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/components/templating-item-menu/index.ts deleted file mode 100644 index 6d80bac0d8..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/components/templating-item-menu/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './templating-item-menu.element.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/entry-point.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/entry-point.ts new file mode 100644 index 0000000000..b3e1814160 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/entry-point.ts @@ -0,0 +1,4 @@ +import './partial-views/global-components/index.js'; +import './scripts/global-components/index.js'; +import './stylesheets/global-components/index.js'; +import './templates/global-components/index.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/index.ts deleted file mode 100644 index e1c9b4be07..0000000000 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './components/index.js'; -export * from './templates/index.js'; -export * from './stylesheets/index.js'; -export * from './modals/index.js'; -export * from './types.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/local-components/insert-menu/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/local-components/insert-menu/index.ts new file mode 100644 index 0000000000..14dcb7e970 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/local-components/insert-menu/index.ts @@ -0,0 +1,3 @@ +import './insert-menu.element.js'; + +export * from './insert-menu.element.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/components/templating-item-menu/templating-item-menu.element.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/local-components/insert-menu/insert-menu.element.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/components/templating-item-menu/templating-item-menu.element.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/local-components/insert-menu/insert-menu.element.ts index 6d6060d48e..3a0591e2d3 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/components/templating-item-menu/templating-item-menu.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/local-components/insert-menu/insert-menu.element.ts @@ -1,17 +1,17 @@ -import { UMB_TEMPLATING_PAGE_FIELD_BUILDER_MODAL } from '../../modals/templating-page-field-builder/templating-page-field-builder-modal.token.js'; -import { CodeSnippetType } from '../../types.js'; -import { - UMB_TEMPLATING_ITEM_PICKER_MODAL, - type UmbTemplatingItemPickerModalValue, -} from '../../modals/templating-item-picker/templating-item-picker-modal.token.js'; -import { getInsertDictionarySnippet, getInsertPartialSnippet } from '../../utils/index.js'; -import { UMB_PARTIAL_VIEW_PICKER_MODAL } from '@umbraco-cms/backoffice/partial-view'; import { UmbDictionaryDetailRepository, UMB_DICTIONARY_PICKER_MODAL } from '@umbraco-cms/backoffice/dictionary'; import { customElement, property, css, html } from '@umbraco-cms/backoffice/external/lit'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; import type { UmbModalManagerContext } from '@umbraco-cms/backoffice/modal'; import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; +import { getInsertDictionarySnippet, getInsertPartialSnippet } from '../../utils/index.js'; +import { + UMB_TEMPLATING_ITEM_PICKER_MODAL, + type UmbTemplatingItemPickerModalValue, +} from '../../modals/templating-item-picker/templating-item-picker-modal.token.js'; +import { CodeSnippetType } from '../../types.js'; +import { UMB_TEMPLATING_PAGE_FIELD_BUILDER_MODAL } from '../../modals/templating-page-field-builder/templating-page-field-builder-modal.token.js'; +import { UMB_PARTIAL_VIEW_PICKER_MODAL } from '@umbraco-cms/backoffice/partial-view'; @customElement('umb-templating-insert-menu') export class UmbTemplatingInsertMenuElement extends UmbLitElement { diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/manifests.ts index 08804aa6a4..e7a4e5d473 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/manifests.ts @@ -1,10 +1,10 @@ -import { manifests as menuManifests } from './menu.manifests.js'; +import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; +import { manifests as menuManifests } from './menu/manifests.js'; import { manifests as templateManifests } from './templates/manifests.js'; import { manifests as stylesheetManifests } from './stylesheets/manifests.js'; import { manifests as partialManifests } from './partial-views/manifests.js'; import { manifests as scriptManifest } from './scripts/manifests.js'; import { manifests as modalManifests } from './modals/manifests.js'; -import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; export const manifests: Array = [ ...menuManifests, diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/menu.manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/menu/manifests.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/menu.manifests.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/menu/manifests.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/package.json b/src/Umbraco.Web.UI.Client/src/packages/templating/package.json new file mode 100644 index 0000000000..844968aefd --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/package.json @@ -0,0 +1,8 @@ +{ + "name": "@umbraco-backoffice/templating", + "private": true, + "type": "module", + "scripts": { + "build": "vite build" + } +} \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/entity-actions/create/create.action.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/entity-actions/create/create.action.ts index 0a674c01a7..a769b2c9d6 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/entity-actions/create/create.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/entity-actions/create/create.action.ts @@ -1,8 +1,8 @@ -import { UMB_PARTIAL_VIEW_CREATE_OPTIONS_MODAL } from './options-modal/index.js'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import type { UmbEntityActionArgs } from '@umbraco-cms/backoffice/entity-action'; import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action'; import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; +import { UMB_PARTIAL_VIEW_CREATE_OPTIONS_MODAL } from './options-modal/index.js'; export class UmbPartialViewCreateOptionsEntityAction extends UmbEntityActionBase { constructor(host: UmbControllerHost, args: UmbEntityActionArgs) { @@ -23,3 +23,5 @@ export class UmbPartialViewCreateOptionsEntityAction extends UmbEntityActionBase await modalContext.onSubmit(); } } + +export { UmbPartialViewCreateOptionsEntityAction as api }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/entity-actions/create/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/entity-actions/create/manifests.ts index f6e8fd0f1a..05f1e09918 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/entity-actions/create/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/entity-actions/create/manifests.ts @@ -1,6 +1,5 @@ -import { UMB_PARTIAL_VIEW_FOLDER_ENTITY_TYPE, UMB_PARTIAL_VIEW_ROOT_ENTITY_TYPE } from '../../entity.js'; -import { UmbPartialViewCreateOptionsEntityAction } from './create.action.js'; import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; +import { UMB_PARTIAL_VIEW_FOLDER_ENTITY_TYPE, UMB_PARTIAL_VIEW_ROOT_ENTITY_TYPE } from '../../entity.js'; export const manifests: Array = [ { @@ -9,7 +8,7 @@ export const manifests: Array = [ alias: 'Umb.EntityAction.PartialView.CreateOptions', name: 'Partial View Create Options Entity Action', weight: 1200, - api: UmbPartialViewCreateOptionsEntityAction, + api: () => import('./create.action.js'), forEntityTypes: [UMB_PARTIAL_VIEW_ROOT_ENTITY_TYPE, UMB_PARTIAL_VIEW_FOLDER_ENTITY_TYPE], meta: { icon: 'icon-add', diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/components/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/global-components/index.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/components/index.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/global-components/index.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/components/input-partial-view/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/global-components/input-partial-view/index.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/components/input-partial-view/index.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/global-components/input-partial-view/index.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/components/input-partial-view/input-partial-view.context.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/global-components/input-partial-view/input-partial-view.context.ts similarity index 80% rename from src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/components/input-partial-view/input-partial-view.context.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/global-components/input-partial-view/input-partial-view.context.ts index 11c584246c..1dcff11475 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/components/input-partial-view/input-partial-view.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/global-components/input-partial-view/input-partial-view.context.ts @@ -1,13 +1,15 @@ +import { UmbPickerInputContext } from '@umbraco-cms/backoffice/picker-input'; +import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UMB_PARTIAL_VIEW_ITEM_REPOSITORY_ALIAS } from '../../repository/item/index.js'; import { UMB_PARTIAL_VIEW_PICKER_MODAL } from '../../partial-view-picker/index.js'; import type { UmbPartialViewItemModel } from '../../types.js'; -import { UmbPickerInputContext } from '@umbraco-cms/backoffice/picker-input'; -import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; +import type { UmbPartialViewTreeItemModel } from '../../tree/types.js'; -export class UmbPartialViewPickerContext extends UmbPickerInputContext { +export class UmbPartialViewPickerContext extends UmbPickerInputContext< + UmbPartialViewItemModel, + UmbPartialViewTreeItemModel +> { constructor(host: UmbControllerHost) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore super(host, UMB_PARTIAL_VIEW_ITEM_REPOSITORY_ALIAS, UMB_PARTIAL_VIEW_PICKER_MODAL); } } diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/index.ts index e5ef7d545d..2ca9dc61a5 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/index.ts @@ -1,5 +1,5 @@ -export * from './components/index.js'; export * from './entity.js'; +export * from './global-components/index.js'; export * from './repository/index.js'; export { UMB_PARTIAL_VIEW_PICKER_MODAL } from './partial-view-picker/index.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/index.ts index 39402645a6..c2c00a61f9 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/index.ts @@ -1,3 +1,3 @@ export { UmbPartialViewDetailRepository } from './partial-view-detail.repository.js'; export { UMB_PARTIAL_VIEW_DETAIL_REPOSITORY_ALIAS } from './manifests.js'; -export { UMB_PARTIAL_VIEW_DETAIL_STORE_CONTEXT } from './partial-view-detail.store.js'; +export { UMB_PARTIAL_VIEW_DETAIL_STORE_CONTEXT } from './partial-view-detail.store.context-token.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/item/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/item/index.ts index d25f95a60a..5bfa2fb180 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/item/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/item/index.ts @@ -1,3 +1,3 @@ export { UmbPartialViewItemRepository } from './partial-view-item.repository.js'; export { UMB_PARTIAL_VIEW_ITEM_REPOSITORY_ALIAS, UMB_PARTIAL_VIEW_ITEM_STORE_ALIAS } from './manifests.js'; -export { UMB_PARTIAL_VIEW_ITEM_STORE_CONTEXT } from './partial-view-item.store.js'; +export { UMB_PARTIAL_VIEW_ITEM_STORE_CONTEXT } from './partial-view-item.store.context-token.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/item/partial-view-item.repository.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/item/partial-view-item.repository.ts index 0779f52811..1d66597196 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/item/partial-view-item.repository.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/item/partial-view-item.repository.ts @@ -1,8 +1,8 @@ -import type { UmbPartialViewItemModel } from '../../types.js'; -import { UmbPartialViewItemServerDataSource } from './partial-view-item.server.data-source.js'; -import { UMB_PARTIAL_VIEW_ITEM_STORE_CONTEXT } from './partial-view-item.store.js'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbItemRepositoryBase } from '@umbraco-cms/backoffice/repository'; +import type { UmbPartialViewItemModel } from '../../types.js'; +import { UmbPartialViewItemServerDataSource } from './partial-view-item.server.data-source.js'; +import { UMB_PARTIAL_VIEW_ITEM_STORE_CONTEXT } from './partial-view-item.store.context-token.js'; export class UmbPartialViewItemRepository extends UmbItemRepositoryBase { constructor(host: UmbControllerHost) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/item/partial-view-item.store.context-token.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/item/partial-view-item.store.context-token.ts new file mode 100644 index 0000000000..b53341468c --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/item/partial-view-item.store.context-token.ts @@ -0,0 +1,6 @@ +import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; +import type { UmbPartialViewItemStore } from './partial-view-item.store.js'; + +export const UMB_PARTIAL_VIEW_ITEM_STORE_CONTEXT = new UmbContextToken( + 'UmbPartialViewItemStore', +); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/item/partial-view-item.store.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/item/partial-view-item.store.ts index 0b1f537f33..3d56ff7614 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/item/partial-view-item.store.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/item/partial-view-item.store.ts @@ -1,7 +1,7 @@ -import type { UmbPartialViewItemModel } from '../../types.js'; -import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbItemStoreBase } from '@umbraco-cms/backoffice/store'; +import type { UmbPartialViewItemModel } from '../../types.js'; +import { UMB_PARTIAL_VIEW_ITEM_STORE_CONTEXT } from './partial-view-item.store.context-token.js'; /** * @export @@ -22,7 +22,3 @@ export class UmbPartialViewItemStore extends UmbItemStoreBase( - 'UmbPartialViewItemStore', -); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/partial-view-detail.repository.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/partial-view-detail.repository.ts index 686f6be2b9..2b62d2d88a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/partial-view-detail.repository.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/partial-view-detail.repository.ts @@ -1,8 +1,8 @@ -import type { UmbPartialViewDetailModel } from '../types.js'; -import { UmbPartialViewDetailServerDataSource } from './partial-view-detail.server.data-source.js'; -import { UMB_PARTIAL_VIEW_DETAIL_STORE_CONTEXT } from './partial-view-detail.store.js'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbDetailRepositoryBase } from '@umbraco-cms/backoffice/repository'; +import type { UmbPartialViewDetailModel } from '../types.js'; +import { UmbPartialViewDetailServerDataSource } from './partial-view-detail.server.data-source.js'; +import { UMB_PARTIAL_VIEW_DETAIL_STORE_CONTEXT } from './partial-view-detail.store.context-token.js'; export class UmbPartialViewDetailRepository extends UmbDetailRepositoryBase { constructor(host: UmbControllerHost) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/partial-view-detail.store.context-token.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/partial-view-detail.store.context-token.ts new file mode 100644 index 0000000000..8c7d18fe56 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/partial-view-detail.store.context-token.ts @@ -0,0 +1,6 @@ +import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; +import type { UmbPartialViewDetailStore } from './partial-view-detail.store.js'; + +export const UMB_PARTIAL_VIEW_DETAIL_STORE_CONTEXT = new UmbContextToken( + 'UmbPartialViewDetailStore', +); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/partial-view-detail.store.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/partial-view-detail.store.ts index 8334c4eb7b..bae29061e6 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/partial-view-detail.store.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/repository/partial-view-detail.store.ts @@ -1,7 +1,7 @@ -import type { UmbPartialViewDetailModel } from '../types.js'; -import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbDetailStoreBase } from '@umbraco-cms/backoffice/store'; +import type { UmbPartialViewDetailModel } from '../types.js'; +import { UMB_PARTIAL_VIEW_DETAIL_STORE_CONTEXT } from './partial-view-detail.store.context-token.js'; /** * @export @@ -21,7 +21,3 @@ export class UmbPartialViewDetailStore extends UmbDetailStoreBase( - 'UmbPartialViewDetailStore', -); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/folder/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/folder/manifests.ts index 0f6d8cf9e6..8402a9f62e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/folder/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/folder/manifests.ts @@ -1,6 +1,5 @@ -import { UMB_PARTIAL_VIEW_FOLDER_ENTITY_TYPE } from '../../entity.js'; -import { UmbPartialViewFolderRepository } from './partial-view-folder.repository.js'; import type { ManifestRepository, ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; +import { UMB_PARTIAL_VIEW_FOLDER_ENTITY_TYPE } from '../../entity.js'; export const UMB_PARTIAL_VIEW_FOLDER_REPOSITORY_ALIAS = 'Umb.Repository.PartialView.Folder'; @@ -8,7 +7,7 @@ const folderRepository: ManifestRepository = { type: 'repository', alias: UMB_PARTIAL_VIEW_FOLDER_REPOSITORY_ALIAS, name: 'Partial View Folder Repository', - api: UmbPartialViewFolderRepository, + api: () => import('./partial-view-folder.repository.js'), }; export const UMB_DELETE_PARTIAL_VIEW_FOLDER_ENTITY_ACTION_ALIAS = 'Umb.EntityAction.PartialView.Folder.Delete'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/folder/partial-view-folder.repository.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/folder/partial-view-folder.repository.ts index 736d5af8ef..2d2c8b72d2 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/folder/partial-view-folder.repository.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/folder/partial-view-folder.repository.ts @@ -1,9 +1,11 @@ -import { UmbPartialViewFolderServerDataSource } from './partial-view-folder.server.data-source.js'; import { UmbFolderRepositoryBase } from '@umbraco-cms/backoffice/tree'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; +import { UmbPartialViewFolderServerDataSource } from './partial-view-folder.server.data-source.js'; export class UmbPartialViewFolderRepository extends UmbFolderRepositoryBase { constructor(host: UmbControllerHost) { super(host, UmbPartialViewFolderServerDataSource); } } + +export { UmbPartialViewFolderRepository as api }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/index.ts index b145ef7fe2..9d1efb47e4 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/index.ts @@ -4,6 +4,6 @@ export { UMB_PARTIAL_VIEW_TREE_STORE_ALIAS, UMB_PARTIAL_VIEW_TREE_ALIAS, } from './manifests.js'; -export { UMB_PARTIAL_VIEW_TREE_STORE_CONTEXT } from './partial-view-tree.store.js'; +export { UMB_PARTIAL_VIEW_TREE_STORE_CONTEXT } from './partial-view-tree.store.context-token.js'; export { type UmbPartialViewTreeStore } from './partial-view-tree.store.js'; export * from './types.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/partial-view-tree.repository.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/partial-view-tree.repository.ts index 69b1777f4c..57d8da8cc4 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/partial-view-tree.repository.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/partial-view-tree.repository.ts @@ -1,10 +1,10 @@ -import { UMB_PARTIAL_VIEW_ROOT_ENTITY_TYPE } from '../entity.js'; -import { UmbPartialViewTreeServerDataSource } from './partial-view-tree.server.data-source.js'; -import type { UmbPartialViewTreeItemModel, UmbPartialViewTreeRootModel } from './types.js'; -import { UMB_PARTIAL_VIEW_TREE_STORE_CONTEXT } from './partial-view-tree.store.js'; import { UmbTreeRepositoryBase } from '@umbraco-cms/backoffice/tree'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import type { UmbApi } from '@umbraco-cms/backoffice/extension-api'; +import { UMB_PARTIAL_VIEW_ROOT_ENTITY_TYPE } from '../entity.js'; +import { UmbPartialViewTreeServerDataSource } from './partial-view-tree.server.data-source.js'; +import type { UmbPartialViewTreeItemModel, UmbPartialViewTreeRootModel } from './types.js'; +import { UMB_PARTIAL_VIEW_TREE_STORE_CONTEXT } from './partial-view-tree.store.context-token.js'; export class UmbPartialViewTreeRepository extends UmbTreeRepositoryBase diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/partial-view-tree.store.context-token.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/partial-view-tree.store.context-token.ts new file mode 100644 index 0000000000..6b169770c3 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/partial-view-tree.store.context-token.ts @@ -0,0 +1,6 @@ +import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; +import type { UmbPartialViewTreeStore } from './partial-view-tree.store.js'; + +export const UMB_PARTIAL_VIEW_TREE_STORE_CONTEXT = new UmbContextToken( + 'UmbPartialViewTreeStore', +); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/partial-view-tree.store.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/partial-view-tree.store.ts index 5783cbc017..67248b8d67 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/partial-view-tree.store.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/tree/partial-view-tree.store.ts @@ -1,6 +1,6 @@ -import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbUniqueTreeStore } from '@umbraco-cms/backoffice/tree'; +import { UMB_PARTIAL_VIEW_TREE_STORE_CONTEXT } from './partial-view-tree.store.context-token.js'; /** * @export @@ -20,7 +20,3 @@ export class UmbPartialViewTreeStore extends UmbUniqueTreeStore { } export default UmbPartialViewTreeStore; - -export const UMB_PARTIAL_VIEW_TREE_STORE_CONTEXT = new UmbContextToken( - 'UmbPartialViewTreeStore', -); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/workspace/partial-view-workspace-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/workspace/partial-view-workspace-editor.element.ts index 20a1d39e33..023087c40f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/workspace/partial-view-workspace-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/workspace/partial-view-workspace-editor.element.ts @@ -1,12 +1,15 @@ -import type { UmbTemplatingInsertMenuElement } from '../../components/index.js'; -import { getQuerySnippet } from '../../utils/index.js'; -import { UMB_PARTIAL_VIEW_WORKSPACE_CONTEXT } from './partial-view-workspace.context-token.js'; -import { UMB_TEMPLATE_QUERY_BUILDER_MODAL } from '@umbraco-cms/backoffice/template'; -import type { UmbCodeEditorElement } from '@umbraco-cms/backoffice/code-editor'; import type { UUIInputElement } from '@umbraco-cms/backoffice/external/uui'; import { css, html, customElement, query, state, nothing } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement, umbFocus } from '@umbraco-cms/backoffice/lit-element'; import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; +import type { UmbTemplatingInsertMenuElement } from '../../local-components/insert-menu/index.js'; +import { getQuerySnippet } from '../../utils/index.js'; +import { UMB_PARTIAL_VIEW_WORKSPACE_CONTEXT } from './partial-view-workspace.context-token.js'; +import { UMB_TEMPLATE_QUERY_BUILDER_MODAL } from '@umbraco-cms/backoffice/template'; +import type { UmbCodeEditorElement } from '@umbraco-cms/backoffice/code-editor'; + +// import local components +import '../../local-components/insert-menu/index.js'; @customElement('umb-partial-view-workspace-editor') export class UmbPartialViewWorkspaceEditorElement extends UmbLitElement { diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/workspace/partial-view-workspace.context-token.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/workspace/partial-view-workspace.context-token.ts index 54c9803061..211d09461a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/workspace/partial-view-workspace.context-token.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/workspace/partial-view-workspace.context-token.ts @@ -1,7 +1,7 @@ -import { UMB_PARTIAL_VIEW_ENTITY_TYPE } from '../entity.js'; -import type { UmbPartialViewWorkspaceContext } from './partial-view-workspace.context.js'; import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbSubmittableWorkspaceContext } from '@umbraco-cms/backoffice/workspace'; +import { UMB_PARTIAL_VIEW_ENTITY_TYPE } from '../entity.js'; +import type { UmbPartialViewWorkspaceContext } from './partial-view-workspace.context.js'; export const UMB_PARTIAL_VIEW_WORKSPACE_CONTEXT = new UmbContextToken< UmbSubmittableWorkspaceContext, diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/workspace/partial-view-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/workspace/partial-view-workspace.context.ts index 700c62c35d..598e91175a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/workspace/partial-view-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/workspace/partial-view-workspace.context.ts @@ -8,7 +8,6 @@ import type { UmbRoutableWorkspaceContext, UmbSubmittableWorkspaceContext } from import { UmbSubmittableWorkspaceContextBase, UmbWorkspaceIsNewRedirectController, - UmbWorkspaceRouteManager, } from '@umbraco-cms/backoffice/workspace'; import { loadCodeEditor } from '@umbraco-cms/backoffice/code-editor'; import { tryExecuteAndNotify } from '@umbraco-cms/backoffice/resources'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/workspace/partial-view-workspace.element.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/workspace/partial-view-workspace.element.ts index 2bf5171364..5d7decf44d 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/workspace/partial-view-workspace.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/partial-views/workspace/partial-view-workspace.element.ts @@ -5,7 +5,7 @@ import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; import type { UmbRoute, IRoutingInfo, PageComponent } from '@umbraco-cms/backoffice/router'; import { UmbWorkspaceIsNewRedirectController } from '@umbraco-cms/backoffice/workspace'; -import '../../components/templating-item-menu/templating-item-menu.element.js'; +import '../../local-components/insert-menu/insert-menu.element.js'; import { UmbExtensionsApiInitializer } from '@umbraco-cms/backoffice/extension-api'; import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry'; @@ -44,6 +44,10 @@ export class UmbPartialViewWorkspaceElement extends UmbLitElement { this.#workspaceContext.load(unique); }, }, + { + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }, ]; constructor() { diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/entity-actions/create/create.action.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/entity-actions/create/create.action.ts index 6b5656ddf1..259edfe90b 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/entity-actions/create/create.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/entity-actions/create/create.action.ts @@ -1,8 +1,8 @@ -import { UMB_SCRIPT_CREATE_OPTIONS_MODAL } from './options-modal/index.js'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import type { UmbEntityActionArgs } from '@umbraco-cms/backoffice/entity-action'; import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action'; import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; +import { UMB_SCRIPT_CREATE_OPTIONS_MODAL } from './options-modal/index.js'; export class UmbScriptCreateOptionsEntityAction extends UmbEntityActionBase { constructor(host: UmbControllerHost, args: UmbEntityActionArgs) { @@ -23,3 +23,5 @@ export class UmbScriptCreateOptionsEntityAction extends UmbEntityActionBase = [ { @@ -9,7 +8,7 @@ export const manifests: Array = [ alias: 'Umb.EntityAction.Script.CreateOptions', name: 'Script Create Options Entity Action', weight: 1200, - api: UmbScriptCreateOptionsEntityAction, + api: () => import('./create.action.js'), forEntityTypes: [UMB_SCRIPT_ROOT_ENTITY_TYPE, UMB_SCRIPT_FOLDER_ENTITY_TYPE], meta: { icon: 'icon-add', diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/components/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/global-components/index.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/scripts/components/index.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/scripts/global-components/index.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/components/input-script/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/global-components/input-script/index.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/scripts/components/input-script/index.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/scripts/global-components/input-script/index.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/components/input-script/input-script.context.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/global-components/input-script/input-script.context.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/scripts/components/input-script/input-script.context.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/scripts/global-components/input-script/input-script.context.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/index.ts index df6fd81bf4..cce5d23b51 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/index.ts @@ -1,5 +1,5 @@ -export * from './components/index.js'; export * from './entity.js'; +export * from './global-components/index.js'; export * from './repository/index.js'; export * from './tree/index.js'; export * from './types.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/index.ts index f53bd9a964..5b576ff659 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/index.ts @@ -1,3 +1,3 @@ export { UMB_SCRIPT_DETAIL_REPOSITORY_ALIAS } from './manifests.js'; export { UmbScriptDetailRepository } from './script-detail.repository.js'; -export { UMB_SCRIPT_DETAIL_STORE_CONTEXT } from './script-detail.store.js'; +export { UMB_SCRIPT_DETAIL_STORE_CONTEXT } from './script-detail.store.context-token.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/item/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/item/index.ts index 2ce544e48a..4ff9d2c346 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/item/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/item/index.ts @@ -1,3 +1,3 @@ export { UmbScriptItemRepository } from './script-item.repository.js'; export { UMB_SCRIPT_ITEM_REPOSITORY_ALIAS, UMB_SCRIPT_ITEM_STORE_ALIAS } from './manifests.js'; -export { UMB_SCRIPT_ITEM_STORE_CONTEXT } from './script-item.store.js'; +export { UMB_SCRIPT_ITEM_STORE_CONTEXT } from './script-item.store.context-token.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/item/script-item.repository.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/item/script-item.repository.ts index f4aeb8ba78..2691695a63 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/item/script-item.repository.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/item/script-item.repository.ts @@ -1,8 +1,8 @@ -import type { UmbScriptItemModel } from '../../types.js'; -import { UmbScriptItemServerDataSource } from './script-item.server.data-source.js'; -import { UMB_SCRIPT_ITEM_STORE_CONTEXT } from './script-item.store.js'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbItemRepositoryBase } from '@umbraco-cms/backoffice/repository'; +import type { UmbScriptItemModel } from '../../types.js'; +import { UmbScriptItemServerDataSource } from './script-item.server.data-source.js'; +import { UMB_SCRIPT_ITEM_STORE_CONTEXT } from './script-item.store.context-token.js'; export class UmbScriptItemRepository extends UmbItemRepositoryBase { constructor(host: UmbControllerHost) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/item/script-item.store.context-token.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/item/script-item.store.context-token.ts new file mode 100644 index 0000000000..1b99e1d606 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/item/script-item.store.context-token.ts @@ -0,0 +1,4 @@ +import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; +import type { UmbScriptItemStore } from './script-item.store.js'; + +export const UMB_SCRIPT_ITEM_STORE_CONTEXT = new UmbContextToken('UmbScriptItemStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/item/script-item.store.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/item/script-item.store.ts index 6b3c7f6c55..280d21e583 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/item/script-item.store.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/item/script-item.store.ts @@ -1,7 +1,7 @@ -import type { UmbScriptItemModel } from '../../types.js'; -import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbItemStoreBase } from '@umbraco-cms/backoffice/store'; +import type { UmbScriptItemModel } from '../../types.js'; +import { UMB_SCRIPT_ITEM_STORE_CONTEXT } from './script-item.store.context-token.js'; /** * @export @@ -22,5 +22,3 @@ export class UmbScriptItemStore extends UmbItemStoreBase { } export default UmbScriptItemStore; - -export const UMB_SCRIPT_ITEM_STORE_CONTEXT = new UmbContextToken('UmbScriptItemStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/script-detail.repository.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/script-detail.repository.ts index 0366a2990a..52d9b83376 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/script-detail.repository.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/script-detail.repository.ts @@ -1,8 +1,8 @@ -import type { UmbScriptDetailModel } from '../types.js'; -import { UMB_SCRIPT_DETAIL_STORE_CONTEXT } from './script-detail.store.js'; -import { UmbScriptDetailServerDataSource } from './script-detail.server.data-source.js'; import { UmbDetailRepositoryBase } from '@umbraco-cms/backoffice/repository'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; +import type { UmbScriptDetailModel } from '../types.js'; +import { UMB_SCRIPT_DETAIL_STORE_CONTEXT } from './script-detail.store.context-token.js'; +import { UmbScriptDetailServerDataSource } from './script-detail.server.data-source.js'; export class UmbScriptDetailRepository extends UmbDetailRepositoryBase { constructor(host: UmbControllerHost) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/script-detail.store.context-token.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/script-detail.store.context-token.ts new file mode 100644 index 0000000000..30d80a6d35 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/script-detail.store.context-token.ts @@ -0,0 +1,4 @@ +import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; +import type { UmbScriptDetailStore } from './script-detail.store.js'; + +export const UMB_SCRIPT_DETAIL_STORE_CONTEXT = new UmbContextToken('UmbScriptDetailStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/script-detail.store.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/script-detail.store.ts index 375fc959a1..0631b34666 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/script-detail.store.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/repository/script-detail.store.ts @@ -1,7 +1,7 @@ -import type { UmbScriptDetailModel } from '../types.js'; -import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbDetailStoreBase } from '@umbraco-cms/backoffice/store'; +import type { UmbScriptDetailModel } from '../types.js'; +import { UMB_SCRIPT_DETAIL_STORE_CONTEXT } from './script-detail.store.context-token.js'; /** * @export @@ -21,5 +21,3 @@ export class UmbScriptDetailStore extends UmbDetailStoreBase('UmbScriptDetailStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/tree/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/tree/index.ts index 37225e51cc..58d9e10f46 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/tree/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/tree/index.ts @@ -1,5 +1,5 @@ export { UmbScriptTreeRepository } from './script-tree.repository.js'; export { UMB_SCRIPT_TREE_REPOSITORY_ALIAS, UMB_SCRIPT_TREE_STORE_ALIAS, UMB_SCRIPT_TREE_ALIAS } from './manifests.js'; -export { UMB_SCRIPT_TREE_STORE_CONTEXT } from './script-tree.store.js'; +export { UMB_SCRIPT_TREE_STORE_CONTEXT } from './script-tree.store.context-token.js'; export { type UmbScriptTreeStore } from './script-tree.store.js'; export * from './types.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/tree/script-tree.repository.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/tree/script-tree.repository.ts index bb3c68e1af..f62c47ae08 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/tree/script-tree.repository.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/tree/script-tree.repository.ts @@ -1,9 +1,9 @@ +import { UmbTreeRepositoryBase } from '@umbraco-cms/backoffice/tree'; +import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UMB_SCRIPT_ROOT_ENTITY_TYPE } from '../entity.js'; import { UmbScriptTreeServerDataSource } from './script-tree.server.data-source.js'; import type { UmbScriptTreeItemModel, UmbScriptTreeRootModel } from './types.js'; -import { UMB_SCRIPT_TREE_STORE_CONTEXT } from './script-tree.store.js'; -import { UmbTreeRepositoryBase } from '@umbraco-cms/backoffice/tree'; -import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; +import { UMB_SCRIPT_TREE_STORE_CONTEXT } from './script-tree.store.context-token.js'; // TODO: TREE STORE TYPE PROBLEM: export class UmbScriptTreeRepository extends UmbTreeRepositoryBase { diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/tree/script-tree.store.context-token.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/tree/script-tree.store.context-token.ts new file mode 100644 index 0000000000..0a433efd7e --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/tree/script-tree.store.context-token.ts @@ -0,0 +1,4 @@ +import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; +import type { UmbScriptTreeStore } from './script-tree.store.js'; + +export const UMB_SCRIPT_TREE_STORE_CONTEXT = new UmbContextToken('UmbScriptTreeStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/tree/script-tree.store.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/tree/script-tree.store.ts index 1cef997c52..6a52812873 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/tree/script-tree.store.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/tree/script-tree.store.ts @@ -1,6 +1,6 @@ -import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbUniqueTreeStore } from '@umbraco-cms/backoffice/tree'; +import { UMB_SCRIPT_TREE_STORE_CONTEXT } from './script-tree.store.context-token.js'; /** * @export @@ -20,5 +20,3 @@ export class UmbScriptTreeStore extends UmbUniqueTreeStore { } export default UmbScriptTreeStore; - -export const UMB_SCRIPT_TREE_STORE_CONTEXT = new UmbContextToken('UmbScriptTreeStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/workspace/script-workspace.context-token.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/workspace/script-workspace.context-token.ts index c5dd0234b5..3cff7360d1 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/workspace/script-workspace.context-token.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/workspace/script-workspace.context-token.ts @@ -1,6 +1,6 @@ -import type { UmbScriptWorkspaceContext } from './script-workspace.context.js'; import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbWorkspaceContext } from '@umbraco-cms/backoffice/workspace'; +import type { UmbScriptWorkspaceContext } from './script-workspace.context.js'; export const UMB_SCRIPT_WORKSPACE_CONTEXT = new UmbContextToken( 'UmbWorkspaceContext', diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/workspace/script-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/workspace/script-workspace.context.ts index 42e23b26ba..b037442377 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/workspace/script-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/workspace/script-workspace.context.ts @@ -10,7 +10,6 @@ import { type UmbRoutableWorkspaceContext, type UmbSubmittableWorkspaceContext, UmbWorkspaceIsNewRedirectController, - UmbWorkspaceRouteManager, } from '@umbraco-cms/backoffice/workspace'; import { loadCodeEditor } from '@umbraco-cms/backoffice/code-editor'; import { UMB_ACTION_EVENT_CONTEXT } from '@umbraco-cms/backoffice/action'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/entity-actions/create/create.action.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/entity-actions/create/create.action.ts index bdc100da4e..1e76bec9d5 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/entity-actions/create/create.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/entity-actions/create/create.action.ts @@ -1,6 +1,6 @@ -import { UMB_STYLESHEET_CREATE_OPTIONS_MODAL } from './options-modal/index.js'; import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action'; import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; +import { UMB_STYLESHEET_CREATE_OPTIONS_MODAL } from './options-modal/index.js'; export class UmbStylesheetCreateOptionsEntityAction extends UmbEntityActionBase { override async execute() { @@ -17,3 +17,5 @@ export class UmbStylesheetCreateOptionsEntityAction extends UmbEntityActionBase< await modalContext.onSubmit(); } } + +export { UmbStylesheetCreateOptionsEntityAction as api }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/entity-actions/create/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/entity-actions/create/manifests.ts index 445ff76811..9e93abc832 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/entity-actions/create/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/entity-actions/create/manifests.ts @@ -1,6 +1,5 @@ -import { UMB_STYLESHEET_FOLDER_ENTITY_TYPE, UMB_STYLESHEET_ROOT_ENTITY_TYPE } from '../../entity.js'; -import { UmbStylesheetCreateOptionsEntityAction } from './create.action.js'; import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; +import { UMB_STYLESHEET_FOLDER_ENTITY_TYPE, UMB_STYLESHEET_ROOT_ENTITY_TYPE } from '../../entity.js'; export const manifests: Array = [ { @@ -9,7 +8,7 @@ export const manifests: Array = [ alias: 'Umb.EntityAction.Stylesheet.CreateOptions', name: 'Stylesheet Create Options Entity Action', weight: 1200, - api: UmbStylesheetCreateOptionsEntityAction, + api: () => import('./create.action.js'), forEntityTypes: [UMB_STYLESHEET_ROOT_ENTITY_TYPE, UMB_STYLESHEET_FOLDER_ENTITY_TYPE], meta: { icon: 'icon-add', diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/index.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/index.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/index.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/manifests.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/manifests.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/manifests.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/stylesheet-input/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/stylesheet-input/index.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/stylesheet-input/index.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/stylesheet-input/index.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/stylesheet-input/stylesheet-input.context.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/stylesheet-input/stylesheet-input.context.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/stylesheet-input/stylesheet-input.context.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/stylesheet-input/stylesheet-input.context.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/stylesheet-input/stylesheet-input.element.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/stylesheet-input/stylesheet-input.element.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/stylesheet-input/stylesheet-input.element.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/stylesheet-input/stylesheet-input.element.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/stylesheet-input/stylesheet-picker-modal.token.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/stylesheet-input/stylesheet-picker-modal.token.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/stylesheet-input/stylesheet-picker-modal.token.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/stylesheet-input/stylesheet-picker-modal.token.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/stylesheet-rule-input/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/stylesheet-rule-input/manifests.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/stylesheet-rule-input/manifests.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/stylesheet-rule-input/manifests.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/stylesheet-rule-input/stylesheet-rule-input.element.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/stylesheet-rule-input/stylesheet-rule-input.element.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/stylesheet-rule-input/stylesheet-rule-input.element.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/stylesheet-rule-input/stylesheet-rule-input.element.ts index 04d8b7d3b5..4907f0a4e2 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/stylesheet-rule-input/stylesheet-rule-input.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/stylesheet-rule-input/stylesheet-rule-input.element.ts @@ -1,11 +1,11 @@ -import type { UmbStylesheetRule } from '../../types.js'; -import { UMB_STYLESHEET_RULE_SETTINGS_MODAL } from './stylesheet-rule-settings-modal.token.js'; import { css, html, customElement, repeat, property } from '@umbraco-cms/backoffice/external/lit'; import { UmbChangeEvent } from '@umbraco-cms/backoffice/event'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; import { UmbSorterController } from '@umbraco-cms/backoffice/sorter'; import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; import { UUIFormControlMixin } from '@umbraco-cms/backoffice/external/uui'; +import type { UmbStylesheetRule } from '../../types.js'; +import { UMB_STYLESHEET_RULE_SETTINGS_MODAL } from './stylesheet-rule-settings-modal.token.js'; @customElement('umb-stylesheet-rule-input') export class UmbStylesheetRuleInputElement extends UUIFormControlMixin(UmbLitElement, '') { diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/stylesheet-rule-input/stylesheet-rule-settings-modal.element.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/stylesheet-rule-input/stylesheet-rule-settings-modal.element.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/stylesheet-rule-input/stylesheet-rule-settings-modal.element.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/stylesheet-rule-input/stylesheet-rule-settings-modal.element.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/stylesheet-rule-input/stylesheet-rule-settings-modal.token.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/stylesheet-rule-input/stylesheet-rule-settings-modal.token.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/stylesheet-rule-input/stylesheet-rule-settings-modal.token.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/stylesheet-rule-input/stylesheet-rule-settings-modal.token.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/stylesheet-rule-ref/stylesheet-rule-ref.element.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/stylesheet-rule-ref/stylesheet-rule-ref.element.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/components/stylesheet-rule-ref/stylesheet-rule-ref.element.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/global-components/stylesheet-rule-ref/stylesheet-rule-ref.element.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/index.ts index 74010d6e27..1848331d21 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/index.ts @@ -1,8 +1,8 @@ -import './components/index.js'; +import './global-components/index.js'; export * from './repository/index.js'; export * from './entity.js'; -export * from './components/index.js'; +export * from './global-components/index.js'; export { UmbStylesheetTreeRepository } from './tree/index.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/manifests.ts index 61cf551469..5d262392ce 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/manifests.ts @@ -3,7 +3,7 @@ import { manifests as menuManifests } from './menu/manifests.js'; import { manifests as treeManifests } from './tree/manifests.js'; import { manifests as workspaceManifests } from './workspace/manifests.js'; import { manifests as entityActionManifests } from './entity-actions/manifests.js'; -import { manifests as componentManifests } from './components/manifests.js'; +import { manifests as componentManifests } from './global-components/manifests.js'; import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; export const manifests: Array = [ diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/index.ts index 3f00980578..f164c3cb28 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/index.ts @@ -2,4 +2,5 @@ export * from './item/index.js'; export * from './stylesheet-detail.repository.js'; export { UMB_STYLESHEET_DETAIL_REPOSITORY_ALIAS } from './manifests.js'; -export { type UmbStylesheetDetailStore, UMB_STYLESHEET_DETAIL_STORE_CONTEXT } from './stylesheet-detail.store.js'; +export { type UmbStylesheetDetailStore } from './stylesheet-detail.store.js'; +export { UMB_STYLESHEET_DETAIL_STORE_CONTEXT } from './stylesheet-detail.store.context-token.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/item/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/item/index.ts index 929e43c0f8..6df1aaee57 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/item/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/item/index.ts @@ -1,3 +1,3 @@ export { UmbStylesheetItemRepository } from './stylesheet-item.repository.js'; export { UMB_STYLESHEET_ITEM_REPOSITORY_ALIAS, UMB_STYLESHEET_ITEM_STORE_ALIAS } from './manifests.js'; -export { UMB_STYLESHEET_ITEM_STORE_CONTEXT } from './stylesheet-item.store.js'; +export { UMB_STYLESHEET_ITEM_STORE_CONTEXT } from './stylesheet-item.store.context-token.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/item/stylesheet-item.repository.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/item/stylesheet-item.repository.ts index 73aa50c015..964eacd51c 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/item/stylesheet-item.repository.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/item/stylesheet-item.repository.ts @@ -1,8 +1,8 @@ -import type { UmbStylesheetItemModel } from '../../types.js'; -import { UmbStylesheetItemServerDataSource } from './stylesheet-item.server.data-source.js'; -import { UMB_STYLESHEET_ITEM_STORE_CONTEXT } from './stylesheet-item.store.js'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbItemRepositoryBase } from '@umbraco-cms/backoffice/repository'; +import type { UmbStylesheetItemModel } from '../../types.js'; +import { UmbStylesheetItemServerDataSource } from './stylesheet-item.server.data-source.js'; +import { UMB_STYLESHEET_ITEM_STORE_CONTEXT } from './stylesheet-item.store.context-token.js'; export class UmbStylesheetItemRepository extends UmbItemRepositoryBase { constructor(host: UmbControllerHost) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/item/stylesheet-item.store.context-token.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/item/stylesheet-item.store.context-token.ts new file mode 100644 index 0000000000..eeebd2ad68 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/item/stylesheet-item.store.context-token.ts @@ -0,0 +1,4 @@ +import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; +import type { UmbStylesheetItemStore } from './stylesheet-item.store.js'; + +export const UMB_STYLESHEET_ITEM_STORE_CONTEXT = new UmbContextToken('UmbStylesheetItemStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/item/stylesheet-item.store.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/item/stylesheet-item.store.ts index 452bf4ed72..66a7e7bddf 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/item/stylesheet-item.store.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/item/stylesheet-item.store.ts @@ -1,7 +1,7 @@ -import type { UmbStylesheetItemModel } from '../../types.js'; -import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbItemStoreBase } from '@umbraco-cms/backoffice/store'; +import type { UmbStylesheetItemModel } from '../../types.js'; +import { UMB_STYLESHEET_ITEM_STORE_CONTEXT } from './stylesheet-item.store.context-token.js'; /** * @export @@ -22,5 +22,3 @@ export class UmbStylesheetItemStore extends UmbItemStoreBase('UmbStylesheetItemStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/stylesheet-detail.repository.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/stylesheet-detail.repository.ts index 5cfe1c64bb..3632871314 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/stylesheet-detail.repository.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/stylesheet-detail.repository.ts @@ -1,8 +1,8 @@ -import type { UmbStylesheetDetailModel } from '../types.js'; -import { UmbStylesheetDetailServerDataSource } from './stylesheet-detail.server.data-source.js'; -import { UMB_STYLESHEET_DETAIL_STORE_CONTEXT } from './stylesheet-detail.store.js'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbDetailRepositoryBase } from '@umbraco-cms/backoffice/repository'; +import type { UmbStylesheetDetailModel } from '../types.js'; +import { UmbStylesheetDetailServerDataSource } from './stylesheet-detail.server.data-source.js'; +import { UMB_STYLESHEET_DETAIL_STORE_CONTEXT } from './stylesheet-detail.store.context-token.js'; export class UmbStylesheetDetailRepository extends UmbDetailRepositoryBase { constructor(host: UmbControllerHost) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/stylesheet-detail.store.context-token.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/stylesheet-detail.store.context-token.ts new file mode 100644 index 0000000000..851d617f6a --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/stylesheet-detail.store.context-token.ts @@ -0,0 +1,6 @@ +import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; +import type { UmbStylesheetDetailStore } from './stylesheet-detail.store.js'; + +export const UMB_STYLESHEET_DETAIL_STORE_CONTEXT = new UmbContextToken( + 'UmbStylesheetDetailStore', +); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/stylesheet-detail.store.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/stylesheet-detail.store.ts index 9a4d91d31d..1eb6ecc526 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/stylesheet-detail.store.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/repository/stylesheet-detail.store.ts @@ -1,7 +1,7 @@ -import type { UmbStylesheetDetailModel } from '../types.js'; -import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbDetailStoreBase } from '@umbraco-cms/backoffice/store'; +import type { UmbStylesheetDetailModel } from '../types.js'; +import { UMB_STYLESHEET_DETAIL_STORE_CONTEXT } from './stylesheet-detail.store.context-token.js'; /** * @export @@ -21,7 +21,3 @@ export class UmbStylesheetDetailStore extends UmbDetailStoreBase( - 'UmbStylesheetDetailStore', -); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/tree/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/tree/index.ts index e7cd001fce..fec6b1c31a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/tree/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/tree/index.ts @@ -4,6 +4,6 @@ export { UMB_STYLESHEET_TREE_STORE_ALIAS, UMB_STYLESHEET_TREE_ALIAS, } from './manifests.js'; -export { UMB_STYLESHEET_TREE_STORE_CONTEXT } from './stylesheet-tree.store.js'; +export { UMB_STYLESHEET_TREE_STORE_CONTEXT } from './stylesheet-tree.store.context-token.js'; export { type UmbStylesheetTreeStore } from './stylesheet-tree.store.js'; export * from './types.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/tree/stylesheet-tree.repository.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/tree/stylesheet-tree.repository.ts index 6edec84a7a..8a6ae8a483 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/tree/stylesheet-tree.repository.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/tree/stylesheet-tree.repository.ts @@ -1,9 +1,9 @@ -import { UMB_STYLESHEET_ROOT_ENTITY_TYPE } from '../entity.js'; -import { UmbStylesheetTreeServerDataSource } from './stylesheet-tree.server.data-source.js'; -import { UMB_STYLESHEET_TREE_STORE_CONTEXT } from './stylesheet-tree.store.js'; -import type { UmbStylesheetTreeItemModel, UmbStylesheetTreeRootModel } from './types.js'; import { UmbTreeRepositoryBase } from '@umbraco-cms/backoffice/tree'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; +import { UMB_STYLESHEET_ROOT_ENTITY_TYPE } from '../entity.js'; +import { UmbStylesheetTreeServerDataSource } from './stylesheet-tree.server.data-source.js'; +import { UMB_STYLESHEET_TREE_STORE_CONTEXT } from './stylesheet-tree.store.context-token.js'; +import type { UmbStylesheetTreeItemModel, UmbStylesheetTreeRootModel } from './types.js'; export class UmbStylesheetTreeRepository extends UmbTreeRepositoryBase< UmbStylesheetTreeItemModel, diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/tree/stylesheet-tree.store.context-token.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/tree/stylesheet-tree.store.context-token.ts new file mode 100644 index 0000000000..6a3618d7b9 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/tree/stylesheet-tree.store.context-token.ts @@ -0,0 +1,4 @@ +import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; +import type { UmbStylesheetTreeStore } from './stylesheet-tree.store.js'; + +export const UMB_STYLESHEET_TREE_STORE_CONTEXT = new UmbContextToken('UmbStylesheetTreeStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/tree/stylesheet-tree.store.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/tree/stylesheet-tree.store.ts index 7474d507c1..081b2545b1 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/tree/stylesheet-tree.store.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/tree/stylesheet-tree.store.ts @@ -1,6 +1,6 @@ import { UmbUniqueTreeStore } from '@umbraco-cms/backoffice/tree'; -import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; +import { UMB_STYLESHEET_TREE_STORE_CONTEXT } from './stylesheet-tree.store.context-token.js'; /** * @export @@ -20,5 +20,3 @@ export class UmbStylesheetTreeStore extends UmbUniqueTreeStore { } export default UmbStylesheetTreeStore; - -export const UMB_STYLESHEET_TREE_STORE_CONTEXT = new UmbContextToken('UmbStylesheetTreeStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace.context-token.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace.context-token.ts index d706d04bb8..69f0d9d232 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace.context-token.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace.context-token.ts @@ -1,7 +1,7 @@ -import { UMB_STYLESHEET_ENTITY_TYPE } from '../entity.js'; -import type { UmbStylesheetWorkspaceContext } from './stylesheet-workspace.context.js'; import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbSubmittableWorkspaceContext } from '@umbraco-cms/backoffice/workspace'; +import { UMB_STYLESHEET_ENTITY_TYPE } from '../entity.js'; +import type { UmbStylesheetWorkspaceContext } from './stylesheet-workspace.context.js'; export const UMB_STYLESHEET_WORKSPACE_CONTEXT = new UmbContextToken< UmbSubmittableWorkspaceContext, diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace.context.ts index e624f48c77..ad403df9b0 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace.context.ts @@ -6,7 +6,6 @@ import { UmbStylesheetWorkspaceEditorElement } from './stylesheet-workspace-edit import { type UmbSubmittableWorkspaceContext, UmbSubmittableWorkspaceContextBase, - UmbWorkspaceRouteManager, UmbWorkspaceIsNewRedirectController, type UmbRoutableWorkspaceContext, } from '@umbraco-cms/backoffice/workspace'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/views/rich-text-rule/stylesheet-rich-text-rule-workspace-view.element.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/views/rich-text-rule/stylesheet-rich-text-rule-workspace-view.element.ts index 2661159b09..3c821705f8 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/views/rich-text-rule/stylesheet-rich-text-rule-workspace-view.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/views/rich-text-rule/stylesheet-rich-text-rule-workspace-view.element.ts @@ -1,5 +1,5 @@ import type { UmbStylesheetRule } from '../../../types.js'; -import type { UmbStylesheetRuleInputElement } from '../../../components/index.js'; +import type { UmbStylesheetRuleInputElement } from '../../../global-components/index.js'; import { UmbStylesheetRuleManager } from '../../../utils/index.js'; import { UMB_STYLESHEET_WORKSPACE_CONTEXT } from '../../stylesheet-workspace.context-token.js'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/entity-actions/create/create.action.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/entity-actions/create/create.action.ts index 97fb564ba7..91e989477c 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/entity-actions/create/create.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/entity-actions/create/create.action.ts @@ -2,7 +2,7 @@ import type { UmbEntityActionArgs } from '@umbraco-cms/backoffice/entity-action' import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; -export class UmbCreateEntityAction extends UmbEntityActionBase { +export class UmbCreateTemplateEntityAction extends UmbEntityActionBase { constructor(host: UmbControllerHost, args: UmbEntityActionArgs) { super(host, args); } @@ -15,3 +15,5 @@ export class UmbCreateEntityAction extends UmbEntityActionBase { history.pushState(null, '', url); } } + +export { UmbCreateTemplateEntityAction as api }; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/entity-actions/manifests.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/entity-actions/manifests.ts index 1a2fd784ee..f27fdcfe6f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/entity-actions/manifests.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/entity-actions/manifests.ts @@ -1,7 +1,6 @@ +import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; import { UMB_TEMPLATE_DETAIL_REPOSITORY_ALIAS, UMB_TEMPLATE_ITEM_REPOSITORY_ALIAS } from '../repository/index.js'; import { UMB_TEMPLATE_ENTITY_TYPE, UMB_TEMPLATE_ROOT_ENTITY_TYPE } from '../entity.js'; -import { UmbCreateEntityAction } from './create/create.action.js'; -import type { ManifestTypes } from '@umbraco-cms/backoffice/extension-registry'; const entityActions: Array = [ { @@ -10,7 +9,7 @@ const entityActions: Array = [ alias: 'Umb.EntityAction.Template.Create', name: 'Create Template Entity Action', weight: 1200, - api: UmbCreateEntityAction, + api: () => import('./create/create.action.js'), forEntityTypes: [UMB_TEMPLATE_ENTITY_TYPE, UMB_TEMPLATE_ROOT_ENTITY_TYPE], meta: { icon: 'icon-add', diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/components/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/global-components/index.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/templates/components/index.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/templates/global-components/index.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/components/input-template/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/global-components/input-template/index.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/templates/components/input-template/index.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/templates/global-components/input-template/index.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/components/input-template/input-template.context.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/global-components/input-template/input-template.context.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/templates/components/input-template/input-template.context.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/templates/global-components/input-template/input-template.context.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/components/input-template/input-template.element.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/global-components/input-template/input-template.element.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/templates/components/input-template/input-template.element.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/templates/global-components/input-template/input-template.element.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/components/template-card/template-card.element.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/global-components/template-card/template-card.element.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/templates/components/template-card/template-card.element.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/templates/global-components/template-card/template-card.element.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/components/template-card/template-card.stories.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/global-components/template-card/template-card.stories.ts similarity index 100% rename from src/Umbraco.Web.UI.Client/src/packages/templating/templates/components/template-card/template-card.stories.ts rename to src/Umbraco.Web.UI.Client/src/packages/templating/templates/global-components/template-card/template-card.stories.ts diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/index.ts index f8e3d79c45..392b743cee 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/index.ts @@ -1,6 +1,6 @@ -import './components/index.js'; +import './global-components/index.js'; -export * from './components/index.js'; +export * from './global-components/index.js'; export * from './entity.js'; export * from './modals/index.js'; export * from './repository/index.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/detail/template-detail.repository.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/detail/template-detail.repository.ts index 547be72f0c..dd01273dac 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/detail/template-detail.repository.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/detail/template-detail.repository.ts @@ -1,8 +1,8 @@ -import type { UmbTemplateDetailModel } from '../../types.js'; -import { UmbTemplateServerDataSource } from './template-detail.server.data-source.js'; -import { UMB_TEMPLATE_DETAIL_STORE_CONTEXT } from './template-detail.store.js'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbDetailRepositoryBase } from '@umbraco-cms/backoffice/repository'; +import type { UmbTemplateDetailModel } from '../../types.js'; +import { UmbTemplateServerDataSource } from './template-detail.server.data-source.js'; +import { UMB_TEMPLATE_DETAIL_STORE_CONTEXT } from './template-detail.store.context-token.js'; export class UmbTemplateDetailRepository extends UmbDetailRepositoryBase { constructor(host: UmbControllerHost) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/detail/template-detail.store.context-token.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/detail/template-detail.store.context-token.ts new file mode 100644 index 0000000000..aa8f305ae2 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/detail/template-detail.store.context-token.ts @@ -0,0 +1,4 @@ +import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; +import type { UmbTemplateDetailStore } from './template-detail.store.js'; + +export const UMB_TEMPLATE_DETAIL_STORE_CONTEXT = new UmbContextToken('UmbTemplateDetailStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/detail/template-detail.store.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/detail/template-detail.store.ts index 0de7d4a852..79e6626082 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/detail/template-detail.store.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/detail/template-detail.store.ts @@ -1,7 +1,7 @@ -import type { UmbTemplateDetailModel } from '../../types.js'; -import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import { UmbDetailStoreBase } from '@umbraco-cms/backoffice/store'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; +import type { UmbTemplateDetailModel } from '../../types.js'; +import { UMB_TEMPLATE_DETAIL_STORE_CONTEXT } from './template-detail.store.context-token.js'; /** * @export @@ -21,5 +21,3 @@ export class UmbTemplateDetailStore extends UmbDetailStoreBase('UmbTemplateDetailStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/item/template-item.repository.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/item/template-item.repository.ts index 88f329f8a0..c95aba9704 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/item/template-item.repository.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/item/template-item.repository.ts @@ -1,8 +1,8 @@ -import { UmbTemplateItemServerDataSource } from './template-item.server.data-source.js'; -import { UMB_TEMPLATE_ITEM_STORE_CONTEXT } from './template-item.store.js'; -import type { UmbTemplateItemModel } from './types.js'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbItemRepositoryBase } from '@umbraco-cms/backoffice/repository'; +import { UmbTemplateItemServerDataSource } from './template-item.server.data-source.js'; +import { UMB_TEMPLATE_ITEM_STORE_CONTEXT } from './template-item.store.context-token.js'; +import type { UmbTemplateItemModel } from './types.js'; export class UmbTemplateItemRepository extends UmbItemRepositoryBase { constructor(host: UmbControllerHost) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/item/template-item.store.context-token.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/item/template-item.store.context-token.ts new file mode 100644 index 0000000000..46db64cdf9 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/item/template-item.store.context-token.ts @@ -0,0 +1,4 @@ +import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; +import type { UmbTemplateItemStore } from './template-item.store.js'; + +export const UMB_TEMPLATE_ITEM_STORE_CONTEXT = new UmbContextToken('UmbTemplateItemStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/item/template-item.store.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/item/template-item.store.ts index 7093c64520..ca7dbf96e6 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/item/template-item.store.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/repository/item/template-item.store.ts @@ -1,7 +1,7 @@ -import type { UmbTemplateItemModel } from './types.js'; -import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbItemStoreBase } from '@umbraco-cms/backoffice/store'; +import type { UmbTemplateItemModel } from './types.js'; +import { UMB_TEMPLATE_ITEM_STORE_CONTEXT } from './template-item.store.context-token.js'; /** * @export @@ -22,5 +22,3 @@ export class UmbTemplateItemStore extends UmbItemStoreBase } export default UmbTemplateItemStore; - -export const UMB_TEMPLATE_ITEM_STORE_CONTEXT = new UmbContextToken('UmbTemplateItemStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/tree/index.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/tree/index.ts index 6552e9138b..2d83f31961 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/tree/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/tree/index.ts @@ -4,6 +4,6 @@ export { UMB_TEMPLATE_TREE_STORE_ALIAS, UMB_TEMPLATE_TREE_ALIAS, } from './manifests.js'; -export { UMB_TEMPLATE_TREE_STORE_CONTEXT } from './template-tree.store.js'; +export { UMB_TEMPLATE_TREE_STORE_CONTEXT } from './template-tree.store.context-token.js'; export { type UmbTemplateTreeStore } from './template-tree.store.js'; export * from './types.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/tree/template-tree.repository.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/tree/template-tree.repository.ts index 77ec7b89aa..c8673ccdf1 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/tree/template-tree.repository.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/tree/template-tree.repository.ts @@ -1,10 +1,10 @@ -import { UMB_TEMPLATE_ROOT_ENTITY_TYPE } from '../entity.js'; -import { UmbTemplateTreeServerDataSource } from './template-tree.server.data-source.js'; -import type { UmbTemplateTreeItemModel, UmbTemplateTreeRootModel } from './types.js'; -import { UMB_TEMPLATE_TREE_STORE_CONTEXT } from './template-tree.store.js'; import { UmbTreeRepositoryBase } from '@umbraco-cms/backoffice/tree'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import type { UmbApi } from '@umbraco-cms/backoffice/extension-api'; +import { UMB_TEMPLATE_ROOT_ENTITY_TYPE } from '../entity.js'; +import { UmbTemplateTreeServerDataSource } from './template-tree.server.data-source.js'; +import type { UmbTemplateTreeItemModel, UmbTemplateTreeRootModel } from './types.js'; +import { UMB_TEMPLATE_TREE_STORE_CONTEXT } from './template-tree.store.context-token.js'; export class UmbTemplateTreeRepository extends UmbTreeRepositoryBase diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/tree/template-tree.store.context-token.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/tree/template-tree.store.context-token.ts new file mode 100644 index 0000000000..19ae9353be --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/tree/template-tree.store.context-token.ts @@ -0,0 +1,4 @@ +import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; +import type { UmbTemplateTreeStore } from './template-tree.store.js'; + +export const UMB_TEMPLATE_TREE_STORE_CONTEXT = new UmbContextToken('UmbTemplateTreeStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/tree/template-tree.store.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/tree/template-tree.store.ts index 26c8e5e624..9b1bb99a7a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/tree/template-tree.store.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/tree/template-tree.store.ts @@ -1,6 +1,6 @@ -import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import { UmbUniqueTreeStore } from '@umbraco-cms/backoffice/tree'; +import { UMB_TEMPLATE_TREE_STORE_CONTEXT } from './template-tree.store.context-token.js'; /** * @export @@ -20,5 +20,3 @@ export class UmbTemplateTreeStore extends UmbUniqueTreeStore { } export default UmbTemplateTreeStore; - -export const UMB_TEMPLATE_TREE_STORE_CONTEXT = new UmbContextToken('UmbTemplateTreeStore'); diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace-editor.element.ts index 29ebab9530..5fe27ad2ab 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace-editor.element.ts @@ -1,17 +1,20 @@ -import { UMB_TEMPLATING_SECTION_PICKER_MODAL } from '../../modals/templating-section-picker/templating-section-picker-modal.token.js'; -import type { UmbTemplatingInsertMenuElement } from '../../components/templating-item-menu/templating-item-menu.element.js'; -import { UMB_TEMPLATE_QUERY_BUILDER_MODAL } from '../modals/query-builder/index.js'; -import { getQuerySnippet } from '../../utils/index.js'; -import { UMB_TEMPLATE_WORKSPACE_CONTEXT } from './template-workspace.context-token.js'; -import type { UmbCodeEditorElement } from '@umbraco-cms/backoffice/code-editor'; import { toCamelCase } from '@umbraco-cms/backoffice/utils'; import type { UUIInputElement } from '@umbraco-cms/backoffice/external/uui'; import { css, html, customElement, query, state, nothing, ifDefined } from '@umbraco-cms/backoffice/external/lit'; import type { UmbModalManagerContext } from '@umbraco-cms/backoffice/modal'; import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; -import { UMB_TEMPLATE_PICKER_MODAL } from '@umbraco-cms/backoffice/template'; import { UmbLitElement, umbFocus } from '@umbraco-cms/backoffice/lit-element'; import { Subject, debounceTime } from '@umbraco-cms/backoffice/external/rxjs'; +import { UMB_TEMPLATING_SECTION_PICKER_MODAL } from '../../modals/templating-section-picker/templating-section-picker-modal.token.js'; +import type { UmbTemplatingInsertMenuElement } from '../../local-components/insert-menu/insert-menu.element.js'; +import { UMB_TEMPLATE_QUERY_BUILDER_MODAL } from '../modals/query-builder/index.js'; +import { getQuerySnippet } from '../../utils/index.js'; +import { UMB_TEMPLATE_WORKSPACE_CONTEXT } from './template-workspace.context-token.js'; +import type { UmbCodeEditorElement } from '@umbraco-cms/backoffice/code-editor'; +import { UMB_TEMPLATE_PICKER_MODAL } from '@umbraco-cms/backoffice/template'; + +// import local components +import '../../local-components/insert-menu/index.js'; @customElement('umb-template-workspace-editor') export class UmbTemplateWorkspaceEditorElement extends UmbLitElement { diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context-token.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context-token.ts index 6c6b390703..6564f95019 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context-token.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context-token.ts @@ -1,6 +1,6 @@ -import type { UmbTemplateWorkspaceContext } from './template-workspace.context.js'; import { UmbContextToken } from '@umbraco-cms/backoffice/context-api'; import type { UmbSubmittableWorkspaceContext } from '@umbraco-cms/backoffice/workspace'; +import type { UmbTemplateWorkspaceContext } from './template-workspace.context.js'; export const UMB_TEMPLATE_WORKSPACE_CONTEXT = new UmbContextToken< UmbSubmittableWorkspaceContext, diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context.ts index 3bb13d3814..ea4f07ffab 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/templates/workspace/template-workspace.context.ts @@ -8,7 +8,6 @@ import type { UmbRoutableWorkspaceContext, UmbSubmittableWorkspaceContext } from import { UmbSubmittableWorkspaceContextBase, UmbWorkspaceIsNewRedirectController, - UmbWorkspaceRouteManager, } from '@umbraco-cms/backoffice/workspace'; import { UmbBooleanState, UmbObjectState } from '@umbraco-cms/backoffice/observable-api'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/umbraco-package.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/umbraco-package.ts index bb38899cf5..0aafd8af65 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/umbraco-package.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/umbraco-package.ts @@ -1,5 +1,3 @@ -import './index.js'; - export const name = 'Umbraco.Core.Templating'; export const extensions = [ { @@ -8,4 +6,10 @@ export const extensions = [ type: 'bundle', js: () => import('./manifests.js'), }, + { + name: 'Template Management Backoffice Entry Point', + alias: 'Umb.BackofficeEntryPoint.TemplateManagement', + type: 'backofficeEntryPoint', + js: () => import('./entry-point.js'), + }, ]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/vite.config.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/vite.config.ts new file mode 100644 index 0000000000..4f5b9cd8e9 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/vite.config.ts @@ -0,0 +1,24 @@ +import { defineConfig } from 'vite'; +import { rmSync } from 'fs'; +import { getDefaultConfig } from '../../vite-config-base'; + +const dist = '../../../dist-cms/packages/templating'; + +// delete the unbundled dist folder +rmSync(dist, { recursive: true, force: true }); + +export default defineConfig({ + ...getDefaultConfig({ + dist, + entry: { + 'code-editor/index': 'code-editor/index.ts', + 'entry-point': 'entry-point.ts', + 'partial-views/index': 'partial-views/index.ts', + 'scripts/index': 'scripts/index.ts', + 'stylesheets/index': 'stylesheets/index.ts', + 'templates/index': 'templates/index.ts', + 'umbraco-package': 'umbraco-package.ts', + manifests: 'manifests.ts', + }, + }), +}); diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/section-view/user-group-section-view.element.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/section-view/user-group-section-view.element.ts index 87ac0b018d..4611f0962d 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/section-view/user-group-section-view.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/section-view/user-group-section-view.element.ts @@ -30,6 +30,10 @@ export class UmbUserGroupSectionViewElement extends UmbLitElement { path: '', redirectTo: 'collection', }, + { + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }, ]; override render() { diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/workspace/user-group-workspace.context.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/workspace/user-group-workspace.context.ts index 482457629f..0ad5583347 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user-group/workspace/user-group-workspace.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user-group/workspace/user-group-workspace.context.ts @@ -6,7 +6,6 @@ import type { UmbRoutableWorkspaceContext, UmbSubmittableWorkspaceContext } from import { UmbSubmittableWorkspaceContextBase, UmbWorkspaceIsNewRedirectController, - UmbWorkspaceRouteManager, } from '@umbraco-cms/backoffice/workspace'; import { UmbObjectState } from '@umbraco-cms/backoffice/observable-api'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/user/user/section-view/users-section-view.element.ts b/src/Umbraco.Web.UI.Client/src/packages/user/user/section-view/users-section-view.element.ts index 4869ea58b8..002fbf4d92 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/user/user/section-view/users-section-view.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/user/user/section-view/users-section-view.element.ts @@ -34,6 +34,10 @@ export class UmbSectionViewUsersElement extends UmbLitElement { path: '', redirectTo: 'collection', }, + { + path: `**`, + component: async () => (await import('@umbraco-cms/backoffice/router')).UmbRouteNotFoundElement, + }, ]; override render() { diff --git a/src/Umbraco.Web.UI.Client/src/rollup.config.js b/src/Umbraco.Web.UI.Client/src/rollup.config.js index 67dacb42aa..b20eb1cd69 100644 --- a/src/Umbraco.Web.UI.Client/src/rollup.config.js +++ b/src/Umbraco.Web.UI.Client/src/rollup.config.js @@ -84,7 +84,7 @@ const libraries = allowed.map((module) => { preventAssignment: true, values: { '?inline': '', - } + }, }), css({ minify: true }), esbuild({ minify: true, sourceMap: true }), diff --git a/src/Umbraco.Web.UI.Client/web-test-runner.config.mjs b/src/Umbraco.Web.UI.Client/web-test-runner.config.mjs index bb99c1da29..7e570f0e20 100644 --- a/src/Umbraco.Web.UI.Client/web-test-runner.config.mjs +++ b/src/Umbraco.Web.UI.Client/web-test-runner.config.mjs @@ -12,6 +12,8 @@ if (!['dev', 'prod'].includes(mode)) { throw new Error(`MODE must be "dev" or "prod", was "${mode}"`); } +const silencedLogs = ['Lit is in dev mode.', 'Multiple versions of Lit loaded.']; + /** @type {import('@web/dev-server').DevServerConfig} */ export default { rootDir: '.', @@ -38,6 +40,14 @@ export default { }), esbuildPlugin({ ts: true, tsconfig: './tsconfig.json', target: 'auto', json: true }), ], + filterBrowserLogs(log) { + for (const arg of log.args) { + if (typeof arg === 'string' && silencedLogs.some((l) => arg.includes(l))) { + return false; + } + } + return true; + }, testRunnerHtml: (testFramework, devMode) => ` @@ -59,19 +69,6 @@ export default { -