@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
@@ -5,6 +5,7 @@
5
5
  */
6
6
  export class UmbManagementApiItemDataCache {
7
7
  #entries = new Map();
8
+ #serverEventsConnected = false;
8
9
  /**
9
10
  * Checks if an entry exists in the cache
10
11
  * @param {string} id - The ID of the entry to check
@@ -61,4 +62,28 @@ export class UmbManagementApiItemDataCache {
61
62
  clear() {
62
63
  this.#entries.clear();
63
64
  }
65
+ /**
66
+ * Whether server events are connected, which is the condition under which cached entries
67
+ * can be trusted, as server events are what invalidate them.
68
+ * The cache's invalidation manager owns this state for the lifetime of the app, so every
69
+ * consumer reads the same value, including one constructed after the connection changed.
70
+ * Without an invalidation manager it stays false, and consumers read from the server.
71
+ * @returns {boolean} - True if server events are connected, false otherwise
72
+ * @memberof UmbManagementApiItemDataCache
73
+ */
74
+ get serverEventsConnected() {
75
+ return this.#serverEventsConnected;
76
+ }
77
+ /**
78
+ * Sets whether server events are connected, clearing the cache when they are not.
79
+ * Called by the cache's invalidation manager.
80
+ * @param {boolean} value - True if server events are connected, false otherwise
81
+ * @memberof UmbManagementApiItemDataCache
82
+ */
83
+ setServerEventsConnected(value) {
84
+ this.#serverEventsConnected = value;
85
+ if (value === false) {
86
+ this.clear();
87
+ }
88
+ }
64
89
  }
@@ -1,29 +1,22 @@
1
- import { UMB_MANAGEMENT_API_SERVER_EVENT_CONTEXT } from '../server-event/constants.js';
2
1
  import { UmbControllerBase } from '../../../libs/class-api/index.js';
3
2
  import { UmbItemDataApiGetRequestController } from '../../core/entity-item/index.js';
