@umbraco-cms/backoffice 14.0.0--preview005-2dd3b083 → 14.0.0--preview005-7ef2bd26

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 (56) hide show
  1. package/dist-cms/apps/app/app.element.js +19 -15
  2. package/dist-cms/custom-elements.json +40 -6
  3. package/dist-cms/libs/element-api/element.mixin.d.ts +3 -3
  4. package/dist-cms/libs/element-api/element.mixin.js +2 -2
  5. package/dist-cms/libs/extension-api/registry/extension.registry.d.ts +19 -0
  6. package/dist-cms/libs/extension-api/registry/extension.registry.js +42 -1
  7. package/dist-cms/libs/localization-api/index.d.ts +2 -2
  8. package/dist-cms/libs/localization-api/index.js +2 -2
  9. package/dist-cms/libs/localization-api/{localize.controller.d.ts → localization.controller.d.ts} +6 -4
  10. package/dist-cms/libs/localization-api/{localize.controller.js → localization.controller.js} +34 -24
  11. package/dist-cms/libs/localization-api/localization.manager.d.ts +29 -0
  12. package/dist-cms/libs/localization-api/localization.manager.js +94 -0
  13. package/dist-cms/mocks/data/data-type/data-type.data.js +7 -0
  14. package/dist-cms/mocks/data/document-type/document-type.data.js +26 -0
  15. package/dist-cms/packages/block/block/workspace/block-workspace.context.js +0 -1
  16. package/dist-cms/packages/block/block-grid/property-editors/block-grid-group-configuration/manifests.d.ts +2 -0
  17. package/dist-cms/packages/block/block-grid/property-editors/block-grid-group-configuration/manifests.js +11 -0
  18. package/dist-cms/packages/block/block-grid/property-editors/block-grid-group-configuration/property-editor-ui-block-grid-group-configuration.element.d.ts +19 -0
  19. package/dist-cms/packages/block/block-grid/property-editors/block-grid-group-configuration/property-editor-ui-block-grid-group-configuration.element.js +61 -0
  20. package/dist-cms/packages/block/block-grid/property-editors/block-grid-type-configuration/property-editor-ui-block-grid-type-configuration.element.d.ts +10 -3
  21. package/dist-cms/packages/block/block-grid/property-editors/block-grid-type-configuration/property-editor-ui-block-grid-type-configuration.element.js +130 -11
  22. package/dist-cms/packages/block/block-grid/property-editors/manifests.js +8 -1
  23. package/dist-cms/packages/block/block-grid/types.d.ts +9 -2
  24. package/dist-cms/packages/block/block-grid/types.js +1 -1
  25. package/dist-cms/packages/block/block-list/property-editors/block-list-type-configuration/property-editor-ui-block-list-type-configuration.element.d.ts +3 -0
  26. package/dist-cms/packages/block/block-list/property-editors/block-list-type-configuration/property-editor-ui-block-list-type-configuration.element.js +41 -3
  27. package/dist-cms/packages/block/block-list/types.d.ts +1 -0
  28. package/dist-cms/packages/block/block-list/types.js +1 -1
  29. package/dist-cms/packages/block/block-type/components/index.d.ts +1 -1
  30. package/dist-cms/packages/block/block-type/components/index.js +1 -1
  31. package/dist-cms/packages/block/block-type/components/input-block-type/input-block-type.element.d.ts +1 -3
  32. package/dist-cms/packages/block/block-type/components/input-block-type/input-block-type.element.js +42 -46
  33. package/dist-cms/packages/block/block-type/workspace/block-type-workspace.context.d.ts +4 -4
  34. package/dist-cms/packages/block/block-type/workspace/block-type-workspace.context.js +3 -1
  35. package/dist-cms/packages/block/block-type/workspace/block-type-workspace.element.js +4 -2
  36. package/dist-cms/packages/core/localization/registry/localization.registry.d.ts +3 -3
  37. package/dist-cms/packages/core/localization/registry/localization.registry.js +59 -60
  38. package/dist-cms/packages/core/tree/tree-menu-item-default/tree-menu-item-default.element.js +1 -1
  39. package/dist-cms/packages/documents/document-types/workspace/views/design/document-type-workspace-view-edit.element.js +1 -1
  40. package/dist-cms/packages/media/media-types/workspace/views/design/media-type-workspace-view-edit.element.js +1 -1
  41. package/dist-cms/packages/user/current-user/current-user.context.js +2 -7
  42. package/dist-cms/shared/auth/auth-flow.d.ts +0 -2
  43. package/dist-cms/shared/auth/auth-flow.js +28 -9
  44. package/dist-cms/shared/auth/auth.context.d.ts +14 -5
  45. package/dist-cms/shared/auth/auth.context.js +15 -3
  46. package/dist-cms/shared/auth/auth.context.token.d.ts +4 -2
  47. package/dist-cms/shared/auth/auth.context.token.js +2 -0
  48. package/dist-cms/shared/auth/index.d.ts +0 -1
  49. package/dist-cms/shared/auth/index.js +0 -1
  50. package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
  51. package/dist-cms/vscode-html-custom-data.json +23 -5
  52. package/package.json +1 -1
  53. package/dist-cms/libs/localization-api/manager.d.ts +0 -18
  54. package/dist-cms/libs/localization-api/manager.js +0 -40
  55. package/dist-cms/shared/auth/auth.context.interface.d.ts +0 -39
  56. package/dist-cms/shared/auth/auth.context.interface.js +0 -1
