@umbraco-cms/backoffice 14.0.0-d542ed7d → 14.0.0-e72b5840
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 +15 -14
- package/dist-cms/external/backend-api/index.js +1 -1
- package/dist-cms/external/monaco-editor/{abap-42d5eca7.js → abap-7ad4f8f0.js} +1 -1
- package/dist-cms/external/monaco-editor/{apex-051da044.js → apex-30597c49.js} +1 -1
- package/dist-cms/external/monaco-editor/{bundle.css → assets/bundle-a4f90d1d.css} +593 -279
- package/dist-cms/external/monaco-editor/{azcli-ad3d7346.js → azcli-67c34a04.js} +1 -1
- package/dist-cms/external/monaco-editor/{bat-0217c0bc.js → bat-b8f4738b.js} +1 -1
- package/dist-cms/external/monaco-editor/{bicep-0cadb30a.js → bicep-b104b38b.js} +1 -1
- package/dist-cms/external/monaco-editor/{cameligo-ac55f854.js → cameligo-001d1ded.js} +1 -1
- package/dist-cms/external/monaco-editor/{clojure-388a0d58.js → clojure-fa9652a1.js} +1 -1
- package/dist-cms/external/monaco-editor/{coffee-7e7a2971.js → coffee-b69a8315.js} +1 -1
- package/dist-cms/external/monaco-editor/{cpp-840d082a.js → cpp-8053752f.js} +1 -1
- package/dist-cms/external/monaco-editor/{csharp-b3429875.js → csharp-886041a3.js} +1 -1
- package/dist-cms/external/monaco-editor/{csp-83442b86.js → csp-e846bce6.js} +1 -1
- package/dist-cms/external/monaco-editor/{css-7a34b8c3.js → css-50032e5e.js} +1 -1
- package/dist-cms/external/monaco-editor/{cssMode-98237bd7.js → cssMode-c0406684.js} +3 -3
- package/dist-cms/external/monaco-editor/{cypher-cc9c23cc.js → cypher-6f93a845.js} +1 -1
- package/dist-cms/external/monaco-editor/{dart-00a58d1c.js → dart-14284236.js} +1 -1
- package/dist-cms/external/monaco-editor/{dockerfile-668ee825.js → dockerfile-e9935eb4.js} +1 -1
- package/dist-cms/external/monaco-editor/{ecl-b42ffd48.js → ecl-9c89f204.js} +1 -1
- package/dist-cms/external/monaco-editor/{elixir-b9ceca92.js → elixir-ca8bf661.js} +1 -1
- package/dist-cms/external/monaco-editor/{flow9-7e9b2e50.js → flow9-ac147227.js} +1 -1
- package/dist-cms/external/monaco-editor/{freemarker2-b9eee947.js → freemarker2-793b7402.js} +2 -2
- package/dist-cms/external/monaco-editor/{fsharp-cdc5b8f1.js → fsharp-8eaad024.js} +1 -1
- package/dist-cms/external/monaco-editor/{go-4c92fa5c.js → go-05529e2e.js} +1 -1
- package/dist-cms/external/monaco-editor/{graphql-67842079.js → graphql-8f5b3fdd.js} +1 -1
- package/dist-cms/external/monaco-editor/{handlebars-36a3f04f.js → handlebars-aaa2fd96.js} +2 -2
- package/dist-cms/external/monaco-editor/{hcl-59febf1c.js → hcl-9e201a51.js} +1 -1
- package/dist-cms/external/monaco-editor/{html-b0d38e59.js → html-1194c0aa.js} +2 -2
- package/dist-cms/external/monaco-editor/{htmlMode-b85c3f7d.js → htmlMode-36df69c6.js} +3 -3
- package/dist-cms/external/monaco-editor/{index-534fb84c.js → index-7368f3e3.js} +418 -409
- package/dist-cms/external/monaco-editor/index.js +1 -1
- package/dist-cms/external/monaco-editor/{ini-1cf2ce67.js → ini-31a5619d.js} +1 -1
- package/dist-cms/external/monaco-editor/{java-e4fb14c6.js → java-8c6e1ae8.js} +1 -1
- package/dist-cms/external/monaco-editor/javascript-86205709.js +6 -0
- package/dist-cms/external/monaco-editor/{jsonMode-fa2b41c8.js → jsonMode-f663e935.js} +6 -6
- package/dist-cms/external/monaco-editor/{julia-9b6c6458.js → julia-fbb2af47.js} +1 -1
- package/dist-cms/external/monaco-editor/{kotlin-b66c14ff.js → kotlin-bfa96180.js} +1 -1
- package/dist-cms/external/monaco-editor/{less-8dc8685d.js → less-0b6a8ff1.js} +1 -1
- package/dist-cms/external/monaco-editor/{lexon-59c0b911.js → lexon-585e5248.js} +1 -1
- package/dist-cms/external/monaco-editor/{liquid-be38812f.js → liquid-37adc07a.js} +2 -2
- package/dist-cms/external/monaco-editor/{lua-3f4d9098.js → lua-f6c17885.js} +1 -1
- package/dist-cms/external/monaco-editor/{m3-82a8c502.js → m3-1b6456c5.js} +1 -1
- package/dist-cms/external/monaco-editor/{markdown-07c3fa1e.js → markdown-7bc251f9.js} +1 -1
- package/dist-cms/external/monaco-editor/{mips-59ddf2f4.js → mips-2df76781.js} +1 -1
- package/dist-cms/external/monaco-editor/{msdax-12ec689c.js → msdax-8c38e8b4.js} +1 -1
- package/dist-cms/external/monaco-editor/{mysql-2958efa4.js → mysql-abbb9ca3.js} +1 -1
- package/dist-cms/external/monaco-editor/{objective-c-08d94025.js → objective-c-efbfd08b.js} +1 -1
- package/dist-cms/external/monaco-editor/{pascal-b686b438.js → pascal-08abee72.js} +1 -1
- package/dist-cms/external/monaco-editor/{pascaligo-96457e5f.js → pascaligo-200db0cf.js} +1 -1
- package/dist-cms/external/monaco-editor/{perl-b938bdad.js → perl-079789ee.js} +1 -1
- package/dist-cms/external/monaco-editor/{pgsql-42970e97.js → pgsql-efd093d4.js} +1 -1
- package/dist-cms/external/monaco-editor/{php-7476401f.js → php-75c530f2.js} +1 -1
- package/dist-cms/external/monaco-editor/{pla-aaf0caa2.js → pla-a55a2765.js} +1 -1
- package/dist-cms/external/monaco-editor/{postiats-759ff404.js → postiats-6098f37b.js} +1 -1
- package/dist-cms/external/monaco-editor/{powerquery-a33a8de4.js → powerquery-949bb7fe.js} +1 -1
- package/dist-cms/external/monaco-editor/{powershell-ec154f36.js → powershell-7e550b21.js} +1 -1
- package/dist-cms/external/monaco-editor/{protobuf-e42d83dc.js → protobuf-25a4d695.js} +1 -1
- package/dist-cms/external/monaco-editor/{pug-04b2d67c.js → pug-f8c9f493.js} +1 -1
- package/dist-cms/external/monaco-editor/{python-b3b058ea.js → python-78a47148.js} +2 -2
- package/dist-cms/external/monaco-editor/{qsharp-5376e9d1.js → qsharp-c4b94317.js} +1 -1
- package/dist-cms/external/monaco-editor/{r-d212ba98.js → r-614353db.js} +1 -1
- package/dist-cms/external/monaco-editor/{razor-911a705a.js → razor-5de9ce12.js} +2 -2
- package/dist-cms/external/monaco-editor/{redis-51e44009.js → redis-fb089f4d.js} +1 -1
- package/dist-cms/external/monaco-editor/{redshift-8de2cfdc.js → redshift-a620fcb0.js} +1 -1
- package/dist-cms/external/monaco-editor/{restructuredtext-3f99254a.js → restructuredtext-7ab09fcf.js} +1 -1
- package/dist-cms/external/monaco-editor/{ruby-64a73e64.js → ruby-922be722.js} +1 -1
- package/dist-cms/external/monaco-editor/{rust-2a0390f1.js → rust-23e08578.js} +1 -1
- package/dist-cms/external/monaco-editor/{sb-4d8fa557.js → sb-ccceec0f.js} +1 -1
- package/dist-cms/external/monaco-editor/{scala-00d62260.js → scala-0535664d.js} +1 -1
- package/dist-cms/external/monaco-editor/{scheme-a0903f29.js → scheme-dba621eb.js} +1 -1
- package/dist-cms/external/monaco-editor/{scss-3e25f7ad.js → scss-28539a11.js} +1 -1
- package/dist-cms/external/monaco-editor/{shell-9c442847.js → shell-5b92a834.js} +1 -1
- package/dist-cms/external/monaco-editor/{solidity-6b3049ed.js → solidity-f63d6049.js} +1 -1
- package/dist-cms/external/monaco-editor/{sophia-f4a2b303.js → sophia-12e9ad90.js} +1 -1
- package/dist-cms/external/monaco-editor/{sparql-1d37a384.js → sparql-dedb74aa.js} +1 -1
- package/dist-cms/external/monaco-editor/{sql-946641be.js → sql-975a69d7.js} +1 -1
- package/dist-cms/external/monaco-editor/{st-9220dec1.js → st-1904ae33.js} +1 -1
- package/dist-cms/external/monaco-editor/{swift-06592b81.js → swift-e180a143.js} +1 -1
- package/dist-cms/external/monaco-editor/{systemverilog-b5ba493c.js → systemverilog-c5592fac.js} +1 -1
- package/dist-cms/external/monaco-editor/{tcl-3fe51e69.js → tcl-996f4ac7.js} +1 -1
- package/dist-cms/external/monaco-editor/tsMode-f4618e87.js +16 -0
- package/dist-cms/external/monaco-editor/{twig-ee0f3b03.js → twig-4859b551.js} +1 -1
- package/dist-cms/external/monaco-editor/{typescript-4d577e09.js → typescript-efea739f.js} +3 -3
- package/dist-cms/external/monaco-editor/{vb-e7e59935.js → vb-ad68fa9a.js} +1 -1
- package/dist-cms/external/monaco-editor/wgsl-5ee7b1ca.js +303 -0
- package/dist-cms/external/monaco-editor/{xml-b05159d9.js → xml-12b9ace3.js} +2 -2
- package/dist-cms/external/monaco-editor/{yaml-b4ec85f0.js → yaml-65e08cff.js} +3 -3
- package/dist-cms/external/rxjs/index.js +2 -2
- package/dist-cms/external/tinymce/index.js +16 -16
- package/dist-cms/mocks/data/partial-views.data.d.ts +19 -3
- package/dist-cms/mocks/data/partial-views.data.js +277 -10
- package/dist-cms/mocks/data/utils.d.ts +2 -1
- package/dist-cms/mocks/data/utils.js +5 -0
- package/dist-cms/mocks/handlers/partial-views.handlers.d.ts +2 -1
- package/dist-cms/mocks/handlers/partial-views.handlers.js +37 -5
- package/dist-cms/packages/core/components/input-tiny-mce/input-tiny-mce.handlers.js +1 -1
- package/dist-cms/packages/core/entity-action/common/create-folder/create-folder.action.d.ts +8 -0
- package/dist-cms/packages/core/entity-action/common/create-folder/create-folder.action.js +21 -0
- package/dist-cms/packages/core/entity-action/common/index.d.ts +1 -0
- package/dist-cms/packages/core/entity-action/common/index.js +1 -0
- package/dist-cms/packages/core/modal/common/folder/folder-modal.element.js +4 -1
- package/dist-cms/packages/core/modal/token/embedded-media-modal.token.js +0 -1
- package/dist-cms/packages/core/modal/token/folder-modal.token.d.ts +1 -0
- package/dist-cms/packages/{templating/components → core/tree}/file-system-tree-item/file-system-tree-item.context.d.ts +9 -1
- package/dist-cms/packages/core/tree/file-system-tree-item/file-system-tree-item.context.js +28 -0
- package/dist-cms/packages/{templating/components → core/tree}/file-system-tree-item/file-system-tree-item.element.d.ts +10 -2
- package/dist-cms/packages/{templating/components → core/tree}/file-system-tree-item/file-system-tree-item.element.js +10 -1
- package/dist-cms/packages/core/tree/file-system-tree-item/index.d.ts +2 -0
- package/dist-cms/packages/core/tree/file-system-tree-item/index.js +2 -0
- package/dist-cms/packages/core/tree/index.d.ts +1 -0
- package/dist-cms/packages/core/tree/index.js +1 -0
- package/dist-cms/packages/core/workspace/workspace-action/workspace-action.element.js +12 -4
- package/dist-cms/packages/templating/components/index.d.ts +0 -1
- package/dist-cms/packages/templating/components/index.js +0 -1
- package/dist-cms/packages/templating/manifests.d.ts +6 -1
- package/dist-cms/packages/templating/partial-views/config.d.ts +5 -5
- package/dist-cms/packages/templating/partial-views/config.js +3 -1
- package/dist-cms/packages/templating/partial-views/entity-actions/create/create-empty.action.js +1 -1
- package/dist-cms/packages/templating/partial-views/entity-actions/create/create-from-snippet.action.d.ts +10 -1
- package/dist-cms/packages/templating/partial-views/entity-actions/create/create-from-snippet.action.js +16 -1
- package/dist-cms/packages/templating/partial-views/entity-actions/create/create-from-snippet.modal.d.ts +16 -0
- package/dist-cms/packages/templating/partial-views/entity-actions/create/create-from-snippet.modal.js +73 -0
- package/dist-cms/packages/templating/partial-views/entity-actions/manifests.d.ts +6 -1
- package/dist-cms/packages/templating/partial-views/entity-actions/manifests.js +43 -5
- package/dist-cms/packages/templating/partial-views/manifests.d.ts +6 -1
- package/dist-cms/packages/templating/partial-views/repository/manifests.js +2 -2
- package/dist-cms/packages/templating/partial-views/repository/partial-views.repository.d.ts +47 -26
- package/dist-cms/packages/templating/partial-views/repository/partial-views.repository.js +81 -24
- package/dist-cms/packages/templating/partial-views/repository/sources/partial-views.detail.server.data.d.ts +48 -13
- package/dist-cms/packages/templating/partial-views/repository/sources/partial-views.detail.server.data.js +56 -17
- package/dist-cms/packages/templating/partial-views/repository/sources/partial-views.folder.server.data.d.ts +17 -0
- package/dist-cms/packages/templating/partial-views/repository/sources/partial-views.folder.server.data.js +23 -0
- package/dist-cms/packages/templating/partial-views/tree/manifests.js +3 -2
- package/dist-cms/packages/templating/partial-views/workspace/partial-views-workspace-edit.element.d.ts +6 -1
- package/dist-cms/packages/templating/partial-views/workspace/partial-views-workspace-edit.element.js +123 -27
- package/dist-cms/packages/templating/partial-views/workspace/partial-views-workspace.context.d.ts +9 -7
- package/dist-cms/packages/templating/partial-views/workspace/partial-views-workspace.context.js +49 -8
- package/dist-cms/packages/templating/partial-views/workspace/partial-views-workspace.element.d.ts +1 -0
- package/dist-cms/packages/templating/partial-views/workspace/partial-views-workspace.element.js +7 -3
- package/dist-cms/packages/templating/templates/modals/query-builder/query-builder-filter.element.js +2 -2
- package/dist-cms/packages/templating/templates/modals/query-builder/query-builder.element.d.ts +1 -0
- package/dist-cms/packages/templating/templates/modals/query-builder/query-builder.element.js +1 -0
- package/dist-cms/shared/repository/data-source/data-source.interface.d.ts +2 -2
- package/dist-cms/shared/repository/detail-repository.interface.d.ts +2 -2
- package/dist-cms/shared/utils/media-helper.service.d.ts +1 -1
- package/dist-cms/shared/utils/media-helper.service.js +1 -1
- package/dist-cms/tinymce/CHANGELOG.md +22 -0
- package/dist-cms/tinymce/composer.json +1 -1
- package/dist-cms/tinymce/icons/default/icons.js +3 -0
- package/dist-cms/tinymce/icons/default/icons.min.js +1 -1
- package/dist-cms/tinymce/langs/ar.js +1 -1
- package/dist-cms/tinymce/langs/bg_BG.js +56 -56
- package/dist-cms/tinymce/langs/fr_FR.js +1 -1
- package/dist-cms/tinymce/langs/ka_GE.js +406 -0
- package/dist-cms/tinymce/langs/nb_NO.js +15 -15
- package/dist-cms/tinymce/models/dom/model.js +1 -1
- package/dist-cms/tinymce/models/dom/model.min.js +1 -1
- package/dist-cms/tinymce/package.json +1 -1
- package/dist-cms/tinymce/plugins/accordion/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/accordion/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/advlist/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/advlist/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/anchor/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/anchor/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/autolink/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/autolink/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/autoresize/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/autoresize/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/autosave/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/autosave/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/charmap/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/charmap/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/code/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/code/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/codesample/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/codesample/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/directionality/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/directionality/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/emoticons/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/emoticons/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/fullscreen/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/fullscreen/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/help/plugin.js +6 -1
- package/dist-cms/tinymce/plugins/help/plugin.min.js +2 -2
- package/dist-cms/tinymce/plugins/image/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/image/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/importcss/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/importcss/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/insertdatetime/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/insertdatetime/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/link/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/link/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/lists/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/lists/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/media/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/media/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/nonbreaking/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/nonbreaking/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/pagebreak/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/pagebreak/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/preview/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/preview/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/quickbars/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/quickbars/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/save/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/save/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/searchreplace/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/searchreplace/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/table/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/table/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/template/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/template/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/visualblocks/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/visualblocks/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/visualchars/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/visualchars/plugin.min.js +1 -1
- package/dist-cms/tinymce/plugins/wordcount/plugin.js +1 -1
- package/dist-cms/tinymce/plugins/wordcount/plugin.min.js +1 -1
- package/dist-cms/tinymce/skins/ui/oxide/skin.css +18 -0
- package/dist-cms/tinymce/skins/ui/oxide/skin.min.css +1 -1
- package/dist-cms/tinymce/skins/ui/oxide-dark/skin.css +18 -0
- package/dist-cms/tinymce/skins/ui/oxide-dark/skin.min.css +1 -1
- package/dist-cms/tinymce/skins/ui/tinymce-5/skin.css +18 -0
- package/dist-cms/tinymce/skins/ui/tinymce-5/skin.min.css +1 -1
- package/dist-cms/tinymce/skins/ui/tinymce-5-dark/skin.css +18 -0
- package/dist-cms/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -1
- package/dist-cms/tinymce/themes/silver/theme.js +279 -85
- package/dist-cms/tinymce/themes/silver/theme.min.js +2 -2
- package/dist-cms/tinymce/tinymce.d.ts +7 -2
- package/dist-cms/tinymce/tinymce.js +3 -3
- package/dist-cms/tinymce/tinymce.min.js +2 -2
- package/dist-cms/tsconfig.tsbuildinfo +1 -1
- package/dist-cms/umbraco-package-schema.json +40 -120
- package/dist-cms/vscode-html-custom-data.json +6 -6
- package/package.json +24 -25
- package/dist-cms/external/monaco-editor/javascript-53ce59fc.js +0 -6
- package/dist-cms/external/monaco-editor/tsMode-3f4e7f54.js +0 -16
- package/dist-cms/packages/templating/components/file-system-tree-item/file-system-tree-item.context.js +0 -10
|
@@ -1,37 +1,75 @@
|
|
|
1
|
+
import { PARTIAL_VIEW_ROOT_ENTITY_TYPE } from '../config.js';
|
|
1
2
|
import { UmbPartialViewDetailServerDataSource } from './sources/partial-views.detail.server.data.js';
|
|
2
3
|
import { UmbPartialViewsTreeServerDataSource } from './sources/partial-views.tree.server.data.js';
|
|
3
4
|
import { UMB_PARTIAL_VIEW_TREE_STORE_CONTEXT_TOKEN } from './partial-views.tree.store.js';
|
|
5
|
+
import { UmbPartialViewsFolderServerDataSource, } from './sources/partial-views.folder.server.data.js';
|
|
4
6
|
import { UmbContextConsumerController } from '../../../../libs/context-api/index.js';
|
|
5
|
-
export class
|
|
7
|
+
export class UmbPartialViewsRepository {
|
|
6
8
|
#init;
|
|
7
9
|
#host;
|
|
8
10
|
#treeDataSource;
|
|
9
11
|
#detailDataSource;
|
|
12
|
+
#folderDataSource;
|
|
10
13
|
#treeStore;
|
|
11
14
|
constructor(host) {
|
|
12
15
|
this.#host = host;
|
|
13
16
|
this.#treeDataSource = new UmbPartialViewsTreeServerDataSource(this.#host);
|
|
14
17
|
this.#detailDataSource = new UmbPartialViewDetailServerDataSource(this.#host);
|
|
18
|
+
this.#folderDataSource = new UmbPartialViewsFolderServerDataSource(this.#host);
|
|
15
19
|
this.#init = Promise.all([
|
|
16
20
|
new UmbContextConsumerController(this.#host, UMB_PARTIAL_VIEW_TREE_STORE_CONTEXT_TOKEN, (instance) => {
|
|
17
21
|
this.#treeStore = instance;
|
|
18
22
|
}),
|
|
19
23
|
]);
|
|
20
24
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
//#region FOLDER
|
|
26
|
+
createFolderScaffold(parentId) {
|
|
27
|
+
const data = {
|
|
28
|
+
name: '',
|
|
29
|
+
parentId,
|
|
30
|
+
};
|
|
31
|
+
return Promise.resolve({ data, error: undefined });
|
|
24
32
|
}
|
|
25
|
-
|
|
26
|
-
|
|
33
|
+
async createFolder(requestBody) {
|
|
34
|
+
await this.#init;
|
|
35
|
+
const req = {
|
|
36
|
+
parentPath: requestBody.parentId,
|
|
37
|
+
name: requestBody.name,
|
|
38
|
+
};
|
|
39
|
+
const promise = this.#folderDataSource.insert(req);
|
|
40
|
+
await promise;
|
|
41
|
+
this.requestTreeItemsOf(requestBody.parentId ? requestBody.parentId : null);
|
|
42
|
+
return promise;
|
|
27
43
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
44
|
+
async requestFolder(unique) {
|
|
45
|
+
await this.#init;
|
|
46
|
+
return this.#folderDataSource.get(unique);
|
|
47
|
+
}
|
|
48
|
+
updateFolder(unique, folder) {
|
|
32
49
|
throw new Error('Method not implemented.');
|
|
33
50
|
}
|
|
34
|
-
|
|
51
|
+
async deleteFolder(path) {
|
|
52
|
+
await this.#init;
|
|
53
|
+
const { data } = await this.requestFolder(path);
|
|
54
|
+
const promise = this.#folderDataSource.delete(path);
|
|
55
|
+
await promise;
|
|
56
|
+
this.requestTreeItemsOf(data?.parentPath ? data?.parentPath : null);
|
|
57
|
+
return promise;
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region TREE
|
|
61
|
+
async requestTreeRoot() {
|
|
62
|
+
await this.#init;
|
|
63
|
+
const data = {
|
|
64
|
+
id: null,
|
|
65
|
+
path: null,
|
|
66
|
+
type: PARTIAL_VIEW_ROOT_ENTITY_TYPE,
|
|
67
|
+
name: 'Partial Views',
|
|
68
|
+
icon: 'umb:folder',
|
|
69
|
+
hasChildren: true,
|
|
70
|
+
};
|
|
71
|
+
return { data };
|
|
72
|
+
}
|
|
35
73
|
async requestRootTreeItems() {
|
|
36
74
|
await this.#init;
|
|
37
75
|
const { data, error } = await this.#treeDataSource.getRootItems();
|
|
@@ -41,10 +79,11 @@ export class UmbTemplateRepository {
|
|
|
41
79
|
return { data, error, asObservable: () => this.#treeStore.rootItems };
|
|
42
80
|
}
|
|
43
81
|
async requestTreeItemsOf(path) {
|
|
44
|
-
if (
|
|
45
|
-
|
|
82
|
+
if (path === null) {
|
|
83
|
+
return this.requestRootTreeItems();
|
|
84
|
+
}
|
|
46
85
|
await this.#init;
|
|
47
|
-
const { data, error } = await this.#treeDataSource.getChildrenOf({ path });
|
|
86
|
+
const { data, error } = await this.#treeDataSource.getChildrenOf({ path, skip: 0, take: 100 });
|
|
48
87
|
if (data) {
|
|
49
88
|
this.#treeStore.appendItems(data.items);
|
|
50
89
|
}
|
|
@@ -75,7 +114,8 @@ export class UmbTemplateRepository {
|
|
|
75
114
|
await this.#init;
|
|
76
115
|
return this.#treeStore.items(paths);
|
|
77
116
|
}
|
|
78
|
-
|
|
117
|
+
//#endregion
|
|
118
|
+
//#region DETAILS
|
|
79
119
|
async requestByKey(path) {
|
|
80
120
|
if (!path)
|
|
81
121
|
throw new Error('Path is missing');
|
|
@@ -83,17 +123,34 @@ export class UmbTemplateRepository {
|
|
|
83
123
|
const { data, error } = await this.#detailDataSource.get(path);
|
|
84
124
|
return { data, error };
|
|
85
125
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
126
|
+
requestById(id) {
|
|
127
|
+
throw new Error('Method not implemented.');
|
|
128
|
+
}
|
|
129
|
+
byId(id) {
|
|
130
|
+
throw new Error('Method not implemented.');
|
|
131
|
+
}
|
|
132
|
+
createScaffold(parentId, preset) {
|
|
133
|
+
return this.#detailDataSource.createScaffold(parentId, preset);
|
|
134
|
+
}
|
|
135
|
+
async create(data) {
|
|
136
|
+
const promise = this.#detailDataSource.insert(data);
|
|
137
|
+
await promise;
|
|
138
|
+
this.requestTreeItemsOf(data.parentPath ? data.parentPath : null);
|
|
139
|
+
return promise;
|
|
140
|
+
}
|
|
141
|
+
save(id, requestBody) {
|
|
142
|
+
return this.#detailDataSource.update(id, requestBody);
|
|
89
143
|
}
|
|
90
|
-
async
|
|
91
|
-
|
|
144
|
+
async delete(id) {
|
|
145
|
+
const promise = this.#detailDataSource.delete(id);
|
|
146
|
+
const parentPath = id.substring(0, id.lastIndexOf('/'));
|
|
147
|
+
this.requestTreeItemsOf(parentPath ? parentPath : null);
|
|
148
|
+
return promise;
|
|
92
149
|
}
|
|
93
|
-
|
|
94
|
-
return
|
|
150
|
+
getSnippets({ skip = 0, take = 100 }) {
|
|
151
|
+
return this.#detailDataSource.getSnippets({ skip, take });
|
|
95
152
|
}
|
|
96
|
-
|
|
97
|
-
return
|
|
153
|
+
requestItems(keys) {
|
|
154
|
+
return this.#detailDataSource.getItems(keys);
|
|
98
155
|
}
|
|
99
156
|
}
|
|
@@ -1,26 +1,61 @@
|
|
|
1
1
|
import { PartialViewDetails } from '../../config.js';
|
|
2
|
+
import { CreatePartialViewRequestModel, PagedSnippetItemResponseModel, PartialViewItemResponseModel, PartialViewResponseModel, UpdatePartialViewRequestModel } from '../../../../../external/backend-api/index.js';
|
|
2
3
|
import type { UmbControllerHostElement } from '../../../../../libs/controller-api/index.js';
|
|
3
4
|
import { DataSourceResponse, UmbDataSource } from '../../../../../shared/repository/index.js';
|
|
4
|
-
export declare class UmbPartialViewDetailServerDataSource implements UmbDataSource<
|
|
5
|
+
export declare class UmbPartialViewDetailServerDataSource implements UmbDataSource<CreatePartialViewRequestModel, string, UpdatePartialViewRequestModel, PartialViewResponseModel, string> {
|
|
5
6
|
#private;
|
|
7
|
+
constructor(host: UmbControllerHostElement);
|
|
6
8
|
/**
|
|
7
|
-
* Creates
|
|
8
|
-
*
|
|
9
|
+
* Creates a new partial view scaffold
|
|
10
|
+
*
|
|
11
|
+
* @param {(string | null)} [parentId=null] You can leave this empty
|
|
12
|
+
* @param {string} preset Name of the snippet to use as a preset
|
|
13
|
+
* @return {*} {Promise<DataSourceResponse<PartialViewDetails>>}
|
|
9
14
|
* @memberof UmbPartialViewDetailServerDataSource
|
|
10
15
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
createScaffold(parentId: string | null | undefined, preset: string): Promise<DataSourceResponse<PartialViewDetails>>;
|
|
17
|
+
/**
|
|
18
|
+
* Get possible snippets for partial views
|
|
19
|
+
*
|
|
20
|
+
* @param {*} { skip = 0, take = 100 }
|
|
21
|
+
* @return {*} {Promise<DataSourceResponse<PagedSnippetItemResponseModel>>}
|
|
22
|
+
* @memberof UmbPartialViewDetailServerDataSource
|
|
23
|
+
*/
|
|
24
|
+
getSnippets({ skip, take }: {
|
|
25
|
+
skip?: number | undefined;
|
|
26
|
+
take?: number | undefined;
|
|
27
|
+
}): Promise<DataSourceResponse<PagedSnippetItemResponseModel>>;
|
|
13
28
|
/**
|
|
14
|
-
* Fetches a
|
|
29
|
+
* Fetches a partial view with the given path from the server
|
|
15
30
|
* @param {string} path
|
|
16
31
|
* @return {*}
|
|
17
32
|
* @memberof UmbStylesheetServerDataSource
|
|
18
33
|
*/
|
|
19
|
-
get(path: string): Promise<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
34
|
+
get(path: string): Promise<DataSourceResponse<import("../../../../../external/backend-api/index.js").TextFileResponseModelBaseModel>>;
|
|
35
|
+
/**
|
|
36
|
+
* Creates a new partial view
|
|
37
|
+
*
|
|
38
|
+
* @param {CreatePartialViewRequestModel} requestBody
|
|
39
|
+
* @return {*} {Promise<DataSourceResponse<string>>}
|
|
40
|
+
* @memberof UmbPartialViewDetailServerDataSource
|
|
41
|
+
*/
|
|
42
|
+
insert(requestBody: CreatePartialViewRequestModel): Promise<DataSourceResponse<string>>;
|
|
43
|
+
/**
|
|
44
|
+
* Updates a partial view
|
|
45
|
+
*
|
|
46
|
+
* @param {string} [unique='']
|
|
47
|
+
* @param {UpdatePartialViewRequestModel} requestBody
|
|
48
|
+
* @return {*} {Promise<DataSourceResponse<any>>}
|
|
49
|
+
* @memberof UmbPartialViewDetailServerDataSource
|
|
50
|
+
*/
|
|
51
|
+
update(unique: string | undefined, requestBody: UpdatePartialViewRequestModel): Promise<DataSourceResponse<any>>;
|
|
52
|
+
/**
|
|
53
|
+
* Deletes a partial view
|
|
54
|
+
*
|
|
55
|
+
* @param {string} path
|
|
56
|
+
* @return {*} {Promise<DataSourceResponse>}
|
|
57
|
+
* @memberof UmbPartialViewDetailServerDataSource
|
|
58
|
+
*/
|
|
59
|
+
delete(path: string): Promise<DataSourceResponse>;
|
|
60
|
+
getItems(keys: Array<string>): Promise<DataSourceResponse<PartialViewItemResponseModel[]>>;
|
|
26
61
|
}
|
|
@@ -1,36 +1,75 @@
|
|
|
1
|
-
|
|
1
|
+
import { PartialViewResource, } from '../../../../../external/backend-api/index.js';
|
|
2
|
+
import { tryExecuteAndNotify } from '../../../../../shared/resources/index.js';
|
|
2
3
|
export class UmbPartialViewDetailServerDataSource {
|
|
3
4
|
#host;
|
|
5
|
+
constructor(host) {
|
|
6
|
+
this.#host = host;
|
|
7
|
+
}
|
|
4
8
|
/**
|
|
5
|
-
* Creates
|
|
6
|
-
*
|
|
9
|
+
* Creates a new partial view scaffold
|
|
10
|
+
*
|
|
11
|
+
* @param {(string | null)} [parentId=null] You can leave this empty
|
|
12
|
+
* @param {string} preset Name of the snippet to use as a preset
|
|
13
|
+
* @return {*} {Promise<DataSourceResponse<PartialViewDetails>>}
|
|
7
14
|
* @memberof UmbPartialViewDetailServerDataSource
|
|
8
15
|
*/
|
|
9
|
-
|
|
10
|
-
this.#host
|
|
16
|
+
createScaffold(parentId = null, preset) {
|
|
17
|
+
return tryExecuteAndNotify(this.#host, PartialViewResource.getPartialViewSnippetByName({ name: preset }));
|
|
11
18
|
}
|
|
12
|
-
|
|
13
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Get possible snippets for partial views
|
|
21
|
+
*
|
|
22
|
+
* @param {*} { skip = 0, take = 100 }
|
|
23
|
+
* @return {*} {Promise<DataSourceResponse<PagedSnippetItemResponseModel>>}
|
|
24
|
+
* @memberof UmbPartialViewDetailServerDataSource
|
|
25
|
+
*/
|
|
26
|
+
getSnippets({ skip = 0, take = 100 }) {
|
|
27
|
+
return tryExecuteAndNotify(this.#host, PartialViewResource.getPartialViewSnippet({ skip, take }));
|
|
14
28
|
}
|
|
15
29
|
/**
|
|
16
|
-
* Fetches a
|
|
30
|
+
* Fetches a partial view with the given path from the server
|
|
17
31
|
* @param {string} path
|
|
18
32
|
* @return {*}
|
|
19
33
|
* @memberof UmbStylesheetServerDataSource
|
|
20
34
|
*/
|
|
21
|
-
|
|
35
|
+
get(path) {
|
|
22
36
|
if (!path)
|
|
23
37
|
throw new Error('Path is missing');
|
|
24
|
-
|
|
25
|
-
return { data: undefined, error: undefined };
|
|
38
|
+
return tryExecuteAndNotify(this.#host, PartialViewResource.getPartialView({ path }));
|
|
26
39
|
}
|
|
27
|
-
|
|
28
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Creates a new partial view
|
|
42
|
+
*
|
|
43
|
+
* @param {CreatePartialViewRequestModel} requestBody
|
|
44
|
+
* @return {*} {Promise<DataSourceResponse<string>>}
|
|
45
|
+
* @memberof UmbPartialViewDetailServerDataSource
|
|
46
|
+
*/
|
|
47
|
+
insert(requestBody) {
|
|
48
|
+
return tryExecuteAndNotify(this.#host, PartialViewResource.postPartialView({ requestBody }));
|
|
49
|
+
}
|
|
50
|
+
//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
|
|
51
|
+
/**
|
|
52
|
+
* Updates a partial view
|
|
53
|
+
*
|
|
54
|
+
* @param {string} [unique='']
|
|
55
|
+
* @param {UpdatePartialViewRequestModel} requestBody
|
|
56
|
+
* @return {*} {Promise<DataSourceResponse<any>>}
|
|
57
|
+
* @memberof UmbPartialViewDetailServerDataSource
|
|
58
|
+
*/
|
|
59
|
+
update(unique = '', requestBody) {
|
|
60
|
+
return tryExecuteAndNotify(this.#host, PartialViewResource.putPartialView({ requestBody }));
|
|
29
61
|
}
|
|
30
|
-
|
|
31
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Deletes a partial view
|
|
64
|
+
*
|
|
65
|
+
* @param {string} path
|
|
66
|
+
* @return {*} {Promise<DataSourceResponse>}
|
|
67
|
+
* @memberof UmbPartialViewDetailServerDataSource
|
|
68
|
+
*/
|
|
69
|
+
delete(path) {
|
|
70
|
+
return tryExecuteAndNotify(this.#host, PartialViewResource.deletePartialView({ path }));
|
|
32
71
|
}
|
|
33
|
-
|
|
34
|
-
|
|
72
|
+
getItems(keys) {
|
|
73
|
+
return tryExecuteAndNotify(this.#host, PartialViewResource.getPartialViewItem({ id: keys }));
|
|
35
74
|
}
|
|
36
75
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CreateFolderRequestModel, FolderModelBaseModel, FolderReponseModel } 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 PartialViewGetFolderResponse = {
|
|
5
|
+
path: string;
|
|
6
|
+
parentPath: string;
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
9
|
+
export declare class UmbPartialViewsFolderServerDataSource implements UmbFolderDataSource {
|
|
10
|
+
#private;
|
|
11
|
+
constructor(host: UmbControllerHostElement);
|
|
12
|
+
createScaffold(parentId: string | null): Promise<DataSourceResponse<FolderReponseModel>>;
|
|
13
|
+
get(unique: string): Promise<DataSourceResponse<PartialViewGetFolderResponse>>;
|
|
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 { PartialViewResource, } from '../../../../../external/backend-api/index.js';
|
|
2
|
+
import { tryExecuteAndNotify } from '../../../../../shared/resources/index.js';
|
|
3
|
+
export class UmbPartialViewsFolderServerDataSource {
|
|
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, PartialViewResource.getPartialViewFolder({ path: unique }));
|
|
13
|
+
}
|
|
14
|
+
insert(requestBody) {
|
|
15
|
+
return tryExecuteAndNotify(this.#host, PartialViewResource.postPartialViewFolder({ requestBody }));
|
|
16
|
+
}
|
|
17
|
+
update(unique, data) {
|
|
18
|
+
throw new Error('Method not implemented.');
|
|
19
|
+
}
|
|
20
|
+
delete(path) {
|
|
21
|
+
return tryExecuteAndNotify(this.#host, PartialViewResource.deletePartialViewFolder({ path }));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { PARTIAL_VIEW_ENTITY_TYPE, PARTIAL_VIEW_REPOSITORY_ALIAS, PARTIAL_VIEW_TREE_ALIAS } from '../config.js';
|
|
1
|
+
import { PARTIAL_VIEW_ENTITY_TYPE, PARTIAL_VIEW_REPOSITORY_ALIAS, PARTIAL_VIEW_ROOT_ENTITY_TYPE, PARTIAL_VIEW_TREE_ALIAS, } from '../config.js';
|
|
2
2
|
const tree = {
|
|
3
3
|
type: 'tree',
|
|
4
4
|
alias: PARTIAL_VIEW_TREE_ALIAS,
|
|
5
5
|
name: 'Partial Views Tree',
|
|
6
|
+
weight: 30,
|
|
6
7
|
meta: {
|
|
7
8
|
repositoryAlias: PARTIAL_VIEW_REPOSITORY_ALIAS,
|
|
8
9
|
},
|
|
@@ -13,7 +14,7 @@ const treeItem = {
|
|
|
13
14
|
alias: 'Umb.TreeItem.PartialViews',
|
|
14
15
|
name: 'Partial Views Tree Item',
|
|
15
16
|
conditions: {
|
|
16
|
-
entityTypes: [PARTIAL_VIEW_ENTITY_TYPE],
|
|
17
|
+
entityTypes: [PARTIAL_VIEW_ROOT_ENTITY_TYPE, PARTIAL_VIEW_ENTITY_TYPE],
|
|
17
18
|
},
|
|
18
19
|
};
|
|
19
20
|
export const manifests = [tree, treeItem];
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
2
2
|
export declare class UmbPartialViewsWorkspaceEditElement extends UmbLitElement {
|
|
3
3
|
#private;
|
|
4
|
-
private _name
|
|
4
|
+
private get _name();
|
|
5
|
+
private set _name(value);
|
|
5
6
|
private _content?;
|
|
7
|
+
private _path?;
|
|
8
|
+
private _ready?;
|
|
6
9
|
private _codeEditor?;
|
|
10
|
+
private _modalContext?;
|
|
11
|
+
private inputQuery$;
|
|
7
12
|
constructor();
|
|
8
13
|
render(): import("lit-html").TemplateResult<1>;
|
|
9
14
|
static styles: import("@lit/reactive-element/css-tag.js").CSSResult[];
|
package/dist-cms/packages/templating/partial-views/workspace/partial-views-workspace-edit.element.js
CHANGED
|
@@ -7,15 +7,34 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { UUITextStyles } from '../../../../external/uui/index.js';
|
|
8
8
|
import { css, html, customElement, query, state } from '../../../../external/lit/index.js';
|
|
9
9
|
import { UmbLitElement } from '../../../../shared/lit-element/index.js';
|
|
10
|
+
import { UMB_MODAL_MANAGER_CONTEXT_TOKEN } from '../../../core/modal/index.js';
|
|
11
|
+
import { UMB_TEMPLATE_QUERY_BUILDER_MODAL } from '../../templates/modals/modal-tokens.js';
|
|
12
|
+
import { getQuerySnippet } from '../../utils.js';
|
|
13
|
+
import { Subject, debounceTime } from '../../../../external/rxjs/index.js';
|
|
10
14
|
export let UmbPartialViewsWorkspaceEditElement = class UmbPartialViewsWorkspaceEditElement extends UmbLitElement {
|
|
15
|
+
#name;
|
|
16
|
+
get _name() {
|
|
17
|
+
return this.#name;
|
|
18
|
+
}
|
|
19
|
+
set _name(value) {
|
|
20
|
+
this.#name = value?.replace('.cshtml', '');
|
|
21
|
+
this.requestUpdate();
|
|
22
|
+
}
|
|
11
23
|
#partialViewsWorkspaceContext;
|
|
12
24
|
#isNew;
|
|
13
25
|
constructor() {
|
|
14
26
|
super();
|
|
15
|
-
this
|
|
27
|
+
this.#name = '';
|
|
16
28
|
this._content = '';
|
|
29
|
+
this._path = '';
|
|
30
|
+
this._ready = false;
|
|
17
31
|
this.#isNew = false;
|
|
18
|
-
this.
|
|
32
|
+
this.inputQuery$ = new Subject();
|
|
33
|
+
this.consumeContext(UMB_MODAL_MANAGER_CONTEXT_TOKEN, (instance) => {
|
|
34
|
+
this._modalContext = instance;
|
|
35
|
+
});
|
|
36
|
+
//tODO: should this be called something else here?
|
|
37
|
+
this.consumeContext('UmbEntityWorkspaceContext', (workspaceContext) => {
|
|
19
38
|
this.#partialViewsWorkspaceContext = workspaceContext;
|
|
20
39
|
this.observe(this.#partialViewsWorkspaceContext.name, (name) => {
|
|
21
40
|
this._name = name;
|
|
@@ -23,44 +42,73 @@ export let UmbPartialViewsWorkspaceEditElement = class UmbPartialViewsWorkspaceE
|
|
|
23
42
|
this.observe(this.#partialViewsWorkspaceContext.content, (content) => {
|
|
24
43
|
this._content = content;
|
|
25
44
|
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
45
|
+
this.observe(this.#partialViewsWorkspaceContext.path, (path) => {
|
|
46
|
+
this._path = path;
|
|
47
|
+
});
|
|
48
|
+
this.observe(this.#partialViewsWorkspaceContext.isNew, (isNew) => {
|
|
49
|
+
this.#isNew = !!isNew;
|
|
50
|
+
});
|
|
51
|
+
this.observe(this.#partialViewsWorkspaceContext.isCodeEditorReady, (isReady) => {
|
|
52
|
+
this._ready = isReady;
|
|
53
|
+
});
|
|
54
|
+
this.inputQuery$.pipe(debounceTime(250)).subscribe((nameInputValue) => {
|
|
55
|
+
this.#partialViewsWorkspaceContext?.setName(`${nameInputValue}.cshtml`);
|
|
56
|
+
});
|
|
29
57
|
});
|
|
30
58
|
}
|
|
31
|
-
// TODO: temp code for testing create and save
|
|
32
59
|
#onNameInput(event) {
|
|
33
60
|
const target = event.target;
|
|
34
61
|
const value = target.value;
|
|
35
|
-
this
|
|
62
|
+
this.inputQuery$.next(value);
|
|
36
63
|
}
|
|
37
|
-
//TODO - debounce that
|
|
38
64
|
#onCodeEditorInput(event) {
|
|
39
65
|
const target = event.target;
|
|
40
66
|
const value = target.code;
|
|
41
67
|
this.#partialViewsWorkspaceContext?.setContent(value);
|
|
42
68
|
}
|
|
43
|
-
#
|
|
69
|
+
#insertSnippet(event) {
|
|
44
70
|
const target = event.target;
|
|
45
71
|
const value = target.value;
|
|
46
|
-
this._codeEditor?.insert(
|
|
72
|
+
this._codeEditor?.insert(value);
|
|
73
|
+
}
|
|
74
|
+
#openQueryBuilder() {
|
|
75
|
+
const queryBuilderModal = this._modalContext?.open(UMB_TEMPLATE_QUERY_BUILDER_MODAL);
|
|
76
|
+
queryBuilderModal?.onSubmit().then((queryBuilderModalResult) => {
|
|
77
|
+
if (queryBuilderModalResult.value)
|
|
78
|
+
this._codeEditor?.insert(getQuerySnippet(queryBuilderModalResult.value));
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
#renderCodeEditor() {
|
|
82
|
+
return html `<umb-code-editor
|
|
83
|
+
language="razor"
|
|
84
|
+
id="content"
|
|
85
|
+
.code=${this._content ?? ''}
|
|
86
|
+
@input=${this.#onCodeEditorInput}></umb-code-editor>`;
|
|
47
87
|
}
|
|
48
88
|
render() {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
89
|
+
return html `<umb-workspace-editor alias="Umb.Workspace.Template">
|
|
90
|
+
<div id="workspace-header" slot="header">
|
|
91
|
+
<uui-input
|
|
92
|
+
placeholder="Enter name..."
|
|
93
|
+
.value=${this._name}
|
|
94
|
+
@input=${this.#onNameInput}
|
|
95
|
+
label="template name"></uui-input>
|
|
96
|
+
<small>Views/Partials/${this._path}</small>
|
|
97
|
+
</div>
|
|
52
98
|
<uui-box>
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
99
|
+
<div slot="header" id="code-editor-menu-container">
|
|
100
|
+
<umb-templating-insert-menu @insert=${this.#insertSnippet}></umb-templating-insert-menu>
|
|
101
|
+
<uui-button look="secondary" id="query-builder-button" label="Query builder" @click=${this.#openQueryBuilder}>
|
|
102
|
+
<uui-icon name="umb:wand"></uui-icon>Query builder
|
|
103
|
+
</uui-button>
|
|
104
|
+
</div>
|
|
105
|
+
${this._ready
|
|
106
|
+
? this.#renderCodeEditor()
|
|
107
|
+
: html `<div id="loader-container">
|
|
108
|
+
<uui-loader></uui-loader>
|
|
109
|
+
</div>`}
|
|
62
110
|
</uui-box>
|
|
63
|
-
</umb-
|
|
111
|
+
</umb-workspace-editor>`;
|
|
64
112
|
}
|
|
65
113
|
static { this.styles = [
|
|
66
114
|
UUITextStyles,
|
|
@@ -71,28 +119,76 @@ export let UmbPartialViewsWorkspaceEditElement = class UmbPartialViewsWorkspaceE
|
|
|
71
119
|
height: 100%;
|
|
72
120
|
}
|
|
73
121
|
|
|
122
|
+
#loader-container {
|
|
123
|
+
display: grid;
|
|
124
|
+
place-items: center;
|
|
125
|
+
min-height: calc(100dvh - 360px);
|
|
126
|
+
}
|
|
127
|
+
|
|
74
128
|
umb-code-editor {
|
|
75
|
-
--editor-height: calc(
|
|
129
|
+
--editor-height: calc(100dvh - 300px);
|
|
76
130
|
}
|
|
77
131
|
|
|
78
132
|
uui-box {
|
|
79
|
-
|
|
133
|
+
min-height: calc(100dvh - 300px);
|
|
134
|
+
margin: var(--uui-size-layout-1);
|
|
80
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%;
|
|
81
142
|
}
|
|
82
143
|
|
|
83
144
|
uui-input {
|
|
84
145
|
width: 100%;
|
|
85
|
-
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
#code-editor-menu-container uui-icon:not([name='umb:delete']) {
|
|
149
|
+
margin-right: var(--uui-size-space-3);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
#insert-menu {
|
|
153
|
+
margin: 0;
|
|
154
|
+
padding: 0;
|
|
155
|
+
margin-top: var(--uui-size-space-3);
|
|
156
|
+
background-color: var(--uui-color-surface);
|
|
157
|
+
box-shadow: var(--uui-shadow-depth-3);
|
|
158
|
+
min-width: calc(100% + var(--uui-size-8, 24px));
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
#insert-menu > li,
|
|
162
|
+
ul {
|
|
163
|
+
padding: 0;
|
|
164
|
+
width: 100%;
|
|
165
|
+
list-style: none;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.insert-menu-item {
|
|
169
|
+
width: 100%;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
#code-editor-menu-container {
|
|
173
|
+
display: flex;
|
|
174
|
+
justify-content: flex-end;
|
|
175
|
+
gap: var(--uui-size-space-3);
|
|
86
176
|
}
|
|
87
177
|
`,
|
|
88
178
|
]; }
|
|
89
179
|
};
|
|
90
180
|
__decorate([
|
|
91
181
|
state()
|
|
92
|
-
], UmbPartialViewsWorkspaceEditElement.prototype, "_name",
|
|
182
|
+
], UmbPartialViewsWorkspaceEditElement.prototype, "_name", null);
|
|
93
183
|
__decorate([
|
|
94
184
|
state()
|
|
95
185
|
], UmbPartialViewsWorkspaceEditElement.prototype, "_content", void 0);
|
|
186
|
+
__decorate([
|
|
187
|
+
state()
|
|
188
|
+
], UmbPartialViewsWorkspaceEditElement.prototype, "_path", void 0);
|
|
189
|
+
__decorate([
|
|
190
|
+
state()
|
|
191
|
+
], UmbPartialViewsWorkspaceEditElement.prototype, "_ready", void 0);
|
|
96
192
|
__decorate([
|
|
97
193
|
query('umb-code-editor')
|
|
98
194
|
], UmbPartialViewsWorkspaceEditElement.prototype, "_codeEditor", void 0);
|
package/dist-cms/packages/templating/partial-views/workspace/partial-views-workspace.context.d.ts
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { UmbPartialViewsRepository } from '../repository/partial-views.repository.js';
|
|
2
|
+
import { PartialViewDetails } from '../config.js';
|
|
3
3
|
import { UmbControllerHostElement } from '../../../../libs/controller-api/index.js';
|
|
4
4
|
import { UmbWorkspaceContext } from '../../../core/workspace/index.js';
|
|
5
|
-
export declare class UmbPartialViewsWorkspaceContext extends UmbWorkspaceContext<
|
|
5
|
+
export declare class UmbPartialViewsWorkspaceContext extends UmbWorkspaceContext<UmbPartialViewsRepository, PartialViewDetails> {
|
|
6
6
|
#private;
|
|
7
7
|
getEntityId(): string | undefined;
|
|
8
8
|
getEntityType(): string;
|
|
9
9
|
save(): Promise<void>;
|
|
10
10
|
destroy(): void;
|
|
11
|
-
data: import("rxjs").Observable<
|
|
11
|
+
data: import("rxjs").Observable<import("../../../../external/backend-api/index.js").TextFileResponseModelBaseModel | undefined>;
|
|
12
12
|
name: import("rxjs").Observable<string | undefined>;
|
|
13
|
-
content: import("rxjs").Observable<string |
|
|
13
|
+
content: import("rxjs").Observable<string | undefined>;
|
|
14
|
+
path: import("rxjs").Observable<string | undefined>;
|
|
15
|
+
isCodeEditorReady: import("rxjs").Observable<boolean>;
|
|
14
16
|
constructor(host: UmbControllerHostElement);
|
|
15
|
-
getData():
|
|
17
|
+
getData(): import("../../../../external/backend-api/index.js").TextFileResponseModelBaseModel | undefined;
|
|
16
18
|
setName(value: string): void;
|
|
17
19
|
setContent(value: string): void;
|
|
18
20
|
load(entityKey: string): Promise<void>;
|
|
19
|
-
create(parentKey: string | null): Promise<void>;
|
|
21
|
+
create(parentKey: string | null, name?: string): Promise<void>;
|
|
20
22
|
}
|