@umbraco-cms/backoffice 14.0.0-258b103a → 14.0.0-2a03783e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist-cms/apps/backoffice/backoffice.element.js +1 -1
  2. package/dist-cms/custom-elements.json +96 -95
  3. package/dist-cms/external/backend-api/index.js +1 -1
  4. package/dist-cms/mocks/data/partial-views.data.d.ts +19 -3
  5. package/dist-cms/mocks/data/partial-views.data.js +277 -10
  6. package/dist-cms/mocks/data/utils.d.ts +2 -1
  7. package/dist-cms/mocks/data/utils.js +5 -0
  8. package/dist-cms/mocks/handlers/partial-views.handlers.d.ts +2 -1
  9. package/dist-cms/mocks/handlers/partial-views.handlers.js +37 -5
  10. package/dist-cms/packages/core/entity-action/common/create-folder/create-folder.action.d.ts +8 -0
  11. package/dist-cms/packages/core/entity-action/common/create-folder/create-folder.action.js +21 -0
  12. package/dist-cms/packages/core/entity-action/common/index.d.ts +1 -0
  13. package/dist-cms/packages/core/entity-action/common/index.js +1 -0
  14. package/dist-cms/packages/core/modal/common/folder/folder-modal.element.js +4 -1
  15. package/dist-cms/packages/core/modal/token/folder-modal.token.d.ts +1 -0
  16. package/dist-cms/packages/core/section/section-default.element.js +1 -1
  17. package/dist-cms/packages/core/section/section-views/index.d.ts +1 -1
  18. package/dist-cms/packages/core/section/section-views/index.js +1 -1
  19. package/dist-cms/packages/{templating/components → core/tree}/file-system-tree-item/file-system-tree-item.context.d.ts +9 -1
  20. package/dist-cms/packages/core/tree/file-system-tree-item/file-system-tree-item.context.js +28 -0
  21. package/dist-cms/packages/{templating/components → core/tree}/file-system-tree-item/file-system-tree-item.element.d.ts +10 -2
  22. package/dist-cms/packages/{templating/components → core/tree}/file-system-tree-item/file-system-tree-item.element.js +10 -1
  23. package/dist-cms/packages/core/tree/file-system-tree-item/index.d.ts +2 -0
  24. package/dist-cms/packages/core/tree/file-system-tree-item/index.js +2 -0
  25. package/dist-cms/packages/core/tree/index.d.ts +1 -0
  26. package/dist-cms/packages/core/tree/index.js +1 -0
  27. package/dist-cms/packages/core/workspace/workspace-action/workspace-action.element.js +12 -4
  28. package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/export/export.action.d.ts +0 -1
  29. package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/export/export.action.js +0 -1
  30. package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/import/import.action.d.ts +0 -1
  31. package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/import/import.action.js +0 -1
  32. package/dist-cms/packages/dictionary/dictionary/index.d.ts +1 -0
  33. package/dist-cms/packages/dictionary/dictionary/index.js +1 -0
  34. package/dist-cms/packages/dictionary/dictionary/repository/index.d.ts +3 -0
  35. package/dist-cms/packages/dictionary/dictionary/repository/index.js +3 -0
  36. package/dist-cms/packages/{translation → dictionary}/dictionary/repository/manifests.js +1 -1
  37. package/dist-cms/packages/{translation → dictionary}/section.manifest.js +4 -4
  38. package/dist-cms/packages/{translation → dictionary}/umbraco-package.d.ts +1 -1
  39. package/dist-cms/packages/dictionary/umbraco-package.js +9 -0
  40. package/dist-cms/packages/settings/dashboards/published-status/dashboard-published-status.element.js +11 -3
  41. package/dist-cms/packages/settings/languages/workspace/language/language-workspace.element.d.ts +0 -1
  42. package/dist-cms/packages/settings/languages/workspace/language/language-workspace.element.js +0 -1
  43. package/dist-cms/packages/templating/components/index.d.ts +0 -1
  44. package/dist-cms/packages/templating/components/index.js +0 -1
  45. package/dist-cms/packages/templating/components/insert-menu/templating-insert-menu.element.js +1 -1
  46. package/dist-cms/packages/templating/manifests.d.ts +6 -1
  47. package/dist-cms/packages/templating/partial-views/config.d.ts +5 -5
  48. package/dist-cms/packages/templating/partial-views/config.js +3 -1
  49. package/dist-cms/packages/templating/partial-views/entity-actions/create/create-empty.action.js +1 -1
  50. package/dist-cms/packages/templating/partial-views/entity-actions/create/create-from-snippet.action.d.ts +10 -1
  51. package/dist-cms/packages/templating/partial-views/entity-actions/create/create-from-snippet.action.js +16 -1
  52. package/dist-cms/packages/templating/partial-views/entity-actions/create/create-from-snippet.modal.d.ts +16 -0
  53. package/dist-cms/packages/templating/partial-views/entity-actions/create/create-from-snippet.modal.js +73 -0
  54. package/dist-cms/packages/templating/partial-views/entity-actions/manifests.d.ts +6 -1
  55. package/dist-cms/packages/templating/partial-views/entity-actions/manifests.js +43 -5
  56. package/dist-cms/packages/templating/partial-views/manifests.d.ts +6 -1
  57. package/dist-cms/packages/templating/partial-views/repository/manifests.js +2 -2
  58. package/dist-cms/packages/templating/partial-views/repository/partial-views.repository.d.ts +47 -26
  59. package/dist-cms/packages/templating/partial-views/repository/partial-views.repository.js +81 -24
  60. package/dist-cms/packages/templating/partial-views/repository/sources/partial-views.detail.server.data.d.ts +48 -13
  61. package/dist-cms/packages/templating/partial-views/repository/sources/partial-views.detail.server.data.js +56 -17
  62. package/dist-cms/packages/templating/partial-views/repository/sources/partial-views.folder.server.data.d.ts +17 -0
  63. package/dist-cms/packages/templating/partial-views/repository/sources/partial-views.folder.server.data.js +23 -0
  64. package/dist-cms/packages/templating/partial-views/tree/manifests.js +3 -2
  65. package/dist-cms/packages/templating/partial-views/workspace/partial-views-workspace-edit.element.d.ts +6 -1
  66. package/dist-cms/packages/templating/partial-views/workspace/partial-views-workspace-edit.element.js +123 -27
  67. package/dist-cms/packages/templating/partial-views/workspace/partial-views-workspace.context.d.ts +9 -7
  68. package/dist-cms/packages/templating/partial-views/workspace/partial-views-workspace.context.js +49 -8
  69. package/dist-cms/packages/templating/partial-views/workspace/partial-views-workspace.element.d.ts +1 -0
  70. package/dist-cms/packages/templating/partial-views/workspace/partial-views-workspace.element.js +7 -3
  71. package/dist-cms/packages/templating/templates/modals/query-builder/query-builder.element.d.ts +1 -0
  72. package/dist-cms/packages/templating/templates/modals/query-builder/query-builder.element.js +1 -0
  73. package/dist-cms/shared/repository/data-source/data-source.interface.d.ts +2 -2
  74. package/dist-cms/shared/repository/detail-repository.interface.d.ts +2 -2
  75. package/dist-cms/tsconfig.tsbuildinfo +1 -1
  76. package/dist-cms/vscode-html-custom-data.json +45 -45
  77. package/package.json +19 -19
  78. package/dist-cms/packages/templating/components/file-system-tree-item/file-system-tree-item.context.js +0 -10
  79. package/dist-cms/packages/translation/umbraco-package.js +0 -9
  80. /package/dist-cms/packages/{translation → dictionary}/dashboards/dictionary/dashboard-translation-dictionary.element.d.ts +0 -0
  81. /package/dist-cms/packages/{translation → dictionary}/dashboards/dictionary/dashboard-translation-dictionary.element.js +0 -0
  82. /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/create/create-dictionary-modal.element.d.ts +0 -0
  83. /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/create/create-dictionary-modal.element.js +0 -0
  84. /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/create/create.action.d.ts +0 -0
  85. /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/create/create.action.js +0 -0
  86. /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/export/export-dictionary-modal.element.d.ts +0 -0
  87. /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/export/export-dictionary-modal.element.js +0 -0
  88. /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/import/import-dictionary-modal.element.d.ts +0 -0
  89. /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/import/import-dictionary-modal.element.js +0 -0
  90. /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/manifests.d.ts +0 -0
  91. /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/manifests.js +0 -0
  92. /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/reload.action.d.ts +0 -0
  93. /package/dist-cms/packages/{translation → dictionary}/dictionary/entity-actions/reload.action.js +0 -0
  94. /package/dist-cms/packages/{translation → dictionary}/dictionary/manifests.d.ts +0 -0
  95. /package/dist-cms/packages/{translation → dictionary}/dictionary/manifests.js +0 -0
  96. /package/dist-cms/packages/{translation → dictionary}/dictionary/menu-item/dictionary-menu-item.element.d.ts +0 -0
  97. /package/dist-cms/packages/{translation → dictionary}/dictionary/menu-item/dictionary-menu-item.element.js +0 -0
  98. /package/dist-cms/packages/{translation → dictionary}/dictionary/menu-item/manifests.d.ts +0 -0
  99. /package/dist-cms/packages/{translation → dictionary}/dictionary/menu-item/manifests.js +0 -0
  100. /package/dist-cms/packages/{translation → dictionary}/dictionary/menu.manifests.d.ts +0 -0
  101. /package/dist-cms/packages/{translation → dictionary}/dictionary/menu.manifests.js +0 -0
  102. /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/dictionary.repository.d.ts +0 -0
  103. /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/dictionary.repository.js +0 -0
  104. /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/dictionary.store.d.ts +0 -0
  105. /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/dictionary.store.js +0 -0
  106. /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/dictionary.tree.store.d.ts +0 -0
  107. /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/dictionary.tree.store.js +0 -0
  108. /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/manifests.d.ts +0 -0
  109. /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/sources/dictionary.detail.server.data.d.ts +0 -0
  110. /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/sources/dictionary.detail.server.data.js +0 -0
  111. /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/sources/dictionary.tree.server.data.d.ts +0 -0
  112. /package/dist-cms/packages/{translation → dictionary}/dictionary/repository/sources/dictionary.tree.server.data.js +0 -0
  113. /package/dist-cms/packages/{translation → dictionary}/dictionary/tree/manifests.d.ts +0 -0
  114. /package/dist-cms/packages/{translation → dictionary}/dictionary/tree/manifests.js +0 -0
  115. /package/dist-cms/packages/{translation → dictionary}/dictionary/workspace/dictionary-workspace-editor.element.d.ts +0 -0
  116. /package/dist-cms/packages/{translation → dictionary}/dictionary/workspace/dictionary-workspace-editor.element.js +0 -0
  117. /package/dist-cms/packages/{translation → dictionary}/dictionary/workspace/dictionary-workspace.context.d.ts +0 -0
  118. /package/dist-cms/packages/{translation → dictionary}/dictionary/workspace/dictionary-workspace.context.js +0 -0
  119. /package/dist-cms/packages/{translation → dictionary}/dictionary/workspace/dictionary-workspace.element.d.ts +0 -0
  120. /package/dist-cms/packages/{translation → dictionary}/dictionary/workspace/dictionary-workspace.element.js +0 -0
  121. /package/dist-cms/packages/{translation → dictionary}/dictionary/workspace/manifests.d.ts +0 -0
  122. /package/dist-cms/packages/{translation → dictionary}/dictionary/workspace/manifests.js +0 -0
  123. /package/dist-cms/packages/{translation → dictionary}/dictionary/workspace/views/editor/workspace-view-dictionary-editor.element.d.ts +0 -0
  124. /package/dist-cms/packages/{translation → dictionary}/dictionary/workspace/views/editor/workspace-view-dictionary-editor.element.js +0 -0
  125. /package/dist-cms/packages/{translation → dictionary}/manifests.d.ts +0 -0
  126. /package/dist-cms/packages/{translation → dictionary}/manifests.js +0 -0
  127. /package/dist-cms/packages/{translation → dictionary}/section.manifest.d.ts +0 -0
