@umbraco-cms/backoffice 17.8.2 → 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.
Files changed (314) hide show
  1. package/custom-elements.json +504 -245
  2. package/dist-cms/apps/app/app-auth.controller.d.ts +8 -0
  3. package/dist-cms/apps/app/app-auth.controller.js +48 -2
  4. package/dist-cms/apps/app/app.element.js +11 -1
  5. package/dist-cms/assets/lang/da.js +3 -0
  6. package/dist-cms/assets/lang/en.js +5 -0
  7. package/dist-cms/assets/lang/nb.js +1 -0
  8. package/dist-cms/assets/lang/pt.js +1 -0
  9. package/dist-cms/assets/lang/vi.js +1 -0
  10. package/dist-cms/external/uui/package.json +1 -1
  11. package/dist-cms/libs/extension-api/functions/has-init-export.function.d.ts +1 -1
  12. package/dist-cms/libs/extension-api/functions/has-init-export.function.js +1 -1
  13. package/dist-cms/libs/extension-api/functions/has-on-unload-export.function.d.ts +1 -1
  14. package/dist-cms/libs/extension-api/functions/has-on-unload-export.function.js +1 -1
  15. package/dist-cms/libs/extension-api/models/entry-point.interface.d.ts +1 -2
  16. package/dist-cms/packages/block/block/components/block-ref-name-slot/block-ref-name-slot.mixin.d.ts +32 -0
  17. package/dist-cms/packages/block/block/components/block-ref-name-slot/block-ref-name-slot.mixin.js +67 -0
  18. package/dist-cms/packages/block/block/components/index.d.ts +1 -0
  19. package/dist-cms/packages/block/block/components/index.js +1 -0
  20. package/dist-cms/packages/block/block/context/block-manager.context.js +2 -1
  21. package/dist-cms/packages/block/block/property-value-resolver/block-value-resolver.api.js +2 -1
  22. package/dist-cms/packages/block/block/utils/block-expose-sort-compare.function.d.ts +10 -0
  23. package/dist-cms/packages/block/block/utils/block-expose-sort-compare.function.js +17 -0
  24. package/dist-cms/packages/block/block/workspace/block-element-manager.js +3 -3
  25. package/dist-cms/packages/block/block-grid/components/block-grid-block/block-grid-block.element.d.ts +7 -5
  26. package/dist-cms/packages/block/block-grid/components/block-grid-block/block-grid-block.element.js +11 -24
  27. package/dist-cms/packages/block/block-grid/components/block-grid-block-inline/block-grid-block-inline.element.d.ts +7 -3
  28. package/dist-cms/packages/block/block-grid/components/block-grid-block-inline/block-grid-block-inline.element.js +11 -19
  29. package/dist-cms/packages/block/block-grid/components/block-grid-entries/block-grid-entries.element.js +3 -3
  30. package/dist-cms/packages/block/block-grid/components/block-grid-entry/block-grid-entry.element.d.ts +2 -2
  31. package/dist-cms/packages/block/block-grid/components/block-grid-entry/block-grid-entry.element.js +11 -6
  32. package/dist-cms/packages/block/block-grid/property-editors/block-grid-editor/Umbraco.BlockGrid.js +1 -1
  33. package/dist-cms/packages/block/block-list/components/block-list-entry/block-list-entry.element.d.ts +1 -1
  34. package/dist-cms/packages/block/block-list/components/block-list-entry/block-list-entry.element.js +3 -13
  35. package/dist-cms/packages/block/block-list/components/inline-list-block/inline-list-block.element.d.ts +3 -9
  36. package/dist-cms/packages/block/block-list/components/inline-list-block/inline-list-block.element.js +37 -67
  37. package/dist-cms/packages/block/block-list/components/ref-list-block/ref-list-block.element.d.ts +3 -10
  38. package/dist-cms/packages/block/block-list/components/ref-list-block/ref-list-block.element.js +4 -44
  39. package/dist-cms/packages/block/block-list/property-editors/block-list-editor/Umbraco.BlockList.js +1 -1
  40. package/dist-cms/packages/block/block-list/property-editors/block-list-editor/property-editor-ui-block-list.element.js +2 -2
  41. package/dist-cms/packages/block/block-rte/components/block-rte-entry/block-rte-entry.element.d.ts +1 -1
  42. package/dist-cms/packages/block/block-rte/components/block-rte-entry/block-rte-entry.element.js +12 -6
  43. package/dist-cms/packages/block/block-rte/components/ref-rte-block/ref-rte-block.element.d.ts +3 -4
  44. package/dist-cms/packages/block/block-rte/components/ref-rte-block/ref-rte-block.element.js +10 -26
  45. package/dist-cms/packages/block/block-rte/context/block-rte-entry.context.js +1 -1
  46. package/dist-cms/packages/block/block-single/components/block-single-entry/block-single-entry.element.d.ts +3 -4
  47. package/dist-cms/packages/block/block-single/components/block-single-entry/block-single-entry.element.js +58 -48
  48. package/dist-cms/packages/block/block-single/components/inline-single-block/inline-single-block.element.d.ts +4 -3
  49. package/dist-cms/packages/block/block-single/components/inline-single-block/inline-single-block.element.js +27 -32
  50. package/dist-cms/packages/block/block-single/components/ref-single-block/ref-single-block.element.d.ts +7 -5
  51. package/dist-cms/packages/block/block-single/components/ref-single-block/ref-single-block.element.js +14 -27
  52. package/dist-cms/packages/content/content/controller/merge-content-variant-data.controller.js +5 -3
  53. package/dist-cms/packages/content/content/index.d.ts +1 -0
  54. package/dist-cms/packages/content/content/index.js +1 -0
  55. package/dist-cms/packages/content/content/manager/content-data-manager.d.ts +0 -1
  56. package/dist-cms/packages/content/content/manager/content-data-manager.js +2 -17
  57. package/dist-cms/packages/content/content/manager/element-data-manager.d.ts +0 -1
  58. package/dist-cms/packages/content/content/manager/element-data-manager.js +1 -25
  59. package/dist-cms/packages/content/content/rollback/modal/content-rollback-modal.element.js +9 -3
  60. package/dist-cms/packages/content/content/rollback/types.d.ts +1 -0
  61. package/dist-cms/packages/content/content/utils/append-content-value.function.d.ts +14 -0
  62. package/dist-cms/packages/content/content/utils/append-content-value.function.js +23 -0
  63. package/dist-cms/packages/content/content/utils/index.d.ts +1 -0
  64. package/dist-cms/packages/content/content/utils/index.js +1 -0
  65. package/dist-cms/packages/content/content/utils/sort-content-values-by-variant.function.d.ts +11 -0
  66. package/dist-cms/packages/content/content/utils/sort-content-values-by-variant.function.js +20 -0
  67. package/dist-cms/packages/content/content/workspace/content-detail-workspace-base.d.ts +6 -0
  68. package/dist-cms/packages/content/content/workspace/content-detail-workspace-base.js +15 -3
  69. package/dist-cms/packages/content/content/workspace/content-type-variance-change-redirect.controller.d.ts +32 -0
  70. package/dist-cms/packages/content/content/workspace/content-type-variance-change-redirect.controller.js +77 -0
  71. package/dist-cms/packages/content/content/workspace/resolve-stale-variant-route.function.d.ts +40 -0
  72. package/dist-cms/packages/content/content/workspace/resolve-stale-variant-route.function.js +63 -0
  73. package/dist-cms/packages/content/content-type/global-components/content-type-workspace-editor-header.element.d.ts +1 -0
  74. package/dist-cms/packages/content/content-type/global-components/content-type-workspace-editor-header.element.js +24 -1
  75. package/dist-cms/packages/content/content-type/global-components/input-content-type-collection-configuration/input-content-type-collection-configuration.element.d.ts +7 -0
  76. package/dist-cms/packages/content/content-type/global-components/input-content-type-collection-configuration/input-content-type-collection-configuration.element.js +25 -8
  77. package/dist-cms/packages/content/content-type/workspace/views/design/content-type-design-editor-group.element.d.ts +7 -0
  78. package/dist-cms/packages/content/content-type/workspace/views/design/content-type-design-editor-group.element.js +15 -3
  79. package/dist-cms/packages/content/content-type/workspace/views/design/content-type-design-editor-properties.element.d.ts +8 -0
  80. package/dist-cms/packages/content/content-type/workspace/views/design/content-type-design-editor-properties.element.js +29 -1
  81. package/dist-cms/packages/content/content-type/workspace/views/design/content-type-design-editor-property.element.d.ts +7 -0
  82. package/dist-cms/packages/content/content-type/workspace/views/design/content-type-design-editor-property.element.js +15 -7
  83. package/dist-cms/packages/content/content-type/workspace/views/design/content-type-design-editor-tab.element.d.ts +8 -0
  84. package/dist-cms/packages/content/content-type/workspace/views/design/content-type-design-editor-tab.element.js +31 -2
  85. package/dist-cms/packages/content/content-type/workspace/views/design/content-type-design-editor.element.d.ts +1 -0
  86. package/dist-cms/packages/content/content-type/workspace/views/design/content-type-design-editor.element.js +26 -7
  87. package/dist-cms/packages/core/auth/auth-provider.extension.d.ts +7 -7
  88. package/dist-cms/packages/core/auth/auth.context.d.ts +23 -0
  89. package/dist-cms/packages/core/auth/auth.context.js +145 -23
  90. package/dist-cms/packages/core/auth/controllers/auth-session-timeout.controller.js +29 -1
  91. package/dist-cms/packages/core/auth/modals/umb-app-auth-modal.element.js +5 -0
  92. package/dist-cms/packages/core/backend-api/types.gen.d.ts +1 -0
  93. package/dist-cms/packages/core/collection/default/collection-default.context.d.ts +8 -0
  94. package/dist-cms/packages/core/collection/default/collection-default.context.js +26 -6
  95. package/dist-cms/packages/core/components/dropdown/dropdown.element.js +6 -3
  96. package/dist-cms/packages/core/components/entity-actions-bundle/entity-actions-bundle.element.d.ts +0 -1
  97. package/dist-cms/packages/core/components/entity-actions-bundle/entity-actions-bundle.element.js +1 -8
  98. package/dist-cms/packages/core/components/input-entity/input-entity.element.d.ts +6 -6
  99. package/dist-cms/packages/core/components/input-entity/input-entity.element.js +28 -37
  100. package/dist-cms/packages/core/components/input-time-zone/input-time-zone.element.d.ts +6 -2
  101. package/dist-cms/packages/core/components/input-time-zone/input-time-zone.element.js +13 -19
  102. package/dist-cms/packages/core/components/input-with-alias/input-with-alias.element.d.ts +4 -0
  103. package/dist-cms/packages/core/components/input-with-alias/input-with-alias.element.js +5 -0
  104. package/dist-cms/packages/core/components/multiple-color-picker-input/multiple-color-picker-input.element.d.ts +6 -6
  105. package/dist-cms/packages/core/components/multiple-color-picker-input/multiple-color-picker-input.element.js +9 -18
  106. package/dist-cms/packages/core/components/multiple-text-string-input/input-multiple-text-string.element.js +6 -4
  107. package/dist-cms/packages/core/entity-action/default/types.d.ts +0 -1
  108. package/dist-cms/packages/core/entity-action/global-components/entity-actions-dropdown/entity-actions-dropdown.element.js +2 -5
  109. package/dist-cms/packages/core/entity-bulk-action/entity-bulk-action.element.js +13 -1
  110. package/dist-cms/packages/core/entity-create-option-action/entity-create-option-action.extension.d.ts +0 -1
  111. package/dist-cms/packages/core/extension-registry/extensions/mfa-login-provider.extension.d.ts +1 -1
  112. package/dist-cms/packages/core/menu/menu-tree-structure-workspace-context-base.js +5 -1
  113. package/dist-cms/packages/core/menu/menu-tree-structure-workspace-context.test-utils.d.ts +2 -0
  114. package/dist-cms/packages/core/menu/menu-tree-structure-workspace-context.test-utils.js +5 -0
  115. package/dist-cms/packages/core/menu/menu-variant-tree-structure-workspace-context-base.js +5 -1
  116. package/dist-cms/packages/core/menu/menu-variant-tree-structure-workspace-context.test-utils.d.ts +2 -0
  117. package/dist-cms/packages/core/menu/menu-variant-tree-structure-workspace-context.test-utils.js +5 -0
  118. package/dist-cms/packages/core/modal/common/discard-changes/discard-changes-modal.element.js +6 -1
  119. package/dist-cms/packages/core/notification/notification-handler.d.ts +1 -1
  120. package/dist-cms/packages/core/notification/notification-handler.js +2 -1
  121. package/dist-cms/packages/core/property-editor/extensions/property-editor-ui.extension.d.ts +0 -1
  122. package/dist-cms/packages/core/property-editor-data-source/input/input-property-editor-data-source.element.d.ts +6 -6
  123. package/dist-cms/packages/core/property-editor-data-source/input/input-property-editor-data-source.element.js +15 -19
  124. package/dist-cms/packages/core/repository/repository-details.manager.d.ts +3 -1
  125. package/dist-cms/packages/core/repository/repository-details.manager.js +17 -2
  126. package/dist-cms/packages/core/resources/api-interceptor.controller.d.ts +2 -1
  127. package/dist-cms/packages/core/resources/api-interceptor.controller.js +23 -18
  128. package/dist-cms/packages/core/resources/resource.controller.js +1 -1
  129. package/dist-cms/packages/core/resources/try-execute/api-error-was-notified.function.js +8 -7
  130. package/dist-cms/packages/core/resources/types.d.ts +5 -0
  131. package/dist-cms/packages/core/resources/umb-error.js +3 -3
  132. package/dist-cms/packages/core/section/components/input-section/input-section.element.d.ts +6 -6
  133. package/dist-cms/packages/core/section/components/input-section/input-section.element.js +6 -19
  134. package/dist-cms/packages/core/server/server.context.d.ts +6 -1
  135. package/dist-cms/packages/core/server/server.context.js +6 -1
  136. package/dist-cms/packages/core/sorter/sorter.controller.js +1 -1
  137. package/dist-cms/packages/core/validation/components/form-validation-message.element.js +2 -1
  138. package/dist-cms/packages/core/validation/const.d.ts +1 -0
  139. package/dist-cms/packages/core/validation/const.js +1 -0
  140. package/dist-cms/packages/core/validation/context/server-model-validator.context.js +11 -1
  141. package/dist-cms/packages/core/validation/utils/index.d.ts +1 -0
  142. package/dist-cms/packages/core/validation/utils/index.js +1 -0
  143. package/dist-cms/packages/core/validation/utils/is-above-zero-and-below-minimum.function.d.ts +7 -0
  144. package/dist-cms/packages/core/validation/utils/is-above-zero-and-below-minimum.function.js +9 -0
  145. package/dist-cms/packages/core/variant/index.d.ts +1 -0
  146. package/dist-cms/packages/core/variant/index.js +1 -0
  147. package/dist-cms/packages/core/variant/variant-object-sort-compare.function.d.ts +22 -0
  148. package/dist-cms/packages/core/variant/variant-object-sort-compare.function.js +29 -0
  149. package/dist-cms/packages/core/workspace/components/workspace-action/common/submit/submit.action.js +21 -11
  150. package/dist-cms/packages/core/workspace/components/workspace-header-name-editable/workspace-header-name-editable.element.d.ts +1 -0
  151. package/dist-cms/packages/core/workspace/components/workspace-header-name-editable/workspace-header-name-editable.element.js +26 -3
  152. package/dist-cms/packages/core/workspace/contexts/tokens/submittable-workspace-context.interface.d.ts +2 -0
  153. package/dist-cms/packages/core/workspace/controllers/resolve-stale-variant-route.function.d.ts +3 -0
  154. package/dist-cms/packages/core/workspace/controllers/resolve-stale-variant-route.function.js +7 -0
  155. package/dist-cms/packages/core/workspace/controllers/workspace-stale-variant-redirect.controller.d.ts +3 -0
  156. package/dist-cms/packages/core/workspace/controllers/workspace-stale-variant-redirect.controller.js +8 -0
  157. package/dist-cms/packages/core/workspace/entity-detail/entity-detail-workspace-base.d.ts +8 -1
  158. package/dist-cms/packages/core/workspace/entity-detail/entity-detail-workspace-base.js +13 -1
  159. package/dist-cms/packages/core/workspace/entity-detail/global-components/entity-detail-workspace-editor.element.js +1 -1
  160. package/dist-cms/packages/core/workspace/extensions/workspace-action-menu-item.model.d.ts +1 -1
  161. package/dist-cms/packages/core/workspace/namable/namable-workspace-context.interface.d.ts +2 -0
  162. package/dist-cms/packages/core/workspace/workspace-property-dataset/invariant-workspace-property-dataset-context.d.ts +2 -1
  163. package/dist-cms/packages/core/workspace/workspace-property-dataset/invariant-workspace-property-dataset-context.js +6 -1
  164. package/dist-cms/packages/data-type/components/data-type-input/data-type-input.element.d.ts +6 -6
  165. package/dist-cms/packages/data-type/components/data-type-input/data-type-input.element.js +27 -34
  166. package/dist-cms/packages/data-type/workspace/views/details/data-type-details-workspace-property-editor-picker.element.d.ts +1 -0
  167. package/dist-cms/packages/data-type/workspace/views/details/data-type-details-workspace-property-editor-picker.element.js +19 -6
  168. package/dist-cms/packages/data-type/workspace/views/details/data-type-details-workspace-view.element.d.ts +1 -0
  169. package/dist-cms/packages/data-type/workspace/views/details/data-type-details-workspace-view.element.js +8 -0
  170. package/dist-cms/packages/dictionary/workspace/views/workspace-view-dictionary-editor.element.d.ts +1 -0
  171. package/dist-cms/packages/dictionary/workspace/views/workspace-view-dictionary-editor.element.js +7 -0
  172. package/dist-cms/packages/documents/document-blueprints/workspace/document-blueprint-workspace-editor.element.js +1 -9
  173. package/dist-cms/packages/documents/document-blueprints/workspace/views/info/document-blueprint-workspace-view-info.element.js +1 -0
  174. package/dist-cms/packages/documents/document-types/components/input-document-type/input-document-type.element.d.ts +8 -7
  175. package/dist-cms/packages/documents/document-types/components/input-document-type/input-document-type.element.js +28 -20
  176. package/dist-cms/packages/documents/document-types/workspace/document-type/views/settings/document-type-workspace-view-settings.element.d.ts +1 -0
  177. package/dist-cms/packages/documents/document-types/workspace/document-type/views/settings/document-type-workspace-view-settings.element.js +13 -1
  178. package/dist-cms/packages/documents/document-types/workspace/document-type/views/structure/document-type-workspace-view-structure.element.d.ts +1 -0
  179. package/dist-cms/packages/documents/document-types/workspace/document-type/views/structure/document-type-workspace-view-structure.element.js +8 -0
  180. package/dist-cms/packages/documents/document-types/workspace/document-type/views/templates/document-type-workspace-view-templates.element.d.ts +1 -0
  181. package/dist-cms/packages/documents/document-types/workspace/document-type/views/templates/document-type-workspace-view-templates.element.js +6 -0
  182. package/dist-cms/packages/documents/documents/components/input-document/input-document.element.d.ts +6 -6
  183. package/dist-cms/packages/documents/documents/components/input-document/input-document.element.js +11 -19
  184. package/dist-cms/packages/documents/documents/entity-actions/move-to/repository/document-move.server.data-source.js +1 -1
  185. package/dist-cms/packages/documents/documents/entity-bulk-actions/move-to/repository/move-to.repository.js +5 -2
  186. package/dist-cms/packages/documents/documents/publishing/schedule-publish/modal/document-schedule-modal.element.d.ts +1 -0
  187. package/dist-cms/packages/documents/documents/publishing/schedule-publish/modal/document-schedule-modal.element.js +62 -19
  188. package/dist-cms/packages/documents/documents/publishing/schedule-publish/modal/document-schedule-modal.token.d.ts +5 -0
  189. package/dist-cms/packages/documents/documents/publishing/schedule-publish/modal/mirror-schedules.function.d.ts +9 -0
  190. package/dist-cms/packages/documents/documents/publishing/schedule-publish/modal/mirror-schedules.function.js +13 -0
  191. package/dist-cms/packages/documents/documents/publishing/workspace-context/document-publishing.workspace-context.js +13 -0
  192. package/dist-cms/packages/documents/documents/rollback/modal/rollback-modal.element.js +9 -3
  193. package/dist-cms/packages/documents/documents/rollback/repository/rollback.repository.js +1 -0
  194. package/dist-cms/packages/documents/documents/user-permissions/document-property-value/workspace-context/property-value-user-permission-workspace-context-base.d.ts +1 -0
  195. package/dist-cms/packages/documents/documents/user-permissions/document-property-value/workspace-context/property-value-user-permission-workspace-context-base.js +20 -1
  196. package/dist-cms/packages/documents/documents/workspace/context/document-workspace.context.d.ts +1 -0
  197. package/dist-cms/packages/documents/documents/workspace/context/document-workspace.context.js +11 -1
  198. package/dist-cms/packages/documents/documents/workspace/document-workspace-editor.element.js +1 -9
  199. package/dist-cms/packages/documents/documents/workspace/views/info/document-workspace-view-info.element.js +1 -0
  200. package/dist-cms/packages/language/components/input-language/input-language.element.d.ts +6 -6
  201. package/dist-cms/packages/language/components/input-language/input-language.element.js +15 -19
  202. package/dist-cms/packages/language/workspace/language/views/language-details-workspace-view.element.d.ts +1 -0
  203. package/dist-cms/packages/language/workspace/language/views/language-details-workspace-view.element.js +9 -0
  204. package/dist-cms/packages/management-api/detail/cache-invalidation.manager.js +12 -1
  205. package/dist-cms/packages/management-api/detail/cache.d.ts +17 -0
  206. package/dist-cms/packages/management-api/detail/cache.js +25 -0
  207. package/dist-cms/packages/management-api/detail/detail-data.request-manager.js +5 -25
  208. package/dist-cms/packages/management-api/item/cache-invalidation.manager.js +12 -1
  209. package/dist-cms/packages/management-api/item/cache.d.ts +17 -0
  210. package/dist-cms/packages/management-api/item/cache.js +25 -0
  211. package/dist-cms/packages/management-api/item/item-data.request-manager.js +2 -22
  212. package/dist-cms/packages/media/media/collection/media-collection.context.d.ts +2 -1
  213. package/dist-cms/packages/media/media/collection/media-collection.context.js +5 -16
  214. package/dist-cms/packages/media/media/components/input-media/input-media.element.d.ts +6 -6
  215. package/dist-cms/packages/media/media/components/input-media/input-media.element.js +11 -19
  216. package/dist-cms/packages/media/media/components/input-rich-media/input-rich-media.element.d.ts +8 -7
  217. package/dist-cms/packages/media/media/components/input-rich-media/input-rich-media.element.js +35 -34
  218. package/dist-cms/packages/media/media/dropzone/media-dropzone.manager.js +54 -29
  219. package/dist-cms/packages/media/media/dropzone/modals/dropzone-media-type-picker/dropzone-media-type-picker-modal.element.js +43 -15
  220. package/dist-cms/packages/media/media/property-editors/media-picker/Umbraco.MediaPicker.js +1 -1
  221. package/dist-cms/packages/media/media-types/components/input-media-type/input-media-type.element.d.ts +14 -6
  222. package/dist-cms/packages/media/media-types/components/input-media-type/input-media-type.element.js +49 -26
  223. package/dist-cms/packages/media/media-types/workspace/views/structure/media-type-workspace-view-structure.element.d.ts +1 -0
  224. package/dist-cms/packages/media/media-types/workspace/views/structure/media-type-workspace-view-structure.element.js +8 -0
  225. package/dist-cms/packages/members/member/components/input-member/input-member.element.d.ts +6 -6
  226. package/dist-cms/packages/members/member/components/input-member/input-member.element.js +11 -19
  227. package/dist-cms/packages/members/member-group/components/input-member-group/input-member-group.element.d.ts +6 -6
  228. package/dist-cms/packages/members/member-group/components/input-member-group/input-member-group.element.js +21 -22
  229. package/dist-cms/packages/members/member-type/components/input-member-type/input-member-type.element.d.ts +6 -6
  230. package/dist-cms/packages/members/member-type/components/input-member-type/input-member-type.element.js +6 -19
  231. package/dist-cms/packages/multi-url-picker/components/input-multi-url/input-multi-url.element.d.ts +8 -7
  232. package/dist-cms/packages/multi-url-picker/components/input-multi-url/input-multi-url.element.js +23 -20
  233. package/dist-cms/packages/multi-url-picker/property-editor/Umbraco.MultiUrlPicker.js +1 -1
  234. package/dist-cms/packages/performance-profiling/dashboard-performance-profiling.element.d.ts +3 -3
  235. package/dist-cms/packages/performance-profiling/dashboard-performance-profiling.element.js +20 -8
  236. package/dist-cms/packages/property-editors/content-picker/Umbraco.MultiNodeTreePicker.js +1 -1
  237. package/dist-cms/packages/property-editors/content-picker/components/input-content/input-content.element.d.ts +6 -6
  238. package/dist-cms/packages/property-editors/content-picker/components/input-content/input-content.element.js +1 -15
  239. package/dist-cms/packages/property-editors/content-picker/property-editor-ui-content-picker.element.d.ts +0 -2
  240. package/dist-cms/packages/property-editors/content-picker/property-editor-ui-content-picker.element.js +0 -12
  241. package/dist-cms/packages/property-editors/entity-data-picker/input/input-entity-data.element.d.ts +6 -6
  242. package/dist-cms/packages/property-editors/entity-data-picker/input/input-entity-data.element.js +11 -19
  243. package/dist-cms/packages/property-editors/entity-data-picker/property-editor/Umbraco.EntityDataPicker.js +1 -0
  244. package/dist-cms/packages/property-editors/entity-data-picker/property-editor/entity-data-picker-property-editor-ui.element.d.ts +0 -2
  245. package/dist-cms/packages/property-editors/entity-data-picker/property-editor/entity-data-picker-property-editor-ui.element.js +0 -12
  246. package/dist-cms/packages/property-editors/multiple-text-string/Umbraco.MultipleTextString.js +1 -1
  247. package/dist-cms/packages/static-file/components/input-static-file/input-static-file.element.d.ts +6 -6
  248. package/dist-cms/packages/static-file/components/input-static-file/input-static-file.element.js +7 -21
  249. package/dist-cms/packages/templating/partial-views/workspace/manifests.js +1 -5
  250. package/dist-cms/packages/templating/partial-views/workspace/partial-view-workspace-editor.element.d.ts +1 -5
  251. package/dist-cms/packages/templating/partial-views/workspace/partial-view-workspace-editor.element.js +4 -14
  252. package/dist-cms/packages/templating/partial-views/workspace/partial-view-workspace.context.d.ts +1 -0
  253. package/dist-cms/packages/templating/partial-views/workspace/partial-view-workspace.context.js +24 -0
  254. package/dist-cms/packages/templating/partial-views/workspace/views/code-editor/partial-view-code-editor-workspace-view.element.d.ts +1 -5
  255. package/dist-cms/packages/templating/partial-views/workspace/views/code-editor/partial-view-code-editor-workspace-view.element.js +6 -16
  256. package/dist-cms/packages/templating/scripts/workspace/views/code-editor/script-code-editor-workspace-view.element.d.ts +1 -0
  257. package/dist-cms/packages/templating/scripts/workspace/views/code-editor/script-code-editor-workspace-view.element.js +6 -0
  258. package/dist-cms/packages/templating/stylesheets/global-components/stylesheet-input/stylesheet-input.element.d.ts +6 -6
  259. package/dist-cms/packages/templating/stylesheets/global-components/stylesheet-input/stylesheet-input.element.js +5 -16
  260. package/dist-cms/packages/templating/stylesheets/workspace/views/code-editor/stylesheet-code-editor-workspace-view.element.d.ts +1 -0
  261. package/dist-cms/packages/templating/stylesheets/workspace/views/code-editor/stylesheet-code-editor-workspace-view.element.js +7 -1
  262. package/dist-cms/packages/templating/templates/global-components/input-template/input-template.element.d.ts +13 -6
  263. package/dist-cms/packages/templating/templates/global-components/input-template/input-template.element.js +33 -25
  264. package/dist-cms/packages/templating/templates/global-components/template-card/template-card.element.d.ts +7 -0
  265. package/dist-cms/packages/templating/templates/global-components/template-card/template-card.element.js +26 -10
  266. package/dist-cms/packages/templating/templates/workspace/manifests.js +1 -5
  267. package/dist-cms/packages/templating/templates/workspace/template-workspace-editor.element.d.ts +1 -5
  268. package/dist-cms/packages/templating/templates/workspace/template-workspace-editor.element.js +16 -15
  269. package/dist-cms/packages/templating/templates/workspace/template-workspace.context.d.ts +1 -0
  270. package/dist-cms/packages/templating/templates/workspace/template-workspace.context.js +24 -0
  271. package/dist-cms/packages/templating/templates/workspace/views/code-editor/template-code-editor-workspace-view.element.d.ts +1 -5
  272. package/dist-cms/packages/templating/templates/workspace/views/code-editor/template-code-editor-workspace-view.element.js +9 -19
  273. package/dist-cms/packages/tiptap/extensions/media-upload/media-upload.tiptap-api.js +3 -3
  274. package/dist-cms/packages/ufm/utils/index.d.ts +1 -0
  275. package/dist-cms/packages/ufm/utils/index.js +1 -0
  276. package/dist-cms/packages/ufm/utils/render-ufm.function.d.ts +12 -0
  277. package/dist-cms/packages/ufm/utils/render-ufm.function.js +22 -0
  278. package/dist-cms/packages/user/current-user/conditions/group-id/group-id.condition-config.d.ts +4 -4
  279. package/dist-cms/packages/user/current-user/current-user.context.d.ts +1 -0
  280. package/dist-cms/packages/user/current-user/current-user.context.js +14 -3
  281. package/dist-cms/packages/user/current-user/user-entry-point/user-entry-point-extension-initializer.js +11 -1
  282. package/dist-cms/packages/user/user/collection/user-collection-header.element.js +1 -1
  283. package/dist-cms/packages/user/user/components/user-input/user-input.element.d.ts +8 -7
  284. package/dist-cms/packages/user/user/components/user-input/user-input.element.js +46 -44
  285. package/dist-cms/packages/user/user-group/collection/repository/user-group-collection.repository.d.ts +16 -0
  286. package/dist-cms/packages/user/user-group/collection/repository/user-group-collection.repository.js +23 -0
  287. package/dist-cms/packages/user/user-group/components/input-user-group/user-group-input.element.d.ts +6 -6
  288. package/dist-cms/packages/user/user-group/components/input-user-group/user-group-input.element.js +5 -16
  289. package/dist-cms/packages/user/user-group/modals/user-group-picker/user-group-picker-modal.element.js +1 -1
  290. package/dist-cms/packages/webhook/components/input-webhook-headers.element.d.ts +7 -0
  291. package/dist-cms/packages/webhook/components/input-webhook-headers.element.js +27 -3
  292. package/dist-cms/packages/webhook/webhook/workspace/views/webhook-details-workspace-view.element.d.ts +1 -0
  293. package/dist-cms/packages/webhook/webhook/workspace/views/webhook-details-workspace-view.element.js +16 -5
  294. package/dist-cms/packages/webhook/webhook/workspace/webhook-workspace-editor.element.d.ts +1 -0
  295. package/dist-cms/packages/webhook/webhook/workspace/webhook-workspace-editor.element.js +19 -1
  296. package/dist-cms/packages/webhook/webhook-event/input-webhook-events.element.d.ts +7 -0
  297. package/dist-cms/packages/webhook/webhook-event/input-webhook-events.element.js +34 -12
  298. package/dist-cms/tsconfig.build.tsbuildinfo +1 -1
  299. package/examples/multi-brand-block-views/README.md +27 -0
  300. package/examples/multi-brand-block-views/article-teaser-block-view.element.ts +53 -0
  301. package/examples/multi-brand-block-views/block-view-base.element.ts +78 -0
  302. package/examples/multi-brand-block-views/block-view.styles.ts +95 -0
  303. package/examples/multi-brand-block-views/block-view.utils.ts +60 -0
  304. package/examples/multi-brand-block-views/entry-point.ts +17 -0
  305. package/examples/multi-brand-block-views/hero-block-view.element.ts +88 -0
  306. package/examples/multi-brand-block-views/image-block-view.element.ts +48 -0
  307. package/examples/multi-brand-block-views/index.ts +67 -0
  308. package/examples/multi-brand-block-views/layout-block-view.element.ts +55 -0
  309. package/examples/multi-brand-block-views/material-showcase-block-view.element.ts +106 -0
  310. package/examples/multi-brand-block-views/product-teaser-block-view.element.ts +96 -0
  311. package/examples/multi-brand-block-views/text-block-view.element.ts +53 -0
  312. package/package.json +3 -2
  313. package/umbraco-package-schema.json +69 -28
  314. package/vscode-html-custom-data.json +250 -140