@@ -0,0 +1,2 @@
1
+ import type { ManifestPropertyEditorUi } from '../../../../core/extension-registry/index.js';
2
+ export declare const manifest: ManifestPropertyEditorUi;
@@ -0,0 +1,11 @@
1
+ export const manifest = {
2
+ type: 'propertyEditorUi',
3
+ alias: 'Umb.PropertyEditorUi.BlockTypeGroupConfiguration',
4
+ name: 'Block Grid Group Configuration Property Editor UI',
5
+ js: () => import('./property-editor-ui-block-grid-group-configuration.element.js'),
6
+ meta: {
7
+ label: '',
8
+ icon: 'icon-box-alt',
9
+ group: 'common',
10
+ },
11
+ };
@@ -0,0 +1,19 @@
1
+ import type { UmbPropertyEditorUiElement } from '../../../../core/extension-registry/index.js';
2
+ import { UmbLitElement } from '../../../../../shared/lit-element/index.js';
3
+ import type { UmbPropertyEditorConfigCollection } from '../../../../core/property-editor/index.js';
4
+ import type { UmbBlockGridGroupType } from '../../../index.js';
5
+ export declare class UmbPropertyEditorUIBlockGridGroupConfigurationElement extends UmbLitElement implements UmbPropertyEditorUiElement {
6
+ #private;
7
+ private _value;
8
+ get value(): Array<UmbBlockGridGroupType>;
9
+ set value(value: Array<UmbBlockGridGroupType>);
10
+ set config(config: UmbPropertyEditorConfigCollection | undefined);
11
+ render(): import("lit-html").TemplateResult<1>;
12
+ static styles: import("../../../../../external/lit/index.js").CSSResult[];
13
+ }
14
+ export default UmbPropertyEditorUIBlockGridGroupConfigurationElement;
15
+ declare global {
16
+ interface HTMLElementTagNameMap {
17
+ 'umb-property-editor-ui-block-grid-group-configuration': UmbPropertyEditorUIBlockGridGroupConfigurationElement;
18
+ }
19
+ }
@@ -0,0 +1,61 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
+ };
12
+ var _UmbPropertyEditorUIBlockGridGroupConfigurationElement_instances, _UmbPropertyEditorUIBlockGridGroupConfigurationElement_addGroup;
13
+ import { html, customElement, property, css } from '../../../../../external/lit/index.js';
14
+ import { UmbLitElement } from '../../../../../shared/lit-element/index.js';
15
+ import { UmbTextStyles } from '../../../../../shared/style/index.js';
16
+ import { UmbId } from '../../../../core/id/index.js';
17
+ let UmbPropertyEditorUIBlockGridGroupConfigurationElement = class UmbPropertyEditorUIBlockGridGroupConfigurationElement extends UmbLitElement {
18
+ constructor() {
19
+ super(...arguments);
20
+ _UmbPropertyEditorUIBlockGridGroupConfigurationElement_instances.add(this);
21
+ this._value = [];
22
+ }
23
+ get value() {
24
+ return this._value;
25
+ }
26
+ set value(value) {
27
+ this._value = value || [];
28
+ }
29
+ set config(config) { }
30
+ render() {
31
+ return html `
32
+ <uui-button label=${this.localize.term('blockEditor_addBlockGroup')} look="placeholder" @click=${__classPrivateFieldGet(this, _UmbPropertyEditorUIBlockGridGroupConfigurationElement_instances, "m", _UmbPropertyEditorUIBlockGridGroupConfigurationElement_addGroup)}>
33
+ ${this.localize.term('blockEditor_addBlockGroup')}
34
+ </uui-button>
35
+ `;
36
+ }
37
+ };
38
+ _UmbPropertyEditorUIBlockGridGroupConfigurationElement_instances = new WeakSet();
39
+ _UmbPropertyEditorUIBlockGridGroupConfigurationElement_addGroup = function _UmbPropertyEditorUIBlockGridGroupConfigurationElement_addGroup() {
40
+ this.value = [...this._value, { name: 'Unnamed group', key: UmbId.new() }];
41
+ this.dispatchEvent(new CustomEvent('property-value-change'));
42
+ };
43
+ UmbPropertyEditorUIBlockGridGroupConfigurationElement.styles = [
44
+ UmbTextStyles,
45
+ css `
46
+ uui-button {
47
+ display: block;
48
+ }
49
+ `,
50
+ ];
51
+ __decorate([
52
+ property({ type: Array })
53
+ ], UmbPropertyEditorUIBlockGridGroupConfigurationElement.prototype, "value", null);
54
+ __decorate([
55
+ property({ attribute: false })
56
+ ], UmbPropertyEditorUIBlockGridGroupConfigurationElement.prototype, "config", null);
57
+ UmbPropertyEditorUIBlockGridGroupConfigurationElement = __decorate([
58
+ customElement('umb-property-editor-ui-block-grid-group-configuration')
59
+ ], UmbPropertyEditorUIBlockGridGroupConfigurationElement);
60
+ export { UmbPropertyEditorUIBlockGridGroupConfigurationElement };
61
+ export default UmbPropertyEditorUIBlockGridGroupConfigurationElement;
@@ -1,14 +1,21 @@
1
- import type { UmbBlockTypeBaseModel } from '../../../block-type/index.js';
1
+ import type { UmbBlockTypeWithGroupKey } from '../../../block-type/index.js';
2
2
  import '../../../block-type/components/input-block-type/index.js';
