@umbraco-cms/backoffice 15.0.0-rc3 → 15.0.0

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 (75) hide show
  1. package/dist-cms/custom-elements.json +20 -20
  2. package/dist-cms/libs/context-api/consume/context-request.event.d.ts +5 -0
  3. package/dist-cms/libs/context-api/consume/context-request.event.js +7 -2
  4. package/dist-cms/libs/context-api/provide/context-boundary.controller.d.ts +9 -0
  5. package/dist-cms/libs/context-api/provide/context-boundary.controller.js +32 -0
  6. package/dist-cms/libs/context-api/provide/context-boundary.d.ts +24 -0
  7. package/dist-cms/libs/context-api/provide/context-boundary.js +49 -0
  8. package/dist-cms/libs/context-api/provide/context-provider.js +3 -3
  9. package/dist-cms/libs/context-api/provide/index.d.ts +3 -1
  10. package/dist-cms/libs/context-api/provide/index.js +3 -1
  11. package/dist-cms/packages/block/block/context/block-entry.context.js +4 -4
  12. package/dist-cms/packages/block/block/context/block-manager.context.d.ts +3 -2
  13. package/dist-cms/packages/block/block/context/block-manager.context.js +5 -4
  14. package/dist-cms/packages/block/block/workspace/block-workspace.context.js +10 -7
  15. package/dist-cms/packages/block/block-list/context/block-list-entries.context.js +1 -5
  16. package/dist-cms/packages/block/block-type/workspace/block-type-workspace.context.js +1 -1
  17. package/dist-cms/packages/core/modal/component/modal.element.js +12 -3
  18. package/dist-cms/packages/core/property-type/workspace/property-type-workspace.context.js +1 -1
  19. package/dist-cms/packages/core/router/modal-registration/modal-route-registration.controller.js +4 -2
  20. package/dist-cms/packages/core/validation/context/validation-messages.manager.d.ts +1 -0
  21. package/dist-cms/packages/core/validation/context/validation-messages.manager.js +4 -1
  22. package/dist-cms/packages/core/validation/controllers/bind-server-validation-to-form-control.controller.js +2 -5
  23. package/dist-cms/packages/core/validation/controllers/validation.controller.js +2 -6
  24. package/dist-cms/packages/core/validation/mixins/form-control.mixin.js +1 -1
  25. package/dist-cms/packages/core/workspace/entity-detail/entity-detail-workspace-base.js +2 -2
  26. package/dist-cms/packages/data-type/workspace/data-type-workspace.context.js +2 -2
  27. package/dist-cms/packages/dictionary/workspace/dictionary-workspace.context.js +1 -1
  28. package/dist-cms/packages/documents/document-blueprints/workspace/document-blueprint-workspace.context.js +1 -1
  29. package/dist-cms/packages/documents/document-types/workspace/document-type-workspace.context.js +2 -2
  30. package/dist-cms/packages/documents/documents/types.d.ts +0 -1
  31. package/dist-cms/packages/documents/documents/workspace/document-workspace.context.js +2 -2
  32. package/dist-cms/packages/language/workspace/language/language-workspace.context.js +1 -1
  33. package/dist-cms/packages/media/media/workspace/media-workspace.context.js +2 -2
  34. package/dist-cms/packages/media/media/workspace/views/info/media-workspace-view-info.element.d.ts +2 -2
  35. package/dist-cms/packages/media/media/workspace/views/info/media-workspace-view-info.element.js +29 -16
  36. package/dist-cms/packages/media/media-types/workspace/media-type-workspace.context.js +2 -2
  37. package/dist-cms/packages/members/member/workspace/member/member-workspace.context.js +1 -1
  38. package/dist-cms/packages/members/member-group/workspace/member-group/member-group-workspace.context.js +2 -2
  39. package/dist-cms/packages/members/member-type/workspace/member-type-workspace.context.js +2 -2
  40. package/dist-cms/packages/property-editors/content-picker/config/{source → source-content}/input-content-picker-source.element.js +1 -1
  41. package/dist-cms/packages/property-editors/content-picker/index.d.ts +1 -1
  42. package/dist-cms/packages/property-editors/content-picker/index.js +1 -1
  43. package/dist-cms/packages/property-editors/content-picker/manifests.js +1 -1
  44. package/dist-cms/packages/publish-cache/dashboard-published-status.element.d.ts +0 -8
  45. package/dist-cms/packages/publish-cache/dashboard-published-status.element.js +2 -83
  46. package/dist-cms/packages/templating/scripts/workspace/script-workspace.context.js +1 -1
  47. package/dist-cms/packages/templating/stylesheets/workspace/stylesheet-workspace.context.js +1 -1
  48. package/dist-cms/packages/templating/templates/workspace/template-workspace.context.js +2 -2
  49. package/dist-cms/packages/tiny-mce/components/input-tiny-mce/input-tiny-mce.defaults.js +2 -2
  50. package/dist-cms/packages/tiptap/components/input-tiptap/input-tiptap.element.js +11 -1
  51. package/dist-cms/packages/tiptap/components/input-tiptap/tiptap-toolbar.element.js +28 -30
  52. package/dist-cms/packages/tiptap/components/toolbar/tiptap-toolbar-button.element.js +1 -0
  53. package/dist-cms/packages/tiptap/extensions/base.d.ts +12 -2
  54. package/dist-cms/packages/tiptap/extensions/base.js +16 -1
  55. package/dist-cms/packages/tiptap/extensions/core/media-upload.extension.js +5 -0
  56. package/dist-cms/packages/tiptap/extensions/types.d.ts +6 -2
  57. package/dist-cms/packages/tiptap/property-editors/tiptap/components/property-editor-ui-tiptap-extensions-configuration.element.js +1 -1
  58. package/dist-cms/packages/tiptap/property-editors/tiptap/components/property-editor-ui-tiptap-toolbar-configuration.element.d.ts +1 -0
  59. package/dist-cms/packages/tiptap/property-editors/tiptap/components/property-editor-ui-tiptap-toolbar-configuration.element.js +5 -2
  60. package/dist-cms/packages/tiptap/property-editors/tiptap/contexts/tiptap-toolbar-configuration.context.d.ts +3 -0
  61. package/dist-cms/packages/tiptap/property-editors/tiptap/contexts/tiptap-toolbar-configuration.context.js +64 -0
  62. package/dist-cms/packages/user/user-group/workspace/user-group/user-group-workspace.context.js +2 -2
  63. package/dist-cms/packages/webhook/workspace/webhook/webhook-workspace.context.js +1 -1
  64. package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
  65. package/dist-cms/umbraco-package-schema.json +6 -6
  66. package/dist-cms/umbraco-package.json +1 -1
  67. package/dist-cms/vscode-html-custom-data.json +12 -12
  68. package/package.json +1 -1
  69. /package/dist-cms/packages/property-editors/content-picker/config/{source → source-content}/index.d.ts +0 -0
  70. /package/dist-cms/packages/property-editors/content-picker/config/{source → source-content}/index.js +0 -0
  71. /package/dist-cms/packages/property-editors/content-picker/config/{source → source-content}/input-content-picker-source.element.d.ts +0 -0
  72. /package/dist-cms/packages/property-editors/content-picker/config/{source → source-content}/manifests.d.ts +0 -0
  73. /package/dist-cms/packages/property-editors/content-picker/config/{source → source-content}/manifests.js +0 -0
  74. /package/dist-cms/packages/property-editors/content-picker/config/{source → source-content}/property-editor-ui-content-picker-source.element.d.ts +0 -0
  75. /package/dist-cms/packages/property-editors/content-picker/config/{source → source-content}/property-editor-ui-content-picker-source.element.js +0 -0