@@ -34,7 +34,8 @@ export declare class UmbApiInterceptorController extends UmbControllerBase {
34
34
  addErrorInterceptor(client: typeof umbHttpClient): void;
35
35
  /**
36
36
  * Interceptor which checks responses for the umb-notifications header and displays them as a notification if any.
37
- * @param {umbHttpClient} client The OpenAPI client to add the interceptor to. It can be any client supporting Response and Request interceptors.
37
+ * The error of a failed response that carried notifications is marked with `notifiedByServer`.
38
+ * @param {umbHttpClient} client The OpenAPI client to add the interceptor to. It can be any client supporting Response, Request and Error interceptors.
38
39
  * @internal
39
40
  */
40
41
  addUmbNotificationsInterceptor(client: typeof umbHttpClient): void;
@@ -230,31 +230,36 @@ export class UmbApiInterceptorController extends UmbControllerBase {
230
230
  }
231
231
  /**
232
232
  * Interceptor which checks responses for the umb-notifications header and displays them as a notification if any.
233
- * @param {umbHttpClient} client The OpenAPI client to add the interceptor to. It can be any client supporting Response and Request interceptors.
233
+ * The error of a failed response that carried notifications is marked with `notifiedByServer`.
234
+ * @param {umbHttpClient} client The OpenAPI client to add the interceptor to. It can be any client supporting Response, Request and Error interceptors.
234
235
  * @internal
235
236
  */
236
237
  addUmbNotificationsInterceptor(client) {
237
238
  client.interceptors.response.use((response) => {
238
- // Check if the response has the umb-notifications header
239
- // If not, we just return the response
240
- const umbNotifications = response.headers.get(UMB_NOTIFICATION_HEADER);
241
- if (!umbNotifications)
242
- return response;
243
- // Parse the notifications from the header
244
- // If the header is not a valid JSON, we just return the response
245
- try {
246
- const notifications = JSON.parse(umbNotifications);
247
- if (!isUmbNotifications(notifications))
248
- return response;
249
- for (const notification of notifications) {
250
- this.#peekError(notification.category, notification.message, undefined, extractUmbNotificationColor(notification.type));
251
- }
252
- }
253
- catch {
254
- // Ignore JSON parse errors
239
+ for (const notification of this.#getUmbNotifications(response)) {
240
+ this.#peekError(notification.category, notification.message, undefined, extractUmbNotificationColor(notification.type));
255
241
  }
256
242
  return response;
257
243
  });
244
+ client.interceptors.error?.use((error, response) => {
245
+ if (!response || !isProblemDetailsLike(error) || this.#getUmbNotifications(response).length === 0) {
246
+ return error;
247
+ }
248
+ return { ...error, notifiedByServer: true };
249
+ });
250
+ }
251
+ #getUmbNotifications(response) {
252
+ const umbNotifications = response.headers.get(UMB_NOTIFICATION_HEADER);
253
+ if (!umbNotifications)
254
+ return [];
255
+ try {
256
+ const notifications = JSON.parse(umbNotifications);
257
+ return isUmbNotifications(notifications) ? notifications : [];
258
+ }
259
+ catch {
260
+ // Ignore JSON parse errors
261
+ return [];
262
+ }
258
263
  }
259
264
  /**
260
265
  * Observes the auth signaler's authorization state to retry GET-requests that received a 401
@@ -25,7 +25,7 @@ export class UmbResourceController extends UmbControllerBase {
25
25
  else if (UmbCancelError.isUmbCancelError(error)) {
26
26
  return error;
27
27
  }
28
- else if (error instanceof DOMException && error.name === 'AbortError') {
28
+ else if (error instanceof DOMException && (error.name === 'AbortError' || error.name === 'TimeoutError')) {
29
29
  return new UmbCancelError(error.message);
30
30
  }
31
31
  else if (UmbApiError.isUmbApiError(error)) {
@@ -7,10 +7,10 @@ import { UmbApiError, UmbCancelError } from '../umb-error.js';
7
7
  */
8
8
  const IGNORED_ERROR_CODES = new Set([401, 403, 404]);
9
9
  /**
10
- * Operation statuses that are ignored for notifications.
11
- * These are operation statuses where the server already sends a notification
12
- * via the Umb-Notifications response header, so we avoid showing a duplicate
13
- * notification from the ProblemDetails body.
10
+ * Operation statuses that are ignored for notifications when the server notified about them itself.
11
+ * A notification handler that cancels an operation can explain why in the Umb-Notifications response header,
12
+ * which makes the ProblemDetails body a duplicate. Without that explanation, the ProblemDetails body is all
13
+ * the user gets.
14
14
  */
15
15
  const IGNORED_OPERATION_STATUSES = new Set(['CancelledByNotification']);
16
16
  /**
@@ -23,8 +23,7 @@ const IGNORED_OPERATION_STATUSES = new Set(['CancelledByNotification']);
23
23
  * @returns {boolean} True when a notification is shown for this error, false when it is suppressed.
24
24
  */
25
25
  export function apiErrorWasNotified(error) {
26
- // The UmbError type guards read `.name` off the argument, so anything that is not an object has to be
27
- // rejected first. It also cannot have come from tryExecute, so nothing was notified for it.
26
+ // Anything that is not an object cannot have come from tryExecute, so nothing was notified for it.
28
27
  if (error === null || typeof error !== 'object') {
29
28
  return false;
30
29
  }
@@ -38,5 +37,7 @@ export function apiErrorWasNotified(error) {
38
37
  if (IGNORED_ERROR_CODES.has(error.problemDetails.status)) {
39
38
  return false;
40
39
  }
41
- return !(error.problemDetails.operationStatus && IGNORED_OPERATION_STATUSES.has(error.problemDetails.operationStatus));
40
+ return !(error.problemDetails.operationStatus &&
41
+ IGNORED_OPERATION_STATUSES.has(error.problemDetails.operationStatus) &&
42
+ error.problemDetails.notifiedByServer);
42
43
  }
@@ -21,6 +21,11 @@ export interface UmbProblemDetails {
21
21
  operationStatus?: string;
22
22
  extensions?: Record<string, unknown>;
23
23
  errors?: Record<string, string[]>;
24
+ /**
25
+ * Set by the backoffice, not the server: true when the failed response also carried notifications from the
26
+ * server (the `Umb-Notifications` header), which have been shown to the user.
27
+ */
28
+ notifiedByServer?: boolean;
24
29
  }
25
30
  export interface UmbTryExecuteOptions {
26
31
  /**
@@ -4,7 +4,7 @@ export class UmbError extends Error {
4
4
  this.name = 'UmbError';
5
5
  }
6
6
  static isUmbError(error) {
7
- return error instanceof UmbError || error.name === 'UmbError';
7
+ return error instanceof UmbError || error?.name === 'UmbError';
8
8
  }
9
9
  }
10
10
  export class UmbCancelError extends UmbError {
@@ -13,7 +13,7 @@ export class UmbCancelError extends UmbError {
13
13
  this.name = 'UmbCancelError';
14
14
  }
15
15
  static isUmbCancelError(error) {
16
- return error instanceof UmbCancelError || error.name === 'UmbCancelError';
16
+ return error instanceof UmbCancelError || error?.name === 'UmbCancelError';
17
17
  }
18
18
  /**
19
19
  * Transforms a CancelError into an UmbCancelError.
@@ -37,7 +37,7 @@ export class UmbApiError extends UmbError {
37
37
  this.problemDetails = problemDetails;
38
38
  }
39
39
  static isUmbApiError(error) {
40
- return error instanceof UmbApiError || error.name === 'UmbApiError';
40
+ return error instanceof UmbApiError || error?.name === 'UmbApiError';
41
41
  }
42
42
  /**
43
43
  * Transforms an ApiError into an UmbApiError.
@@ -11,12 +11,12 @@ export declare class UmbInputSectionElement extends UmbInputSectionElement_base
11
11
  set min(value: number);
12
12
  get min(): number;
13
13
  /**
14
- * Min validation message.
14
+ * Min validation message. When not set, a localized message stating the minimum and how many more items are needed is used.
15
15
  * @type {string}
16
16
  * @attr
17
- * @default
17
+ * @default undefined
18
18
  */
19
- minMessage: string;
19
+ minMessage?: string;
20
20
  /**
21
21
  * This is a maximum amount of selected items in this input.
22
22
  * @type {number}
@@ -26,12 +26,12 @@ export declare class UmbInputSectionElement extends UmbInputSectionElement_base
26
26
  set max(value: number);
27
27
  get max(): number;
28
28
  /**
29
- * Max validation message.
29
+ * Max validation message. When not set, a localized message stating the maximum and how many items are over it is used.
30
30
  * @type {string}
31
31
  * @attr
32
- * @default
32
+ * @default undefined
33
33
  */
34
- maxMessage: string;
34
+ maxMessage?: string;
35
35
  set selection(uniques: Array<string>);
36
36
  get selection(): Array<string>;
37
37
  set value(selectionString: string | undefined);
@@ -8,7 +8,7 @@ import { UmbSectionPickerInputContext } from './input-section.context.js';
8
8
  import { css, html, customElement, property, state, repeat } from '../../../../../external/lit/index.js';
9
9
  import { UmbLitElement } from '../../../lit-element/index.js';
10
10
  import { splitStringToArray } from '../../../utils/index.js';
11
- import { UmbFormControlMixin } from '../../../validation/index.js';
11
+ import { isAboveZeroAndBelowMinimum, UmbFormControlMixin } from '../../../validation/index.js';
12
12
  let UmbInputSectionElement = class UmbInputSectionElement extends UmbFormControlMixin(UmbLitElement) {
13
13
  /**
14
14
  * This is a minimum amount of selected items in this input.
@@ -46,26 +46,13 @@ let UmbInputSectionElement = class UmbInputSectionElement extends UmbFormControl
46
46
  get value() {
47
47
  return this.selection.length > 0 ? this.selection.join(',') : undefined;
48
48
  }
49
- #pickerContext;
49
+ #pickerContext = new UmbSectionPickerInputContext(this);
50
50
  constructor() {
51
51
  super();
52
- /**
53
- * Min validation message.
54
- * @type {string}
55
- * @attr
56
- * @default
57
- */
58
- this.minMessage = 'This field needs more items';
59
- /**
60
- * Max validation message.
61
- * @type {string}
62
- * @attr
63
- * @default
64
- */
65
- this.maxMessage = 'This field exceeds the allowed amount of items';
66
- this.#pickerContext = new UmbSectionPickerInputContext(this);
67
- this.addValidator('rangeUnderflow', () => this.minMessage, () => !!this.min && this.#pickerContext.getSelection().length < this.min);
68
- this.addValidator('rangeOverflow', () => this.maxMessage, () => !!this.max && this.#pickerContext.getSelection().length > this.max);
52
+ this.addValidator('rangeUnderflow', () => this.minMessage ||
53
+ this.localize.term('validation_entriesShort', this.min, (this.min ?? 0) - this.#pickerContext.getSelection().length), () => isAboveZeroAndBelowMinimum(this.#pickerContext.getSelection().length, this.min));
54
+ this.addValidator('rangeOverflow', () => this.maxMessage ||
55
+ this.localize.term('validation_entriesExceed', this.max, this.#pickerContext.getSelection().length - (this.max ?? 0)), () => !!this.max && this.#pickerContext.getSelection().length > this.max);
69
56
  this.observe(this.#pickerContext.selection, (selection) => (this.value = selection.join(',')), null);
70
57
  this.observe(this.#pickerContext.selectedItems, (selectedItems) => (this._items = [...selectedItems].sort((a, b) => (b.weight ?? 0) - (a.weight ?? 0))), null);
71
58
  }
@@ -7,7 +7,7 @@ export declare class UmbServerContext extends UmbContextBase {
7
7
  /**
8
8
  * Observable that provides the full server information.
9
9
  * Every subscriber shares one request: the server is asked for its information at most once per
10
- * app session, no matter how many consumers observe this or the derived `isProductionMode`.
10
+ * app session, no matter how many consumers observe this or the derived `isProductionMode` and `isDebugMode`.
11
11
  */
12
12
  readonly serverInformation: import("rxjs").Observable<ServerInformationResponseModel | undefined>;
13
13
  /**
@@ -16,6 +16,11 @@ export declare class UmbServerContext extends UmbContextBase {
16
16
  * UI consumers should treat undefined as restricted (safe default).
17
17
  */
18
18
  readonly isProductionMode: import("rxjs").Observable<boolean | undefined>;
19
+ /**
20
+ * Observable that emits true when the server is running in debug mode,
21
+ * false when not, or undefined until server information is loaded.
22
+ */
23
+ readonly isDebugMode: import("rxjs").Observable<boolean | undefined>;
19
24
  constructor(host: UmbControllerHost, config: UmbServerContextConfig);
20
25
  getBackofficePath(): string;
21
26
  getServerUrl(): string;
@@ -17,7 +17,7 @@ export class UmbServerContext extends UmbContextBase {
17
17
  /**
18
18
  * Observable that provides the full server information.
19
19
  * Every subscriber shares one request: the server is asked for its information at most once per
20
- * app session, no matter how many consumers observe this or the derived `isProductionMode`.
20
+ * app session, no matter how many consumers observe this or the derived `isProductionMode` and `isDebugMode`.
21
21
  */
22
22
  this.serverInformation = defer(() => {
23
23
  this.#requestServerInformation();
@@ -29,6 +29,11 @@ export class UmbServerContext extends UmbContextBase {
29
29
  * UI consumers should treat undefined as restricted (safe default).
30
30
  */
31
31
  this.isProductionMode = this.serverInformation.pipe(map((info) => (info ? info.runtimeMode === RuntimeModeModel.PRODUCTION : undefined)));
32
+ /**
33
+ * Observable that emits true when the server is running in debug mode,
34
+ * false when not, or undefined until server information is loaded.
35
+ */
36
+ this.isDebugMode = this.serverInformation.pipe(map((info) => (info ? info.isDebugMode : undefined)));
32
37
  this.#serverUrl = config.serverUrl;
33
38
  this.#backofficePath = config.backofficePath;
34
39
  this.#serverConnection = config.serverConnection;
@@ -128,7 +128,7 @@ export class UmbSorterController extends UmbControllerBase {
128
128
  this.#dragY = 0;
129
129
  this.#elements = Array();
130
130
  this.#initialize = () => {
131
- if (this.#isConnected === false)
131
+ if (this.#isConnected === false || this.#enabled === false)
132
132
  return;
133
133
  if (this.#containerElement) {
134
134
  // This can happen, so no need to show an error as it seems to be happening in some cases. We will just reject. [NL]
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { UmbValidationInvalidEvent, UmbValidationValidEvent } from '../events/index.js';
8
8
  import { css, customElement, html, property, repeat, unsafeHTML } from '../../../../external/lit/index.js';
9
9
  import { UmbLitElement } from '../../lit-element/index.js';
10
+ import { sanitizeHTML } from '../../utils/index.js';
10
11
  /**
11
12
  * @description - Component for displaying one or more validation messages from UMB/UUI Form Control within the given scope.
12
13
  * Notice: Only supports components that is build on the UMB / UUI FormControlMixing.
@@ -76,7 +77,7 @@ let UmbFormValidationMessageElement = class UmbFormValidationMessageElement exte
76
77
  return html `
77
78
  <slot></slot>
78
79
  <div id="messages">
79
- ${repeat(this._messages, (item) => html `<div>${unsafeHTML(item[1])}</div>`)}
80
+ ${repeat(this._messages, (item) => html `<div>${unsafeHTML(sanitizeHTML(item[1]))}</div>`)}
80
81
  <slot name="message"></slot>
81
82
  </div>
82
83
  `;
@@ -1,2 +1,3 @@
1
1
  export declare const UMB_VALIDATION_EMPTY_LOCALIZATION_KEY = "#validation_invalidEmpty";
2
+ export declare const UMB_VALIDATION_MISSING_LOCALIZATION_KEY = "#validation_invalidNull";
2
3
  export declare const UMB_VALIDATION_FALSE_LOCALIZATION_KEY = "#validation_invalidFalse";
@@ -1,2 +1,3 @@
1
1
  export const UMB_VALIDATION_EMPTY_LOCALIZATION_KEY = '#validation_invalidEmpty';
2
+ export const UMB_VALIDATION_MISSING_LOCALIZATION_KEY = '#validation_invalidNull';
2
3
  export const UMB_VALIDATION_FALSE_LOCALIZATION_KEY = '#validation_invalidFalse';
@@ -1,8 +1,18 @@
1
1
  import { UmbValidationPathTranslationController } from '../controllers/validation-path-translation/index.js';
2
+ import { UMB_VALIDATION_EMPTY_LOCALIZATION_KEY, UMB_VALIDATION_MISSING_LOCALIZATION_KEY } from '../const.js';
2
3
  import { UMB_VALIDATION_CONTEXT } from './validation.context-token.js';
3
4
  import { UMB_SERVER_MODEL_VALIDATOR_CONTEXT } from './server-model-validator.context-token.js';
4
5
  import { UmbContextBase } from '../../../../libs/class-api/index.js';
5
6
  import { UmbId } from '../../id/index.js';
7
+ /**
8
+ * The server reports a value that is missing separately from one that is present but empty. That distinction is
9
+ * meaningful over the API, but not when the message is presented, so both map to the same message.
10
+ * @param {string} body - the message as returned by the server.
11
+ * @returns {string} the message to present.
12
+ */
13
+ function convertMissingToEmpty(body) {
14
+ return body === UMB_VALIDATION_MISSING_LOCALIZATION_KEY ? UMB_VALIDATION_EMPTY_LOCALIZATION_KEY : body;
15
+ }
6
16
  export class UmbServerModelValidatorContext extends UmbContextBase {
7
17
  #pathTranslators = [];
8
18
  #validatePromise;
@@ -73,7 +83,7 @@ export class UmbServerModelValidatorContext extends UmbContextBase {
73
83
  if (path.endsWith('.Value')) {
74
84
  path = path.slice(0, -6) + '.value';
75
85
  }
76
- newBodies.forEach((body) => messages.push({ type: 'server', key: UmbId.new(), path, body }));
86
+ newBodies.forEach((body) => messages.push({ type: 'server', key: UmbId.new(), path, body: convertMissingToEmpty(body) }));
77
87
  //this.#context!.messages.addMessages('server', path, errorBody.errors[path]);
78
88
  });
79
89
  }
@@ -3,6 +3,7 @@ export * from './data-path-variant-query.function.js';
3
3
  export * from './extract-first-json-query-containing.function.js';
4
4
  export * from './extract-json-query-properties.function.js';
5
5
  export * from './first-json-path-bracket.function.js';
6
+ export * from './is-above-zero-and-below-minimum.function.js';
6
7
  export * from './json-path.function.js';
7
8
  export * from './scope-mapper-json-paths.function.js';
8
9
  export * from './query-mapper-json-paths.function.js';
@@ -3,6 +3,7 @@ export * from './data-path-variant-query.function.js';
3
3
  export * from './extract-first-json-query-containing.function.js';
4
4
  export * from './extract-json-query-properties.function.js';
5
5
  export * from './first-json-path-bracket.function.js';
6
+ export * from './is-above-zero-and-below-minimum.function.js';
6
7
  export * from './json-path.function.js';
7
8
  export * from './scope-mapper-json-paths.function.js';
8
9
  export * from './query-mapper-json-paths.function.js';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Determines whether a count is above zero and below the configured minimum.
3
+ * @param {number} count - the number of items held.
4
+ * @param {number | undefined} min - the configured minimum, where undefined or zero means no minimum.
5
+ * @returns {boolean} true when the count is above zero and below the minimum.
6
+ */
7
+ export declare function isAboveZeroAndBelowMinimum(count: number, min: number | undefined): boolean;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Determines whether a count is above zero and below the configured minimum.
3
+ * @param {number} count - the number of items held.
4
+ * @param {number | undefined} min - the configured minimum, where undefined or zero means no minimum.
5
+ * @returns {boolean} true when the count is above zero and below the minimum.
6
+ */
7
+ export function isAboveZeroAndBelowMinimum(count, min) {
8
+ return !!min && count > 0 && count < min;
9
+ }
@@ -3,5 +3,6 @@ export * from './context/index.js';
3
3
  export * from './sort-variants.function.js';
4
4
  export * from './variant-id.class.js';
5
5
  export * from './variant-object-compare.function.js';
6
+ export * from './variant-object-sort-compare.function.js';
6
7
  export * from './variant-resolver.js';
7
8
  export type * from './types.js';
@@ -3,4 +3,5 @@ export * from './context/index.js';
3
3
  export * from './sort-variants.function.js';
4
4
  export * from './variant-id.class.js';
5
5
  export * from './variant-object-compare.function.js';
6
+ export * from './variant-object-sort-compare.function.js';
6
7
  export * from './variant-resolver.js';
@@ -0,0 +1,22 @@
1
+ type UmbSortableVariantObject = {
2
+ culture?: string | null;
3
+ segment?: string | null;
4
+ };
5
+ /**
6
+ * Compares two culture or segment codes, invariant (nullish) first, then ordinally and case-sensitively,
7
+ * matching .NET's `StringComparer.Ordinal`.
8
+ * @param {string | null | undefined} a - The first code to compare.
9
+ * @param {string | null | undefined} b - The second code to compare.
10
+ * @returns {number} A negative number if `a` sorts before `b`, positive if after, zero if equal.
11
+ */
12
+ export declare function umbVariantCodeSortCompare(a: string | null | undefined, b: string | null | undefined): number;
13
+ /**
14
+ * Compares two variant objects by culture, then by segment, in the order the Management API returns
15
+ * variant collections in (invariant first, then ordinal and case-sensitive).
16
+ * This is not the display order of `sortVariants`, which prioritizes default language, mandatory state and publish state.
17
+ * @param {UmbSortableVariantObject} a - The first object to compare.
18
+ * @param {UmbSortableVariantObject} b - The second object to compare.
19
+ * @returns {number} A negative number if `a` sorts before `b`, positive if after, zero if equal.
20
+ */
21
+ export declare function umbVariantObjectSortCompare(a: UmbSortableVariantObject, b: UmbSortableVariantObject): number;
22
+ export {};
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Compares two culture or segment codes, invariant (nullish) first, then ordinally and case-sensitively,
3
+ * matching .NET's `StringComparer.Ordinal`.
4
+ * @param {string | null | undefined} a - The first code to compare.
5
+ * @param {string | null | undefined} b - The second code to compare.
6
+ * @returns {number} A negative number if `a` sorts before `b`, positive if after, zero if equal.
7
+ */
8
+ export function umbVariantCodeSortCompare(a, b) {
9
+ const normalizedA = a ?? null;
10
+ const normalizedB = b ?? null;
11
+ if (normalizedA === normalizedB)
12
+ return 0;
13
+ if (normalizedA === null)
14
+ return -1;
15
+ if (normalizedB === null)
16
+ return 1;
17
+ return normalizedA < normalizedB ? -1 : 1;
18
+ }
19
+ /**
20
+ * Compares two variant objects by culture, then by segment, in the order the Management API returns
21
+ * variant collections in (invariant first, then ordinal and case-sensitive).
22
+ * This is not the display order of `sortVariants`, which prioritizes default language, mandatory state and publish state.
23
+ * @param {UmbSortableVariantObject} a - The first object to compare.
24
+ * @param {UmbSortableVariantObject} b - The second object to compare.
25
+ * @returns {number} A negative number if `a` sorts before `b`, positive if after, zero if equal.
26
+ */
27
+ export function umbVariantObjectSortCompare(a, b) {
28
+ return umbVariantCodeSortCompare(a.culture, b.culture) || umbVariantCodeSortCompare(a.segment, b.segment);
29
+ }
@@ -1,12 +1,14 @@
1
1
  import { UMB_SUBMITTABLE_WORKSPACE_CONTEXT } from '../../../../contexts/tokens/index.js';
2
2
  import { UmbWorkspaceActionBase } from '../../workspace-action-base.controller.js';
3
3
  export class UmbSubmitWorkspaceAction extends UmbWorkspaceActionBase {
4
+ #hasUnique = false;
5
+ #isReadOnly = false;
4
6
  constructor(host, args) {
5
7
  super(host, args);
6
8
  // TODO: Could we make change label depending on the state? [NL]
7
9
  this._retrieveWorkspaceContext = this.consumeContext(args.workspaceContextToken ?? UMB_SUBMITTABLE_WORKSPACE_CONTEXT, (context) => {
8
10
  this._workspaceContext = context;
9
- this.#observeUnique();
11
+ this.#observeSubmittable();
10
12
  this._gotWorkspaceContext();
11
13
  })
12
14
  .asPromise()
@@ -14,19 +16,27 @@ export class UmbSubmitWorkspaceAction extends UmbWorkspaceActionBase {
14
16
  return undefined;
15
17
  });
16
18
  }
17
- #observeUnique() {
19
+ #observeSubmittable() {
18
20
  this.observe(this._workspaceContext?.unique, (unique) => {
19
- if (!this._workspaceContext)
20
- return;
21
21
  // We can't save if we don't have a unique
22
- if (unique === undefined) {
23
- this.disable();
24
- }
25
- else {
26
- // Dangerous, cause this could enable despite a class extension decided to disable it?. [NL]
27
- this.enable();
28
- }
22
+ this.#hasUnique = unique !== undefined;
23
+ this.#updateIsDisabled();
29
24
  }, 'saveWorkspaceActionUniqueObserver');
25
+ this.observe(this._workspaceContext?.readOnlyGuard?.permitted, (isReadOnly) => {
26
+ this.#isReadOnly = isReadOnly ?? false;
27
+ this.#updateIsDisabled();
28
+ }, 'saveWorkspaceActionReadOnlyObserver');
29
+ }
30
+ #updateIsDisabled() {
31
+ if (!this._workspaceContext)
32
+ return;
33
+ if (this.#hasUnique && !this.#isReadOnly) {
34
+ // Dangerous, cause this could enable despite a class extension decided to disable it?. [NL]
35
+ this.enable();
36
+ }
37
+ else {
38
+ this.disable();
39
+ }
30
40
  }
31
41
  _gotWorkspaceContext() {
32
42
  // Override in subclass
@@ -18,6 +18,7 @@ export declare class UmbWorkspaceHeaderNameEditableElement extends UmbLitElement
18
18
  readonly: boolean;
19
19
  private _name;
20
20
  private _isWritableName;
21
+ private _isReadOnly;
21
22
  constructor();
22
23
  render(): import("lit-html").TemplateResult<1>;
23
24
  static styles: import("lit").CSSResult[];
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { UMB_NAMABLE_WORKSPACE_CONTEXT } from '../../namable/index.js';
8
8
  import { UmbTextStyles } from '../../../style/index.js';
9
- import { css, html, customElement, state, property } from '../../../../../external/lit/index.js';
9
+ import { css, html, customElement, nothing, state, property } from '../../../../../external/lit/index.js';
10
10
  import { umbFocus, UmbLitElement } from '../../../lit-element/index.js';
11
11
  import { UUIInputEvent } from '../../../../../external/uui/index.js';
12
12
  import { umbBindToValidation } from '../../../validation/index.js';
@@ -21,12 +21,17 @@ let UmbWorkspaceHeaderNameEditableElement = class UmbWorkspaceHeaderNameEditable
21
21
  this.readonly = false;
22
22
  this._name = '';
23
23
  this._isWritableName = true;
24
+ this._isReadOnly = false;
24
25
  this.consumeContext(UMB_NAMABLE_WORKSPACE_CONTEXT, (workspaceContext) => {
25
26
  this.#workspaceContext = workspaceContext;
26
27
  this.#observeName();
27
28
  this.#observeNameWriteGuardRules();
29
+ this.#observeReadOnly();
28
30
  });
29
31
  }
32
+ #observeReadOnly() {
33
+ this.observe(this.#workspaceContext?.readOnlyGuard?.permitted, (isReadOnly) => (this._isReadOnly = isReadOnly ?? false), 'umbObserveWorkspaceReadOnly');
34
+ }
30
35
  #observeNameWriteGuardRules() {
31
36
  this.observe(this.#workspaceContext?.nameWriteGuard?.isPermittedForName(), (isPermitted) => {
32
37
  this._isWritableName = isPermitted ?? true;
@@ -57,10 +62,16 @@ let UmbWorkspaceHeaderNameEditableElement = class UmbWorkspaceHeaderNameEditable
57
62
  @input="${this.#onNameInput}"
58
63
  label=${this.label ?? this.localize.term('placeholders_entername')}
59
64
  placeholder=${this.placeholder ?? this.localize.term('placeholders_entername')}
60
- ?readonly=${this.readonly || !this._isWritableName}
65
+ ?readonly=${this.readonly || this._isReadOnly || !this._isWritableName}
61
66
  required
62
67
  ${umbBindToValidation(this, `$.name`, this._name)}
63
- ${umbFocus()}></uui-input>`;
68
+ ${umbFocus()}>
69
+ ${this._isReadOnly
70
+ ? html `<uui-tag id="read-only-tag" slot="append" look="secondary">
71
+ ${this.localize.term('general_readOnly')}
72
+ </uui-tag>`
73
+ : nothing}
74
+ </uui-input>`;
64
75
  }
65
76
  static { this.styles = [
66
77
  UmbTextStyles,
@@ -72,6 +83,12 @@ let UmbWorkspaceHeaderNameEditableElement = class UmbWorkspaceHeaderNameEditable
72
83
  #nameInput {
73
84
  flex: 1 1 auto;
74
85
  }
86
+
87
+ #read-only-tag {
88
+ align-self: center;
89
+ margin: 0 var(--uui-size-space-2);
90
+ white-space: nowrap;
91
+ }
75
92
  `,
76
93
  ]; }
77
94
  };
@@ -81,12 +98,18 @@ __decorate([
81
98
  __decorate([
82
99
  property()
83
100
  ], UmbWorkspaceHeaderNameEditableElement.prototype, "placeholder", void 0);
101
+ __decorate([
102
+ property({ type: Boolean })
103
+ ], UmbWorkspaceHeaderNameEditableElement.prototype, "readonly", void 0);
84
104
  __decorate([
85
105
  state()
86
106
  ], UmbWorkspaceHeaderNameEditableElement.prototype, "_name", void 0);
87
107
  __decorate([
88
108
  state()
89
109
  ], UmbWorkspaceHeaderNameEditableElement.prototype, "_isWritableName", void 0);
110
+ __decorate([
111
+ state()
112
+ ], UmbWorkspaceHeaderNameEditableElement.prototype, "_isReadOnly", void 0);
90
113
  UmbWorkspaceHeaderNameEditableElement = __decorate([
91
114
  customElement('umb-workspace-header-name-editable')
92
115
  ], UmbWorkspaceHeaderNameEditableElement);
@@ -1,9 +1,11 @@
1
1
  import type { UmbEntityWorkspaceContext } from './entity-workspace-context.interface.js';
2
2
  import type { UmbRoutableWorkspaceContext } from './routable-workspace-context.interface.js';
3
3
  import type { Observable } from '../../../../../external/rxjs/index.js';
4
+ import type { UmbGuardRule, UmbReadOnlyGuardManager } from '../../../utils/index.js';
4
5
  export interface UmbSubmittableWorkspaceContext extends UmbEntityWorkspaceContext, UmbRoutableWorkspaceContext {
5
6
  isNew: Observable<boolean | undefined>;
6
7
  getIsNew(): boolean | undefined;
7
8
  requestSubmit(): Promise<void>;
8
9
  destroy(): void;
10
+ readonly readOnlyGuard?: UmbReadOnlyGuardManager<UmbGuardRule>;
9
11
  }
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * A minimal variant option descriptor consumed by {@link resolveStaleVariantRoute}.
3
+ * @deprecated Deprecated since v17.9. This is specific to content workspaces and no longer used by the core. Scheduled for removal in Umbraco 20.
3
4
  */
4
5
  export interface UmbStaleVariantRouteResolverVariant {
5
6
  culture: string | null;
@@ -8,6 +9,7 @@ export interface UmbStaleVariantRouteResolverVariant {
8
9
  }
9
10
  /**
10
11
  * The arguments for {@link resolveStaleVariantRoute}.
12
+ * @deprecated Deprecated since v17.9. This is specific to content workspaces and no longer used by the core. Scheduled for removal in Umbraco 20.
11
13
  */
12
14
  export interface UmbStaleVariantRouteResolverArgs {
13
15
  /**
@@ -33,5 +35,6 @@ export interface UmbStaleVariantRouteResolverArgs {
33
35
  * Split-view parts are resolved individually and deduplicated.
34
36
  * @param {UmbStaleVariantRouteResolverArgs} args - The current path, workspace route, variant options and app culture.
35
37
  * @returns {string | null} The corrected path without the query string, or null when the URL is valid or not applicable.
38
+ * @deprecated Deprecated since v17.9. This is specific to content workspaces and no longer used by the core. Scheduled for removal in Umbraco 20.
36
39
  */
37
40
  export declare function resolveStaleVariantRoute(args: UmbStaleVariantRouteResolverArgs): string | null;