@umbraco-cms/backoffice 16.0.0-rc2 → 16.0.0-rc4
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/apps/backoffice/backoffice.context.js +5 -1
- package/dist-cms/apps/backoffice/components/backoffice-main.element.js +3 -1
- package/dist-cms/css/uui-css.css +438 -108
- package/dist-cms/custom-elements.json +100 -15
- package/dist-cms/external/uui/index.js +370 -336
- package/dist-cms/libs/context-api/consume/context-consumer.js +1 -2
- package/dist-cms/libs/controller-api/controller-host.mixin.js +2 -2
- package/dist-cms/packages/block/block/context/block-entry.context.js +10 -3
- package/dist-cms/packages/block/block/workspace/views/edit/block-workspace-view-edit-properties.element.d.ts +1 -1
- package/dist-cms/packages/block/block/workspace/views/edit/block-workspace-view-edit-properties.element.js +7 -7
- package/dist-cms/packages/block/block/workspace/views/edit/block-workspace-view-edit-property.element.js +1 -1
- package/dist-cms/packages/block/block/workspace/views/edit/block-workspace-view-edit.element.js +1 -0
- package/dist-cms/packages/block/block-list/components/block-list-entry/block-list-entry.element.js +2 -1
- package/dist-cms/packages/block/block-type/components/input-block-type/input-block-type.element.js +1 -2
- package/dist-cms/packages/clipboard/property/value-translator/copy/clipboard-copy-translator-value-resolver.js +6 -1
- package/dist-cms/packages/content/content/components/property-type-based-property/index.d.ts +2 -0
- package/dist-cms/packages/content/content/components/property-type-based-property/index.js +2 -0
- package/dist-cms/packages/content/content/components/property-type-based-property/property-type-based-property.context-token.d.ts +8 -0
- package/dist-cms/packages/content/content/components/property-type-based-property/property-type-based-property.context-token.js +7 -0
- package/dist-cms/packages/content/content/{content-property.context.d.ts → components/property-type-based-property/property-type-based-property.context.d.ts} +6 -1
- package/dist-cms/packages/content/content/components/property-type-based-property/property-type-based-property.context.js +19 -0
- package/dist-cms/packages/content/content/components/property-type-based-property/property-type-based-property.element.d.ts +1 -1
- package/dist-cms/packages/content/content/components/property-type-based-property/property-type-based-property.element.js +8 -7
- package/dist-cms/packages/content/content/controller/merge-content-variant-data.controller.js +1 -0
- package/dist-cms/packages/content/content/global-components/content-workspace-property.element.d.ts +26 -0
- package/dist-cms/packages/content/content/global-components/content-workspace-property.element.js +104 -0
- package/dist-cms/packages/content/content/global-components/index.d.ts +1 -0
- package/dist-cms/packages/content/content/global-components/index.js +1 -0
- package/dist-cms/packages/content/content/index.d.ts +1 -2
- package/dist-cms/packages/content/content/index.js +1 -2
- package/dist-cms/packages/content/content/property-dataset-context/element-property-dataset.context.js +4 -1
- package/dist-cms/packages/content/content/workspace/content-detail-workspace-base.js +6 -1
- package/dist-cms/packages/content/content/workspace/views/edit/content-editor-properties.element.d.ts +1 -3
- package/dist-cms/packages/content/content/workspace/views/edit/content-editor-properties.element.js +8 -48
- package/dist-cms/packages/content/content/workspace/views/edit/content-editor.element.js +1 -0
- package/dist-cms/packages/content/content-type/structure/content-type-property-structure-helper.class.d.ts +1 -0
- package/dist-cms/packages/content/content-type/structure/content-type-property-structure-helper.class.js +1 -0
- package/dist-cms/packages/content/content-type/structure/content-type-structure-manager.class.d.ts +1 -0
- package/dist-cms/packages/content/content-type/structure/content-type-structure-manager.class.js +3 -3
- package/dist-cms/packages/content/content-type/workspace/views/design/content-type-design-editor.element.js +11 -7
- package/dist-cms/packages/content/property-type/workspace/property-type-workspace.context.js +5 -1
- package/dist-cms/packages/core/backend-api/types.gen.d.ts +2 -0
- package/dist-cms/packages/core/collection/collection-view.manager.js +4 -4
- package/dist-cms/packages/core/collection/default/collection-default.context.d.ts +1 -0
- package/dist-cms/packages/core/collection/default/collection-default.context.js +3 -0
- package/dist-cms/packages/core/components/entity-actions-bundle/entity-actions-bundle.element.js +4 -1
- package/dist-cms/packages/core/components/input-number-range/input-number-range.element.d.ts +4 -1
- package/dist-cms/packages/core/components/input-number-range/input-number-range.element.js +27 -3
- package/dist-cms/packages/core/components/input-with-alias/input-with-alias.element.js +0 -2
- package/dist-cms/packages/core/culture/manifests.d.ts +1 -1
- package/dist-cms/packages/core/entity-action/common/create/create.action.js +1 -0
- package/dist-cms/packages/core/entity-item/entity-item-ref/entity-item-ref.element.d.ts +9 -0
- package/dist-cms/packages/core/entity-item/entity-item-ref/entity-item-ref.element.js +80 -2
- package/dist-cms/packages/core/picker/search/picker-search-result.element.js +1 -2
- package/dist-cms/packages/core/property/manifests.d.ts +1 -1
- package/dist-cms/packages/core/property/property-dataset/property-dataset-base-context.js +7 -2
- package/dist-cms/packages/core/property/property-guard-manager/variant-property-guard.manager.d.ts +15 -2
- package/dist-cms/packages/core/property/property-guard-manager/variant-property-guard.manager.js +22 -15
- package/dist-cms/packages/core/property/property-value-cloner/property-value-clone.controller.js +2 -0
- package/dist-cms/packages/core/property/property-value-preset/property-value-preset-builder.controller.js +6 -1
- package/dist-cms/packages/core/repository/detail/detail-repository-base.js +6 -7
- package/dist-cms/packages/core/repository/item/item-repository-base.d.ts +1 -1
- package/dist-cms/packages/core/repository/item/item-repository-base.js +25 -9
- package/dist-cms/packages/core/repository/item/item-repository.interface.d.ts +1 -1
- package/dist-cms/packages/core/router/router-slot/model.d.ts +1 -0
- package/dist-cms/packages/core/router/router-slot/router-slot.d.ts +1 -0
- package/dist-cms/packages/core/router/router-slot/router-slot.js +30 -0
- package/dist-cms/packages/core/section/section-default.element.js +3 -0
- package/dist-cms/packages/core/temporary-file/config/config.repository.d.ts +1 -0
- package/dist-cms/packages/core/temporary-file/config/config.repository.js +7 -3
- package/dist-cms/packages/core/temporary-file/config/config.server.data-source.js +1 -1
- package/dist-cms/packages/core/temporary-file/manifests.d.ts +1 -1
- package/dist-cms/packages/core/temporary-file/temporary-file-manager.class.js +15 -4
- package/dist-cms/packages/core/themes/manifests.d.ts +1 -1
- package/dist-cms/packages/core/tree/data/tree-repository-base.d.ts +5 -1
- package/dist-cms/packages/core/tree/data/tree-repository-base.js +27 -13
- package/dist-cms/packages/core/tree/tree-item/tree-item.element.js +1 -1
- package/dist-cms/packages/core/utils/media/image-size.function.d.ts +5 -3
- package/dist-cms/packages/core/utils/media/image-size.function.js +9 -11
- package/dist-cms/packages/core/validation/controllers/bind-server-validation-to-form-control.controller.js +1 -1
- package/dist-cms/packages/core/validation/controllers/form-control-validator.controller.js +4 -4
- package/dist-cms/packages/core/validation/controllers/validation-path-translation/validation-property-path-translation.controller.js +1 -0
- package/dist-cms/packages/core/validation/controllers/validation.controller.js +5 -5
- package/dist-cms/packages/core/variant/constants.d.ts +1 -0
- package/dist-cms/packages/core/variant/constants.js +1 -0
- package/dist-cms/packages/core/variant/context/constants.d.ts +1 -0
- package/dist-cms/packages/core/variant/context/constants.js +1 -0
- package/dist-cms/packages/core/variant/context/index.d.ts +1 -0
- package/dist-cms/packages/core/variant/context/index.js +1 -0
- package/dist-cms/packages/core/variant/context/variant.context.d.ts +91 -0
- package/dist-cms/packages/core/variant/context/variant.context.js +141 -0
- package/dist-cms/packages/core/variant/context/variant.context.token.d.ts +3 -0
- package/dist-cms/packages/core/variant/context/variant.context.token.js +2 -0
- package/dist-cms/packages/core/variant/index.d.ts +2 -0
- package/dist-cms/packages/core/variant/index.js +2 -0
- package/dist-cms/packages/core/workspace/components/workspace-action/common/save/save.action.js +3 -1
- package/dist-cms/packages/core/workspace/components/workspace-split-view/workspace-split-view-variant-selector.element.js +2 -2
- package/dist-cms/packages/core/workspace/controllers/workspace-is-new-redirect.controller.d.ts +7 -0
- package/dist-cms/packages/core/workspace/controllers/workspace-is-new-redirect.controller.js +31 -10
- package/dist-cms/packages/core/workspace/controllers/workspace-route-manager.controller.js +5 -5
- package/dist-cms/packages/core/workspace/entity-detail/entity-detail-workspace-base.js +1 -1
- package/dist-cms/packages/core/workspace/info-app/global-components/workspace-info-app-layout.element.js +0 -4
- package/dist-cms/packages/core/workspace/submittable/submittable-workspace-context-base.d.ts +1 -0
- package/dist-cms/packages/core/workspace/submittable/submittable-workspace-context-base.js +10 -0
- package/dist-cms/packages/core/workspace/workspace-property-dataset/invariant-workspace-property-dataset-context.js +4 -1
- package/dist-cms/packages/data-type/collection/repository/data-type-collection.repository.js +6 -1
- package/dist-cms/packages/data-type/constants.d.ts +1 -0
- package/dist-cms/packages/data-type/constants.js +1 -0
- package/dist-cms/packages/data-type/repository/detail/data-type-detail.repository.js +6 -1
- package/dist-cms/packages/data-type/search/constants.d.ts +2 -0
- package/dist-cms/packages/data-type/search/constants.js +2 -0
- package/dist-cms/packages/data-type/search/global-search/constants.d.ts +1 -0
- package/dist-cms/packages/data-type/search/global-search/constants.js +1 -0
- package/dist-cms/packages/data-type/search/global-search/manifests.d.ts +1 -0
- package/dist-cms/packages/data-type/search/global-search/manifests.js +22 -0
- package/dist-cms/packages/data-type/search/manifests.js +2 -0
- package/dist-cms/packages/dictionary/search/constants.d.ts +1 -0
- package/dist-cms/packages/dictionary/search/constants.js +1 -0
- package/dist-cms/packages/dictionary/search/global-search/constants.d.ts +1 -0
- package/dist-cms/packages/dictionary/search/global-search/constants.js +1 -0
- package/dist-cms/packages/dictionary/search/global-search/manifests.d.ts +1 -0
- package/dist-cms/packages/dictionary/search/global-search/manifests.js +22 -0
- package/dist-cms/packages/dictionary/search/manifests.js +2 -0
- package/dist-cms/packages/documents/document-blueprints/workspace/document-blueprint-workspace-editor.element.js +5 -4
- package/dist-cms/packages/documents/document-types/search/constants.d.ts +1 -0
- package/dist-cms/packages/documents/document-types/search/constants.js +1 -0
- package/dist-cms/packages/documents/document-types/search/global-search/constants.d.ts +1 -0
- package/dist-cms/packages/documents/document-types/search/global-search/constants.js +1 -0
- package/dist-cms/packages/documents/document-types/search/global-search/manifests.d.ts +1 -0
- package/dist-cms/packages/documents/document-types/search/global-search/manifests.js +22 -0
- package/dist-cms/packages/documents/document-types/search/manifests.js +2 -0
- package/dist-cms/packages/documents/documents/collection/document-collection.context.d.ts +2 -0
- package/dist-cms/packages/documents/documents/collection/document-collection.context.js +23 -0
- package/dist-cms/packages/documents/documents/components/input-document/input-document.context.js +4 -0
- package/dist-cms/packages/documents/documents/item/document-item-data-resolver.d.ts +2 -2
- package/dist-cms/packages/documents/documents/item/document-item-data-resolver.js +55 -68
- package/dist-cms/packages/documents/documents/item/document-item-ref.element.d.ts +4 -0
- package/dist-cms/packages/documents/documents/item/document-item-ref.element.js +33 -2
- package/dist-cms/packages/documents/documents/picker/document-picker-search-result-item.element.d.ts +1 -0
- package/dist-cms/packages/documents/documents/picker/document-picker-search-result-item.element.js +14 -8
- package/dist-cms/packages/documents/documents/property-dataset-context/document-property-dataset.context.d.ts +0 -1
- package/dist-cms/packages/documents/documents/property-dataset-context/document-property-dataset.context.js +0 -42
- package/dist-cms/packages/documents/documents/publishing/workspace-context/document-publishing.workspace-context.js +12 -2
- package/dist-cms/packages/documents/documents/search/constants.d.ts +1 -0
- package/dist-cms/packages/documents/documents/search/constants.js +1 -0
- package/dist-cms/packages/documents/documents/search/document-search.server.data-source.js +3 -2
- package/dist-cms/packages/documents/documents/search/global-search/constants.d.ts +1 -0
- package/dist-cms/packages/documents/documents/search/global-search/constants.js +1 -0
- package/dist-cms/packages/documents/documents/search/global-search/document-global-search.d.ts +6 -0
- package/dist-cms/packages/documents/documents/search/global-search/document-global-search.js +15 -0
- package/dist-cms/packages/documents/documents/search/global-search/manifests.d.ts +1 -0
- package/dist-cms/packages/documents/documents/search/global-search/manifests.js +23 -0
- package/dist-cms/packages/documents/documents/search/manifests.js +2 -0
- package/dist-cms/packages/documents/documents/search/types.d.ts +1 -0
- package/dist-cms/packages/documents/documents/types.d.ts +1 -0
- package/dist-cms/packages/documents/documents/url/document-urls-data-resolver.d.ts +37 -0
- package/dist-cms/packages/documents/documents/url/document-urls-data-resolver.js +78 -0
- package/dist-cms/packages/documents/documents/url/index.d.ts +2 -0
- package/dist-cms/packages/documents/documents/url/index.js +2 -0
- package/dist-cms/packages/documents/documents/url/info-app/document-links-workspace-info-app.element.d.ts +0 -1
- package/dist-cms/packages/documents/documents/url/info-app/document-links-workspace-info-app.element.js +29 -24
- package/dist-cms/packages/documents/documents/url/repository/types.d.ts +1 -1
- package/dist-cms/packages/documents/documents/url/types.d.ts +1 -0
- package/dist-cms/packages/documents/documents/url/types.js +1 -0
- package/dist-cms/packages/documents/documents/user-permissions/document/conditions/document-user-permission.condition.js +3 -1
- package/dist-cms/packages/documents/documents/workspace/actions/save.action.js +4 -2
- package/dist-cms/packages/documents/documents/workspace/document-workspace-editor.element.js +13 -7
- package/dist-cms/packages/documents/documents/workspace/document-workspace.context.js +29 -0
- package/dist-cms/packages/language/global-contexts/app-language.context.js +14 -12
- package/dist-cms/packages/markdown-editor/components/input-markdown-editor/input-markdown.element.js +3 -0
- package/dist-cms/packages/media/media/components/input-media/input-media.context.js +4 -0
- package/dist-cms/packages/media/media/constants.d.ts +1 -1
- package/dist-cms/packages/media/media/constants.js +1 -1
- package/dist-cms/packages/media/media/dashboard/media-dashboard.element.js +1 -0
- package/dist-cms/packages/media/media/modals/media-picker/media-picker-modal.element.js +8 -0
- package/dist-cms/packages/media/media/search/constants.d.ts +1 -0
- package/dist-cms/packages/media/media/search/constants.js +1 -0
- package/dist-cms/packages/media/media/search/global-search/constants.d.ts +1 -0
- package/dist-cms/packages/media/media/search/global-search/constants.js +1 -0
- package/dist-cms/packages/media/media/search/global-search/manifests.d.ts +1 -0
- package/dist-cms/packages/media/media/search/global-search/manifests.js +23 -0
- package/dist-cms/packages/media/media/search/global-search/media-global-search.d.ts +15 -0
- package/dist-cms/packages/media/media/search/global-search/media-global-search.js +15 -0
- package/dist-cms/packages/media/media/search/manifests.js +2 -0
- package/dist-cms/packages/media/media/search/media-search.server.data-source.js +3 -2
- package/dist-cms/packages/media/media/search/types.d.ts +1 -0
- package/dist-cms/packages/media/media/workspace/media-workspace-editor.element.js +1 -0
- package/dist-cms/packages/media/media-types/constants.d.ts +1 -0
- package/dist-cms/packages/media/media-types/constants.js +1 -0
- package/dist-cms/packages/media/media-types/search/constants.d.ts +2 -0
- package/dist-cms/packages/media/media-types/search/constants.js +2 -0
- package/dist-cms/packages/media/media-types/search/global-search/constants.d.ts +1 -0
- package/dist-cms/packages/media/media-types/search/global-search/constants.js +1 -0
- package/dist-cms/packages/media/media-types/search/global-search/manifests.d.ts +1 -0
- package/dist-cms/packages/media/media-types/search/global-search/manifests.js +22 -0
- package/dist-cms/packages/media/media-types/search/manifests.js +4 -1
- package/dist-cms/packages/members/member/repository/member-repository-base.d.ts +8 -8
- package/dist-cms/packages/members/member/repository/member-repository-base.js +13 -12
- package/dist-cms/packages/members/member/search/constants.d.ts +1 -0
- package/dist-cms/packages/members/member/search/constants.js +1 -0
- package/dist-cms/packages/members/member/search/global-search/constants.d.ts +1 -0
- package/dist-cms/packages/members/member/search/global-search/constants.js +1 -0
- package/dist-cms/packages/members/member/search/global-search/manifests.d.ts +1 -0
- package/dist-cms/packages/members/member/search/global-search/manifests.js +22 -0
- package/dist-cms/packages/members/member/search/manifests.js +2 -0
- package/dist-cms/packages/members/member/workspace/member/member-workspace-editor.element.js +1 -0
- package/dist-cms/packages/members/member-type/constants.d.ts +1 -0
- package/dist-cms/packages/members/member-type/constants.js +1 -0
- package/dist-cms/packages/members/member-type/search/constants.d.ts +2 -0
- package/dist-cms/packages/members/member-type/search/constants.js +2 -0
- package/dist-cms/packages/members/member-type/search/global-search/constants.d.ts +1 -0
- package/dist-cms/packages/members/member-type/search/global-search/constants.js +1 -0
- package/dist-cms/packages/members/member-type/search/global-search/manifests.d.ts +1 -0
- package/dist-cms/packages/members/member-type/search/global-search/manifests.js +22 -0
- package/dist-cms/packages/members/member-type/search/manifests.js +4 -1
- package/dist-cms/packages/multi-url-picker/components/input-multi-url/input-multi-url.element.d.ts +4 -0
- package/dist-cms/packages/multi-url-picker/components/input-multi-url/input-multi-url.element.js +48 -1
- package/dist-cms/packages/multi-url-picker/link-picker-modal/link-picker-modal.element.d.ts +2 -2
- package/dist-cms/packages/multi-url-picker/link-picker-modal/link-picker-modal.element.js +95 -34
- package/dist-cms/packages/packages/package-section/views/created/created-packages-section-view.element.js +1 -0
- package/dist-cms/packages/relations/relations/reference/workspace-info-app/entity-references-workspace-view-info.element.js +6 -1
- package/dist-cms/packages/search/global-search/global-search-base.d.ts +11 -0
- package/dist-cms/packages/search/global-search/global-search-base.js +49 -0
- package/dist-cms/packages/search/global-search/global-search.extension.d.ts +15 -0
- package/dist-cms/packages/search/global-search/global-search.extension.js +1 -0
- package/dist-cms/packages/search/global-search/index.d.ts +1 -0
- package/dist-cms/packages/search/global-search/index.js +1 -0
- package/dist-cms/packages/search/global-search/types.d.ts +4 -0
- package/dist-cms/packages/search/global-search/types.js +1 -0
- package/dist-cms/packages/search/index.d.ts +1 -0
- package/dist-cms/packages/search/index.js +1 -0
- package/dist-cms/packages/search/search-modal/search-modal.element.d.ts +4 -4
- package/dist-cms/packages/search/search-modal/search-modal.element.js +40 -29
- package/dist-cms/packages/search/types.d.ts +1 -0
- package/dist-cms/packages/segment/package.json +8 -0
- package/dist-cms/packages/settings/package.json +8 -0
- package/dist-cms/packages/settings/vite.config.d.ts +2 -0
- package/dist-cms/packages/settings/vite.config.js +11 -0
- package/dist-cms/packages/sysinfo/components/sysinfo.element.js +49 -9
- package/dist-cms/packages/sysinfo/repository/sysinfo.repository.d.ts +3 -0
- package/dist-cms/packages/sysinfo/repository/sysinfo.repository.js +8 -0
- package/dist-cms/packages/templating/templates/constants.d.ts +1 -0
- package/dist-cms/packages/templating/templates/constants.js +1 -0
- package/dist-cms/packages/templating/templates/search/constants.d.ts +2 -0
- package/dist-cms/packages/templating/templates/search/constants.js +2 -0
- package/dist-cms/packages/templating/templates/search/global-search/constants.d.ts +1 -0
- package/dist-cms/packages/templating/templates/search/global-search/constants.js +1 -0
- package/dist-cms/packages/templating/templates/search/global-search/manifests.d.ts +1 -0
- package/dist-cms/packages/templating/templates/search/global-search/manifests.js +22 -0
- package/dist-cms/packages/templating/templates/search/manifests.js +4 -1
- package/dist-cms/packages/tiptap/extensions/core/media-upload.tiptap-api.d.ts +6 -1
- package/dist-cms/packages/tiptap/extensions/core/media-upload.tiptap-api.js +16 -6
- package/dist-cms/packages/tiptap/extensions/toolbar/media-picker.tiptap-toolbar-api.d.ts +6 -1
- package/dist-cms/packages/tiptap/extensions/toolbar/media-picker.tiptap-toolbar-api.js +27 -6
- package/dist-cms/packages/translation/package.json +8 -0
- package/dist-cms/packages/user/current-user/action/current-user-app-button.element.d.ts +1 -1
- package/dist-cms/packages/user/current-user/action/current-user-app-button.element.js +4 -8
- package/dist-cms/packages/user/current-user/current-user-action.extension.d.ts +0 -11
- package/dist-cms/packages/user/current-user/current-user.context.js +4 -1
- package/dist-cms/packages/user/current-user/external-login/manifests.js +0 -1
- package/dist-cms/packages/user/current-user/mfa-login/manifests.js +0 -1
- package/dist-cms/packages/user/current-user/repository/current-user.repository.d.ts +2 -2
- package/dist-cms/packages/user/current-user/repository/current-user.repository.js +8 -5
- package/dist-cms/packages/user/user/repository/user-repository-base.d.ts +7 -7
- package/dist-cms/packages/user/user/repository/user-repository-base.js +13 -12
- package/dist-cms/packages/user/user-group/collection/repository/user-group-collection.repository.js +4 -1
- package/dist-cms/packages/webhook/webhook-event/repository/webhook-event.repository.d.ts +4 -0
- package/dist-cms/packages/webhook/webhook-event/repository/webhook-event.repository.js +7 -1
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/dist-cms/umbraco-package-schema.json +147 -0
- package/dist-cms/umbraco-package.json +1 -1
- package/dist-cms/vscode-html-custom-data.json +61 -15
- package/examples/modal-routed/dashboard.element.ts +1 -0
- package/examples/modal-routed/modal/example-modal.element.ts +1 -0
- package/examples/validation-context/validation-context-dashboard.ts +12 -12
- package/package.json +7 -7
- package/dist-cms/packages/content/content/content-property.context-token.d.ts +0 -3
- package/dist-cms/packages/content/content/content-property.context-token.js +0 -2
- package/dist-cms/packages/content/content/content-property.context.js +0 -14
- package/dist-cms/packages/content/content/workspace/views/edit/content-editor-property.element.d.ts +0 -21
- package/dist-cms/packages/content/content/workspace/views/edit/content-editor-property.element.js +0 -63
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { UmbDocumentVariantState } from '../types.js';
|
|
2
2
|
import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { UMB_PROPERTY_DATASET_CONTEXT } from '@umbraco-cms/backoffice/property';
|
|
3
|
+
import { UmbBooleanState, UmbObjectState, UmbStringState } from '@umbraco-cms/backoffice/observable-api';
|
|
4
|
+
import { UMB_VARIANT_CONTEXT } from '@umbraco-cms/backoffice/variant';
|
|
6
5
|
/**
|
|
7
6
|
* A controller for resolving data for a document item
|
|
8
7
|
* @exports
|
|
@@ -10,46 +9,43 @@ import { UMB_PROPERTY_DATASET_CONTEXT } from '@umbraco-cms/backoffice/property';
|
|
|
10
9
|
* @augments {UmbControllerBase}
|
|
11
10
|
*/
|
|
12
11
|
export class UmbDocumentItemDataResolver extends UmbControllerBase {
|
|
13
|
-
#defaultCulture;
|
|
14
|
-
#appCulture;
|
|
15
|
-
#propertyDataSetCulture;
|
|
16
12
|
#data;
|
|
17
|
-
#init;
|
|
18
|
-
#unique;
|
|
19
13
|
#name;
|
|
20
|
-
#icon;
|
|
21
14
|
#state;
|
|
22
|
-
#isTrashed;
|
|
23
15
|
#isDraft;
|
|
16
|
+
#variantContext;
|
|
17
|
+
#fallbackCulture;
|
|
18
|
+
#displayCulture;
|
|
24
19
|
constructor(host) {
|
|
25
20
|
super(host);
|
|
26
|
-
this.#
|
|
27
|
-
this.unique = this.#
|
|
21
|
+
this.#data = new UmbObjectState(undefined);
|
|
22
|
+
this.unique = this.#data.asObservablePart((x) => x?.unique);
|
|
23
|
+
this.icon = this.#data.asObservablePart((x) => x?.documentType.icon);
|
|
24
|
+
this.isTrashed = this.#data.asObservablePart((x) => x?.isTrashed);
|
|
28
25
|
this.#name = new UmbStringState(undefined);
|
|
29
26
|
this.name = this.#name.asObservable();
|
|
30
|
-
this.#icon = new UmbStringState(undefined);
|
|
31
|
-
this.icon = this.#icon.asObservable();
|
|
32
27
|
this.#state = new UmbStringState(undefined);
|
|
33
28
|
this.state = this.#state.asObservable();
|
|
34
|
-
this.#isTrashed = new UmbBooleanState(undefined);
|
|
35
|
-
this.isTrashed = this.#isTrashed.asObservable();
|
|
36
29
|
this.#isDraft = new UmbBooleanState(undefined);
|
|
37
30
|
this.isDraft = this.#isDraft.asObservable();
|
|
38
|
-
this.consumeContext(
|
|
39
|
-
this.#
|
|
40
|
-
this.#
|
|
31
|
+
this.consumeContext(UMB_VARIANT_CONTEXT, (context) => {
|
|
32
|
+
this.#variantContext = context;
|
|
33
|
+
this.#observeVariantContext();
|
|
41
34
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
this
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
35
|
+
}
|
|
36
|
+
#observeVariantContext() {
|
|
37
|
+
this.observe(this.#variantContext?.displayCulture, (displayCulture) => {
|
|
38
|
+
if (displayCulture === undefined)
|
|
39
|
+
return;
|
|
40
|
+
this.#displayCulture = displayCulture;
|
|
41
|
+
this.#setVariantAwareValues();
|
|
42
|
+
}, 'umbObserveVariantId');
|
|
43
|
+
this.observe(this.#variantContext?.fallbackCulture, (fallbackCulture) => {
|
|
44
|
+
if (fallbackCulture === undefined)
|
|
45
|
+
return;
|
|
46
|
+
this.#fallbackCulture = fallbackCulture;
|
|
47
|
+
this.#setVariantAwareValues();
|
|
48
|
+
}, 'umbObserveFallbackCulture');
|
|
53
49
|
}
|
|
54
50
|
/**
|
|
55
51
|
* Get the current item
|
|
@@ -57,7 +53,7 @@ export class UmbDocumentItemDataResolver extends UmbControllerBase {
|
|
|
57
53
|
* @memberof UmbDocumentItemDataResolver
|
|
58
54
|
*/
|
|
59
55
|
getData() {
|
|
60
|
-
return this.#data;
|
|
56
|
+
return this.#data.getValue();
|
|
61
57
|
}
|
|
62
58
|
/**
|
|
63
59
|
* Set the current item
|
|
@@ -65,18 +61,7 @@ export class UmbDocumentItemDataResolver extends UmbControllerBase {
|
|
|
65
61
|
* @memberof UmbDocumentItemDataResolver
|
|
66
62
|
*/
|
|
67
63
|
setData(data) {
|
|
68
|
-
this.#data
|
|
69
|
-
if (!this.#data) {
|
|
70
|
-
this.#unique.setValue(undefined);
|
|
71
|
-
this.#name.setValue(undefined);
|
|
72
|
-
this.#icon.setValue(undefined);
|
|
73
|
-
this.#isTrashed.setValue(undefined);
|
|
74
|
-
this.#isDraft.setValue(undefined);
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
this.#unique.setValue(this.#data.unique);
|
|
78
|
-
this.#icon.setValue(this.#data.documentType.icon);
|
|
79
|
-
this.#isTrashed.setValue(this.#data.isTrashed);
|
|
64
|
+
this.#data.setValue(data);
|
|
80
65
|
this.#setVariantAwareValues();
|
|
81
66
|
}
|
|
82
67
|
/**
|
|
@@ -85,8 +70,7 @@ export class UmbDocumentItemDataResolver extends UmbControllerBase {
|
|
|
85
70
|
* @memberof UmbDocumentItemDataResolver
|
|
86
71
|
*/
|
|
87
72
|
async getUnique() {
|
|
88
|
-
await this
|
|
89
|
-
return this.#unique.getValue();
|
|
73
|
+
return await this.observe(this.unique).asPromise();
|
|
90
74
|
}
|
|
91
75
|
/**
|
|
92
76
|
* Get the name of the item
|
|
@@ -94,8 +78,7 @@ export class UmbDocumentItemDataResolver extends UmbControllerBase {
|
|
|
94
78
|
* @memberof UmbDocumentItemDataResolver
|
|
95
79
|
*/
|
|
96
80
|
async getName() {
|
|
97
|
-
await this
|
|
98
|
-
return this.#name.getValue() || '';
|
|
81
|
+
return (await this.observe(this.name).asPromise()) || '';
|
|
99
82
|
}
|
|
100
83
|
/**
|
|
101
84
|
* Get the icon of the item
|
|
@@ -103,8 +86,7 @@ export class UmbDocumentItemDataResolver extends UmbControllerBase {
|
|
|
103
86
|
* @memberof UmbDocumentItemDataResolver
|
|
104
87
|
*/
|
|
105
88
|
async getIcon() {
|
|
106
|
-
await this
|
|
107
|
-
return this.#data?.documentType.icon;
|
|
89
|
+
return await this.observe(this.icon).asPromise();
|
|
108
90
|
}
|
|
109
91
|
/**
|
|
110
92
|
* Get the state of the item
|
|
@@ -112,8 +94,8 @@ export class UmbDocumentItemDataResolver extends UmbControllerBase {
|
|
|
112
94
|
* @memberof UmbDocumentItemDataResolver
|
|
113
95
|
*/
|
|
114
96
|
async getState() {
|
|
115
|
-
await this.#
|
|
116
|
-
return
|
|
97
|
+
const variant = await this.#getCurrentVariant();
|
|
98
|
+
return variant?.state;
|
|
117
99
|
}
|
|
118
100
|
/**
|
|
119
101
|
* Get the isDraft of the item
|
|
@@ -121,8 +103,7 @@ export class UmbDocumentItemDataResolver extends UmbControllerBase {
|
|
|
121
103
|
* @memberof UmbDocumentItemDataResolver
|
|
122
104
|
*/
|
|
123
105
|
async getIsDraft() {
|
|
124
|
-
await this
|
|
125
|
-
return this.#isDraft.getValue() ?? false;
|
|
106
|
+
return (await this.observe(this.isDraft).asPromise()) ?? false;
|
|
126
107
|
}
|
|
127
108
|
/**
|
|
128
109
|
* Get the isTrashed of the item
|
|
@@ -130,44 +111,50 @@ export class UmbDocumentItemDataResolver extends UmbControllerBase {
|
|
|
130
111
|
* @memberof UmbDocumentItemDataResolver
|
|
131
112
|
*/
|
|
132
113
|
async getIsTrashed() {
|
|
133
|
-
await this
|
|
134
|
-
return this.#data?.isTrashed ?? false;
|
|
114
|
+
return (await this.observe(this.isTrashed).asPromise()) ?? false;
|
|
135
115
|
}
|
|
136
116
|
#setVariantAwareValues() {
|
|
117
|
+
if (!this.#variantContext)
|
|
118
|
+
return;
|
|
119
|
+
if (!this.#displayCulture)
|
|
120
|
+
return;
|
|
121
|
+
if (!this.#fallbackCulture)
|
|
122
|
+
return;
|
|
123
|
+
if (!this.#data)
|
|
124
|
+
return;
|
|
137
125
|
this.#setName();
|
|
138
126
|
this.#setIsDraft();
|
|
139
127
|
this.#setState();
|
|
140
128
|
}
|
|
141
|
-
#setName() {
|
|
142
|
-
const variant = this.#getCurrentVariant();
|
|
129
|
+
async #setName() {
|
|
130
|
+
const variant = await this.#getCurrentVariant();
|
|
143
131
|
if (variant) {
|
|
144
132
|
this.#name.setValue(variant.name);
|
|
145
133
|
return;
|
|
146
134
|
}
|
|
147
|
-
const fallbackName = this.#findVariant(this.#
|
|
135
|
+
const fallbackName = this.#findVariant(this.#fallbackCulture)?.name;
|
|
148
136
|
this.#name.setValue(`(${fallbackName})`);
|
|
149
137
|
}
|
|
150
|
-
#setIsDraft() {
|
|
151
|
-
const variant = this.#getCurrentVariant();
|
|
138
|
+
async #setIsDraft() {
|
|
139
|
+
const variant = await this.#getCurrentVariant();
|
|
152
140
|
const isDraft = variant?.state === UmbDocumentVariantState.DRAFT || false;
|
|
153
141
|
this.#isDraft.setValue(isDraft);
|
|
154
142
|
}
|
|
155
|
-
#setState() {
|
|
156
|
-
const variant = this.#getCurrentVariant();
|
|
143
|
+
async #setState() {
|
|
144
|
+
const variant = await this.#getCurrentVariant();
|
|
157
145
|
const state = variant?.state || UmbDocumentVariantState.NOT_CREATED;
|
|
158
146
|
this.#state.setValue(state);
|
|
159
147
|
}
|
|
160
148
|
#findVariant(culture) {
|
|
161
|
-
return this
|
|
149
|
+
return this.getData()?.variants.find((x) => x.culture === culture);
|
|
162
150
|
}
|
|
163
|
-
#getCurrentVariant() {
|
|
151
|
+
async #getCurrentVariant() {
|
|
164
152
|
if (this.#isInvariant()) {
|
|
165
|
-
return this
|
|
153
|
+
return this.getData()?.variants?.[0];
|
|
166
154
|
}
|
|
167
|
-
|
|
168
|
-
return this.#findVariant(culture);
|
|
155
|
+
return this.#findVariant(this.#displayCulture);
|
|
169
156
|
}
|
|
170
157
|
#isInvariant() {
|
|
171
|
-
return this
|
|
158
|
+
return this.getData()?.variants?.[0]?.culture === null;
|
|
172
159
|
}
|
|
173
160
|
}
|
|
@@ -7,6 +7,10 @@ export declare class UmbDocumentItemRefElement extends UmbLitElement {
|
|
|
7
7
|
set item(value: UmbDocumentItemModel | undefined);
|
|
8
8
|
readonly: boolean;
|
|
9
9
|
standalone: boolean;
|
|
10
|
+
selectOnly: boolean;
|
|
11
|
+
selectable: boolean;
|
|
12
|
+
selected: boolean;
|
|
13
|
+
disabled: boolean;
|
|
10
14
|
private _unique;
|
|
11
15
|
private _name;
|
|
12
16
|
private _icon;
|
|
@@ -11,6 +11,7 @@ import { customElement, html, ifDefined, nothing, property, state } from '@umbra
|
|
|
11
11
|
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
|
12
12
|
import { UmbModalRouteRegistrationController } from '@umbraco-cms/backoffice/router';
|
|
13
13
|
import { UMB_WORKSPACE_MODAL } from '@umbraco-cms/backoffice/workspace';
|
|
14
|
+
import { UmbDeselectedEvent, UmbSelectedEvent } from '@umbraco-cms/backoffice/event';
|
|
14
15
|
let UmbDocumentItemRefElement = class UmbDocumentItemRefElement extends UmbLitElement {
|
|
15
16
|
#item;
|
|
16
17
|
get item() {
|
|
@@ -24,6 +25,10 @@ let UmbDocumentItemRefElement = class UmbDocumentItemRefElement extends UmbLitEl
|
|
|
24
25
|
this.#item = new UmbDocumentItemDataResolver(this);
|
|
25
26
|
this.readonly = false;
|
|
26
27
|
this.standalone = false;
|
|
28
|
+
this.selectOnly = false;
|
|
29
|
+
this.selectable = false;
|
|
30
|
+
this.selected = false;
|
|
31
|
+
this.disabled = false;
|
|
27
32
|
this._unique = '';
|
|
28
33
|
this._name = '';
|
|
29
34
|
this._icon = '';
|
|
@@ -50,6 +55,14 @@ let UmbDocumentItemRefElement = class UmbDocumentItemRefElement extends UmbLitEl
|
|
|
50
55
|
const path = UMB_EDIT_DOCUMENT_WORKSPACE_PATH_PATTERN.generateLocal({ unique: this._unique });
|
|
51
56
|
return `${this._editPath}/${path}`;
|
|
52
57
|
}
|
|
58
|
+
#onSelected(event) {
|
|
59
|
+
event.stopPropagation();
|
|
60
|
+
this.dispatchEvent(new UmbSelectedEvent(this._unique));
|
|
61
|
+
}
|
|
62
|
+
#onDeselected(event) {
|
|
63
|
+
event.stopPropagation();
|
|
64
|
+
this.dispatchEvent(new UmbDeselectedEvent(this._unique));
|
|
65
|
+
}
|
|
53
66
|
render() {
|
|
54
67
|
if (!this.item)
|
|
55
68
|
return nothing;
|
|
@@ -58,7 +71,13 @@ let UmbDocumentItemRefElement = class UmbDocumentItemRefElement extends UmbLitEl
|
|
|
58
71
|
name=${this._name}
|
|
59
72
|
href=${ifDefined(this.#getHref())}
|
|
60
73
|
?readonly=${this.readonly}
|
|
61
|
-
?standalone=${this.standalone}
|
|
74
|
+
?standalone=${this.standalone}
|
|
75
|
+
?select-only=${this.selectOnly}
|
|
76
|
+
?selectable=${this.selectable}
|
|
77
|
+
?selected=${this.selected}
|
|
78
|
+
?disabled=${this.disabled}
|
|
79
|
+
@selected=${this.#onSelected}
|
|
80
|
+
@deselected=${this.#onDeselected}>
|
|
62
81
|
<slot name="actions" slot="actions"></slot>
|
|
63
82
|
${this.#renderIcon()}${this.#renderIsDraft()} ${this.#renderIsTrashed()}
|
|
64
83
|
</uui-ref-node>
|
|
@@ -84,11 +103,23 @@ __decorate([
|
|
|
84
103
|
property({ type: Object })
|
|
85
104
|
], UmbDocumentItemRefElement.prototype, "item", null);
|
|
86
105
|
__decorate([
|
|
87
|
-
property({ type: Boolean })
|
|
106
|
+
property({ type: Boolean, reflect: true })
|
|
88
107
|
], UmbDocumentItemRefElement.prototype, "readonly", void 0);
|
|
89
108
|
__decorate([
|
|
90
109
|
property({ type: Boolean })
|
|
91
110
|
], UmbDocumentItemRefElement.prototype, "standalone", void 0);
|
|
111
|
+
__decorate([
|
|
112
|
+
property({ type: Boolean, attribute: 'select-only', reflect: true })
|
|
113
|
+
], UmbDocumentItemRefElement.prototype, "selectOnly", void 0);
|
|
114
|
+
__decorate([
|
|
115
|
+
property({ type: Boolean, reflect: true })
|
|
116
|
+
], UmbDocumentItemRefElement.prototype, "selectable", void 0);
|
|
117
|
+
__decorate([
|
|
118
|
+
property({ type: Boolean, reflect: true })
|
|
119
|
+
], UmbDocumentItemRefElement.prototype, "selected", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
property({ type: Boolean, reflect: true })
|
|
122
|
+
], UmbDocumentItemRefElement.prototype, "disabled", void 0);
|
|
92
123
|
__decorate([
|
|
93
124
|
state()
|
|
94
125
|
], UmbDocumentItemRefElement.prototype, "_unique", void 0);
|
package/dist-cms/packages/documents/documents/picker/document-picker-search-result-item.element.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { UmbDocumentSearchItemModel } from '../search/types.js';
|
|
|
2
2
|
import { nothing } from '@umbraco-cms/backoffice/external/lit';
|
|
3
3
|
import { UmbPickerSearchResultItemElementBase } from '@umbraco-cms/backoffice/picker';
|
|
4
4
|
export declare class UmbDocumentPickerSearchResultItemElement extends UmbPickerSearchResultItemElementBase<UmbDocumentSearchItemModel> {
|
|
5
|
+
#private;
|
|
5
6
|
render(): typeof nothing | import("lit-html").TemplateResult<1>;
|
|
6
7
|
}
|
|
7
8
|
export { UmbDocumentPickerSearchResultItemElement as element };
|
package/dist-cms/packages/documents/documents/picker/document-picker-search-result-item.element.js
CHANGED
|
@@ -7,22 +7,28 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { customElement, html, nothing } from '@umbraco-cms/backoffice/external/lit';
|
|
8
8
|
import { UmbPickerSearchResultItemElementBase } from '@umbraco-cms/backoffice/picker';
|
|
9
9
|
let UmbDocumentPickerSearchResultItemElement = class UmbDocumentPickerSearchResultItemElement extends UmbPickerSearchResultItemElementBase {
|
|
10
|
+
#onSelected(event) {
|
|
11
|
+
if (event.unique !== this.item.unique)
|
|
12
|
+
return;
|
|
13
|
+
this.pickerContext?.selection.select(this.item.unique);
|
|
14
|
+
}
|
|
15
|
+
#onDeselected(event) {
|
|
16
|
+
if (event.unique !== this.item.unique)
|
|
17
|
+
return;
|
|
18
|
+
this.pickerContext?.selection.deselect(this.item.unique);
|
|
19
|
+
}
|
|
10
20
|
render() {
|
|
11
21
|
if (!this.item)
|
|
12
22
|
return nothing;
|
|
13
|
-
const item = this.item;
|
|
14
23
|
return html `
|
|
15
|
-
<umb-
|
|
16
|
-
|
|
17
|
-
id=${item.unique}
|
|
18
|
-
icon=${item.documentType.icon ?? 'icon-document'}
|
|
24
|
+
<umb-entity-item-ref
|
|
25
|
+
.item=${this.item}
|
|
19
26
|
select-only
|
|
20
27
|
?selectable=${!this.disabled}
|
|
21
28
|
?selected=${this._isSelected}
|
|
22
29
|
?disabled=${this.disabled}
|
|
23
|
-
@deselected=${
|
|
24
|
-
@selected=${
|
|
25
|
-
</umb-ref-item>
|
|
30
|
+
@deselected=${this.#onDeselected}
|
|
31
|
+
@selected=${this.#onSelected}></umb-entity-item-ref>
|
|
26
32
|
`;
|
|
27
33
|
}
|
|
28
34
|
};
|
|
@@ -4,6 +4,5 @@ import type { UmbDocumentTypeDetailModel } from '@umbraco-cms/backoffice/documen
|
|
|
4
4
|
import type { UmbVariantId } from '@umbraco-cms/backoffice/variant';
|
|
5
5
|
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
|
6
6
|
export declare class UmbDocumentPropertyDatasetContext extends UmbContentPropertyDatasetContext<UmbDocumentDetailModel, UmbDocumentTypeDetailModel, UmbDocumentVariantModel> {
|
|
7
|
-
#private;
|
|
8
7
|
constructor(host: UmbControllerHost, dataOwner: UmbDocumentWorkspaceContext, variantId?: UmbVariantId);
|
|
9
8
|
}
|
|
@@ -1,48 +1,6 @@
|
|
|
1
|
-
import { UMB_DOCUMENT_CONFIGURATION_CONTEXT } from '../global-contexts/index.js';
|
|
2
1
|
import { UmbContentPropertyDatasetContext } from '@umbraco-cms/backoffice/content';
|
|
3
|
-
import { observeMultiple } from '@umbraco-cms/backoffice/observable-api';
|
|
4
2
|
export class UmbDocumentPropertyDatasetContext extends UmbContentPropertyDatasetContext {
|
|
5
|
-
#dataSetVariantId;
|
|
6
|
-
#documentConfiguration;
|
|
7
|
-
#allowEditInvariantFromNonDefault = undefined;
|
|
8
3
|
constructor(host, dataOwner, variantId) {
|
|
9
4
|
super(host, dataOwner, variantId);
|
|
10
|
-
this.#dataSetVariantId = variantId;
|
|
11
|
-
this.consumeContext(UMB_DOCUMENT_CONFIGURATION_CONTEXT, async (context) => {
|
|
12
|
-
if (!context)
|
|
13
|
-
return;
|
|
14
|
-
this.#documentConfiguration = (await context?.getDocumentConfiguration()) ?? undefined;
|
|
15
|
-
this.#allowEditInvariantFromNonDefault = this.#documentConfiguration?.allowEditInvariantFromNonDefault;
|
|
16
|
-
if (this.#allowEditInvariantFromNonDefault === false) {
|
|
17
|
-
this.#preventEditInvariantFromNonDefault();
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
#preventEditInvariantFromNonDefault() {
|
|
22
|
-
this.observe(observeMultiple([this._dataOwner.structure.contentTypeProperties, this._dataOwner.variantOptions]), ([properties, variantOptions]) => {
|
|
23
|
-
if (properties.length === 0)
|
|
24
|
-
return;
|
|
25
|
-
if (variantOptions.length === 0)
|
|
26
|
-
return;
|
|
27
|
-
const currentVariantOption = variantOptions.find((option) => option.culture === this.#dataSetVariantId?.culture);
|
|
28
|
-
const isDefaultLanguage = currentVariantOption?.language.isDefault;
|
|
29
|
-
properties.forEach((property) => {
|
|
30
|
-
const unique = 'UMB_PREVENT_EDIT_INVARIANT_FROM_NON_DEFAULT_' + property.unique;
|
|
31
|
-
// Clean up the rule if it exists before adding a new one
|
|
32
|
-
this._dataOwner.propertyWriteGuard.removeRule(unique);
|
|
33
|
-
// If the property is invariant and not in the default language, we need to add a rule
|
|
34
|
-
if (!property.variesByCulture && !isDefaultLanguage) {
|
|
35
|
-
const rule = {
|
|
36
|
-
unique,
|
|
37
|
-
message: 'Shared properties can only be edited in the default language',
|
|
38
|
-
propertyType: {
|
|
39
|
-
unique: property.unique,
|
|
40
|
-
},
|
|
41
|
-
permitted: false,
|
|
42
|
-
};
|
|
43
|
-
this._dataOwner.propertyWriteGuard.addRule(rule);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
5
|
}
|
|
48
6
|
}
|
|
@@ -46,10 +46,20 @@ export class UmbDocumentPublishingWorkspaceContext extends UmbContextBase {
|
|
|
46
46
|
this.consumeContext(UMB_DOCUMENT_WORKSPACE_CONTEXT, async (context) => {
|
|
47
47
|
this.#documentWorkspaceContext = context;
|
|
48
48
|
this.#initPendingChanges();
|
|
49
|
-
})
|
|
49
|
+
})
|
|
50
|
+
.asPromise({ preventTimeout: true })
|
|
51
|
+
.catch(() => {
|
|
52
|
+
// If the context is not available, we can assume that the context is not available.
|
|
53
|
+
this.#documentWorkspaceContext = undefined;
|
|
54
|
+
}),
|
|
50
55
|
this.consumeContext(UMB_ACTION_EVENT_CONTEXT, async (context) => {
|
|
51
56
|
this.#eventContext = context;
|
|
52
|
-
})
|
|
57
|
+
})
|
|
58
|
+
.asPromise({ preventTimeout: true })
|
|
59
|
+
.catch(() => {
|
|
60
|
+
// If the context is not available, we can assume that the context is not available.
|
|
61
|
+
this.#eventContext = undefined;
|
|
62
|
+
}),
|
|
53
63
|
]);
|
|
54
64
|
this.consumeContext(UMB_NOTIFICATION_CONTEXT, (context) => {
|
|
55
65
|
this.#notificationContext = context;
|
|
@@ -25,9 +25,10 @@ export class UmbDocumentSearchServerDataSource {
|
|
|
25
25
|
async search(args) {
|
|
26
26
|
const { data, error } = await tryExecute(this.#host, DocumentService.getItemDocumentSearch({
|
|
27
27
|
query: {
|
|
28
|
-
query: args.query,
|
|
29
|
-
parentId: args.searchFrom?.unique ?? undefined,
|
|
30
28
|
allowedDocumentTypes: args.allowedContentTypes?.map((contentType) => contentType.unique),
|
|
29
|
+
culture: args.culture || undefined,
|
|
30
|
+
parentId: args.searchFrom?.unique ?? undefined,
|
|
31
|
+
query: args.query,
|
|
31
32
|
trashed: args.includeTrashed,
|
|
32
33
|
},
|
|
33
34
|
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const UMB_DOCUMENT_GLOBAL_SEARCH_ALIAS = "Umb.GlobalSearch.Document";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const UMB_DOCUMENT_GLOBAL_SEARCH_ALIAS = 'Umb.GlobalSearch.Document';
|
package/dist-cms/packages/documents/documents/search/global-search/document-global-search.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { UmbDocumentSearchProvider } from '../document.search-provider.js';
|
|
2
|
+
import { UmbGlobalSearchBase, type UmbGlobalSearchApi, type UmbSearchRequestArgs } from '@umbraco-cms/backoffice/search';
|
|
3
|
+
export declare class UmbDocumentGlobalSearch extends UmbGlobalSearchBase<UmbDocumentSearchProvider> implements UmbGlobalSearchApi {
|
|
4
|
+
search(args: UmbSearchRequestArgs): Promise<import("@umbraco-cms/backoffice/repository").UmbRepositoryResponse<import("@umbraco-cms/backoffice/repository").UmbPagedModel<import("../types.js").UmbDocumentSearchItemModel>>>;
|
|
5
|
+
}
|
|
6
|
+
export { UmbDocumentGlobalSearch as api };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UmbGlobalSearchBase, } from '@umbraco-cms/backoffice/search';
|
|
2
|
+
import { UMB_VARIANT_CONTEXT } from '@umbraco-cms/backoffice/variant';
|
|
3
|
+
export class UmbDocumentGlobalSearch extends UmbGlobalSearchBase {
|
|
4
|
+
async search(args) {
|
|
5
|
+
await this._init;
|
|
6
|
+
if (!this._searchProvider) {
|
|
7
|
+
throw new Error('Search provider is not available');
|
|
8
|
+
}
|
|
9
|
+
// TODO: change this to consume so we don't emit context events for every search change [MR]
|
|
10
|
+
const variantContext = await this.getContext(UMB_VARIANT_CONTEXT);
|
|
11
|
+
const displayCulture = await variantContext?.getDisplayCulture();
|
|
12
|
+
return await this._searchProvider.search({ culture: displayCulture, query: args.query });
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export { UmbDocumentGlobalSearch as api };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const manifests: Array<UmbExtensionManifest>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { UMB_DOCUMENT_SEARCH_PROVIDER_ALIAS } from '../constants.js';
|
|
2
|
+
import { UMB_DOCUMENT_GLOBAL_SEARCH_ALIAS } from './constants.js';
|
|
3
|
+
import { UMB_SECTION_USER_PERMISSION_CONDITION_ALIAS } from '@umbraco-cms/backoffice/section';
|
|
4
|
+
import { UMB_CONTENT_SECTION_ALIAS } from '@umbraco-cms/backoffice/content';
|
|
5
|
+
export const manifests = [
|
|
6
|
+
{
|
|
7
|
+
name: 'Document Global Search',
|
|
8
|
+
alias: UMB_DOCUMENT_GLOBAL_SEARCH_ALIAS,
|
|
9
|
+
type: 'globalSearch',
|
|
10
|
+
weight: 800,
|
|
11
|
+
api: () => import('./document-global-search.js'),
|
|
12
|
+
meta: {
|
|
13
|
+
label: 'Documents',
|
|
14
|
+
searchProviderAlias: UMB_DOCUMENT_SEARCH_PROVIDER_ALIAS,
|
|
15
|
+
},
|
|
16
|
+
conditions: [
|
|
17
|
+
{
|
|
18
|
+
alias: UMB_SECTION_USER_PERMISSION_CONDITION_ALIAS,
|
|
19
|
+
match: UMB_CONTENT_SECTION_ALIAS,
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UMB_DOCUMENT_ENTITY_TYPE } from '../entity.js';
|
|
2
2
|
import { UMB_DOCUMENT_SEARCH_PROVIDER_ALIAS } from './constants.js';
|
|
3
|
+
import { manifests as globalSearchManifests } from './global-search/manifests.js';
|
|
3
4
|
export const manifests = [
|
|
4
5
|
{
|
|
5
6
|
name: 'Document Search Provider',
|
|
@@ -18,4 +19,5 @@ export const manifests = [
|
|
|
18
19
|
element: () => import('./document-search-result-item.element.js'),
|
|
19
20
|
forEntityTypes: [UMB_DOCUMENT_ENTITY_TYPE],
|
|
20
21
|
},
|
|
22
|
+
...globalSearchManifests,
|
|
21
23
|
];
|
|
@@ -12,6 +12,7 @@ export type * from './modals/types.js';
|
|
|
12
12
|
export type * from './publishing/types.js';
|
|
13
13
|
export type * from './recycle-bin/types.js';
|
|
14
14
|
export type * from './tree/types.js';
|
|
15
|
+
export type * from './url/types.js';
|
|
15
16
|
export type * from './user-permissions/types.js';
|
|
16
17
|
export type * from './workspace/types.js';
|
|
17
18
|
export interface UmbDocumentDetailModel extends UmbContentDetailModel {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { UmbDocumentUrlModel } from './repository/types.js';
|
|
2
|
+
import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
|
|
3
|
+
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
|
4
|
+
/**
|
|
5
|
+
* A controller for resolving data for document urls
|
|
6
|
+
* @exports
|
|
7
|
+
* @class UmbDocumentUrlsDataResolver
|
|
8
|
+
* @augments {UmbControllerBase}
|
|
9
|
+
*/
|
|
10
|
+
export declare class UmbDocumentUrlsDataResolver extends UmbControllerBase {
|
|
11
|
+
#private;
|
|
12
|
+
/**
|
|
13
|
+
* The urls for the current culture
|
|
14
|
+
* @returns {ObservableArray<UmbDocumentUrlModel>} The urls for the current culture
|
|
15
|
+
* @memberof UmbDocumentUrlsDataResolver
|
|
16
|
+
*/
|
|
17
|
+
readonly urls: import("rxjs").Observable<UmbDocumentUrlModel[]>;
|
|
18
|
+
constructor(host: UmbControllerHost);
|
|
19
|
+
/**
|
|
20
|
+
* Get the current data
|
|
21
|
+
* @returns {Array<UmbDocumentUrlModel> | undefined} The current data
|
|
22
|
+
* @memberof UmbDocumentUrlsDataResolver
|
|
23
|
+
*/
|
|
24
|
+
getData(): Array<UmbDocumentUrlModel> | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Set the current data
|
|
27
|
+
* @param {Array<UmbDocumentUrlModel> | undefined} data The current data
|
|
28
|
+
* @memberof UmbDocumentUrlsDataResolver
|
|
29
|
+
*/
|
|
30
|
+
setData(data: Array<UmbDocumentUrlModel> | undefined): void;
|
|
31
|
+
/**
|
|
32
|
+
* Get the urls for the current culture
|
|
33
|
+
* @returns {(Promise<Array<UmbDocumentUrlModel> | []>)} The urls for the current culture
|
|
34
|
+
* @memberof UmbDocumentUrlsDataResolver
|
|
35
|
+
*/
|
|
36
|
+
getUrls(): Promise<Array<UmbDocumentUrlModel> | []>;
|
|
37
|
+
}
|