@umbraco-cms/backoffice 14.0.0--preview005-c0d3d16d → 14.0.0--preview005-268981cb

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 (31) hide show
  1. package/dist-cms/custom-elements.json +14 -0
  2. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/culture-and-hostnames.action.d.ts +9 -0
  3. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/culture-and-hostnames.action.js +37 -0
  4. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/index.d.ts +2 -0
  5. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/index.js +2 -0
  6. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/manifests.d.ts +2 -0
  7. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/manifests.js +27 -0
  8. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/modal/culture-and-hostnames-modal.element.d.ts +19 -0
  9. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/modal/culture-and-hostnames-modal.element.js +236 -0
  10. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/modal/culture-and-hostnames-modal.token.d.ts +10 -0
  11. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/modal/culture-and-hostnames-modal.token.js +7 -0
  12. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/modal/index.d.ts +2 -0
  13. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/modal/index.js +2 -0
  14. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/repository/culture-and-hostnames.repository.d.ts +18 -0
  15. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/repository/culture-and-hostnames.repository.js +47 -0
  16. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/repository/culture-and-hostnames.server.data.d.ts +30 -0
  17. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/repository/culture-and-hostnames.server.data.js +53 -0
  18. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/repository/index.d.ts +2 -0
  19. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/repository/index.js +2 -0
  20. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/repository/manifests.d.ts +3 -0
  21. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames/repository/manifests.js +9 -0
  22. package/dist-cms/packages/documents/documents/entity-actions/index.d.ts +1 -0
  23. package/dist-cms/packages/documents/documents/entity-actions/index.js +1 -0
  24. package/dist-cms/packages/documents/documents/entity-actions/manifests.js +2 -14
  25. package/dist-cms/packages/documents/documents/index.d.ts +1 -0
  26. package/dist-cms/packages/documents/documents/index.js +1 -0
  27. package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
  28. package/dist-cms/vscode-html-custom-data.json +5 -0
  29. package/package.json +1 -1
  30. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames.action.d.ts +0 -7
  31. package/dist-cms/packages/documents/documents/entity-actions/culture-and-hostnames.action.js +0 -10
@@ -6537,6 +6537,20 @@
6537
6537
  }
6538
6538
  ]
6539
6539
  },
