@umbraco-cms/backoffice 14.0.0--preview005-c0d3d16d → 14.0.0--preview005-d8ecd776

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 (77) hide show
  1. package/dist-cms/custom-elements.json +26 -12
  2. package/dist-cms/libs/class-api/class.mixin.d.ts +25 -0
  3. package/dist-cms/libs/class-api/class.mixin.js +0 -25
  4. package/dist-cms/mocks/data/user/user.db.d.ts +1 -1
  5. package/dist-cms/mocks/data/user/user.db.js +2 -2
  6. package/dist-cms/packages/block/block/workspace/views/edit/block-workspace-view-edit-no-router.element.js +3 -0
  7. package/dist-cms/packages/core/property-editor/schemas/Umbraco.ColorPicker.js +1 -1
  8. package/dist-cms/packages/core/property-editor/uis/checkbox-list/manifests.js +1 -1
  9. package/dist-cms/packages/core/property-editor/uis/collection-view/config/bulk-action-permissions/manifests.js +1 -1
  10. package/dist-cms/packages/core/property-editor/uis/collection-view/config/column-configuration/manifests.js +1 -1
  11. package/dist-cms/packages/core/property-editor/uis/collection-view/config/layout-configuration/manifests.js +1 -1
  12. package/dist-cms/packages/core/property-editor/uis/collection-view/config/order-by/manifests.js +1 -1
  13. package/dist-cms/packages/core/property-editor/uis/collection-view/manifests.js +1 -1
  14. package/dist-cms/packages/core/property-editor/uis/color-picker/manifests.js +1 -1
  15. package/dist-cms/packages/core/property-editor/uis/color-swatches-editor/manifests.js +11 -0
  16. package/dist-cms/packages/core/property-editor/uis/{color-editor/property-editor-ui-color-editor.element.d.ts → color-swatches-editor/property-editor-ui-color-swatches-editor.element.d.ts} +4 -4
  17. package/dist-cms/packages/core/property-editor/uis/{color-editor/property-editor-ui-color-editor.element.js → color-swatches-editor/property-editor-ui-color-swatches-editor.element.js} +19 -19
  18. package/dist-cms/packages/core/property-editor/uis/date-picker/manifests.js +1 -1
  19. package/dist-cms/packages/core/property-editor/uis/dropdown/manifests.js +1 -1
  20. package/dist-cms/packages/core/property-editor/uis/eye-dropper/manifests.js +1 -1
  21. package/dist-cms/packages/core/property-editor/uis/icon-picker/manifests.js +1 -1
  22. package/dist-cms/packages/core/property-editor/uis/label/manifests.js +1 -1
  23. package/dist-cms/packages/core/property-editor/uis/manifests.js +34 -46
  24. package/dist-cms/packages/core/property-editor/uis/member-group-picker/manifests.js +1 -1
  25. package/dist-cms/packages/core/property-editor/uis/member-picker/manifests.js +1 -1
  26. package/dist-cms/packages/core/property-editor/uis/multi-url-picker/manifests.js +1 -1
  27. package/dist-cms/packages/core/property-editor/uis/multiple-text-string/manifests.js +1 -1
  28. package/dist-cms/packages/core/property-editor/uis/number/manifests.js +14 -2
  29. package/dist-cms/packages/core/property-editor/uis/number-range/manifests.js +1 -1
  30. package/dist-cms/packages/core/property-editor/uis/order-direction/manifests.js +1 -1
  31. package/dist-cms/packages/core/property-editor/uis/overlay-size/manifests.js +1 -1
  32. package/dist-cms/packages/core/property-editor/uis/radio-button-list/manifests.js +1 -1
  33. package/dist-cms/packages/core/property-editor/uis/slider/manifests.js +1 -1
  34. package/dist-cms/packages/core/property-editor/uis/text-box/manifests.js +2 -2
  35. package/dist-cms/packages/core/property-editor/uis/textarea/manifests.js +1 -1
  36. package/dist-cms/packages/core/property-editor/uis/tiny-mce/manifests.js +1 -1
  37. package/dist-cms/packages/core/property-editor/uis/toggle/manifests.js +1 -1
  38. package/dist-cms/packages/core/property-editor/uis/tree-picker/config/source-picker/manifests.js +1 -1
  39. package/dist-cms/packages/core/property-editor/uis/tree-picker/config/source-type-picker/manifests.js +1 -1
  40. package/dist-cms/packages/core/property-editor/uis/tree-picker/manifests.js +1 -1
  41. package/dist-cms/packages/core/property-editor/uis/upload-field/manifests.js +1 -1
  42. package/dist-cms/packages/core/property-editor/uis/user-picker/manifests.js +1 -1
  43. package/dist-cms/packages/core/property-editor/uis/value-type/manifests.js +1 -1
  44. package/dist-cms/packages/documents/document-types/workspace/views/design/document-type-workspace-view-edit.element.js +3 -0
  45. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/culture-and-hostnames.action.d.ts +9 -0
  46. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/culture-and-hostnames.action.js +37 -0
  47. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/index.d.ts +2 -0
  48. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/index.js +2 -0
  49. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/manifests.d.ts +2 -0
  50. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/manifests.js +27 -0
  51. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/modal/culture-and-hostnames-modal.element.d.ts +19 -0
  52. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/modal/culture-and-hostnames-modal.element.js +236 -0
  53. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/modal/culture-and-hostnames-modal.token.d.ts +10 -0
  54. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/modal/culture-and-hostnames-modal.token.js +7 -0
  55. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/modal/index.d.ts +2 -0
  56. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/modal/index.js +2 -0
  57. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/repository/culture-and-hostnames.repository.d.ts +18 -0
  58. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/repository/culture-and-hostnames.repository.js +47 -0
  59. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/repository/culture-and-hostnames.server.data.d.ts +30 -0
  60. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/repository/culture-and-hostnames.server.data.js +53 -0
  61. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/repository/index.d.ts +2 -0
  62. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/repository/index.js +2 -0
  63. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/repository/manifests.d.ts +3 -0
  64. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/repository/manifests.js +9 -0
  65. package/dist-cms/packages/documents/documents/entity-actions/index.d.ts +1 -0
  66. package/dist-cms/packages/documents/documents/entity-actions/index.js +1 -0
  67. package/dist-cms/packages/documents/documents/entity-actions/manifests.js +2 -14
  68. package/dist-cms/packages/documents/documents/index.d.ts +1 -0
  69. package/dist-cms/packages/documents/documents/index.js +1 -0
  70. package/dist-cms/packages/media/media-types/workspace/views/design/media-type-workspace-view-edit.element.js +3 -0
  71. package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
  72. package/dist-cms/vscode-html-custom-data.json +11 -6
  73. package/package.json +1 -1
  74. package/dist-cms/packages/core/property-editor/uis/color-editor/manifests.js +0 -11
  75. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames.action.d.ts +0 -7
  76. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames.action.js +0 -10
  77. /package/dist-cms/packages/core/property-editor/uis/{color-editor → color-swatches-editor}/manifests.d.ts +0 -0