3
3
  import type { UmbPropertyEditorUiElement } from '../../../../core/extension-registry/index.js';
4
- import type { UmbPropertyEditorConfigCollection } from '../../../../core/property-editor/index.js';
4
+ import { type UmbPropertyEditorConfigCollection } from '../../../../core/property-editor/index.js';
5
5
  import { UmbLitElement } from '../../../../../shared/lit-element/index.js';
6
6
  /**
7
7
  * @element umb-property-editor-ui-block-grid-type-configuration
8
8
  */
9
9
  export declare class UmbPropertyEditorUIBlockGridTypeConfigurationElement extends UmbLitElement implements UmbPropertyEditorUiElement {
10
- value: UmbBlockTypeBaseModel[];
10
+ #private;
11
+ private _value;
12
+ get value(): Array<UmbBlockTypeWithGroupKey>;
13
+ set value(value: Array<UmbBlockTypeWithGroupKey>);
11
14
  config?: UmbPropertyEditorConfigCollection;
15
+ private _blockGroups;
16
+ private _mappedValuesAndGroups;
17
+ private _workspacePath?;
18
+ constructor();
12
19
  render(): import("lit-html").TemplateResult<1>;
13
20
  static styles: import("../../../../../external/lit/index.js").CSSResult[];
14
21
  }
@@ -4,34 +4,153 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
8
+ if (kind === "m") throw new TypeError("Private method is not writable");
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
11
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
12
+ };
13
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
14
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
15
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
16
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
17
+ };
18
+ var _UmbPropertyEditorUIBlockGridTypeConfigurationElement_instances, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_datasetContext, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_blockTypeWorkspaceModalRegistration, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_observeProperties, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_mapValuesToBlockGroups, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_onChange, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_onCreate, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_deleteGroup, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_changeGroupName, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_renderGroupInput;
7
19
  import '../../../block-type/components/input-block-type/index.js';
8
- import { html, customElement, property } from '../../../../../external/lit/index.js';
20
+ import { html, customElement, property, state, repeat, nothing, css } from '../../../../../external/lit/index.js';
21
+ import { UmbPropertyValueChangeEvent, } from '../../../../core/property-editor/index.js';
9
22
  import { UmbTextStyles } from '../../../../../shared/style/index.js';
10
23
  import { UmbLitElement } from '../../../../../shared/lit-element/index.js';
24
+ import { UMB_BLOCK_GRID_TYPE, } from '../../../index.js';
25
+ import { UMB_PROPERTY_DATASET_CONTEXT } from '../../../../core/property/index.js';
26
+ import { UMB_WORKSPACE_MODAL, UmbModalRouteRegistrationController } from '../../../../core/modal/index.js';
11
27
  /**
12
28
  * @element umb-property-editor-ui-block-grid-type-configuration
13
29
  */
14
30
  let UmbPropertyEditorUIBlockGridTypeConfigurationElement = class UmbPropertyEditorUIBlockGridTypeConfigurationElement extends UmbLitElement {
31
+ get value() {
32
+ return this._value;
33
+ }
34
+ set value(value) {
35
+ this._value = value ?? [];
36
+ }
15
37
  constructor() {
16
- super(...arguments);
17
- this.value = [];
38
+ super();
39
+ _UmbPropertyEditorUIBlockGridTypeConfigurationElement_instances.add(this);
40
+ _UmbPropertyEditorUIBlockGridTypeConfigurationElement_datasetContext.set(this, void 0);
41
+ _UmbPropertyEditorUIBlockGridTypeConfigurationElement_blockTypeWorkspaceModalRegistration.set(this, void 0);
42
+ this._value = [];
43
+ this._blockGroups = [];
44
+ this._mappedValuesAndGroups = [];
45
+ this.consumeContext(UMB_PROPERTY_DATASET_CONTEXT, async (instance) => {
46
+ __classPrivateFieldSet(this, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_datasetContext, instance, "f");
47
+ __classPrivateFieldGet(this, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_instances, "m", _UmbPropertyEditorUIBlockGridTypeConfigurationElement_observeProperties).call(this);
48
+ });
49
+ __classPrivateFieldGet(this, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_blockTypeWorkspaceModalRegistration, "f")?.destroy();
50
+ __classPrivateFieldSet(this, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_blockTypeWorkspaceModalRegistration, new UmbModalRouteRegistrationController(this, UMB_WORKSPACE_MODAL)
51
+ .addAdditionalPath(UMB_BLOCK_GRID_TYPE)
52
+ .onSetup(() => {
53
+ return { data: { entityType: UMB_BLOCK_GRID_TYPE, preset: {} }, modal: { size: 'large' } };
54
+ })
55
+ .observeRouteBuilder((routeBuilder) => {
56
+ const newpath = routeBuilder({});
57
+ this._workspacePath = newpath;
58
+ }), "f");
18
59
  }
19
60
  render() {
20
- return html `<umb-input-block-type
21
- entity-type="block-grid-type"
22
- .value=${this.value}
23
- @change=${(e) => {
24
- this.value = e.target.value;
25
- }}></umb-input-block-type>`;
61
+ return html `${repeat(this._mappedValuesAndGroups, (group) => group.key, (group) => html `${group.key ? __classPrivateFieldGet(this, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_instances, "m", _UmbPropertyEditorUIBlockGridTypeConfigurationElement_renderGroupInput).call(this, group.key, group.name) : nothing}
62
+ <umb-input-block-type
63
+ .value=${group.blocks}
64
+ .workspacePath=${this._workspacePath}
65
+ @create=${(e) => __classPrivateFieldGet(this, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_instances, "m", _UmbPropertyEditorUIBlockGridTypeConfigurationElement_onCreate).call(this, e, group.key ?? null)}
66
+ @change=${(e) => __classPrivateFieldGet(this, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_instances, "m", _UmbPropertyEditorUIBlockGridTypeConfigurationElement_onChange).call(this, e, group.key)}></umb-input-block-type>`)}`;
26
67
  }
27
68
  };
