Skip to content

Commit

Permalink
Merge pull request #2064 from umbraco/v14/chore/bundle-templating-pac…
Browse files Browse the repository at this point in the history
…kage

Bundling: Templating package
  • Loading branch information
iOvergaard authored Jul 3, 2024
2 parents 28ea2f4 + 89d9e37 commit 391065f
Show file tree
Hide file tree
Showing 106 changed files with 260 additions and 179 deletions.
8 changes: 7 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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<never> {
export class UmbCreateDocumentBlueprintEntityAction extends UmbEntityActionBase<never> {
constructor(host: UmbControllerHost, args: UmbEntityActionArgs<never>) {
super(host, args);
}
Expand All @@ -31,4 +31,4 @@ export class UmbCreateEntityAction extends UmbEntityActionBase<never> {
}
}

export default UmbCreateEntityAction;
export default UmbCreateDocumentBlueprintEntityAction;
1 change: 0 additions & 1 deletion src/packages/templating/components/index.ts

This file was deleted.

This file was deleted.

4 changes: 4 additions & 0 deletions src/packages/templating/entry-point.ts
Original file line number Diff line number Diff line change
@@ -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';
5 changes: 0 additions & 5 deletions src/packages/templating/index.ts

This file was deleted.

3 changes: 3 additions & 0 deletions src/packages/templating/local-components/insert-menu/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import './insert-menu.element.js';

export * from './insert-menu.element.js';
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/packages/templating/manifests.ts
Original file line number Diff line number Diff line change
@@ -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<ManifestTypes> = [
...menuManifests,
Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions src/packages/templating/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "@umbraco-backoffice/templating",
"private": true,
"type": "module",
"scripts": {
"build": "vite build"
}
}
Original file line number Diff line number Diff line change
@@ -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<never> {
constructor(host: UmbControllerHost, args: UmbEntityActionArgs<never>) {
Expand All @@ -23,3 +23,5 @@ export class UmbPartialViewCreateOptionsEntityAction extends UmbEntityActionBase
await modalContext.onSubmit();
}
}

export { UmbPartialViewCreateOptionsEntityAction as api };
Original file line number Diff line number Diff line change
@@ -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<ManifestTypes> = [
{
Expand All @@ -9,7 +8,7 @@ export const manifests: Array<ManifestTypes> = [
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',
Expand Down
Original file line number Diff line number Diff line change
@@ -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<UmbPartialViewItemModel> {
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);
}
}
2 changes: 1 addition & 1 deletion src/packages/templating/partial-views/index.ts
Original file line number Diff line number Diff line change
@@ -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';
2 changes: 1 addition & 1 deletion src/packages/templating/partial-views/repository/index.ts
Original file line number Diff line number Diff line change
@@ -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';
Original file line number Diff line number Diff line change
@@ -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';
Original file line number Diff line number Diff line change
@@ -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<UmbPartialViewItemModel> {
constructor(host: UmbControllerHost) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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>(
'UmbPartialViewItemStore',
);
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -22,7 +22,3 @@ export class UmbPartialViewItemStore extends UmbItemStoreBase<UmbPartialViewItem
}

export default UmbPartialViewItemStore;

export const UMB_PARTIAL_VIEW_ITEM_STORE_CONTEXT = new UmbContextToken<UmbPartialViewItemStore>(
'UmbPartialViewItemStore',
);
Original file line number Diff line number Diff line change
@@ -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<UmbPartialViewDetailModel> {
constructor(host: UmbControllerHost) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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>(
'UmbPartialViewDetailStore',
);
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -21,7 +21,3 @@ export class UmbPartialViewDetailStore extends UmbDetailStoreBase<UmbPartialView
}

export default UmbPartialViewDetailStore;

export const UMB_PARTIAL_VIEW_DETAIL_STORE_CONTEXT = new UmbContextToken<UmbPartialViewDetailStore>(
'UmbPartialViewDetailStore',
);
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
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';

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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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 };
2 changes: 1 addition & 1 deletion src/packages/templating/partial-views/tree/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Original file line number Diff line number Diff line change
@@ -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<UmbPartialViewTreeItemModel, UmbPartialViewTreeRootModel>
Expand Down
Original file line number Diff line number Diff line change
@@ -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>(
'UmbPartialViewTreeStore',
);
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -20,7 +20,3 @@ export class UmbPartialViewTreeStore extends UmbUniqueTreeStore {
}

export default UmbPartialViewTreeStore;

export const UMB_PARTIAL_VIEW_TREE_STORE_CONTEXT = new UmbContextToken<UmbPartialViewTreeStore>(
'UmbPartialViewTreeStore',
);
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Loading

0 comments on commit 391065f

Please sign in to comment.