@@ -1,26 +1,62 @@
1
- import { UmbTemplateRepository } from '../repository/partial-views.repository.js';
2
- import { createObservablePart, UmbDeepState } from '../../../../libs/observable-api/index.js';
1
+ import { UmbPartialViewsRepository } from '../repository/partial-views.repository.js';
2
+ import { createObservablePart, UmbBooleanState, UmbDeepState } from '../../../../libs/observable-api/index.js';
3
3
  import { UmbWorkspaceContext } from '../../../core/workspace/index.js';
4
+ import { loadCodeEditor } from '../../code-editor/index.js';
4
5
  export class UmbPartialViewsWorkspaceContext extends UmbWorkspaceContext {
5
6
  getEntityId() {
6
- throw new Error('Method not implemented.');
7
+ return this.getData()?.path;
7
8
  }
8
9
  getEntityType() {
9
10
  throw new Error('Method not implemented.');
10
11
  }
11
12
  save() {
12
- throw new Error('Method not implemented.');
13
+ const partialView = this.getData();
14
+ if (!partialView)
15
+ return Promise.reject('Something went wrong, there is no data for partial view you want to save...');
16
+ if (this.getIsNew()) {
17
+ const createRequestBody = {
18
+ name: partialView.name,
19
+ content: partialView.content,
20
+ parentPath: partialView.path + '/',
21
+ };
22
+ this.repository.create(createRequestBody);
23
+ console.log('create');
24
+ return Promise.resolve();
25
+ }
26
+ if (!partialView.path)
27
+ return Promise.reject('There is no path');
28
+ const updateRequestBody = {
29
+ name: partialView.name,
30
+ existingPath: partialView.path,
31
+ content: partialView.content,
32
+ };
33
+ this.repository.save(partialView.path, updateRequestBody);
34
+ return Promise.resolve();
13
35
  }
14
36
  destroy() {
15
37
  throw new Error('Method not implemented.');
16
38
  }
17
39
  #data;
40
+ #isCodeEditorReady;
18
41
  constructor(host) {
19
- super(host, new UmbTemplateRepository(host));
42
+ super(host, new UmbPartialViewsRepository(host));
20
43
  this.#data = new UmbDeepState(undefined);
21
44
  this.data = this.#data.asObservable();
22
45
  this.name = createObservablePart(this.#data, (data) => data?.name);
23
46
  this.content = createObservablePart(this.#data, (data) => data?.content);
47
+ this.path = createObservablePart(this.#data, (data) => data?.path);
48
+ this.#isCodeEditorReady = new UmbBooleanState(false);
49
+ this.isCodeEditorReady = this.#isCodeEditorReady.asObservable();
50
+ this.#loadCodeEditor();
51
+ }
52
+ async #loadCodeEditor() {
53
+ try {
54
+ await loadCodeEditor();
55
+ this.#isCodeEditorReady.next(true);
56
+ }
57
+ catch (error) {
58
+ console.error(error);
59
+ }
24
60
  }
25
61
  getData() {
26
62
  return this.#data.getValue();
@@ -38,11 +74,16 @@ export class UmbPartialViewsWorkspaceContext extends UmbWorkspaceContext {
38
74
  this.#data.next(data);
39
75
  }
40
76
  }
41
- async create(parentKey) {
42
- const { data } = await this.repository.createScaffold(parentKey);
77
+ async create(parentKey, name = 'Empty') {
78
+ const { data } = await this.repository.createScaffold(parentKey, name);
79
+ const newPartial = {
80
+ ...data,
81
+ name: '',
82
+ path: parentKey ?? '',
83
+ };
43
84
  if (!data)
44
85
  return;
45
86
  this.setIsNew(true);
46
- this.#data.next(data);
87
+ this.#data.next(newPartial);
47
88
  }
48
89
  }
@@ -1,6 +1,7 @@
1
1
  import { UmbLitElement } from '../../../../shared/lit-element/index.js';
2
2
  import { UmbRoute } from '../../../../shared/router/index.js';
3
3
  import './partial-views-workspace-edit.element.js';
4
+ import '../../components/insert-menu/templating-insert-menu.element.js';
4
5
  export declare class UmbPartialViewsWorkspaceElement extends UmbLitElement {
5
6
  #private;
6
7
  _routes: UmbRoute[];
@@ -9,6 +9,7 @@ import { UUITextStyles } from '../../../../external/uui/index.js';
9
9
  import { css, html, customElement, state } from '../../../../external/lit/index.js';
10
10
  import { UmbLitElement } from '../../../../shared/lit-element/index.js';
11
11
  import './partial-views-workspace-edit.element.js';
12
+ import '../../components/insert-menu/templating-insert-menu.element.js';
12
13
  import { UmbWorkspaceIsNewRedirectController } from '../../../core/workspace/index.js';
13
14
  export let UmbPartialViewsWorkspaceElement = class UmbPartialViewsWorkspaceElement extends UmbLitElement {
14
15
  constructor() {
@@ -17,11 +18,13 @@ export let UmbPartialViewsWorkspaceElement = class UmbPartialViewsWorkspaceEleme
17
18
  this.#element = document.createElement('umb-partial-views-workspace-edit');
18
19
  this._routes = [
19
20
  {
20
- path: 'create/:parentKey',
21
+ path: 'create/:parentKey/:snippetName',
21
22
  component: () => this.#element,
22
23
  setup: async (component, info) => {
23
24
  const parentKey = info.match.params.parentKey;
24
- this.#partialViewsWorkspaceContext.create(parentKey);
25
+ const decodePath = decodeURIComponent(parentKey);
26
+ const snippetName = info.match.params.snippetName;
27
+ this.#partialViewsWorkspaceContext.create(decodePath === 'null' ? null : parentKey, snippetName);
25
28
  new UmbWorkspaceIsNewRedirectController(this, this.#partialViewsWorkspaceContext, this.shadowRoot.querySelector('umb-router-slot'));
26
29
  },
27
30
  },
@@ -30,7 +33,8 @@ export let UmbPartialViewsWorkspaceElement = class UmbPartialViewsWorkspaceEleme
30
33
  component: () => this.#element,
31
34
  setup: (component, info) => {
32
35
  const key = info.match.params.key;
33
- this.#partialViewsWorkspaceContext.load(key);
36
+ const decodePath = decodeURIComponent(key).replace('-cshtml', '.cshtml');
37
+ this.#partialViewsWorkspaceContext.load(decodePath);
34
38
  },
35
39
  },
36
40
  ];
@@ -1,4 +1,5 @@
1
1
  import { UmbModalBaseElement } from '../../../../../shared/modal/index.js';
2
+ import './query-builder-filter.element.js';
2
3
  export interface TemplateQueryBuilderModalData {
3
4
  hidePartialViews?: boolean;
4
5
  }
@@ -10,6 +10,7 @@ import { css, html, customElement, state, query, queryAll } from '../../../../..
10
10
  import { UmbModalBaseElement } from '../../../../../shared/modal/index.js';
11
11
  import { UMB_DOCUMENT_PICKER_MODAL, UMB_MODAL_MANAGER_CONTEXT_TOKEN, } from '../../../../core/modal/index.js';
12
12
  import { UmbDocumentRepository } from '../../../../documents/documents/index.js';
13
+ import './query-builder-filter.element.js';
13
14
  var SortOrder;
14
15
  (function (SortOrder) {
15
16
  SortOrder["Ascending"] = "ascending";
@@ -1,6 +1,6 @@
1
1
  import type { DataSourceResponse } from '../index.js';
2
- export interface UmbDataSource<CreateRequestType, CreateResponseType, UpdateRequestType, ResponseType> {
3
- createScaffold(parentId: string | null): Promise<DataSourceResponse<CreateRequestType>>;
2
+ export interface UmbDataSource<CreateRequestType, CreateResponseType, UpdateRequestType, ResponseType, CreateScaffoldPresetType = Partial<CreateRequestType>> {
3
+ createScaffold(parentId: string | null, preset?: Partial<CreateRequestType> | CreateScaffoldPresetType): Promise<DataSourceResponse<CreateRequestType>>;
4
4
  get(unique: string): Promise<DataSourceResponse<ResponseType>>;
5
5
  insert(data: CreateRequestType): Promise<DataSourceResponse<CreateResponseType>>;
6
6
  update(unique: string, data: UpdateRequestType): Promise<DataSourceResponse<ResponseType>>;
@@ -1,7 +1,7 @@
1
1
  import type { DataSourceResponse, UmbDataSourceErrorResponse } from './data-source/index.js';
2
2
  import { Observable } from '../../external/rxjs/index.js';
3
- export interface UmbDetailRepository<CreateRequestType = any, CreateResponseType = any, UpdateRequestType = any, ResponseType = any> {
4
- createScaffold(parentId: string | null, preset?: Partial<CreateRequestType>): Promise<DataSourceResponse<CreateRequestType>>;
3
+ export interface UmbDetailRepository<CreateRequestType = any, CreateResponseType = any, UpdateRequestType = any, ResponseType = any, CreateScaffoldPresetType = Partial<CreateRequestType>> {
4
+ createScaffold(parentId: string | null, preset?: Partial<CreateRequestType> | CreateScaffoldPresetType): Promise<DataSourceResponse<CreateRequestType>>;
5
5
  requestById(id: string): Promise<DataSourceResponse<ResponseType | undefined>>;
6
6
  byId(id: string): Promise<Observable<ResponseType | undefined>>;
7
7
  create(data: CreateRequestType): Promise<DataSourceResponse<CreateResponseType>>;