28
- UmbPropertyEditorUIBlockGridTypeConfigurationElement.styles = [UmbTextStyles];
69
+ _UmbPropertyEditorUIBlockGridTypeConfigurationElement_datasetContext = new WeakMap();
70
+ _UmbPropertyEditorUIBlockGridTypeConfigurationElement_blockTypeWorkspaceModalRegistration = new WeakMap();
71
+ _UmbPropertyEditorUIBlockGridTypeConfigurationElement_instances = new WeakSet();
72
+ _UmbPropertyEditorUIBlockGridTypeConfigurationElement_observeProperties = async function _UmbPropertyEditorUIBlockGridTypeConfigurationElement_observeProperties() {
73
+ if (!__classPrivateFieldGet(this, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_datasetContext, "f"))
74
+ return;
75
+ this.observe(await __classPrivateFieldGet(this, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_datasetContext, "f").propertyValueByAlias('blockGroups'), (value) => {
76
+ this._blockGroups = value ?? [];
77
+ __classPrivateFieldGet(this, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_instances, "m", _UmbPropertyEditorUIBlockGridTypeConfigurationElement_mapValuesToBlockGroups).call(this);
78
+ });
79
+ this.observe(await __classPrivateFieldGet(this, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_datasetContext, "f").propertyValueByAlias('blocks'), () => {
80
+ __classPrivateFieldGet(this, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_instances, "m", _UmbPropertyEditorUIBlockGridTypeConfigurationElement_mapValuesToBlockGroups).call(this);
81
+ });
82
+ };
83
+ _UmbPropertyEditorUIBlockGridTypeConfigurationElement_mapValuesToBlockGroups = function _UmbPropertyEditorUIBlockGridTypeConfigurationElement_mapValuesToBlockGroups() {
84
+ // What if a block is in a group that does not exist in the block groups? Should it be removed? (Right now they will never be rendered)
85
+ const valuesWithNoGroup = this._value.filter((value) => !value.groupKey);
86
+ const valuesWithGroup = this._blockGroups.map((group) => {
87
+ return { name: group.name, key: group.key, blocks: this._value.filter((value) => value.groupKey === group.key) };
88
+ });
89
+ this._mappedValuesAndGroups = [{ blocks: valuesWithNoGroup }, ...valuesWithGroup];
90
+ };
91
+ _UmbPropertyEditorUIBlockGridTypeConfigurationElement_onChange = function _UmbPropertyEditorUIBlockGridTypeConfigurationElement_onChange(e, groupKey) {
92
+ const updatedValues = e.target.value.map((value) => ({ ...value, groupKey }));
93
+ const filteredValues = this.value.filter((value) => value.groupKey !== groupKey);
94
+ this.value = [...filteredValues, ...updatedValues];
95
+ this.dispatchEvent(new UmbPropertyValueChangeEvent());
96
+ };
97
+ _UmbPropertyEditorUIBlockGridTypeConfigurationElement_onCreate = function _UmbPropertyEditorUIBlockGridTypeConfigurationElement_onCreate(e, groupKey) {
98
+ const selectedElementType = e.detail.contentElementTypeKey;
99
+ if (selectedElementType) {
100
+ __classPrivateFieldGet(this, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_blockTypeWorkspaceModalRegistration, "f")?.open({}, 'create/' + selectedElementType + '/' + groupKey);
101
+ }
102
+ };
103
+ _UmbPropertyEditorUIBlockGridTypeConfigurationElement_deleteGroup = function _UmbPropertyEditorUIBlockGridTypeConfigurationElement_deleteGroup(groupKey) {
104
+ __classPrivateFieldGet(this, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_datasetContext, "f")?.setPropertyValue('blockGroups', this._blockGroups.filter((group) => group.key !== groupKey));
105
+ // Should blocks that belonged to the removed group be deleted as well?
106
+ this.value = this._value.filter((block) => block.groupKey !== groupKey);
107
+ };
108
+ _UmbPropertyEditorUIBlockGridTypeConfigurationElement_changeGroupName = function _UmbPropertyEditorUIBlockGridTypeConfigurationElement_changeGroupName(e, groupKey) {
109
+ const groupName = e.target.value;
110
+ __classPrivateFieldGet(this, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_datasetContext, "f")?.setPropertyValue('blockGroups', this._blockGroups.map((group) => (group.key === groupKey ? { ...group, name: groupName } : group)));
111
+ };
112
+ _UmbPropertyEditorUIBlockGridTypeConfigurationElement_renderGroupInput = function _UmbPropertyEditorUIBlockGridTypeConfigurationElement_renderGroupInput(groupKey, groupName) {
113
+ return html `<uui-input
114
+ auto-width
115
+ label="Group"
116
+ .value=${groupName ?? ''}
117
+ @change=${(e) => __classPrivateFieldGet(this, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_instances, "m", _UmbPropertyEditorUIBlockGridTypeConfigurationElement_changeGroupName).call(this, e, groupKey)}>
118
+ <uui-button compact slot="append" label="delete" @click=${() => __classPrivateFieldGet(this, _UmbPropertyEditorUIBlockGridTypeConfigurationElement_instances, "m", _UmbPropertyEditorUIBlockGridTypeConfigurationElement_deleteGroup).call(this, groupKey)}>
119
+ <uui-icon name="icon-trash"></uui-icon>
120
+ </uui-button>
121
+ </uui-input>`;
122
+ };
123
+ UmbPropertyEditorUIBlockGridTypeConfigurationElement.styles = [
124
+ UmbTextStyles,
125
+ css `
126
+ uui-input {
127
+ margin-top: var(--uui-size-6);
128
+ margin-bottom: var(--uui-size-4);
129
+ }
130
+
131
+ uui-input:not(:hover, :focus) {
132
+ border: 1px solid transparent;
133
+ }
134
+ uui-input:not(:hover, :focus) uui-button {
135
+ opacity: 0;
136
+ }
137
+ `,
138
+ ];
29
139
  __decorate([
30
140
  property({ attribute: false })
31
- ], UmbPropertyEditorUIBlockGridTypeConfigurationElement.prototype, "value", void 0);
141
+ ], UmbPropertyEditorUIBlockGridTypeConfigurationElement.prototype, "value", null);
32
142
  __decorate([
33
143
  property({ type: Object, attribute: false })
34
144
  ], UmbPropertyEditorUIBlockGridTypeConfigurationElement.prototype, "config", void 0);