@@ -2,7 +2,7 @@ export const manifest = {
2
2
  type: 'propertyEditorUi',
3
3
  alias: 'Umb.PropertyEditorUi.OrderDirection',
4
4
  name: 'Order Direction Property Editor UI',
5
- js: () => import('./property-editor-ui-order-direction.element.js'),
5
+ element: () => import('./property-editor-ui-order-direction.element.js'),
6
6
  meta: {
7
7
  label: 'Order Direction',
8
8
  propertyEditorSchemaAlias: '',
@@ -2,7 +2,7 @@ export const manifest = {
2
2
  type: 'propertyEditorUi',
3
3
  alias: 'Umb.PropertyEditorUi.OverlaySize',
4
4
  name: 'Overlay Size Property Editor UI',
5
- js: () => import('./property-editor-ui-overlay-size.element.js'),
5
+ element: () => import('./property-editor-ui-overlay-size.element.js'),
6
6
  meta: {
7
7
  label: 'Overlay Size',
8
8
  propertyEditorSchemaAlias: '',
@@ -2,7 +2,7 @@ export const manifest = {
2
2
  type: 'propertyEditorUi',
3
3
  alias: 'Umb.PropertyEditorUi.RadioButtonList',
4
4
  name: 'Radio Button List Property Editor UI',
5
- js: () => import('./property-editor-ui-radio-button-list.element.js'),
5
+ element: () => import('./property-editor-ui-radio-button-list.element.js'),
6
6
  meta: {
7
7
  label: 'Radio Button List',
8
8
  propertyEditorSchemaAlias: 'Umbraco.RadioButtonList',
@@ -2,7 +2,7 @@ export const manifest = {
2
2
  type: 'propertyEditorUi',
3
3
  alias: 'Umb.PropertyEditorUi.Slider',
4
4
  name: 'Slider Property Editor UI',
5
- js: () => import('./property-editor-ui-slider.element.js'),
5
+ element: () => import('./property-editor-ui-slider.element.js'),
6
6
  meta: {
7
7
  label: 'Slider',
8
8
  propertyEditorSchemaAlias: 'Umbraco.Slider',
@@ -10,7 +10,7 @@ export const manifests = [
10
10
  type: 'propertyEditorUi',
11
11
  alias: 'Umb.PropertyEditorUi.TextBox',
12
12
  name: 'Text Box Property Editor UI',
13
- js: () => import('./property-editor-ui-text-box.element.js'),
13
+ element: () => import('./property-editor-ui-text-box.element.js'),
14
14
  meta: {
15
15
  label: 'Text Box',
16
16
  propertyEditorSchemaAlias: 'Umbraco.TextBox',
@@ -31,7 +31,7 @@ export const manifests = [
31
31
  type: 'propertyEditorUi',
32
32
  alias: 'Umb.PropertyEditorUi.Email',
33
33
  name: 'Email Property Editor UI',
34
- js: () => import('./property-editor-ui-text-box.element.js'),
34
+ element: () => import('./property-editor-ui-text-box.element.js'),
35
35
  meta: {
36
36
  label: 'Email',
37
37
  propertyEditorSchemaAlias: 'Umbraco.EmailAddress',
@@ -2,7 +2,7 @@ export const manifest = {
2
2
  type: 'propertyEditorUi',
3
3
  alias: 'Umb.PropertyEditorUi.TextArea',
4
4
  name: 'Text Area Property Editor UI',
5
- js: () => import('./property-editor-ui-textarea.element.js'),
5
+ element: () => import('./property-editor-ui-textarea.element.js'),
6
6
  meta: {
7
7
  label: 'Text Area',
8
8
  propertyEditorSchemaAlias: 'Umbraco.TextArea',
@@ -3,7 +3,7 @@ const manifest = {
3
3
  type: 'propertyEditorUi',
4
4
  alias: 'Umb.PropertyEditorUi.TinyMCE',
5
5
  name: 'Rich Text Editor Property Editor UI',
6
- js: () => import('./property-editor-ui-tiny-mce.element.js'),
6
+ element: () => import('./property-editor-ui-tiny-mce.element.js'),
7
7
  meta: {
8
8
  label: 'Rich Text Editor',
9
9
  propertyEditorSchemaAlias: 'Umbraco.RichText',
@@ -2,7 +2,7 @@ export const manifest = {
2
2
  type: 'propertyEditorUi',
3
3
  alias: 'Umb.PropertyEditorUi.Toggle',
4
4
  name: 'Toggle Property Editor UI',
5
- js: () => import('./property-editor-ui-toggle.element.js'),
5
+ element: () => import('./property-editor-ui-toggle.element.js'),
6
6
  meta: {
7
7
  label: 'Toggle',
8
8
  propertyEditorSchemaAlias: 'Umbraco.TrueFalse',
@@ -2,7 +2,7 @@ export const manifest = {
2
2
  type: 'propertyEditorUi',
3
3
  alias: 'Umb.PropertyEditorUi.TreePicker.SourcePicker',
4
4
  name: 'Tree Picker Source Picker Property Editor UI',
5
- js: () => import('./property-editor-ui-tree-picker-source-picker.element.js'),
5
+ element: () => import('./property-editor-ui-tree-picker-source-picker.element.js'),
6
6
  meta: {
7
7
  label: 'Tree Picker Source Picker',
8
8
  icon: 'icon-page-add',
@@ -2,7 +2,7 @@ export const manifest = {
2
2
  type: 'propertyEditorUi',
3
3
  alias: 'Umb.PropertyEditorUi.TreePicker.SourceTypePicker',
4
4
  name: 'Tree Picker Source Type Picker Property Editor UI',
5
- js: () => import('./property-editor-ui-tree-picker-source-type-picker.element.js'),
5
+ element: () => import('./property-editor-ui-tree-picker-source-type-picker.element.js'),
6
6
  meta: {
7
7
  label: 'Tree Picker Source Type Picker',
8
8
  icon: 'icon-page-add',
@@ -4,7 +4,7 @@ const manifest = {
4
4
  type: 'propertyEditorUi',
5
5
  alias: 'Umb.PropertyEditorUi.TreePicker',
6
6
  name: 'Tree Picker Property Editor UI',
7
- js: () => import('./property-editor-ui-tree-picker.element.js'),
7
+ element: () => import('./property-editor-ui-tree-picker.element.js'),
8
8
  meta: {
9
9
  label: 'Tree Picker',
10
10
  icon: 'icon-page-add',
@@ -2,7 +2,7 @@ export const manifest = {
2
2
  type: 'propertyEditorUi',
3
3
  alias: 'Umb.PropertyEditorUi.UploadField',
4
4
  name: 'Upload Field Property Editor UI',
5
- js: () => import('./property-editor-ui-upload-field.element.js'),
5
+ element: () => import('./property-editor-ui-upload-field.element.js'),
6
6
  meta: {
7
7
  label: 'Upload Field',
8
8
  propertyEditorSchemaAlias: 'Umbraco.UploadField',
@@ -2,7 +2,7 @@ export const manifest = {
2
2
  type: 'propertyEditorUi',
3
3
  alias: 'Umb.PropertyEditorUi.UserPicker',
4
4
  name: 'User Picker Property Editor UI',
5
- js: () => import('./property-editor-ui-user-picker.element.js'),
5
+ element: () => import('./property-editor-ui-user-picker.element.js'),
6
6
  meta: {
7
7
  label: 'User Picker',
8
8
  propertyEditorSchemaAlias: 'Umbraco.UserPicker',
@@ -2,7 +2,7 @@ export const manifest = {
2
2
  type: 'propertyEditorUi',
3
3
  alias: 'Umb.PropertyEditorUi.ValueType',
4
4
  name: 'Value Type Property Editor UI',
5
- js: () => import('./property-editor-ui-value-type.element.js'),
5
+ element: () => import('./property-editor-ui-value-type.element.js'),
6
6
  meta: {
7
7
  label: 'Value Type',
8
8
  icon: 'icon-autofill',
@@ -435,6 +435,9 @@ UmbDocumentTypeWorkspaceViewEditElement.styles = [
435
435
  }
436
436
  `,
437
437
  ];
438
+ __decorate([
439
+ state()
440
+ ], UmbDocumentTypeWorkspaceViewEditElement.prototype, "_hasRootGroups", void 0);
438
441
  __decorate([
439
442
  state()
440
443
  ], UmbDocumentTypeWorkspaceViewEditElement.prototype, "_routes", void 0);
@@ -0,0 +1,9 @@
1
+ import { UmbEntityActionBase } from '../../../../core/entity-action/index.js';
2
+ import type { UmbControllerHostElement } from '../../../../../libs/controller-api/index.js';
3
+ import { type UmbDocumentDetailRepository } from '../../index.js';
4
+ export declare class UmbDocumentCultureAndHostnamesEntityAction extends UmbEntityActionBase<UmbDocumentDetailRepository> {
5
+ #private;
6
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string, entityType: string);
7
+ execute(): Promise<void>;
8
+ private _openModal;
9
+ }
@@ -0,0 +1,37 @@
1
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
+ if (kind === "m") throw new TypeError("Private method is not writable");
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
+ 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");
5
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
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 _UmbDocumentCultureAndHostnamesEntityAction_modalContext;
13
+ import { UmbEntityActionBase } from '../../../../core/entity-action/index.js';
14
+ import { UMB_MODAL_MANAGER_CONTEXT } from '../../../../core/modal/index.js';
15
+ import { UMB_CULTURE_AND_HOSTNAMES_MODAL } from '../../index.js';
16
+ export class UmbDocumentCultureAndHostnamesEntityAction extends UmbEntityActionBase {
17
+ constructor(host, repositoryAlias, unique, entityType) {
18
+ super(host, repositoryAlias, unique, entityType);
19
+ _UmbDocumentCultureAndHostnamesEntityAction_modalContext.set(this, void 0);
20
+ this.consumeContext(UMB_MODAL_MANAGER_CONTEXT, (instance) => {
21
+ __classPrivateFieldSet(this, _UmbDocumentCultureAndHostnamesEntityAction_modalContext, instance, "f");
22
+ });
23
+ }
24
+ async execute() {
25
+ if (!this.repository)
26
+ return;
27
+ this._openModal(this.unique || null);
28
+ }
29
+ async _openModal(unique) {
30
+ if (!__classPrivateFieldGet(this, _UmbDocumentCultureAndHostnamesEntityAction_modalContext, "f"))
31
+ return;
32
+ __classPrivateFieldGet(this, _UmbDocumentCultureAndHostnamesEntityAction_modalContext, "f").open(UMB_CULTURE_AND_HOSTNAMES_MODAL, {
33
+ data: { unique },
34
+ });
35
+ }
36
+ }
37
+ _UmbDocumentCultureAndHostnamesEntityAction_modalContext = new WeakMap();
@@ -0,0 +1,2 @@
1
+ export * from './modal/index.js';
2
+ export * from './repository/index.js';
@@ -0,0 +1,2 @@
1
+ export * from './modal/index.js';
2
+ export * from './repository/index.js';
@@ -0,0 +1,2 @@
1
+ import type { ManifestEntityAction, ManifestModal } from '../../../../core/extension-registry/index.js';
2
+ export declare const manifests: (ManifestModal | ManifestEntityAction)[];
@@ -0,0 +1,27 @@
1
+ import { UMB_DOCUMENT_ENTITY_TYPE } from '../../entity.js';
2
+ import { UMB_DOCUMENT_DETAIL_REPOSITORY_ALIAS } from '../../repository/index.js';
3
+ import { UmbDocumentCultureAndHostnamesEntityAction } from './culture-and-hostnames.action.js';
4
+ const entityActions = [
5
+ {
6
+ type: 'entityAction',
7
+ alias: 'Umb.EntityAction.Document.CultureAndHostnames',
8
+ name: 'Culture And Hostnames Document Entity Action',
9
+ weight: 400,
10
+ api: UmbDocumentCultureAndHostnamesEntityAction,
11
+ meta: {
12
+ icon: 'icon-home',
13
+ label: 'Culture and Hostnames',
14
+ repositoryAlias: UMB_DOCUMENT_DETAIL_REPOSITORY_ALIAS,
15
+ entityTypes: [UMB_DOCUMENT_ENTITY_TYPE],
16
+ },
17
+ },
18
+ ];
19
+ const manifestModals = [
20
+ {
21
+ type: 'modal',
22
+ alias: 'Umb.Modal.CultureAndHostnames',
23
+ name: 'Culture And Hostnames Modal',
24
+ js: () => import('./modal/culture-and-hostnames-modal.element.js'),
25
+ },
26
+ ];
27
+ export const manifests = [...entityActions, ...manifestModals];
@@ -0,0 +1,19 @@
1
+ import { UmbModalBaseElement } from '../../../../../core/modal/index.js';
2
+ import { type UmbCultureAndHostnamesModalData, type UmbCultureAndHostnamesModalValue } from '../../../index.js';
3
+ import type { UUIPopoverContainerElement } from '../../../../../../external/uui/index.js';
4
+ export declare class UmbCultureAndHostnamesModalElement extends UmbModalBaseElement<UmbCultureAndHostnamesModalData, UmbCultureAndHostnamesModalValue> {
5
+ #private;
6
+ private _languageModel;
7
+ private _defaultIsoCode?;
8
+ private _domains;
9
+ popoverContainerElement?: UUIPopoverContainerElement;
10
+ firstUpdated(): void;
11
+ render(): import("lit-html").TemplateResult<1>;
12
+ static styles: import("../../../../../../external/lit/index.js").CSSResult[];
13
+ }
14
+ export default UmbCultureAndHostnamesModalElement;
15
+ declare global {
16
+ interface HTMLElementTagNameMap {
17
+ 'umb-culture-and-hostnames-modal': UmbCultureAndHostnamesModalElement;
18
+ }
19
+ }
@@ -0,0 +1,236 @@
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 __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 _UmbCultureAndHostnamesModalElement_instances, _UmbCultureAndHostnamesModalElement_documentRepository, _UmbCultureAndHostnamesModalElement_languageRepository, _UmbCultureAndHostnamesModalElement_unique, _UmbCultureAndHostnamesModalElement_readDomains, _UmbCultureAndHostnamesModalElement_requestLanguages, _UmbCultureAndHostnamesModalElement_handleSave, _UmbCultureAndHostnamesModalElement_handleClose, _UmbCultureAndHostnamesModalElement_onChangeLanguage, _UmbCultureAndHostnamesModalElement_onChangeDomainLanguage, _UmbCultureAndHostnamesModalElement_onChangeDomainHostname, _UmbCultureAndHostnamesModalElement_onRemoveDomain, _UmbCultureAndHostnamesModalElement_onAddDomain, _UmbCultureAndHostnamesModalElement_renderCultureSection, _UmbCultureAndHostnamesModalElement_renderDomainSection, _UmbCultureAndHostnamesModalElement_renderDomains, _UmbCultureAndHostnamesModalElement_renderLanguageModelOptions, _UmbCultureAndHostnamesModalElement_renderAddNewDomainButton;
19
+ import { html, customElement, state, css, repeat, query } from '../../../../../../external/lit/index.js';
20
+ import { UmbTextStyles } from '../../../../../../shared/style/index.js';
21
+ import { UmbModalBaseElement } from '../../../../../core/modal/index.js';
22
+ import { UmbLanguageRepository } from '../../../../../settings/languages/index.js';
23
+ import { UmbDocumentCultureAndHostnamesRepository, } from '../../../index.js';
24
+ let UmbCultureAndHostnamesModalElement = class UmbCultureAndHostnamesModalElement extends UmbModalBaseElement {
25
+ constructor() {
26
+ super(...arguments);
27
+ _UmbCultureAndHostnamesModalElement_instances.add(this);
28
+ _UmbCultureAndHostnamesModalElement_documentRepository.set(this, new UmbDocumentCultureAndHostnamesRepository(this));
29
+ _UmbCultureAndHostnamesModalElement_languageRepository.set(this, new UmbLanguageRepository(this));
30
+ _UmbCultureAndHostnamesModalElement_unique.set(this, void 0);
31
+ this._languageModel = [];
32
+ this._domains = [];
33
+ }
34
+ // Init
35
+ firstUpdated() {
36
+ __classPrivateFieldSet(this, _UmbCultureAndHostnamesModalElement_unique, this.data?.unique, "f");
37
+ __classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_instances, "m", _UmbCultureAndHostnamesModalElement_requestLanguages).call(this);
38
+ __classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_instances, "m", _UmbCultureAndHostnamesModalElement_readDomains).call(this);
39
+ }
40
+ // Renders
41
+ render() {
42
+ return html `
43
+ <umb-body-layout headline=${this.localize.term('actions_assigndomain')}>
44
+ ${__classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_instances, "m", _UmbCultureAndHostnamesModalElement_renderCultureSection).call(this)} ${__classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_instances, "m", _UmbCultureAndHostnamesModalElement_renderDomainSection).call(this)}
45
+ <uui-button
46
+ slot="actions"
47
+ id="close"
48
+ label=${this.localize.term('general_close')}
49
+ @click="${__classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_instances, "m", _UmbCultureAndHostnamesModalElement_handleClose)}"></uui-button>
50
+ <uui-button
51
+ slot="actions"
52
+ id="save"
53
+ look="primary"
54
+ color="positive"
55
+ label=${this.localize.term('buttons_save')}
56
+ @click="${__classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_instances, "m", _UmbCultureAndHostnamesModalElement_handleSave)}"></uui-button>
57
+ </umb-body-layout>
58
+ `;
59
+ }
60
+ };
61
+ _UmbCultureAndHostnamesModalElement_documentRepository = new WeakMap();
62
+ _UmbCultureAndHostnamesModalElement_languageRepository = new WeakMap();
63
+ _UmbCultureAndHostnamesModalElement_unique = new WeakMap();
64
+ _UmbCultureAndHostnamesModalElement_instances = new WeakSet();
65
+ _UmbCultureAndHostnamesModalElement_readDomains = async function _UmbCultureAndHostnamesModalElement_readDomains() {
66
+ if (!__classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_unique, "f"))
67
+ return;
68
+ const { data } = await __classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_documentRepository, "f").readCultureAndHostnames(__classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_unique, "f"));
69
+ if (!data)
70
+ return;
71
+ this._defaultIsoCode = data.defaultIsoCode;
72
+ this._domains = data.domains;
73
+ };
74
+ _UmbCultureAndHostnamesModalElement_requestLanguages = async function _UmbCultureAndHostnamesModalElement_requestLanguages() {
75
+ const { data } = await __classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_languageRepository, "f").requestLanguages();
76
+ if (!data)
77
+ return;
78
+ this._languageModel = data.items;
79
+ };
80
+ _UmbCultureAndHostnamesModalElement_handleSave =
81
+ // Modal
82
+ async function _UmbCultureAndHostnamesModalElement_handleSave() {
83
+ this.value = { defaultIsoCode: this._defaultIsoCode, domains: this._domains };
84
+ await __classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_documentRepository, "f").updateCultureAndHostnames(__classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_unique, "f"), this.value);
85
+ };
86
+ _UmbCultureAndHostnamesModalElement_handleClose = function _UmbCultureAndHostnamesModalElement_handleClose() {
87
+ this.modalContext?.submit();
88
+ };
89
+ _UmbCultureAndHostnamesModalElement_onChangeLanguage = function _UmbCultureAndHostnamesModalElement_onChangeLanguage(e) {
90
+ const defaultIsoCode = e.target.value;
91
+ if (defaultIsoCode === 'inherit') {
92
+ this._defaultIsoCode = null;
93
+ }
94
+ else {
95
+ this._defaultIsoCode = defaultIsoCode;
96
+ }
97
+ };
98
+ _UmbCultureAndHostnamesModalElement_onChangeDomainLanguage = function _UmbCultureAndHostnamesModalElement_onChangeDomainLanguage(e, index) {
99
+ const isoCode = e.target.value;
100
+ this._domains = this._domains.map((domain, i) => (index === i ? { ...domain, isoCode } : domain));
101
+ };
102
+ _UmbCultureAndHostnamesModalElement_onChangeDomainHostname = function _UmbCultureAndHostnamesModalElement_onChangeDomainHostname(e, index) {
103
+ const domainName = e.target.value;
104
+ this._domains = this._domains.map((domain, i) => (index === i ? { ...domain, domainName } : domain));
105
+ };
106
+ _UmbCultureAndHostnamesModalElement_onRemoveDomain = async function _UmbCultureAndHostnamesModalElement_onRemoveDomain(index) {
107
+ this._domains = this._domains.filter((d, i) => index !== i);
108
+ };
109
+ _UmbCultureAndHostnamesModalElement_onAddDomain = function _UmbCultureAndHostnamesModalElement_onAddDomain(useCurrentDomain) {
110
+ const defaultModel = this._languageModel.find((model) => model.isDefault);
111
+ if (useCurrentDomain) {
112
+ // TODO: This ignorer is just needed for JSON SCHEMA TO WORK, As its not updated with latest TS jet.
113
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
114
+ // @ts-ignore
115
+ this.popoverContainerElement?.hidePopover();
116
+ this._domains = [...this._domains, { isoCode: defaultModel?.isoCode ?? '', domainName: window.location.host }];
117
+ }
118
+ else {
119
+ this._domains = [...this._domains, { isoCode: defaultModel?.isoCode ?? '', domainName: '' }];
120
+ }
121
+ };
122
+ _UmbCultureAndHostnamesModalElement_renderCultureSection = function _UmbCultureAndHostnamesModalElement_renderCultureSection() {
123
+ return html `<uui-box headline=${this.localize.term('assignDomain_setLanguage')}>
124
+ <uui-label for="select">${this.localize.term('assignDomain_language')}</uui-label>
125
+ <uui-combobox
126
+ id="select"
127
+ label=${this.localize.term('assignDomain_language')}
128
+ .value=${this._defaultIsoCode ?? 'inherit'}
129
+ @change=${__classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_instances, "m", _UmbCultureAndHostnamesModalElement_onChangeLanguage)}>
130
+ <uui-combobox-list>
131
+ <uui-combobox-list-option .value=${'inherit'}>
132
+ ${this.localize.term('assignDomain_inherit')}
133
+ </uui-combobox-list-option>
134
+ ${__classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_instances, "m", _UmbCultureAndHostnamesModalElement_renderLanguageModelOptions).call(this)}
135
+ </uui-combobox-list>
136
+ </uui-combobox>
137
+ </uui-box>`;
138
+ };
139
+ _UmbCultureAndHostnamesModalElement_renderDomainSection = function _UmbCultureAndHostnamesModalElement_renderDomainSection() {
140
+ return html `<uui-box headline=${this.localize.term('assignDomain_setDomains')}>
141
+ <umb-localize key="assignDomain_domainHelpWithVariants">
142
+ Valid domain names are: "example.com", "www.example.com", "example.com:8080", or "https://www.example.com/".<br />Furthermore
143
+ also one-level paths in domains are supported, eg. "example.com/en" or "/en".
144
+ </umb-localize>
145
+ ${__classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_instances, "m", _UmbCultureAndHostnamesModalElement_renderDomains).call(this)} ${__classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_instances, "m", _UmbCultureAndHostnamesModalElement_renderAddNewDomainButton).call(this)}
146
+ </uui-box>`;
147
+ };
148
+ _UmbCultureAndHostnamesModalElement_renderDomains = function _UmbCultureAndHostnamesModalElement_renderDomains() {
149
+ if (!this._domains?.length)
150
+ return;
151
+ return html `<div id="domains">
152
+ ${repeat(this._domains, (domain) => domain.isoCode, (domain, index) => html `
153
+ <uui-input
154
+ label=${this.localize.term('assignDomain_domain')}
155
+ .value=${domain.domainName}
156
+ @change=${(e) => __classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_instances, "m", _UmbCultureAndHostnamesModalElement_onChangeDomainHostname).call(this, e, index)}></uui-input>
157
+ <uui-combobox
158
+ .value=${domain.isoCode}
159
+ label=${this.localize.term('assignDomain_language')}
160
+ @change=${(e) => __classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_instances, "m", _UmbCultureAndHostnamesModalElement_onChangeDomainLanguage).call(this, e, index)}>
161
+ <uui-combobox-list> ${__classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_instances, "m", _UmbCultureAndHostnamesModalElement_renderLanguageModelOptions).call(this)} </uui-combobox-list>
162
+ </uui-combobox>
163
+ <uui-button
164
+ look="outline"
165
+ color="danger"
166
+ label=${this.localize.term('assignDomain_remove')}
167
+ @click=${() => __classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_instances, "m", _UmbCultureAndHostnamesModalElement_onRemoveDomain).call(this, index)}>
168
+ <uui-icon name="icon-trash"></uui-icon>
169
+ </uui-button>
170
+ `)}
171
+ </div>`;
172
+ };
173
+ _UmbCultureAndHostnamesModalElement_renderLanguageModelOptions = function _UmbCultureAndHostnamesModalElement_renderLanguageModelOptions() {
174
+ return html `${repeat(this._languageModel, (model) => model.isoCode, (model) => html `<uui-combobox-list-option .value=${model.isoCode}>${model.name}</uui-combobox-list-option>`)}`;
175
+ };
176
+ _UmbCultureAndHostnamesModalElement_renderAddNewDomainButton = function _UmbCultureAndHostnamesModalElement_renderAddNewDomainButton() {
177
+ return html `<uui-button-group>
178
+ <uui-button
179
+ label=${this.localize.term('assignDomain_addNew')}
180
+ look="placeholder"
181
+ @click=${() => __classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_instances, "m", _UmbCultureAndHostnamesModalElement_onAddDomain).call(this)}></uui-button>
182
+ <uui-button
183
+ id="dropdown"
184
+ label=${this.localize.term('buttons_select')}
185
+ look="placeholder"
186
+ popovertarget="more-options">
187
+ <uui-icon name="icon-navigation-down"></uui-icon>
188
+ </uui-button>
189
+ <uui-popover-container id="more-options" placement="bottom-end">
190
+ <umb-popover-layout>
191
+ <uui-button label=${this.localize.term('assignDomain_addCurrent')} @click=${() => __classPrivateFieldGet(this, _UmbCultureAndHostnamesModalElement_instances, "m", _UmbCultureAndHostnamesModalElement_onAddDomain).call(this, true)}></uui-button>
192
+ </umb-popover-layout>
193
+ </uui-popover-container>
194
+ </uui-button-group> `;
195
+ };
196
+ UmbCultureAndHostnamesModalElement.styles = [
197
+ UmbTextStyles,
198
+ css `
199
+ uui-button-group {
200
+ width: 100%;
201
+ }
202
+
203
+ uui-box:first-child {
204
+ margin-bottom: var(--uui-size-layout-1);
205
+ }
206
+
207
+ #dropdown {
208
+ flex-grow: 0;
209
+ }
210
+
211
+ #domains {
212
+ margin-top: var(--uui-size-layout-1);
213
+ margin-bottom: var(--uui-size-2);
214
+ display: grid;
215
+ grid-template-columns: 1fr 1fr auto;
216
+ grid-gap: var(--uui-size-1);
217
+ }
218
+ `,
219
+ ];
220
+ __decorate([
221
+ state()
222
+ ], UmbCultureAndHostnamesModalElement.prototype, "_languageModel", void 0);
223
+ __decorate([
224
+ state()
225
+ ], UmbCultureAndHostnamesModalElement.prototype, "_defaultIsoCode", void 0);
226
+ __decorate([
227
+ state()
228
+ ], UmbCultureAndHostnamesModalElement.prototype, "_domains", void 0);
229
+ __decorate([
230
+ query('#more-options')
231
+ ], UmbCultureAndHostnamesModalElement.prototype, "popoverContainerElement", void 0);
232
+ UmbCultureAndHostnamesModalElement = __decorate([
233
+ customElement('umb-culture-and-hostnames-modal')
234
+ ], UmbCultureAndHostnamesModalElement);
235
+ export { UmbCultureAndHostnamesModalElement };
236
+ export default UmbCultureAndHostnamesModalElement;
@@ -0,0 +1,10 @@
1
+ import type { DomainPresentationModel } from '../../../../../../external/backend-api/index.js';
2
+ import { UmbModalToken } from '../../../../../core/modal/index.js';
3
+ export interface UmbCultureAndHostnamesModalData {
4
+ unique: string | null;
5
+ }
6
+ export interface UmbCultureAndHostnamesModalValue {
7
+ defaultIsoCode?: string | null;
8
+ domains: Array<DomainPresentationModel>;
9
+ }
10
+ export declare const UMB_CULTURE_AND_HOSTNAMES_MODAL: UmbModalToken<UmbCultureAndHostnamesModalData, UmbCultureAndHostnamesModalValue>;
@@ -0,0 +1,7 @@
1
+ import { UmbModalToken } from '../../../../../core/modal/index.js';
2
+ export const UMB_CULTURE_AND_HOSTNAMES_MODAL = new UmbModalToken('Umb.Modal.CultureAndHostnames', {
3
+ modal: {
4
+ type: 'sidebar',
5
+ size: 'medium',
6
+ },
7
+ });
@@ -0,0 +1,2 @@
1
+ export * from './culture-and-hostnames-modal.token.js';
2
+ export * from './culture-and-hostnames-modal.element.js';
@@ -0,0 +1,2 @@
1
+ export * from './culture-and-hostnames-modal.token.js';
2
+ export * from './culture-and-hostnames-modal.element.js';
@@ -0,0 +1,18 @@
1
+ import type { UmbControllerHost } from '../../../../../../libs/controller-api/index.js';
2
+ import { UmbBaseController } from '../../../../../../libs/class-api/index.js';
3
+ import type { UmbApi } from '../../../../../../libs/extension-api/index.js';
4
+ import type { DomainsPresentationModelBaseModel } from '../../../../../../external/backend-api/index.js';
5
+ export declare class UmbDocumentCultureAndHostnamesRepository extends UmbBaseController implements UmbApi {
6
+ #private;
7
+ constructor(host: UmbControllerHost);
8
+ readCultureAndHostnames(unique: string): Promise<{
9
+ data: DomainsPresentationModelBaseModel | undefined;
10
+ error?: undefined;
11
+ } | {
12
+ error: import("../../../../../../external/backend-api/index.js").ApiError | import("../../../../../../external/backend-api/index.js").CancelError;
13
+ data?: undefined;
14
+ }>;
15
+ updateCultureAndHostnames(unique: string, data: DomainsPresentationModelBaseModel): Promise<{
16
+ error: import("../../../../../../external/backend-api/index.js").ApiError | import("../../../../../../external/backend-api/index.js").CancelError | undefined;
17
+ }>;
18
+ }
@@ -0,0 +1,47 @@
1
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
+ if (kind === "m") throw new TypeError("Private method is not writable");
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
+ 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");
5
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
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 _UmbDocumentCultureAndHostnamesRepository_dataSource, _UmbDocumentCultureAndHostnamesRepository_notificationContext;
13
+ import { UmbDocumentCultureAndHostnamesServerDataSource } from './culture-and-hostnames.server.data.js';
14
+ import { UmbBaseController } from '../../../../../../libs/class-api/index.js';
15
+ import { UMB_NOTIFICATION_CONTEXT } from '../../../../../core/notification/index.js';
16
+ export class UmbDocumentCultureAndHostnamesRepository extends UmbBaseController {
17
+ constructor(host) {
18
+ super(host);
19
+ _UmbDocumentCultureAndHostnamesRepository_dataSource.set(this, new UmbDocumentCultureAndHostnamesServerDataSource(this));
20
+ _UmbDocumentCultureAndHostnamesRepository_notificationContext.set(this, void 0);
21
+ this.consumeContext(UMB_NOTIFICATION_CONTEXT, (instance) => {
22
+ __classPrivateFieldSet(this, _UmbDocumentCultureAndHostnamesRepository_notificationContext, instance, "f");
23
+ });
24
+ }
25
+ async readCultureAndHostnames(unique) {
26
+ if (!unique)
27
+ throw new Error('Unique is missing');
28
+ const { data, error } = await __classPrivateFieldGet(this, _UmbDocumentCultureAndHostnamesRepository_dataSource, "f").read(unique);
29
+ if (!error) {
30
+ return { data };
31
+ }
32
+ return { error };
33
+ }
34
+ async updateCultureAndHostnames(unique, data) {
35
+ if (!unique)
36
+ throw new Error('Unique is missing');
37
+ if (!data)
38
+ throw new Error('Data is missing');
39
+ const { error } = await __classPrivateFieldGet(this, _UmbDocumentCultureAndHostnamesRepository_dataSource, "f").update(unique, data);
40
+ if (!error) {
41
+ const notification = { data: { message: `Cultures and hostnames saved` } };
42
+ __classPrivateFieldGet(this, _UmbDocumentCultureAndHostnamesRepository_notificationContext, "f")?.peek('positive', notification);
43
+ }
44
+ return { error };
45
+ }
46
+ }
47
+ _UmbDocumentCultureAndHostnamesRepository_dataSource = new WeakMap(), _UmbDocumentCultureAndHostnamesRepository_notificationContext = new WeakMap();