@anzusystems/common-admin 2.0.0-rc.26 → 2.0.0-rc.27

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/dist/AnzuSystemsCommonAdmin.d.ts +22 -1
  2. package/dist/AnzuSystemsCommonAdmin.js.map +1 -1
  3. package/dist/common-admin.css +1 -1
  4. package/dist/common-admin.js +185 -181
  5. package/dist/domains/anzuUser/components/AAnzuUserDatatable.vue_vue_type_script_setup_true_lang.js +101 -100
  6. package/dist/domains/anzuUser/components/AAnzuUserDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  7. package/dist/domains/anzuUser/components/AUserCreateInSystemButton.vue_vue_type_script_setup_true_lang.js +4 -4
  8. package/dist/domains/anzuUser/components/AUserMetadataRepairDialog.vue_vue_type_script_setup_true_lang.js +4 -4
  9. package/dist/domains/anzuUser/components/AUserMetadataRepairDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  10. package/dist/domains/anzuUser/components/AUserSystemOverview.vue_vue_type_script_setup_true_lang.js +4 -4
  11. package/dist/domains/auth/composables/refreshSession.d.ts +7 -0
  12. package/dist/domains/auth/composables/refreshSession.js +26 -19
  13. package/dist/domains/auth/composables/refreshSession.js.map +1 -1
  14. package/dist/domains/auth/composables/sessionEnd.d.ts +37 -0
  15. package/dist/domains/auth/composables/sessionEnd.js +65 -0
  16. package/dist/domains/auth/composables/sessionEnd.js.map +1 -0
  17. package/dist/domains/collab/components/ACollabCountdown.vue_vue_type_script_setup_true_lang.js +3 -3
  18. package/dist/domains/collab/components/ACollabCountdown.vue_vue_type_script_setup_true_lang.js.map +1 -1
  19. package/dist/domains/collab/composables/collabInit.js +13 -13
  20. package/dist/domains/collab/composables/collabInit.js.map +1 -1
  21. package/dist/domains/collab/composables/collabRoom.js +98 -96
  22. package/dist/domains/collab/composables/collabRoom.js.map +1 -1
  23. package/dist/domains/collab/composables/collabState.d.ts +1 -0
  24. package/dist/domains/collab/composables/collabState.js +6 -5
  25. package/dist/domains/collab/composables/collabState.js.map +1 -1
  26. package/dist/domains/customDataForm/components/ACustomDataForm.vue_vue_type_script_setup_true_lang.js +53 -52
  27. package/dist/domains/customDataForm/components/ACustomDataForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  28. package/dist/domains/customDataForm/components/ACustomDataFormElement.vue_vue_type_script_setup_true_lang.js +78 -77
  29. package/dist/domains/customDataForm/components/ACustomDataFormElement.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/domains/customDataForm/types/CustomDataForm.d.ts +3 -0
  31. package/dist/domains/customDataForm/utils/customDataFormElementName.d.ts +18 -0
  32. package/dist/domains/customDataForm/utils/customDataFormElementName.js +9 -0
  33. package/dist/domains/customDataForm/utils/customDataFormElementName.js.map +1 -0
  34. package/dist/domains/dam/api/damAssetApi.d.ts +1 -1
  35. package/dist/domains/dam/api/damAssetApi.js +90 -85
  36. package/dist/domains/dam/api/damAssetApi.js.map +1 -1
  37. package/dist/domains/dam/assetDetail/components/AssetImage.vue.d.ts +11 -1
  38. package/dist/domains/dam/assetDetail/components/AssetImage.vue_vue_type_script_setup_true_lang.js +31 -7
  39. package/dist/domains/dam/assetDetail/components/AssetImage.vue_vue_type_script_setup_true_lang.js.map +1 -1
  40. package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.vue.d.ts +10 -0
  41. package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.vue_vue_type_script_setup_true_lang.js +59 -32
  42. package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.vue_vue_type_script_setup_true_lang.js.map +1 -1
  43. package/dist/domains/dam/assetDetail/store/assetDetailStore.d.ts +8 -0
  44. package/dist/domains/dam/assetSelect/components/AAssetListInner.vue.d.ts +8 -0
  45. package/dist/domains/dam/assetSelect/components/AAssetSelect.vue.d.ts +10 -2
  46. package/dist/domains/dam/assetSelect/components/AAssetSelect.vue_vue_type_script_setup_true_lang.js +148 -113
  47. package/dist/domains/dam/assetSelect/components/AAssetSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  48. package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue.d.ts +6 -2
  49. package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue_vue_type_script_setup_true_lang.js +143 -108
  50. package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue_vue_type_script_setup_true_lang.js.map +1 -1
  51. package/dist/domains/dam/assetSelect/components/AssetImagePreview.vue.d.ts +9 -2
  52. package/dist/domains/dam/assetSelect/components/AssetImagePreview.vue_vue_type_script_setup_true_lang.js +23 -5
  53. package/dist/domains/dam/assetSelect/components/AssetImagePreview.vue_vue_type_script_setup_true_lang.js.map +1 -1
  54. package/dist/domains/dam/assetSelect/components/AssetSelectDetailTabs.js +6 -0
  55. package/dist/domains/dam/assetSelect/components/AssetSelectDetailTabs.js.map +1 -0
  56. package/dist/domains/dam/assetSelect/components/AssetSelectDetailTabs.vue.d.ts +25 -0
  57. package/dist/domains/dam/assetSelect/components/AssetSelectDetailTabs.vue_vue_type_script_setup_true_lang.js +59 -0
  58. package/dist/domains/dam/assetSelect/components/AssetSelectDetailTabs.vue_vue_type_script_setup_true_lang.js.map +1 -0
  59. package/dist/domains/dam/assetSelect/components/AssetSelectListTable.js +1 -0
  60. package/dist/domains/dam/assetSelect/components/AssetSelectListTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  61. package/dist/domains/dam/assetSelect/components/AssetSelectListTiles.vue_vue_type_script_setup_true_lang.js.map +1 -1
  62. package/dist/domains/dam/assetSelect/components/AssetSelectSingleUseUsage.js +6 -0
  63. package/dist/domains/dam/assetSelect/components/AssetSelectSingleUseUsage.js.map +1 -0
  64. package/dist/domains/dam/assetSelect/components/AssetSelectSingleUseUsage.vue.d.ts +11 -0
  65. package/dist/domains/dam/assetSelect/components/AssetSelectSingleUseUsage.vue_vue_type_script_setup_true_lang.js +92 -0
  66. package/dist/domains/dam/assetSelect/components/AssetSelectSingleUseUsage.vue_vue_type_script_setup_true_lang.js.map +1 -0
  67. package/dist/domains/dam/assetSelect/components/AssetSelectTableRowItem.vue_vue_type_script_setup_true_lang.js +35 -27
  68. package/dist/domains/dam/assetSelect/components/AssetSelectTableRowItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  69. package/dist/domains/dam/assetSelect/components/AssetSelectTilesItem.vue_vue_type_script_setup_true_lang.js +35 -27
  70. package/dist/domains/dam/assetSelect/components/AssetSelectTilesItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  71. package/dist/domains/dam/assetSelect/composables/assetSelectDisabledReason.d.ts +18 -0
  72. package/dist/domains/dam/assetSelect/composables/assetSelectDisabledReason.js +28 -0
  73. package/dist/domains/dam/assetSelect/composables/assetSelectDisabledReason.js.map +1 -0
  74. package/dist/domains/dam/assetSelect/composables/assetSelectItemActions.d.ts +4 -0
  75. package/dist/domains/dam/assetSelect/composables/assetSelectItemActions.js +37 -28
  76. package/dist/domains/dam/assetSelect/composables/assetSelectItemActions.js.map +1 -1
  77. package/dist/domains/dam/assetSelect/composables/assetSelectListActions.d.ts +46 -3
  78. package/dist/domains/dam/assetSelect/composables/assetSelectListActions.js +136 -93
  79. package/dist/domains/dam/assetSelect/composables/assetSelectListActions.js.map +1 -1
  80. package/dist/domains/dam/assetSelect/composables/assetSelectSingleUseUsage.d.ts +848 -0
  81. package/dist/domains/dam/assetSelect/composables/assetSelectSingleUseUsage.js +83 -0
  82. package/dist/domains/dam/assetSelect/composables/assetSelectSingleUseUsage.js.map +1 -0
  83. package/dist/domains/dam/assetSelect/composables/assetSelectTakeOver.d.ts +17 -0
  84. package/dist/domains/dam/assetSelect/composables/assetSelectTakeOver.js +23 -0
  85. package/dist/domains/dam/assetSelect/composables/assetSelectTakeOver.js.map +1 -0
  86. package/dist/domains/dam/assetSelect/filter/AssetFilter.d.ts +3 -3
  87. package/dist/domains/dam/assetSelect/filter/AssetFilter.js +1 -1
  88. package/dist/domains/dam/assetSelect/filter/AssetFilter.js.map +1 -1
  89. package/dist/domains/dam/assetSelect/store/assetSelectStore.d.ts +118 -4
  90. package/dist/domains/dam/assetSelect/store/assetSelectStore.js +135 -87
  91. package/dist/domains/dam/assetSelect/store/assetSelectStore.js.map +1 -1
  92. package/dist/domains/dam/author/composables/authorActions.js +3 -1
  93. package/dist/domains/dam/author/composables/authorActions.js.map +1 -1
  94. package/dist/domains/dam/author/composables/cachedAuthors.js +6 -2
  95. package/dist/domains/dam/author/composables/cachedAuthors.js.map +1 -1
  96. package/dist/domains/dam/author/composables/damCredit.d.ts +3 -1
  97. package/dist/domains/dam/author/composables/damCredit.js +13 -12
  98. package/dist/domains/dam/author/composables/damCredit.js.map +1 -1
  99. package/dist/domains/dam/author/composables/damSourceBadge.d.ts +13 -0
  100. package/dist/domains/dam/author/composables/damSourceBadge.js +11 -0
  101. package/dist/domains/dam/author/composables/damSourceBadge.js.map +1 -0
  102. package/dist/domains/dam/author/factory/AuthorFactory.js +2 -0
  103. package/dist/domains/dam/author/factory/AuthorFactory.js.map +1 -1
  104. package/dist/domains/dam/author/types/DamAuthor.d.ts +8 -0
  105. package/dist/domains/dam/composables/commonAdminCoreDamOptions.d.ts +3 -0
  106. package/dist/domains/dam/composables/commonAdminCoreDamOptions.js +4 -1
  107. package/dist/domains/dam/composables/commonAdminCoreDamOptions.js.map +1 -1
  108. package/dist/domains/dam/config/api/damAssetCustomFormApi.js +17 -16
  109. package/dist/domains/dam/config/api/damAssetCustomFormApi.js.map +1 -1
  110. package/dist/domains/dam/cropper/components/DamAssetImageRoiSelect.vue_vue_type_script_setup_true_lang.js +62 -48
  111. package/dist/domains/dam/cropper/components/DamAssetImageRoiSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  112. package/dist/domains/dam/cropper/store/imageRoiStore.d.ts +2 -0
  113. package/dist/domains/dam/imageWidget/components/AImageMediaWidget.vue.d.ts +14 -1
  114. package/dist/domains/dam/imageWidget/components/AImageMediaWidget.vue_vue_type_script_setup_true_lang.js +7 -1
  115. package/dist/domains/dam/imageWidget/components/AImageMediaWidget.vue_vue_type_script_setup_true_lang.js.map +1 -1
  116. package/dist/domains/dam/imageWidget/components/AImagePublicInput.vue.d.ts +6 -1
  117. package/dist/domains/dam/imageWidget/components/AImagePublicInput.vue_vue_type_script_setup_true_lang.js +91 -88
  118. package/dist/domains/dam/imageWidget/components/AImagePublicInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  119. package/dist/domains/dam/imageWidget/components/AImageWidget.vue.d.ts +14 -1
  120. package/dist/domains/dam/imageWidget/components/AImageWidget.vue_vue_type_script_setup_true_lang.js +7 -1
  121. package/dist/domains/dam/imageWidget/components/AImageWidget.vue_vue_type_script_setup_true_lang.js.map +1 -1
  122. package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.vue.d.ts +14 -0
  123. package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.vue_vue_type_script_setup_true_lang.js +7 -1
  124. package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.vue_vue_type_script_setup_true_lang.js.map +1 -1
  125. package/dist/domains/dam/imageWidget/components/AImageWidgetSimple.vue.d.ts +6 -0
  126. package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.vue.d.ts +7 -0
  127. package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.vue_vue_type_script_setup_true_lang.js +123 -111
  128. package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  129. package/dist/domains/dam/imageWidget/components/ImageDetailSingleUseWarning.js +6 -0
  130. package/dist/domains/dam/imageWidget/components/ImageDetailSingleUseWarning.js.map +1 -0
  131. package/dist/domains/dam/imageWidget/components/ImageDetailSingleUseWarning.vue.d.ts +11 -0
  132. package/dist/domains/dam/imageWidget/components/ImageDetailSingleUseWarning.vue_vue_type_script_setup_true_lang.js +59 -0
  133. package/dist/domains/dam/imageWidget/components/ImageDetailSingleUseWarning.vue_vue_type_script_setup_true_lang.js.map +1 -0
  134. package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue.d.ts +18 -1
  135. package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue_vue_type_script_setup_true_lang.js +338 -337
  136. package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  137. package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue.d.ts +22 -1
  138. package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue_vue_type_script_setup_true_lang.js +366 -363
  139. package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  140. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue.d.ts +18 -0
  141. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue_vue_type_script_setup_true_lang.js +376 -311
  142. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  143. package/dist/domains/dam/imageWidget/composables/commonAdminImageOptions.d.ts +9 -0
  144. package/dist/domains/dam/imageWidget/composables/commonAdminImageOptions.js +19 -17
  145. package/dist/domains/dam/imageWidget/composables/commonAdminImageOptions.js.map +1 -1
  146. package/dist/domains/dam/imageWidget/composables/imageApiCms.d.ts +36 -1
  147. package/dist/domains/dam/imageWidget/composables/imageApiCms.js +84 -36
  148. package/dist/domains/dam/imageWidget/composables/imageApiCms.js.map +1 -1
  149. package/dist/domains/dam/imageWidget/composables/imageDialogDamAuthors.d.ts +5 -0
  150. package/dist/domains/dam/imageWidget/composables/imageDialogDamAuthors.js +93 -80
  151. package/dist/domains/dam/imageWidget/composables/imageDialogDamAuthors.js.map +1 -1
  152. package/dist/domains/dam/imageWidget/composables/imageSaveErrors.d.ts +8 -0
  153. package/dist/domains/dam/imageWidget/composables/imageSaveErrors.js +22 -0
  154. package/dist/domains/dam/imageWidget/composables/imageSaveErrors.js.map +1 -0
  155. package/dist/domains/dam/imageWidget/composables/imageSingleUseUsageFetch.d.ts +11 -0
  156. package/dist/domains/dam/imageWidget/composables/imageSingleUseUsageFetch.js +15 -0
  157. package/dist/domains/dam/imageWidget/composables/imageSingleUseUsageFetch.js.map +1 -0
  158. package/dist/domains/dam/imageWidget/store/imageMediaWidgetStore.d.ts +8 -0
  159. package/dist/domains/dam/imageWidget/store/imageStore.d.ts +15 -0
  160. package/dist/domains/dam/imageWidget/store/imageStore.js +24 -14
  161. package/dist/domains/dam/imageWidget/store/imageStore.js.map +1 -1
  162. package/dist/domains/dam/imageWidget/utils/damImage.d.ts +10 -1
  163. package/dist/domains/dam/imageWidget/utils/damImage.js +24 -12
  164. package/dist/domains/dam/imageWidget/utils/damImage.js.map +1 -1
  165. package/dist/domains/dam/types/Asset.d.ts +29 -1
  166. package/dist/domains/dam/types/Asset.js +9 -2
  167. package/dist/domains/dam/types/Asset.js.map +1 -1
  168. package/dist/domains/dam/types/AssetFile.d.ts +1 -0
  169. package/dist/domains/dam/types/AssetFile.js.map +1 -1
  170. package/dist/domains/dam/types/AssetLicence.d.ts +6 -1
  171. package/dist/domains/dam/types/AssetSelect.d.ts +9 -4
  172. package/dist/domains/dam/types/AssetSelect.js.map +1 -1
  173. package/dist/domains/dam/types/ImageAware.d.ts +9 -0
  174. package/dist/domains/dam/types/ImageAware.js +7 -0
  175. package/dist/domains/dam/types/ImageAware.js.map +1 -0
  176. package/dist/domains/dam/uploadQueue/components/AssetCustomMetadataFormMassOperations.vue_vue_type_script_setup_true_lang.js +42 -41
  177. package/dist/domains/dam/uploadQueue/components/AssetCustomMetadataFormMassOperations.vue_vue_type_script_setup_true_lang.js.map +1 -1
  178. package/dist/domains/dam/uploadQueue/components/UploadQueueDialog.vue_vue_type_script_setup_true_lang.js +4 -4
  179. package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.vue_vue_type_script_setup_true_lang.js +59 -58
  180. package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  181. package/dist/domains/dam/uploadQueue/components/UploadQueueItemErrorOverlay.vue_vue_type_script_setup_true_lang.js +8 -8
  182. package/dist/domains/dam/uploadQueue/components/UploadQueueItemErrorOverlay.vue_vue_type_script_setup_true_lang.js.map +1 -1
  183. package/dist/domains/dam/uploadQueue/composables/uploadService.d.ts +6 -0
  184. package/dist/domains/dam/uploadQueue/composables/uploadService.js +69 -55
  185. package/dist/domains/dam/uploadQueue/composables/uploadService.js.map +1 -1
  186. package/dist/domains/dam/uploadQueue/presets/queuePresets.js +21 -17
  187. package/dist/domains/dam/uploadQueue/presets/queuePresets.js.map +1 -1
  188. package/dist/domains/dam/uploadQueue/presets/uploadPresets.d.ts +4 -0
  189. package/dist/domains/dam/uploadQueue/presets/uploadPresets.js +15 -14
  190. package/dist/domains/dam/uploadQueue/presets/uploadPresets.js.map +1 -1
  191. package/dist/domains/dam/user/composables/cachedAssetLicences.d.ts +2 -0
  192. package/dist/domains/dam/user/composables/cachedAssetLicences.js +11 -8
  193. package/dist/domains/dam/user/composables/cachedAssetLicences.js.map +1 -1
  194. package/dist/domains/filters/bookmarks/components/FilterBookmarkDialog.vue_vue_type_script_setup_true_lang.js +190 -184
  195. package/dist/domains/filters/bookmarks/components/FilterBookmarkDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  196. package/dist/domains/filters/components/AFilterTimeInterval.js +1 -1
  197. package/dist/domains/filters/components/AFilterTimeInterval.vue_vue_type_script_setup_true_lang.js +85 -84
  198. package/dist/domains/filters/components/AFilterTimeInterval.vue_vue_type_script_setup_true_lang.js.map +1 -1
  199. package/dist/domains/filters/composables/filterFactory.d.ts +13 -1
  200. package/dist/domains/filters/composables/filterFactory.js +171 -120
  201. package/dist/domains/filters/composables/filterFactory.js.map +1 -1
  202. package/dist/domains/filters/composables/filterTimeIntervalTools.js +6 -6
  203. package/dist/domains/filters/composables/filterTimeIntervalTools.js.map +1 -1
  204. package/dist/domains/filters/datatable/components/ADatatablePagination.vue_vue_type_script_setup_true_lang.js +49 -49
  205. package/dist/domains/filters/datatable/components/ADatatablePagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  206. package/dist/domains/filters/utils/filterInjectionKeys.d.ts +1 -0
  207. package/dist/domains/filters/utils/filterInjectionKeys.js +2 -2
  208. package/dist/domains/filters/utils/filterInjectionKeys.js.map +1 -1
  209. package/dist/domains/job/api/jobApi.js +3 -3
  210. package/dist/domains/job/api/jobApi.js.map +1 -1
  211. package/dist/domains/listEditor/components/ANestedSortableListEditor.vue.d.ts +1 -1
  212. package/dist/domains/listEditor/components/ANestedSortableListEditor.vue_vue_type_script_setup_true_lang.js +385 -351
  213. package/dist/domains/listEditor/components/ANestedSortableListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  214. package/dist/domains/listEditor/components/ASortableListEditor.vue_vue_type_script_setup_true_lang.js +277 -260
  215. package/dist/domains/listEditor/components/ASortableListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  216. package/dist/domains/listEditor/composables/useKeyboardNav.d.ts +4 -0
  217. package/dist/domains/listEditor/composables/useKeyboardNav.js +33 -20
  218. package/dist/domains/listEditor/composables/useKeyboardNav.js.map +1 -1
  219. package/dist/domains/log/components/ALogDatatable.vue.d.ts +1 -0
  220. package/dist/domains/log/components/ALogDatatable.vue_vue_type_script_setup_true_lang.js +70 -66
  221. package/dist/domains/log/components/ALogDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  222. package/dist/domains/log/components/ALogListView.vue_vue_type_script_setup_true_lang.js +1 -1
  223. package/dist/domains/log/components/ALogListView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  224. package/dist/domains/log/filter/logFilter.d.ts +5 -0
  225. package/dist/domains/log/filter/logFilter.js +2 -2
  226. package/dist/domains/log/filter/logFilter.js.map +1 -1
  227. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js +89 -92
  228. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  229. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocompleteWithMinimal.vue_vue_type_script_setup_true_lang.js +123 -119
  230. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocompleteWithMinimal.vue_vue_type_script_setup_true_lang.js.map +1 -1
  231. package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js +26 -24
  232. package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  233. package/dist/domains/system/appShell/components/ALayoutSwitch.js +1 -0
  234. package/dist/domains/system/appShell/components/ALayoutSwitch.vue.d.ts +3 -0
  235. package/dist/domains/system/appShell/components/ALayoutSwitch.vue_vue_type_script_setup_true_lang.js +38 -16
  236. package/dist/domains/system/appShell/components/ALayoutSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  237. package/dist/domains/system/composables/alerts.js +57 -40
  238. package/dist/domains/system/composables/alerts.js.map +1 -1
  239. package/dist/domains/system/systemBar/components/ASystemBar.vue_vue_type_script_setup_true_lang.js +39 -38
  240. package/dist/domains/system/systemBar/components/ASystemBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  241. package/dist/domains/system/systemBar/components/ASystemBarSessionEnded.js +6 -0
  242. package/dist/domains/system/systemBar/components/ASystemBarSessionEnded.js.map +1 -0
  243. package/dist/domains/system/systemBar/components/ASystemBarSessionEnded.vue.d.ts +3 -0
  244. package/dist/domains/system/systemBar/components/ASystemBarSessionEnded.vue_vue_type_script_setup_true_lang.js +53 -0
  245. package/dist/domains/system/systemBar/components/ASystemBarSessionEnded.vue_vue_type_script_setup_true_lang.js.map +1 -0
  246. package/dist/domains/ui/datetime/components/ADatetimePicker.js +1 -1
  247. package/dist/domains/ui/datetime/components/ADatetimePicker.vue_vue_type_script_setup_true_lang.js +1 -1
  248. package/dist/domains/ui/datetime/components/ADatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  249. package/dist/domains/ui/file/composables/formatAndSizeCheck.js +1 -1
  250. package/dist/domains/ui/file/composables/formatAndSizeCheck.js.map +1 -1
  251. package/dist/domains/ui/view/components/ALogoutView.vue_vue_type_script_setup_true_lang.js +9 -8
  252. package/dist/domains/ui/view/components/ALogoutView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  253. package/dist/lib.d.ts +9 -5
  254. package/dist/locales/cs/common/alert.js +8 -0
  255. package/dist/locales/cs/common/alert.js.map +1 -1
  256. package/dist/locales/cs/common/assetSelect.js +361 -0
  257. package/dist/locales/cs/common/assetSelect.js.map +1 -1
  258. package/dist/locales/cs/common/damCustomFormElement.js +258 -0
  259. package/dist/locales/cs/common/damCustomFormElement.js.map +1 -0
  260. package/dist/locales/cs/common/damImage.js +237 -1
  261. package/dist/locales/cs/common/damImage.js.map +1 -1
  262. package/dist/locales/cs/common/filter.js +1 -9
  263. package/dist/locales/cs/common/filter.js.map +1 -1
  264. package/dist/locales/cs/common/system.js +26 -0
  265. package/dist/locales/cs/common/system.js.map +1 -1
  266. package/dist/locales/cs/error/apiForbiddenOperation.js +113 -7
  267. package/dist/locales/cs/error/apiForbiddenOperation.js.map +1 -1
  268. package/dist/locales/cs/error/apiValidation.js +8 -0
  269. package/dist/locales/cs/error/apiValidation.js.map +1 -1
  270. package/dist/locales/cs.d.ts +120 -1
  271. package/dist/locales/cs.js +20 -18
  272. package/dist/locales/cs.js.map +1 -1
  273. package/dist/locales/en/common/alert.js +8 -0
  274. package/dist/locales/en/common/alert.js.map +1 -1
  275. package/dist/locales/en/common/assetSelect.js +361 -0
  276. package/dist/locales/en/common/assetSelect.js.map +1 -1
  277. package/dist/locales/en/common/damCustomFormElement.js +258 -0
  278. package/dist/locales/en/common/damCustomFormElement.js.map +1 -0
  279. package/dist/locales/en/common/damImage.js +237 -1
  280. package/dist/locales/en/common/damImage.js.map +1 -1
  281. package/dist/locales/en/common/filter.js +1 -9
  282. package/dist/locales/en/common/filter.js.map +1 -1
  283. package/dist/locales/en/common/system.js +26 -0
  284. package/dist/locales/en/common/system.js.map +1 -1
  285. package/dist/locales/en/error/apiForbiddenOperation.js +113 -7
  286. package/dist/locales/en/error/apiForbiddenOperation.js.map +1 -1
  287. package/dist/locales/en/error/apiValidation.js +8 -0
  288. package/dist/locales/en/error/apiValidation.js.map +1 -1
  289. package/dist/locales/en.d.ts +120 -1
  290. package/dist/locales/en.js +20 -18
  291. package/dist/locales/en.js.map +1 -1
  292. package/dist/locales/sk/common/alert.js +8 -0
  293. package/dist/locales/sk/common/alert.js.map +1 -1
  294. package/dist/locales/sk/common/assetSelect.js +361 -0
  295. package/dist/locales/sk/common/assetSelect.js.map +1 -1
  296. package/dist/locales/sk/common/damCustomFormElement.js +258 -0
  297. package/dist/locales/sk/common/damCustomFormElement.js.map +1 -0
  298. package/dist/locales/sk/common/damImage.js +237 -1
  299. package/dist/locales/sk/common/damImage.js.map +1 -1
  300. package/dist/locales/sk/common/filter.js +1 -9
  301. package/dist/locales/sk/common/filter.js.map +1 -1
  302. package/dist/locales/sk/common/system.js +26 -0
  303. package/dist/locales/sk/common/system.js.map +1 -1
  304. package/dist/locales/sk/error/apiForbiddenOperation.js +113 -7
  305. package/dist/locales/sk/error/apiForbiddenOperation.js.map +1 -1
  306. package/dist/locales/sk/error/apiValidation.js +8 -0
  307. package/dist/locales/sk/error/apiValidation.js.map +1 -1
  308. package/dist/locales/sk.d.ts +120 -1
  309. package/dist/locales/sk.js +20 -18
  310. package/dist/locales/sk.js.map +1 -1
  311. package/dist/plugins/i18n.d.ts +120 -1
  312. package/dist/shared/utils/datetimePickerValue.js +9 -6
  313. package/dist/shared/utils/datetimePickerValue.js.map +1 -1
  314. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"ImageWidgetMultipleInner.vue_vue_type_script_setup_true_lang.js","names":["$slots","_openBlock","_createElementBlock","_toDisplayString","_createVNode","AFileInput","_unref","_withCtx","_component_VBtn","_mergeProps","_createTextVNode","AAssetSelect","_renderSlot","_normalizeProps","_guardReactiveProps","_component_VProgressCircular","_createElementVNode","_createBlock","ASortableListEditor","_isRef","_Fragment","_renderList","ImageWidgetMultipleItem","AImageWidgetSimple","AImageDropzone","UploadQueueDialog","AssetDetailDialog","ImageWidgetMultipleLimitDialog","ImageWidgetMultipleItem_default","AAssetSelect_default","AFileInput_default","AFileDropzone_default","UploadQueueDialog_default","AssetDetailDialog_default","ASortableListEditor_default","AImageWidgetSimple_default","ImageWidgetMultipleLimitDialog_default","useVuelidate","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","ImageWidgetMultipleInner_vue_vue_type_script_setup_true_lang_default","__expose","__emit","props","__props","emit","damConfigName","useDamConfigName","assetSelectDialog","ref","imageWidgetUploadConfig","inject","ImageWidgetUploadConfigKey","isUndefined","useCommonAdminImageOptions","useAlerts","uploadButtonComponent","useDamAcceptTypeAndSizeHelper","DamAssetType","useI18n","imagesLoading","imagesLoadFailed","imagesReady","listEditor","imageStore","useImageStore","watch","value","storeToRefs","thisWidget","ownImageSaves","cancelSaveWaits","savesOfOthersOver","waits","ids","imageSavesOfOthersOver","id","isNull","wait","over","withinWaitLimit","WAIT_RAN_OUT","unmounted","showErrorT","imagesLoaded","fetchImagesOnLoad","readAt","holdImages","read","imageApi","imageClient","image","imagesRes","saved","imageSavedSince","a","b","groupedIds","group","assetsRes","fetchAssetListByFileIdsMultipleLicences","damClient","endPointAsset","imageRes","found","asset","generateUUIDv1","hasNoDamCredit","images","showErrorsDefault","uploadQueuesStore","useUploadQueuesStore","uploadQueue","computed","useExtSystemIdForCached","useUploadQueueDialog","onFileInput","files","config","stopQueueLeftBehind","limitDialogComponent","onDrop","onCopyToLicence","data","refused","item","afterLimitDialogAdd","assetSelectConfirmMap","assetSelectStore","useAssetSelectStore","assetMetadataMap","creditMap","idsByLicence","licence","readUnder","failures","assetDetails","fetchAssetListByIds","customAssetSelectMetadataToImageMap","mapped","assetDetail","isString","credited","licenceConfig","extSystem","getExtSystemByLicence","namesMap","fetchDamAuthorsMap","endPointAuthor","creditConfig","creditConfigOf","damCreditFromMap","showUnknownError","items","authorIds","sourceIds","description","createDamImage","positioned","maxPosition","onAssetSelectConfirm","picked","toCopy","copyToLicenceEnabled","addingIsOver","copying","copyToLicence","endPointImage","asTheyAre","imagesAsTheyAre","copyRes","assetDetailStore","useAssetDetailStore","assetDialog","useCommonAdminCoreDamOptions","detailOfRow","detailAssetReads","onEditAsset","fetchAssetByFileId","assetFileId","shownUnder","loadAssetDetailExtSystem","uploadWaitsForLoad","onAssetUploadConfirm","addUploadedRows","damSelectionEnabled","takeAuthorsGiven","actionLibrary","v$","AImageMetadataValidationScopeSymbol","useDamConfigState","damConfigStore","useDamConfigStoreOf","authorEnabled","getDamConfigExtSystem","cachedExtSystemId","sourceEnabled","damCreditConfigOf","authorNamesOf","pageExtSystem","fetchDamCredit","authors","sources","row","names","takeAuthorsOfDetailAsset","detailSave","fetchAsset","assetId","source","onAssetDetailClose","ofRow","shown","saveImages","showValidationError","assetUpdateItems","imagesRaw","toRaw","offering","of","author","named","rows","readAgain","givenMeanwhile","index","showWarningT","bulkUpdateAssetsAuthors","sentRows","resItems","noteImagesSave","imageFieldsOf","resItem","updatedItems","matchedImage","showMetadataSaveError","removeImage","updateAllPositions","removeItem","editorMode","createImageStoreItem","pos","onReorderApplied","onMounted","openBlock","createElementBlock","toDisplayString","createCommentVNode","createVNode","unref","uploadAccept","uploadSizes","withCtx","fileInputProps","VBtn","mergeProps","createTextVNode","t","addFromDamLabel","_cache","$event","createSlots","_ctx","renderSlot","normalizeProps","guardReactiveProps","slotProps","VProgressCircular","createElementVNode","createBlock","isRef","Fragment","renderList","showSourceEnabled","sourceLabel","editAssetLabel","raw","uploadQueueDialog"],"sources":["../../../../../src/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { DocId, IntegerId } from '@/shared/types/common'\nimport { computed, inject, onBeforeUnmount, onMounted, ref, type ShallowRef, toRaw, watch } from 'vue'\nimport { isNull, isString, isUndefined } from '@/shared/utils/common'\nimport type { UploadQueueKey } from '@/domains/dam/types/UploadQueue'\nimport type { DamConfigLicenceExtSystemReturnType } from '@/domains/dam/types/DamConfig'\nimport { useImageStore } from '@/domains/dam/imageWidget/store/imageStore'\nimport ImageWidgetMultipleItem from '@/domains/dam/imageWidget/components/ImageWidgetMultipleItem.vue'\nimport { storeToRefs } from 'pinia'\nimport { useCommonAdminImageOptions } from '@/domains/dam/imageWidget/composables/commonAdminImageOptions'\nimport { useAlerts } from '@/domains/system/composables/alerts'\nimport {\n type AssetDetailItemDto,\n type AssetSearchListItemDto,\n DamAssetType,\n type DamImageCopyToLicenceResponse,\n} from '@/domains/dam/types/Asset'\nimport AAssetSelect from '@/domains/dam/assetSelect/components/AAssetSelect.vue'\nimport AFileInput from '@/domains/ui/file/components/AFileInput.vue'\nimport AImageDropzone from '@/domains/ui/file/components/AFileDropzone.vue'\nimport { useDamAcceptTypeAndSizeHelper } from '@/domains/dam/config/composables/acceptTypeAndSizeHelper'\nimport { useUploadQueuesStore } from '@/domains/dam/uploadQueue/store/uploadQueuesStore'\nimport type { AssetSelectReturnData } from '@/domains/dam/types/AssetSelect'\nimport UploadQueueDialog from '@/domains/dam/uploadQueue/components/UploadQueueDialog.vue'\nimport { useUploadQueueDialog } from '@/domains/dam/uploadQueue/composables/useUploadQueueDialog'\nimport AssetDetailDialog from '@/domains/dam/assetDetail/components/AssetDetailDialog.vue'\nimport {\n type AssetAuthorsItems,\n bulkUpdateAssetsAuthors,\n fetchAsset,\n fetchAssetByFileId,\n fetchAssetListByIds,\n type IdsGroupedByLicences,\n showMetadataSaveError,\n} from '@/domains/dam/api/damAssetApi'\nimport { useAssetDetailStore } from '@/domains/dam/assetDetail/store/assetDetailStore'\nimport { loadAssetDetailExtSystem } from '@/domains/dam/assetDetail/composables/assetDetailExtSystem'\nimport { useCommonAdminCoreDamOptions } from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport type { ImageStoreItem } from '@/domains/dam/types/ImageAware'\nimport { generateUUIDv1 } from '@/shared/utils/generator'\nimport ASortableListEditor from '@/domains/listEditor/components/ASortableListEditor.vue'\nimport AImageWidgetSimple from '@/domains/dam/imageWidget/components/AImageWidgetSimple.vue'\nimport {\n damCreditFromMap,\n fetchDamAuthorsMap,\n fetchDamCredit,\n damCreditConfigOf,\n hasNoDamCredit,\n} from '@/domains/dam/author/composables/damCredit'\nimport { useI18n } from 'vue-i18n'\nimport useVuelidate from '@vuelidate/core'\nimport { AImageMetadataValidationScopeSymbol } from '@/domains/dam/composables/uploadValidations'\nimport { useExtSystemIdForCached } from '@/domains/dam/composables/extSystemIdForCached'\nimport { useAssetSelectStore } from '@/domains/dam/assetSelect/store/assetSelectStore'\nimport ImageWidgetMultipleLimitDialog from '@/domains/dam/imageWidget/components/ImageWidgetMultipleLimitDialog.vue'\nimport { ImageWidgetUploadConfigKey } from '@/domains/dam/imageWidget/utils/imageWidgetInkectionKeys'\nimport { fetchAssetListByFileIdsMultipleLicences } from '@/domains/dam/api/damfetchAssetListByFileIdsMultipleLicences'\nimport { copyToLicence } from '@/domains/dam/api/damImageApi'\nimport { createDamImage, imageFieldsOf } from '@/domains/dam/imageWidget/utils/damImage'\nimport { useDamConfigState } from '@/domains/dam/config/composables/damConfigState'\nimport { useDamConfigStoreOf } from '@/domains/dam/config/store/damConfigStore'\nimport { useDamConfigName } from '@/domains/dam/composables/damConfigName'\nimport {\n holdImages,\n imageSavedSince,\n imageSavesOfOthersOver,\n noteImagesSave,\n} from '@/domains/dam/imageWidget/utils/imageSaves'\nimport { WAIT_RAN_OUT, withinWaitLimit } from '@/domains/dam/imageWidget/utils/waitLimit'\n\nconst props = withDefaults(\n defineProps<{\n modelValue: IntegerId[]\n queueKey: UploadQueueKey\n uploadLicence: IntegerId\n selectLicences: IntegerId[]\n /** List views of the host the asset select offers as \"Search in\" choices, those the DAM user has. */\n listViews?: IntegerId[]\n configName?: string\n label?: string | undefined\n readonly?: boolean\n dataCy?: string | undefined\n width?: number | undefined\n disableDraggable?: boolean\n widgetIdentifierId?: string | undefined\n callDeleteApiOnRemove?: boolean\n skipCurrentUserCheck?: boolean\n }>(),\n {\n configName: undefined,\n listViews: () => [],\n label: undefined,\n readonly: false,\n dataCy: undefined,\n width: undefined,\n disableDraggable: false,\n widgetIdentifierId: undefined,\n callDeleteApiOnRemove: false,\n skipCurrentUserCheck: false,\n }\n)\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', data: IntegerId[]): void\n}>()\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst damConfigName = useDamConfigName(props.configName)\n\nconst assetSelectDialog = ref(false)\n\nconst imageWidgetUploadConfig = inject<ShallowRef<DamConfigLicenceExtSystemReturnType | undefined> | undefined>(\n ImageWidgetUploadConfigKey,\n undefined\n)\n\nif (isUndefined(imageWidgetUploadConfig) || isUndefined(imageWidgetUploadConfig.value)) {\n throw new Error(\"Fatal error, parent component doesn't provide necessary config ext system config.\")\n}\n\nconst imageOptions = useCommonAdminImageOptions(damConfigName)\nconst { imageClient, imageApi } = imageOptions\nconst { showErrorsDefault, showValidationError, showErrorT, showWarningT, showUnknownError } = useAlerts()\nconst uploadButtonComponent = ref<InstanceType<any> | null>(null)\n\nconst { uploadSizes, uploadAccept } = useDamAcceptTypeAndSizeHelper(\n DamAssetType.Image,\n imageWidgetUploadConfig.value.extSystemConfig\n)\n\nconst { t } = useI18n()\n\nconst imagesLoading = ref(false)\nconst imagesLoadFailed = ref(false)\n\n// Editor must not mount before the fetch lands: its dirty baseline is captured once, so rows\n// arriving later would read as \"added\". One-shot, like the fetch.\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst imagesReady = ref(props.modelValue.length === 0)\n\nconst listEditor = ref<{ commit: (rows?: ImageStoreItem[]) => void; cancelReorderMode: () => void } | null>(null)\n\nconst imageStore = useImageStore()\n// The store is shared by all widgets. Leftovers from the previous one do not belong to this entity.\nimageStore.reset()\nwatch(\n () => props.readonly,\n (value) => {\n imageStore.readonly = value\n },\n { immediate: true }\n)\nconst { images, maxPosition } = storeToRefs(imageStore)\n\n// Identity of this widget among the image-saving widgets (`imageSaves.ts`), and marks of its own pending saves.\nconst thisWidget = Symbol('image widget multiple')\nconst ownImageSaves = new Set<symbol>()\n// Cancels waiting on other widgets' saves when this widget unmounts.\nlet cancelSaveWaits: (() => void) | null = null\n\n/**\n * Resolves once no other widget has a pending save of any of `ids`, such as the\n * widget this one replaced. On timeout the user is told the request timed out.\n */\nconst savesOfOthersOver = async (ids: IntegerId[]) => {\n const waits = ids\n .map((id) => imageSavesOfOthersOver(damConfigName, id, ownImageSaves))\n .filter((wait) => !isNull(wait))\n if (waits.length === 0) return\n cancelSaveWaits = () => waits.forEach((wait) => wait.cancel())\n const over = await withinWaitLimit(Promise.all(waits.map((wait) => wait.over)), 1, damConfigName)\n cancelSaveWaits = null\n if (over !== WAIT_RAN_OUT) return\n waits.forEach((wait) => wait.cancel())\n if (!unmounted) showErrorT('error.apiTimedOut.message')\n}\n\n// Rows added while the entity images load wait for the load and\n// come after them. Otherwise the load replaced them silently.\nlet imagesLoaded: Promise<void> = Promise.resolve()\n\nconst fetchImagesOnLoad = async () => {\n if (props.modelValue.length === 0) {\n return\n }\n try {\n imagesLoading.value = true\n // Counted when the read is sent: a save answered later may have taken effect after the read.\n const readAt = holdImages(damConfigName, thisWidget, props.modelValue)\n const read = await imageApi.fetchImageListByIds(imageClient, props.modelValue)\n // Rows wait until other widgets' saves of these images are over, using the latest saved state.\n // Otherwise a row had old texts and this widget's save wrote them back over the saved ones.\n await savesOfOthersOver(read.map((image) => image.id))\n if (unmounted) return\n const imagesRes = read\n .map((image) => {\n const saved = imageSavedSince(damConfigName, image.id, readAt.get(image.id) ?? 0)\n return saved ? { ...image, ...saved, id: image.id, position: saved.position ?? image.position } : image\n })\n .sort((a, b) => (a.position ?? 0) - (b.position ?? 0))\n const groupedIds: IdsGroupedByLicences = new Map()\n imagesRes.forEach((image) => {\n const group = groupedIds.get(image.dam.licenceId)\n if (group) {\n group.push(image.dam.damId)\n } else {\n groupedIds.set(image.dam.licenceId, [image.dam.damId])\n }\n })\n\n let assetsRes: Awaited<ReturnType<typeof fetchAssetListByFileIdsMultipleLicences>> = []\n try {\n assetsRes = await fetchAssetListByFileIdsMultipleLicences(damClient, endPointAsset, groupedIds)\n } catch (e) {\n // Read-only shows images without DAM authors. A user without upload rights is often refused the assets.\n if (!props.readonly) throw e\n }\n\n imageStore.setImages(\n imagesRes.map((imageRes) => {\n if (isUndefined(imageRes.position)) throw new Error('Image object needs position field!')\n imageStore.updateMaxPositionIfGreater(imageRes.position)\n const found = assetsRes.find((asset) => asset.mainFile?.id === imageRes.dam.damId)\n return {\n key: generateUUIDv1(),\n ...imageRes,\n // Each row gets its own copy. Rows of the same asset shared the array.\n damAuthors: found ? [...found.authors] : [],\n damSources: found ? [...(found.sources ?? [])] : [],\n showDamAuthors: found ? hasNoDamCredit(found.authors, found.sources) : false,\n assetId: found ? found.id : undefined,\n }\n })\n )\n // Displaying a read-only widget must not rewrite the form's value with the stored order.\n if (!props.readonly) {\n emit('update:modelValue', images.value.map((image) => image.id).filter((id) => id !== undefined) as IntegerId[])\n }\n } catch (e) {\n imagesLoadFailed.value = true\n showErrorsDefault(e)\n } finally {\n imagesLoading.value = false\n imagesReady.value = true\n }\n}\n\nconst uploadQueuesStore = useUploadQueuesStore()\n\nconst uploadQueue = computed(() => {\n return uploadQueuesStore.getQueue(props.queueKey)\n})\n\nconst { cachedExtSystemId } = useExtSystemIdForCached(damConfigName)\n\nconst { uploadQueueDialog, stopQueueLeftBehind } = useUploadQueueDialog()\n\nconst onFileInput = (files: File[]) => {\n if (props.readonly) return\n // The input rejected every file and reported it. Opening the queue dialog would show nothing new.\n if (files.length === 0) return\n const config = imageWidgetUploadConfig.value\n if (isUndefined(config)) return\n cachedExtSystemId.value = config.extSystem\n // `afterLimitDialogAdd` opens the queue dialog once files are\n // queued. Over the limit nothing is queued until the user agrees.\n // Rows of a queue no dialog shows are not counted. They go first.\n stopQueueLeftBehind(props.queueKey)\n limitDialogComponent.value?.check(files)\n}\n\nconst onDrop = (files: File[]) => {\n if (props.readonly) return\n // Same as the input: the dropzone rejected every file and reported it.\n if (files.length === 0) return\n const config = imageWidgetUploadConfig.value\n if (isUndefined(config)) return\n cachedExtSystemId.value = config.extSystem\n stopQueueLeftBehind(props.queueKey)\n limitDialogComponent.value?.check(files)\n}\n\nconst onCopyToLicence = (data: DamImageCopyToLicenceResponse) => {\n if (props.readonly) return\n if (data.length === 0) return\n const config = imageWidgetUploadConfig.value\n if (isUndefined(config)) return\n cachedExtSystemId.value = config.extSystem\n stopQueueLeftBehind(props.queueKey)\n let refused = 0\n data.forEach((item) => {\n if (item.result === 'copy') {\n uploadQueuesStore.addByCopyToLicence(\n props.queueKey,\n config.extSystem,\n config.licence,\n [item.targetAsset],\n damConfigName\n )\n } else if (item.result === 'exists') {\n uploadQueuesStore.addByCopyToLicence(\n props.queueKey,\n config.extSystem,\n config.licence,\n [item.targetAsset],\n damConfigName\n )\n uploadQueuesStore.queueItemDuplicate(item.targetAsset, item.targetMainFile, DamAssetType.Image, damConfigName)\n } else {\n refused++\n }\n })\n if (refused > 0) showErrorT('common.damImage.queueItem.errorUnableToCopyToLicence')\n if (refused === data.length) return\n uploadQueueDialog.value = props.queueKey\n}\n\nconst afterLimitDialogAdd = () => {\n uploadQueueDialog.value = props.queueKey\n}\n\n/**\n * Images of picked assets, without position. Each asset is read under\n * its own licence, and its credit under that licence's ext system.\n * The browsed licence can change after picking, and the DAM silently omits assets of another licence.\n * `readUnder`: the licence of all assets and its ext system, when the caller knows them.\n */\nconst assetSelectConfirmMap = async (\n items: AssetSearchListItemDto[],\n readUnder?: { licence: IntegerId; extSystem: IntegerId }\n): Promise<ImageStoreItem[]> => {\n const assetSelectStore = useAssetSelectStore()\n const assetMetadataMap = new Map<DocId, { description: string; authorIds: DocId[]; sourceIds: DocId[] }>()\n // The image source of each read asset: its credit, or what the custom mapping gives.\n const creditMap = new Map<DocId, string>()\n const idsByLicence: IdsGroupedByLicences = new Map()\n items.forEach((item) => {\n const licence = readUnder ? readUnder.licence : item.licence\n const group = idsByLicence.get(licence)\n if (group) {\n group.push(item.id)\n } else {\n idsByLicence.set(licence, [item.id])\n }\n })\n // A licence that fails to read does not stop the others.\n const failures: unknown[] = []\n for (const [licence, ids] of idsByLicence) {\n try {\n const assetDetails = await fetchAssetListByIds(damClient, endPointAsset, ids, licence)\n if (customAssetSelectMetadataToImageMap) {\n assetDetails.forEach((assetDetail) => {\n const mapped = customAssetSelectMetadataToImageMap(assetDetail)\n assetMetadataMap.set(assetDetail.id, {\n description: mapped.description,\n authorIds: [],\n sourceIds: [],\n })\n creditMap.set(assetDetail.id, mapped.source)\n })\n continue\n }\n assetDetails.forEach((assetDetail) => {\n assetMetadataMap.set(assetDetail.id, {\n description: isString(assetDetail.metadata.customData?.description)\n ? assetDetail.metadata.customData.description.trim()\n : '',\n authorIds: assetDetail.authors,\n sourceIds: assetDetail.sources ?? [],\n })\n })\n const credited = assetDetails.filter((assetDetail) => !hasNoDamCredit(assetDetail.authors, assetDetail.sources))\n if (credited.length > 0) {\n const licenceConfig = assetSelectStore.selectConfig.find((config) => config.licence === licence)\n // Uses the licence's ext system, as for every DAM credit the widgets\n // write. Falls back to the picker's when the licence does not tell.\n const extSystem = readUnder\n ? readUnder.extSystem\n : ((await getExtSystemByLicence(licence)) ??\n (licenceConfig ?? assetSelectStore.requireSelectedSelectConfig()).extSystem)\n const namesMap = await fetchDamAuthorsMap(\n damClient,\n endPointAuthor,\n extSystem,\n credited.flatMap((assetDetail) => [...(assetDetail.sources ?? []), ...assetDetail.authors])\n )\n const creditConfig = creditConfigOf(extSystem)\n credited.forEach((assetDetail) => {\n creditMap.set(\n assetDetail.id,\n damCreditFromMap(namesMap, assetDetail.sources, assetDetail.authors, creditConfig)\n )\n })\n }\n } catch (e) {\n failures.push(e)\n }\n }\n // Reported once for all failures. A DAM refusal arrives as a bare axios error that the default handler ignores.\n if (failures.length > 0 && !showErrorsDefault(failures[0])) showUnknownError()\n\n return items.map((asset) => {\n const authorIds = assetMetadataMap.get(asset.id)?.authorIds || []\n const sourceIds = assetMetadataMap.get(asset.id)?.sourceIds || []\n const description = assetMetadataMap.get(asset.id)?.description ?? ''\n\n if (customAssetSelectMetadataToImageMap) {\n return {\n key: generateUUIDv1(),\n ...createDamImage(\n { fileId: asset.mainFile!.id, licenceId: asset.licence, internal: asset.mainFileInternal },\n { description, source: creditMap.get(asset.id) ?? '' },\n { position: 0 }\n ),\n damAuthors: [],\n damSources: [],\n showDamAuthors: false,\n assetId: asset.id,\n }\n }\n\n return {\n key: generateUUIDv1(),\n ...createDamImage(\n { fileId: asset.mainFile!.id, licenceId: asset.licence, internal: asset.mainFileInternal },\n { description, source: creditMap.get(asset.id) ?? '' },\n { position: 0 }\n ),\n damAuthors: authorIds,\n damSources: sourceIds,\n // Only for assets that were read. For an unread asset its sources and authors are unknown,\n // and those picked in the row would replace them in the DAM. Its row shows the source instead.\n showDamAuthors: assetMetadataMap.has(asset.id) && hasNoDamCredit(authorIds, sourceIds),\n assetId: asset.id,\n }\n })\n}\n\nconst positioned = (items: ImageStoreItem[]) =>\n items.map((item) => {\n maxPosition.value++\n return { ...item, position: maxPosition.value }\n })\n\nconst onAssetSelectConfirm = async (data: AssetSelectReturnData) => {\n if (props.readonly) return\n if (data.type !== 'asset' || data.value.length === 0) return\n const picked = data.value.filter((asset) => !isNull(asset.mainFile))\n // Picked assets from a licence other than the upload licence are copied. Assets\n // already in it are used at once. Copies are added when the queue dialog is used.\n const toCopy =\n copyToLicenceEnabled !== false && !isUndefined(data.copyToLicence)\n ? picked.filter((asset) => asset.licence !== data.copyToLicence)\n : []\n // A widget that unmounted or became read-only adds nothing. The image store belongs to the next widget by then.\n const addingIsOver = () => unmounted || props.readonly\n if (toCopy.length === 0) {\n const images = await assetSelectConfirmMap(picked)\n await imagesLoaded\n if (!addingIsOver()) imageStore.addImages(positioned(images))\n return\n }\n const copying = copyToLicence(\n damClient,\n endPointImage,\n toCopy.map((asset) => ({ asset: asset.id, targetAssetLicence: data.copyToLicence! }))\n )\n // Read during the copy under their own licence (the upload's) and its ext system, not the browsed one.\n // Added before the queue dialog opens. Otherwise using the dialog first put the copies before them.\n const asTheyAre = picked.filter((asset) => !toCopy.includes(asset))\n const config = imageWidgetUploadConfig.value\n const imagesAsTheyAre =\n asTheyAre.length === 0\n ? Promise.resolve([])\n : assetSelectConfirmMap(\n asTheyAre,\n config ? { licence: data.copyToLicence!, extSystem: config.extSystem } : undefined\n )\n let copyRes: DamImageCopyToLicenceResponse | null = null\n try {\n copyRes = await copying\n } catch (e) {\n showErrorsDefault(e)\n }\n const images = await imagesAsTheyAre\n await imagesLoaded\n if (addingIsOver()) return\n imageStore.addImages(positioned(images))\n if (copyRes) onCopyToLicence(copyRes)\n}\n\nconst assetDetailStore = useAssetDetailStore()\nconst { dialog: assetDialog } = storeToRefs(assetDetailStore)\nconst {\n damClient,\n endPointAsset,\n endPointImage,\n endPointAuthor,\n copyToLicenceEnabled,\n showSourceEnabled,\n sourceLabel,\n editAssetLabel,\n addFromDamLabel,\n customAssetSelectMetadataToImageMap,\n} = useCommonAdminCoreDamOptions(damConfigName)\n\n// True while the detail was opened by \"edit asset\" of a row. Not for the detail\n// opened from the queue dialog, which is drawn here too and reads nothing on close.\nlet detailOfRow = false\n// Reads of assets whose detail closed, keyed by asset. The widget save waits for them.\n// Reads of other assets do not wait on these. Otherwise closing one detail waited for another asset's save and read.\nconst detailAssetReads = new Map<DocId, Promise<void>>()\n// Such a read may finish after unmount, when the store belongs to the next widget.\nlet unmounted = false\nonBeforeUnmount(() => {\n unmounted = true\n holdImages(damConfigName, thisWidget, [])\n cancelSaveWaits?.()\n})\n\nconst onEditAsset = async (assetFileId: DocId) => {\n detailOfRow = true\n let extSystem: IntegerId | null = null\n try {\n await assetDetailStore.open(\n props.queueKey,\n async () => {\n const asset = await fetchAssetByFileId(damClient, endPointAsset, assetFileId)\n // Falls back to the ext system of the widget's upload licence,\n // loaded by its root, when the licence cannot be resolved.\n const shownUnder = (await getExtSystemByLicence(asset.licence)) ?? imageWidgetUploadConfig.value!.extSystem\n // Must load before the detail shows the asset: it reads the ext\n // system configuration while rendering and threw without it.\n await loadAssetDetailExtSystem(damClient, shownUnder, asset.attributes.assetType, damConfigName)\n extSystem = shownUnder\n return asset\n },\n // Only for the asset the detail still shows: a stale answer must not change the ext system used for name lookups.\n () => {\n if (extSystem) cachedExtSystemId.value = extSystem\n }\n )\n } catch (e) {\n showErrorsDefault(e)\n }\n}\n\n// An upload applied during the entity image load waits with its dialog and\n// queue intact. Its rows come after the loaded images, then the dialog closes.\n// If the widget is read-only or gone by then, the dialog and queue stay as for\n// read-only, so nothing is lost. Before, the dialog and rows were dropped.\n// Applying again while waiting is ignored, or rows would be added twice.\nlet uploadWaitsForLoad = false\nconst onAssetUploadConfirm = async (items: ImageStoreItem[]) => {\n if (props.readonly) return\n if (items.length === 0) return\n if (imagesLoading.value) {\n if (uploadWaitsForLoad) return\n uploadWaitsForLoad = true\n await imagesLoaded\n uploadWaitsForLoad = false\n if (unmounted || props.readonly) return\n }\n addUploadedRows(items)\n uploadQueueDialog.value = null\n uploadQueuesStore.stopUpload(props.queueKey)\n}\n\nconst addUploadedRows = (items: ImageStoreItem[]) => {\n // A duplicate file becomes the asset of the existing image, and the dialog has just saved its sources and authors.\n // Rows of that asset offering the pick take them, as after closing the detail. Otherwise their pick would overwrite\n // them. The credit goes into a row's source only if it has none. Before, it always overwrote it.\n if (damSelectionEnabled.value) {\n items.forEach((item) => {\n if (isUndefined(item.assetId) || hasNoDamCredit(item.damAuthors, item.damSources)) return\n images.value.forEach((image) => {\n if (image.assetId !== item.assetId || !image.showDamAuthors) return\n takeAuthorsGiven(image, item.damAuthors, item.damSources, item.texts.source)\n })\n })\n }\n imageStore.addImages(positioned(items))\n}\n\nconst actionLibrary = () => {\n assetSelectDialog.value = true\n}\n\nconst v$ = useVuelidate({ $scope: AImageMetadataValidationScopeSymbol })\n\nconst { getDamConfigExtSystem, getExtSystemByLicence } = useDamConfigState(damClient, damConfigName)\nconst damConfigStore = useDamConfigStoreOf(damConfigName)\n\nconst authorEnabled = computed(() => {\n return !!getDamConfigExtSystem(cachedExtSystemId.value)?.[DamAssetType.Image]?.authors?.enabled\n})\n\nconst sourceEnabled = computed(() => {\n return !!getDamConfigExtSystem(cachedExtSystemId.value)?.[DamAssetType.Image]?.sources?.enabled\n})\n\n// Rows offer the pick of sources and authors when the configured ext system has either.\nconst damSelectionEnabled = computed(() => authorEnabled.value || sourceEnabled.value)\n\n// The credit format of `extSystem` when its configuration is loaded, else that of the configured one.\nconst creditConfigOf = (extSystem: IntegerId) =>\n damCreditConfigOf(getDamConfigExtSystem(extSystem) ?? getDamConfigExtSystem(cachedExtSystemId.value))\n\n/**\n * Credit of an asset under its licence's ext system.\n * Falls back to `pageExtSystem` when the licence does not tell.\n */\nconst authorNamesOf = async (asset: AssetDetailItemDto, pageExtSystem: IntegerId) => {\n const extSystem = (await getExtSystemByLicence(asset.licence)) ?? pageExtSystem\n return fetchDamCredit(damClient, endPointAuthor, extSystem, asset.sources, asset.authors, creditConfigOf(extSystem))\n}\n\n/**\n * Once the asset turns out to have sources or authors, a row offering the\n * pick takes them, drops the pick and shows its source.\n * The source takes their credit if empty or if it holds a hidden \"fill empty\"\n * pick from mass operations. An image's own source stays for the user to check.\n */\nconst takeAuthorsGiven = (row: ImageStoreItem, authors: DocId[], sources: DocId[] | undefined, names: string) => {\n row.damAuthors = [...authors]\n row.damSources = [...(sources ?? [])]\n if (row.texts.source.trim().length === 0 || imageStore.hasSourceOfPick(row)) row.texts.source = names\n imageStore.forgetSourceOfPick(row)\n row.showDamAuthors = false\n}\n\n/**\n * The detail may have given sources or authors to an asset whose row offers the pick.\n * Otherwise the widget save overwrote them, or saved the image without a source.\n * So the asset is read again, and its offering rows take its authors with names under the asset\n * licence's ext system (see `takeAuthorsGiven`). Rows showing their source are left alone.\n * `detailSave`: the detail save pending at close. `pageExtSystem`: the ext system configured at that time.\n */\nconst takeAuthorsOfDetailAsset = async (assetId: DocId, detailSave: Promise<void> | null, pageExtSystem: IntegerId) => {\n try {\n // Read before the DAM answers that save, the asset would be stale.\n await detailSave\n const asset = await fetchAsset(damClient, endPointAsset, assetId)\n if (hasNoDamCredit(asset.authors, asset.sources)) return\n const source = await authorNamesOf(asset, pageExtSystem)\n if (unmounted || props.readonly) return\n images.value.forEach((image) => {\n // Uses the row's own flag. Whether the page shows the pick depends\n // on an ext system that another asset's detail may have changed.\n if (image.assetId !== asset.id || !image.showDamAuthors) return\n takeAuthorsGiven(image, asset.authors, asset.sources, source)\n })\n } catch (e) {\n if (!unmounted && !showErrorsDefault(e)) showUnknownError()\n }\n}\n\n/**\n * `shown`: the asset the detail showed. None if it closed from its loader or after a failed read.\n * Captured before any await: whether a row of that asset offers the\n * pick, the pending detail save, and the configured ext system.\n */\nconst onAssetDetailClose = (shown: AssetDetailItemDto | null) => {\n const ofRow = detailOfRow\n detailOfRow = false\n if (!ofRow || isNull(shown) || props.readonly || !damSelectionEnabled.value) return\n const assetId = shown.id\n if (!images.value.some((image) => image.assetId === assetId && image.showDamAuthors)) return\n const detailSave = assetDetailStore.savingOf(assetId, damConfigName)\n const pageExtSystem = cachedExtSystemId.value\n const read = (detailAssetReads.get(assetId) ?? Promise.resolve()).then(() =>\n takeAuthorsOfDetailAsset(assetId, detailSave, pageExtSystem)\n )\n detailAssetReads.set(assetId, read)\n void read.then(() => {\n if (detailAssetReads.get(assetId) === read) detailAssetReads.delete(assetId)\n })\n}\n\nconst saveImages = async () => {\n // Nothing of the user's to write. The images stay as loaded.\n if (props.readonly) return true\n // An empty store here means the fetch is pending or failed, not a\n // user deletion. The empty path below would detach every image.\n if (imagesLoading.value || imagesLoadFailed.value) {\n showUnknownError()\n return false\n }\n // A closed detail's asset is still being read. Its rows are not written until they have its authors.\n await Promise.all(detailAssetReads.values())\n if (unmounted) return false\n v$.value.$touch()\n if (v$.value.$invalid) {\n showValidationError()\n return false\n }\n try {\n const assetUpdateItems: AssetAuthorsItems = []\n const imagesRaw = toRaw(images.value)\n // Rows offering the pick, grouped by asset. An entity may have\n // an image twice, and a queue duplicate is a second row of its asset.\n // Per row, authors went out once per row and the last won, and a row with no pick was saved without a source.\n // The asset gets the union of picks in its rows, each source and author once,\n // and each row gets them and their credit after the DAM accepts them.\n type Offering = { assetId: DocId | undefined; rows: ImageStoreItem[]; authors: DocId[]; sources: DocId[] }\n const offering = new Map<DocId, Offering>()\n if (damSelectionEnabled.value) {\n images.value.forEach((image) => {\n if (!image.showDamAuthors) return\n // A row offering the pick has an asset. One without would be grouped alone.\n const of = image.assetId ?? image.key\n const asset = offering.get(of) ?? { assetId: image.assetId, rows: [], authors: [], sources: [] }\n offering.set(of, asset)\n asset.rows.push(image)\n image.damAuthors.forEach((author) => {\n if (!asset.authors.includes(author)) asset.authors.push(author)\n })\n for (const source of image.damSources ?? []) {\n if (!asset.sources.includes(source)) asset.sources.push(source)\n }\n })\n }\n const named: Array<Offering & { source: string }> = []\n for (const { assetId, rows, authors, sources } of offering.values()) {\n if (hasNoDamCredit(authors, sources)) continue\n if (assetId) assetUpdateItems.push({ id: assetId, authors, sources })\n // Uses the ext system of the rows' asset licence, as the pre-write read does. Falls back to the configured\n // one when the page does not know the licence. It is not fetched, since entity rows can be of any licence.\n const extSystem =\n damConfigStore.damConfigLicenceExtSystem.get(rows[0]!.dam.licenceId)?.extSystem ?? cachedExtSystemId.value\n const namesMap = await fetchDamAuthorsMap(damClient, endPointAuthor, extSystem, [...sources, ...authors])\n named.push({\n assetId,\n rows,\n authors,\n sources,\n source: damCreditFromMap(namesMap, sources, authors, creditConfigOf(extSystem)),\n })\n }\n // Unmounted while authors loaded: write nothing. Turned read-only: nothing of the user's is written.\n if (unmounted) return false\n if (props.readonly) return true\n // Assets may have received sources or authors elsewhere since their rows loaded, and the write would\n // replace them. So each asset with a pick is re-read right before the write.\n // If any asset already has sources or authors, nothing is written. Its offering rows take\n // them (`takeAuthorsGiven`), a message stays until closed, and the user saves again.\n const picked = [...offering.values()].filter(\n ({ assetId, authors, sources }) => !isUndefined(assetId) && !hasNoDamCredit(authors, sources)\n )\n if (picked.length > 0) {\n const readAgain = await Promise.all(picked.map(({ assetId }) => fetchAsset(damClient, endPointAsset, assetId!)))\n // Unmounted or made read-only while the assets were read: write nothing.\n if (unmounted || props.readonly) return false\n const givenMeanwhile = picked\n .map(({ rows }, index) => ({ rows, asset: readAgain[index]! }))\n .filter(({ asset }) => !hasNoDamCredit(asset.authors, asset.sources))\n if (givenMeanwhile.length > 0) {\n const pageExtSystem = cachedExtSystemId.value\n const names = await Promise.all(givenMeanwhile.map(({ asset }) => authorNamesOf(asset, pageExtSystem)))\n if (unmounted || props.readonly) return false\n givenMeanwhile.forEach(({ rows, asset }, index) => {\n rows.forEach((row) => {\n if (row.showDamAuthors) takeAuthorsGiven(row, asset.authors, asset.sources, names[index]!)\n })\n })\n showWarningT('common.damImage.image.meta.galleryAuthorsGivenMeanwhile', -1)\n return false\n }\n }\n if (assetUpdateItems.length) {\n // Sources go out where the configured ext system has them, as the rows offer them.\n await bulkUpdateAssetsAuthors(\n damClient,\n endPointAsset,\n DamAssetType.Image,\n cachedExtSystemId.value,\n assetUpdateItems,\n damConfigName\n )\n // Unmounted while the authors were written: save no image. A widget mounted meanwhile\n // for the same images read them before this save, which is noted only once sent.\n if (unmounted) return false\n }\n // The DAM now has these authors even if the images are not saved, so the rows show the source as after a save.\n // If the rows kept offering the pick, the next save would send them as picks,\n // the pre-write read would find these authors, and nothing would be written.\n named.forEach(({ assetId, rows, authors, sources, source }) => {\n rows.forEach((row) => {\n row.damAuthors = [...authors]\n row.damSources = [...sources]\n row.texts.source = source\n if (isUndefined(assetId)) return\n row.showDamAuthors = false\n imageStore.forgetSourceOfPick(row)\n })\n })\n const sentRows = [...imagesRaw]\n // Note the saved images for the page's other widgets, one by one.\n // This runs even if this widget unmounted before the response.\n const resItems = await noteImagesSave(\n damConfigName,\n sentRows.map((row) => row.id).filter((id) => !isUndefined(id)),\n ownImageSaves,\n imageApi.bulkUpdateImages(imageClient, sentRows.map(imageFieldsOf))\n )\n // If unmounted before the response, write nothing to the image store. By then it belongs to the next widget.\n if (unmounted) return true\n holdImages(\n damConfigName,\n thisWidget,\n resItems.map((resItem) => resItem.id)\n )\n const ids: IntegerId[] = []\n const items = resItems.map((resItem) => {\n ids.push(resItem.id)\n\n return {\n key: generateUUIDv1(),\n ...resItem,\n damAuthors: [],\n damSources: [],\n showDamAuthors: false,\n assetId: undefined,\n }\n })\n if (imageStore.images.length === 0) {\n listEditor.value?.commit([])\n // Emptying is a change too. Without this emit the parent keeps its old ids.\n emit('update:modelValue', ids)\n return true\n }\n\n // Match each returned image to its own sent row. Rows of the same file are matched one by one in send order.\n // Matching by file alone gave every row of a file the values of the first one.\n const getUpdatedItem = (item: ImageStoreItem): ImageStoreItem => {\n const index = sentRows.findIndex((row) => row.dam.damId === item.dam.damId)\n const matchedImage = index < 0 ? undefined : sentRows.splice(index, 1)[0]\n\n return {\n ...item,\n damAuthors: matchedImage ? matchedImage.damAuthors : item.damAuthors,\n damSources: matchedImage ? matchedImage.damSources : item.damSources,\n // Only a row that offered DAM sources and authors keeps offering them.\n // A row whose asset the DAM did not return has no asset to save them into, so it keeps its source.\n showDamAuthors: matchedImage\n ? matchedImage.showDamAuthors && hasNoDamCredit(matchedImage.damAuthors, matchedImage.damSources)\n : false,\n assetId: matchedImage ? matchedImage.assetId : item.assetId,\n }\n }\n\n const updatedItems = items.map(getUpdatedItem)\n imageStore.setImages(updatedItems)\n // Pass the rows explicitly. `setImages` just replaced their keys,\n // so a bare `commit()` would read the not-yet-rerendered prop.\n listEditor.value?.commit(updatedItems)\n emit('update:modelValue', ids)\n return true\n } catch (e) {\n // Authors refused by validation are named as the forms name them. Other errors are shown as before.\n showMetadataSaveError(e, cachedExtSystemId.value, damConfigName)\n return false\n }\n}\n\n// Renumber the remaining images as after a move. Otherwise the backend gets positions with a gap.\nconst removeImage = (index: number) => {\n imageStore.removeImageByIndex(index)\n updateAllPositions()\n}\n\nconst removeItem = async (index: number) => {\n const image = images.value[index]\n if (!image) return\n if (isUndefined(image.id)) {\n removeImage(index)\n return\n }\n if (props.callDeleteApiOnRemove) {\n try {\n await imageApi.deleteImage(imageClient, image.id)\n removeImage(index)\n } catch (e) {\n showErrorsDefault(e)\n }\n return\n }\n removeImage(index)\n}\n\nconst limitDialogComponent = ref<InstanceType<typeof ImageWidgetMultipleLimitDialog> | null>(null)\n\nconst editorMode = ref<'view' | 'reorder'>('view')\n// A reorder under way would keep moving rows a read-only widget does not save.\nwatch(\n () => props.readonly,\n (value) => {\n if (value && editorMode.value === 'reorder') listEditor.value?.cancelReorderMode()\n }\n)\n\n// Required by the editor but never called. Adds go through the\n// upload and asset-select flow; the editor's add button is hidden.\nconst createImageStoreItem = (): ImageStoreItem => ({\n key: generateUUIDv1(),\n ...createDamImage({ fileId: '', licenceId: 0 }, {}, { position: 0 }),\n damAuthors: [],\n damSources: [],\n showDamAuthors: false,\n assetId: undefined,\n})\n\nconst updateAllPositions = () => {\n let pos = 0\n images.value.forEach((image) => {\n pos++\n image.position = pos\n })\n imageStore.maxPosition = pos\n}\n\nconst onReorderApplied = () => {\n updateAllPositions()\n}\n\ndefineExpose({\n saveImages,\n})\n\nonMounted(() => {\n imagesLoaded = fetchImagesOnLoad()\n})\n</script>\n\n<template>\n <div>\n <h4\n v-if=\"label\"\n class=\"font-weight-bold text-label-large\"\n >\n {{ label }}\n </h4>\n <div\n v-if=\"!readonly\"\n class=\"pb-2\"\n >\n <AFileInput\n :file-input-key=\"uploadQueue?.fileInputKey\"\n :accept=\"uploadAccept\"\n :max-sizes=\"uploadSizes\"\n multiple\n @files-input=\"onFileInput\"\n >\n <template #activator=\"{ props: fileInputProps }\">\n <VBtn\n ref=\"uploadButtonComponent\"\n v-bind=\"fileInputProps\"\n >\n {{ t('common.damImage.image.button.upload') }}\n </VBtn>\n </template>\n </AFileInput>\n <VBtn\n class=\"mr-2\"\n @click=\"actionLibrary\"\n >\n {{ addFromDamLabel }}\n </VBtn>\n </div>\n <AAssetSelect\n v-model=\"assetSelectDialog\"\n :select-licences=\"selectLicences\"\n :list-views=\"listViews\"\n :upload-licence=\"uploadLicence\"\n :min-count=\"1\"\n :max-count=\"50\"\n :asset-type=\"DamAssetType.Image\"\n :skip-current-user-check=\"skipCurrentUserCheck\"\n :config-name=\"damConfigName\"\n return-type=\"asset\"\n @confirm=\"onAssetSelectConfirm\"\n >\n <template\n v-if=\"$slots['asset-select-sidebar-prepend']\"\n #sidebar-prepend=\"slotProps\"\n >\n <slot\n name=\"asset-select-sidebar-prepend\"\n v-bind=\"slotProps\"\n />\n </template>\n </AAssetSelect>\n <div\n v-if=\"imagesLoading\"\n class=\"w-100 d-flex align-center justify-center\"\n >\n <VProgressCircular\n indeterminate\n color=\"primary\"\n />\n </div>\n <div\n class=\"position-relative w-100\"\n style=\"min-height: 140px\"\n >\n <ASortableListEditor\n v-if=\"imagesReady\"\n ref=\"listEditor\"\n v-model=\"images\"\n v-model:mode=\"editorMode\"\n :factory=\"createImageStoreItem\"\n get-key=\"key\"\n position=\"position\"\n :show-add-button=\"false\"\n :show-delete-button=\"false\"\n :show-edit-button=\"false\"\n :disable-drag=\"disableDraggable || readonly\"\n :readonly=\"readonly\"\n @reorder-applied=\"onReorderApplied\"\n >\n <template #view-body>\n <div class=\"asset-list-tiles asset-list-tiles--thumbnail a-sortable-widget__group\">\n <ImageWidgetMultipleItem\n v-for=\"(image, index) in images\"\n :key=\"image.key\"\n :index=\"index\"\n :show-source-enabled=\"showSourceEnabled\"\n :source-label=\"sourceLabel\"\n :edit-asset-label=\"editAssetLabel\"\n :author-enabled=\"authorEnabled\"\n :source-enabled=\"sourceEnabled\"\n :readonly=\"readonly\"\n :config-name=\"damConfigName\"\n @edit-asset=\"onEditAsset\"\n @remove-item=\"removeItem\"\n />\n </div>\n </template>\n <template #item-compact=\"{ raw }\">\n <div class=\"image-widget-multiple-reorder\">\n <div class=\"image-widget-multiple-reorder__thumb\">\n <AImageWidgetSimple\n :model-value=\"raw.id\"\n :image=\"raw\"\n :config-name=\"damConfigName\"\n />\n </div>\n <div class=\"image-widget-multiple-reorder__meta\">\n <div class=\"image-widget-multiple-reorder__title\">\n {{ raw.texts?.description?.trim() || '—' }}\n </div>\n <div\n v-if=\"raw.texts?.source\"\n class=\"image-widget-multiple-reorder__source\"\n >\n {{ raw.texts.source }}\n </div>\n </div>\n </div>\n </template>\n </ASortableListEditor>\n <AImageDropzone\n v-if=\"editorMode === 'view' && !readonly\"\n variant=\"fill\"\n :hover-only=\"modelValue.length > 0 || images.length > 0\"\n :accept=\"uploadAccept\"\n :max-sizes=\"uploadSizes\"\n @drop=\"onDrop\"\n @click=\"uploadButtonComponent?.$el.click()\"\n />\n </div>\n <UploadQueueDialog\n v-if=\"uploadQueueDialog === queueKey && imageWidgetUploadConfig\"\n :queue-key=\"queueKey\"\n :ext-system=\"imageWidgetUploadConfig.extSystem\"\n :licence-id=\"imageWidgetUploadConfig.licence\"\n :file-input-key=\"uploadQueue?.fileInputKey ?? -1\"\n :accept=\"uploadAccept\"\n :max-sizes=\"uploadSizes\"\n multiple\n @apply=\"onAssetUploadConfirm\"\n @files-input=\"onFileInput\"\n @drop=\"onFileInput\"\n />\n <AssetDetailDialog\n v-if=\"assetDialog === queueKey\"\n :queue-key=\"queueKey\"\n :config-name=\"damConfigName\"\n :ext-system=\"cachedExtSystemId\"\n @close=\"onAssetDetailClose\"\n />\n <ImageWidgetMultipleLimitDialog\n ref=\"limitDialogComponent\"\n :queue-key=\"queueKey\"\n @after-add=\"afterLimitDialogAdd\"\n />\n </div>\n</template>\n\n<style lang=\"scss\">\n.image-widget-multiple-reorder {\n display: flex;\n align-items: center;\n gap: 16px;\n width: 100%;\n min-height: 100px;\n padding: 4px 0;\n\n &__thumb {\n flex: 0 0 auto;\n width: 200px;\n border-radius: 4px;\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n\n img {\n width: 100%;\n height: auto;\n display: block;\n }\n }\n\n &__meta {\n flex: 1 1 auto;\n min-width: 0;\n }\n\n &__title {\n font-size: 0.95rem;\n font-weight: 500;\n color: rgb(var(--v-theme-on-surface));\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n &__source {\n font-size: 0.82rem;\n color: rgb(var(--v-theme-on-surface) / 70%);\n margin-top: 4px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n @media (width <= 600px) {\n gap: 8px;\n min-height: 72px;\n\n &__thumb {\n width: 80px;\n }\n\n &__source {\n display: none;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsEA,IAAMmD,IAAQC,GAgCRC,IAAOH,IAIPI,IAAgBC,GAAiBJ,EAAM,UAAU,GAEjDK,IAAoBC,EAAI,EAAK,GAE7BC,IAA0BC,GAC9BC,IACA,KAAA,CACF;EAEA,IAAIC,EAAYH,CAAuB,KAAKG,EAAYH,EAAwB,KAAK,GACnF,MAAU,MAAM,mFAAmF;EAIrG,IAAM,EAAE,gBAAa,gBADAI,EAA2BR,CACd,GAC5B,EAAE,sBAAmB,yBAAqB,gBAAY,kBAAc,wBAAqBS,EAAU,GACnGC,KAAwBP,EAA8B,IAAI,GAE1D,EAAE,gBAAa,oBAAiBQ,EACpCC,EAAa,OACbR,EAAwB,MAAM,eAChC,GAEM,EAAE,UAAMS,GAAQ,GAEhBC,IAAgBX,EAAI,EAAK,GACzBY,KAAmBZ,EAAI,EAAK,GAK5Ba,KAAcb,EAAIN,EAAM,WAAW,WAAW,CAAC,GAE/CoB,IAAad,EAAyF,IAAI,GAE1Ge,IAAaC,EAAc;EAGjC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vue_vue_type_script_setup_true_lang.js","names":["$slots","_openBlock","_createElementBlock","_toDisplayString","_createVNode","AFileInput","_unref","_withCtx","_component_VBtn","_mergeProps","_createTextVNode","AAssetSelect","_renderSlot","_normalizeProps","_guardReactiveProps","_component_VProgressCircular","_createElementVNode","_createBlock","ASortableListEditor","_isRef","_Fragment","_renderList","ImageWidgetMultipleItem","AImageWidgetSimple","AImageDropzone","UploadQueueDialog","AssetDetailDialog","ImageWidgetMultipleLimitDialog","ImageWidgetMultipleItem_default","AAssetSelect_default","AFileInput_default","AFileDropzone_default","UploadQueueDialog_default","AssetDetailDialog_default","ASortableListEditor_default","AImageWidgetSimple_default","ImageWidgetMultipleLimitDialog_default","useVuelidate","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","ImageWidgetMultipleInner_vue_vue_type_script_setup_true_lang_default","__expose","__emit","props","__props","emit","damConfigName","useDamConfigName","assetSelectDialog","ref","imageWidgetUploadConfig","inject","ImageWidgetUploadConfigKey","isUndefined","useCommonAdminImageOptions","useAlerts","uploadButtonComponent","useDamAcceptTypeAndSizeHelper","DamAssetType","useI18n","imagesLoading","imagesLoadFailed","imagesReady","listEditor","imageStore","useImageStore","watch","value","storeToRefs","thisWidget","ownImageSaves","cancelSaveWaits","savesOfOthersOver","waits","ids","imageSavesOfOthersOver","id","isNull","wait","over","withinWaitLimit","WAIT_RAN_OUT","unmounted","showErrorT","imagesLoaded","fetchImagesOnLoad","readAt","holdImages","read","imageApi","imageClient","image","imagesRes","saved","imageSavedSince","a","b","groupedIds","group","assetsRes","fetchAssetListByFileIdsMultipleLicences","damClient","endPointAsset","imageRes","found","asset","generateUUIDv1","hasNoDamCredit","images","showErrorsDefault","uploadQueuesStore","useUploadQueuesStore","uploadQueue","computed","useExtSystemIdForCached","useUploadQueueDialog","onFileInput","files","config","stopQueueLeftBehind","limitDialogComponent","onDrop","onCopyToLicence","data","refused","item","afterLimitDialogAdd","assetSelectConfirmMap","assetSelectStore","useAssetSelectStore","assetMetadataMap","creditMap","idsByLicence","licence","readUnder","failures","assetDetails","fetchAssetListByIds","customAssetSelectMetadataToImageMap","mapped","assetDetail","isString","credited","licenceConfig","extSystem","getExtSystemByLicence","namesMap","fetchDamAuthorsMap","endPointAuthor","creditConfig","creditConfigOf","damCreditFromMap","showUnknownError","items","authorIds","sourceIds","description","createDamImage","positioned","maxPosition","onAssetSelectConfirm","picked","targetLicence","toCopy","copyToLicenceEnabled","addingIsOver","copying","copyToLicence","endPointImage","asTheyAre","imagesAsTheyAre","copyRes","assetDetailStore","useAssetDetailStore","assetDialog","useCommonAdminCoreDamOptions","detailOfRow","detailAssetReads","onEditAsset","fetchAssetByFileId","assetFileId","shownUnder","loadAssetDetailExtSystem","uploadWaitsForLoad","onAssetUploadConfirm","addUploadedRows","damSelectionEnabled","takeAuthorsGiven","actionLibrary","v$","AImageMetadataValidationScopeSymbol","useDamConfigState","damConfigStore","useDamConfigStoreOf","authorEnabled","getDamConfigExtSystem","cachedExtSystemId","sourceEnabled","damCreditConfigOf","authorNamesOf","pageExtSystem","fetchDamCredit","authors","sources","row","names","takeAuthorsOfDetailAsset","detailSave","fetchAsset","assetId","source","onAssetDetailClose","ofRow","shown","pairSavedRows","pairs","resItems","sentRows","index","left","resItem","writeCreditsToSavedAssets","credits","extSystemShown","itemsByExtSystem","credit","savedAsset","bulkUpdateAssetsAuthors","saveImages","showValidationError","assetUpdateItems","creditsAfterSave","sourceAfterSave","imagesRaw","toRaw","offering","of","author","named","rows","readAgain","givenMeanwhile","showWarningT","takeNamed","afterSave","entry","noteImagesSave","fields","imageSaveFieldsOf","savedOf","creditWrite","damId","sentOf","updatedItems","sent","keepSentDamCredit","showMetadataSaveError","removeImage","updateAllPositions","removeItem","editorMode","createImageStoreItem","pos","onReorderApplied","onMounted","openBlock","createElementBlock","toDisplayString","createCommentVNode","createVNode","unref","uploadAccept","uploadSizes","withCtx","fileInputProps","VBtn","mergeProps","createTextVNode","t","addFromDamLabel","_cache","$event","createSlots","_ctx","renderSlot","normalizeProps","guardReactiveProps","slotProps","VProgressCircular","createElementVNode","createBlock","isRef","Fragment","renderList","showSourceEnabled","sourceLabel","editAssetLabel","raw","uploadQueueDialog"],"sources":["../../../../../src/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { DocId, IntegerId } from '@/shared/types/common'\nimport { computed, inject, onBeforeUnmount, onMounted, ref, type ShallowRef, toRaw, watch } from 'vue'\nimport { isNull, isString, isUndefined } from '@/shared/utils/common'\nimport type { UploadQueueKey } from '@/domains/dam/types/UploadQueue'\nimport type { DamConfigLicenceExtSystemReturnType } from '@/domains/dam/types/DamConfig'\nimport { keepSentDamCredit, useImageStore } from '@/domains/dam/imageWidget/store/imageStore'\nimport ImageWidgetMultipleItem from '@/domains/dam/imageWidget/components/ImageWidgetMultipleItem.vue'\nimport { storeToRefs } from 'pinia'\nimport { useCommonAdminImageOptions } from '@/domains/dam/imageWidget/composables/commonAdminImageOptions'\nimport { useAlerts } from '@/domains/system/composables/alerts'\nimport {\n type AssetDetailItemDto,\n type AssetSearchListItemDto,\n DamAssetType,\n type DamImageCopyToLicenceResponse,\n} from '@/domains/dam/types/Asset'\nimport AAssetSelect from '@/domains/dam/assetSelect/components/AAssetSelect.vue'\nimport AFileInput from '@/domains/ui/file/components/AFileInput.vue'\nimport AImageDropzone from '@/domains/ui/file/components/AFileDropzone.vue'\nimport { useDamAcceptTypeAndSizeHelper } from '@/domains/dam/config/composables/acceptTypeAndSizeHelper'\nimport { useUploadQueuesStore } from '@/domains/dam/uploadQueue/store/uploadQueuesStore'\nimport type { AssetSelectReturnData, AssetSelectUsageHolder } from '@/domains/dam/types/AssetSelect'\nimport UploadQueueDialog from '@/domains/dam/uploadQueue/components/UploadQueueDialog.vue'\nimport { useUploadQueueDialog } from '@/domains/dam/uploadQueue/composables/useUploadQueueDialog'\nimport AssetDetailDialog from '@/domains/dam/assetDetail/components/AssetDetailDialog.vue'\nimport {\n type AssetAuthorsItems,\n bulkUpdateAssetsAuthors,\n fetchAsset,\n fetchAssetByFileId,\n fetchAssetListByIds,\n type IdsGroupedByLicences,\n showMetadataSaveError,\n} from '@/domains/dam/api/damAssetApi'\nimport { useAssetDetailStore } from '@/domains/dam/assetDetail/store/assetDetailStore'\nimport { loadAssetDetailExtSystem } from '@/domains/dam/assetDetail/composables/assetDetailExtSystem'\nimport { useCommonAdminCoreDamOptions } from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport type { ImageAware, ImageOwner, ImageStoreItem } from '@/domains/dam/types/ImageAware'\nimport { generateUUIDv1 } from '@/shared/utils/generator'\nimport ASortableListEditor from '@/domains/listEditor/components/ASortableListEditor.vue'\nimport AImageWidgetSimple from '@/domains/dam/imageWidget/components/AImageWidgetSimple.vue'\nimport {\n damCreditFromMap,\n fetchDamAuthorsMap,\n fetchDamCredit,\n damCreditConfigOf,\n hasNoDamCredit,\n} from '@/domains/dam/author/composables/damCredit'\nimport { useI18n } from 'vue-i18n'\nimport useVuelidate from '@vuelidate/core'\nimport { AImageMetadataValidationScopeSymbol } from '@/domains/dam/composables/uploadValidations'\nimport { useExtSystemIdForCached } from '@/domains/dam/composables/extSystemIdForCached'\nimport { useAssetSelectStore } from '@/domains/dam/assetSelect/store/assetSelectStore'\nimport ImageWidgetMultipleLimitDialog from '@/domains/dam/imageWidget/components/ImageWidgetMultipleLimitDialog.vue'\nimport { ImageWidgetUploadConfigKey } from '@/domains/dam/imageWidget/utils/imageWidgetInkectionKeys'\nimport { fetchAssetListByFileIdsMultipleLicences } from '@/domains/dam/api/damfetchAssetListByFileIdsMultipleLicences'\nimport { copyToLicence } from '@/domains/dam/api/damImageApi'\nimport { createDamImage, imageSaveFieldsOf } from '@/domains/dam/imageWidget/utils/damImage'\nimport { useDamConfigState } from '@/domains/dam/config/composables/damConfigState'\nimport { useDamConfigStoreOf } from '@/domains/dam/config/store/damConfigStore'\nimport { useDamConfigName } from '@/domains/dam/composables/damConfigName'\nimport {\n holdImages,\n imageSavedSince,\n imageSavesOfOthersOver,\n noteImagesSave,\n} from '@/domains/dam/imageWidget/utils/imageSaves'\nimport { WAIT_RAN_OUT, withinWaitLimit } from '@/domains/dam/imageWidget/utils/waitLimit'\n\nconst props = withDefaults(\n defineProps<{\n modelValue: IntegerId[]\n queueKey: UploadQueueKey\n uploadLicence: IntegerId\n selectLicences: IntegerId[]\n /** List views of the host the asset select offers as \"Search in\" choices, those the DAM user has. */\n listViews?: IntegerId[]\n configName?: string\n label?: string | undefined\n readonly?: boolean\n dataCy?: string | undefined\n width?: number | undefined\n disableDraggable?: boolean\n widgetIdentifierId?: string | undefined\n callDeleteApiOnRemove?: boolean\n skipCurrentUserCheck?: boolean\n /**\n * The record the image belongs to, sent with the image save (`ownerResourceName`, `ownerResourceId`). Left out,\n * the stored owner stays. core-cms checks a single use photo against it.\n */\n owner?: ImageOwner | null\n /** The record may use a single use photo: the picker lists them. `false` lists none. */\n singleUseAllowed?: boolean\n /** The record the picker asks the single use usage for (`AssetSelectUsageHolder`). */\n usageHolder?: AssetSelectUsageHolder | null\n }>(),\n {\n configName: undefined,\n listViews: () => [],\n label: undefined,\n readonly: false,\n dataCy: undefined,\n width: undefined,\n disableDraggable: false,\n widgetIdentifierId: undefined,\n callDeleteApiOnRemove: false,\n skipCurrentUserCheck: false,\n owner: null,\n singleUseAllowed: true,\n usageHolder: null,\n }\n)\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', data: IntegerId[]): void\n}>()\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst damConfigName = useDamConfigName(props.configName)\n\nconst assetSelectDialog = ref(false)\n\nconst imageWidgetUploadConfig = inject<ShallowRef<DamConfigLicenceExtSystemReturnType | undefined> | undefined>(\n ImageWidgetUploadConfigKey,\n undefined\n)\n\nif (isUndefined(imageWidgetUploadConfig) || isUndefined(imageWidgetUploadConfig.value)) {\n throw new Error(\"Fatal error, parent component doesn't provide necessary config ext system config.\")\n}\n\nconst imageOptions = useCommonAdminImageOptions(damConfigName)\nconst { imageClient, imageApi } = imageOptions\nconst { showErrorsDefault, showValidationError, showErrorT, showWarningT, showUnknownError } = useAlerts()\nconst uploadButtonComponent = ref<InstanceType<any> | null>(null)\n\nconst { uploadSizes, uploadAccept } = useDamAcceptTypeAndSizeHelper(\n DamAssetType.Image,\n imageWidgetUploadConfig.value.extSystemConfig\n)\n\nconst { t } = useI18n()\n\nconst imagesLoading = ref(false)\nconst imagesLoadFailed = ref(false)\n\n// Editor must not mount before the fetch lands: its dirty baseline is captured once, so rows\n// arriving later would read as \"added\". One-shot, like the fetch.\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst imagesReady = ref(props.modelValue.length === 0)\n\nconst listEditor = ref<{ commit: (rows?: ImageStoreItem[]) => void; cancelReorderMode: () => void } | null>(null)\n\nconst imageStore = useImageStore()\n// The store is shared by all widgets. Leftovers from the previous one do not belong to this entity.\nimageStore.reset()\nwatch(\n () => props.readonly,\n (value) => {\n imageStore.readonly = value\n },\n { immediate: true }\n)\nconst { images, maxPosition } = storeToRefs(imageStore)\n\n// Identity of this widget among the image-saving widgets (`imageSaves.ts`), and marks of its own pending saves.\nconst thisWidget = Symbol('image widget multiple')\nconst ownImageSaves = new Set<symbol>()\n// Cancels waiting on other widgets' saves when this widget unmounts.\nlet cancelSaveWaits: (() => void) | null = null\n\n/**\n * Resolves once no other widget has a pending save of any of `ids`, such as the\n * widget this one replaced. On timeout the user is told the request timed out.\n */\nconst savesOfOthersOver = async (ids: IntegerId[]) => {\n const waits = ids\n .map((id) => imageSavesOfOthersOver(damConfigName, id, ownImageSaves))\n .filter((wait) => !isNull(wait))\n if (waits.length === 0) return\n cancelSaveWaits = () => waits.forEach((wait) => wait.cancel())\n const over = await withinWaitLimit(Promise.all(waits.map((wait) => wait.over)), 1, damConfigName)\n cancelSaveWaits = null\n if (over !== WAIT_RAN_OUT) return\n waits.forEach((wait) => wait.cancel())\n if (!unmounted) showErrorT('error.apiTimedOut.message')\n}\n\n// Rows added while the entity images load wait for the load and\n// come after them. Otherwise the load replaced them silently.\nlet imagesLoaded: Promise<void> = Promise.resolve()\n\nconst fetchImagesOnLoad = async () => {\n if (props.modelValue.length === 0) {\n return\n }\n try {\n imagesLoading.value = true\n // Counted when the read is sent: a save answered later may have taken effect after the read.\n const readAt = holdImages(damConfigName, thisWidget, props.modelValue)\n const read = await imageApi.fetchImageListByIds(imageClient, props.modelValue)\n // Rows wait until other widgets' saves of these images are over, using the latest saved state.\n // Otherwise a row had old texts and this widget's save wrote them back over the saved ones.\n await savesOfOthersOver(read.map((image) => image.id))\n if (unmounted) return\n const imagesRes = read\n .map((image) => {\n const saved = imageSavedSince(damConfigName, image.id, readAt.get(image.id) ?? 0)\n return saved ? { ...image, ...saved, id: image.id, position: saved.position ?? image.position } : image\n })\n .sort((a, b) => (a.position ?? 0) - (b.position ?? 0))\n const groupedIds: IdsGroupedByLicences = new Map()\n imagesRes.forEach((image) => {\n const group = groupedIds.get(image.dam.licenceId)\n if (group) {\n group.push(image.dam.damId)\n } else {\n groupedIds.set(image.dam.licenceId, [image.dam.damId])\n }\n })\n\n let assetsRes: Awaited<ReturnType<typeof fetchAssetListByFileIdsMultipleLicences>> = []\n try {\n assetsRes = await fetchAssetListByFileIdsMultipleLicences(damClient, endPointAsset, groupedIds)\n } catch (e) {\n // Read-only shows images without DAM authors. A user without upload rights is often refused the assets.\n if (!props.readonly) throw e\n }\n\n imageStore.setImages(\n imagesRes.map((imageRes) => {\n if (isUndefined(imageRes.position)) throw new Error('Image object needs position field!')\n imageStore.updateMaxPositionIfGreater(imageRes.position)\n const found = assetsRes.find((asset) => asset.mainFile?.id === imageRes.dam.damId)\n return {\n key: generateUUIDv1(),\n ...imageRes,\n // Each row gets its own copy. Rows of the same asset shared the array.\n damAuthors: found ? [...found.authors] : [],\n damSources: found ? [...(found.sources ?? [])] : [],\n showDamAuthors: found ? hasNoDamCredit(found.authors, found.sources) : false,\n assetId: found ? found.id : undefined,\n }\n })\n )\n // Displaying a read-only widget must not rewrite the form's value with the stored order.\n if (!props.readonly) {\n emit('update:modelValue', images.value.map((image) => image.id).filter((id) => id !== undefined) as IntegerId[])\n }\n } catch (e) {\n imagesLoadFailed.value = true\n showErrorsDefault(e)\n } finally {\n imagesLoading.value = false\n imagesReady.value = true\n }\n}\n\nconst uploadQueuesStore = useUploadQueuesStore()\n\nconst uploadQueue = computed(() => {\n return uploadQueuesStore.getQueue(props.queueKey)\n})\n\nconst { cachedExtSystemId } = useExtSystemIdForCached(damConfigName)\n\nconst { uploadQueueDialog, stopQueueLeftBehind } = useUploadQueueDialog()\n\nconst onFileInput = (files: File[]) => {\n if (props.readonly) return\n // The input rejected every file and reported it. Opening the queue dialog would show nothing new.\n if (files.length === 0) return\n const config = imageWidgetUploadConfig.value\n if (isUndefined(config)) return\n cachedExtSystemId.value = config.extSystem\n // `afterLimitDialogAdd` opens the queue dialog once files are\n // queued. Over the limit nothing is queued until the user agrees.\n // Rows of a queue no dialog shows are not counted. They go first.\n stopQueueLeftBehind(props.queueKey)\n limitDialogComponent.value?.check(files)\n}\n\nconst onDrop = (files: File[]) => {\n if (props.readonly) return\n // Same as the input: the dropzone rejected every file and reported it.\n if (files.length === 0) return\n const config = imageWidgetUploadConfig.value\n if (isUndefined(config)) return\n cachedExtSystemId.value = config.extSystem\n stopQueueLeftBehind(props.queueKey)\n limitDialogComponent.value?.check(files)\n}\n\nconst onCopyToLicence = (data: DamImageCopyToLicenceResponse) => {\n if (props.readonly) return\n if (data.length === 0) return\n const config = imageWidgetUploadConfig.value\n if (isUndefined(config)) return\n cachedExtSystemId.value = config.extSystem\n stopQueueLeftBehind(props.queueKey)\n let refused = 0\n data.forEach((item) => {\n if (item.result === 'copy') {\n uploadQueuesStore.addByCopyToLicence(\n props.queueKey,\n config.extSystem,\n config.licence,\n [item.targetAsset],\n damConfigName\n )\n } else if (item.result === 'exists') {\n uploadQueuesStore.addByCopyToLicence(\n props.queueKey,\n config.extSystem,\n config.licence,\n [item.targetAsset],\n damConfigName\n )\n uploadQueuesStore.queueItemDuplicate(item.targetAsset, item.targetMainFile, DamAssetType.Image, damConfigName)\n } else {\n refused++\n }\n })\n if (refused > 0) showErrorT('common.damImage.queueItem.errorUnableToCopyToLicence')\n if (refused === data.length) return\n uploadQueueDialog.value = props.queueKey\n}\n\nconst afterLimitDialogAdd = () => {\n uploadQueueDialog.value = props.queueKey\n}\n\n/**\n * Images of picked assets, without position. Each asset is read under\n * its own licence, and its credit under that licence's ext system.\n * The browsed licence can change after picking, and the DAM silently omits assets of another licence.\n * `readUnder`: the licence of all assets and its ext system, when the caller knows them.\n */\nconst assetSelectConfirmMap = async (\n items: AssetSearchListItemDto[],\n readUnder?: { licence: IntegerId; extSystem: IntegerId }\n): Promise<ImageStoreItem[]> => {\n const assetSelectStore = useAssetSelectStore()\n const assetMetadataMap = new Map<DocId, { description: string; authorIds: DocId[]; sourceIds: DocId[] }>()\n // The image source of each read asset: its credit, or what the custom mapping gives.\n const creditMap = new Map<DocId, string>()\n const idsByLicence: IdsGroupedByLicences = new Map()\n items.forEach((item) => {\n const licence = readUnder ? readUnder.licence : item.licence\n const group = idsByLicence.get(licence)\n if (group) {\n group.push(item.id)\n } else {\n idsByLicence.set(licence, [item.id])\n }\n })\n // A licence that fails to read does not stop the others.\n const failures: unknown[] = []\n for (const [licence, ids] of idsByLicence) {\n try {\n const assetDetails = await fetchAssetListByIds(damClient, endPointAsset, ids, licence)\n if (customAssetSelectMetadataToImageMap) {\n assetDetails.forEach((assetDetail) => {\n const mapped = customAssetSelectMetadataToImageMap(assetDetail)\n assetMetadataMap.set(assetDetail.id, {\n description: mapped.description,\n authorIds: [],\n sourceIds: [],\n })\n creditMap.set(assetDetail.id, mapped.source)\n })\n continue\n }\n assetDetails.forEach((assetDetail) => {\n assetMetadataMap.set(assetDetail.id, {\n description: isString(assetDetail.metadata.customData?.description)\n ? assetDetail.metadata.customData.description.trim()\n : '',\n authorIds: assetDetail.authors,\n sourceIds: assetDetail.sources ?? [],\n })\n })\n const credited = assetDetails.filter((assetDetail) => !hasNoDamCredit(assetDetail.authors, assetDetail.sources))\n if (credited.length > 0) {\n const licenceConfig = assetSelectStore.selectConfig.find((config) => config.licence === licence)\n // Uses the licence's ext system, as for every DAM credit the widgets\n // write. Falls back to the picker's when the licence does not tell.\n const extSystem = readUnder\n ? readUnder.extSystem\n : ((await getExtSystemByLicence(licence)) ??\n (licenceConfig ?? assetSelectStore.requireSelectedSelectConfig()).extSystem)\n const namesMap = await fetchDamAuthorsMap(\n damClient,\n endPointAuthor,\n extSystem,\n credited.flatMap((assetDetail) => [...(assetDetail.sources ?? []), ...assetDetail.authors])\n )\n const creditConfig = creditConfigOf(extSystem)\n credited.forEach((assetDetail) => {\n creditMap.set(\n assetDetail.id,\n damCreditFromMap(namesMap, assetDetail.sources, assetDetail.authors, creditConfig)\n )\n })\n }\n } catch (e) {\n failures.push(e)\n }\n }\n // Reported once for all failures. A DAM refusal arrives as a bare axios error that the default handler ignores.\n if (failures.length > 0 && !showErrorsDefault(failures[0])) showUnknownError()\n\n return items.map((asset) => {\n const authorIds = assetMetadataMap.get(asset.id)?.authorIds || []\n const sourceIds = assetMetadataMap.get(asset.id)?.sourceIds || []\n const description = assetMetadataMap.get(asset.id)?.description ?? ''\n\n if (customAssetSelectMetadataToImageMap) {\n return {\n key: generateUUIDv1(),\n ...createDamImage(\n { fileId: asset.mainFile!.id, licenceId: asset.licence, internal: asset.mainFileInternal },\n { description, source: creditMap.get(asset.id) ?? '' },\n { position: 0 }\n ),\n damAuthors: [],\n damSources: [],\n showDamAuthors: false,\n assetId: asset.id,\n }\n }\n\n return {\n key: generateUUIDv1(),\n ...createDamImage(\n { fileId: asset.mainFile!.id, licenceId: asset.licence, internal: asset.mainFileInternal },\n { description, source: creditMap.get(asset.id) ?? '' },\n { position: 0 }\n ),\n damAuthors: authorIds,\n damSources: sourceIds,\n // Only for assets that were read. For an unread asset its sources and authors are unknown,\n // and those picked in the row would replace them in the DAM. Its row shows the source instead.\n showDamAuthors: assetMetadataMap.has(asset.id) && hasNoDamCredit(authorIds, sourceIds),\n assetId: asset.id,\n }\n })\n}\n\nconst positioned = (items: ImageStoreItem[]) =>\n items.map((item) => {\n maxPosition.value++\n return { ...item, position: maxPosition.value }\n })\n\nconst onAssetSelectConfirm = async (data: AssetSelectReturnData) => {\n if (props.readonly) return\n if (data.type !== 'asset' || data.value.length === 0) return\n const picked = data.value.filter((asset) => !isNull(asset.mainFile))\n // With the take over switch on, picked assets from a licence other than the upload licence are copied into it here,\n // not by the image save. Assets already in it are used at once. Copies are added when the queue dialog is used.\n const targetLicence = data.forceTakeOver ? props.uploadLicence : undefined\n const toCopy =\n copyToLicenceEnabled !== false && !isUndefined(targetLicence)\n ? picked.filter((asset) => asset.licence !== targetLicence)\n : []\n // A widget that unmounted or became read-only adds nothing. The image store belongs to the next widget by then.\n const addingIsOver = () => unmounted || props.readonly\n if (toCopy.length === 0) {\n const images = await assetSelectConfirmMap(picked)\n await imagesLoaded\n if (!addingIsOver()) imageStore.addImages(positioned(images))\n return\n }\n const copying = copyToLicence(\n damClient,\n endPointImage,\n toCopy.map((asset) => ({ asset: asset.id, targetAssetLicence: targetLicence! }))\n )\n // Read during the copy under their own licence (the upload's) and its ext system, not the browsed one.\n // Added before the queue dialog opens. Otherwise using the dialog first put the copies before them.\n const asTheyAre = picked.filter((asset) => !toCopy.includes(asset))\n const config = imageWidgetUploadConfig.value\n const imagesAsTheyAre =\n asTheyAre.length === 0\n ? Promise.resolve([])\n : assetSelectConfirmMap(asTheyAre, config ? { licence: targetLicence!, extSystem: config.extSystem } : undefined)\n let copyRes: DamImageCopyToLicenceResponse | null = null\n try {\n copyRes = await copying\n } catch (e) {\n if (!showErrorsDefault(e)) showUnknownError()\n }\n const images = await imagesAsTheyAre\n await imagesLoaded\n if (addingIsOver()) return\n imageStore.addImages(positioned(images))\n if (copyRes) onCopyToLicence(copyRes)\n}\n\nconst assetDetailStore = useAssetDetailStore()\nconst { dialog: assetDialog } = storeToRefs(assetDetailStore)\nconst {\n damClient,\n endPointAsset,\n endPointImage,\n endPointAuthor,\n copyToLicenceEnabled,\n showSourceEnabled,\n sourceLabel,\n editAssetLabel,\n addFromDamLabel,\n customAssetSelectMetadataToImageMap,\n} = useCommonAdminCoreDamOptions(damConfigName)\n\n// True while the detail was opened by \"edit asset\" of a row. Not for the detail\n// opened from the queue dialog, which is drawn here too and reads nothing on close.\nlet detailOfRow = false\n// Reads of assets whose detail closed, keyed by asset. The widget save waits for them.\n// Reads of other assets do not wait on these. Otherwise closing one detail waited for another asset's save and read.\nconst detailAssetReads = new Map<DocId, Promise<void>>()\n// Such a read may finish after unmount, when the store belongs to the next widget.\nlet unmounted = false\nonBeforeUnmount(() => {\n unmounted = true\n holdImages(damConfigName, thisWidget, [])\n cancelSaveWaits?.()\n})\n\nconst onEditAsset = async (assetFileId: DocId) => {\n detailOfRow = true\n let extSystem: IntegerId | null = null\n try {\n await assetDetailStore.open(\n props.queueKey,\n async () => {\n const asset = await fetchAssetByFileId(damClient, endPointAsset, assetFileId)\n // Falls back to the ext system of the widget's upload licence,\n // loaded by its root, when the licence cannot be resolved.\n const shownUnder = (await getExtSystemByLicence(asset.licence)) ?? imageWidgetUploadConfig.value!.extSystem\n // Must load before the detail shows the asset: it reads the ext\n // system configuration while rendering and threw without it.\n await loadAssetDetailExtSystem(damClient, shownUnder, asset.attributes.assetType, damConfigName)\n extSystem = shownUnder\n return asset\n },\n // Only for the asset the detail still shows: a stale answer must not change the ext system used for name lookups.\n () => {\n if (extSystem) cachedExtSystemId.value = extSystem\n }\n )\n } catch (e) {\n showErrorsDefault(e)\n }\n}\n\n// An upload applied during the entity image load waits with its dialog and\n// queue intact. Its rows come after the loaded images, then the dialog closes.\n// If the widget is read-only or gone by then, the dialog and queue stay as for\n// read-only, so nothing is lost. Before, the dialog and rows were dropped.\n// Applying again while waiting is ignored, or rows would be added twice.\nlet uploadWaitsForLoad = false\nconst onAssetUploadConfirm = async (items: ImageStoreItem[]) => {\n if (props.readonly) return\n if (items.length === 0) return\n if (imagesLoading.value) {\n if (uploadWaitsForLoad) return\n uploadWaitsForLoad = true\n await imagesLoaded\n uploadWaitsForLoad = false\n if (unmounted || props.readonly) return\n }\n addUploadedRows(items)\n uploadQueueDialog.value = null\n uploadQueuesStore.stopUpload(props.queueKey)\n}\n\nconst addUploadedRows = (items: ImageStoreItem[]) => {\n // A duplicate file becomes the asset of the existing image, and the dialog has just saved its sources and authors.\n // Rows of that asset offering the pick take them, as after closing the detail. Otherwise their pick would overwrite\n // them. The credit goes into a row's source only if it has none. Before, it always overwrote it.\n if (damSelectionEnabled.value) {\n items.forEach((item) => {\n if (isUndefined(item.assetId) || hasNoDamCredit(item.damAuthors, item.damSources)) return\n images.value.forEach((image) => {\n if (image.assetId !== item.assetId || !image.showDamAuthors) return\n takeAuthorsGiven(image, item.damAuthors, item.damSources, item.texts.source)\n })\n })\n }\n imageStore.addImages(positioned(items))\n}\n\nconst actionLibrary = () => {\n assetSelectDialog.value = true\n}\n\nconst v$ = useVuelidate({ $scope: AImageMetadataValidationScopeSymbol })\n\nconst { getDamConfigExtSystem, getExtSystemByLicence } = useDamConfigState(damClient, damConfigName)\nconst damConfigStore = useDamConfigStoreOf(damConfigName)\n\nconst authorEnabled = computed(() => {\n return !!getDamConfigExtSystem(cachedExtSystemId.value)?.[DamAssetType.Image]?.authors?.enabled\n})\n\nconst sourceEnabled = computed(() => {\n return !!getDamConfigExtSystem(cachedExtSystemId.value)?.[DamAssetType.Image]?.sources?.enabled\n})\n\n// Rows offer the pick of sources and authors when the configured ext system has either.\nconst damSelectionEnabled = computed(() => authorEnabled.value || sourceEnabled.value)\n\n// The credit format of `extSystem` when its configuration is loaded, else that of the configured one.\nconst creditConfigOf = (extSystem: IntegerId) =>\n damCreditConfigOf(getDamConfigExtSystem(extSystem) ?? getDamConfigExtSystem(cachedExtSystemId.value))\n\n/**\n * Credit of an asset under its licence's ext system.\n * Falls back to `pageExtSystem` when the licence does not tell.\n */\nconst authorNamesOf = async (asset: AssetDetailItemDto, pageExtSystem: IntegerId) => {\n const extSystem = (await getExtSystemByLicence(asset.licence)) ?? pageExtSystem\n return fetchDamCredit(damClient, endPointAuthor, extSystem, asset.sources, asset.authors, creditConfigOf(extSystem))\n}\n\n/**\n * Once the asset turns out to have sources or authors, a row offering the\n * pick takes them, drops the pick and shows its source.\n * The source takes their credit if empty or if it holds a hidden \"fill empty\"\n * pick from mass operations. An image's own source stays for the user to check.\n */\nconst takeAuthorsGiven = (row: ImageStoreItem, authors: DocId[], sources: DocId[] | undefined, names: string) => {\n row.damAuthors = [...authors]\n row.damSources = [...(sources ?? [])]\n if (row.texts.source.trim().length === 0 || imageStore.hasSourceOfPick(row)) row.texts.source = names\n imageStore.forgetSourceOfPick(row)\n row.showDamAuthors = false\n}\n\n/**\n * The detail may have given sources or authors to an asset whose row offers the pick.\n * Otherwise the widget save overwrote them, or saved the image without a source.\n * So the asset is read again, and its offering rows take its authors with names under the asset\n * licence's ext system (see `takeAuthorsGiven`). Rows showing their source are left alone.\n * `detailSave`: the detail save pending at close. `pageExtSystem`: the ext system configured at that time.\n */\nconst takeAuthorsOfDetailAsset = async (assetId: DocId, detailSave: Promise<void> | null, pageExtSystem: IntegerId) => {\n try {\n // Read before the DAM answers that save, the asset would be stale.\n await detailSave\n const asset = await fetchAsset(damClient, endPointAsset, assetId)\n if (hasNoDamCredit(asset.authors, asset.sources)) return\n const source = await authorNamesOf(asset, pageExtSystem)\n if (unmounted || props.readonly) return\n images.value.forEach((image) => {\n // Uses the row's own flag. Whether the page shows the pick depends\n // on an ext system that another asset's detail may have changed.\n if (image.assetId !== asset.id || !image.showDamAuthors) return\n takeAuthorsGiven(image, asset.authors, asset.sources, source)\n })\n } catch (e) {\n if (!unmounted && !showErrorsDefault(e)) showUnknownError()\n }\n}\n\n/**\n * `shown`: the asset the detail showed. None if it closed from its loader or after a failed read.\n * Captured before any await: whether a row of that asset offers the\n * pick, the pending detail save, and the configured ext system.\n */\nconst onAssetDetailClose = (shown: AssetDetailItemDto | null) => {\n const ofRow = detailOfRow\n detailOfRow = false\n if (!ofRow || isNull(shown) || props.readonly || !damSelectionEnabled.value) return\n const assetId = shown.id\n if (!images.value.some((image) => image.assetId === assetId && image.showDamAuthors)) return\n const detailSave = assetDetailStore.savingOf(assetId, damConfigName)\n const pageExtSystem = cachedExtSystemId.value\n const read = (detailAssetReads.get(assetId) ?? Promise.resolve()).then(() =>\n takeAuthorsOfDetailAsset(assetId, detailSave, pageExtSystem)\n )\n detailAssetReads.set(assetId, read)\n void read.then(() => {\n if (detailAssetReads.get(assetId) === read) detailAssetReads.delete(assetId)\n })\n}\n\n/**\n * The returned image of each sent row. By position when the save returns one image per sent row, as the image API\n * does: a photo taken over into the upload licence comes back with another file. Otherwise by file, rows of the same\n * file one by one in send order. Matching by file alone gave every row of a file the values of the first one.\n */\nconst pairSavedRows = (sentRows: ImageStoreItem[], resItems: ImageAware[]) => {\n // By row key: the rows come as they are in the store and as sent, which are not the same objects.\n const pairs = new Map<string, ImageAware>()\n // A position pairs a row with its image when both have the file, or the row's photo was of another licence and the\n // image is in the upload licence: taken over. Otherwise the answer is in another order and is paired by file.\n const byPosition =\n resItems.length === sentRows.length &&\n sentRows.every((row, index) => {\n const saved = resItems[index]!\n return (\n saved.dam.damId === row.dam.damId ||\n (row.dam.licenceId !== props.uploadLicence && saved.dam.licenceId === props.uploadLicence)\n )\n })\n if (byPosition) {\n sentRows.forEach((row, index) => pairs.set(row.key, resItems[index]!))\n } else {\n const left = [...sentRows]\n resItems.forEach((resItem) => {\n const index = left.findIndex((row) => row.dam.damId === resItem.dam.damId)\n if (index >= 0) pairs.set(left.splice(index, 1)[0]!.key, resItem)\n })\n }\n return (row: ImageStoreItem) => pairs.get(row.key)\n}\n\n/**\n * Writes picked sources and authors into the assets of the saved files, after the save: the save may have taken a\n * photo of another licence over into a copy in the upload licence. Each asset under the ext system of its licence\n * where the page knows it, else of the rows; no licence is read, as for the writes before the save.\n * A failed write is shown; the images stay saved.\n */\nconst writeCreditsToSavedAssets = async (\n credits: Array<{ damId: DocId; authors: DocId[]; sources: DocId[]; extSystem: IntegerId }>\n) => {\n if (credits.length === 0) return\n let extSystemShown = cachedExtSystemId.value\n try {\n const itemsByExtSystem = new Map<IntegerId, AssetAuthorsItems>()\n for (const credit of credits) {\n const savedAsset = await fetchAssetByFileId(damClient, endPointAsset, credit.damId)\n const extSystem = damConfigStore.damConfigLicenceExtSystem.get(savedAsset.licence)?.extSystem ?? credit.extSystem\n const items = itemsByExtSystem.get(extSystem) ?? []\n items.push({ id: savedAsset.id, authors: credit.authors, sources: credit.sources })\n itemsByExtSystem.set(extSystem, items)\n }\n for (const [extSystem, items] of itemsByExtSystem) {\n extSystemShown = extSystem\n await bulkUpdateAssetsAuthors(damClient, endPointAsset, DamAssetType.Image, extSystem, items, damConfigName)\n }\n } catch (e) {\n showMetadataSaveError(e, extSystemShown, damConfigName)\n }\n}\n\nconst saveImages = async () => {\n // Nothing of the user's to write. The images stay as loaded.\n if (props.readonly) return true\n // An empty store here means the fetch is pending or failed, not a\n // user deletion. The empty path below would detach every image.\n if (imagesLoading.value || imagesLoadFailed.value) {\n showUnknownError()\n return false\n }\n // A closed detail's asset is still being read. Its rows are not written until they have its authors.\n await Promise.all(detailAssetReads.values())\n if (unmounted) return false\n v$.value.$touch()\n if (v$.value.$invalid) {\n showValidationError()\n return false\n }\n try {\n const assetUpdateItems: AssetAuthorsItems = []\n // Picks of rows whose photo is of another licence than the upload licence. The save may take such a photo over\n // into a copy in the upload licence, so its credit is written after the save into the asset of the saved file.\n const creditsAfterSave: Array<{\n rows: ImageStoreItem[]\n authors: DocId[]\n sources: DocId[]\n extSystem: IntegerId\n }> = []\n // The credit of the rows of the picks above by row key, put into the rows once their pick is written.\n const sourceAfterSave = new Map<string, string>()\n const imagesRaw = toRaw(images.value)\n // Rows offering the pick, grouped by asset. An entity may have\n // an image twice, and a queue duplicate is a second row of its asset.\n // Per row, authors went out once per row and the last won, and a row with no pick was saved without a source.\n // The asset gets the union of picks in its rows, each source and author once,\n // and each row gets them and their credit after the DAM accepts them.\n type Offering = { assetId: DocId | undefined; rows: ImageStoreItem[]; authors: DocId[]; sources: DocId[] }\n const offering = new Map<DocId, Offering>()\n if (damSelectionEnabled.value) {\n images.value.forEach((image) => {\n if (!image.showDamAuthors) return\n // A row offering the pick has an asset. One without would be grouped alone.\n const of = image.assetId ?? image.key\n const asset = offering.get(of) ?? { assetId: image.assetId, rows: [], authors: [], sources: [] }\n offering.set(of, asset)\n asset.rows.push(image)\n image.damAuthors.forEach((author) => {\n if (!asset.authors.includes(author)) asset.authors.push(author)\n })\n for (const source of image.damSources ?? []) {\n if (!asset.sources.includes(source)) asset.sources.push(source)\n }\n })\n }\n const named: Array<Offering & { source: string }> = []\n for (const { assetId, rows, authors, sources } of offering.values()) {\n if (hasNoDamCredit(authors, sources)) continue\n // Uses the ext system of the rows' asset licence, as the pre-write read does. Falls back to the configured\n // one when the page does not know the licence. It is not fetched, since entity rows can be of any licence.\n const extSystem =\n damConfigStore.damConfigLicenceExtSystem.get(rows[0]!.dam.licenceId)?.extSystem ?? cachedExtSystemId.value\n if (rows[0]!.dam.licenceId !== props.uploadLicence) {\n creditsAfterSave.push({ rows, authors, sources, extSystem })\n } else if (assetId) {\n assetUpdateItems.push({ id: assetId, authors, sources })\n }\n const namesMap = await fetchDamAuthorsMap(damClient, endPointAuthor, extSystem, [...sources, ...authors])\n named.push({\n assetId,\n rows,\n authors,\n sources,\n source: damCreditFromMap(namesMap, sources, authors, creditConfigOf(extSystem)),\n })\n }\n // Unmounted while authors loaded: write nothing. Turned read-only: nothing of the user's is written.\n if (unmounted) return false\n if (props.readonly) return true\n // Assets may have received sources or authors elsewhere since their rows loaded, and the write would\n // replace them. So each asset with a pick is re-read right before the write.\n // If any asset already has sources or authors, nothing is written. Its offering rows take\n // them (`takeAuthorsGiven`), a message stays until closed, and the user saves again.\n const picked = [...offering.values()].filter(\n ({ assetId, authors, sources }) => !isUndefined(assetId) && !hasNoDamCredit(authors, sources)\n )\n if (picked.length > 0) {\n const readAgain = await Promise.all(picked.map(({ assetId }) => fetchAsset(damClient, endPointAsset, assetId!)))\n // Unmounted or made read-only while the assets were read: write nothing.\n if (unmounted || props.readonly) return false\n const givenMeanwhile = picked\n .map(({ rows }, index) => ({ rows, asset: readAgain[index]! }))\n .filter(({ asset }) => !hasNoDamCredit(asset.authors, asset.sources))\n if (givenMeanwhile.length > 0) {\n const pageExtSystem = cachedExtSystemId.value\n const names = await Promise.all(givenMeanwhile.map(({ asset }) => authorNamesOf(asset, pageExtSystem)))\n if (unmounted || props.readonly) return false\n givenMeanwhile.forEach(({ rows, asset }, index) => {\n rows.forEach((row) => {\n if (row.showDamAuthors) takeAuthorsGiven(row, asset.authors, asset.sources, names[index]!)\n })\n })\n showWarningT('common.damImage.image.meta.galleryAuthorsGivenMeanwhile', -1)\n return false\n }\n }\n if (assetUpdateItems.length) {\n // Sources go out where the configured ext system has them, as the rows offer them.\n await bulkUpdateAssetsAuthors(\n damClient,\n endPointAsset,\n DamAssetType.Image,\n cachedExtSystemId.value,\n assetUpdateItems,\n damConfigName\n )\n // Unmounted while the authors were written: save no image. A widget mounted meanwhile\n // for the same images read them before this save, which is noted only once sent.\n if (unmounted) return false\n }\n // The DAM now has these authors even if the images are not saved, so the rows show the source as after a save.\n // If the rows kept offering the pick, the next save would send them as picks,\n // the pre-write read would find these authors, and nothing would be written.\n // Rows whose pick is written after the save (`creditsAfterSave`) send their credit and take it once saved.\n const takeNamed = ({ assetId, rows, authors, sources, source }: Offering & { source: string }) => {\n rows.forEach((row) => {\n row.damAuthors = [...authors]\n row.damSources = [...sources]\n row.texts.source = source\n if (isUndefined(assetId)) return\n row.showDamAuthors = false\n imageStore.forgetSourceOfPick(row)\n })\n }\n const afterSave = new Set(creditsAfterSave.flatMap(({ rows }) => rows.map((row) => row.key)))\n named.forEach((entry) => {\n if (entry.rows.some((row) => afterSave.has(row.key))) {\n entry.rows.forEach((row) => sourceAfterSave.set(row.key, entry.source))\n return\n }\n takeNamed(entry)\n })\n const sentRows = [...imagesRaw]\n // Note the saved images for the page's other widgets, one by one.\n // This runs even if this widget unmounted before the response.\n // Each image goes with the record it belongs to and the upload licence a photo of another licence is taken over into.\n const resItems = await noteImagesSave(\n damConfigName,\n sentRows.map((row) => row.id).filter((id) => !isUndefined(id)),\n ownImageSaves,\n imageApi.bulkUpdateImages(\n imageClient,\n sentRows.map((row) => {\n const fields = imageSaveFieldsOf(row, props.owner, props.uploadLicence)\n const source = sourceAfterSave.get(row.key)\n return isUndefined(source) ? fields : { ...fields, texts: { ...fields.texts, source } }\n })\n )\n )\n const savedOf = pairSavedRows(sentRows, resItems)\n // Written also for a widget gone meanwhile: the images are saved with this credit.\n const creditWrite = writeCreditsToSavedAssets(\n creditsAfterSave.flatMap(({ rows, authors, sources, extSystem }) => {\n const damIds = new Set(rows.map((row) => savedOf(row)?.dam.damId).filter((damId) => !isUndefined(damId)))\n return [...damIds].map((damId) => ({ damId, authors, sources, extSystem }))\n })\n )\n // If unmounted before the response, write nothing to the image store. By then it belongs to the next widget.\n if (unmounted) return true\n named.forEach((entry) => {\n if (entry.rows.some((row) => sourceAfterSave.has(row.key))) takeNamed(entry)\n })\n holdImages(\n damConfigName,\n thisWidget,\n resItems.map((resItem) => resItem.id)\n )\n const ids: IntegerId[] = []\n const items = resItems.map((resItem) => {\n ids.push(resItem.id)\n\n return {\n key: generateUUIDv1(),\n ...resItem,\n damAuthors: [],\n damSources: [],\n showDamAuthors: false,\n assetId: undefined,\n }\n })\n if (imageStore.images.length === 0) {\n listEditor.value?.commit([])\n // Emptying is a change too. Without this emit the parent keeps its old ids.\n emit('update:modelValue', ids)\n await creditWrite\n return true\n }\n\n // Each returned image with its own sent row (`pairSavedRows`). A returned image no sent row\n // matches keeps what it came with: no pick, no asset, its source.\n const sentOf = new Map<ImageAware, ImageStoreItem>()\n sentRows.forEach((row) => {\n const saved = savedOf(row)\n if (saved) sentOf.set(saved, row)\n })\n const updatedItems = items.map((item, index) => {\n const sent = sentOf.get(resItems[index]!)\n return sent ? keepSentDamCredit(item, sent) : item\n })\n imageStore.setImages(updatedItems)\n // Pass the rows explicitly. `setImages` just replaced their keys,\n // so a bare `commit()` would read the not-yet-rerendered prop.\n listEditor.value?.commit(updatedItems)\n emit('update:modelValue', ids)\n await creditWrite\n return true\n } catch (e) {\n // Authors refused by validation are named as the forms name them. Other errors are shown as before.\n showMetadataSaveError(e, cachedExtSystemId.value, damConfigName)\n return false\n }\n}\n\n// Renumber the remaining images as after a move. Otherwise the backend gets positions with a gap.\nconst removeImage = (index: number) => {\n imageStore.removeImageByIndex(index)\n updateAllPositions()\n}\n\nconst removeItem = async (index: number) => {\n const image = images.value[index]\n if (!image) return\n if (isUndefined(image.id)) {\n removeImage(index)\n return\n }\n if (props.callDeleteApiOnRemove) {\n try {\n await imageApi.deleteImage(imageClient, image.id)\n removeImage(index)\n } catch (e) {\n showErrorsDefault(e)\n }\n return\n }\n removeImage(index)\n}\n\nconst limitDialogComponent = ref<InstanceType<typeof ImageWidgetMultipleLimitDialog> | null>(null)\n\nconst editorMode = ref<'view' | 'reorder'>('view')\n// A reorder under way would keep moving rows a read-only widget does not save.\nwatch(\n () => props.readonly,\n (value) => {\n if (value && editorMode.value === 'reorder') listEditor.value?.cancelReorderMode()\n }\n)\n\n// Required by the editor but never called. Adds go through the\n// upload and asset-select flow; the editor's add button is hidden.\nconst createImageStoreItem = (): ImageStoreItem => ({\n key: generateUUIDv1(),\n ...createDamImage({ fileId: '', licenceId: 0 }, {}, { position: 0 }),\n damAuthors: [],\n damSources: [],\n showDamAuthors: false,\n assetId: undefined,\n})\n\nconst updateAllPositions = () => {\n let pos = 0\n images.value.forEach((image) => {\n pos++\n image.position = pos\n })\n imageStore.maxPosition = pos\n}\n\nconst onReorderApplied = () => {\n updateAllPositions()\n}\n\ndefineExpose({\n saveImages,\n})\n\nonMounted(() => {\n imagesLoaded = fetchImagesOnLoad()\n})\n</script>\n\n<template>\n <div>\n <h4\n v-if=\"label\"\n class=\"font-weight-bold text-label-large\"\n >\n {{ label }}\n </h4>\n <div\n v-if=\"!readonly\"\n class=\"pb-2\"\n >\n <AFileInput\n :file-input-key=\"uploadQueue?.fileInputKey\"\n :accept=\"uploadAccept\"\n :max-sizes=\"uploadSizes\"\n multiple\n @files-input=\"onFileInput\"\n >\n <template #activator=\"{ props: fileInputProps }\">\n <VBtn\n ref=\"uploadButtonComponent\"\n v-bind=\"fileInputProps\"\n >\n {{ t('common.damImage.image.button.upload') }}\n </VBtn>\n </template>\n </AFileInput>\n <VBtn\n class=\"mr-2\"\n @click=\"actionLibrary\"\n >\n {{ addFromDamLabel }}\n </VBtn>\n </div>\n <AAssetSelect\n v-model=\"assetSelectDialog\"\n :select-licences=\"selectLicences\"\n :list-views=\"listViews\"\n :upload-licence=\"uploadLicence\"\n :min-count=\"1\"\n :max-count=\"50\"\n :asset-type=\"DamAssetType.Image\"\n :skip-current-user-check=\"skipCurrentUserCheck\"\n :single-use-allowed=\"singleUseAllowed\"\n :usage-holder=\"usageHolder\"\n :config-name=\"damConfigName\"\n return-type=\"asset\"\n @confirm=\"onAssetSelectConfirm\"\n >\n <template\n v-if=\"$slots['asset-select-sidebar-prepend']\"\n #sidebar-prepend=\"slotProps\"\n >\n <slot\n name=\"asset-select-sidebar-prepend\"\n v-bind=\"slotProps\"\n />\n </template>\n </AAssetSelect>\n <div\n v-if=\"imagesLoading\"\n class=\"w-100 d-flex align-center justify-center\"\n >\n <VProgressCircular\n indeterminate\n color=\"primary\"\n />\n </div>\n <div\n class=\"position-relative w-100\"\n style=\"min-height: 140px\"\n >\n <ASortableListEditor\n v-if=\"imagesReady\"\n ref=\"listEditor\"\n v-model=\"images\"\n v-model:mode=\"editorMode\"\n :factory=\"createImageStoreItem\"\n get-key=\"key\"\n position=\"position\"\n :show-add-button=\"false\"\n :show-delete-button=\"false\"\n :show-edit-button=\"false\"\n :disable-drag=\"disableDraggable || readonly\"\n :readonly=\"readonly\"\n @reorder-applied=\"onReorderApplied\"\n >\n <template #view-body>\n <div class=\"asset-list-tiles asset-list-tiles--thumbnail a-sortable-widget__group\">\n <ImageWidgetMultipleItem\n v-for=\"(image, index) in images\"\n :key=\"image.key\"\n :index=\"index\"\n :show-source-enabled=\"showSourceEnabled\"\n :source-label=\"sourceLabel\"\n :edit-asset-label=\"editAssetLabel\"\n :author-enabled=\"authorEnabled\"\n :source-enabled=\"sourceEnabled\"\n :readonly=\"readonly\"\n :config-name=\"damConfigName\"\n @edit-asset=\"onEditAsset\"\n @remove-item=\"removeItem\"\n />\n </div>\n </template>\n <template #item-compact=\"{ raw }\">\n <div class=\"image-widget-multiple-reorder\">\n <div class=\"image-widget-multiple-reorder__thumb\">\n <AImageWidgetSimple\n :model-value=\"raw.id\"\n :image=\"raw\"\n :config-name=\"damConfigName\"\n />\n </div>\n <div class=\"image-widget-multiple-reorder__meta\">\n <div class=\"image-widget-multiple-reorder__title\">\n {{ raw.texts?.description?.trim() || '—' }}\n </div>\n <div\n v-if=\"raw.texts?.source\"\n class=\"image-widget-multiple-reorder__source\"\n >\n {{ raw.texts.source }}\n </div>\n </div>\n </div>\n </template>\n </ASortableListEditor>\n <AImageDropzone\n v-if=\"editorMode === 'view' && !readonly\"\n variant=\"fill\"\n :hover-only=\"modelValue.length > 0 || images.length > 0\"\n :accept=\"uploadAccept\"\n :max-sizes=\"uploadSizes\"\n @drop=\"onDrop\"\n @click=\"uploadButtonComponent?.$el.click()\"\n />\n </div>\n <UploadQueueDialog\n v-if=\"uploadQueueDialog === queueKey && imageWidgetUploadConfig\"\n :queue-key=\"queueKey\"\n :ext-system=\"imageWidgetUploadConfig.extSystem\"\n :licence-id=\"imageWidgetUploadConfig.licence\"\n :file-input-key=\"uploadQueue?.fileInputKey ?? -1\"\n :accept=\"uploadAccept\"\n :max-sizes=\"uploadSizes\"\n multiple\n @apply=\"onAssetUploadConfirm\"\n @files-input=\"onFileInput\"\n @drop=\"onFileInput\"\n />\n <AssetDetailDialog\n v-if=\"assetDialog === queueKey\"\n :queue-key=\"queueKey\"\n :config-name=\"damConfigName\"\n :ext-system=\"cachedExtSystemId\"\n @close=\"onAssetDetailClose\"\n />\n <ImageWidgetMultipleLimitDialog\n ref=\"limitDialogComponent\"\n :queue-key=\"queueKey\"\n @after-add=\"afterLimitDialogAdd\"\n />\n </div>\n</template>\n\n<style lang=\"scss\">\n.image-widget-multiple-reorder {\n display: flex;\n align-items: center;\n gap: 16px;\n width: 100%;\n min-height: 100px;\n padding: 4px 0;\n\n &__thumb {\n flex: 0 0 auto;\n width: 200px;\n border-radius: 4px;\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n\n img {\n width: 100%;\n height: auto;\n display: block;\n }\n }\n\n &__meta {\n flex: 1 1 auto;\n min-width: 0;\n }\n\n &__title {\n font-size: 0.95rem;\n font-weight: 500;\n color: rgb(var(--v-theme-on-surface));\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n &__source {\n font-size: 0.82rem;\n color: rgb(var(--v-theme-on-surface) / 70%);\n margin-top: 4px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n @media (width <= 600px) {\n gap: 8px;\n min-height: 72px;\n\n &__thumb {\n width: 80px;\n }\n\n &__source {\n display: none;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsEA,IAAMmD,IAAQC,GA4CRC,KAAOH,IAIPI,IAAgBC,GAAiBJ,EAAM,UAAU,GAEjDK,KAAoBC,EAAI,EAAK,GAE7BC,IAA0BC,GAC9BC,IACA,KAAA,CACF;EAEA,IAAIC,EAAYH,CAAuB,KAAKG,EAAYH,EAAwB,KAAK,GACnF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AAoD,CAAA,CAAuB,CAAC;IACpC,cAAYpD,EAAAoD,CAAA,CAAuB,CAAC;IACpC,kBAAgB8D,GAAA,OAAa,gBAAY;IACzC,QAAQlH,EAAAiR,CAAA;IACR,aAAWjR,EAAAkR,CAAA;IACZ,UAAA;IACC,SAAOxF;IACP,cAAapE;IACb,QAAMA;;;;;;;;;GAGDtH,EAAAgL,EAAA,MAAgBlI,EAAA,YADxBnD,EAAA,GAAAgB,EAMES,GAAA;;IAJC,aAAW0B,EAAA;IACX,eAAa9C,EAAAgD,CAAA;IACb,cAAYhD,EAAAsM,CAAA;IACZ,SAAOe;;;;;;GAEVvN,EAIEuB,IAAA;IAHI,SAAA;IAAJ,KAAIqG;IACH,aAAW5E,EAAA;IACX,YAAWkF"}
@@ -6,11 +6,20 @@ export declare function useCommonAdminImageOptions(configName?: string): {
6
6
  imageWidth: number;
7
7
  imageHeight: number;
8
8
  imageApi: {
9
+ fetchImage: (client: () => import('axios').AxiosInstance, id: import('../../../../lib').IntegerId) => Promise<import('../../types/ImageAware').ImageAware>;
10
+ createImage: (client: () => import('axios').AxiosInstance, data: import('../../types/ImageAware').ImageCreateUpdateAware) => Promise<import('../../types/ImageAware').ImageAware>;
11
+ updateImage: (client: () => import('axios').AxiosInstance, id: import('../../../../lib').IntegerId, data: import('../../types/ImageAware').ImageCreateUpdateAware) => Promise<import('../../types/ImageAware').ImageAware>;
12
+ deleteImage: (client: () => import('axios').AxiosInstance, id: import('../../../../lib').IntegerId) => Promise<void>;
13
+ fetchImageListByIds: (client: () => import('axios').AxiosInstance, ids: import('../../../../lib').IntegerId[]) => Promise<import('../../types/ImageAware').ImageAware[]>;
14
+ bulkUpdateImages: (client: () => import('axios').AxiosInstance, items: import('../../types/ImageAware').ImageCreateUpdateAware[]) => Promise<import('../../types/ImageAware').ImageAware[]>;
15
+ fetchSingleUseUsage?: (client: () => import('axios').AxiosInstance, groupIds: import('../../../../lib').DocId[], usageHolder: import('../../types/AssetSelect').AssetSelectUsageHolder | null) => Promise<Record<import('../../../../lib').DocId, import('../../types/Asset').AssetSingleUseUsage>>;
16
+ } | {
9
17
  fetchImage: (client: () => import('axios').AxiosInstance, id: import('../../../../lib').IntegerId) => Promise<import('../../types/ImageAware').ImageAware | null>;
10
18
  createImage: (client: () => import('axios').AxiosInstance, data: import('../../types/ImageAware').ImageCreateUpdateAware) => Promise<import('../../types/ImageAware').ImageAware>;
11
19
  updateImage: (client: () => import('axios').AxiosInstance, id: import('../../../../lib').IntegerId, data: import('../../types/ImageAware').ImageCreateUpdateAware) => Promise<import('../../types/ImageAware').ImageAware>;
12
20
  deleteImage: (client: () => import('axios').AxiosInstance, id: import('../../../../lib').IntegerId) => Promise<void>;
13
21
  fetchImageListByIds: (client: () => import('axios').AxiosInstance, ids: import('../../../../lib').IntegerId[]) => Promise<import('../../types/ImageAware').ImageAware[]>;
14
22
  bulkUpdateImages: (client: () => import('axios').AxiosInstance, items: import('../../types/ImageAware').ImageCreateUpdateAware[]) => Promise<import('../../types/ImageAware').ImageAware[]>;
23
+ fetchSingleUseUsage: (client: () => import('axios').AxiosInstance, groupIds: import('../../../../lib').DocId[], usageHolder: import('../../types/AssetSelect').AssetSelectUsageHolder | null) => Promise<Record<import('../../../../lib').DocId, import('../../types/Asset').AssetSingleUseUsage>>;
15
24
  };
16
25
  };
@@ -1,25 +1,27 @@
1
1
  import { imageOptions as e } from "../../../../plugins/pluginOptions.js";
2
2
  import { isUndefined as t } from "../../../../shared/utils/common.js";
3
- import { bulkUpdateImages as n, createImage as r, deleteImage as i, fetchImage as a, fetchImageListByIds as o, updateImage as s } from "./imageApiCms.js";
3
+ import { bulkUpdateImages as n, createImage as r, deleteImage as i, fetchImage as a, fetchImageListByIds as o, fetchSingleUseUsage as s, updateImage as c } from "./imageApiCms.js";
4
4
  // src/domains/dam/imageWidget/composables/commonAdminImageOptions.ts
5
- function c(c = "default") {
6
- if (t(e.value) || t(e.value.configs) || !Object.hasOwn(e.value.configs, c) || t(e.value.configs[c])) throw Error("Composable can't be used without properly configured common admin.");
5
+ var l = {
6
+ fetchImage: a,
7
+ createImage: r,
8
+ updateImage: c,
9
+ deleteImage: i,
10
+ fetchImageListByIds: o,
11
+ bulkUpdateImages: n,
12
+ fetchSingleUseUsage: s
13
+ };
14
+ function u(n = "default") {
15
+ if (t(e.value) || t(e.value.configs) || !Object.hasOwn(e.value.configs, n) || t(e.value.configs[n])) throw Error("Composable can't be used without properly configured common admin.");
7
16
  return {
8
- imageClient: e.value.configs[c].imageClient,
9
- previewDomain: e.value.configs[c].previewDomain,
10
- previewDomainOriginal: e.value.configs[c].previewDomainOriginal,
11
- imageWidth: e.value.configs[c].width,
12
- imageHeight: e.value.configs[c].height,
13
- imageApi: e.value.configs[c].imageApi ? e.value.configs[c].imageApi : {
14
- fetchImage: a,
15
- createImage: r,
16
- updateImage: s,
17
- deleteImage: i,
18
- fetchImageListByIds: o,
19
- bulkUpdateImages: n
20
- }
17
+ imageClient: e.value.configs[n].imageClient,
18
+ previewDomain: e.value.configs[n].previewDomain,
19
+ previewDomainOriginal: e.value.configs[n].previewDomainOriginal,
20
+ imageWidth: e.value.configs[n].width,
21
+ imageHeight: e.value.configs[n].height,
22
+ imageApi: e.value.configs[n].imageApi ?? l
21
23
  };
22
24
  }
23
- export { c as useCommonAdminImageOptions };
25
+ export { u as useCommonAdminImageOptions };
24
26
 
25
27
  //# sourceMappingURL=commonAdminImageOptions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"commonAdminImageOptions.js","names":["fetchImageApi","createImageApi","updateImageApi","deleteImageApi","fetchImageListByIdsApi","bulkUpdateImagesApi","useCommonAdminImageOptions","isUndefined","imageOptions","configName"],"sources":["../../../../../src/domains/dam/imageWidget/composables/commonAdminImageOptions.ts"],"sourcesContent":["import { imageOptions } from '@/plugins/pluginOptions'\nimport { isUndefined } from '@/shared/utils/common'\nimport {\n bulkUpdateImages as bulkUpdateImagesApi,\n createImage as createImageApi,\n deleteImage as deleteImageApi,\n fetchImage as fetchImageApi,\n fetchImageListByIds as fetchImageListByIdsApi,\n updateImage as updateImageApi,\n} from '@/domains/dam/imageWidget/composables/imageApiCms'\n\nexport { initCommonAdminImageOptions } from '@/plugins/pluginOptions'\n\nexport function useCommonAdminImageOptions(configName: string = 'default') {\n if (\n isUndefined(imageOptions.value) ||\n isUndefined(imageOptions.value.configs) ||\n // Own keys only. Inherited names like `constructor` are not configurations.\n !Object.hasOwn(imageOptions.value.configs, configName) ||\n isUndefined(imageOptions.value.configs[configName])\n ) {\n throw new Error(\"Composable can't be used without properly configured common admin.\")\n }\n\n return {\n imageClient: imageOptions.value.configs[configName].imageClient,\n previewDomain: imageOptions.value.configs[configName].previewDomain,\n previewDomainOriginal: imageOptions.value.configs[configName].previewDomainOriginal,\n imageWidth: imageOptions.value.configs[configName].width,\n imageHeight: imageOptions.value.configs[configName].height,\n imageApi: imageOptions.value.configs[configName].imageApi\n ? imageOptions.value.configs[configName].imageApi\n : {\n fetchImage: fetchImageApi,\n createImage: createImageApi,\n updateImage: updateImageApi,\n deleteImage: deleteImageApi,\n fetchImageListByIds: fetchImageListByIdsApi,\n bulkUpdateImages: bulkUpdateImagesApi,\n },\n }\n}\n"],"mappings":";;;;AAaA,SAAgBM,EAA2B,IAAqB,WAAW;CACzE,IACEC,EAAYC,EAAa,KAAK,KAC9BD,EAAYC,EAAa,MAAM,OAAO,KAEtC,CAAC,OAAO,OAAOA,EAAa,MAAM,SAASC,CAAU,KACrDF,EAAYC,EAAa,MAAM,QAAQC,EAAW,GAElD,MAAU,MAAM,oEAAoE;CAGtF,OAAO;EACL,aAAaD,EAAa,MAAM,QAAQC,EAAW,CAAC;EACpD,eAAeD,EAAa,MAAM,QAAQC,EAAW,CAAC;EACtD,uBAAuBD,EAAa,MAAM,QAAQC,EAAW,CAAC;EAC9D,YAAYD,EAAa,MAAM,QAAQC,EAAW,CAAC;EACnD,aAAaD,EAAa,MAAM,QAAQC,EAAW,CAAC;EACpD,UAAUD,EAAa,MAAM,QAAQC,EAAW,CAAC,WAC7CD,EAAa,MAAM,QAAQC,EAAW,CAAC,WACvC;GACcT;GACCC;GACAC;GACAC;GACQC;GACHC;EACpB;CACN;AACF"}
1
+ {"version":3,"file":"commonAdminImageOptions.js","names":["fetchImageApi","createImageApi","updateImageApi","deleteImageApi","fetchImageListByIdsApi","bulkUpdateImagesApi","fetchSingleUseUsageApi","defaultImageApi","useCommonAdminImageOptions","isUndefined","imageOptions","configName"],"sources":["../../../../../src/domains/dam/imageWidget/composables/commonAdminImageOptions.ts"],"sourcesContent":["import { imageOptions } from '@/plugins/pluginOptions'\nimport { isUndefined } from '@/shared/utils/common'\nimport {\n bulkUpdateImages as bulkUpdateImagesApi,\n createImage as createImageApi,\n deleteImage as deleteImageApi,\n fetchImage as fetchImageApi,\n fetchImageListByIds as fetchImageListByIdsApi,\n fetchSingleUseUsage as fetchSingleUseUsageApi,\n updateImage as updateImageApi,\n} from '@/domains/dam/imageWidget/composables/imageApiCms'\n\nexport { initCommonAdminImageOptions } from '@/plugins/pluginOptions'\n\nconst defaultImageApi = {\n fetchImage: fetchImageApi,\n createImage: createImageApi,\n updateImage: updateImageApi,\n deleteImage: deleteImageApi,\n fetchImageListByIds: fetchImageListByIdsApi,\n bulkUpdateImages: bulkUpdateImagesApi,\n fetchSingleUseUsage: fetchSingleUseUsageApi,\n}\n\nexport function useCommonAdminImageOptions(configName: string = 'default') {\n if (\n isUndefined(imageOptions.value) ||\n isUndefined(imageOptions.value.configs) ||\n // Own keys only. Inherited names like `constructor` are not configurations.\n !Object.hasOwn(imageOptions.value.configs, configName) ||\n isUndefined(imageOptions.value.configs[configName])\n ) {\n throw new Error(\"Composable can't be used without properly configured common admin.\")\n }\n\n return {\n imageClient: imageOptions.value.configs[configName].imageClient,\n previewDomain: imageOptions.value.configs[configName].previewDomain,\n previewDomainOriginal: imageOptions.value.configs[configName].previewDomainOriginal,\n imageWidth: imageOptions.value.configs[configName].width,\n imageHeight: imageOptions.value.configs[configName].height,\n imageApi: imageOptions.value.configs[configName].imageApi ?? defaultImageApi,\n }\n}\n"],"mappings":";;;;AAcA,IAAMO,IAAkB;CACVP;CACCC;CACAC;CACAC;CACQC;CACHC;CACGC;AACvB;AAEA,SAAgBE,EAA2B,IAAqB,WAAW;CACzE,IACEC,EAAYC,EAAa,KAAK,KAC9BD,EAAYC,EAAa,MAAM,OAAO,KAEtC,CAAC,OAAO,OAAOA,EAAa,MAAM,SAASC,CAAU,KACrDF,EAAYC,EAAa,MAAM,QAAQC,EAAW,GAElD,MAAU,MAAM,oEAAoE;CAGtF,OAAO;EACL,aAAaD,EAAa,MAAM,QAAQC,EAAW,CAAC;EACpD,eAAeD,EAAa,MAAM,QAAQC,EAAW,CAAC;EACtD,uBAAuBD,EAAa,MAAM,QAAQC,EAAW,CAAC;EAC9D,YAAYD,EAAa,MAAM,QAAQC,EAAW,CAAC;EACnD,aAAaD,EAAa,MAAM,QAAQC,EAAW,CAAC;EACpD,UAAUD,EAAa,MAAM,QAAQC,EAAW,CAAC,YAAYJ;CAC/D;AACF"}
@@ -1,6 +1,8 @@
1
1
  import { AxiosInstance } from 'axios';
2
- import { IntegerId } from '../../../../shared/types/common';
2
+ import { DocId, IntegerId } from '../../../../shared/types/common';
3
3
  import { ImageAware, ImageCreateUpdateAware } from '../../types/ImageAware';
4
+ import { AssetSingleUseUsage } from '../../types/Asset';
5
+ import { AssetSelectUsageHolder } from '../../types/AssetSelect';
4
6
  export declare const ENTITY = "image";
5
7
  export declare const SYSTEM_CMS = "cms";
6
8
  export declare const fetchImageListByIds: (client: () => AxiosInstance, ids: IntegerId[]) => Promise<ImageAware[]>;
@@ -8,4 +10,37 @@ export declare const fetchImage: (client: () => AxiosInstance, id: IntegerId) =>
8
10
  export declare const createImage: (client: () => AxiosInstance, data: ImageCreateUpdateAware) => Promise<ImageAware>;
9
11
  export declare const updateImage: (client: () => AxiosInstance, id: IntegerId, data: ImageCreateUpdateAware) => Promise<ImageAware>;
10
12
  export declare const deleteImage: (client: () => AxiosInstance, id: IntegerId) => Promise<void>;
13
+ /**
14
+ * Where each photo group is used, for the record `usageHolder` that picks (none: for no record), keyed by group id.
15
+ * A group is the root file of a photo with the files taken over from it. Asked 100 groups per request, in parallel.
16
+ */
17
+ export declare const fetchSingleUseUsage: (client: () => AxiosInstance, groupIds: DocId[], usageHolder: AssetSelectUsageHolder | null) => Promise<Record<DocId, AssetSingleUseUsage>>;
18
+ /** Error codes of core-cms refusing an image save (an image row of any record: article, gallery, person...). */
19
+ export declare const ImageSaveErrorCode: {
20
+ readonly TakeOverFailed: "image_take_over_failed";
21
+ readonly SingleUseViolation: "image_single_use_violation";
22
+ };
23
+ export type ImageSaveErrorCodeType = (typeof ImageSaveErrorCode)[keyof typeof ImageSaveErrorCode];
24
+ export declare const ImageSaveErrorReason: {
25
+ readonly ExclusivityConflict: "exclusivity_conflict";
26
+ readonly SharedGallery: "shared_gallery";
27
+ readonly InvalidOwner: "invalid_owner";
28
+ readonly GalleryCopy: "gallery_copy";
29
+ readonly RestoreConflict: "restore_conflict";
30
+ readonly TakeOverRejected: "take_over_rejected";
31
+ readonly TakeOverException: "take_over_exception";
32
+ };
33
+ export type ImageSaveErrorReasonType = (typeof ImageSaveErrorReason)[keyof typeof ImageSaveErrorReason];
34
+ export interface ImageSaveErrorInfo {
35
+ code: ImageSaveErrorCodeType;
36
+ reason?: ImageSaveErrorReasonType;
37
+ damId?: DocId;
38
+ holderResourceName?: string;
39
+ holderResourceId?: string;
40
+ }
41
+ /**
42
+ * The refusal of an image save by core-cms, from what a save rejected with: an error of the api helpers
43
+ * (`AnzuApiAxiosError`, `AnzuFatalError`) or a bare axios error (`bulkUpdateImages`). `undefined` for any other.
44
+ */
45
+ export declare const extractImageSaveErrorInfo: (error: unknown) => ImageSaveErrorInfo | undefined;
11
46
  export declare const bulkUpdateImages: (client: () => AxiosInstance, items: ImageCreateUpdateAware[]) => Promise<ImageAware[]>;