145
+ __decorate([
146
+ state()
147
+ ], UmbPropertyEditorUIBlockGridTypeConfigurationElement.prototype, "_blockGroups", void 0);
148
+ __decorate([
149
+ state()
150
+ ], UmbPropertyEditorUIBlockGridTypeConfigurationElement.prototype, "_mappedValuesAndGroups", void 0);
151
+ __decorate([
152
+ state()
153
+ ], UmbPropertyEditorUIBlockGridTypeConfigurationElement.prototype, "_workspacePath", void 0);
35
154
  UmbPropertyEditorUIBlockGridTypeConfigurationElement = __decorate([
36
155
  customElement('umb-property-editor-ui-block-grid-type-configuration')
37
156
  ], UmbPropertyEditorUIBlockGridTypeConfigurationElement);
@@ -2,4 +2,11 @@ import { manifest as blockGridEditor } from './block-grid-editor/manifests.js';
2
2
  import { manifest as blockGridLayoutStylesheet } from './block-grid-layout-stylesheet/manifests.js';
3
3
  import { manifest as blockGridTypeConfiguration } from './block-grid-type-configuration/manifests.js';
4
4
  import { manifest as blockGridColumnSpan } from './block-grid-column-span/manifests.js';
5
- export const manifests = [blockGridTypeConfiguration, blockGridEditor, blockGridLayoutStylesheet, blockGridColumnSpan];
5
+ import { manifest as blockGridGroupConfiguration } from './block-grid-group-configuration/manifests.js';
6
+ export const manifests = [
7
+ blockGridTypeConfiguration,
8
+ blockGridEditor,
9
+ blockGridLayoutStylesheet,
10
+ blockGridColumnSpan,
11
+ blockGridGroupConfiguration,
12
+ ];
@@ -1,4 +1,5 @@
1
- import type { UmbBlockTypeBaseModel } from '../block-type/index.js';
1
+ import type { UmbBlockTypeBaseModel, UmbBlockTypeWithGroupKey } from '../block-type/index.js';
2
+ export declare const UMB_BLOCK_GRID_TYPE = "block-grid-type";
2
3
  export interface UmbBlockGridType extends UmbBlockTypeBaseModel {
3
4
  columnSpanOptions: Array<number>;
4
5
  allowAtRoot: boolean;
@@ -8,5 +9,11 @@ export interface UmbBlockGridType extends UmbBlockTypeBaseModel {
8
9
  thumbnail?: string;
9
10
  areaGridColumns?: number;
10
11
  areas: Array<any>;
11
- groupKey: null | string;
12
+ }
13
+ export interface UmbBlockGridGroupType {
14
+ name: string;
15
+ key: string;
16
+ }
17
+ export interface UmbBlockGridGroupTypeConfiguration extends Partial<UmbBlockGridGroupType> {
18
+ blocks: Array<UmbBlockTypeWithGroupKey>;
12
19
  }
@@ -1 +1 @@
1
- export {};
1
+ export const UMB_BLOCK_GRID_TYPE = 'block-grid-type';
@@ -7,6 +7,9 @@ import { UmbLitElement } from '../../../../../shared/lit-element/index.js';
7
7
  * @element umb-property-editor-ui-block-list-type-configuration
8
8
  */
9
9
  export declare class UmbPropertyEditorUIBlockListBlockConfigurationElement extends UmbLitElement implements UmbPropertyEditorUiElement {
10
+ #private;
11
+ private _workspacePath?;
12
+ constructor();
10
13
  value: UmbBlockTypeBaseModel[];
11
14
  config?: UmbPropertyEditorConfigCollection;
12
15
  render(): import("lit-html").TemplateResult<1>;
@@ -4,28 +4,66 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
+ };
12
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
13
+ if (kind === "m") throw new TypeError("Private method is not writable");
14
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
15
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
16
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
17
+ };
18
+ var _UmbPropertyEditorUIBlockListBlockConfigurationElement_instances, _UmbPropertyEditorUIBlockListBlockConfigurationElement_blockTypeWorkspaceModalRegistration, _UmbPropertyEditorUIBlockListBlockConfigurationElement_onCreate;
7
19
  import '../../../block-type/components/input-block-type/index.js';
