@umbraco-cms/backoffice 17.8.1 → 17.9.0-rc
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/custom-elements.json +504 -245
- package/dist-cms/apps/app/app-auth.controller.d.ts +8 -0
- package/dist-cms/apps/app/app-auth.controller.js +48 -2
- package/dist-cms/apps/app/app.element.js +11 -1
- package/dist-cms/assets/lang/da.js +3 -0
- package/dist-cms/assets/lang/en.js +5 -0
- package/dist-cms/assets/lang/nb.js +1 -0
- package/dist-cms/assets/lang/pt.js +1 -0
- package/dist-cms/assets/lang/vi.js +1 -0
- package/dist-cms/external/uui/package.json +1 -1
- package/dist-cms/libs/extension-api/functions/has-init-export.function.d.ts +1 -1
- package/dist-cms/libs/extension-api/functions/has-init-export.function.js +1 -1
- package/dist-cms/libs/extension-api/functions/has-on-unload-export.function.d.ts +1 -1
- package/dist-cms/libs/extension-api/functions/has-on-unload-export.function.js +1 -1
- package/dist-cms/libs/extension-api/models/entry-point.interface.d.ts +1 -2
- package/dist-cms/packages/block/block/components/block-ref-name-slot/block-ref-name-slot.mixin.d.ts +32 -0
- package/dist-cms/packages/block/block/components/block-ref-name-slot/block-ref-name-slot.mixin.js +67 -0
- package/dist-cms/packages/block/block/components/index.d.ts +1 -0
- package/dist-cms/packages/block/block/components/index.js +1 -0
- package/dist-cms/packages/block/block/context/block-manager.context.js +2 -1
- package/dist-cms/packages/block/block/property-value-resolver/block-value-resolver.api.js +2 -1
- package/dist-cms/packages/block/block/utils/block-expose-sort-compare.function.d.ts +10 -0
- package/dist-cms/packages/block/block/utils/block-expose-sort-compare.function.js +17 -0
- package/dist-cms/packages/block/block/workspace/block-element-manager.js +3 -3
- package/dist-cms/packages/block/block-grid/components/block-grid-block/block-grid-block.element.d.ts +7 -5
- package/dist-cms/packages/block/block-grid/components/block-grid-block/block-grid-block.element.js +11 -24
- package/dist-cms/packages/block/block-grid/components/block-grid-block-inline/block-grid-block-inline.element.d.ts +7 -3
- package/dist-cms/packages/block/block-grid/components/block-grid-block-inline/block-grid-block-inline.element.js +11 -19
- package/dist-cms/packages/block/block-grid/components/block-grid-entries/block-grid-entries.element.js +3 -3
- package/dist-cms/packages/block/block-grid/components/block-grid-entry/block-grid-entry.element.d.ts +2 -2
- package/dist-cms/packages/block/block-grid/components/block-grid-entry/block-grid-entry.element.js +11 -6
- package/dist-cms/packages/block/block-grid/property-editors/block-grid-editor/Umbraco.BlockGrid.js +1 -1
- package/dist-cms/packages/block/block-list/components/block-list-entry/block-list-entry.element.d.ts +1 -1
- package/dist-cms/packages/block/block-list/components/block-list-entry/block-list-entry.element.js +3 -13
- package/dist-cms/packages/block/block-list/components/inline-list-block/inline-list-block.element.d.ts +3 -9
- package/dist-cms/packages/block/block-list/components/inline-list-block/inline-list-block.element.js +37 -67
- package/dist-cms/packages/block/block-list/components/ref-list-block/ref-list-block.element.d.ts +3 -10
- package/dist-cms/packages/block/block-list/components/ref-list-block/ref-list-block.element.js +4 -44
- package/dist-cms/packages/block/block-list/property-editors/block-list-editor/Umbraco.BlockList.js +1 -1
- package/dist-cms/packages/block/block-list/property-editors/block-list-editor/property-editor-ui-block-list.element.js +2 -2
- package/dist-cms/packages/block/block-rte/components/block-rte-entry/block-rte-entry.element.d.ts +1 -1
- package/dist-cms/packages/block/block-rte/components/block-rte-entry/block-rte-entry.element.js +12 -6
- package/dist-cms/packages/block/block-rte/components/ref-rte-block/ref-rte-block.element.d.ts +3 -4
- package/dist-cms/packages/block/block-rte/components/ref-rte-block/ref-rte-block.element.js +10 -26
- package/dist-cms/packages/block/block-rte/context/block-rte-entry.context.js +1 -1
- package/dist-cms/packages/block/block-single/components/block-single-entry/block-single-entry.element.d.ts +3 -4
- package/dist-cms/packages/block/block-single/components/block-single-entry/block-single-entry.element.js +58 -48
- package/dist-cms/packages/block/block-single/components/inline-single-block/inline-single-block.element.d.ts +4 -3
- package/dist-cms/packages/block/block-single/components/inline-single-block/inline-single-block.element.js +27 -32
- package/dist-cms/packages/block/block-single/components/ref-single-block/ref-single-block.element.d.ts +7 -5
- package/dist-cms/packages/block/block-single/components/ref-single-block/ref-single-block.element.js +14 -27
- package/dist-cms/packages/content/content/controller/merge-content-variant-data.controller.js +5 -3
- package/dist-cms/packages/content/content/index.d.ts +1 -0
- package/dist-cms/packages/content/content/index.js +1 -0
- package/dist-cms/packages/content/content/manager/content-data-manager.d.ts +0 -1
- package/dist-cms/packages/content/content/manager/content-data-manager.js +2 -17
- package/dist-cms/packages/content/content/manager/element-data-manager.d.ts +0 -1
- package/dist-cms/packages/content/content/manager/element-data-manager.js +1 -25
- package/dist-cms/packages/content/content/rollback/modal/content-rollback-modal.element.js +9 -3
- package/dist-cms/packages/content/content/rollback/types.d.ts +1 -0
- package/dist-cms/packages/content/content/utils/append-content-value.function.d.ts +14 -0
- package/dist-cms/packages/content/content/utils/append-content-value.function.js +23 -0
- package/dist-cms/packages/content/content/utils/index.d.ts +1 -0
- package/dist-cms/packages/content/content/utils/index.js +1 -0
- package/dist-cms/packages/content/content/utils/sort-content-values-by-variant.function.d.ts +11 -0
- package/dist-cms/packages/content/content/utils/sort-content-values-by-variant.function.js +20 -0
- package/dist-cms/packages/content/content/workspace/content-detail-workspace-base.d.ts +6 -0
- package/dist-cms/packages/content/content/workspace/content-detail-workspace-base.js +15 -3
- package/dist-cms/packages/content/content/workspace/content-type-variance-change-redirect.controller.d.ts +32 -0
- package/dist-cms/packages/content/content/workspace/content-type-variance-change-redirect.controller.js +77 -0
- package/dist-cms/packages/content/content/workspace/resolve-stale-variant-route.function.d.ts +40 -0
- package/dist-cms/packages/content/content/workspace/resolve-stale-variant-route.function.js +63 -0
- package/dist-cms/packages/content/content-type/global-components/content-type-workspace-editor-header.element.d.ts +1 -0
- package/dist-cms/packages/content/content-type/global-components/content-type-workspace-editor-header.element.js +24 -1
- package/dist-cms/packages/content/content-type/global-components/input-content-type-collection-configuration/input-content-type-collection-configuration.element.d.ts +7 -0
- package/dist-cms/packages/content/content-type/global-components/input-content-type-collection-configuration/input-content-type-collection-configuration.element.js +25 -8
- package/dist-cms/packages/content/content-type/workspace/views/design/content-type-design-editor-group.element.d.ts +7 -0
- package/dist-cms/packages/content/content-type/workspace/views/design/content-type-design-editor-group.element.js +15 -3
- package/dist-cms/packages/content/content-type/workspace/views/design/content-type-design-editor-properties.element.d.ts +8 -0
- package/dist-cms/packages/content/content-type/workspace/views/design/content-type-design-editor-properties.element.js +29 -1
- package/dist-cms/packages/content/content-type/workspace/views/design/content-type-design-editor-property.element.d.ts +7 -0
- package/dist-cms/packages/content/content-type/workspace/views/design/content-type-design-editor-property.element.js +15 -7
- package/dist-cms/packages/content/content-type/workspace/views/design/content-type-design-editor-tab.element.d.ts +8 -0
- package/dist-cms/packages/content/content-type/workspace/views/design/content-type-design-editor-tab.element.js +31 -2
- package/dist-cms/packages/content/content-type/workspace/views/design/content-type-design-editor.element.d.ts +1 -0
- package/dist-cms/packages/content/content-type/workspace/views/design/content-type-design-editor.element.js +26 -7
- package/dist-cms/packages/core/auth/auth-provider.extension.d.ts +7 -7
- package/dist-cms/packages/core/auth/auth.context.d.ts +23 -0
- package/dist-cms/packages/core/auth/auth.context.js +145 -23
- package/dist-cms/packages/core/auth/controllers/auth-session-timeout.controller.js +29 -1
- package/dist-cms/packages/core/auth/modals/umb-app-auth-modal.element.js +5 -0
- package/dist-cms/packages/core/backend-api/types.gen.d.ts +1 -0
- package/dist-cms/packages/core/collection/default/collection-default.context.d.ts +8 -0
- package/dist-cms/packages/core/collection/default/collection-default.context.js +26 -6
- package/dist-cms/packages/core/components/dropdown/dropdown.element.js +6 -3
- package/dist-cms/packages/core/components/entity-actions-bundle/entity-actions-bundle.element.d.ts +0 -1
- package/dist-cms/packages/core/components/entity-actions-bundle/entity-actions-bundle.element.js +1 -8
- package/dist-cms/packages/core/components/input-entity/input-entity.element.d.ts +6 -6
- package/dist-cms/packages/core/components/input-entity/input-entity.element.js +28 -37
- package/dist-cms/packages/core/components/input-time-zone/input-time-zone.element.d.ts +6 -2
- package/dist-cms/packages/core/components/input-time-zone/input-time-zone.element.js +13 -19
- package/dist-cms/packages/core/components/input-with-alias/input-with-alias.element.d.ts +4 -0
- package/dist-cms/packages/core/components/input-with-alias/input-with-alias.element.js +5 -0
- package/dist-cms/packages/core/components/multiple-color-picker-input/multiple-color-picker-input.element.d.ts +6 -6
- package/dist-cms/packages/core/components/multiple-color-picker-input/multiple-color-picker-input.element.js +9 -18
- package/dist-cms/packages/core/components/multiple-text-string-input/input-multiple-text-string.element.js +6 -4
- package/dist-cms/packages/core/entity-action/default/types.d.ts +0 -1
- package/dist-cms/packages/core/entity-action/global-components/entity-actions-dropdown/entity-actions-dropdown.element.js +2 -5
- package/dist-cms/packages/core/entity-bulk-action/entity-bulk-action.element.js +13 -1
- package/dist-cms/packages/core/entity-create-option-action/entity-create-option-action.extension.d.ts +0 -1
- package/dist-cms/packages/core/extension-registry/extensions/mfa-login-provider.extension.d.ts +1 -1
- package/dist-cms/packages/core/menu/menu-tree-structure-workspace-context-base.js +5 -1
- package/dist-cms/packages/core/menu/menu-tree-structure-workspace-context.test-utils.d.ts +2 -0
- package/dist-cms/packages/core/menu/menu-tree-structure-workspace-context.test-utils.js +5 -0
- package/dist-cms/packages/core/menu/menu-variant-tree-structure-workspace-context-base.js +5 -1
- package/dist-cms/packages/core/menu/menu-variant-tree-structure-workspace-context.test-utils.d.ts +2 -0
- package/dist-cms/packages/core/menu/menu-variant-tree-structure-workspace-context.test-utils.js +5 -0
- package/dist-cms/packages/core/modal/common/discard-changes/discard-changes-modal.element.js +6 -1
- package/dist-cms/packages/core/notification/notification-handler.d.ts +1 -1
- package/dist-cms/packages/core/notification/notification-handler.js +2 -1
- package/dist-cms/packages/core/property-editor/extensions/property-editor-ui.extension.d.ts +0 -1
- package/dist-cms/packages/core/property-editor-data-source/input/input-property-editor-data-source.element.d.ts +6 -6
- package/dist-cms/packages/core/property-editor-data-source/input/input-property-editor-data-source.element.js +15 -19
- package/dist-cms/packages/core/repository/repository-details.manager.d.ts +3 -1
- package/dist-cms/packages/core/repository/repository-details.manager.js +17 -2
- package/dist-cms/packages/core/resources/api-interceptor.controller.d.ts +2 -1
- package/dist-cms/packages/core/resources/api-interceptor.controller.js +23 -18
- package/dist-cms/packages/core/resources/resource.controller.js +1 -1
- package/dist-cms/packages/core/resources/try-execute/api-error-was-notified.function.js +8 -7
- package/dist-cms/packages/core/resources/types.d.ts +5 -0
- package/dist-cms/packages/core/resources/umb-error.js +3 -3
- package/dist-cms/packages/core/section/components/input-section/input-section.element.d.ts +6 -6
- package/dist-cms/packages/core/section/components/input-section/input-section.element.js +6 -19
- package/dist-cms/packages/core/server/server.context.d.ts +6 -1
- package/dist-cms/packages/core/server/server.context.js +6 -1
- package/dist-cms/packages/core/sorter/sorter.controller.js +1 -1
- package/dist-cms/packages/core/validation/components/form-validation-message.element.js +2 -1
- package/dist-cms/packages/core/validation/const.d.ts +1 -0
- package/dist-cms/packages/core/validation/const.js +1 -0
- package/dist-cms/packages/core/validation/context/server-model-validator.context.js +11 -1
- package/dist-cms/packages/core/validation/utils/index.d.ts +1 -0
- package/dist-cms/packages/core/validation/utils/index.js +1 -0
- package/dist-cms/packages/core/validation/utils/is-above-zero-and-below-minimum.function.d.ts +7 -0
- package/dist-cms/packages/core/validation/utils/is-above-zero-and-below-minimum.function.js +9 -0
- package/dist-cms/packages/core/variant/index.d.ts +1 -0
- package/dist-cms/packages/core/variant/index.js +1 -0
- package/dist-cms/packages/core/variant/variant-object-sort-compare.function.d.ts +22 -0
- package/dist-cms/packages/core/variant/variant-object-sort-compare.function.js +29 -0
- package/dist-cms/packages/core/workspace/components/workspace-action/common/submit/submit.action.js +21 -11
- package/dist-cms/packages/core/workspace/components/workspace-header-name-editable/workspace-header-name-editable.element.d.ts +1 -0
- package/dist-cms/packages/core/workspace/components/workspace-header-name-editable/workspace-header-name-editable.element.js +26 -3
- package/dist-cms/packages/core/workspace/contexts/tokens/submittable-workspace-context.interface.d.ts +2 -0
- package/dist-cms/packages/core/workspace/controllers/resolve-stale-variant-route.function.d.ts +3 -0
- package/dist-cms/packages/core/workspace/controllers/resolve-stale-variant-route.function.js +7 -0
- package/dist-cms/packages/core/workspace/controllers/workspace-stale-variant-redirect.controller.d.ts +3 -0
- package/dist-cms/packages/core/workspace/controllers/workspace-stale-variant-redirect.controller.js +8 -0
- package/dist-cms/packages/core/workspace/entity-detail/entity-detail-workspace-base.d.ts +8 -1
- package/dist-cms/packages/core/workspace/entity-detail/entity-detail-workspace-base.js +13 -1
- package/dist-cms/packages/core/workspace/entity-detail/global-components/entity-detail-workspace-editor.element.js +1 -1
- package/dist-cms/packages/core/workspace/extensions/workspace-action-menu-item.model.d.ts +1 -1
- package/dist-cms/packages/core/workspace/namable/namable-workspace-context.interface.d.ts +2 -0
- package/dist-cms/packages/core/workspace/workspace-property-dataset/invariant-workspace-property-dataset-context.d.ts +2 -1
- package/dist-cms/packages/core/workspace/workspace-property-dataset/invariant-workspace-property-dataset-context.js +6 -1
- package/dist-cms/packages/data-type/components/data-type-input/data-type-input.element.d.ts +6 -6
- package/dist-cms/packages/data-type/components/data-type-input/data-type-input.element.js +27 -34
- package/dist-cms/packages/data-type/workspace/views/details/data-type-details-workspace-property-editor-picker.element.d.ts +1 -0
- package/dist-cms/packages/data-type/workspace/views/details/data-type-details-workspace-property-editor-picker.element.js +19 -6
- package/dist-cms/packages/data-type/workspace/views/details/data-type-details-workspace-view.element.d.ts +1 -0
- package/dist-cms/packages/data-type/workspace/views/details/data-type-details-workspace-view.element.js +8 -0
- package/dist-cms/packages/dictionary/workspace/views/workspace-view-dictionary-editor.element.d.ts +1 -0
- package/dist-cms/packages/dictionary/workspace/views/workspace-view-dictionary-editor.element.js +7 -0
- package/dist-cms/packages/documents/document-blueprints/workspace/document-blueprint-workspace-editor.element.js +1 -9
- package/dist-cms/packages/documents/document-blueprints/workspace/views/info/document-blueprint-workspace-view-info.element.js +1 -0
- package/dist-cms/packages/documents/document-types/components/input-document-type/input-document-type.element.d.ts +8 -7
- package/dist-cms/packages/documents/document-types/components/input-document-type/input-document-type.element.js +28 -20
- package/dist-cms/packages/documents/document-types/workspace/document-type/views/settings/document-type-workspace-view-settings.element.d.ts +1 -0
- package/dist-cms/packages/documents/document-types/workspace/document-type/views/settings/document-type-workspace-view-settings.element.js +13 -1
- package/dist-cms/packages/documents/document-types/workspace/document-type/views/structure/document-type-workspace-view-structure.element.d.ts +1 -0
- package/dist-cms/packages/documents/document-types/workspace/document-type/views/structure/document-type-workspace-view-structure.element.js +8 -0
- package/dist-cms/packages/documents/document-types/workspace/document-type/views/templates/document-type-workspace-view-templates.element.d.ts +1 -0
- package/dist-cms/packages/documents/document-types/workspace/document-type/views/templates/document-type-workspace-view-templates.element.js +6 -0
- package/dist-cms/packages/documents/documents/components/input-document/input-document.element.d.ts +6 -6
- package/dist-cms/packages/documents/documents/components/input-document/input-document.element.js +11 -19
- package/dist-cms/packages/documents/documents/entity-actions/move-to/repository/document-move.server.data-source.js +1 -1
- package/dist-cms/packages/documents/documents/entity-bulk-actions/move-to/repository/move-to.repository.js +5 -2
- package/dist-cms/packages/documents/documents/publishing/schedule-publish/modal/document-schedule-modal.element.d.ts +1 -0
- package/dist-cms/packages/documents/documents/publishing/schedule-publish/modal/document-schedule-modal.element.js +62 -19
- package/dist-cms/packages/documents/documents/publishing/schedule-publish/modal/document-schedule-modal.token.d.ts +5 -0
- package/dist-cms/packages/documents/documents/publishing/schedule-publish/modal/mirror-schedules.function.d.ts +9 -0
- package/dist-cms/packages/documents/documents/publishing/schedule-publish/modal/mirror-schedules.function.js +13 -0
- package/dist-cms/packages/documents/documents/publishing/workspace-context/document-publishing.workspace-context.js +13 -0
- package/dist-cms/packages/documents/documents/rollback/modal/rollback-modal.element.js +9 -3
- package/dist-cms/packages/documents/documents/rollback/repository/rollback.repository.js +1 -0
- package/dist-cms/packages/documents/documents/user-permissions/document-property-value/workspace-context/property-value-user-permission-workspace-context-base.d.ts +1 -0
- package/dist-cms/packages/documents/documents/user-permissions/document-property-value/workspace-context/property-value-user-permission-workspace-context-base.js +20 -1
- package/dist-cms/packages/documents/documents/workspace/context/document-workspace.context.d.ts +1 -0
- package/dist-cms/packages/documents/documents/workspace/context/document-workspace.context.js +11 -1
- package/dist-cms/packages/documents/documents/workspace/document-workspace-editor.element.js +1 -9
- package/dist-cms/packages/documents/documents/workspace/views/info/document-workspace-view-info.element.js +1 -0
- package/dist-cms/packages/language/components/input-language/input-language.element.d.ts +6 -6
- package/dist-cms/packages/language/components/input-language/input-language.element.js +15 -19
- package/dist-cms/packages/language/workspace/language/views/language-details-workspace-view.element.d.ts +1 -0
- package/dist-cms/packages/language/workspace/language/views/language-details-workspace-view.element.js +9 -0
- package/dist-cms/packages/management-api/detail/cache-invalidation.manager.js +12 -1
- package/dist-cms/packages/management-api/detail/cache.d.ts +17 -0
- package/dist-cms/packages/management-api/detail/cache.js +25 -0
- package/dist-cms/packages/management-api/detail/detail-data.request-manager.js +5 -25
- package/dist-cms/packages/management-api/item/cache-invalidation.manager.js +12 -1
- package/dist-cms/packages/management-api/item/cache.d.ts +17 -0
- package/dist-cms/packages/management-api/item/cache.js +25 -0
- package/dist-cms/packages/management-api/item/item-data.request-manager.js +2 -22
- package/dist-cms/packages/media/media/collection/media-collection.context.d.ts +2 -1
- package/dist-cms/packages/media/media/collection/media-collection.context.js +5 -16
- package/dist-cms/packages/media/media/components/input-media/input-media.element.d.ts +6 -6
- package/dist-cms/packages/media/media/components/input-media/input-media.element.js +11 -19
- package/dist-cms/packages/media/media/components/input-rich-media/input-rich-media.element.d.ts +8 -7
- package/dist-cms/packages/media/media/components/input-rich-media/input-rich-media.element.js +35 -34
- package/dist-cms/packages/media/media/dropzone/media-dropzone.manager.js +54 -29
- package/dist-cms/packages/media/media/dropzone/modals/dropzone-media-type-picker/dropzone-media-type-picker-modal.element.js +43 -15
- package/dist-cms/packages/media/media/property-editors/media-picker/Umbraco.MediaPicker.js +1 -1
- package/dist-cms/packages/media/media-types/components/input-media-type/input-media-type.element.d.ts +14 -6
- package/dist-cms/packages/media/media-types/components/input-media-type/input-media-type.element.js +49 -26
- package/dist-cms/packages/media/media-types/workspace/views/structure/media-type-workspace-view-structure.element.d.ts +1 -0
- package/dist-cms/packages/media/media-types/workspace/views/structure/media-type-workspace-view-structure.element.js +8 -0
- package/dist-cms/packages/members/member/components/input-member/input-member.element.d.ts +6 -6
- package/dist-cms/packages/members/member/components/input-member/input-member.element.js +11 -19
- package/dist-cms/packages/members/member-group/components/input-member-group/input-member-group.element.d.ts +6 -6
- package/dist-cms/packages/members/member-group/components/input-member-group/input-member-group.element.js +21 -22
- package/dist-cms/packages/members/member-type/components/input-member-type/input-member-type.element.d.ts +6 -6
- package/dist-cms/packages/members/member-type/components/input-member-type/input-member-type.element.js +6 -19
- package/dist-cms/packages/multi-url-picker/components/input-multi-url/input-multi-url.element.d.ts +8 -7
- package/dist-cms/packages/multi-url-picker/components/input-multi-url/input-multi-url.element.js +23 -20
- package/dist-cms/packages/multi-url-picker/property-editor/Umbraco.MultiUrlPicker.js +1 -1
- package/dist-cms/packages/performance-profiling/dashboard-performance-profiling.element.d.ts +3 -3
- package/dist-cms/packages/performance-profiling/dashboard-performance-profiling.element.js +20 -8
- package/dist-cms/packages/property-editors/content-picker/Umbraco.MultiNodeTreePicker.js +1 -1
- package/dist-cms/packages/property-editors/content-picker/components/input-content/input-content.element.d.ts +6 -6
- package/dist-cms/packages/property-editors/content-picker/components/input-content/input-content.element.js +1 -15
- package/dist-cms/packages/property-editors/content-picker/property-editor-ui-content-picker.element.d.ts +0 -2
- package/dist-cms/packages/property-editors/content-picker/property-editor-ui-content-picker.element.js +0 -12
- package/dist-cms/packages/property-editors/entity-data-picker/input/input-entity-data.element.d.ts +6 -6
- package/dist-cms/packages/property-editors/entity-data-picker/input/input-entity-data.element.js +11 -19
- package/dist-cms/packages/property-editors/entity-data-picker/property-editor/Umbraco.EntityDataPicker.js +1 -0
- package/dist-cms/packages/property-editors/entity-data-picker/property-editor/entity-data-picker-property-editor-ui.element.d.ts +0 -2
- package/dist-cms/packages/property-editors/entity-data-picker/property-editor/entity-data-picker-property-editor-ui.element.js +0 -12
- package/dist-cms/packages/property-editors/multiple-text-string/Umbraco.MultipleTextString.js +1 -1
- package/dist-cms/packages/static-file/components/input-static-file/input-static-file.element.d.ts +6 -6
- package/dist-cms/packages/static-file/components/input-static-file/input-static-file.element.js +7 -21
- package/dist-cms/packages/templating/partial-views/workspace/manifests.js +1 -5
- package/dist-cms/packages/templating/partial-views/workspace/partial-view-workspace-editor.element.d.ts +1 -5
- package/dist-cms/packages/templating/partial-views/workspace/partial-view-workspace-editor.element.js +4 -14
- package/dist-cms/packages/templating/partial-views/workspace/partial-view-workspace.context.d.ts +1 -0
- package/dist-cms/packages/templating/partial-views/workspace/partial-view-workspace.context.js +24 -0
- package/dist-cms/packages/templating/partial-views/workspace/views/code-editor/partial-view-code-editor-workspace-view.element.d.ts +1 -5
- package/dist-cms/packages/templating/partial-views/workspace/views/code-editor/partial-view-code-editor-workspace-view.element.js +6 -16
- package/dist-cms/packages/templating/scripts/workspace/views/code-editor/script-code-editor-workspace-view.element.d.ts +1 -0
- package/dist-cms/packages/templating/scripts/workspace/views/code-editor/script-code-editor-workspace-view.element.js +6 -0
- package/dist-cms/packages/templating/stylesheets/global-components/stylesheet-input/stylesheet-input.element.d.ts +6 -6
- package/dist-cms/packages/templating/stylesheets/global-components/stylesheet-input/stylesheet-input.element.js +5 -16
- package/dist-cms/packages/templating/stylesheets/workspace/views/code-editor/stylesheet-code-editor-workspace-view.element.d.ts +1 -0
- package/dist-cms/packages/templating/stylesheets/workspace/views/code-editor/stylesheet-code-editor-workspace-view.element.js +7 -1
- package/dist-cms/packages/templating/templates/global-components/input-template/input-template.element.d.ts +13 -6
- package/dist-cms/packages/templating/templates/global-components/input-template/input-template.element.js +33 -25
- package/dist-cms/packages/templating/templates/global-components/template-card/template-card.element.d.ts +7 -0
- package/dist-cms/packages/templating/templates/global-components/template-card/template-card.element.js +26 -10
- package/dist-cms/packages/templating/templates/workspace/manifests.js +1 -5
- package/dist-cms/packages/templating/templates/workspace/template-workspace-editor.element.d.ts +1 -5
- package/dist-cms/packages/templating/templates/workspace/template-workspace-editor.element.js +16 -15
- package/dist-cms/packages/templating/templates/workspace/template-workspace.context.d.ts +1 -0
- package/dist-cms/packages/templating/templates/workspace/template-workspace.context.js +24 -0
- package/dist-cms/packages/templating/templates/workspace/views/code-editor/template-code-editor-workspace-view.element.d.ts +1 -5
- package/dist-cms/packages/templating/templates/workspace/views/code-editor/template-code-editor-workspace-view.element.js +9 -19
- package/dist-cms/packages/tiptap/extensions/media-upload/media-upload.tiptap-api.js +3 -3
- package/dist-cms/packages/ufm/utils/index.d.ts +1 -0
- package/dist-cms/packages/ufm/utils/index.js +1 -0
- package/dist-cms/packages/ufm/utils/render-ufm.function.d.ts +12 -0
- package/dist-cms/packages/ufm/utils/render-ufm.function.js +22 -0
- package/dist-cms/packages/user/current-user/conditions/group-id/group-id.condition-config.d.ts +4 -4
- package/dist-cms/packages/user/current-user/current-user.context.d.ts +1 -0
- package/dist-cms/packages/user/current-user/current-user.context.js +14 -3
- package/dist-cms/packages/user/current-user/user-entry-point/user-entry-point-extension-initializer.js +11 -1
- package/dist-cms/packages/user/user/collection/user-collection-header.element.js +1 -1
- package/dist-cms/packages/user/user/components/user-input/user-input.element.d.ts +8 -7
- package/dist-cms/packages/user/user/components/user-input/user-input.element.js +46 -44
- package/dist-cms/packages/user/user-group/collection/repository/user-group-collection.repository.d.ts +16 -0
- package/dist-cms/packages/user/user-group/collection/repository/user-group-collection.repository.js +23 -0
- package/dist-cms/packages/user/user-group/components/input-user-group/user-group-input.element.d.ts +6 -6
- package/dist-cms/packages/user/user-group/components/input-user-group/user-group-input.element.js +5 -16
- package/dist-cms/packages/user/user-group/modals/user-group-picker/user-group-picker-modal.element.js +1 -1
- package/dist-cms/packages/webhook/components/input-webhook-headers.element.d.ts +7 -0
- package/dist-cms/packages/webhook/components/input-webhook-headers.element.js +27 -3
- package/dist-cms/packages/webhook/webhook/workspace/views/webhook-details-workspace-view.element.d.ts +1 -0
- package/dist-cms/packages/webhook/webhook/workspace/views/webhook-details-workspace-view.element.js +16 -5
- package/dist-cms/packages/webhook/webhook/workspace/webhook-workspace-editor.element.d.ts +1 -0
- package/dist-cms/packages/webhook/webhook/workspace/webhook-workspace-editor.element.js +19 -1
- package/dist-cms/packages/webhook/webhook-event/input-webhook-events.element.d.ts +7 -0
- package/dist-cms/packages/webhook/webhook-event/input-webhook-events.element.js +34 -12
- package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
- package/examples/multi-brand-block-views/README.md +27 -0
- package/examples/multi-brand-block-views/article-teaser-block-view.element.ts +53 -0
- package/examples/multi-brand-block-views/block-view-base.element.ts +78 -0
- package/examples/multi-brand-block-views/block-view.styles.ts +95 -0
- package/examples/multi-brand-block-views/block-view.utils.ts +60 -0
- package/examples/multi-brand-block-views/entry-point.ts +17 -0
- package/examples/multi-brand-block-views/hero-block-view.element.ts +88 -0
- package/examples/multi-brand-block-views/image-block-view.element.ts +48 -0
- package/examples/multi-brand-block-views/index.ts +67 -0
- package/examples/multi-brand-block-views/layout-block-view.element.ts +55 -0
- package/examples/multi-brand-block-views/material-showcase-block-view.element.ts +106 -0
- package/examples/multi-brand-block-views/product-teaser-block-view.element.ts +96 -0
- package/examples/multi-brand-block-views/text-block-view.element.ts +53 -0
- package/package.json +3 -2
- package/umbraco-package-schema.json +69 -28
- package/vscode-html-custom-data.json +250 -140
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import { UmbMergeContentVariantDataController } from '../controller/merge-content-variant-data.controller.js';
|
|
2
|
-
import { UmbVariantId
|
|
2
|
+
import { UmbVariantId } from '../../../core/variant/index.js';
|
|
3
3
|
import { UmbEntityWorkspaceDataManager } from '../../../core/workspace/index.js';
|
|
4
|
-
/**
|
|
5
|
-
* Compares two element values by alias and variant.
|
|
6
|
-
* @param {UmbElementValueModel} a The first value to compare.
|
|
7
|
-
* @param {UmbElementValueModel} b The second value to compare.
|
|
8
|
-
* @returns {boolean} True if the values have the same alias and variant.
|
|
9
|
-
*/
|
|
10
|
-
function valueObjectCompare(a, b) {
|
|
11
|
-
return a.alias === b.alias && umbVariantObjectCompare(a, b);
|
|
12
|
-
}
|
|
13
4
|
export class UmbElementWorkspaceDataManager extends UmbEntityWorkspaceDataManager {
|
|
14
5
|
constructor() {
|
|
15
6
|
super(...arguments);
|
|
@@ -19,21 +10,6 @@ export class UmbElementWorkspaceDataManager extends UmbEntityWorkspaceDataManage
|
|
|
19
10
|
this.#triggerPropertyValueChanges();
|
|
20
11
|
};
|
|
21
12
|
}
|
|
22
|
-
_sortCurrentData(persistedData, currentData) {
|
|
23
|
-
currentData = super._sortCurrentData(persistedData, currentData);
|
|
24
|
-
// Sort the values in the same order as the persisted data:
|
|
25
|
-
const persistedValues = persistedData.values;
|
|
26
|
-
if (persistedValues && currentData.values) {
|
|
27
|
-
return {
|
|
28
|
-
...currentData,
|
|
29
|
-
values: [...currentData.values].sort(function (a, b) {
|
|
30
|
-
return (persistedValues.findIndex((x) => valueObjectCompare(x, a)) -
|
|
31
|
-
persistedValues.findIndex((x) => valueObjectCompare(x, b)));
|
|
32
|
-
}),
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
return currentData;
|
|
36
|
-
}
|
|
37
13
|
#updateLock;
|
|
38
14
|
initiatePropertyValueChange() {
|
|
39
15
|
this.#updateLock++;
|
|
@@ -65,7 +65,9 @@ let UmbContentRollbackModalElement = class UmbContentRollbackModalElement extend
|
|
|
65
65
|
return;
|
|
66
66
|
this.#currentDocument = data;
|
|
67
67
|
const itemVariants = this.#currentDocument?.variants ?? [];
|
|
68
|
-
|
|
68
|
+
// A document is culture invariant when none of its variants carry a culture. It may still hold
|
|
69
|
+
// several variants, as any segment adds one.
|
|
70
|
+
this._isInvariant = itemVariants.every((variant) => UmbVariantId.Create(variant).isCultureInvariant());
|
|
69
71
|
this.#selectCulture();
|
|
70
72
|
const cultures = itemVariants.map((x) => x.culture).filter((x) => x !== null);
|
|
71
73
|
const { data: languageItems } = await new UmbLanguageItemRepository(this).requestItems(cultures);
|
|
@@ -141,7 +143,9 @@ let UmbContentRollbackModalElement = class UmbContentRollbackModalElement extend
|
|
|
141
143
|
name: data.variants.find((x) => x.culture === this._selectedCulture)?.name || data.variants[0].name,
|
|
142
144
|
id: data.id,
|
|
143
145
|
properties: data.values
|
|
144
|
-
|
|
146
|
+
// When invariant, culture is undefined or null. Segment values are overrides of the default
|
|
147
|
+
// segment value, so only the default segment is shown here.
|
|
148
|
+
.filter((x) => (x.culture === this._selectedCulture || !x.culture) && !x.segment)
|
|
145
149
|
.map((value) => {
|
|
146
150
|
return {
|
|
147
151
|
alias: value.alias,
|
|
@@ -262,7 +266,9 @@ let UmbContentRollbackModalElement = class UmbContentRollbackModalElement extend
|
|
|
262
266
|
async #setDiffs() {
|
|
263
267
|
if (!this._selectedVersion)
|
|
264
268
|
return;
|
|
265
|
-
|
|
269
|
+
// When invariant, culture is undefined or null. Segment values are overrides of the default segment
|
|
270
|
+
// value, so only the default segment is diffed.
|
|
271
|
+
const currentPropertyValues = this.#currentDocument?.values.filter((x) => (x.culture === this._selectedCulture || !x.culture) && !x.segment);
|
|
266
272
|
if (!currentPropertyValues) {
|
|
267
273
|
throw new Error('Current property values are not set');
|
|
268
274
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { UmbPotentialContentValueModel } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Inserts or replaces a content value in a frozen array of content values.
|
|
4
|
+
*
|
|
5
|
+
* A replaced entry keeps the array's existing order — it already has a variant-sorted position from when it
|
|
6
|
+
* was first added. A newly inserted entry is placed by culture, segment, and alias, matching the order the
|
|
7
|
+
* backend settles a set of variant values into, so a fresh addition doesn't just land at the end out of order.
|
|
8
|
+
* @template T
|
|
9
|
+
* @param {Array<T>} data - An array of content values, which is frozen and should be updated.
|
|
10
|
+
* @param {T} entry - A new or updated content value.
|
|
11
|
+
* @param {(entry: T) => unknown} getUniqueMethod - Method to retrieve the value that uniquely identifies an entry, used to find an existing match to replace.
|
|
12
|
+
* @returns {Array<T>} A new array with the entry inserted or replacing its match.
|
|
13
|
+
*/
|
|
14
|
+
export declare function umbAppendContentValue<T extends UmbPotentialContentValueModel>(data: Array<T>, entry: T, getUniqueMethod: (entry: T) => unknown): Array<T>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { _sortContentValuesByVariant } from './sort-content-values-by-variant.function.js';
|
|
2
|
+
/**
|
|
3
|
+
* Inserts or replaces a content value in a frozen array of content values.
|
|
4
|
+
*
|
|
5
|
+
* A replaced entry keeps the array's existing order — it already has a variant-sorted position from when it
|
|
6
|
+
* was first added. A newly inserted entry is placed by culture, segment, and alias, matching the order the
|
|
7
|
+
* backend settles a set of variant values into, so a fresh addition doesn't just land at the end out of order.
|
|
8
|
+
* @template T
|
|
9
|
+
* @param {Array<T>} data - An array of content values, which is frozen and should be updated.
|
|
10
|
+
* @param {T} entry - A new or updated content value.
|
|
11
|
+
* @param {(entry: T) => unknown} getUniqueMethod - Method to retrieve the value that uniquely identifies an entry, used to find an existing match to replace.
|
|
12
|
+
* @returns {Array<T>} A new array with the entry inserted or replacing its match.
|
|
13
|
+
*/
|
|
14
|
+
export function umbAppendContentValue(data, entry, getUniqueMethod) {
|
|
15
|
+
const unique = getUniqueMethod(entry);
|
|
16
|
+
const indexToReplace = data.findIndex((x) => getUniqueMethod(x) === unique);
|
|
17
|
+
if (indexToReplace === -1) {
|
|
18
|
+
return _sortContentValuesByVariant([...data, entry]);
|
|
19
|
+
}
|
|
20
|
+
const values = [...data];
|
|
21
|
+
values[indexToReplace] = entry;
|
|
22
|
+
return values;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './append-content-value.function.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './append-content-value.function.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { UmbPotentialContentValueModel } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Sorts content values by culture, then by segment, then by alias, matching the ordinal order the
|
|
4
|
+
* Management API returns property values in (invariant culture/segment first, then codes
|
|
5
|
+
* and aliases compared ordinally, case-sensitively). This keeps a freshly-constructed value array in the
|
|
6
|
+
* same order the backend returns after a save and reload, so unchanged values don't register as changed.
|
|
7
|
+
* @param {Array<UmbPotentialContentValueModel>} values - The values to sort.
|
|
8
|
+
* @returns {Array<UmbPotentialContentValueModel>} A new, variant-sorted array.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export declare function _sortContentValuesByVariant<T extends UmbPotentialContentValueModel>(values: Array<T>): Array<T>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { umbVariantObjectSortCompare } from '../../../core/variant/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Sorts content values by culture, then by segment, then by alias, matching the ordinal order the
|
|
4
|
+
* Management API returns property values in (invariant culture/segment first, then codes
|
|
5
|
+
* and aliases compared ordinally, case-sensitively). This keeps a freshly-constructed value array in the
|
|
6
|
+
* same order the backend returns after a save and reload, so unchanged values don't register as changed.
|
|
7
|
+
* @param {Array<UmbPotentialContentValueModel>} values - The values to sort.
|
|
8
|
+
* @returns {Array<UmbPotentialContentValueModel>} A new, variant-sorted array.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export function _sortContentValuesByVariant(values) {
|
|
12
|
+
return [...values].sort((a, b) => {
|
|
13
|
+
const variantCompare = umbVariantObjectSortCompare(a, b);
|
|
14
|
+
if (variantCompare !== 0)
|
|
15
|
+
return variantCompare;
|
|
16
|
+
if (a.alias === b.alias)
|
|
17
|
+
return 0;
|
|
18
|
+
return a.alias < b.alias ? -1 : 1;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
@@ -6,6 +6,7 @@ import type { UmbContentPropertyDatasetContext } from '../property-dataset-conte
|
|
|
6
6
|
import type { UmbContentValidationRepository } from '../repository/content-validation-repository.interface.js';
|
|
7
7
|
import type { UmbContentCollectionWorkspaceContext } from '../collection/content-collection-workspace-context.interface.js';
|
|
8
8
|
import type { UmbContentWorkspaceContext } from './content-workspace-context.interface.js';
|
|
9
|
+
import { UmbContentTypeVarianceChangeRedirectController } from './content-type-variance-change-redirect.controller.js';
|
|
9
10
|
import { UmbArrayState } from '../../../../libs/observable-api/index.js';
|
|
10
11
|
import { UmbContentTypeStructureManager } from '../../content-type/index.js';
|
|
11
12
|
import { UmbReadOnlyVariantGuardManager } from '../../../core/utils/index.js';
|
|
@@ -76,6 +77,11 @@ export declare abstract class UmbContentDetailWorkspaceContextBase<DetailModelTy
|
|
|
76
77
|
readonly varies: Observable<boolean | undefined>;
|
|
77
78
|
abstract readonly contentTypeUnique: Observable<string | undefined>;
|
|
78
79
|
readonly splitView: UmbWorkspaceSplitViewManager;
|
|
80
|
+
/**
|
|
81
|
+
* Keeps the workspace on an existing variant when the content type's variance is changed from within the workspace.
|
|
82
|
+
* @internal
|
|
83
|
+
*/
|
|
84
|
+
readonly contentTypeVarianceChangeRedirect: UmbContentTypeVarianceChangeRedirectController;
|
|
79
85
|
readonly collection: UmbContentCollectionManager;
|
|
80
86
|
/**
|
|
81
87
|
* @private
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
import { umbAppendContentValue } from '../utils/index.js';
|
|
1
2
|
import { UmbContentCollectionConfigurationContext, UmbContentCollectionManager } from '../collection/index.js';
|
|
2
3
|
import { UmbContentWorkspaceDataManager } from '../manager/index.js';
|
|
3
4
|
import { UmbMergeContentVariantDataController } from '../controller/merge-content-variant-data.controller.js';
|
|
4
5
|
import { UmbContentDetailValidationPathTranslator } from './content-detail-validation-path-translator.js';
|
|
5
6
|
import { UmbContentValidationToHintsManager } from './content-validation-to-hints.manager.js';
|
|
6
7
|
import { UmbContentDetailWorkspaceTypeTransformController } from './content-detail-workspace-type-transform.controller.js';
|
|
7
|
-
import {
|
|
8
|
+
import { UmbContentTypeVarianceChangeRedirectController } from './content-type-variance-change-redirect.controller.js';
|
|
9
|
+
import { mergeObservables, observeMultiple, UmbArrayState } from '../../../../libs/observable-api/index.js';
|
|
8
10
|
import { firstValueFrom, map } from '../../../../external/rxjs/index.js';
|
|
9
11
|
import { umbOpenModal } from '../../../core/modal/index.js';
|
|
10
12
|
import { UmbContentTypeStructureManager } from '../../content-type/index.js';
|
|
@@ -119,6 +121,7 @@ export class UmbContentDetailWorkspaceContextBase extends UmbEntityDetailWorkspa
|
|
|
119
121
|
this.collection = new UmbContentCollectionManager(this, this.structure, args.collectionAlias);
|
|
120
122
|
new UmbContentValidationToHintsManager(this, this.structure, this.validationContext, this.view.hints);
|
|
121
123
|
new UmbContentDetailWorkspaceTypeTransformController(this, this._data);
|
|
124
|
+
this.contentTypeVarianceChangeRedirect = new UmbContentTypeVarianceChangeRedirectController(this);
|
|
122
125
|
this.variantOptions = mergeObservables([this.variesByCulture, this.variesBySegment, this.variants, this.languages, this._segments.asObservable()], ([variesByCulture, variesBySegment, variants, languages, segments]) => {
|
|
123
126
|
if ((variesByCulture || variesBySegment) === undefined) {
|
|
124
127
|
return [];
|
|
@@ -526,7 +529,7 @@ export class UmbContentDetailWorkspaceContextBase extends UmbEntityDetailWorkspa
|
|
|
526
529
|
};
|
|
527
530
|
const currentData = this.getData();
|
|
528
531
|
if (currentData) {
|
|
529
|
-
const values =
|
|
532
|
+
const values = umbAppendContentValue(currentData.values ?? [], entry, (x) => x.alias === alias && variantId.compare(x));
|
|
530
533
|
this.#ensureVariantsExistsForProperty(variantId, entry);
|
|
531
534
|
this._data.updateCurrent({ values });
|
|
532
535
|
}
|
|
@@ -633,7 +636,16 @@ export class UmbContentDetailWorkspaceContextBase extends UmbEntityDetailWorkspa
|
|
|
633
636
|
const variantsWithoutAName = saveData.variants.filter((x) => !x.name);
|
|
634
637
|
if (variantsWithoutAName.length > 0) {
|
|
635
638
|
variantsWithoutAName.forEach((variant) => {
|
|
636
|
-
|
|
639
|
+
const variantId = UmbVariantId.Create(variant);
|
|
640
|
+
const key = 'umbMissingVariantName_' + variantId.toString();
|
|
641
|
+
// 'client' messages are owned by the form control, so this check owns its message and removes it once a name is set.
|
|
642
|
+
this.validationContext.messages.addMessage('custom', `$.variants[${UmbDataPathVariantQuery(variant)}].name`, UMB_VALIDATION_EMPTY_LOCALIZATION_KEY, key);
|
|
643
|
+
this.observe(this.name(variantId), (name) => {
|
|
644
|
+
if (!name)
|
|
645
|
+
return;
|
|
646
|
+
this.validationContext.messages.removeMessageByKey(key);
|
|
647
|
+
this.removeUmbControllerByAlias(key);
|
|
648
|
+
}, key);
|
|
637
649
|
});
|
|
638
650
|
throw new Error('All variants must have a name, these variants are missing a name: ' +
|
|
639
651
|
variantsWithoutAName.map((x) => (x.culture ?? 'invariant') + '_' + (x.segment ?? '')).join(', '));
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { UmbStaleVariantRouteResolverVariant } from './resolve-stale-variant-route.function.js';
|
|
2
|
+
import { UmbControllerBase } from '../../../../libs/class-api/index.js';
|
|
3
|
+
import type { UmbControllerHost } from '../../../../libs/controller-api/index.js';
|
|
4
|
+
interface UmbContentTypeVarianceChangeRedirectHost extends UmbControllerHost {
|
|
5
|
+
readonly splitView: {
|
|
6
|
+
getWorkspaceRoute(): string | undefined;
|
|
7
|
+
};
|
|
8
|
+
getVariesByCulture(): boolean | undefined;
|
|
9
|
+
getVariesBySegment(): boolean | undefined;
|
|
10
|
+
getVariantOptions(): Promise<Array<UmbStaleVariantRouteResolverVariant>>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Moves the workspace URL to an existing variant when the content type's variance is changed from within the
|
|
14
|
+
* workspace, for example by editing the content type in an infinite editing modal. Only the editor who made the
|
|
15
|
+
* change is redirected; a URL referring to a variant that does not exist is otherwise left alone.
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare class UmbContentTypeVarianceChangeRedirectController extends UmbControllerBase {
|
|
19
|
+
#private;
|
|
20
|
+
constructor(host: UmbContentTypeVarianceChangeRedirectHost);
|
|
21
|
+
/**
|
|
22
|
+
* Call before the content type is edited from within the workspace, for example when opening it in a modal.
|
|
23
|
+
* Tracking ends once the URL settles outside of any modal, that is when the modal has closed: if the variance
|
|
24
|
+
* changed by then, redirects to the best matching variant.
|
|
25
|
+
*
|
|
26
|
+
* The URL is checked on navigation rather than on the modal's result: a variance change removes the variant
|
|
27
|
+
* the modal was opened from, which closes the modal without resolving it.
|
|
28
|
+
*/
|
|
29
|
+
trackVarianceChange(): void;
|
|
30
|
+
destroy(): void;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { resolveStaleVariantRoute } from './resolve-stale-variant-route.function.js';
|
|
2
|
+
import { UmbControllerBase } from '../../../../libs/class-api/index.js';
|
|
3
|
+
import { UMB_APP_LANGUAGE_CONTEXT } from '../../../language/index.js';
|
|
4
|
+
import { UMB_MODAL_ROUTE_PATH_SEGMENT } from '../../../core/router/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Moves the workspace URL to an existing variant when the content type's variance is changed from within the
|
|
7
|
+
* workspace, for example by editing the content type in an infinite editing modal. Only the editor who made the
|
|
8
|
+
* change is redirected; a URL referring to a variant that does not exist is otherwise left alone.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
export class UmbContentTypeVarianceChangeRedirectController extends UmbControllerBase {
|
|
12
|
+
#workspace;
|
|
13
|
+
#appLanguage;
|
|
14
|
+
#trackedVariance;
|
|
15
|
+
constructor(host) {
|
|
16
|
+
super(host);
|
|
17
|
+
this.#workspace = host;
|
|
18
|
+
this.consumeContext(UMB_APP_LANGUAGE_CONTEXT, (context) => {
|
|
19
|
+
this.#appLanguage = context;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Call before the content type is edited from within the workspace, for example when opening it in a modal.
|
|
24
|
+
* Tracking ends once the URL settles outside of any modal, that is when the modal has closed: if the variance
|
|
25
|
+
* changed by then, redirects to the best matching variant.
|
|
26
|
+
*
|
|
27
|
+
* The URL is checked on navigation rather than on the modal's result: a variance change removes the variant
|
|
28
|
+
* the modal was opened from, which closes the modal without resolving it.
|
|
29
|
+
*/
|
|
30
|
+
trackVarianceChange() {
|
|
31
|
+
this.#trackedVariance = this.#getVariance();
|
|
32
|
+
window.addEventListener('changestate', this.#onChangeState);
|
|
33
|
+
}
|
|
34
|
+
#onChangeState = async () => {
|
|
35
|
+
const previous = this.#trackedVariance;
|
|
36
|
+
if (!previous || this.#isInModal())
|
|
37
|
+
return;
|
|
38
|
+
this.#stopTracking();
|
|
39
|
+
const current = this.#getVariance();
|
|
40
|
+
if (previous.variesByCulture === current.variesByCulture && previous.variesBySegment === current.variesBySegment) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const workspaceRoute = this.#workspace.splitView.getWorkspaceRoute();
|
|
44
|
+
if (!workspaceRoute)
|
|
45
|
+
return;
|
|
46
|
+
const variants = await this.#workspace.getVariantOptions();
|
|
47
|
+
const newPath = resolveStaleVariantRoute({
|
|
48
|
+
currentPath: window.location.pathname,
|
|
49
|
+
workspaceRoute,
|
|
50
|
+
variants,
|
|
51
|
+
appCulture: this.#appLanguage?.getAppCulture(),
|
|
52
|
+
});
|
|
53
|
+
if (newPath) {
|
|
54
|
+
history.replaceState(null, '', newPath + window.location.search);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
#isInModal() {
|
|
58
|
+
const workspaceRoute = this.#workspace.splitView.getWorkspaceRoute() ?? '';
|
|
59
|
+
const currentPath = window.location.pathname;
|
|
60
|
+
const workspacePath = currentPath.startsWith(workspaceRoute) ? currentPath.substring(workspaceRoute.length) : '';
|
|
61
|
+
return workspacePath.split('/').includes(UMB_MODAL_ROUTE_PATH_SEGMENT);
|
|
62
|
+
}
|
|
63
|
+
#stopTracking() {
|
|
64
|
+
this.#trackedVariance = undefined;
|
|
65
|
+
window.removeEventListener('changestate', this.#onChangeState);
|
|
66
|
+
}
|
|
67
|
+
#getVariance() {
|
|
68
|
+
return {
|
|
69
|
+
variesByCulture: this.#workspace.getVariesByCulture(),
|
|
70
|
+
variesBySegment: this.#workspace.getVariesBySegment(),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
destroy() {
|
|
74
|
+
this.#stopTracking();
|
|
75
|
+
super.destroy();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A minimal variant option descriptor consumed by {@link resolveStaleVariantRoute}.
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export interface UmbStaleVariantRouteResolverVariant {
|
|
6
|
+
culture: string | null;
|
|
7
|
+
segment: string | null;
|
|
8
|
+
unique: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The arguments for {@link resolveStaleVariantRoute}.
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export interface UmbStaleVariantRouteResolverArgs {
|
|
15
|
+
/**
|
|
16
|
+
* The current location pathname, e.g. window.location.pathname.
|
|
17
|
+
*/
|
|
18
|
+
currentPath: string;
|
|
19
|
+
/**
|
|
20
|
+
* The absolute router path of the workspace, without a trailing slash.
|
|
21
|
+
*/
|
|
22
|
+
workspaceRoute: string;
|
|
23
|
+
/**
|
|
24
|
+
* The available variant options.
|
|
25
|
+
*/
|
|
26
|
+
variants: Array<UmbStaleVariantRouteResolverVariant>;
|
|
27
|
+
/**
|
|
28
|
+
* The culture currently selected in the app language switcher.
|
|
29
|
+
*/
|
|
30
|
+
appCulture?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Checks whether the variant part of a workspace URL refers to variant options that no longer exist —
|
|
34
|
+
* e.g. after the content type's Vary by Culture setting changed — and resolves a corrected path.
|
|
35
|
+
* Split-view parts are resolved individually and deduplicated.
|
|
36
|
+
* @param {UmbStaleVariantRouteResolverArgs} args - The current path, workspace route, variant options and app culture.
|
|
37
|
+
* @returns {string | null} The corrected path without the query string, or null when the URL is valid or not applicable.
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export declare function resolveStaleVariantRoute(args: UmbStaleVariantRouteResolverArgs): string | null;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { UMB_MODAL_ROUTE_PATH_SEGMENT } from '../../../core/router/index.js';
|
|
2
|
+
import { UMB_WORKSPACE_PATH_VARIANT_DELIMITER } from '../../../core/workspace/index.js';
|
|
3
|
+
import { UmbVariantId } from '../../../core/variant/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Checks whether the variant part of a workspace URL refers to variant options that no longer exist —
|
|
6
|
+
* e.g. after the content type's Vary by Culture setting changed — and resolves a corrected path.
|
|
7
|
+
* Split-view parts are resolved individually and deduplicated.
|
|
8
|
+
* @param {UmbStaleVariantRouteResolverArgs} args - The current path, workspace route, variant options and app culture.
|
|
9
|
+
* @returns {string | null} The corrected path without the query string, or null when the URL is valid or not applicable.
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export function resolveStaleVariantRoute(args) {
|
|
13
|
+
const { currentPath, workspaceRoute, variants, appCulture } = args;
|
|
14
|
+
if (variants.length === 0)
|
|
15
|
+
return null;
|
|
16
|
+
const parsed = parseVariantPath(currentPath, workspaceRoute);
|
|
17
|
+
if (!parsed)
|
|
18
|
+
return null;
|
|
19
|
+
const { variantPart, pathSuffix } = parsed;
|
|
20
|
+
// Skip while a modal is layered on top — closing it restores the pre-modal URL and dispatches
|
|
21
|
+
// a changestate event, at which point the correction can run against the settled URL:
|
|
22
|
+
if (pathSuffix.split('/').includes(UMB_MODAL_ROUTE_PATH_SEGMENT))
|
|
23
|
+
return null;
|
|
24
|
+
const parts = variantPart.split(UMB_WORKSPACE_PATH_VARIANT_DELIMITER);
|
|
25
|
+
const isValid = (part) => variants.some((v) => v.unique === part);
|
|
26
|
+
if (parts.every(isValid))
|
|
27
|
+
return null;
|
|
28
|
+
const resolvedParts = parts.map((part) => isValid(part) ? part : findFallbackVariant(variants, UmbVariantId.FromString(part), appCulture).unique);
|
|
29
|
+
const uniqueParts = [...new Set(resolvedParts)];
|
|
30
|
+
return `${workspaceRoute}/${uniqueParts.join(UMB_WORKSPACE_PATH_VARIANT_DELIMITER)}${pathSuffix}`;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Separates the variant part of a workspace path from any trailing path (e.g. /view/info).
|
|
34
|
+
* @param {string} currentPath - the current location pathname.
|
|
35
|
+
* @param {string} workspaceRoute - the absolute router path of the workspace, without a trailing slash.
|
|
36
|
+
* @returns {{ variantPart: string; pathSuffix: string } | null} the split parts, or null if the path is not under the workspace route.
|
|
37
|
+
*/
|
|
38
|
+
function parseVariantPath(currentPath, workspaceRoute) {
|
|
39
|
+
const routePrefix = workspaceRoute + '/';
|
|
40
|
+
if (!currentPath.startsWith(routePrefix))
|
|
41
|
+
return null;
|
|
42
|
+
const remainingPath = currentPath.substring(routePrefix.length);
|
|
43
|
+
if (remainingPath.length === 0)
|
|
44
|
+
return null;
|
|
45
|
+
const slashIndex = remainingPath.indexOf('/');
|
|
46
|
+
if (slashIndex === -1) {
|
|
47
|
+
return { variantPart: remainingPath, pathSuffix: '' };
|
|
48
|
+
}
|
|
49
|
+
return { variantPart: remainingPath.substring(0, slashIndex), pathSuffix: remainingPath.substring(slashIndex) };
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Prefers the same culture without a segment, then the app culture, then invariant, then the first option.
|
|
53
|
+
* @param {Array<UmbStaleVariantRouteResolverVariant>} variants - the available variant options.
|
|
54
|
+
* @param {UmbVariantId} variantId - the variant that no longer exists.
|
|
55
|
+
* @param {string} [appCulture] - the culture currently selected in the app language switcher.
|
|
56
|
+
* @returns {UmbStaleVariantRouteResolverVariant} the best matching fallback variant.
|
|
57
|
+
*/
|
|
58
|
+
function findFallbackVariant(variants, variantId, appCulture) {
|
|
59
|
+
return (variants.find((v) => v.culture === variantId.culture && v.segment === null) ??
|
|
60
|
+
variants.find((v) => v.culture === appCulture && v.segment === null) ??
|
|
61
|
+
variants.find((v) => v.culture === null && v.segment === null) ??
|
|
62
|
+
variants[0]);
|
|
63
|
+
}
|
|
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { UMB_CONTENT_TYPE_WORKSPACE_CONTEXT } from '../workspace/content-type-workspace.context-token.js';
|
|
8
8
|
import { umbFocus, UmbLitElement } from '../../../core/lit-element/index.js';
|
|
9
|
-
import { css, html, customElement, state, ifDefined } from '../../../../external/lit/index.js';
|
|
9
|
+
import { css, html, customElement, state, ifDefined, nothing } from '../../../../external/lit/index.js';
|
|
10
10
|
import { UMB_MODAL_MANAGER_CONTEXT } from '../../../core/modal/index.js';
|
|
11
11
|
import { UMB_ICON_PICKER_MODAL } from '../../../core/icon-registry/index.js';
|
|
12
12
|
import { umbBindToValidation } from '../../../core/validation/index.js';
|
|
@@ -14,11 +14,16 @@ let UmbContentTypeWorkspaceEditorHeaderElement = class UmbContentTypeWorkspaceEd
|
|
|
14
14
|
#workspaceContext;
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
17
|
+
this._isReadOnly = false;
|
|
17
18
|
this.consumeContext(UMB_CONTENT_TYPE_WORKSPACE_CONTEXT, (instance) => {
|
|
18
19
|
this.#workspaceContext = instance;
|
|
19
20
|
this.#observeContentType();
|
|
21
|
+
this.#observeReadOnly();
|
|
20
22
|
});
|
|
21
23
|
}
|
|
24
|
+
#observeReadOnly() {
|
|
25
|
+
this.observe(this.#workspaceContext?.readOnlyGuard?.permitted, (isReadOnly) => (this._isReadOnly = isReadOnly ?? false), '_observeIsReadOnly');
|
|
26
|
+
}
|
|
22
27
|
#observeContentType() {
|
|
23
28
|
if (!this.#workspaceContext)
|
|
24
29
|
return;
|
|
@@ -72,6 +77,7 @@ let UmbContentTypeWorkspaceEditorHeaderElement = class UmbContentTypeWorkspaceEd
|
|
|
72
77
|
label=${this.#iconTitle ?? 'icon'}
|
|
73
78
|
look="outline"
|
|
74
79
|
title=${ifDefined(this.#iconTitle)}
|
|
80
|
+
?disabled=${this._isReadOnly}
|
|
75
81
|
@click=${this._handleIconClick}>
|
|
76
82
|
<umb-icon aria-hidden="true" name=${ifDefined(this._icon)}></umb-icon>
|
|
77
83
|
</uui-button>
|
|
@@ -83,11 +89,18 @@ let UmbContentTypeWorkspaceEditorHeaderElement = class UmbContentTypeWorkspaceEd
|
|
|
83
89
|
.value=${this._name}
|
|
84
90
|
.alias=${this._alias}
|
|
85
91
|
?auto-generate-alias=${this._isNew}
|
|
92
|
+
?readonly=${this._isReadOnly}
|
|
93
|
+
?alias-readonly=${this._isReadOnly}
|
|
86
94
|
.autocomplete=${'off'}
|
|
87
95
|
@change=${this.#onNameAndAliasChange}
|
|
88
96
|
required
|
|
89
97
|
${umbBindToValidation(this, '$.name', this._name)}
|
|
90
98
|
${umbFocus()}>
|
|
99
|
+
${this._isReadOnly
|
|
100
|
+
? html `<uui-tag id="read-only-tag" slot="append" look="secondary">
|
|
101
|
+
${this.localize.term('general_readOnly')}
|
|
102
|
+
</uui-tag>`
|
|
103
|
+
: nothing}
|
|
91
104
|
</umb-input-with-alias>
|
|
92
105
|
|
|
93
106
|
<uui-input
|
|
@@ -95,6 +108,7 @@ let UmbContentTypeWorkspaceEditorHeaderElement = class UmbContentTypeWorkspaceEd
|
|
|
95
108
|
.label=${this.localize.term('placeholders_enterDescription')}
|
|
96
109
|
.value=${this._description}
|
|
97
110
|
.placeholder=${this.localize.term('placeholders_enterDescription')}
|
|
111
|
+
?readonly=${this._isReadOnly}
|
|
98
112
|
@input=${this.#onDescriptionChange}></uui-input>
|
|
99
113
|
</div>
|
|
100
114
|
</div>
|
|
@@ -134,6 +148,12 @@ let UmbContentTypeWorkspaceEditorHeaderElement = class UmbContentTypeWorkspaceEd
|
|
|
134
148
|
--uui-input-border-color: var(--uui-color-border);
|
|
135
149
|
}
|
|
136
150
|
|
|
151
|
+
#read-only-tag {
|
|
152
|
+
align-self: center;
|
|
153
|
+
margin: 0 var(--uui-size-space-2);
|
|
154
|
+
white-space: nowrap;
|
|
155
|
+
}
|
|
156
|
+
|
|
137
157
|
#icon {
|
|
138
158
|
font-size: var(--uui-size-8);
|
|
139
159
|
height: 60px;
|
|
@@ -159,6 +179,9 @@ __decorate([
|
|
|
159
179
|
__decorate([
|
|
160
180
|
state()
|
|
161
181
|
], UmbContentTypeWorkspaceEditorHeaderElement.prototype, "_isNew", void 0);
|
|
182
|
+
__decorate([
|
|
183
|
+
state()
|
|
184
|
+
], UmbContentTypeWorkspaceEditorHeaderElement.prototype, "_isReadOnly", void 0);
|
|
162
185
|
UmbContentTypeWorkspaceEditorHeaderElement = __decorate([
|
|
163
186
|
customElement('umb-content-type-workspace-editor-header')
|
|
164
187
|
], UmbContentTypeWorkspaceEditorHeaderElement);
|
|
@@ -6,6 +6,13 @@ export declare class UmbInputContentTypeCollectionConfigurationElement extends U
|
|
|
6
6
|
protected getFormElement(): undefined;
|
|
7
7
|
private _dataTypePickerModalPath?;
|
|
8
8
|
defaultValue?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Sets the input to readonly mode, meaning the collection cannot be chosen or removed but its data type can still be opened.
|
|
11
|
+
* @type {boolean}
|
|
12
|
+
* @attr
|
|
13
|
+
* @default
|
|
14
|
+
*/
|
|
15
|
+
readonly: boolean;
|
|
9
16
|
constructor();
|
|
10
17
|
render(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
11
18
|
static styles: import("lit").CSSResult[];
|
|
@@ -15,13 +15,21 @@ let UmbInputContentTypeCollectionConfigurationElement = class UmbInputContentTyp
|
|
|
15
15
|
return undefined;
|
|
16
16
|
}
|
|
17
17
|
#dataTypeModal;
|
|
18
|
-
#propertyEditorUiAlias
|
|
18
|
+
#propertyEditorUiAlias;
|
|
19
19
|
#setValue(value) {
|
|
20
20
|
this.value = value;
|
|
21
21
|
this.dispatchEvent(new UmbChangeEvent());
|
|
22
22
|
}
|
|
23
23
|
constructor() {
|
|
24
24
|
super();
|
|
25
|
+
this.#propertyEditorUiAlias = 'Umb.PropertyEditorUi.Collection';
|
|
26
|
+
/**
|
|
27
|
+
* Sets the input to readonly mode, meaning the collection cannot be chosen or removed but its data type can still be opened.
|
|
28
|
+
* @type {boolean}
|
|
29
|
+
* @attr
|
|
30
|
+
* @default
|
|
31
|
+
*/
|
|
32
|
+
this.readonly = false;
|
|
25
33
|
new UmbModalRouteRegistrationController(this, UMB_DATA_TYPE_PICKER_FLOW_DATA_TYPE_PICKER_MODAL)
|
|
26
34
|
.addAdditionalPath(':uiAlias')
|
|
27
35
|
.onSetup((routingInfo) => {
|
|
@@ -73,7 +81,8 @@ let UmbInputContentTypeCollectionConfigurationElement = class UmbInputContentTyp
|
|
|
73
81
|
color="default"
|
|
74
82
|
look="placeholder"
|
|
75
83
|
label=${this.localize.term('collection_addCollectionConfiguration')}
|
|
76
|
-
href=${this._dataTypePickerModalPath}
|
|
84
|
+
href=${this._dataTypePickerModalPath}
|
|
85
|
+
?disabled=${this.readonly}></uui-button>
|
|
77
86
|
`;
|
|
78
87
|
}
|
|
79
88
|
#renderConfigured() {
|
|
@@ -82,16 +91,21 @@ let UmbInputContentTypeCollectionConfigurationElement = class UmbInputContentTyp
|
|
|
82
91
|
return html `
|
|
83
92
|
<uui-ref-list>
|
|
84
93
|
<umb-ref-data-type standalone data-type-id=${this.value} @open=${this.#editDataType}>
|
|
85
|
-
|
|
86
|
-
<uui-button
|
|
87
|
-
label=${this.localize.term('general_choose')}
|
|
88
|
-
href=${this._dataTypePickerModalPath}></uui-button>
|
|
89
|
-
<uui-button @click=${this.#clearDataType} label=${this.localize.term('general_remove')}></uui-button>
|
|
90
|
-
</uui-action-bar>
|
|
94
|
+
${this.#renderDataTypeActions()}
|
|
91
95
|
</umb-ref-data-type>
|
|
92
96
|
</uui-ref-list>
|
|
93
97
|
`;
|
|
94
98
|
}
|
|
99
|
+
#renderDataTypeActions() {
|
|
100
|
+
if (this.readonly)
|
|
101
|
+
return nothing;
|
|
102
|
+
return html `
|
|
103
|
+
<uui-action-bar slot="actions">
|
|
104
|
+
<uui-button label=${this.localize.term('general_choose')} href=${this._dataTypePickerModalPath}></uui-button>
|
|
105
|
+
<uui-button @click=${this.#clearDataType} label=${this.localize.term('general_remove')}></uui-button>
|
|
106
|
+
</uui-action-bar>
|
|
107
|
+
`;
|
|
108
|
+
}
|
|
95
109
|
static { this.styles = [
|
|
96
110
|
css `
|
|
97
111
|
#create-button {
|
|
@@ -106,6 +120,9 @@ __decorate([
|
|
|
106
120
|
__decorate([
|
|
107
121
|
property({ attribute: 'default-value' })
|
|
108
122
|
], UmbInputContentTypeCollectionConfigurationElement.prototype, "defaultValue", void 0);
|
|
123
|
+
__decorate([
|
|
124
|
+
property({ type: Boolean, reflect: true })
|
|
125
|
+
], UmbInputContentTypeCollectionConfigurationElement.prototype, "readonly", void 0);
|
|
109
126
|
UmbInputContentTypeCollectionConfigurationElement = __decorate([
|
|
110
127
|
customElement('umb-input-content-type-collection-configuration')
|
|
111
128
|
], UmbInputContentTypeCollectionConfigurationElement);
|
|
@@ -13,6 +13,13 @@ export declare class UmbContentTypeWorkspaceViewEditGroupElement extends UmbLitE
|
|
|
13
13
|
private _groupStructureHelper?;
|
|
14
14
|
sortModeActive: boolean;
|
|
15
15
|
editContentTypePath?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Sets the group to readonly mode, meaning it and its properties can't be changed, sorted or removed.
|
|
18
|
+
* @type {boolean}
|
|
19
|
+
* @attr
|
|
20
|
+
* @default
|
|
21
|
+
*/
|
|
22
|
+
readonly: boolean;
|
|
16
23
|
private _groupId?;
|
|
17
24
|
private _hasOwnerContainer?;
|
|
18
25
|
private _inherited?;
|