@umbraco-cms/backoffice 14.0.0-3ffd4766 → 14.0.0-40e04294
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.
- package/dist-cms/custom-elements.json +33 -11
- package/dist-cms/external/backend-api/index.js +1 -1
- package/dist-cms/external/backend-api/src/index.d.ts +17 -1
- package/dist-cms/external/backend-api/src/models/CreateContentRequestModelBaseDocumentValueModelDocumentVariantRequestModel.d.ts +1 -0
- package/dist-cms/external/backend-api/src/models/CreateContentRequestModelBaseMediaValueModelMediaVariantRequestModel.d.ts +1 -0
- package/dist-cms/external/backend-api/src/models/CreateContentTypeRequestModelBaseCreateDocumentTypePropertyTypeRequestModelCreateDocumentTypePropertyTypeContainerRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/CreateContentTypeRequestModelBaseCreateMediaTypePropertyTypeRequestModelCreateMediaTypePropertyTypeContainerRequestModel.d.ts +20 -0
- package/dist-cms/external/backend-api/src/models/CreateMediaTypePropertyTypeContainerRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/CreateMediaTypePropertyTypeRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/CreateMediaTypeRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/DeleteUserGroupsRequestModel.d.ts +3 -0
- package/dist-cms/external/backend-api/src/models/DeleteUsersRequestModel.d.ts +3 -0
- package/dist-cms/external/backend-api/src/models/ItemSortingRequestModel.d.ts +4 -0
- package/dist-cms/external/backend-api/src/models/ProblemDetailsBuilderModel.d.ts +1 -0
- package/dist-cms/external/backend-api/src/models/RelationResponseModel.d.ts +2 -2
- package/dist-cms/external/backend-api/src/models/ResetPasswordRequestModel.d.ts +3 -0
- package/dist-cms/external/backend-api/src/models/ResetPasswordTokenRequestModel.d.ts +4 -0
- package/dist-cms/external/backend-api/src/models/SortingRequestModel.d.ts +5 -0
- package/dist-cms/external/backend-api/src/models/UpdateContentTypeRequestModelBaseUpdateMediaTypePropertyTypeRequestModelUpdateMediaTypePropertyTypeContainerRequestModel.d.ts +18 -0
- package/dist-cms/external/backend-api/src/models/{UpdateFolderReponseModel.d.ts → UpdateFolderResponseModel.d.ts} +1 -1
- package/dist-cms/external/backend-api/src/models/UpdateMediaTypePropertyTypeContainerRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/UpdateMediaTypePropertyTypeRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/UpdateMediaTypeRequestModel.d.ts +2 -0
- package/dist-cms/external/backend-api/src/models/VerifyResetPasswordTokenRequestModel.d.ts +4 -0
- package/dist-cms/external/backend-api/src/services/DataTypeResource.d.ts +2 -2
- package/dist-cms/external/backend-api/src/services/DocumentResource.d.ts +21 -21
- package/dist-cms/external/backend-api/src/services/DocumentTypeResource.d.ts +35 -3
- package/dist-cms/external/backend-api/src/services/MediaResource.d.ts +13 -5
- package/dist-cms/external/backend-api/src/services/MediaTypeResource.d.ts +56 -0
- package/dist-cms/external/backend-api/src/services/RelationResource.d.ts +1 -9
- package/dist-cms/external/backend-api/src/services/SecurityResource.d.ts +24 -0
- package/dist-cms/external/backend-api/src/services/UserGroupResource.d.ts +8 -0
- package/dist-cms/external/backend-api/src/services/UserResource.d.ts +8 -0
- package/dist-cms/external/router-slot/config.d.ts +8 -0
- package/dist-cms/external/router-slot/index.d.ts +4 -3
- package/dist-cms/external/router-slot/index.js +1 -1
- package/dist-cms/external/router-slot/model.d.ts +123 -0
- package/dist-cms/external/router-slot/router-slot.d.ts +111 -0
- package/dist-cms/external/router-slot/util/anchor.d.ts +5 -0
- package/dist-cms/external/router-slot/util/events.d.ts +26 -0
- package/dist-cms/external/router-slot/util/history.d.ts +32 -0
- package/dist-cms/external/router-slot/util/index.d.ts +6 -0
- package/dist-cms/external/router-slot/util/router.d.ts +72 -0
- package/dist-cms/external/router-slot/util/shadow.d.ts +15 -0
- package/dist-cms/external/router-slot/util/url.d.ts +78 -0
- package/dist-cms/external/router-slot/util.d.ts +1 -0
- package/dist-cms/libs/observable-api/observer.js +2 -1
- package/dist-cms/mocks/browser-handlers.js +3 -1
- package/dist-cms/mocks/data/document.data.d.ts +6 -2
- package/dist-cms/mocks/data/document.data.js +54 -4
- package/dist-cms/mocks/data/entity.data.js +0 -2
- package/dist-cms/mocks/data/scripts.data.d.ts +21 -0
- package/dist-cms/mocks/data/scripts.data.js +205 -0
- package/dist-cms/mocks/handlers/{document.handlers.js → document/document.handlers.js} +28 -40
- package/dist-cms/mocks/handlers/document/index.d.ts +1 -0
- package/dist-cms/mocks/handlers/document/index.js +5 -0
- package/dist-cms/mocks/handlers/document/item.handlers.d.ts +1 -0
- package/dist-cms/mocks/handlers/document/item.handlers.js +13 -0
- package/dist-cms/mocks/handlers/document/recycle-bin.handlers.d.ts +1 -0
- package/dist-cms/mocks/handlers/document/recycle-bin.handlers.js +16 -0
- package/dist-cms/mocks/handlers/document/slug.d.ts +1 -0
- package/dist-cms/mocks/handlers/document/slug.js +1 -0
- package/dist-cms/mocks/handlers/document/tree.handlers.d.ts +1 -0
- package/dist-cms/mocks/handlers/document/tree.handlers.js +16 -0
- package/dist-cms/mocks/handlers/scripts.handlers.d.ts +2 -0
- package/dist-cms/mocks/handlers/scripts.handlers.js +83 -0
- package/dist-cms/packages/core/content-type/content-type-container-structure-helper.class.js +2 -2
- package/dist-cms/packages/core/content-type/content-type-property-structure-helper.class.js +1 -1
- package/dist-cms/packages/core/content-type/content-type-structure-manager.class.d.ts +15 -15
- package/dist-cms/packages/core/content-type/content-type-structure-manager.class.js +79 -103
- package/dist-cms/packages/core/entity-action/common/trash/trash.action.d.ts +1 -1
- package/dist-cms/packages/core/entity-action/common/trash/trash.action.js +1 -1
- package/dist-cms/packages/core/modal/token/create-document-modal.token.d.ts +8 -0
- package/dist-cms/packages/core/modal/token/create-document-modal.token.js +5 -0
- package/dist-cms/packages/core/modal/token/index.d.ts +1 -1
- package/dist-cms/packages/core/modal/token/index.js +1 -1
- package/dist-cms/packages/core/store/store-base.d.ts +18 -6
- package/dist-cms/packages/core/store/store-base.js +22 -6
- package/dist-cms/packages/documents/document-types/entity-actions/manifests.js +1 -1
- package/dist-cms/packages/documents/document-types/manifests.js +0 -2
- package/dist-cms/packages/documents/document-types/repository/document-type-item.store.d.ts +20 -0
- package/dist-cms/packages/documents/document-types/repository/document-type-item.store.js +23 -0
- package/dist-cms/packages/documents/document-types/repository/document-type.repository.d.ts +5 -21
- package/dist-cms/packages/documents/document-types/repository/document-type.repository.js +26 -20
- package/dist-cms/packages/documents/document-types/repository/manifests.d.ts +3 -2
- package/dist-cms/packages/documents/document-types/repository/manifests.js +9 -1
- package/dist-cms/packages/documents/document-types/repository/sources/document-type-item.server.data.d.ts +25 -0
- package/dist-cms/packages/documents/document-types/repository/sources/document-type-item.server.data.js +32 -0
- package/dist-cms/packages/documents/document-types/repository/sources/document-type.server.data.d.ts +1 -1
- package/dist-cms/packages/documents/document-types/repository/sources/document-type.server.data.js +1 -12
- package/dist-cms/packages/documents/document-types/workspace/document-type-workspace.context.js +27 -27
- package/dist-cms/packages/documents/document-types/workspace/views/design/document-type-workspace-view-edit.element.js +8 -4
- package/dist-cms/packages/documents/documents/entity-actions/create/create-document-modal.element.d.ts +17 -0
- package/dist-cms/packages/documents/{document-types/modals/allowed-document-types/allowed-document-types-modal.element.js → documents/entity-actions/create/create-document-modal.element.js} +29 -38
- package/dist-cms/packages/documents/documents/entity-actions/create/create.action.d.ts +0 -2
- package/dist-cms/packages/documents/documents/entity-actions/create/create.action.js +7 -23
- package/dist-cms/packages/documents/documents/entity-actions/create/manifests.d.ts +2 -0
- package/dist-cms/packages/documents/documents/entity-actions/create/manifests.js +27 -0
- package/dist-cms/packages/documents/documents/entity-actions/manifests.d.ts +2 -2
- package/dist-cms/packages/documents/documents/entity-actions/manifests.js +15 -48
- package/dist-cms/packages/documents/documents/index.d.ts +1 -0
- package/dist-cms/packages/documents/documents/index.js +1 -0
- package/dist-cms/packages/documents/documents/manifests.d.ts +13 -1
- package/dist-cms/packages/documents/documents/manifests.js +2 -0
- package/dist-cms/packages/documents/documents/menu-item/manifests.js +1 -1
- package/dist-cms/packages/documents/documents/recycle-bin/entity-action/manifests.d.ts +14 -0
- package/dist-cms/packages/documents/documents/recycle-bin/entity-action/manifests.js +18 -0
- package/dist-cms/packages/documents/documents/recycle-bin/index.d.ts +1 -0
- package/dist-cms/packages/documents/documents/recycle-bin/index.js +1 -0
- package/dist-cms/packages/documents/documents/recycle-bin/manifests.d.ts +13 -0
- package/dist-cms/packages/documents/documents/recycle-bin/manifests.js +5 -0
- package/dist-cms/packages/documents/documents/recycle-bin/menu-item/manifests.d.ts +1 -0
- package/dist-cms/packages/documents/documents/recycle-bin/menu-item/manifests.js +14 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/document-recycle-bin.repository.d.ts +28 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/document-recycle-bin.repository.js +56 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/document-recycle.bin.tree.store.d.ts +18 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/document-recycle.bin.tree.store.js +19 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/index.d.ts +1 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/index.js +1 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/manifests.d.ts +4 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/manifests.js +17 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/sources/document-recycle-bin.tree.server.data.d.ts +29 -0
- package/dist-cms/packages/documents/documents/recycle-bin/repository/sources/document-recycle-bin.tree.server.data.js +49 -0
- package/dist-cms/packages/documents/documents/recycle-bin/tree/manifests.d.ts +2 -0
- package/dist-cms/packages/documents/documents/recycle-bin/tree/manifests.js +19 -0
- package/dist-cms/packages/documents/documents/repository/document-item.store.d.ts +20 -0
- package/dist-cms/packages/documents/documents/repository/document-item.store.js +23 -0
- package/dist-cms/packages/documents/documents/repository/document.repository.d.ts +10 -9
- package/dist-cms/packages/documents/documents/repository/document.repository.js +47 -25
- package/dist-cms/packages/documents/documents/repository/document.store.d.ts +0 -12
- package/dist-cms/packages/documents/documents/repository/document.store.js +0 -16
- package/dist-cms/packages/documents/documents/repository/sources/document-item.server.data.d.ts +24 -0
- package/dist-cms/packages/documents/documents/repository/sources/document-item.server.data.js +31 -0
- package/dist-cms/packages/documents/documents/repository/sources/document.server.data.d.ts +9 -21
- package/dist-cms/packages/documents/documents/repository/sources/document.server.data.js +33 -62
- package/dist-cms/packages/documents/documents/workspace/manifests.js +6 -4
- package/dist-cms/packages/documents/manifests.d.ts +13 -1
- package/dist-cms/packages/settings/dashboards/performance-profiling/dashboard-performance-profiling.element.d.ts +3 -1
- package/dist-cms/packages/settings/dashboards/performance-profiling/dashboard-performance-profiling.element.js +26 -40
- package/dist-cms/packages/settings/relation-types/workspace/views/relation/workspace-view-relation-type-relation.element.js +17 -17
- package/dist-cms/packages/templating/manifests.js +2 -0
- package/dist-cms/packages/templating/scripts/config.d.ts +20 -0
- package/dist-cms/packages/templating/scripts/config.js +22 -0
- package/dist-cms/packages/templating/scripts/entity-actions/create/create-empty.action.d.ts +8 -0
- package/dist-cms/packages/templating/scripts/entity-actions/create/create-empty.action.js +9 -0
- package/dist-cms/packages/templating/scripts/entity-actions/manifests.d.ts +2 -0
- package/dist-cms/packages/templating/scripts/entity-actions/manifests.js +56 -0
- package/dist-cms/packages/templating/scripts/index.d.ts +2 -0
- package/dist-cms/packages/templating/scripts/index.js +2 -0
- package/dist-cms/packages/templating/scripts/manifests.d.ts +1 -0
- package/dist-cms/packages/templating/scripts/manifests.js +12 -0
- package/dist-cms/packages/templating/scripts/menu-item/manifests.d.ts +1 -0
- package/dist-cms/packages/templating/scripts/menu-item/manifests.js +16 -0
- package/dist-cms/packages/templating/scripts/repository/index.d.ts +1 -0
- package/dist-cms/packages/templating/scripts/repository/index.js +1 -0
- package/dist-cms/packages/templating/scripts/repository/manifests.d.ts +2 -0
- package/dist-cms/packages/templating/scripts/repository/manifests.js +23 -0
- package/dist-cms/packages/templating/scripts/repository/scripts.repository.d.ts +71 -0
- package/dist-cms/packages/templating/scripts/repository/scripts.repository.js +154 -0
- package/dist-cms/packages/templating/scripts/repository/scripts.store.d.ts +31 -0
- package/dist-cms/packages/templating/scripts/repository/scripts.store.js +37 -0
- package/dist-cms/packages/templating/scripts/repository/scripts.tree.store.d.ts +19 -0
- package/dist-cms/packages/templating/scripts/repository/scripts.tree.store.js +21 -0
- package/dist-cms/packages/templating/scripts/repository/sources/index.d.ts +11 -0
- package/dist-cms/packages/templating/scripts/repository/sources/index.js +1 -0
- package/dist-cms/packages/templating/scripts/repository/sources/scripts.detail.server.data.d.ts +41 -0
- package/dist-cms/packages/templating/scripts/repository/sources/scripts.detail.server.data.js +57 -0
- package/dist-cms/packages/templating/scripts/repository/sources/scripts.folder.server.data.d.ts +17 -0
- package/dist-cms/packages/templating/scripts/repository/sources/scripts.folder.server.data.js +23 -0
- package/dist-cms/packages/templating/scripts/repository/sources/scripts.tree.server.data.d.ts +14 -0
- package/dist-cms/packages/templating/scripts/repository/sources/scripts.tree.server.data.js +31 -0
- package/dist-cms/packages/templating/scripts/tree/manifests.d.ts +2 -0
- package/dist-cms/packages/templating/scripts/tree/manifests.js +20 -0
- package/dist-cms/packages/templating/scripts/workspace/manifests.d.ts +2 -0
- package/dist-cms/packages/templating/scripts/workspace/manifests.js +32 -0
- package/dist-cms/packages/templating/scripts/workspace/scripts-workspace-edit.element.d.ts +24 -0
- package/dist-cms/packages/templating/scripts/workspace/scripts-workspace-edit.element.js +171 -0
- package/dist-cms/packages/templating/scripts/workspace/scripts-workspace.context.d.ts +23 -0
- package/dist-cms/packages/templating/scripts/workspace/scripts-workspace.context.js +87 -0
- package/dist-cms/packages/templating/scripts/workspace/scripts-workspace.element.d.ts +14 -0
- package/dist-cms/packages/templating/scripts/workspace/scripts-workspace.element.js +50 -0
- package/dist-cms/packages/templating/templates/modals/query-builder/query-builder.element.d.ts +1 -1
- package/dist-cms/packages/templating/templates/modals/query-builder/query-builder.element.js +1 -1
- package/dist-cms/shared/repository/data-source/folder-data-source.interface.d.ts +2 -2
- package/dist-cms/shared/repository/folder-repository.interface.d.ts +2 -2
- package/dist-cms/shared/router/index.d.ts +1 -1
- package/dist-cms/shared/router/index.js +1 -1
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/vscode-html-custom-data.json +17 -7
- package/package.json +2 -3
- package/dist-cms/packages/core/modal/token/allowed-document-types-modal.token.d.ts +0 -9
- package/dist-cms/packages/core/modal/token/allowed-document-types-modal.token.js +0 -5
- package/dist-cms/packages/documents/document-types/modals/allowed-document-types/allowed-document-types-modal.element.d.ts +0 -19
- package/dist-cms/packages/documents/document-types/modals/manifests.d.ts +0 -2
- package/dist-cms/packages/documents/document-types/modals/manifests.js +0 -9
- package/router-slot-2.3.0.tgz +0 -0
- /package/dist-cms/mocks/handlers/{document.handlers.d.ts → document/document.handlers.d.ts} +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { UmbContextToken } from '../../../../libs/context-api/index.js';
|
|
2
|
+
import { UmbStoreBase } from '../../../core/store/index.js';
|
|
3
|
+
import type { TemplateResponseModel } from '../../../../external/backend-api/index.js';
|
|
4
|
+
import { UmbControllerHostElement } from '../../../../libs/controller-api/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* @export
|
|
7
|
+
* @class UmbScriptsStore
|
|
8
|
+
* @extends {UmbStoreBase}
|
|
9
|
+
* @description - Data Store for scripts
|
|
10
|
+
*/
|
|
11
|
+
export declare class UmbScriptsStore extends UmbStoreBase {
|
|
12
|
+
/**
|
|
13
|
+
* Creates an instance of UmbScriptsStore.
|
|
14
|
+
* @param {UmbControllerHostInterface} host
|
|
15
|
+
* @memberof UmbScriptsStore
|
|
16
|
+
*/
|
|
17
|
+
constructor(host: UmbControllerHostElement);
|
|
18
|
+
/**
|
|
19
|
+
* Append a script to the store
|
|
20
|
+
* @param {Template} template
|
|
21
|
+
* @memberof UmbScriptsStore
|
|
22
|
+
*/
|
|
23
|
+
append(template: TemplateResponseModel): void;
|
|
24
|
+
/**
|
|
25
|
+
* Removes scripts in the store with the given uniques
|
|
26
|
+
* @param {string[]} uniques
|
|
27
|
+
* @memberof UmbScriptsStore
|
|
28
|
+
*/
|
|
29
|
+
remove(uniques: string[]): void;
|
|
30
|
+
}
|
|
31
|
+
export declare const UMB_SCRIPTS_STORE_CONTEXT_TOKEN: UmbContextToken<UmbScriptsStore, UmbScriptsStore>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { UMB_SCRIPTS_STORE_CONTEXT_TOKEN_ALIAS } from '../config.js';
|
|
2
|
+
import { UmbContextToken } from '../../../../libs/context-api/index.js';
|
|
3
|
+
import { UmbArrayState } from '../../../../libs/observable-api/index.js';
|
|
4
|
+
import { UmbStoreBase } from '../../../core/store/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* @export
|
|
7
|
+
* @class UmbScriptsStore
|
|
8
|
+
* @extends {UmbStoreBase}
|
|
9
|
+
* @description - Data Store for scripts
|
|
10
|
+
*/
|
|
11
|
+
export class UmbScriptsStore extends UmbStoreBase {
|
|
12
|
+
/**
|
|
13
|
+
* Creates an instance of UmbScriptsStore.
|
|
14
|
+
* @param {UmbControllerHostInterface} host
|
|
15
|
+
* @memberof UmbScriptsStore
|
|
16
|
+
*/
|
|
17
|
+
constructor(host) {
|
|
18
|
+
super(host, UMB_SCRIPTS_STORE_CONTEXT_TOKEN.toString(), new UmbArrayState([], (x) => x.id));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Append a script to the store
|
|
22
|
+
* @param {Template} template
|
|
23
|
+
* @memberof UmbScriptsStore
|
|
24
|
+
*/
|
|
25
|
+
append(template) {
|
|
26
|
+
this._data.append([template]);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Removes scripts in the store with the given uniques
|
|
30
|
+
* @param {string[]} uniques
|
|
31
|
+
* @memberof UmbScriptsStore
|
|
32
|
+
*/
|
|
33
|
+
remove(uniques) {
|
|
34
|
+
this._data.remove(uniques);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export const UMB_SCRIPTS_STORE_CONTEXT_TOKEN = new UmbContextToken(UMB_SCRIPTS_STORE_CONTEXT_TOKEN_ALIAS);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { UmbContextToken } from '../../../../libs/context-api/index.js';
|
|
2
|
+
import { UmbFileSystemTreeStore } from '../../../core/store/index.js';
|
|
3
|
+
import type { UmbControllerHostElement } from '../../../../libs/controller-api/index.js';
|
|
4
|
+
export declare const UMB_SCRIPTS_TREE_STORE_CONTEXT_TOKEN: UmbContextToken<UmbScriptsTreeStore, UmbScriptsTreeStore>;
|
|
5
|
+
/**
|
|
6
|
+
* Tree Store for scripts
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @class
|
|
10
|
+
* @extends {UmbEntityTreeStore}
|
|
11
|
+
*/
|
|
12
|
+
export declare class UmbScriptsTreeStore extends UmbFileSystemTreeStore {
|
|
13
|
+
/**
|
|
14
|
+
* Creates an instance of UmbScriptsTreeStore.
|
|
15
|
+
* @param {UmbControllerHostInterface} host
|
|
16
|
+
* @memberof UmbScriptsTreeStore
|
|
17
|
+
*/
|
|
18
|
+
constructor(host: UmbControllerHostElement);
|
|
19
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { UMB_SCRIPTS_TREE_STORE_CONTEXT_TOKEN_ALIAS } from '../config.js';
|
|
2
|
+
import { UmbContextToken } from '../../../../libs/context-api/index.js';
|
|
3
|
+
import { UmbFileSystemTreeStore } from '../../../core/store/index.js';
|
|
4
|
+
export const UMB_SCRIPTS_TREE_STORE_CONTEXT_TOKEN = new UmbContextToken(UMB_SCRIPTS_TREE_STORE_CONTEXT_TOKEN_ALIAS);
|
|
5
|
+
/**
|
|
6
|
+
* Tree Store for scripts
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @class
|
|
10
|
+
* @extends {UmbEntityTreeStore}
|
|
11
|
+
*/
|
|
12
|
+
export class UmbScriptsTreeStore extends UmbFileSystemTreeStore {
|
|
13
|
+
/**
|
|
14
|
+
* Creates an instance of UmbScriptsTreeStore.
|
|
15
|
+
* @param {UmbControllerHostInterface} host
|
|
16
|
+
* @memberof UmbScriptsTreeStore
|
|
17
|
+
*/
|
|
18
|
+
constructor(host) {
|
|
19
|
+
super(host, UMB_SCRIPTS_TREE_STORE_CONTEXT_TOKEN.toString());
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FileSystemTreeItemPresentationModel, PagedFileSystemTreeItemPresentationModel } from '../../../../../external/backend-api/index.js';
|
|
2
|
+
import type { DataSourceResponse } from '../../../../../shared/repository/index.js';
|
|
3
|
+
export interface ScriptsTreeDataSource {
|
|
4
|
+
getRootItems(): Promise<DataSourceResponse<PagedFileSystemTreeItemPresentationModel>>;
|
|
5
|
+
getChildrenOf({ path, skip, take, }: {
|
|
6
|
+
path?: string | undefined;
|
|
7
|
+
skip?: number | undefined;
|
|
8
|
+
take?: number | undefined;
|
|
9
|
+
}): Promise<DataSourceResponse<PagedFileSystemTreeItemPresentationModel>>;
|
|
10
|
+
getItem(ids: Array<string>): Promise<DataSourceResponse<FileSystemTreeItemPresentationModel[]>>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist-cms/packages/templating/scripts/repository/sources/scripts.detail.server.data.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { CreateScriptRequestModel, CreateTextFileViewModelBaseModel, ScriptItemResponseModel, ScriptResponseModel, UpdateScriptRequestModel } from '../../../../../external/backend-api/index.js';
|
|
2
|
+
import type { UmbControllerHostElement } from '../../../../../libs/controller-api/index.js';
|
|
3
|
+
import { DataSourceResponse, UmbDataSource } from '../../../../../shared/repository/index.js';
|
|
4
|
+
export declare class UmbScriptsServerDataSource implements UmbDataSource<CreateScriptRequestModel, string, UpdateScriptRequestModel, ScriptResponseModel, string> {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(host: UmbControllerHostElement);
|
|
7
|
+
createScaffold(parentId: string | null, preset?: string | Partial<CreateTextFileViewModelBaseModel> | undefined): Promise<DataSourceResponse<CreateTextFileViewModelBaseModel>>;
|
|
8
|
+
/**
|
|
9
|
+
* Fetches a script with the given path from the server
|
|
10
|
+
* @param {string} path
|
|
11
|
+
* @return {*}
|
|
12
|
+
* @memberof UmbScriptsDetailServerDataSource
|
|
13
|
+
*/
|
|
14
|
+
get(path: string): Promise<DataSourceResponse<ScriptResponseModel>>;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new script
|
|
17
|
+
*
|
|
18
|
+
* @param {CreateScriptRequestModel} requestBody
|
|
19
|
+
* @return {*} {Promise<DataSourceResponse<string>>}
|
|
20
|
+
* @memberof UmbScriptsDetailServerDataSource
|
|
21
|
+
*/
|
|
22
|
+
insert(requestBody: CreateScriptRequestModel): Promise<DataSourceResponse<string>>;
|
|
23
|
+
/**
|
|
24
|
+
* Updates a script
|
|
25
|
+
*
|
|
26
|
+
* @param {string} [unique='']
|
|
27
|
+
* @param {UpdateScriptRequestModel} requestBody
|
|
28
|
+
* @return {*} {Promise<DataSourceResponse<any>>}
|
|
29
|
+
* @memberof UmbScriptsDetailServerDataSource
|
|
30
|
+
*/
|
|
31
|
+
update(unique: string | undefined, requestBody: UpdateScriptRequestModel): Promise<DataSourceResponse<any>>;
|
|
32
|
+
/**
|
|
33
|
+
* Deletes a script
|
|
34
|
+
*
|
|
35
|
+
* @param {string} path
|
|
36
|
+
* @return {*} {Promise<DataSourceResponse>}
|
|
37
|
+
* @memberof UmbScriptsDetailServerDataSource
|
|
38
|
+
*/
|
|
39
|
+
delete(path: string): Promise<DataSourceResponse>;
|
|
40
|
+
getItems(keys: Array<string>): Promise<DataSourceResponse<ScriptItemResponseModel[]>>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ScriptResource, } from '../../../../../external/backend-api/index.js';
|
|
2
|
+
import { tryExecuteAndNotify } from '../../../../../shared/resources/index.js';
|
|
3
|
+
export class UmbScriptsServerDataSource {
|
|
4
|
+
#host;
|
|
5
|
+
constructor(host) {
|
|
6
|
+
this.#host = host;
|
|
7
|
+
}
|
|
8
|
+
createScaffold(parentId, preset) {
|
|
9
|
+
throw new Error('Method not implemented.');
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Fetches a script with the given path from the server
|
|
13
|
+
* @param {string} path
|
|
14
|
+
* @return {*}
|
|
15
|
+
* @memberof UmbScriptsDetailServerDataSource
|
|
16
|
+
*/
|
|
17
|
+
get(path) {
|
|
18
|
+
if (!path)
|
|
19
|
+
throw new Error('Path is missing');
|
|
20
|
+
return tryExecuteAndNotify(this.#host, ScriptResource.getScript({ path }));
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates a new script
|
|
24
|
+
*
|
|
25
|
+
* @param {CreateScriptRequestModel} requestBody
|
|
26
|
+
* @return {*} {Promise<DataSourceResponse<string>>}
|
|
27
|
+
* @memberof UmbScriptsDetailServerDataSource
|
|
28
|
+
*/
|
|
29
|
+
insert(requestBody) {
|
|
30
|
+
return tryExecuteAndNotify(this.#host, ScriptResource.postScript({ requestBody }));
|
|
31
|
+
}
|
|
32
|
+
//TODO the parameters here are bit ugly, since unique is already in the request body parameter, but it has to be done to marry the UmbDataSource interface an backend API together... maybe come up with some nicer solution
|
|
33
|
+
/**
|
|
34
|
+
* Updates a script
|
|
35
|
+
*
|
|
36
|
+
* @param {string} [unique='']
|
|
37
|
+
* @param {UpdateScriptRequestModel} requestBody
|
|
38
|
+
* @return {*} {Promise<DataSourceResponse<any>>}
|
|
39
|
+
* @memberof UmbScriptsDetailServerDataSource
|
|
40
|
+
*/
|
|
41
|
+
update(unique = '', requestBody) {
|
|
42
|
+
return tryExecuteAndNotify(this.#host, ScriptResource.putScript({ requestBody }));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Deletes a script
|
|
46
|
+
*
|
|
47
|
+
* @param {string} path
|
|
48
|
+
* @return {*} {Promise<DataSourceResponse>}
|
|
49
|
+
* @memberof UmbScriptsDetailServerDataSource
|
|
50
|
+
*/
|
|
51
|
+
delete(path) {
|
|
52
|
+
return tryExecuteAndNotify(this.#host, ScriptResource.deleteScript({ path }));
|
|
53
|
+
}
|
|
54
|
+
getItems(keys) {
|
|
55
|
+
return tryExecuteAndNotify(this.#host, ScriptResource.getScriptItem({ path: keys }));
|
|
56
|
+
}
|
|
57
|
+
}
|
package/dist-cms/packages/templating/scripts/repository/sources/scripts.folder.server.data.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CreateFolderRequestModel, FolderModelBaseModel, FolderResponseModel } from '../../../../../external/backend-api/index.js';
|
|
2
|
+
import { UmbControllerHostElement } from '../../../../../libs/controller-api/index.js';
|
|
3
|
+
import { DataSourceResponse, UmbFolderDataSource } from '../../../../../shared/repository/index.js';
|
|
4
|
+
export type ScriptsGetFolderResponse = {
|
|
5
|
+
path: string;
|
|
6
|
+
parentPath: string;
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
9
|
+
export declare class UmbScriptsFolderServerDataSource implements UmbFolderDataSource {
|
|
10
|
+
#private;
|
|
11
|
+
constructor(host: UmbControllerHostElement);
|
|
12
|
+
createScaffold(parentId: string | null): Promise<DataSourceResponse<FolderResponseModel>>;
|
|
13
|
+
get(unique: string): Promise<DataSourceResponse<ScriptsGetFolderResponse>>;
|
|
14
|
+
insert(requestBody: CreateFolderRequestModel): Promise<DataSourceResponse<string>>;
|
|
15
|
+
update(unique: string, data: CreateFolderRequestModel): Promise<DataSourceResponse<FolderModelBaseModel>>;
|
|
16
|
+
delete(path: string): Promise<DataSourceResponse<unknown>>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ScriptResource, } from '../../../../../external/backend-api/index.js';
|
|
2
|
+
import { tryExecuteAndNotify } from '../../../../../shared/resources/index.js';
|
|
3
|
+
export class UmbScriptsFolderServerDataSource {
|
|
4
|
+
#host;
|
|
5
|
+
constructor(host) {
|
|
6
|
+
this.#host = host;
|
|
7
|
+
}
|
|
8
|
+
createScaffold(parentId) {
|
|
9
|
+
throw new Error('Method not implemented.');
|
|
10
|
+
}
|
|
11
|
+
get(unique) {
|
|
12
|
+
return tryExecuteAndNotify(this.#host, ScriptResource.getScriptFolder({ path: unique }));
|
|
13
|
+
}
|
|
14
|
+
insert(requestBody) {
|
|
15
|
+
return tryExecuteAndNotify(this.#host, ScriptResource.postScriptFolder({ requestBody }));
|
|
16
|
+
}
|
|
17
|
+
update(unique, data) {
|
|
18
|
+
throw new Error('Method not implemented.');
|
|
19
|
+
}
|
|
20
|
+
delete(path) {
|
|
21
|
+
return tryExecuteAndNotify(this.#host, ScriptResource.deleteScriptFolder({ path }));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ScriptsTreeDataSource } from './index.js';
|
|
2
|
+
import { ProblemDetails } from '../../../../../external/backend-api/index.js';
|
|
3
|
+
import { UmbControllerHostElement } from '../../../../../libs/controller-api/index.js';
|
|
4
|
+
export declare class UmbScriptsTreeServerDataSource implements ScriptsTreeDataSource {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(host: UmbControllerHostElement);
|
|
7
|
+
getRootItems(): Promise<import("../../../../../shared/repository/index.js").DataSourceResponse<import("../../../../../external/backend-api/index.js").PagedFileSystemTreeItemPresentationModel>>;
|
|
8
|
+
getChildrenOf({ path, skip, take, }: {
|
|
9
|
+
path?: string | undefined;
|
|
10
|
+
skip?: number | undefined;
|
|
11
|
+
take?: number | undefined;
|
|
12
|
+
}): Promise<ProblemDetails | import("../../../../../shared/repository/index.js").DataSourceResponse<import("../../../../../external/backend-api/index.js").PagedFileSystemTreeItemPresentationModel>>;
|
|
13
|
+
getItem(path: Array<string>): Promise<ProblemDetails | import("../../../../../shared/repository/index.js").DataSourceResponse<import("../../../../../external/backend-api/index.js").FileItemResponseModelBaseModel[]>>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ScriptResource } from '../../../../../external/backend-api/index.js';
|
|
2
|
+
import { tryExecuteAndNotify } from '../../../../../shared/resources/index.js';
|
|
3
|
+
export class UmbScriptsTreeServerDataSource {
|
|
4
|
+
#host;
|
|
5
|
+
constructor(host) {
|
|
6
|
+
this.#host = host;
|
|
7
|
+
}
|
|
8
|
+
async getRootItems() {
|
|
9
|
+
return tryExecuteAndNotify(this.#host, ScriptResource.getTreeScriptRoot({}));
|
|
10
|
+
}
|
|
11
|
+
async getChildrenOf({ path, skip, take, }) {
|
|
12
|
+
if (!path) {
|
|
13
|
+
const error = { title: 'Path is missing' };
|
|
14
|
+
return error;
|
|
15
|
+
}
|
|
16
|
+
return tryExecuteAndNotify(this.#host, ScriptResource.getTreeScriptChildren({
|
|
17
|
+
path,
|
|
18
|
+
skip,
|
|
19
|
+
take,
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
async getItem(path) {
|
|
23
|
+
if (!path) {
|
|
24
|
+
const error = { title: 'Paths are missing' };
|
|
25
|
+
return error;
|
|
26
|
+
}
|
|
27
|
+
return tryExecuteAndNotify(this.#host, ScriptResource.getScriptItem({
|
|
28
|
+
path,
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SCRIPTS_ENTITY_TYPE, SCRIPTS_REPOSITORY_ALIAS, SCRIPTS_ROOT_ENTITY_TYPE, SCRIPTS_TREE_ALIAS, SCRIPTS_TREE_ITEM_ALIAS, } from '../config.js';
|
|
2
|
+
const tree = {
|
|
3
|
+
type: 'tree',
|
|
4
|
+
alias: SCRIPTS_TREE_ALIAS,
|
|
5
|
+
name: 'Scripts Tree',
|
|
6
|
+
weight: 30,
|
|
7
|
+
meta: {
|
|
8
|
+
repositoryAlias: SCRIPTS_REPOSITORY_ALIAS,
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
const treeItem = {
|
|
12
|
+
type: 'treeItem',
|
|
13
|
+
kind: 'fileSystem',
|
|
14
|
+
alias: SCRIPTS_TREE_ITEM_ALIAS,
|
|
15
|
+
name: 'Scripts Tree Item',
|
|
16
|
+
meta: {
|
|
17
|
+
entityTypes: [SCRIPTS_ROOT_ENTITY_TYPE, SCRIPTS_ENTITY_TYPE],
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export const manifests = [tree, treeItem];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SCRIPTS_ENTITY_TYPE, SCRIPTS_WORKSPACE_ALIAS } from '../config.js';
|
|
2
|
+
import { UmbSaveWorkspaceAction } from '../../../core/workspace/index.js';
|
|
3
|
+
const workspace = {
|
|
4
|
+
type: 'workspace',
|
|
5
|
+
alias: SCRIPTS_WORKSPACE_ALIAS,
|
|
6
|
+
name: 'Scripts Workspace',
|
|
7
|
+
loader: () => import('./scripts-workspace.element.js'),
|
|
8
|
+
meta: {
|
|
9
|
+
entityType: SCRIPTS_ENTITY_TYPE,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
//TODO: this does not work for some reason
|
|
13
|
+
const workspaceActions = [
|
|
14
|
+
{
|
|
15
|
+
type: 'workspaceAction',
|
|
16
|
+
alias: 'Umb.WorkspaceAction.Scripts.Save',
|
|
17
|
+
name: 'Save Script Workspace Action',
|
|
18
|
+
meta: {
|
|
19
|
+
label: 'Save',
|
|
20
|
+
look: 'primary',
|
|
21
|
+
color: 'positive',
|
|
22
|
+
api: UmbSaveWorkspaceAction,
|
|
23
|
+
},
|
|
24
|
+
conditions: [
|
|
25
|
+
{
|
|
26
|
+
alias: 'Umb.Condition.WorkspaceAlias',
|
|
27
|
+
match: workspace.alias,
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
];
|
|
32
|
+
export const manifests = [workspace, ...workspaceActions];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PropertyValueMap } from '../../../../external/lit/index.js';
|
|
2
|
+
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
3
|
+
export declare class UmbScriptsWorkspaceEditElement extends UmbLitElement {
|
|
4
|
+
#private;
|
|
5
|
+
private get _name();
|
|
6
|
+
private set _name(value);
|
|
7
|
+
private _content?;
|
|
8
|
+
private _path?;
|
|
9
|
+
private _dirName?;
|
|
10
|
+
private _ready?;
|
|
11
|
+
private _codeEditor?;
|
|
12
|
+
private _modalContext?;
|
|
13
|
+
private inputQuery$;
|
|
14
|
+
constructor();
|
|
15
|
+
protected willUpdate(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
16
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
17
|
+
static styles: import("@lit/reactive-element/css-tag.js").CSSResult[];
|
|
18
|
+
}
|
|
19
|
+
export default UmbScriptsWorkspaceEditElement;
|
|
20
|
+
declare global {
|
|
21
|
+
interface HTMLElementTagNameMap {
|
|
22
|
+
'umb-scripts-workspace-edit': UmbScriptsWorkspaceEditElement;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
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
|
+
import { UUITextStyles } from '../../../../external/uui/index.js';
|
|
8
|
+
import { css, html, customElement, query, state } from '../../../../external/lit/index.js';
|
|
9
|
+
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
10
|
+
import { UMB_MODAL_MANAGER_CONTEXT_TOKEN } from '../../../core/modal/index.js';
|
|
11
|
+
import { Subject, debounceTime } from '../../../../external/rxjs/index.js';
|
|
12
|
+
import { UMB_WORKSPACE_CONTEXT } from '../../../core/workspace/index.js';
|
|
13
|
+
export let UmbScriptsWorkspaceEditElement = class UmbScriptsWorkspaceEditElement extends UmbLitElement {
|
|
14
|
+
#name;
|
|
15
|
+
get _name() {
|
|
16
|
+
return this.#name;
|
|
17
|
+
}
|
|
18
|
+
set _name(value) {
|
|
19
|
+
this.#name = value?.replace('.js', '');
|
|
20
|
+
this.requestUpdate();
|
|
21
|
+
}
|
|
22
|
+
#scriptsWorkspaceContext;
|
|
23
|
+
#isNew;
|
|
24
|
+
constructor() {
|
|
25
|
+
super();
|
|
26
|
+
this.#name = '';
|
|
27
|
+
this._content = '';
|
|
28
|
+
this._path = '';
|
|
29
|
+
this._dirName = '';
|
|
30
|
+
this._ready = false;
|
|
31
|
+
this.#isNew = false;
|
|
32
|
+
this.inputQuery$ = new Subject();
|
|
33
|
+
this.consumeContext(UMB_MODAL_MANAGER_CONTEXT_TOKEN, (instance) => {
|
|
34
|
+
this._modalContext = instance;
|
|
35
|
+
});
|
|
36
|
+
this.consumeContext(UMB_WORKSPACE_CONTEXT, (workspaceContext) => {
|
|
37
|
+
this.#scriptsWorkspaceContext = workspaceContext;
|
|
38
|
+
this.observe(this.#scriptsWorkspaceContext.name, (name) => {
|
|
39
|
+
this._name = name;
|
|
40
|
+
});
|
|
41
|
+
this.observe(this.#scriptsWorkspaceContext.content, (content) => {
|
|
42
|
+
this._content = content;
|
|
43
|
+
});
|
|
44
|
+
this.observe(this.#scriptsWorkspaceContext.path, (path) => {
|
|
45
|
+
this._path = path;
|
|
46
|
+
});
|
|
47
|
+
this.observe(this.#scriptsWorkspaceContext.isNew, (isNew) => {
|
|
48
|
+
this.#isNew = !!isNew;
|
|
49
|
+
});
|
|
50
|
+
this.observe(this.#scriptsWorkspaceContext.isCodeEditorReady, (isReady) => {
|
|
51
|
+
this._ready = isReady;
|
|
52
|
+
});
|
|
53
|
+
this.inputQuery$.pipe(debounceTime(250)).subscribe((nameInputValue) => {
|
|
54
|
+
this.#scriptsWorkspaceContext?.setName(`${nameInputValue}.js`);
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
willUpdate(_changedProperties) {
|
|
59
|
+
if (_changedProperties.has('_path')) {
|
|
60
|
+
this._dirName = this._path?.substring(0, this._path?.lastIndexOf('/'));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
#onNameInput(event) {
|
|
64
|
+
const target = event.target;
|
|
65
|
+
const value = target.value;
|
|
66
|
+
this.inputQuery$.next(value);
|
|
67
|
+
}
|
|
68
|
+
#onCodeEditorInput(event) {
|
|
69
|
+
const target = event.target;
|
|
70
|
+
const value = target.code;
|
|
71
|
+
this.#scriptsWorkspaceContext?.setContent(value);
|
|
72
|
+
}
|
|
73
|
+
#renderCodeEditor() {
|
|
74
|
+
return html `<umb-code-editor
|
|
75
|
+
language="javascript"
|
|
76
|
+
id="content"
|
|
77
|
+
.code=${this._content ?? ''}
|
|
78
|
+
@input=${this.#onCodeEditorInput}></umb-code-editor>`;
|
|
79
|
+
}
|
|
80
|
+
render() {
|
|
81
|
+
return html `<umb-workspace-editor alias="Umb.Workspace.Scripts">
|
|
82
|
+
<div id="workspace-header" slot="header">
|
|
83
|
+
<uui-input
|
|
84
|
+
placeholder="Enter name..."
|
|
85
|
+
.value=${this._name}
|
|
86
|
+
@input=${this.#onNameInput}
|
|
87
|
+
label="template name"></uui-input>
|
|
88
|
+
<small>Scripts/${this._dirName}${this._name}.js</small>
|
|
89
|
+
</div>
|
|
90
|
+
<uui-box>
|
|
91
|
+
<!-- the div below in the header is to make the box display nicely with code editor -->
|
|
92
|
+
<div slot="header"></div>
|
|
93
|
+
${this._ready
|
|
94
|
+
? this.#renderCodeEditor()
|
|
95
|
+
: html `<div id="loader-container">
|
|
96
|
+
<uui-loader></uui-loader>
|
|
97
|
+
</div>`}
|
|
98
|
+
</uui-box>
|
|
99
|
+
<div slot="footer-info">
|
|
100
|
+
<!-- TODO: Shortcuts Modal? -->
|
|
101
|
+
<uui-button label="Show keyboard shortcuts">
|
|
102
|
+
Keyboard Shortcuts
|
|
103
|
+
<uui-keyboard-shortcut>
|
|
104
|
+
<uui-key>ALT</uui-key>
|
|
105
|
+
+
|
|
106
|
+
<uui-key>shift</uui-key>
|
|
107
|
+
+
|
|
108
|
+
<uui-key>k</uui-key>
|
|
109
|
+
</uui-keyboard-shortcut>
|
|
110
|
+
</uui-button>
|
|
111
|
+
</div>
|
|
112
|
+
</umb-workspace-editor>`;
|
|
113
|
+
}
|
|
114
|
+
static { this.styles = [
|
|
115
|
+
UUITextStyles,
|
|
116
|
+
css `
|
|
117
|
+
:host {
|
|
118
|
+
display: block;
|
|
119
|
+
width: 100%;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
#loader-container {
|
|
123
|
+
display: grid;
|
|
124
|
+
place-items: center;
|
|
125
|
+
min-height: calc(100dvh - 260px);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
umb-code-editor {
|
|
129
|
+
--editor-height: calc(100dvh - 260px);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
uui-box {
|
|
133
|
+
min-height: calc(100dvh - 260px);
|
|
134
|
+
margin: var(--uui-size-layout-1);
|
|
135
|
+
--uui-box-default-padding: 0;
|
|
136
|
+
/* remove header border bottom as code editor looks better in this box */
|
|
137
|
+
--uui-color-divider-standalone: transparent;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
#workspace-header {
|
|
141
|
+
width: 100%;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
uui-input {
|
|
145
|
+
width: 100%;
|
|
146
|
+
}
|
|
147
|
+
`,
|
|
148
|
+
]; }
|
|
149
|
+
};
|
|
150
|
+
__decorate([
|
|
151
|
+
state()
|
|
152
|
+
], UmbScriptsWorkspaceEditElement.prototype, "_name", null);
|
|
153
|
+
__decorate([
|
|
154
|
+
state()
|
|
155
|
+
], UmbScriptsWorkspaceEditElement.prototype, "_content", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
state()
|
|
158
|
+
], UmbScriptsWorkspaceEditElement.prototype, "_path", void 0);
|
|
159
|
+
__decorate([
|
|
160
|
+
state()
|
|
161
|
+
], UmbScriptsWorkspaceEditElement.prototype, "_dirName", void 0);
|
|
162
|
+
__decorate([
|
|
163
|
+
state()
|
|
164
|
+
], UmbScriptsWorkspaceEditElement.prototype, "_ready", void 0);
|
|
165
|
+
__decorate([
|
|
166
|
+
query('umb-code-editor')
|
|
167
|
+
], UmbScriptsWorkspaceEditElement.prototype, "_codeEditor", void 0);
|
|
168
|
+
UmbScriptsWorkspaceEditElement = __decorate([
|
|
169
|
+
customElement('umb-scripts-workspace-edit')
|
|
170
|
+
], UmbScriptsWorkspaceEditElement);
|
|
171
|
+
export default UmbScriptsWorkspaceEditElement;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ScriptDetails } from '../config.js';
|
|
2
|
+
import { UmbScriptsRepository } from '../repository/scripts.repository.js';
|
|
3
|
+
import { UmbControllerHostElement } from '../../../../libs/controller-api/index.js';
|
|
4
|
+
import { UmbWorkspaceContext } from '../../../core/workspace/index.js';
|
|
5
|
+
import { TextFileResponseModelBaseModel } from '../../../../external/backend-api/index.js';
|
|
6
|
+
export declare class UmbScriptsWorkspaceContext extends UmbWorkspaceContext<UmbScriptsRepository, ScriptDetails> {
|
|
7
|
+
#private;
|
|
8
|
+
data: import("rxjs").Observable<TextFileResponseModelBaseModel | undefined>;
|
|
9
|
+
name: import("rxjs").Observable<string | undefined>;
|
|
10
|
+
content: import("rxjs").Observable<string | undefined>;
|
|
11
|
+
path: import("rxjs").Observable<string | undefined>;
|
|
12
|
+
isCodeEditorReady: import("rxjs").Observable<boolean>;
|
|
13
|
+
constructor(host: UmbControllerHostElement);
|
|
14
|
+
getData(): TextFileResponseModelBaseModel | undefined;
|
|
15
|
+
setName(value: string): void;
|
|
16
|
+
setContent(value: string): void;
|
|
17
|
+
load(entityKey: string): Promise<void>;
|
|
18
|
+
create(parentKey: string): Promise<void>;
|
|
19
|
+
getEntityId(): string | undefined;
|
|
20
|
+
save(): Promise<void>;
|
|
21
|
+
destroy(): void;
|
|
22
|
+
getEntityType(): string;
|
|
23
|
+
}
|