8
- import { html, customElement, property } from '../../../../../external/lit/index.js';
20
+ import { UMB_BLOCK_LIST_TYPE } from '../../types.js';
21
+ import { html, customElement, property, state } from '../../../../../external/lit/index.js';
9
22
  import { UmbTextStyles } from '../../../../../shared/style/index.js';
10
23
  import { UmbLitElement } from '../../../../../shared/lit-element/index.js';
24
+ import { UMB_WORKSPACE_MODAL, UmbModalRouteRegistrationController } from '../../../../core/modal/index.js';
11
25
  /**
12
26
  * @element umb-property-editor-ui-block-list-type-configuration
13
27
  */
14
28
  let UmbPropertyEditorUIBlockListBlockConfigurationElement = class UmbPropertyEditorUIBlockListBlockConfigurationElement extends UmbLitElement {
15
29
  constructor() {
16
- super(...arguments);
30
+ super();
31
+ _UmbPropertyEditorUIBlockListBlockConfigurationElement_instances.add(this);
32
+ _UmbPropertyEditorUIBlockListBlockConfigurationElement_blockTypeWorkspaceModalRegistration.set(this, void 0);
17
33
  this.value = [];
34
+ __classPrivateFieldGet(this, _UmbPropertyEditorUIBlockListBlockConfigurationElement_blockTypeWorkspaceModalRegistration, "f")?.destroy();
35
+ __classPrivateFieldSet(this, _UmbPropertyEditorUIBlockListBlockConfigurationElement_blockTypeWorkspaceModalRegistration, new UmbModalRouteRegistrationController(this, UMB_WORKSPACE_MODAL)
36
+ .addAdditionalPath(UMB_BLOCK_LIST_TYPE)
37
+ .onSetup(() => {
38
+ return { data: { entityType: UMB_BLOCK_LIST_TYPE, preset: {} }, modal: { size: 'large' } };
39
+ })
40
+ .observeRouteBuilder((routeBuilder) => {
41
+ const newpath = routeBuilder({});
42
+ this._workspacePath = newpath;
43
+ }), "f");
18
44
  }
19
45
  render() {
20
46
  return html `<umb-input-block-type
21
- entity-type="block-list-type"
22
47
  .value=${this.value}
48
+ .workspacePath=${this._workspacePath}
49
+ @create=${__classPrivateFieldGet(this, _UmbPropertyEditorUIBlockListBlockConfigurationElement_instances, "m", _UmbPropertyEditorUIBlockListBlockConfigurationElement_onCreate)}
23
50
  @change=${(e) => {
24
51
  this.value = e.target.value;
25
52
  }}></umb-input-block-type>`;
26
53
  }
27
54
  };
55
+ _UmbPropertyEditorUIBlockListBlockConfigurationElement_blockTypeWorkspaceModalRegistration = new WeakMap();
56
+ _UmbPropertyEditorUIBlockListBlockConfigurationElement_instances = new WeakSet();
57
+ _UmbPropertyEditorUIBlockListBlockConfigurationElement_onCreate = function _UmbPropertyEditorUIBlockListBlockConfigurationElement_onCreate(e) {
58
+ const selectedElementType = e.detail.contentElementTypeKey;
59
+ if (selectedElementType) {
60
+ __classPrivateFieldGet(this, _UmbPropertyEditorUIBlockListBlockConfigurationElement_blockTypeWorkspaceModalRegistration, "f")?.open({}, 'create/' + selectedElementType + '/null');
61
+ }
62
+ };
28
63
  UmbPropertyEditorUIBlockListBlockConfigurationElement.styles = [UmbTextStyles];
64
+ __decorate([
65
+ state()
66
+ ], UmbPropertyEditorUIBlockListBlockConfigurationElement.prototype, "_workspacePath", void 0);
29
67
  __decorate([
30
68
  property({ attribute: false })
31
69
  ], UmbPropertyEditorUIBlockListBlockConfigurationElement.prototype, "value", void 0);
@@ -1,5 +1,6 @@
1
1
  import type { UmbBlockTypeBaseModel } from '../block-type/index.js';
2
2
  import type { UmbBlockLayoutBaseModel } from '../index.js';
3
+ export declare const UMB_BLOCK_LIST_TYPE = "block-list-type";
3
4
  export interface UmbBlockListTypeModel extends UmbBlockTypeBaseModel {
4
5
  }
