diff --git a/package-lock.json b/package-lock.json index c1c4159eb0..3333dc4b2f 100644 --- a/package-lock.json +++ b/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", @@ -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 @@ -22270,6 +22275,7 @@ "src/packages/tags": { "name": "@umbraco-backoffice/tag" }, + "src/packages/templating": {}, "src/packages/umbraco-news": { "name": "@umbraco-backoffice/umbraco-news" }, diff --git a/package.json b/package.json index 14d325f8f2..a1aa6b2ab8 100644 --- a/package.json +++ b/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", diff --git a/src/packages/documents/document-blueprints/entity-actions/create/create.action.ts b/src/packages/documents/document-blueprints/entity-actions/create/create.action.ts index 25bdcb52dc..8f8e477785 100644 --- a/src/packages/documents/document-blueprints/entity-actions/create/create.action.ts +++ b/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/packages/templating/components/index.ts b/src/packages/templating/components/index.ts deleted file mode 100644 index f70c22af23..0000000000 --- a/src/packages/templating/components/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './templating-item-menu/index.js'; diff --git a/src/packages/templating/components/templating-item-menu/index.ts b/src/packages/templating/components/templating-item-menu/index.ts deleted file mode 100644 index 6d80bac0d8..0000000000 --- a/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/packages/templating/entry-point.ts b/src/packages/templating/entry-point.ts new file mode 100644 index 0000000000..b3e1814160 --- /dev/null +++ b/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/packages/templating/index.ts b/src/packages/templating/index.ts deleted file mode 100644 index e1c9b4be07..0000000000 --- a/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/packages/templating/local-components/insert-menu/index.ts b/src/packages/templating/local-components/insert-menu/index.ts new file mode 100644 index 0000000000..14dcb7e970 --- /dev/null +++ b/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/packages/templating/components/templating-item-menu/templating-item-menu.element.ts b/src/packages/templating/local-components/insert-menu/insert-menu.element.ts similarity index 100% rename from src/packages/templating/components/templating-item-menu/templating-item-menu.element.ts rename to src/packages/templating/local-components/insert-menu/insert-menu.element.ts index 6d6060d48e..3a0591e2d3 100644 --- a/src/packages/templating/components/templating-item-menu/templating-item-menu.element.ts +++ b/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/packages/templating/manifests.ts b/src/packages/templating/manifests.ts index 08804aa6a4..e7a4e5d473 100644 --- a/src/packages/templating/manifests.ts +++ b/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/packages/templating/menu.manifests.ts b/src/packages/templating/menu/manifests.ts similarity index 100% rename from src/packages/templating/menu.manifests.ts rename to src/packages/templating/menu/manifests.ts diff --git a/src/packages/templating/package.json b/src/packages/templating/package.json new file mode 100644 index 0000000000..844968aefd --- /dev/null +++ b/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/packages/templating/partial-views/entity-actions/create/create.action.ts b/src/packages/templating/partial-views/entity-actions/create/create.action.ts index 0a674c01a7..a769b2c9d6 100644 --- a/src/packages/templating/partial-views/entity-actions/create/create.action.ts +++ b/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/packages/templating/partial-views/entity-actions/create/manifests.ts b/src/packages/templating/partial-views/entity-actions/create/manifests.ts index f6e8fd0f1a..05f1e09918 100644 --- a/src/packages/templating/partial-views/entity-actions/create/manifests.ts +++ b/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/packages/templating/partial-views/components/index.ts b/src/packages/templating/partial-views/global-components/index.ts similarity index 100% rename from src/packages/templating/partial-views/components/index.ts rename to src/packages/templating/partial-views/global-components/index.ts diff --git a/src/packages/templating/partial-views/components/input-partial-view/index.ts b/src/packages/templating/partial-views/global-components/input-partial-view/index.ts similarity index 100% rename from src/packages/templating/partial-views/components/input-partial-view/index.ts rename to src/packages/templating/partial-views/global-components/input-partial-view/index.ts diff --git a/src/packages/templating/partial-views/components/input-partial-view/input-partial-view.context.ts b/src/packages/templating/partial-views/global-components/input-partial-view/input-partial-view.context.ts similarity index 80% rename from src/packages/templating/partial-views/components/input-partial-view/input-partial-view.context.ts rename to src/packages/templating/partial-views/global-components/input-partial-view/input-partial-view.context.ts index 11c584246c..1dcff11475 100644 --- a/src/packages/templating/partial-views/components/input-partial-view/input-partial-view.context.ts +++ b/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/packages/templating/partial-views/index.ts b/src/packages/templating/partial-views/index.ts index e5ef7d545d..2ca9dc61a5 100644 --- a/src/packages/templating/partial-views/index.ts +++ b/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/packages/templating/partial-views/repository/index.ts b/src/packages/templating/partial-views/repository/index.ts index 39402645a6..c2c00a61f9 100644 --- a/src/packages/templating/partial-views/repository/index.ts +++ b/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/packages/templating/partial-views/repository/item/index.ts b/src/packages/templating/partial-views/repository/item/index.ts index d25f95a60a..5bfa2fb180 100644 --- a/src/packages/templating/partial-views/repository/item/index.ts +++ b/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/packages/templating/partial-views/repository/item/partial-view-item.repository.ts b/src/packages/templating/partial-views/repository/item/partial-view-item.repository.ts index 0779f52811..1d66597196 100644 --- a/src/packages/templating/partial-views/repository/item/partial-view-item.repository.ts +++ b/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/packages/templating/partial-views/repository/item/partial-view-item.store.context-token.ts b/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/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/packages/templating/partial-views/repository/item/partial-view-item.store.ts b/src/packages/templating/partial-views/repository/item/partial-view-item.store.ts index 0b1f537f33..3d56ff7614 100644 --- a/src/packages/templating/partial-views/repository/item/partial-view-item.store.ts +++ b/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/packages/templating/partial-views/repository/partial-view-detail.repository.ts b/src/packages/templating/partial-views/repository/partial-view-detail.repository.ts index 686f6be2b9..2b62d2d88a 100644 --- a/src/packages/templating/partial-views/repository/partial-view-detail.repository.ts +++ b/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/packages/templating/partial-views/repository/partial-view-detail.store.context-token.ts b/src/packages/templating/partial-views/repository/partial-view-detail.store.context-token.ts new file mode 100644 index 0000000000..8c7d18fe56 --- /dev/null +++ b/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/packages/templating/partial-views/repository/partial-view-detail.store.ts b/src/packages/templating/partial-views/repository/partial-view-detail.store.ts index 8334c4eb7b..bae29061e6 100644 --- a/src/packages/templating/partial-views/repository/partial-view-detail.store.ts +++ b/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/packages/templating/partial-views/tree/folder/manifests.ts b/src/packages/templating/partial-views/tree/folder/manifests.ts index 0f6d8cf9e6..8402a9f62e 100644 --- a/src/packages/templating/partial-views/tree/folder/manifests.ts +++ b/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/packages/templating/partial-views/tree/folder/partial-view-folder.repository.ts b/src/packages/templating/partial-views/tree/folder/partial-view-folder.repository.ts index 736d5af8ef..2d2c8b72d2 100644 --- a/src/packages/templating/partial-views/tree/folder/partial-view-folder.repository.ts +++ b/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/packages/templating/partial-views/tree/index.ts b/src/packages/templating/partial-views/tree/index.ts index b145ef7fe2..9d1efb47e4 100644 --- a/src/packages/templating/partial-views/tree/index.ts +++ b/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/packages/templating/partial-views/tree/partial-view-tree.repository.ts b/src/packages/templating/partial-views/tree/partial-view-tree.repository.ts index 69b1777f4c..57d8da8cc4 100644 --- a/src/packages/templating/partial-views/tree/partial-view-tree.repository.ts +++ b/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/packages/templating/partial-views/tree/partial-view-tree.store.context-token.ts b/src/packages/templating/partial-views/tree/partial-view-tree.store.context-token.ts new file mode 100644 index 0000000000..6b169770c3 --- /dev/null +++ b/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/packages/templating/partial-views/tree/partial-view-tree.store.ts b/src/packages/templating/partial-views/tree/partial-view-tree.store.ts index 5783cbc017..67248b8d67 100644 --- a/src/packages/templating/partial-views/tree/partial-view-tree.store.ts +++ b/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/packages/templating/partial-views/workspace/partial-view-workspace-editor.element.ts b/src/packages/templating/partial-views/workspace/partial-view-workspace-editor.element.ts index 20a1d39e33..023087c40f 100644 --- a/src/packages/templating/partial-views/workspace/partial-view-workspace-editor.element.ts +++ b/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/packages/templating/partial-views/workspace/partial-view-workspace.context-token.ts b/src/packages/templating/partial-views/workspace/partial-view-workspace.context-token.ts index 54c9803061..211d09461a 100644 --- a/src/packages/templating/partial-views/workspace/partial-view-workspace.context-token.ts +++ b/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/packages/templating/partial-views/workspace/partial-view-workspace.element.ts b/src/packages/templating/partial-views/workspace/partial-view-workspace.element.ts index 2bf5171364..c60e4a4a6d 100644 --- a/src/packages/templating/partial-views/workspace/partial-view-workspace.element.ts +++ b/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'; diff --git a/src/packages/templating/scripts/entity-actions/create/create.action.ts b/src/packages/templating/scripts/entity-actions/create/create.action.ts index 6b5656ddf1..259edfe90b 100644 --- a/src/packages/templating/scripts/entity-actions/create/create.action.ts +++ b/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/packages/templating/scripts/components/index.ts b/src/packages/templating/scripts/global-components/index.ts similarity index 100% rename from src/packages/templating/scripts/components/index.ts rename to src/packages/templating/scripts/global-components/index.ts diff --git a/src/packages/templating/scripts/components/input-script/index.ts b/src/packages/templating/scripts/global-components/input-script/index.ts similarity index 100% rename from src/packages/templating/scripts/components/input-script/index.ts rename to src/packages/templating/scripts/global-components/input-script/index.ts diff --git a/src/packages/templating/scripts/components/input-script/input-script.context.ts b/src/packages/templating/scripts/global-components/input-script/input-script.context.ts similarity index 100% rename from src/packages/templating/scripts/components/input-script/input-script.context.ts rename to src/packages/templating/scripts/global-components/input-script/input-script.context.ts diff --git a/src/packages/templating/scripts/index.ts b/src/packages/templating/scripts/index.ts index df6fd81bf4..cce5d23b51 100644 --- a/src/packages/templating/scripts/index.ts +++ b/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/packages/templating/scripts/repository/index.ts b/src/packages/templating/scripts/repository/index.ts index f53bd9a964..5b576ff659 100644 --- a/src/packages/templating/scripts/repository/index.ts +++ b/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/packages/templating/scripts/repository/item/index.ts b/src/packages/templating/scripts/repository/item/index.ts index 2ce544e48a..4ff9d2c346 100644 --- a/src/packages/templating/scripts/repository/item/index.ts +++ b/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/packages/templating/scripts/repository/item/script-item.repository.ts b/src/packages/templating/scripts/repository/item/script-item.repository.ts index f4aeb8ba78..2691695a63 100644 --- a/src/packages/templating/scripts/repository/item/script-item.repository.ts +++ b/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/packages/templating/scripts/repository/item/script-item.store.context-token.ts b/src/packages/templating/scripts/repository/item/script-item.store.context-token.ts new file mode 100644 index 0000000000..1b99e1d606 --- /dev/null +++ b/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/packages/templating/scripts/repository/item/script-item.store.ts b/src/packages/templating/scripts/repository/item/script-item.store.ts index 6b3c7f6c55..280d21e583 100644 --- a/src/packages/templating/scripts/repository/item/script-item.store.ts +++ b/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/packages/templating/scripts/repository/script-detail.repository.ts b/src/packages/templating/scripts/repository/script-detail.repository.ts index 0366a2990a..52d9b83376 100644 --- a/src/packages/templating/scripts/repository/script-detail.repository.ts +++ b/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/packages/templating/scripts/repository/script-detail.store.context-token.ts b/src/packages/templating/scripts/repository/script-detail.store.context-token.ts new file mode 100644 index 0000000000..30d80a6d35 --- /dev/null +++ b/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/packages/templating/scripts/repository/script-detail.store.ts b/src/packages/templating/scripts/repository/script-detail.store.ts index 375fc959a1..0631b34666 100644 --- a/src/packages/templating/scripts/repository/script-detail.store.ts +++ b/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/packages/templating/scripts/tree/index.ts b/src/packages/templating/scripts/tree/index.ts index 37225e51cc..58d9e10f46 100644 --- a/src/packages/templating/scripts/tree/index.ts +++ b/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/packages/templating/scripts/tree/script-tree.repository.ts b/src/packages/templating/scripts/tree/script-tree.repository.ts index bb3c68e1af..f62c47ae08 100644 --- a/src/packages/templating/scripts/tree/script-tree.repository.ts +++ b/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/packages/templating/scripts/tree/script-tree.store.context-token.ts b/src/packages/templating/scripts/tree/script-tree.store.context-token.ts new file mode 100644 index 0000000000..0a433efd7e --- /dev/null +++ b/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/packages/templating/scripts/tree/script-tree.store.ts b/src/packages/templating/scripts/tree/script-tree.store.ts index 1cef997c52..6a52812873 100644 --- a/src/packages/templating/scripts/tree/script-tree.store.ts +++ b/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/packages/templating/scripts/workspace/script-workspace.context-token.ts b/src/packages/templating/scripts/workspace/script-workspace.context-token.ts index c5dd0234b5..3cff7360d1 100644 --- a/src/packages/templating/scripts/workspace/script-workspace.context-token.ts +++ b/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/packages/templating/stylesheets/entity-actions/create/create.action.ts b/src/packages/templating/stylesheets/entity-actions/create/create.action.ts index bdc100da4e..1e76bec9d5 100644 --- a/src/packages/templating/stylesheets/entity-actions/create/create.action.ts +++ b/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/packages/templating/stylesheets/entity-actions/create/manifests.ts b/src/packages/templating/stylesheets/entity-actions/create/manifests.ts index 445ff76811..9e93abc832 100644 --- a/src/packages/templating/stylesheets/entity-actions/create/manifests.ts +++ b/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/packages/templating/stylesheets/components/index.ts b/src/packages/templating/stylesheets/global-components/index.ts similarity index 100% rename from src/packages/templating/stylesheets/components/index.ts rename to src/packages/templating/stylesheets/global-components/index.ts diff --git a/src/packages/templating/stylesheets/components/manifests.ts b/src/packages/templating/stylesheets/global-components/manifests.ts similarity index 100% rename from src/packages/templating/stylesheets/components/manifests.ts rename to src/packages/templating/stylesheets/global-components/manifests.ts diff --git a/src/packages/templating/stylesheets/components/stylesheet-input/index.ts b/src/packages/templating/stylesheets/global-components/stylesheet-input/index.ts similarity index 100% rename from src/packages/templating/stylesheets/components/stylesheet-input/index.ts rename to src/packages/templating/stylesheets/global-components/stylesheet-input/index.ts diff --git a/src/packages/templating/stylesheets/components/stylesheet-input/stylesheet-input.context.ts b/src/packages/templating/stylesheets/global-components/stylesheet-input/stylesheet-input.context.ts similarity index 100% rename from src/packages/templating/stylesheets/components/stylesheet-input/stylesheet-input.context.ts rename to src/packages/templating/stylesheets/global-components/stylesheet-input/stylesheet-input.context.ts diff --git a/src/packages/templating/stylesheets/components/stylesheet-input/stylesheet-input.element.ts b/src/packages/templating/stylesheets/global-components/stylesheet-input/stylesheet-input.element.ts similarity index 100% rename from src/packages/templating/stylesheets/components/stylesheet-input/stylesheet-input.element.ts rename to src/packages/templating/stylesheets/global-components/stylesheet-input/stylesheet-input.element.ts diff --git a/src/packages/templating/stylesheets/components/stylesheet-input/stylesheet-picker-modal.token.ts b/src/packages/templating/stylesheets/global-components/stylesheet-input/stylesheet-picker-modal.token.ts similarity index 100% rename from src/packages/templating/stylesheets/components/stylesheet-input/stylesheet-picker-modal.token.ts rename to src/packages/templating/stylesheets/global-components/stylesheet-input/stylesheet-picker-modal.token.ts diff --git a/src/packages/templating/stylesheets/components/stylesheet-rule-input/manifests.ts b/src/packages/templating/stylesheets/global-components/stylesheet-rule-input/manifests.ts similarity index 100% rename from src/packages/templating/stylesheets/components/stylesheet-rule-input/manifests.ts rename to src/packages/templating/stylesheets/global-components/stylesheet-rule-input/manifests.ts diff --git a/src/packages/templating/stylesheets/components/stylesheet-rule-input/stylesheet-rule-input.element.ts b/src/packages/templating/stylesheets/global-components/stylesheet-rule-input/stylesheet-rule-input.element.ts similarity index 100% rename from src/packages/templating/stylesheets/components/stylesheet-rule-input/stylesheet-rule-input.element.ts rename to src/packages/templating/stylesheets/global-components/stylesheet-rule-input/stylesheet-rule-input.element.ts index 04d8b7d3b5..4907f0a4e2 100644 --- a/src/packages/templating/stylesheets/components/stylesheet-rule-input/stylesheet-rule-input.element.ts +++ b/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/packages/templating/stylesheets/components/stylesheet-rule-input/stylesheet-rule-settings-modal.element.ts b/src/packages/templating/stylesheets/global-components/stylesheet-rule-input/stylesheet-rule-settings-modal.element.ts similarity index 100% rename from src/packages/templating/stylesheets/components/stylesheet-rule-input/stylesheet-rule-settings-modal.element.ts rename to src/packages/templating/stylesheets/global-components/stylesheet-rule-input/stylesheet-rule-settings-modal.element.ts diff --git a/src/packages/templating/stylesheets/components/stylesheet-rule-input/stylesheet-rule-settings-modal.token.ts b/src/packages/templating/stylesheets/global-components/stylesheet-rule-input/stylesheet-rule-settings-modal.token.ts similarity index 100% rename from src/packages/templating/stylesheets/components/stylesheet-rule-input/stylesheet-rule-settings-modal.token.ts rename to src/packages/templating/stylesheets/global-components/stylesheet-rule-input/stylesheet-rule-settings-modal.token.ts diff --git a/src/packages/templating/stylesheets/components/stylesheet-rule-ref/stylesheet-rule-ref.element.ts b/src/packages/templating/stylesheets/global-components/stylesheet-rule-ref/stylesheet-rule-ref.element.ts similarity index 100% rename from src/packages/templating/stylesheets/components/stylesheet-rule-ref/stylesheet-rule-ref.element.ts rename to src/packages/templating/stylesheets/global-components/stylesheet-rule-ref/stylesheet-rule-ref.element.ts diff --git a/src/packages/templating/stylesheets/index.ts b/src/packages/templating/stylesheets/index.ts index 74010d6e27..1848331d21 100644 --- a/src/packages/templating/stylesheets/index.ts +++ b/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/packages/templating/stylesheets/manifests.ts b/src/packages/templating/stylesheets/manifests.ts index 61cf551469..5d262392ce 100644 --- a/src/packages/templating/stylesheets/manifests.ts +++ b/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/packages/templating/stylesheets/repository/index.ts b/src/packages/templating/stylesheets/repository/index.ts index 3f00980578..f164c3cb28 100644 --- a/src/packages/templating/stylesheets/repository/index.ts +++ b/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/packages/templating/stylesheets/repository/item/index.ts b/src/packages/templating/stylesheets/repository/item/index.ts index 929e43c0f8..6df1aaee57 100644 --- a/src/packages/templating/stylesheets/repository/item/index.ts +++ b/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/packages/templating/stylesheets/repository/item/stylesheet-item.repository.ts b/src/packages/templating/stylesheets/repository/item/stylesheet-item.repository.ts index 73aa50c015..964eacd51c 100644 --- a/src/packages/templating/stylesheets/repository/item/stylesheet-item.repository.ts +++ b/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/packages/templating/stylesheets/repository/item/stylesheet-item.store.context-token.ts b/src/packages/templating/stylesheets/repository/item/stylesheet-item.store.context-token.ts new file mode 100644 index 0000000000..eeebd2ad68 --- /dev/null +++ b/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/packages/templating/stylesheets/repository/item/stylesheet-item.store.ts b/src/packages/templating/stylesheets/repository/item/stylesheet-item.store.ts index 452bf4ed72..66a7e7bddf 100644 --- a/src/packages/templating/stylesheets/repository/item/stylesheet-item.store.ts +++ b/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/packages/templating/stylesheets/repository/stylesheet-detail.repository.ts b/src/packages/templating/stylesheets/repository/stylesheet-detail.repository.ts index 5cfe1c64bb..3632871314 100644 --- a/src/packages/templating/stylesheets/repository/stylesheet-detail.repository.ts +++ b/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/packages/templating/stylesheets/repository/stylesheet-detail.store.context-token.ts b/src/packages/templating/stylesheets/repository/stylesheet-detail.store.context-token.ts new file mode 100644 index 0000000000..851d617f6a --- /dev/null +++ b/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/packages/templating/stylesheets/repository/stylesheet-detail.store.ts b/src/packages/templating/stylesheets/repository/stylesheet-detail.store.ts index 9a4d91d31d..1eb6ecc526 100644 --- a/src/packages/templating/stylesheets/repository/stylesheet-detail.store.ts +++ b/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/packages/templating/stylesheets/tree/index.ts b/src/packages/templating/stylesheets/tree/index.ts index e7cd001fce..fec6b1c31a 100644 --- a/src/packages/templating/stylesheets/tree/index.ts +++ b/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/packages/templating/stylesheets/tree/stylesheet-tree.repository.ts b/src/packages/templating/stylesheets/tree/stylesheet-tree.repository.ts index 6edec84a7a..8a6ae8a483 100644 --- a/src/packages/templating/stylesheets/tree/stylesheet-tree.repository.ts +++ b/src/packages/templating/stylesheets/tree/stylesheet-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_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 { UMB_STYLESHEET_TREE_STORE_CONTEXT } from './stylesheet-tree.store.context-token.js'; import type { UmbStylesheetTreeItemModel, UmbStylesheetTreeRootModel } from './types.js'; -import { UmbTreeRepositoryBase } from '@umbraco-cms/backoffice/tree'; -import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; export class UmbStylesheetTreeRepository extends UmbTreeRepositoryBase< UmbStylesheetTreeItemModel, diff --git a/src/packages/templating/stylesheets/tree/stylesheet-tree.store.context-token.ts b/src/packages/templating/stylesheets/tree/stylesheet-tree.store.context-token.ts new file mode 100644 index 0000000000..6a3618d7b9 --- /dev/null +++ b/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/packages/templating/stylesheets/tree/stylesheet-tree.store.ts b/src/packages/templating/stylesheets/tree/stylesheet-tree.store.ts index 7474d507c1..081b2545b1 100644 --- a/src/packages/templating/stylesheets/tree/stylesheet-tree.store.ts +++ b/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/packages/templating/stylesheets/workspace/stylesheet-workspace.context-token.ts b/src/packages/templating/stylesheets/workspace/stylesheet-workspace.context-token.ts index d706d04bb8..69f0d9d232 100644 --- a/src/packages/templating/stylesheets/workspace/stylesheet-workspace.context-token.ts +++ b/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/packages/templating/stylesheets/workspace/views/rich-text-rule/stylesheet-rich-text-rule-workspace-view.element.ts b/src/packages/templating/stylesheets/workspace/views/rich-text-rule/stylesheet-rich-text-rule-workspace-view.element.ts index 2661159b09..3c821705f8 100644 --- a/src/packages/templating/stylesheets/workspace/views/rich-text-rule/stylesheet-rich-text-rule-workspace-view.element.ts +++ b/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/packages/templating/templates/entity-actions/create/create.action.ts b/src/packages/templating/templates/entity-actions/create/create.action.ts index 97fb564ba7..91e989477c 100644 --- a/src/packages/templating/templates/entity-actions/create/create.action.ts +++ b/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/packages/templating/templates/entity-actions/manifests.ts b/src/packages/templating/templates/entity-actions/manifests.ts index 1a2fd784ee..f27fdcfe6f 100644 --- a/src/packages/templating/templates/entity-actions/manifests.ts +++ b/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/packages/templating/templates/components/index.ts b/src/packages/templating/templates/global-components/index.ts similarity index 100% rename from src/packages/templating/templates/components/index.ts rename to src/packages/templating/templates/global-components/index.ts diff --git a/src/packages/templating/templates/components/input-template/index.ts b/src/packages/templating/templates/global-components/input-template/index.ts similarity index 100% rename from src/packages/templating/templates/components/input-template/index.ts rename to src/packages/templating/templates/global-components/input-template/index.ts diff --git a/src/packages/templating/templates/components/input-template/input-template.context.ts b/src/packages/templating/templates/global-components/input-template/input-template.context.ts similarity index 100% rename from src/packages/templating/templates/components/input-template/input-template.context.ts rename to src/packages/templating/templates/global-components/input-template/input-template.context.ts diff --git a/src/packages/templating/templates/components/input-template/input-template.element.ts b/src/packages/templating/templates/global-components/input-template/input-template.element.ts similarity index 100% rename from src/packages/templating/templates/components/input-template/input-template.element.ts rename to src/packages/templating/templates/global-components/input-template/input-template.element.ts diff --git a/src/packages/templating/templates/components/template-card/template-card.element.ts b/src/packages/templating/templates/global-components/template-card/template-card.element.ts similarity index 100% rename from src/packages/templating/templates/components/template-card/template-card.element.ts rename to src/packages/templating/templates/global-components/template-card/template-card.element.ts diff --git a/src/packages/templating/templates/components/template-card/template-card.stories.ts b/src/packages/templating/templates/global-components/template-card/template-card.stories.ts similarity index 100% rename from src/packages/templating/templates/components/template-card/template-card.stories.ts rename to src/packages/templating/templates/global-components/template-card/template-card.stories.ts diff --git a/src/packages/templating/templates/index.ts b/src/packages/templating/templates/index.ts index f8e3d79c45..392b743cee 100644 --- a/src/packages/templating/templates/index.ts +++ b/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/packages/templating/templates/repository/detail/template-detail.repository.ts b/src/packages/templating/templates/repository/detail/template-detail.repository.ts index 547be72f0c..dd01273dac 100644 --- a/src/packages/templating/templates/repository/detail/template-detail.repository.ts +++ b/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/packages/templating/templates/repository/detail/template-detail.store.context-token.ts b/src/packages/templating/templates/repository/detail/template-detail.store.context-token.ts new file mode 100644 index 0000000000..aa8f305ae2 --- /dev/null +++ b/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/packages/templating/templates/repository/detail/template-detail.store.ts b/src/packages/templating/templates/repository/detail/template-detail.store.ts index 0de7d4a852..79e6626082 100644 --- a/src/packages/templating/templates/repository/detail/template-detail.store.ts +++ b/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/packages/templating/templates/repository/item/template-item.repository.ts b/src/packages/templating/templates/repository/item/template-item.repository.ts index 88f329f8a0..c95aba9704 100644 --- a/src/packages/templating/templates/repository/item/template-item.repository.ts +++ b/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/packages/templating/templates/repository/item/template-item.store.context-token.ts b/src/packages/templating/templates/repository/item/template-item.store.context-token.ts new file mode 100644 index 0000000000..46db64cdf9 --- /dev/null +++ b/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/packages/templating/templates/repository/item/template-item.store.ts b/src/packages/templating/templates/repository/item/template-item.store.ts index 7093c64520..ca7dbf96e6 100644 --- a/src/packages/templating/templates/repository/item/template-item.store.ts +++ b/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/packages/templating/templates/tree/index.ts b/src/packages/templating/templates/tree/index.ts index 6552e9138b..2d83f31961 100644 --- a/src/packages/templating/templates/tree/index.ts +++ b/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/packages/templating/templates/tree/template-tree.repository.ts b/src/packages/templating/templates/tree/template-tree.repository.ts index 77ec7b89aa..c8673ccdf1 100644 --- a/src/packages/templating/templates/tree/template-tree.repository.ts +++ b/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/packages/templating/templates/tree/template-tree.store.context-token.ts b/src/packages/templating/templates/tree/template-tree.store.context-token.ts new file mode 100644 index 0000000000..19ae9353be --- /dev/null +++ b/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/packages/templating/templates/tree/template-tree.store.ts b/src/packages/templating/templates/tree/template-tree.store.ts index 26c8e5e624..9b1bb99a7a 100644 --- a/src/packages/templating/templates/tree/template-tree.store.ts +++ b/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/packages/templating/templates/workspace/template-workspace-editor.element.ts b/src/packages/templating/templates/workspace/template-workspace-editor.element.ts index 29ebab9530..5fe27ad2ab 100644 --- a/src/packages/templating/templates/workspace/template-workspace-editor.element.ts +++ b/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/packages/templating/templates/workspace/template-workspace.context-token.ts b/src/packages/templating/templates/workspace/template-workspace.context-token.ts index 6c6b390703..6564f95019 100644 --- a/src/packages/templating/templates/workspace/template-workspace.context-token.ts +++ b/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/packages/templating/umbraco-package.ts b/src/packages/templating/umbraco-package.ts index bb38899cf5..0aafd8af65 100644 --- a/src/packages/templating/umbraco-package.ts +++ b/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/packages/templating/vite.config.ts b/src/packages/templating/vite.config.ts new file mode 100644 index 0000000000..4f5b9cd8e9 --- /dev/null +++ b/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', + }, + }), +});