@@ -10430,26 +10430,9 @@
10430
10430
  }
10431
10431
  ]
10432
10432
  },
10433
- {
10434
- "name": "umb-property-editor-ui-content-picker-source-type",
10435
- "path": "./../src/packages/property-editors/content-picker/config/source-type/property-editor-ui-content-picker-source-type.element.ts",
10436
- "attributes": [
10437
- {
10438
- "name": "value",
10439
- "type": "string"
10440
- }
10441
- ],
10442
- "properties": [
10443
- {
10444
- "name": "value",
10445
- "attribute": "value",
10446
- "type": "string"
10447
- }
10448
- ]
10449
- },
10450
10433
  {
10451
10434
  "name": "umb-input-content-picker-source",
10452
- "path": "./../src/packages/property-editors/content-picker/config/source/input-content-picker-source.element.ts",
10435
+ "path": "./../src/packages/property-editors/content-picker/config/source-content/input-content-picker-source.element.ts",
10453
10436
  "attributes": [
10454
10437
  {
10455
10438
  "name": "type",
@@ -10484,7 +10467,7 @@
10484
10467
  },
10485
10468
  {
10486
10469
  "name": "umb-property-editor-ui-content-picker-source",
10487
- "path": "./../src/packages/property-editors/content-picker/config/source/property-editor-ui-content-picker-source.element.ts",
10470
+ "path": "./../src/packages/property-editors/content-picker/config/source-content/property-editor-ui-content-picker-source.element.ts",
10488
10471
  "attributes": [
10489
10472
  {
10490
10473
  "name": "value",
@@ -10502,6 +10485,23 @@
10502
10485
  }
10503
10486
  ]
10504
10487
  },
10488
+ {
10489
+ "name": "umb-property-editor-ui-content-picker-source-type",
10490
+ "path": "./../src/packages/property-editors/content-picker/config/source-type/property-editor-ui-content-picker-source-type.element.ts",
10491
+ "attributes": [
10492
+ {
10493
+ "name": "value",
10494
+ "type": "string"
10495
+ }
10496
+ ],
10497
+ "properties": [
10498
+ {
10499
+ "name": "value",
10500
+ "attribute": "value",
10501
+ "type": "string"
10502
+ }
10503
+ ]
10504
+ },
10505
10505
  {
10506
10506
  "name": "umb-input-content-picker-document-root",
10507
10507
  "path": "./../src/packages/property-editors/content-picker/dynamic-root/components/input-content-picker-document-root.element.ts",
@@ -12245,7 +12245,7 @@
12245
12245
  },
12246
12246
  {
12247
12247
  "name": "styles",
12248
- "default": "\"css`\\n\\t\\t:host([readonly]) {\\n\\t\\t\\tpointer-events: none;\\n\\t\\t\\tbackground-color: var(--uui-color-surface-alt);\\n\\t\\t}\\n\\n\\t\\t:host {\\n\\t\\t\\tborder-radius: var(--uui-border-radius);\\n\\t\\t\\tborder: 1px solid var(--uui-color-border);\\n\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t\\tbackground-color: var(--uui-color-surface);\\n\\t\\t\\tcolor: var(--color-text);\\n\\t\\t\\tdisplay: grid;\\n\\t\\t\\tgrid-template-columns: repeat(auto-fill, 10px);\\n\\t\\t\\tgrid-auto-flow: row;\\n\\t\\t\\tposition: sticky;\\n\\t\\t\\ttop: -25px;\\n\\t\\t\\tleft: 0px;\\n\\t\\t\\tright: 0px;\\n\\t\\t\\tpadding: var(--uui-size-space-3);\\n\\t\\t\\tz-index: 9999999;\\n\\t\\t}\\n\\n\\t\\t.item {\\n\\t\\t\\tgrid-column: span 3;\\n\\t\\t}\\n\\n\\t\\t.separator {\\n\\t\\t\\tbackground-color: var(--uui-color-border);\\n\\t\\t\\twidth: 1px;\\n\\t\\t\\tplace-self: center;\\n\\t\\t\\theight: 22px;\\n\\t\\t}\\n\\t\\t.separator:last-child,\\n\\t\\t.separator:has(+ [data-new-row]) {\\n\\t\\t\\tdisplay: none;\\n\\t\\t}\\n\\t`\""
12248
+ "default": "\"css`\\n\\t\\t:host([readonly]) {\\n\\t\\t\\tpointer-events: none;\\n\\t\\t\\tbackground-color: var(--uui-color-surface-alt);\\n\\t\\t}\\n\\n\\t\\t:host {\\n\\t\\t\\tborder-radius: var(--uui-border-radius);\\n\\t\\t\\tborder: 1px solid var(--uui-color-border);\\n\\t\\t\\tborder-bottom-left-radius: 0;\\n\\t\\t\\tborder-bottom-right-radius: 0;\\n\\t\\t\\tbackground-color: var(--uui-color-surface);\\n\\t\\t\\tcolor: var(--color-text);\\n\\n\\t\\t\\tdisplay: flex;\\n\\t\\t\\tflex-direction: column;\\n\\n\\t\\t\\tposition: sticky;\\n\\t\\t\\ttop: -25px;\\n\\t\\t\\tleft: 0px;\\n\\t\\t\\tright: 0px;\\n\\t\\t\\tpadding: var(--uui-size-3);\\n\\t\\t\\tz-index: 9999999;\\n\\t\\t}\\n\\n\\t\\t.row {\\n\\t\\t\\tdisplay: flex;\\n\\t\\t\\tflex-direction: row;\\n\\n\\t\\t\\t.group {\\n\\t\\t\\t\\tdisplay: inline-flex;\\n\\t\\t\\t\\talign-items: stretch;\\n\\n\\t\\t\\t\\t&:not(:last-child)::after {\\n\\t\\t\\t\\t\\tcontent: '';\\n\\t\\t\\t\\t\\tbackground-color: var(--uui-color-border);\\n\\t\\t\\t\\t\\twidth: 1px;\\n\\t\\t\\t\\t\\tplace-self: center;\\n\\t\\t\\t\\t\\theight: 22px;\\n\\t\\t\\t\\t\\tmargin: 0 var(--uui-size-3);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t`\""
12249
12249
  }
12250
12250
  ]
12251
12251
  },