5
6
  export interface UmbBlockListLayoutModel extends UmbBlockLayoutBaseModel {
@@ -1 +1 @@
1
- export {};
1
+ export const UMB_BLOCK_LIST_TYPE = 'block-list-type';
@@ -1,2 +1,2 @@
1
- export * from './input-block-type/index.js';
2
1
  export * from './block-type-card/index.js';
2
+ export * from './input-block-type/index.js';
@@ -1,2 +1,2 @@
1
- export * from './input-block-type/index.js';
2
1
  export * from './block-type-card/index.js';
2
+ export * from './input-block-type/index.js';
@@ -5,10 +5,8 @@ export declare class UmbInputBlockTypeElement<BlockType extends UmbBlockTypeBase
5
5
  #private;
6
6
  get value(): BlockType[];
7
7
  set value(items: BlockType[]);
8
- get entityType(): string | undefined;
9
- set entityType(entityType: string | undefined);
8
+ workspacePath?: string;
10
9
  private _items;
11
- private _workspacePath?;
12
10
  constructor();
13
11
  create(): void;
14
12
  deleteItem(contentElementTypeKey: string): void;
@@ -4,65 +4,52 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
- };
12
7
  var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
13
8
  if (kind === "m") throw new TypeError("Private method is not writable");
14
9
  if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
15
10
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
16
11
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
17
12
  };
18
- var _UmbInputBlockTypeElement_instances, _UmbInputBlockTypeElement_entityType, _UmbInputBlockTypeElement_blockTypeWorkspaceModalRegistration, _UmbInputBlockTypeElement_renderButton, _UmbInputBlockTypeElement_renderItem;
19
- import { UMB_DOCUMENT_TYPE_PICKER_MODAL, UMB_MODAL_MANAGER_CONTEXT, UMB_WORKSPACE_MODAL, UmbModalRouteRegistrationController, } from '../../../../core/modal/index.js';
13
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
14
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
15
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
16
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
17
+ };
18
+ var _UmbInputBlockTypeElement_instances, _UmbInputBlockTypeElement_datasetContext, _UmbInputBlockTypeElement_filter, _UmbInputBlockTypeElement_renderItem, _UmbInputBlockTypeElement_renderButton;
19
+ import { UMB_DOCUMENT_TYPE_PICKER_MODAL, UMB_MODAL_MANAGER_CONTEXT } from '../../../../core/modal/index.js';
20
20
  import '../block-type-card/index.js';
21
21
  import { css, html, customElement, property, state, repeat } from '../../../../../external/lit/index.js';
22
22
  import { UmbLitElement } from '../../../../../shared/lit-element/index.js';
23
+ import { UMB_PROPERTY_DATASET_CONTEXT } from '../../../../core/property/index.js';
23
24
  import { UmbChangeEvent } from '../../../../core/event/index.js';
24
25
  let UmbInputBlockTypeElement = class UmbInputBlockTypeElement extends UmbLitElement {
25
- //
26
26
  get value() {
27
27
  return this._items;
28
28
  }
29
29
  set value(items) {
30
30
  this._items = items ?? [];
31
31
  }
32
- get entityType() {
33
- return __classPrivateFieldGet(this, _UmbInputBlockTypeElement_entityType, "f");
34
- }
35
- set entityType(entityType) {
36
- __classPrivateFieldSet(this, _UmbInputBlockTypeElement_entityType, entityType, "f");
37
- __classPrivateFieldGet(this, _UmbInputBlockTypeElement_blockTypeWorkspaceModalRegistration, "f")?.destroy();
38
- if (entityType) {
39
- // TODO: Make specific modal token that requires data.
40
- __classPrivateFieldSet(this, _UmbInputBlockTypeElement_blockTypeWorkspaceModalRegistration, new UmbModalRouteRegistrationController(this, UMB_WORKSPACE_MODAL)
41
- .addAdditionalPath(entityType)
42
- .onSetup(() => {
43
- return { data: { entityType: entityType, preset: {} }, modal: { size: 'large' } };
44
- })
45
- .observeRouteBuilder((routeBuilder) => {
46
- const newpath = routeBuilder({});
47
- this._workspacePath = newpath;
48
- }), "f");
49
- }
50
- }
51
32
  constructor() {
52
33
  super();
53
34
  _UmbInputBlockTypeElement_instances.add(this);
54
- _UmbInputBlockTypeElement_entityType.set(this, void 0);
55
35
  this._items = [];
56
- _UmbInputBlockTypeElement_blockTypeWorkspaceModalRegistration.set(this, void 0);
36
+ _UmbInputBlockTypeElement_datasetContext.set(this, void 0);
37
+ _UmbInputBlockTypeElement_filter.set(this, []);
57
38
  _UmbInputBlockTypeElement_renderItem.set(this, (item) => {
58
39
  return html `
59
40
  <umb-block-type-card
60
- .workspacePath=${this._workspacePath}
41
+ .workspacePath=${this.workspacePath}
61
42
  .key=${item.contentElementTypeKey}
62
43
  @delete=${() => this.deleteItem(item.contentElementTypeKey)}>
63
44
  </umb-block-type-card>
64
45
  `;
65
46
  });
47
+ this.consumeContext(UMB_PROPERTY_DATASET_CONTEXT, async (instance) => {
48
+ __classPrivateFieldSet(this, _UmbInputBlockTypeElement_datasetContext, instance, "f");
49
+ this.observe(await __classPrivateFieldGet(this, _UmbInputBlockTypeElement_datasetContext, "f")?.propertyValueByAlias('blocks'), (value) => {
50
+ __classPrivateFieldSet(this, _UmbInputBlockTypeElement_filter, value, "f");
51
+ });
52
+ });
66
53
  }
67
54
  create() {
68
55
  this.consumeContext(UMB_MODAL_MANAGER_CONTEXT, async (modalManager) => {
@@ -76,34 +63,33 @@ let UmbInputBlockTypeElement = class UmbInputBlockTypeElement extends UmbLitElem
76
63
  // Only pick elements:
77
64
  docType.isElement &&
78
65
  // Prevent picking the an already used element type:
79
- this._items.find((x) => x.contentElementTypeKey === docType.unique) === undefined,
66
+ __classPrivateFieldGet(this, _UmbInputBlockTypeElement_filter, "f") &&
67
+ __classPrivateFieldGet(this, _UmbInputBlockTypeElement_filter, "f").find((x) => x.contentElementTypeKey === docType.unique) === undefined,
80
68
  },
81
69
  });
82
70
  const modalValue = await modalContext?.onSubmit();
83
71
  const selectedElementType = modalValue.selection[0];
84
72
  if (selectedElementType) {
85
- __classPrivateFieldGet(this, _UmbInputBlockTypeElement_blockTypeWorkspaceModalRegistration, "f")?.open({}, 'create/' + selectedElementType);
73
+ this.dispatchEvent(new CustomEvent('create', { detail: { contentElementTypeKey: selectedElementType } }));
86
74
  }
87
75
  }