6540
+ {
6541
+ "name": "umb-culture-and-hostnames-modal",
6542
+ "path": "./../src/packages/documents/documents/entity-actions/culture-and-hostnames/modal/culture-and-hostnames-modal.element.ts",
6543
+ "properties": [
6544
+ {
6545
+ "name": "popoverContainerElement"
6546
+ },
6547
+ {
6548
+ "name": "styles",
6549
+ "type": "array",
6550
+ "default": "[\"UmbTextStyles\",null]"
6551
+ }
6552
+ ]
6553
+ },
6540
6554
  {
6541
6555
  "name": "umb-permissions-modal",
6542
6556
  "path": "./../src/packages/documents/documents/entity-actions/permissions/permissions-modal.element.ts",
@@ -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();
@@ -0,0 +1,30 @@
1
+ import type { DomainsPresentationModelBaseModel } from '../../../../../../external/backend-api/index.js';
2
+ import type { UmbControllerHost } from '../../../../../../libs/controller-api/index.js';
3
+ /**
4
+ * A data source for the Document Culture and Hostnames that fetches data from the server
5
+ * @export
6
+ * @class UmbDocumentCultureAndHostnamesServerDataSource
7
+ * @implements {RepositoryDetailDataSource}
8
+ */
9
+ export declare class UmbDocumentCultureAndHostnamesServerDataSource {
10
+ #private;
11
+ /**
12
+ * Creates an instance of UmbDocumentCultureAndHostnamesServerDataSource.
13
+ * @param {UmbControllerHost} host
14
+ * @memberof UmbDocumentCultureAndHostnamesServerDataSource
15
+ */
16
+ constructor(host: UmbControllerHost);
17
+ /**
18
+ * Fetches the Culture and Hostnames for the given Document unique
19
+ * @param {string} unique
20
+ * @memberof UmbDocumentCultureAndHostnamesServerDataSource
21
+ */
22
+ read(unique: string): Promise<import("../../../../../core/repository/index.js").DataSourceResponse<DomainsPresentationModelBaseModel>>;
23
+ /**
24
+ * Updates Culture and Hostnames for the given Document unique
25
+ * @param {string} unique
26
+ * @param {DomainsPresentationModelBaseModel} data
27
+ * @memberof UmbDocumentCultureAndHostnamesServerDataSource
28
+ */
29
+ update(unique: string, data: DomainsPresentationModelBaseModel): Promise<import("../../../../../core/repository/index.js").DataSourceResponse<any>>;
30
+ }
@@ -0,0 +1,53 @@
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 _UmbDocumentCultureAndHostnamesServerDataSource_host;
13
+ import { DocumentResource } from '../../../../../../external/backend-api/index.js';
14
+ import { tryExecuteAndNotify } from '../../../../../../shared/resources/index.js';
15
+ /**
16
+ * A data source for the Document Culture and Hostnames that fetches data from the server
17
+ * @export
18
+ * @class UmbDocumentCultureAndHostnamesServerDataSource
19
+ * @implements {RepositoryDetailDataSource}
20
+ */
21
+ export class UmbDocumentCultureAndHostnamesServerDataSource {
22
+ /**
23
+ * Creates an instance of UmbDocumentCultureAndHostnamesServerDataSource.
24
+ * @param {UmbControllerHost} host
25
+ * @memberof UmbDocumentCultureAndHostnamesServerDataSource
26
+ */
27
+ constructor(host) {
28
+ _UmbDocumentCultureAndHostnamesServerDataSource_host.set(this, void 0);
29
+ __classPrivateFieldSet(this, _UmbDocumentCultureAndHostnamesServerDataSource_host, host, "f");
30
+ }
31
+ /**
32
+ * Fetches the Culture and Hostnames for the given Document unique
33
+ * @param {string} unique
34
+ * @memberof UmbDocumentCultureAndHostnamesServerDataSource
35
+ */
36
+ async read(unique) {
37
+ if (!unique)
38
+ throw new Error('Unique is missing');
39
+ return tryExecuteAndNotify(__classPrivateFieldGet(this, _UmbDocumentCultureAndHostnamesServerDataSource_host, "f"), DocumentResource.getDocumentByIdDomains({ id: unique }));
40
+ }
41
+ /**
42
+ * Updates Culture and Hostnames for the given Document unique
43
+ * @param {string} unique
44
+ * @param {DomainsPresentationModelBaseModel} data
45
+ * @memberof UmbDocumentCultureAndHostnamesServerDataSource
46
+ */
47
+ async update(unique, data) {
48
+ if (!unique)
49
+ throw new Error('Unique is missing');
50
+ return tryExecuteAndNotify(__classPrivateFieldGet(this, _UmbDocumentCultureAndHostnamesServerDataSource_host, "f"), DocumentResource.putDocumentByIdDomains({ id: unique, requestBody: data }));
51
+ }
52
+ }
53
+ _UmbDocumentCultureAndHostnamesServerDataSource_host = new WeakMap();
@@ -0,0 +1,2 @@
1
+ export { UmbDocumentCultureAndHostnamesRepository } from './culture-and-hostnames.repository.js';
2
+ export { UMB_DOCUMENT_CULTURE_AND_HOSTNAMES_REPOSITORY_ALIAS } from './manifests.js';
@@ -0,0 +1,2 @@
1
+ export { UmbDocumentCultureAndHostnamesRepository } from './culture-and-hostnames.repository.js';
2
+ export { UMB_DOCUMENT_CULTURE_AND_HOSTNAMES_REPOSITORY_ALIAS } from './manifests.js';
@@ -0,0 +1,3 @@
1
+ import type { ManifestRepository } from '../../../../../core/extension-registry/index.js';
2
+ export declare const UMB_DOCUMENT_CULTURE_AND_HOSTNAMES_REPOSITORY_ALIAS = "Umb.Repository.Document.CultureAndHostnames";
3
+ export declare const manifests: ManifestRepository<import("../../../../../../libs/extension-api/index.js").UmbApi>[];
@@ -0,0 +1,9 @@
1
+ import { UmbDocumentCultureAndHostnamesRepository } from '../repository/index.js';
2
+ export const UMB_DOCUMENT_CULTURE_AND_HOSTNAMES_REPOSITORY_ALIAS = 'Umb.Repository.Document.CultureAndHostnames';
3
+ const repository = {
4
+ type: 'repository',
5
+ alias: UMB_DOCUMENT_CULTURE_AND_HOSTNAMES_REPOSITORY_ALIAS,
6
+ name: 'Document Culture And Hostnames Repository',
7
+ api: UmbDocumentCultureAndHostnamesRepository,
8
+ };
9
+ export const manifests = [repository];
@@ -0,0 +1 @@
1
+ export * from './culture-and-hostnames/index.js';
@@ -0,0 +1 @@
1
+ export * from './culture-and-hostnames/index.js';
@@ -1,17 +1,18 @@
1
1
  import { UMB_DOCUMENT_DETAIL_REPOSITORY_ALIAS } from '../repository/index.js';
2
2
  import { UMB_DOCUMENT_ENTITY_TYPE, UMB_DOCUMENT_ROOT_ENTITY_TYPE } from '../entity.js';
3
3
  import { UmbPublishDocumentEntityAction } from './publish.action.js';
4
- import { UmbDocumentCultureAndHostnamesEntityAction } from './culture-and-hostnames.action.js';
5
4
  import { UmbCreateDocumentBlueprintEntityAction } from './create-blueprint.action.js';
6
5
  import { UmbDocumentPublicAccessEntityAction } from './public-access.action.js';
7
6
  import { UmbUnpublishDocumentEntityAction } from './unpublish.action.js';
8
7
  import { UmbRollbackDocumentEntityAction } from './rollback.action.js';
9
8
  import { manifests as createManifests } from './create/manifests.js';
10
9
  import { manifests as permissionManifests } from './permissions/manifests.js';
10
+ import { manifests as cultureAndHostnamesManifests } from './culture-and-hostnames/manifests.js';
11
11
  import { UmbCopyEntityAction, UmbMoveEntityAction, UmbSortChildrenOfEntityAction, } from '../../../core/entity-action/index.js';
12
12
  const entityActions = [
13
13
  ...createManifests,
14
14
  ...permissionManifests,
15
+ ...cultureAndHostnamesManifests,
15
16
  {
16
17
  type: 'entityAction',
17
18
  alias: 'Umb.EntityAction.Document.CreateBlueprint',
@@ -64,19 +65,6 @@ const entityActions = [
64
65
  entityTypes: [UMB_DOCUMENT_ROOT_ENTITY_TYPE, UMB_DOCUMENT_ENTITY_TYPE],
65
66
  },
66
67
  },
67
- {
68
- type: 'entityAction',
69
- alias: 'Umb.EntityAction.Document.CultureAndHostnames',
70
- name: 'Culture And Hostnames Document Entity Action',
71
- weight: 400,
72
- api: UmbDocumentCultureAndHostnamesEntityAction,
73
- meta: {
74
- icon: 'icon-home',
75
- label: 'Culture And Hostnames (TBD)',
76
- repositoryAlias: UMB_DOCUMENT_DETAIL_REPOSITORY_ALIAS,
77
- entityTypes: [UMB_DOCUMENT_ENTITY_TYPE],
78
- },
79
- },
80
68
  {
81
69
  type: 'entityAction',
82
70
  alias: 'Umb.EntityAction.Document.PublicAccess',
@@ -6,6 +6,7 @@ export * from './recycle-bin/index.js';
6
6
  export * from './user-permissions/index.js';
7
7
  export * from './components/index.js';
8
8
  export * from './entity.js';
9
+ export * from './entity-actions/index.js';
9
10
  export { UMB_DOCUMENT_TREE_ALIAS } from './tree/index.js';
10
11
  export { UMB_CONTENT_MENU_ALIAS } from './menu.manifests.js';
11
12
  export { UMB_DOCUMENT_COLLECTION_ALIAS } from './collection/index.js';