@@ -1,3 +1,8 @@
1
+ export declare const UMB_CONTEXT_REQUEST_EVENT_TYPE = "umb:context-request";
2
+ /**
3
+ * @deprecated use UMB_CONTEXT_REQUEST_EVENT_TYPE
4
+ * This will be removed in Umbraco 17
5
+ */
1
6
  export declare const UMB_CONTENT_REQUEST_EVENT_TYPE = "umb:context-request";
2
7
  export declare const UMB_DEBUG_CONTEXT_EVENT_TYPE = "umb:debug-contexts";
3
8
  export type UmbContextCallback<T> = (instance: T) => void;
@@ -1,4 +1,9 @@
1
- export const UMB_CONTENT_REQUEST_EVENT_TYPE = 'umb:context-request';
1
+ export const UMB_CONTEXT_REQUEST_EVENT_TYPE = 'umb:context-request';
2
+ /**
3
+ * @deprecated use UMB_CONTEXT_REQUEST_EVENT_TYPE
4
+ * This will be removed in Umbraco 17
5
+ */
6
+ export const UMB_CONTENT_REQUEST_EVENT_TYPE = UMB_CONTEXT_REQUEST_EVENT_TYPE;
2
7
  export const UMB_DEBUG_CONTEXT_EVENT_TYPE = 'umb:debug-contexts';
3
8
  /**
4
9
  * @class UmbContextRequestEventImplementation
@@ -7,7 +12,7 @@ export const UMB_DEBUG_CONTEXT_EVENT_TYPE = 'umb:debug-contexts';
7
12
  */