88
76
  });
89
- // No need to fire a change event, as all changes are made directly to the property, via context api.
90
77
  }
91
78
  deleteItem(contentElementTypeKey) {
92
- this._items = this._items.filter((x) => x.contentElementTypeKey !== contentElementTypeKey);
79
+ this.value = this._items.filter((x) => x.contentElementTypeKey !== contentElementTypeKey);
93
80
  this.dispatchEvent(new UmbChangeEvent());
94
81
  }
95
82
  getFormElement() {
96
83
  return undefined;
97
84
  }
98
85
  render() {
99
- return html `
100
- ${this._items ? repeat(this._items, (item) => item.contentElementTypeKey, __classPrivateFieldGet(this, _UmbInputBlockTypeElement_renderItem, "f")) : ''}
101
- ${__classPrivateFieldGet(this, _UmbInputBlockTypeElement_instances, "m", _UmbInputBlockTypeElement_renderButton).call(this)}
102
- `;
86
+ return html `<div>
87
+ ${repeat(this.value, (block) => block.contentElementTypeKey, __classPrivateFieldGet(this, _UmbInputBlockTypeElement_renderItem, "f"))} ${__classPrivateFieldGet(this, _UmbInputBlockTypeElement_instances, "m", _UmbInputBlockTypeElement_renderButton).call(this)}
88
+ </div>`;
103
89
  }
104
90
  };
105
- _UmbInputBlockTypeElement_entityType = new WeakMap();
106
- _UmbInputBlockTypeElement_blockTypeWorkspaceModalRegistration = new WeakMap();
91
+ _UmbInputBlockTypeElement_datasetContext = new WeakMap();
92
+ _UmbInputBlockTypeElement_filter = new WeakMap();
107
93
  _UmbInputBlockTypeElement_renderItem = new WeakMap();
108
94
  _UmbInputBlockTypeElement_instances = new WeakSet();
109
95
  _UmbInputBlockTypeElement_renderButton = function _UmbInputBlockTypeElement_renderButton() {
@@ -116,7 +102,7 @@ _UmbInputBlockTypeElement_renderButton = function _UmbInputBlockTypeElement_rend
116
102
  };
117
103
  UmbInputBlockTypeElement.styles = [
118
104
  css `
119
- :host {
105
+ div {
120
106
  display: grid;
121
107
  gap: var(--uui-size-space-3);
122
108
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
@@ -125,6 +111,7 @@ UmbInputBlockTypeElement.styles = [
125
111
 
126
112
  #add-button {
127
113
  text-align: center;
114
+ min-height: 150px;
128
115
  height: 100%;
129
116
  }
130
117
 
@@ -132,20 +119,29 @@ UmbInputBlockTypeElement.styles = [
132
119
  display: block;
133
120
  margin: 0 auto;
134
121
  }
122
+
123
+ uui-input {
124
+ border: none;
125
+ margin: var(--uui-size-space-6) 0 var(--uui-size-space-4);
126
+ }
127
+
128
+ uui-input:hover uui-button {
129
+ opacity: 1;
130
+ }
131
+ uui-input uui-button {
132
+ opacity: 0;
133
+ }
135
134
  `,
136
135
  ];
137
136
  __decorate([
138
137
  property({ type: Array, attribute: false })
139
138
  ], UmbInputBlockTypeElement.prototype, "value", null);
140
139
  __decorate([
141
- property({ type: String, attribute: 'entity-type' })
142
- ], UmbInputBlockTypeElement.prototype, "entityType", null);
140
+ property({ type: String })
141
+ ], UmbInputBlockTypeElement.prototype, "workspacePath", void 0);
143
142
  __decorate([
144
143
  state()
145
144
  ], UmbInputBlockTypeElement.prototype, "_items", void 0);
146
- __decorate([
147
- state()
148
- ], UmbInputBlockTypeElement.prototype, "_workspacePath", void 0);
149
145
  UmbInputBlockTypeElement = __decorate([
150
146
  customElement('umb-input-block-type')
151
147
  ], UmbInputBlockTypeElement);