4
3
  export class UmbManagementApiItemDataRequestManager extends UmbControllerBase {
5
4
  #dataCache;
6
5
  #inflightRequestCache;
7
- #serverEventContext;
8
6
  #getItems;
9
- #isConnectedToServerEvents = false;
10
7
  constructor(host, args) {
11
8
  super(host);
12
9
  this.#getItems = args.getItems;
13
10
  this.#dataCache = args.dataCache;
14
11
  this.#inflightRequestCache = args.inflightRequestCache;
15
12
  this.getUniqueMethod = args.getUniqueMethod;
16
- this.consumeContext(UMB_MANAGEMENT_API_SERVER_EVENT_CONTEXT, (context) => {
17
- this.#serverEventContext = context;
18
- this.#observeServerEventsConnection();
19
- });
20
13
  }
21
14
  async getItems(ids) {
22
15
  let error;
23
16
  let idsToRequest = [...ids];
24
17
  let cacheItems = [];
25
18
  // Only read from the cache when we are connected to the server events
26
- if (this.#isConnectedToServerEvents) {
19
+ if (this.#dataCache.serverEventsConnected) {
27
20
  const cachedIds = ids.filter((id) => this.#dataCache.has(id));
28
21
  cacheItems = cachedIds
29
22
  .map((id) => this.#dataCache.get(id))
@@ -64,7 +57,7 @@ export class UmbManagementApiItemDataRequestManager extends UmbControllerBase {
64
57
  const { data: serverData, error: serverError } = await getItemsController.request();
65
58
  const serverItems = serverData ?? [];
66
59
  error = serverError;
67
- if (this.#isConnectedToServerEvents) {
60
+ if (this.#dataCache.serverEventsConnected) {
68
61
  serverItems.forEach((item) => this.#dataCache.set(this.getUniqueMethod(item), item));
69
62
  }
70
63
  newlyFetchedItems = serverItems;
@@ -102,17 +95,4 @@ export class UmbManagementApiItemDataRequestManager extends UmbControllerBase {
102
95
  const data = [...cacheItems, ...inflightItems, ...newlyFetchedItems];
103
96
  return { data, error };
104
97
  }
105
- #observeServerEventsConnection() {
106
- this.observe(this.#serverEventContext?.isConnected, (isConnected) => {
107
- /* We purposefully ignore the initial value of isConnected.
108
- We only care about whether the connection is established or not (true/false) */
109
- if (isConnected === undefined)
110
- return;
111
- this.#isConnectedToServerEvents = isConnected;
112
- // Clear the cache if we lose connection to the server events
113
- if (this.#isConnectedToServerEvents === false) {
114
- this.#dataCache.clear();
115
- }
116
- }, 'umbObserveServerEventsConnection');
117
- }
118
98
  }
@@ -2,6 +2,7 @@ import type { UmbMediaCollectionFilterModel, UmbMediaCollectionItemModel } from
2
2
  import type { UmbFileDropzoneItemStatus } from '../../dropzone/index.js';
3
3
  import { UmbDefaultCollectionContext } from '../../../core/collection/index.js';
4
4
  import type { UmbControllerHost } from '../../../../libs/controller-api/index.js';
5
+ import type { UmbPagedModel } from '../../../core/repository/index.js';
5
6
  export declare class UmbMediaCollectionContext extends UmbDefaultCollectionContext<UmbMediaCollectionItemModel, UmbMediaCollectionFilterModel> {
6
7
  #private;
7
8
  readonly placeholders: import("rxjs").Observable<UmbMediaCollectionItemModel[]>;
@@ -20,7 +21,7 @@ export declare class UmbMediaCollectionContext extends UmbDefaultCollectionConte
20
21
  * @memberof UmbMediaCollectionContext
21
22
  */
22
23
  requestCollection(): Promise<void>;
23
- protected _requestCollection(): Promise<void>;
24
+ protected _setCollectionData(data: UmbPagedModel<UmbMediaCollectionItemModel>): void;
24
25
  /**
25
26
  * Returns the href for a specific media collection item.
26
27
  * @param {UmbMediaCollectionItemModel} item - The media item to get the href for.
@@ -51,22 +51,11 @@ export class UmbMediaCollectionContext extends UmbDefaultCollectionContext {
51
51
  }).warn();
52
52
  return this._requestCollection();
53
53
  }
54
- async _requestCollection() {
55
- await this._init;
56
- if (!this._configured)
57
- this._configure();
58
- if (!this._repository)
59
- throw new Error(`Missing repository for ${this._manifest}`);
60
- this._loading.setValue(true);
61
- const filter = this._filter.getValue();
62
- const { data } = await this._repository.requestCollection(filter);
63
- if (data) {
64
- this.#cleanupPlaceholdersFromCollection(data.items);
65
- const placeholders = this.#placeholders.getValue();
66
- this._items.setValue([...placeholders, ...data.items]);
67
- this._setTotalItems(placeholders.length + data.total);
68
- }
69
- this._loading.setValue(false);
54
+ _setCollectionData(data) {
55
+ this.#cleanupPlaceholdersFromCollection(data.items);
56
+ const placeholders = this.#placeholders.getValue();
57
+ this._items.setValue([...placeholders, ...data.items]);
58
+ this._setTotalItems(placeholders.length + data.total);
70
59
  }
71
60
  #cleanupPlaceholdersFromCollection(collection) {
72
61
  const placeholderItems = this.#placeholders.getValue();
@@ -15,12 +15,12 @@ export declare class UmbInputMediaElement extends UmbInputMediaElement_base {
15
15
  set min(value: number);
16
16
  get min(): number;
17
17
  /**
18
- * Min validation message.
18
+ * Min validation message. When not set, a localized message stating the minimum and how many more items are needed is used.
19
19
  * @type {string}
20
20
  * @attr
21
- * @default
21
+ * @default undefined
22
22
  */
23
- minMessage: string;
23
+ minMessage?: string;
24
24
  /**
25
25
  * This is a maximum amount of selected items in this input.
26
26
  * @type {number}
@@ -30,12 +30,12 @@ export declare class UmbInputMediaElement extends UmbInputMediaElement_base {
30
30
  set max(value: number);
31
31
  get max(): number;
32
32
  /**
33
- * Max validation message.
33
+ * Max validation message. When not set, a localized message stating the maximum and how many items are over it is used.
34
34
  * @type {string}
35
35
  * @attr
36
- * @default
36
+ * @default undefined
37
37
  */
38
- maxMessage: string;
38
+ maxMessage?: string;
39
39
  set selection(ids: Array<string>);
40
40
  get selection(): Array<string>;
41
41
  allowedContentTypeIds?: Array<string>;
@@ -8,7 +8,7 @@ import { UmbMediaPickerFolderFilter, UmbMediaPickerInputContext } from './input-
8
8
  import { css, customElement, html, ifDefined, nothing, property, repeat, state, } from '../../../../../external/lit/index.js';
9
9
  import { splitStringToArray } from '../../../../core/utils/index.js';
10
10
  import { UmbChangeEvent } from '../../../../core/event/index.js';
11
- import { UmbFormControlMixin } from '../../../../core/validation/index.js';
11
+ import { isAboveZeroAndBelowMinimum, UmbFormControlMixin } from '../../../../core/validation/index.js';
12
12
  import { UmbEntityInputInteractionMemoryManager } from '../../../../core/entity/index.js';
13
13
  import { UmbLitElement } from '../../../../core/lit-element/index.js';
14
14
  import { UmbModalRouteRegistrationController } from '../../../../core/router/index.js';
@@ -38,6 +38,7 @@ let UmbInputMediaElement = class UmbInputMediaElement extends UmbFormControlMixi
38
38
  */
39
39
  set max(value) {
40
40
  this.#pickerInputContext.max = value;
41
+ this.#updateSorterEnabled();
41
42
  }
42
43
  get max() {
43
44
  return this.#pickerInputContext.max;
@@ -67,14 +68,17 @@ let UmbInputMediaElement = class UmbInputMediaElement extends UmbFormControlMixi
67
68
  }
68
69
  set readonly(value) {
69
70
  this.#readonly = value;
70
- if (this.#readonly) {
71
+ this.#updateSorterEnabled();
72
+ }
73
+ #readonly;
74
+ #updateSorterEnabled() {
75
+ if (this.readonly || this.max === 1) {
71
76
  this.#sorter.disable();
72
77
  }
73
78
  else {
74
79
  this.#sorter.enable();
75
80
  }
76
81
  }
77
- #readonly;
78
82
  get interactionMemories() {
79
83
  return this.#interactionMemoryManager.getMemories();
80
84
  }
@@ -102,20 +106,6 @@ let UmbInputMediaElement = class UmbInputMediaElement extends UmbFormControlMixi
102
106
  this.dispatchEvent(new UmbChangeEvent());
103
107
  },
104
108
  });
105
- /**
106
- * Min validation message.
107
- * @type {string}
108
- * @attr
109
- * @default
110
- */
111
- this.minMessage = 'This field needs more items';
112
- /**
113
- * Max validation message.
114
- * @type {string}
115
- * @attr
116
- * @default
117
- */
118
- this.maxMessage = 'This field exceeds the allowed amount of items';
119
109
  this.includeTrashed = false;
120
110
  this.folderFilter = UmbMediaPickerFolderFilter.FILES_AND_FOLDERS;
121
111
  this.#readonly = false;
@@ -135,8 +125,10 @@ let UmbInputMediaElement = class UmbInputMediaElement extends UmbFormControlMixi
135
125
  this.observe(this.#pickerInputContext.selection, (selection) => (this.value = selection.join(',')), null);
136
126
  this.observe(this.#pickerInputContext.selectedItems, (selectedItems) => (this._items = selectedItems), null);
137
127
  this.observe(this.#pickerInputContext.statuses, (statuses) => (this._statuses = statuses), null);
138
- this.addValidator('rangeUnderflow', () => this.minMessage, () => !this.readonly && !!this.min && this.selection.length < this.min);
139
- this.addValidator('rangeOverflow', () => this.maxMessage, () => !this.readonly && !!this.max && this.selection.length > this.max);
128
+ this.addValidator('rangeUnderflow', () => this.minMessage ||
129
+ this.localize.term('validation_entriesShort', this.min, (this.min ?? 0) - this.selection.length), () => !this.readonly && isAboveZeroAndBelowMinimum(this.selection.length, this.min));
130
+ this.addValidator('rangeOverflow', () => this.maxMessage ||
131
+ this.localize.term('validation_entriesExceed', this.max, this.selection.length - (this.max ?? 0)), () => !this.readonly && !!this.max && this.selection.length > this.max);
140
132
  }
141
133
  #openPicker() {
142
134
  this.#pickerInputContext.openPicker({
@@ -20,26 +20,27 @@ export declare class UmbInputRichMediaElement extends UmbInputRichMediaElement_b
20
20
  */
21
21
  min: number;
22
22
  /**
23
- * Min validation message.
23
+ * Min validation message. When not set, a localized message stating the minimum and how many more items are needed is used.
24
24
  * @type {string}
25
25
  * @attr
26
- * @default
26
+ * @default undefined
27
27
  */
28
- minMessage: string;
28
+ minMessage?: string;
29
29
  /**
30
30
  * This is a maximum amount of selected items in this input.
31
31
  * @type {number}
32
32
  * @attr
33
33
  * @default Infinity
34
34
  */
35
- max: number;
35
+ set max(value: number);
36
+ get max(): number;
36
37
  /**
37
- * Max validation message.
38
+ * Max validation message. When not set, a localized message stating the maximum and how many items are over it is used.
38
39
  * @type {string}
39
40
  * @attr
40
- * @default
41
+ * @default undefined
41
42
  */
42
- maxMessage: string;
43
+ maxMessage?: string;
43
44
  set value(value: Array<UmbMediaPickerPropertyValueEntry> | undefined);
44
45
  get value(): Array<UmbMediaPickerPropertyValueEntry> | undefined;
45
46
  allowedContentTypeIds?: string[];
@@ -6,6 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { UMB_IMAGE_CROPPER_EDITOR_MODAL } from '../../modals/index.js';
8
8
  import { UMB_MEDIA_ITEM_REPOSITORY_ALIAS } from '../../repository/constants.js';
9
+ import { UMB_MEDIA_ENTITY_TYPE } from '../../entity.js';
9
10
  import { UmbMediaPickerInputContext } from '../input-media/input-media.context.js';
10
11
  import { UmbFileDropzoneItemStatus } from '../../../dropzone/index.js';
11
12
  import { css, customElement, html, nothing, property, repeat, state } from '../../../../../external/lit/index.js';
@@ -14,13 +15,27 @@ import { UmbId } from '../../../../core/id/index.js';
14
15
  import { UmbLitElement } from '../../../../core/lit-element/index.js';
15
16
  import { UmbModalRouteRegistrationController } from '../../../../core/router/index.js';
16
17
  import { UmbSorterController, UmbSorterResolvePlacementAsGrid } from '../../../../core/sorter/index.js';
17
- import { UMB_VALIDATION_EMPTY_LOCALIZATION_KEY, UmbFormControlMixin } from '../../../../core/validation/index.js';
18
+ import { isAboveZeroAndBelowMinimum, UMB_VALIDATION_EMPTY_LOCALIZATION_KEY, UmbFormControlMixin, } from '../../../../core/validation/index.js';
18
19
  import { UmbRepositoryItemsManager } from '../../../../core/repository/index.js';
19
20
  import { UMB_MEDIA_TYPE_ENTITY_TYPE } from '../../../media-types/index.js';
20
21
  import '../../../imaging/index.js';
21
22
  import { UmbEntityInputInteractionMemoryManager } from '../../../../core/entity/index.js';
22
23
  let UmbInputRichMediaElement = class UmbInputRichMediaElement extends UmbFormControlMixin(UmbLitElement, undefined) {
23
24
  #sorter;
25
+ /**
26
+ * This is a maximum amount of selected items in this input.
27
+ * @type {number}
28
+ * @attr
29
+ * @default Infinity
30
+ */
31
+ set max(value) {
32
+ this.#max = value;
33
+ this.#updateSorterEnabled();
34
+ }
35
+ get max() {
36
+ return this.#max;
37
+ }
38
+ #max;
24
39
  set value(value) {
25
40
  super.value = value;
26
41
  this.#sorter.setModel(value);
@@ -50,14 +65,17 @@ let UmbInputRichMediaElement = class UmbInputRichMediaElement extends UmbFormCon
50
65
  }
51
66
  set readonly(value) {
52
67
  this.#readonly = value;
53
- if (this.#readonly) {
68
+ this.#updateSorterEnabled();
69
+ }
70
+ #readonly;
71
+ #updateSorterEnabled() {
72
+ if (this.readonly || this.max === 1) {
54
73
  this.#sorter.disable();
55
74
  }
56
75
  else {
57
76
  this.#sorter.enable();
58
77
  }
59
78
  }
60
- #readonly;
61
79
  get interactionMemories() {
62
80
  return this.#interactionMemoryManager.getMemories();
63
81
  }
@@ -93,27 +111,7 @@ let UmbInputRichMediaElement = class UmbInputRichMediaElement extends UmbFormCon
93
111
  * @default 0
94
112
  */
95
113
  this.min = 0;
96
- /**
97
- * Min validation message.
98
- * @type {string}
99
- * @attr
100
- * @default
101
- */
102
- this.minMessage = 'This field needs more items';
103
- /**
104
- * This is a maximum amount of selected items in this input.
105
- * @type {number}
106
- * @attr
107
- * @default Infinity
108
- */
109
- this.max = Infinity;
110
- /**
111
- * Max validation message.
112
- * @type {string}
113
- * @attr
114
- * @default
115
- */
116
- this.maxMessage = 'This field exceeds the allowed amount of items';
114
+ this.#max = Infinity;
117
115
  this.multiple = false;
118
116
  this.#focalPointEnabled = false;
119
117
  this.#readonly = false;
@@ -183,14 +181,10 @@ let UmbInputRichMediaElement = class UmbInputRichMediaElement extends UmbFormCon
183
181
  this.addValidator('valueMissing', () => this.requiredMessage ?? UMB_VALIDATION_EMPTY_LOCALIZATION_KEY, () => {
184
182
  return !this.readonly && !!this.required && (!this.value || this.value.length === 0);
185
183
  });
186
- this.addValidator('rangeUnderflow', () => this.minMessage, () => !this.readonly &&
187
- // Only if min is set:
188
- !!this.min &&
189
- // if the value is empty and not required, we should not validate the min:
190
- !(this.value?.length === 0 && this.required == false) &&
191
- // Validate the min:
192
- (this.value?.length ?? 0) < this.min);
193
- this.addValidator('rangeOverflow', () => this.maxMessage, () => !this.readonly && !!this.value && !!this.max && this.value?.length > this.max);
184
+ this.addValidator('rangeUnderflow', () => this.minMessage ||
185
+ this.localize.term('validation_entriesShort', this.min, (this.min ?? 0) - (this.value?.length ?? 0)), () => !this.readonly && isAboveZeroAndBelowMinimum(this.value?.length ?? 0, this.min));
186
+ this.addValidator('rangeOverflow', () => this.maxMessage ||
187
+ this.localize.term('validation_entriesExceed', this.max, (this.value?.length ?? 0) - (this.max ?? 0)), () => !this.readonly && !!this.value && !!this.max && this.value?.length > this.max);
194
188
  }
195
189
  getFormElement() {
196
190
  return undefined;
@@ -202,6 +196,7 @@ let UmbInputRichMediaElement = class UmbInputRichMediaElement extends UmbFormCon
202
196
  const media = mediaItems.find((x) => x.unique === item.mediaKey);
203
197
  const isNotFound = this._statuses.find((x) => x.unique === item.mediaKey)?.state.type === 'error';
204
198
  return {
199
+ entityType: media?.entityType ?? UMB_MEDIA_ENTITY_TYPE,
205
200
  unique: item.key,
206
201
  media: item.mediaKey,
207
202
  name: media?.name ?? '',
@@ -316,7 +311,13 @@ let UmbInputRichMediaElement = class UmbInputRichMediaElement extends UmbFormCon
316
311
  }
317
312
  const href = this.readonly ? undefined : this._routeBuilder?.({ key: item.unique });
318
313
  return html `
319
- <uui-card-media id=${item.unique} title=${item.name} name=${item.name} .href=${href} ?readonly=${this.readonly}>
314
+ <uui-card-media
315
+ id=${item.unique}
316
+ data-mark="${item.entityType}:${item.media}"
317
+ title=${item.name}
318
+ name=${item.name}
319
+ .href=${href}
320
+ ?readonly=${this.readonly}>
320
321
  <umb-media-thumbnail
321
322
  .unique=${item.media}
322
323
  .alt=${item.name}
@@ -410,7 +411,7 @@ __decorate([
410
411
  ], UmbInputRichMediaElement.prototype, "minMessage", void 0);
411
412
  __decorate([
412
413
  property({ type: Number })
413
- ], UmbInputRichMediaElement.prototype, "max", void 0);
414
+ ], UmbInputRichMediaElement.prototype, "max", null);
414
415
  __decorate([
415
416
  property({ type: String, attribute: 'max-message' })
416
417
  ], UmbInputRichMediaElement.prototype, "maxMessage", void 0);
@@ -38,16 +38,17 @@ export class UmbMediaDropzoneManager extends UmbDropzoneManager {
38
38
  if (!uploadableItems.length)
39
39
  return [];
40
40
  if (uploadableItems.length === 1) {
41
- // When there is only one item being uploaded, allow the user to pick the media type, if more than one is allowed.
42
41
  this.#createOneMediaItem(uploadableItems[0]);
43
42
  }
44
43
  else {
45
- // When there are multiple items being uploaded, automatically pick the media types for each item. We probably want to allow the user to pick the media type in the future.
46
44
  this.#createMediaItems(uploadableItems);
47
45
  }
48
46
  return uploadableItems;
49
47
  }
50
48
  async #createMediaItems(uploadableItems) {
49
+ // Items in the same location offering the same media type choices share one pick, so the user is asked once per
50
+ // kind of item there.
51
+ const pickedMediaTypes = new Map();
51
52
  for (const item of uploadableItems) {
52
53
  const { options, availableMediaTypes } = await this.#getMediaTypeOptions(item);
53
54
  if (!options.length) {
@@ -55,12 +56,12 @@ export class UmbMediaDropzoneManager extends UmbDropzoneManager {
55
56
  this._updateStatus(item, UmbFileDropzoneItemStatus.NOT_ALLOWED, message);
56
57
  continue;
57
58
  }
58
- // Prefer a specific extension match over a fallback
59
- const specificMatch = options.find((x) => x.matchedFileExtension === true);
60
- const { unique: mediaTypeUnique, name: mediaTypeName } = specificMatch ?? options[0];
59
+ const mediaTypeUnique = await this.#resolveMediaTypeUnique(item, options, uploadableItems, pickedMediaTypes);
61
60
  if (!mediaTypeUnique) {
62
- throw new Error('Media type unique is not defined');
61
+ this._updateStatus(item, UmbFileDropzoneItemStatus.CANCELLED);
62
+ continue;
63
63
  }
64
+ const mediaTypeName = options.find((o) => o.unique === mediaTypeUnique)?.name ?? '';
64
65
  // Handle files and folders differently: a file is uploaded as temp then created as a media item, and a folder is created as a media item directly.
65
66
  // Awaiting ensures parent folders exist on the server before their children are processed.
66
67
  if (item.temporaryFile) {
@@ -215,12 +216,55 @@ export class UmbMediaDropzoneManager extends UmbDropzoneManager {
215
216
  const { data } = await this.#mediaDetailRepository.createScaffold(preset);
216
217
  return data;
217
218
  }
218
- async #showDialogMediaTypePicker(options) {
219
- const value = await umbOpenModal(this, UMB_DROPZONE_MEDIA_TYPE_PICKER_MODAL, { data: { options } }).catch(() => undefined);
219
+ async #resolveMediaTypeUnique(item, options, items = [item], pickedMediaTypes) {
220
+ if (options.length === 1)
221
+ return options[0].unique ?? undefined;
222
+ // Prefer specific extension matches over catch-all fallbacks, and only ask when several specific matches remain.
223
+ const specificMatches = options.filter((x) => x.matchedFileExtension === true);
224
+ if (specificMatches.length === 1)
225
+ return specificMatches[0].unique ?? undefined;
226
+ if (specificMatches.length === 0)
227
+ return options[0].unique ?? undefined;
228
+ const pickerKey = this.#getPickerKey(specificMatches);
229
+ const pickKey = `${item.parentUnique}|${pickerKey}`;
230
+ if (pickedMediaTypes?.has(pickKey))
231
+ return pickedMediaTypes.get(pickKey);
232
+ const files = await this.#getFilesSharingPick(item, pickerKey, items);
233
+ const mediaTypeUnique = await this.#showDialogMediaTypePicker(specificMatches, files);
234
+ pickedMediaTypes?.set(pickKey, mediaTypeUnique);
235
+ return mediaTypeUnique;
236
+ }
237
+ #getPickerKey(specificMatches) {
238
+ return specificMatches
239
+ .map((x) => x.unique)
240
+ .sort()
241
+ .join('|');
242
+ }
243
+ // The files in the same location as the item whose choices match, so the picker can name every file the pick
244
+ // applies to. Within one location the choices only depend on the file extension.
245
+ async #getFilesSharingPick(item, pickerKey, items) {
246
+ const keyByExtension = new Map();
247
+ const files = [];
248
+ for (const other of items) {
249
+ if (!other.temporaryFile || other.parentUnique !== item.parentUnique)
250
+ continue;
251
+ const extension = getFileExtension(other.temporaryFile.file.name);
252
+ if (!keyByExtension.has(extension)) {
253
+ const { options } = await this.#getMediaTypeOptions(other);
254
+ const specificMatches = options.filter((x) => x.matchedFileExtension === true);
255
+ keyByExtension.set(extension, options.length > 1 ? this.#getPickerKey(specificMatches) : undefined);
256
+ }
257
+ if (keyByExtension.get(extension) === pickerKey)
258
+ files.push(other.temporaryFile.file);
259
+ }
260
+ return files;
261
+ }
262
+ async #showDialogMediaTypePicker(options, files) {
263
+ const value = await umbOpenModal(this, UMB_DROPZONE_MEDIA_TYPE_PICKER_MODAL, { data: { options, files } }).catch(() => undefined);
220
264
  if (!value)
221
265
  return undefined; // cancelled
222
266
  // Auto-pick: mediaTypeUnique is undefined → use the server's preferred type (first in the list)
223
- return value.mediaTypeUnique ?? options[0]?.unique;
267
+ return value.mediaTypeUnique ?? options[0]?.unique ?? undefined;
224
268
  }
225
269
  async #createOneMediaItem(item) {
226
270
  const { options, availableMediaTypes } = await this.#getMediaTypeOptions(item);
@@ -234,26 +278,7 @@ export class UmbMediaDropzoneManager extends UmbDropzoneManager {
234
278
  });
235
279
  return this._updateStatus(item, UmbFileDropzoneItemStatus.NOT_ALLOWED, message);
236
280
  }
237
- let mediaTypeUnique;
238
- if (options.length > 1) {
239
- // When multiple options are available, prefer specific extension matches over fallbacks
240
- const specificMatches = options.filter((x) => x.matchedFileExtension === true);
241
- if (specificMatches.length === 1) {
242
- // Exactly one specific match — auto-select it (e.g., Article for .pdf when both Article and File are allowed)
243
- mediaTypeUnique = specificMatches[0].unique;
244
- }
245
- else if (specificMatches.length > 1) {
246
- // Multiple specific matches — let the user pick from those
247
- mediaTypeUnique = await this.#showDialogMediaTypePicker(specificMatches);
248
- }
249
- else {
250
- // All fallbacks — auto-select the first one
251
- mediaTypeUnique = options[0].unique;
252
- }
253
- }
254
- else {
255
- mediaTypeUnique = options[0].unique;
256
- }
281
+ const mediaTypeUnique = await this.#resolveMediaTypeUnique(item, options);
257
282
  if (!mediaTypeUnique) {
258
283
  return this._updateStatus(item, UmbFileDropzoneItemStatus.CANCELLED);
259
284
  }
@@ -4,9 +4,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { css, customElement, html, query, repeat, state } from '../../../../../../external/lit/index.js';
7
+ import { css, customElement, html, nothing, query, repeat, state } from '../../../../../../external/lit/index.js';
8
8
  import { UmbModalBaseElement } from '../../../../../core/modal/index.js';
9
9
  import { UmbTextStyles } from '../../../../../core/style/index.js';
10
+ const VISIBLE_FILE_NAMES = 3;
10
11
  let UmbDropzoneMediaTypePickerModalElement = class UmbDropzoneMediaTypePickerModalElement extends UmbModalBaseElement {
11
12
  constructor() {
12
13
  super(...arguments);
@@ -29,28 +30,55 @@ let UmbDropzoneMediaTypePickerModalElement = class UmbDropzoneMediaTypePickerMod
29
30
  this._submitModal();
30
31
  }
31
32
  render() {
32
- return html ` <div id="options">
33
- <uui-button id="auto" look="secondary" @click=${() => this.#onAutoPick()} label="Automatically" compact>
34
- <umb-icon name="icon-wand"></umb-icon> Auto pick
35
- </uui-button>
36
- ${repeat(this._options, (option) => option.unique, (option) => html `<uui-button
37
- look="secondary"
38
- @click=${() => this.#onMediaTypePick(option.unique)}
39
- label=${option.name}
40
- compact>
41
- <umb-icon .name=${option.icon ?? 'icon-circle-dotted'}></umb-icon>${option.name}
42
- </uui-button>`)}
43
- </div>`;
33
+ return html `<uui-dialog-layout headline=${this.localize.term('media_chooseMediaTypeHeadline')}>
34
+ ${this.#renderFiles()}
35
+ <div id="options">
36
+ <uui-button
37
+ id="auto"
38
+ look="secondary"
39
+ @click=${() => this.#onAutoPick()}
40
+ label=${this.localize.term('mediaType_autoPickMediaType')}
41
+ compact>
42
+ <umb-icon name="icon-wand"></umb-icon>${this.localize.term('mediaType_autoPickMediaType')}
43
+ </uui-button>
44
+ ${repeat(this._options, (option) => option.unique, (option) => html `<uui-button
45
+ look="secondary"
46
+ @click=${() => this.#onMediaTypePick(option.unique)}
47
+ label=${option.name}
48
+ compact>
49
+ <umb-icon .name=${option.icon ?? 'icon-circle-dotted'}></umb-icon>${option.name}
50
+ </uui-button>`)}
51
+ </div>
52
+ <uui-button
53
+ id="cancel"
54
+ slot="actions"
55
+ label=${this.localize.term('general_cancel')}
56
+ @click=${() => this._rejectModal()}></uui-button>
57
+ </uui-dialog-layout>`;
58
+ }
59
+ #renderFiles() {
60
+ const files = this.data?.files ?? [];
61
+ if (!files.length)
62
+ return nothing;
63
+ const names = files.slice(0, VISIBLE_FILE_NAMES).map((file) => file.name);
64
+ const remaining = files.length - names.length;
65
+ if (remaining > 0)
66
+ names.push(this.localize.term('media_chooseMediaTypeMoreFiles', remaining));
67
+ return html `<p id="files">${this.localize.list(names)}</p>`;
44
68
  }
45
69
  static { this.styles = [
46
70
  UmbTextStyles,
47
71
  css `
72
+ #files {
73
+ margin-top: 0;
74
+ word-break: break-word;
75
+ }
48
76
  #options {
49
77
  display: flex;
50
- margin: var(--uui-size-layout-1);
78
+ flex-wrap: wrap;
51
79
  gap: var(--uui-size-3);
52
80
  }
53
- uui-button {
81
+ #options uui-button {
54
82
  width: 150px;
55
83
  height: 150px;
56
84
  }
@@ -21,7 +21,7 @@ export const manifest = {
21
21
  {
22
22
  alias: 'validationLimit',
23
23
  label: 'Amount',
24
- description: 'Set a required range of medias',
24
+ description: '{#validation_minimumOnlyWhenInUse}',
25
25
  propertyEditorUiAlias: 'Umb.PropertyEditorUi.NumberRange',
26
26
  config: [{ alias: 'validationRange', value: { min: 0, max: Infinity } }],
27
27
  },