8
13
  export class UmbContextRequestEventImplementation extends Event {
9
14
  constructor(contextAlias, apiAlias, callback, stopAtContextMatch = true) {
10
- super(UMB_CONTENT_REQUEST_EVENT_TYPE, { bubbles: true, composed: true, cancelable: true });
15
+ super(UMB_CONTEXT_REQUEST_EVENT_TYPE, { bubbles: true, composed: true, cancelable: true });
11
16
  this.contextAlias = contextAlias;
12
17
  this.apiAlias = apiAlias;
13
18
  this.callback = callback;
@@ -0,0 +1,9 @@
1
+ import type { UmbContextToken } from '../token/index.js';
2
+ import { UmbContextBoundary } from './context-boundary.js';
3
+ import type { UmbControllerHost, UmbController } from '../../controller-api/index.js';
4
+ export declare class UmbContextBoundaryController extends UmbContextBoundary implements UmbController {
5
+ #private;
6
+ get controllerAlias(): string;
7
+ constructor(host: UmbControllerHost, contextAlias: string | UmbContextToken<any>);
8
+ destroy(): void;
9
+ }
@@ -0,0 +1,32 @@
1
+ import { UmbContextBoundary } from './context-boundary.js';
2
+ export class UmbContextBoundaryController extends UmbContextBoundary {
3
+ #host;
4
+ #controllerAlias;
5
+ get controllerAlias() {
6
+ return this.#controllerAlias;
7
+ }
8
+ constructor(host, contextAlias) {
9
+ super(host.getHostElement(), contextAlias);
10
+ this.#host = host;
11
+ // Makes the controllerAlias unique for this instance, this enables multiple Contexts to be provided under the same name. (This only makes sense cause of Context Token Discriminators)
12
+ // This does mean that if someone provides a context with the same name, but with a different instance, it will not override the previous instance. But its good since it enables extensions to provide contexts at the same scope of other contexts.
13
+ this.#controllerAlias = 'umbContextBoundary_' + contextAlias.toString();
14
+ // If this API is already provided with this alias? Then we do not want to register this controller:
15
+ const existingControllers = host.getUmbControllers((x) => x.controllerAlias === this.controllerAlias);
16
+ if (existingControllers.length > 0) {
17
+ // This just an additional awareness feature to make devs Aware, the alternative would be adding it anyway, but that would destroy existing controller of this alias.
18
+ // Back out, this instance is already provided, by another controller.
19
+ throw new Error(`Context API: The context boundary of '${this.controllerAlias}' is already provided by another Context Provider Controller.`);
20
+ }
21
+ else {
22
+ host.addUmbController(this);
23
+ }
24
+ }
25
+ destroy() {
26
+ if (this.#host) {
27
+ this.#host.removeUmbController(this);
28
+ this.#host = undefined;
29
+ }
30
+ super.destroy();
31
+ }
32
+ }
@@ -0,0 +1,24 @@
1
+ import type { UmbContextToken } from '../token/index.js';
2
+ /**
3
+ * @class UmbContextBoundary
4
+ */
5
+ export declare class UmbContextBoundary {
6
+ #private;
7
+ /**
8
+ * Creates an instance of UmbContextBoundary.
9
+ * @param {EventTarget} eventTarget - the host element for this context provider
10
+ * @param {string | UmbContextToken} contextIdentifier - a string or token to identify the context
11
+ * @param {*} instance - the instance to provide
12
+ * @memberof UmbContextBoundary
13
+ */
14
+ constructor(eventTarget: EventTarget, contextIdentifier: string | UmbContextToken<any>);
15
+ /**
16
+ * @memberof UmbContextBoundary
17
+ */
18
+ hostConnected(): void;
19
+ /**
20
+ * @memberof UmbContextBoundary
21
+ */
22
+ hostDisconnected(): void;
23
+ destroy(): void;
24
+ }
@@ -0,0 +1,49 @@
1
+ import { UMB_CONTEXT_REQUEST_EVENT_TYPE } from '../consume/context-request.event.js';
2
+ import { UmbContextProvideEventImplementation } from './context-provide.event.js';
3
+ /**
4
+ * @class UmbContextBoundary
5
+ */
6
+ export class UmbContextBoundary {
7
+ #eventTarget;
8
+ #contextAlias;
9
+ /**
10
+ * Creates an instance of UmbContextBoundary.
11
+ * @param {EventTarget} eventTarget - the host element for this context provider
12
+ * @param {string | UmbContextToken} contextIdentifier - a string or token to identify the context
13
+ * @param {*} instance - the instance to provide
14
+ * @memberof UmbContextBoundary
15
+ */
16
+ constructor(eventTarget, contextIdentifier) {
17
+ this.#eventTarget = eventTarget;
18
+ const idSplit = contextIdentifier.toString().split('#');
19
+ this.#contextAlias = idSplit[0];
20
+ this.#eventTarget.addEventListener(UMB_CONTEXT_REQUEST_EVENT_TYPE, this.#handleContextRequest);
21
+ }
22
+ /**
23
+ * @private
24
+ * @param {UmbContextRequestEvent} event - the event to handle
25
+ * @memberof UmbContextBoundary
26
+ */
27
+ #handleContextRequest = ((event) => {
28
+ if (event.contextAlias !== this.#contextAlias)
29
+ return;
30
+ if (event.stopAtContextMatch) {
31
+ // Since the alias matches, we will stop it from bubbling further up. But we still allow it to ask the other Contexts of the element. Hence not calling `event.stopImmediatePropagation();`
32
+ event.stopPropagation();
33
+ }
34
+ });
35
+ /**
36
+ * @memberof UmbContextBoundary
37
+ */
38
+ hostConnected() {
39
+ //this.hostElement.addEventListener(UMB_CONTENT_REQUEST_EVENT_TYPE, this.#handleContextRequest);
40
+ this.#eventTarget.dispatchEvent(new UmbContextProvideEventImplementation(this.#contextAlias));
41
+ }
42
+ /**
43
+ * @memberof UmbContextBoundary
44
+ */
45
+ hostDisconnected() { }
46
+ destroy() {
47
+ this.#eventTarget = undefined;
48
+ }
49
+ }
@@ -1,4 +1,4 @@
1
- import { UMB_CONTENT_REQUEST_EVENT_TYPE, UMB_DEBUG_CONTEXT_EVENT_TYPE } from '../consume/context-request.event.js';
1
+ import { UMB_CONTEXT_REQUEST_EVENT_TYPE, UMB_DEBUG_CONTEXT_EVENT_TYPE } from '../consume/context-request.event.js';
2
2
  import { UmbContextProvideEventImplementation } from './context-provide.event.js';
3
3
  /**
4
4
  * @class UmbContextProvider
@@ -29,11 +29,11 @@ export class UmbContextProvider {
29
29
  this.#contextAlias = idSplit[0];
30
30
  this.#apiAlias = idSplit[1] ?? 'default';
31
31
  this.#instance = instance;
32
- this.#eventTarget.addEventListener(UMB_CONTENT_REQUEST_EVENT_TYPE, this.#handleContextRequest);
32
+ this.#eventTarget.addEventListener(UMB_CONTEXT_REQUEST_EVENT_TYPE, this.#handleContextRequest);
33
33
  }
34
34
  /**
35
35
  * @private
36
- * @param {UmbContextRequestEvent} event
36
+ * @param {UmbContextRequestEvent} event - the event to handle
37
37
  * @memberof UmbContextProvider
38
38
  */
39
39
  #handleContextRequest = ((event) => {
@@ -1,3 +1,5 @@
1
+ export * from './context-boundary.js';
2
+ export * from './context-boundary.controller.js';
3
+ export * from './context-provide.event.js';
1
4
  export * from './context-provider.controller.js';
2
5
  export * from './context-provider.js';
3
- export * from './context-provide.event.js';
@@ -1,3 +1,5 @@
1
+ export * from './context-boundary.js';
2
+ export * from './context-boundary.controller.js';
3
+ export * from './context-provide.event.js';
1
4
  export * from './context-provider.controller.js';
2
5
  export * from './context-provider.js';
3
- export * from './context-provide.event.js';
@@ -412,8 +412,7 @@ export class UmbBlockEntryContext extends UmbContextBase {
412
412
  const variantId = this.#variantId.getValue();
413
413
  if (!variantId || !this.#contentKey)
414
414
  return;
415
- // TODO: Handle variantId changes
416
- this.observe(this._manager?.hasExposeOf(this.#contentKey), (hasExpose) => {
415
+ this.observe(this._manager?.hasExposeOf(this.#contentKey, variantId), (hasExpose) => {
417
416
  this.#hasExpose.setValue(hasExpose);
418
417
  }, 'observeExpose');
419
418
  }
@@ -445,8 +444,9 @@ export class UmbBlockEntryContext extends UmbContextBase {
445
444
  this._entries.delete(contentKey);
446
445
  }
447
446
  expose() {
448
- if (!this.#contentKey)
447
+ const variantId = this.#variantId.getValue();
448
+ if (!variantId || !this.#contentKey)
449
449
  return;
450
- this._manager?.setOneExpose(this.#contentKey);
450
+ this._manager?.setOneExpose(this.#contentKey, variantId);
451
451
  }
452
452
  }
@@ -19,6 +19,7 @@ export declare abstract class UmbBlockManagerContext<BlockType extends UmbBlockT
19
19
  setPropertyAlias(propertyAlias: string | undefined): void;
20
20
  variantId: import("rxjs/internal/Observable").Observable<UmbVariantId | undefined>;
21
21
  setVariantId(variantId: UmbVariantId | undefined): void;
22
+ getVariantId(): UmbVariantId | undefined;
22
23
  readonly blockTypes: import("rxjs/internal/Observable").Observable<BlockType[]>;
23
24
  protected _editorConfiguration: UmbClassState<UmbPropertyEditorConfigCollection | undefined>;
24
25
  readonly editorConfiguration: import("rxjs/internal/Observable").Observable<UmbPropertyEditorConfigCollection | undefined>;
@@ -52,13 +53,13 @@ export declare abstract class UmbBlockManagerContext<BlockType extends UmbBlockT
52
53
  contentOf(key: string): import("rxjs/internal/Observable").Observable<UmbBlockDataModel | undefined>;
53
54
  settingsOf(key: string): import("rxjs/internal/Observable").Observable<UmbBlockDataModel | undefined>;
54
55
  currentExposeOf(contentKey: string): import("rxjs/internal/Observable").Observable<UmbBlockExposeModel | undefined> | undefined;
55
- hasExposeOf(contentKey: string): import("rxjs/internal/Observable").Observable<boolean> | undefined;
56
+ hasExposeOf(contentKey: string, variantId: UmbVariantId): import("rxjs/internal/Observable").Observable<boolean> | undefined;
56
57
  getBlockTypeOf(contentTypeKey: string): BlockType | undefined;
57
58
  getContentOf(contentKey: string): UmbBlockDataModel | undefined;
58
59
  setOneLayout(layoutData: BlockLayoutType, _originData?: BlockOriginDataType): void;
59
60
  setOneContent(contentData: UmbBlockDataModel): void;
60
61
  setOneSettings(settingsData: UmbBlockDataModel): void;
61
- setOneExpose(contentKey: string): void;
62
+ setOneExpose(contentKey: string, variantId: UmbVariantId): void;
62
63
  removeOneContent(contentKey: string): void;
63
64
  removeOneSettings(settingsKey: string): void;
64
65
  removeExposesOf(contentKey: string): void;
@@ -18,6 +18,9 @@ export class UmbBlockManagerContext extends UmbContextBase {
18
18
  setVariantId(variantId) {
19
19
  this.#variantId.setValue(variantId);
20
20
  }
21
+ getVariantId() {
22
+ return this.#variantId.getValue();
23
+ }
21
24
  #structures;
22
25
  #blockTypes;
23
26
  #contents;
@@ -148,8 +151,7 @@ export class UmbBlockManagerContext extends UmbContextBase {
148
151
  return;
149
152
  return mergeObservables([this.#exposes.asObservablePart((source) => source.filter((x) => x.contentKey === contentKey)), this.variantId], ([exposes, variantId]) => (variantId ? exposes.find((x) => variantId.compare(x)) : undefined));
150
153
  }
151
- hasExposeOf(contentKey) {
152
- const variantId = this.#variantId.getValue();
154
+ hasExposeOf(contentKey, variantId) {
153
155
  if (!variantId)
154
156
  return;
155
157
  return this.#exposes.asObservablePart((source) => source.some((x) => x.contentKey === contentKey && variantId.compare(x)));
@@ -171,8 +173,7 @@ export class UmbBlockManagerContext extends UmbContextBase {
171
173
  setOneSettings(settingsData) {
172
174
  this.#settings.appendOne(settingsData);
173
175
  }
174
- setOneExpose(contentKey) {
175
- const variantId = this.#variantId.getValue();
176
+ setOneExpose(contentKey, variantId) {
176
177
  if (!variantId)
177
178
  return;
178
179
  this.#exposes.appendOne({ contentKey, ...variantId.toObject() });
@@ -99,13 +99,13 @@ export class UmbBlockWorkspaceContext extends UmbSubmittableWorkspaceContextBase
99
99
  }
100
100
  this.#variantId.setValue(variantId);
101
101
  }, 'observeBlockType');
102
- this.observe(this.contentKey, (contentKey) => {
103
- if (!contentKey)
102
+ this.observe(observeMultiple([this.contentKey, this.variantId]), ([contentKey, variantId]) => {
103
+ if (!contentKey || !variantId)
104
104
  return;
105
- this.observe(manager.hasExposeOf(contentKey), (exposed) => {
105
+ this.observe(manager.hasExposeOf(contentKey, variantId), (exposed) => {
106
106
  this.#exposed.setValue(exposed);
107
107
  }, 'observeHasExpose');
108
- }, 'observeContentKey');
108
+ }, 'observeContentKeyAndVariantId');
109
109
  }).asPromise();
110
110
  this.#retrieveBlockEntries = this.consumeContext(UMB_BLOCK_ENTRIES_CONTEXT, (context) => {
111
111
  this.#blockEntries = context;
@@ -141,7 +141,7 @@ export class UmbBlockWorkspaceContext extends UmbSubmittableWorkspaceContextBase
141
141
  setup: async (component, info) => {
142
142
  component.workspaceAlias = manifest.alias;
143
143
  const elementTypeKey = info.match.params.elementTypeKey;
144
- this.create(elementTypeKey);
144
+ await this.create(elementTypeKey);
145
145
  new UmbWorkspaceIsNewRedirectController(this, this, this.getHostElement().shadowRoot.querySelector('umb-router-slot'));
146
146
  },
147
147
  },
@@ -344,11 +344,14 @@ export class UmbBlockWorkspaceContext extends UmbSubmittableWorkspaceContextBase
344
344
  expose() {
345
345
  const contentKey = this.#layout.value?.contentKey;
346
346
  if (!contentKey)
347
- throw new Error('Cannot expose block that does not exist.');
347
+ throw new Error('Failed to expose block, missing content key.');
348
348
  this.#expose(contentKey);
349
349
  }
350
350
  #expose(unique) {
351
- this.#blockManager?.setOneExpose(unique);
351
+ const variantId = this.#variantId.getValue();
352
+ if (!variantId)
353
+ throw new Error('Failed to expose block, missing variant id.');
354
+ this.#blockManager?.setOneExpose(unique, variantId);
352
355
  }
353
356
  #modalRejected;
354
357
  destroy() {
@@ -94,11 +94,7 @@ export class UmbBlockListEntriesContext extends UmbBlockEntriesContext {
94
94
  // insert Block?
95
95
  async insert(layoutEntry, content, settings, originData) {
96
96
  await this._retrieveManager;
97
- const success = this._manager?.insert(layoutEntry, content, settings, originData) ?? false;
98
- if (success) {
99
- this._manager?.setOneExpose(layoutEntry.contentKey);
100
- }
101
- return success;
97
+ return this._manager?.insert(layoutEntry, content, settings, originData) ?? false;
102
98
  }
103
99
  // create Block?
104
100
  async delete(contentKey) {
@@ -25,7 +25,7 @@ export class UmbBlockTypeWorkspaceContext extends UmbSubmittableWorkspaceContext
25
25
  component.workspaceAlias = manifest.alias;
26
26
  const elementTypeKey = info.match.params.elementTypeKey;
27
27
  const groupKey = info.match.params.groupKey === 'null' ? null : info.match.params.groupKey;
28
- this.create(elementTypeKey, groupKey);
28
+ await this.create(elementTypeKey, groupKey);
29
29
  new UmbWorkspaceIsNewRedirectController(this, this, this.getHostElement().shadowRoot.querySelector('umb-router-slot'));
30
30
  },
31
31
  },
@@ -11,8 +11,9 @@ import { UmbTextStyles } from '../../style/index.js';
11
11
  import { html, customElement } from '../../../../external/lit/index.js';
12
12
  import { UmbBasicState } from '../../../../libs/observable-api/index.js';
13
13
  import { UUIModalCloseEvent, } from '../../../../external/uui/index.js';
14
+ import { UMB_ROUTE_CONTEXT } from '../../router/index.js';
14
15
  import { createExtensionElement } from '../../../../libs/extension-api/index.js';
15
- import { UMB_CONTENT_REQUEST_EVENT_TYPE, UmbContextProvider } from '../../../../libs/context-api/index.js';
16
+ import { UMB_CONTEXT_REQUEST_EVENT_TYPE, UmbContextBoundary, UmbContextProvider, } from '../../../../libs/context-api/index.js';
16
17
  let UmbModalElement = class UmbModalElement extends UmbLitElement {
17
18
  #modalContext;
18
19
  get modalContext() {
@@ -30,7 +31,7 @@ let UmbModalElement = class UmbModalElement extends UmbLitElement {
30
31
  }
31
32
  #innerElement = new UmbBasicState(undefined);
32
33
  #modalExtensionObserver;
33
- #modalRouterElement = document.createElement('umb-router-slot');
34
+ #modalRouterElement;
34
35
  #onClose = () => {
35
36
  this.element?.removeEventListener(UUIModalCloseEvent, this.#onClose);
36
37
  this.#modalContext?.reject({ type: 'close' });
@@ -44,7 +45,7 @@ let UmbModalElement = class UmbModalElement extends UmbLitElement {
44
45
  this.element.addEventListener(UUIModalCloseEvent, this.#onClose);
45
46
  // The following code is the context api proxy.
46
47
  // It re-dispatches the context api request event to the origin target of this modal, in other words the element that initiated the modal. [NL]
47
- this.element.addEventListener(UMB_CONTENT_REQUEST_EVENT_TYPE, ((event) => {
48
+ this.element.addEventListener(UMB_CONTEXT_REQUEST_EVENT_TYPE, ((event) => {
48
49
  if (!this.#modalContext)
49
50
  return;
50
51
  // Note for this hack (The if-sentence): [NL]
@@ -66,6 +67,7 @@ let UmbModalElement = class UmbModalElement extends UmbLitElement {
66
67
  *
67
68
  */
68
69
  if (this.#modalContext.router) {
70
+ this.#modalRouterElement = document.createElement('umb-router-slot');
69
71
  this.#modalRouterElement.routes = [
70
72
  {
71
73
  path: '',
@@ -74,6 +76,13 @@ let UmbModalElement = class UmbModalElement extends UmbLitElement {
74
76
  ];
75
77
  this.#modalRouterElement.parent = this.#modalContext.router;
76
78
  }
79
+ else {
80
+ this.#modalRouterElement = document.createElement('div');
81
+ // Notice inline styling here is used cause the element is not appended into this elements shadowDom but outside and there by gets into the element via a slot.
82
+ this.#modalRouterElement.style.position = 'relative';
83
+ this.#modalRouterElement.style.height = '100%';
84
+ new UmbContextBoundary(this.#modalRouterElement, UMB_ROUTE_CONTEXT).hostConnected();
85
+ }
77
86
  this.element.appendChild(this.#modalRouterElement);
78
87
  this.#observeModal(this.#modalContext.alias.toString());
79
88
  const provider = new UmbContextProvider(this.element, UMB_MODAL_CONTEXT, this.#modalContext);
@@ -37,7 +37,7 @@ export class UmbPropertyTypeWorkspaceContext extends UmbSubmittableWorkspaceCont
37
37
  setup: async (component, info) => {
38
38
  component.workspaceAlias = manifest.alias;
39
39
  const containerUnique = info.match.params.containerUnique === 'null' ? null : info.match.params.containerUnique;
40
- this.create(containerUnique);
40
+ await this.create(containerUnique);
41
41
  new UmbWorkspaceIsNewRedirectController(this, this, this.getHostElement().shadowRoot.querySelector('umb-router-slot'));
42
42
  },
43
43
  },
@@ -179,9 +179,9 @@ export class UmbModalRouteRegistrationController extends UmbControllerBase {
179
179
  return !!this.#modalContext;
180
180
  }
181
181
  open(params, prepend) {
182
- if (this.active)
182
+ if (this.active || !this.#routeBuilder)
183
183
  return;
184
- window.history.pushState({}, '', this.#routeBuilder?.(params) + (prepend ? `${prepend}` : ''));
184
+ window.history.pushState({}, '', this.#routeBuilder(params) + (prepend ? `${prepend}` : ''));
185
185
  }
186
186
  /**
187
187
  * Returns the modal context if the modal is currently active. Otherwise its undefined.
@@ -195,6 +195,8 @@ export class UmbModalRouteRegistrationController extends UmbControllerBase {
195
195
  return this;
196
196
  }
197
197
  _internal_setRouteBuilder(urlBuilder) {
198
+ if (!this.#routeContext)
199
+ return;
198
200
  this.#routeBuilder = urlBuilder;
199
201
  this.#urlBuilderCallback?.(urlBuilder);
200
202
  }
@@ -19,6 +19,7 @@ export declare class UmbValidationMessagesManager {
19
19
  addMessage(type: UmbValidationMessageType, path: string, body: string, key?: string): void;
20
20
  addMessages(type: UmbValidationMessageType, path: string, bodies: Array<string>): void;
21
21
  removeMessageByKey(key: string): void;
22
+ removeMessageByKeys(keys: Array<string>): void;
22
23
  removeMessagesByTypeAndPath(type: UmbValidationMessageType, path: string): void;
23
24
  removeMessagesByType(type: UmbValidationMessageType): void;
24
25
  addTranslator(translator: UmbValidationMessageTranslator): void;
@@ -8,7 +8,7 @@ export class UmbValidationMessagesManager {
8
8
  }
9
9
  #messages;
10
10
  debug(logName) {
11
- this.#messages.asObservable().subscribe((x) => console.log(logName, x, this.#translators));
11
+ this.#messages.asObservable().subscribe((x) => console.log(logName, x));
12
12
  }
13
13
  getHasAnyMessages() {
14
14
  return this.#messages.getValue().length !== 0;
@@ -58,6 +58,9 @@ export class UmbValidationMessagesManager {
58
58
  removeMessageByKey(key) {
59
59
  this.#messages.removeOne(key);
60
60
  }
61
+ removeMessageByKeys(keys) {
62
+ this.#messages.filter((x) => keys.indexOf(x.key) === -1);
63
+ }
61
64
  removeMessagesByTypeAndPath(type, path) {
62
65
  //path = path.toLowerCase();
63
66
  this.#messages.filter((x) => !(x.type === type && x.path === path));
@@ -24,11 +24,8 @@ export class UmbBindServerValidationToFormControl extends UmbControllerBase {
24
24
  if (!defaultMemoization(this.#value, value)) {
25
25
  this.#value = value;
26
26
  // Only remove server validations from validation context [NL]
27
- this.#messages.forEach((message) => {
28
- if (message.type === 'server') {
29
- this.#context?.messages.removeMessageByKey(message.key);
30
- }
31
- });
27
+ const toRemove = this.#messages.filter((x) => x.type === 'server').map((msg) => msg.key);
28
+ this.#context?.messages.removeMessageByKeys(toRemove);
32
29
  }
33
30
  }
34
31
  }
@@ -117,9 +117,7 @@ export class UmbValidationController extends UmbControllerBase {
117
117
  if (this.#parentMessages) {
118
118
  // Remove the local messages that does not exist in the parent anymore:
119
119
  const toRemove = this.#parentMessages.filter((msg) => !msgs.find((m) => m.key === msg.key));
120
- toRemove.forEach((msg) => {
121
- this.messages.removeMessageByKey(msg.key);
122
- });
120
+ this.#parent.messages.removeMessageByKeys(toRemove.map((msg) => msg.key));
123
121
  }
124
122
  this.#parentMessages = msgs;
125
123
  msgs.forEach((msg) => {
@@ -135,9 +133,7 @@ export class UmbValidationController extends UmbControllerBase {
135
133
  if (this.#localMessages) {
136
134
  // Remove the parent messages that does not exist locally anymore:
137
135
  const toRemove = this.#localMessages.filter((msg) => !msgs.find((m) => m.key === msg.key));
138
- toRemove.forEach((msg) => {
139
- this.#parent.messages.removeMessageByKey(msg.key);
140
- });
136
+ this.#parent.messages.removeMessageByKeys(toRemove.map((msg) => msg.key));
141
137
  }
142
138
  this.#localMessages = msgs;
143
139
  msgs.forEach((msg) => {
@@ -60,7 +60,7 @@ export function UmbFormControlMixin(superClass, defaultValue) {
60
60
  set pristine(value) {
61
61
  if (this._pristine !== value) {
62
62
  this._pristine = value;
63
- this.#dispatchValidationState();
63
+ this._runValidators();
64
64
  }
65
65
  }
66
66
  get pristine() {
@@ -116,10 +116,10 @@ export class UmbEntityDetailWorkspaceContextBase extends UmbSubmittableWorkspace
116
116
  throw new Error('Unique is not set');
117
117
  }
118
118
  if (this.getIsNew()) {
119
- this.#create(currentData);
119
+ await this.#create(currentData);
120
120
  }
121
121
  else {
122
- this.#update(currentData);
122
+ await this.#update(currentData);
123
123
  }
124
124
  }
125
125
  async delete(unique) {
@@ -60,10 +60,10 @@ export class UmbDataTypeWorkspaceContext extends UmbEntityDetailWorkspaceContext
60
60
  {
61
61
  path: 'create/parent/:entityType/:parentUnique',
62
62
  component: UmbDataTypeWorkspaceEditorElement,
63
- setup: (_component, info) => {
63
+ setup: async (_component, info) => {
64
64
  const parentEntityType = info.match.params.entityType;
65
65
  const parentUnique = info.match.params.parentUnique === 'null' ? null : info.match.params.parentUnique;
66
- this.createScaffold({ parent: { entityType: parentEntityType, unique: parentUnique } });
66
+ await this.createScaffold({ parent: { entityType: parentEntityType, unique: parentUnique } });
67
67
  new UmbWorkspaceIsNewRedirectController(this, this, this.getHostElement().shadowRoot.querySelector('umb-router-slot'));
68
68
  },
69
69
  },
@@ -19,7 +19,7 @@ export class UmbDictionaryWorkspaceContext extends UmbEntityDetailWorkspaceConte
19
19
  setup: async (_component, info) => {
20
20
  const parentEntityType = info.match.params.entityType;
21
21
  const parentUnique = info.match.params.parentUnique === 'null' ? null : info.match.params.parentUnique;
22
- this.createScaffold({ parent: { entityType: parentEntityType, unique: parentUnique } });
22
+ await this.createScaffold({ parent: { entityType: parentEntityType, unique: parentUnique } });
23
23
  new UmbWorkspaceIsNewRedirectController(this, this, this.getHostElement().shadowRoot.querySelector('umb-router-slot'));
24
24
  },
25
25
  },
@@ -126,7 +126,7 @@ export class UmbDocumentBlueprintWorkspaceContext extends UmbSubmittableWorkspac
126
126
  const parentEntityType = info.match.params.parentEntityType;
127
127
  const parentUnique = info.match.params.parentUnique === 'null' ? null : info.match.params.parentUnique;
128
128
  const documentTypeUnique = info.match.params.documentTypeUnique;
129
- this.create({ entityType: parentEntityType, unique: parentUnique }, documentTypeUnique);
129
+ await this.create({ entityType: parentEntityType, unique: parentUnique }, documentTypeUnique);
130
130
  new UmbWorkspaceIsNewRedirectController(this, this, this.getHostElement().shadowRoot.querySelector('umb-router-slot'));
131
131
  },
132
132
  },
@@ -52,7 +52,7 @@ export class UmbDocumentTypeWorkspaceContext extends UmbSubmittableWorkspaceCont
52
52
  {
53
53
  path: UMB_CREATE_DOCUMENT_TYPE_WORKSPACE_PATH_PATTERN.toString(),
54
54
  component: UmbDocumentTypeWorkspaceEditorElement,
55
- setup: (_component, info) => {
55
+ setup: async (_component, info) => {
56
56
  const params = info.match.params;
57
57
  const parentEntityType = params.parentEntityType;
58
58
  const parentUnique = params.parentUnique === 'null' ? null : params.parentUnique;
@@ -60,7 +60,7 @@ export class UmbDocumentTypeWorkspaceContext extends UmbSubmittableWorkspaceCont
60
60
  if (parentUnique === undefined) {
61
61
  throw new Error('ParentUnique url parameter is required to create a document type');
62
62
  }
63
- this.create({ entityType: parentEntityType, unique: parentUnique }, presetAlias);
63
+ await this.create({ entityType: parentEntityType, unique: parentUnique }, presetAlias);
64
64
  new UmbWorkspaceIsNewRedirectController(this, this, this.getHostElement().shadowRoot.querySelector('umb-router-slot'));
65
65
  },
66
66
  },