@anzusystems/common-admin 2.0.0-rc.4 → 2.0.0-rc.6

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 (680) hide show
  1. package/README.md +1 -1
  2. package/dist/AnzuSystemsCommonAdmin.d.ts +42 -32
  3. package/dist/AnzuSystemsCommonAdmin.js.map +1 -1
  4. package/dist/common-admin.css +1 -1
  5. package/dist/common-admin.js +282 -282
  6. package/dist/domains/anzuUser/api/anzuUserApi.d.ts +9 -12
  7. package/dist/domains/anzuUser/api/anzuUserApi.js.map +1 -1
  8. package/dist/domains/anzuUser/components/AAnzuUserDatatable.js.map +1 -1
  9. package/dist/domains/anzuUser/components/AAnzuUserDatatable.vue.d.ts +38 -44
  10. package/dist/domains/anzuUser/components/AAnzuUserDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  11. package/dist/domains/anzuUser/components/AAnzuUserFilter.js.map +1 -1
  12. package/dist/domains/anzuUser/components/AAnzuUserFilter.vue.d.ts +12 -13
  13. package/dist/domains/anzuUser/components/AAnzuUserFilter.vue_vue_type_script_setup_true_lang.js.map +1 -1
  14. package/dist/domains/anzuUser/components/AAnzuUserForm.js.map +1 -1
  15. package/dist/domains/anzuUser/components/AAnzuUserForm.vue.d.ts +18 -20
  16. package/dist/domains/anzuUser/components/AAnzuUserForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  17. package/dist/domains/anzuUser/components/AAnzuUserRoleAutocomplete.js.map +1 -1
  18. package/dist/domains/anzuUser/components/AAnzuUserRoleAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  19. package/dist/domains/anzuUser/components/AUserBulkActionDialog.js.map +1 -1
  20. package/dist/domains/anzuUser/components/AUserBulkActionDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  21. package/dist/domains/anzuUser/components/AUserCopyPermissionsDialog.js.map +1 -1
  22. package/dist/domains/anzuUser/components/AUserCopyPermissionsDialog.vue.d.ts +2 -3
  23. package/dist/domains/anzuUser/components/AUserCopyPermissionsDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  24. package/dist/domains/anzuUser/components/AUserCreateInSystemButton.js.map +1 -1
  25. package/dist/domains/anzuUser/components/AUserCreateInSystemButton.vue.d.ts +9 -15
  26. package/dist/domains/anzuUser/components/AUserCreateInSystemButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  27. package/dist/domains/anzuUser/components/AUserEnabledSwitch.js.map +1 -1
  28. package/dist/domains/anzuUser/components/AUserEnabledSwitch.vue.d.ts +8 -7
  29. package/dist/domains/anzuUser/components/AUserEnabledSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/domains/anzuUser/components/AUserManageButton.js.map +1 -1
  31. package/dist/domains/anzuUser/components/AUserManageButton.vue.d.ts +0 -1
  32. package/dist/domains/anzuUser/components/AUserManageButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  33. package/dist/domains/anzuUser/components/AUserMetadataForm.js.map +1 -1
  34. package/dist/domains/anzuUser/components/AUserMetadataForm.vue.d.ts +8 -9
  35. package/dist/domains/anzuUser/components/AUserMetadataForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  36. package/dist/domains/anzuUser/components/AUserMetadataRepairDialog.js.map +1 -1
  37. package/dist/domains/anzuUser/components/AUserMetadataRepairDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  38. package/dist/domains/anzuUser/components/AUserOtherSystemsTable.js.map +1 -1
  39. package/dist/domains/anzuUser/components/AUserOtherSystemsTable.vue.d.ts +1 -2
  40. package/dist/domains/anzuUser/components/AUserOtherSystemsTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  41. package/dist/domains/anzuUser/components/AUserSystemOverview.js.map +1 -1
  42. package/dist/domains/anzuUser/components/AUserSystemOverview.vue_vue_type_script_setup_true_lang.js.map +1 -1
  43. package/dist/domains/anzuUser/components/AUserSystemPanel.js.map +1 -1
  44. package/dist/domains/anzuUser/components/AUserSystemPanel.vue.d.ts +2 -2
  45. package/dist/domains/anzuUser/components/AUserSystemPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  46. package/dist/domains/anzuUser/components/AUserSystemStatusChip.js.map +1 -1
  47. package/dist/domains/anzuUser/components/AUserSystemStatusChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  48. package/dist/domains/anzuUser/components/AUserTabsShell.js.map +1 -1
  49. package/dist/domains/anzuUser/components/AUserTabsShell.vue.d.ts +17 -22
  50. package/dist/domains/anzuUser/components/AUserTabsShell.vue_vue_type_script_setup_true_lang.js.map +1 -1
  51. package/dist/domains/anzuUser/composables/anzuUserActions.d.ts +5 -9
  52. package/dist/domains/anzuUser/composables/anzuUserActions.js.map +1 -1
  53. package/dist/domains/anzuUser/composables/anzuUserValidations.d.ts +4 -6
  54. package/dist/domains/anzuUser/composables/anzuUserValidations.js.map +1 -1
  55. package/dist/domains/anzuUser/composables/cachedAnzuUsers.d.ts +3 -3
  56. package/dist/domains/anzuUser/composables/cachedAnzuUsers.js.map +1 -1
  57. package/dist/domains/anzuUser/composables/userCrossSystemSearch.d.ts +2 -4
  58. package/dist/domains/anzuUser/composables/userCrossSystemSearch.js.map +1 -1
  59. package/dist/domains/anzuUser/composables/userCrossSystemWrites.d.ts +5 -11
  60. package/dist/domains/anzuUser/composables/userCrossSystemWrites.js.map +1 -1
  61. package/dist/domains/anzuUser/composables/userSystemDescriptor.d.ts +33 -57
  62. package/dist/domains/anzuUser/composables/userSystemDescriptor.js.map +1 -1
  63. package/dist/domains/anzuUser/composables/userSystemProbe.d.ts +7 -27
  64. package/dist/domains/anzuUser/composables/userSystemProbe.js.map +1 -1
  65. package/dist/domains/anzuUser/filter/anzuUserFilter.d.ts +6 -16
  66. package/dist/domains/anzuUser/filter/anzuUserFilter.js.map +1 -1
  67. package/dist/domains/anzuUser/store/anzuUserStore.d.ts +1 -5
  68. package/dist/domains/anzuUser/store/anzuUserStore.js.map +1 -1
  69. package/dist/domains/anzuUser/store/userCrossSystemStore.d.ts +3 -14
  70. package/dist/domains/anzuUser/store/userCrossSystemStore.js.map +1 -1
  71. package/dist/domains/anzuUser/utils/userMetadataDiff.d.ts +7 -19
  72. package/dist/domains/anzuUser/utils/userMetadataDiff.js.map +1 -1
  73. package/dist/domains/anzuUser/utils/userSystemState.d.ts +12 -30
  74. package/dist/domains/anzuUser/utils/userSystemState.js.map +1 -1
  75. package/dist/domains/anzuUser/utils/userTabs.d.ts +1 -3
  76. package/dist/domains/anzuUser/utils/userTabs.js.map +1 -1
  77. package/dist/domains/api/composables/defineApiClient.d.ts +4 -8
  78. package/dist/domains/api/composables/defineApiClient.js.map +1 -1
  79. package/dist/domains/api/composables/request.d.ts +18 -48
  80. package/dist/domains/api/composables/request.js.map +1 -1
  81. package/dist/domains/api/composables/useApiFetchByIds.d.ts +7 -21
  82. package/dist/domains/api/composables/useApiFetchByIds.js.map +1 -1
  83. package/dist/domains/api/composables/useApiFetchItems.d.ts +18 -57
  84. package/dist/domains/api/composables/useApiFetchItems.js.map +1 -1
  85. package/dist/domains/api/composables/useApiFetchList.d.ts +7 -23
  86. package/dist/domains/api/composables/useApiFetchList.js.map +1 -1
  87. package/dist/domains/api/composables/useApiFetchListBatch.d.ts +5 -22
  88. package/dist/domains/api/composables/useApiFetchListBatch.js.map +1 -1
  89. package/dist/domains/api/composables/useApiQueryBuilder.js.map +1 -1
  90. package/dist/domains/api/composables/useApiRequest.d.ts +16 -39
  91. package/dist/domains/api/composables/useApiRequest.js.map +1 -1
  92. package/dist/domains/api/utils/apiErrors.d.ts +28 -55
  93. package/dist/domains/api/utils/apiErrors.js.map +1 -1
  94. package/dist/domains/api/utils/listBody.d.ts +22 -43
  95. package/dist/domains/api/utils/listBody.js.map +1 -1
  96. package/dist/domains/auth/components/Acl.js.map +1 -1
  97. package/dist/domains/auth/components/Acl.vue_vue_type_script_setup_true_lang.js.map +1 -1
  98. package/dist/domains/auth/composables/aclAllowed.d.ts +2 -3
  99. package/dist/domains/auth/composables/aclAllowed.js.map +1 -1
  100. package/dist/domains/auth/composables/defineAuth.js.map +1 -1
  101. package/dist/domains/auth/composables/refreshSession.d.ts +10 -13
  102. package/dist/domains/auth/composables/refreshSession.js.map +1 -1
  103. package/dist/domains/cached/components/ACachedChip.js.map +1 -1
  104. package/dist/domains/cached/components/ACachedChip.vue.d.ts +13 -11
  105. package/dist/domains/cached/components/ACachedChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  106. package/dist/domains/cached/components/ACachedUserChip.js +1 -1
  107. package/dist/domains/cached/components/ACachedUserChip.js.map +1 -1
  108. package/dist/domains/cached/components/ACachedUserChip.vue.d.ts +3 -3
  109. package/dist/domains/cached/components/ACachedUserChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  110. package/dist/domains/cached/composables/createUserAndTimeTrackingFields.d.ts +9 -9
  111. package/dist/domains/cached/composables/createUserAndTimeTrackingFields.js.map +1 -1
  112. package/dist/domains/cached/composables/defineCached.d.ts +13 -11
  113. package/dist/domains/cached/composables/defineCached.js.map +1 -1
  114. package/dist/domains/cached/composables/useCachedItem.d.ts +7 -8
  115. package/dist/domains/cached/composables/useCachedItem.js.map +1 -1
  116. package/dist/domains/collab/components/ACollabLockedByUser.js.map +1 -1
  117. package/dist/domains/collab/components/ACollabLockedByUser.vue_vue_type_script_setup_true_lang.js.map +1 -1
  118. package/dist/domains/collab/composables/collabAnyDataChange.js.map +1 -1
  119. package/dist/domains/collab/composables/collabField.d.ts +5 -3
  120. package/dist/domains/collab/composables/collabField.js.map +1 -1
  121. package/dist/domains/collab/composables/collabInit.js +58 -54
  122. package/dist/domains/collab/composables/collabInit.js.map +1 -1
  123. package/dist/domains/collab/composables/collabRecovery.d.ts +49 -0
  124. package/dist/domains/collab/composables/collabRecovery.js +99 -0
  125. package/dist/domains/collab/composables/collabRecovery.js.map +1 -0
  126. package/dist/domains/collab/composables/collabRoom.js +106 -106
  127. package/dist/domains/collab/composables/collabRoom.js.map +1 -1
  128. package/dist/domains/collab/composables/collabState.d.ts +11 -4
  129. package/dist/domains/collab/composables/collabState.js +34 -25
  130. package/dist/domains/collab/composables/collabState.js.map +1 -1
  131. package/dist/domains/collab/composables/commonAdminCollabOptions.d.ts +4 -2
  132. package/dist/domains/collab/types/Collab.d.ts +31 -5
  133. package/dist/domains/collab/types/Collab.js +23 -11
  134. package/dist/domains/collab/types/Collab.js.map +1 -1
  135. package/dist/domains/customDataForm/components/ACustomDataForm.js.map +1 -1
  136. package/dist/domains/customDataForm/components/ACustomDataForm.vue.d.ts +7 -5
  137. package/dist/domains/customDataForm/components/ACustomDataForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  138. package/dist/domains/customDataForm/components/ACustomDataFormElement.js.map +1 -1
  139. package/dist/domains/customDataForm/components/ACustomDataFormElement.vue_vue_type_script_setup_true_lang.js.map +1 -1
  140. package/dist/domains/customDataForm/components/ACustomDataFormHiddenPart.js.map +1 -1
  141. package/dist/domains/customDataForm/components/ACustomDataFormHiddenPart.vue.d.ts +5 -3
  142. package/dist/domains/customDataForm/components/ACustomDataFormHiddenPart.vue_vue_type_script_setup_true_lang.js.map +1 -1
  143. package/dist/domains/customDataForm/composables/useCustomDataForm.js.map +1 -1
  144. package/dist/domains/customDataForm/types/CustomDataForm.d.ts +4 -1
  145. package/dist/domains/dam/api/damAssetApi.d.ts +7 -7
  146. package/dist/domains/dam/api/damAssetApi.js.map +1 -1
  147. package/dist/domains/dam/api/damAssetLicenceApi.d.ts +1 -1
  148. package/dist/domains/dam/api/damAssetLicenceApi.js.map +1 -1
  149. package/dist/domains/dam/api/damConstants.js.map +1 -1
  150. package/dist/domains/dam/api/damEndPoints.js.map +1 -1
  151. package/dist/domains/dam/api/damImageApi.js.map +1 -1
  152. package/dist/domains/dam/api/uploadApi.js.map +1 -1
  153. package/dist/domains/dam/assetDetail/components/AssetCustomMetadataForm.js.map +1 -1
  154. package/dist/domains/dam/assetDetail/components/AssetCustomMetadataForm.vue.d.ts +7 -5
  155. package/dist/domains/dam/assetDetail/components/AssetCustomMetadataForm.vue_vue_type_script_setup_true_lang.js.map +1 -1
  156. package/dist/domains/dam/assetDetail/components/AssetDetailDialog.js.map +1 -1
  157. package/dist/domains/dam/assetDetail/components/AssetDetailDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  158. package/dist/domains/dam/assetDetail/components/AssetDetailDialogFrame.js.map +1 -1
  159. package/dist/domains/dam/assetDetail/components/AssetDetailDialogFrame.vue.d.ts +1 -1
  160. package/dist/domains/dam/assetDetail/components/AssetDetailDialogFrame.vue_vue_type_script_setup_true_lang.js.map +1 -1
  161. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarActionsWrapper.vue.d.ts +5 -3
  162. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarFrame.js.map +1 -1
  163. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarFrame.vue_vue_type_script_setup_true_lang.js.map +1 -1
  164. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarMetadata.js.map +1 -1
  165. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  166. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarROI.js.map +1 -1
  167. package/dist/domains/dam/assetDetail/components/AssetDetailSidebarROI.vue_vue_type_script_setup_true_lang.js.map +1 -1
  168. package/dist/domains/dam/assetDetail/components/AssetFileInfoPanel.js.map +1 -1
  169. package/dist/domains/dam/assetDetail/components/AssetFileInfoPanel.vue.d.ts +1 -1
  170. package/dist/domains/dam/assetDetail/components/AssetFileInfoPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  171. package/dist/domains/dam/assetDetail/components/AssetImage.js.map +1 -1
  172. package/dist/domains/dam/assetDetail/components/AssetImage.vue.d.ts +1 -1
  173. package/dist/domains/dam/assetDetail/components/AssetImage.vue_vue_type_script_setup_true_lang.js.map +1 -1
  174. package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.js.map +1 -1
  175. package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.vue.d.ts +2 -2
  176. package/dist/domains/dam/assetDetail/components/AssetImageMetaIcons.vue_vue_type_script_setup_true_lang.js.map +1 -1
  177. package/dist/domains/dam/assetDetail/components/AssetInfobox.js.map +1 -1
  178. package/dist/domains/dam/assetDetail/components/AssetInfobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  179. package/dist/domains/dam/assetDetail/components/AssetMetadata.js.map +1 -1
  180. package/dist/domains/dam/assetDetail/components/AssetMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  181. package/dist/domains/dam/assetDetail/composables/assetDetailExtSystem.d.ts +5 -6
  182. package/dist/domains/dam/assetDetail/composables/assetDetailExtSystem.js.map +1 -1
  183. package/dist/domains/dam/assetDetail/composables/assetDetailView.d.ts +10 -10
  184. package/dist/domains/dam/assetDetail/composables/assetDetailView.js.map +1 -1
  185. package/dist/domains/dam/assetDetail/store/assetDetailStore.js.map +1 -1
  186. package/dist/domains/dam/assetDetail/utils/assetMetadataMayStillChange.d.ts +4 -3
  187. package/dist/domains/dam/assetDetail/utils/assetMetadataMayStillChange.js.map +1 -1
  188. package/dist/domains/dam/assetSelect/api/damPodcastApi.js.map +1 -1
  189. package/dist/domains/dam/assetSelect/components/AAssetListInner.js.map +1 -1
  190. package/dist/domains/dam/assetSelect/components/AAssetListInner.vue.d.ts +789 -787
  191. package/dist/domains/dam/assetSelect/components/AAssetListInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  192. package/dist/domains/dam/assetSelect/components/AAssetSelect.js.map +1 -1
  193. package/dist/domains/dam/assetSelect/components/AAssetSelect.vue.d.ts +395 -393
  194. package/dist/domains/dam/assetSelect/components/AAssetSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  195. package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.js.map +1 -1
  196. package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue.d.ts +14 -12
  197. package/dist/domains/dam/assetSelect/components/AAssetSelectMedia.vue_vue_type_script_setup_true_lang.js.map +1 -1
  198. package/dist/domains/dam/assetSelect/components/AssetDistributionServiceNameFilter.js.map +1 -1
  199. package/dist/domains/dam/assetSelect/components/AssetDistributionServiceNameFilter.vue_vue_type_script_setup_true_lang.js.map +1 -1
  200. package/dist/domains/dam/assetSelect/components/AssetSelectListBar.js.map +1 -1
  201. package/dist/domains/dam/assetSelect/components/AssetSelectListBar.vue.d.ts +9 -7
  202. package/dist/domains/dam/assetSelect/components/AssetSelectListBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  203. package/dist/domains/dam/assetSelect/components/AssetSelectTableRowItem.js.map +1 -1
  204. package/dist/domains/dam/assetSelect/components/AssetSelectTableRowItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  205. package/dist/domains/dam/assetSelect/composables/assetSelectListActions.js.map +1 -1
  206. package/dist/domains/dam/assetSelect/store/assetSelectStore.js.map +1 -1
  207. package/dist/domains/dam/author/api/authorApi.js.map +1 -1
  208. package/dist/domains/dam/author/components/AuthorCreateButton.js.map +1 -1
  209. package/dist/domains/dam/author/components/AuthorCreateButton.vue.d.ts +1 -1
  210. package/dist/domains/dam/author/components/AuthorCreateButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  211. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.js.map +1 -1
  212. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.vue.d.ts +9 -6
  213. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  214. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChipConflicts.js.map +1 -1
  215. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteCachedAuthorChipConflicts.vue_vue_type_script_setup_true_lang.js.map +1 -1
  216. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.js +1 -1
  217. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.js.map +1 -1
  218. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.vue.d.ts +2 -2
  219. package/dist/domains/dam/author/components/AuthorRemoteAutocompleteWithCached.vue_vue_type_script_setup_true_lang.js.map +1 -1
  220. package/dist/domains/dam/author/components/DamAuthorFilterRemoteAutocomplete.js.map +1 -1
  221. package/dist/domains/dam/author/components/DamAuthorFilterRemoteAutocomplete.vue.d.ts +1 -1
  222. package/dist/domains/dam/author/components/DamAuthorFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  223. package/dist/domains/dam/author/composables/cachedAuthors.d.ts +5 -4
  224. package/dist/domains/dam/author/composables/cachedAuthors.js.map +1 -1
  225. package/dist/domains/dam/author/composables/cachedUsers.d.ts +5 -4
  226. package/dist/domains/dam/author/composables/cachedUsers.js.map +1 -1
  227. package/dist/domains/dam/author/composables/damAuthorConfig.d.ts +2 -2
  228. package/dist/domains/dam/author/composables/damAuthorConfig.js.map +1 -1
  229. package/dist/domains/dam/components/DamAdminAssetLink.js.map +1 -1
  230. package/dist/domains/dam/components/DamAdminAssetLink.vue_vue_type_script_setup_true_lang.js.map +1 -1
  231. package/dist/domains/dam/composables/commonAdminCoreDamOptions.d.ts +10 -8
  232. package/dist/domains/dam/composables/commonAdminCoreDamOptions.js.map +1 -1
  233. package/dist/domains/dam/composables/damConfigName.d.ts +8 -9
  234. package/dist/domains/dam/composables/damConfigName.js.map +1 -1
  235. package/dist/domains/dam/composables/damNotifications.d.ts +9 -9
  236. package/dist/domains/dam/composables/damNotifications.js.map +1 -1
  237. package/dist/domains/dam/composables/damNotificationsConnection.d.ts +4 -4
  238. package/dist/domains/dam/composables/damNotificationsConnection.js.map +1 -1
  239. package/dist/domains/dam/composables/damNotificationsEventBus.d.ts +2 -2
  240. package/dist/domains/dam/composables/damNotificationsEventBus.js.map +1 -1
  241. package/dist/domains/dam/composables/extSystemIdForCached.d.ts +5 -4
  242. package/dist/domains/dam/composables/extSystemIdForCached.js.map +1 -1
  243. package/dist/domains/dam/config/api/damAssetCustomFormApi.js.map +1 -1
  244. package/dist/domains/dam/config/api/damConfigApi.js.map +1 -1
  245. package/dist/domains/dam/config/composables/damConfigState.d.ts +5 -5
  246. package/dist/domains/dam/config/composables/damConfigState.js.map +1 -1
  247. package/dist/domains/dam/config/store/damConfigStore.d.ts +5 -4
  248. package/dist/domains/dam/config/store/damConfigStore.js.map +1 -1
  249. package/dist/domains/dam/config/utils/damFilterUserAllowedUploadConfigs.d.ts +3 -1
  250. package/dist/domains/dam/config/utils/damFilterUserAllowedUploadConfigs.js.map +1 -1
  251. package/dist/domains/dam/cropper/components/ACropper.js.map +1 -1
  252. package/dist/domains/dam/cropper/components/ACropper.vue.d.ts +8 -16
  253. package/dist/domains/dam/cropper/components/ACropper.vue_vue_type_script_setup_true_lang.js.map +1 -1
  254. package/dist/domains/dam/cropper/components/DamAssetImageRoiSelect.js.map +1 -1
  255. package/dist/domains/dam/cropper/components/DamAssetImageRoiSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  256. package/dist/domains/dam/cropper/store/imageRoiStore.d.ts +9 -12
  257. package/dist/domains/dam/cropper/store/imageRoiStore.js.map +1 -1
  258. package/dist/domains/dam/cropper/utils/cropperGeometry.d.ts +24 -38
  259. package/dist/domains/dam/cropper/utils/cropperGeometry.js.map +1 -1
  260. package/dist/domains/dam/cropper/utils/cropperJsService.d.ts +3 -7
  261. package/dist/domains/dam/cropper/utils/cropperJsService.js +10 -3
  262. package/dist/domains/dam/cropper/utils/cropperJsService.js.map +1 -1
  263. package/dist/domains/dam/cropper/utils/cropperTypes.d.ts +3 -6
  264. package/dist/domains/dam/cropper/utils/damAssetImageRoiSelectLoader.d.ts +5 -5
  265. package/dist/domains/dam/cropper/utils/damAssetImageRoiSelectLoader.js.map +1 -1
  266. package/dist/domains/dam/imageWidget/components/AImageMediaWidget.js.map +1 -1
  267. package/dist/domains/dam/imageWidget/components/AImageMediaWidget.vue_vue_type_script_setup_true_lang.js.map +1 -1
  268. package/dist/domains/dam/imageWidget/components/AImagePublicInput.js.map +1 -1
  269. package/dist/domains/dam/imageWidget/components/AImagePublicInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  270. package/dist/domains/dam/imageWidget/components/AImageWidget.js.map +1 -1
  271. package/dist/domains/dam/imageWidget/components/AImageWidget.vue_vue_type_script_setup_true_lang.js.map +1 -1
  272. package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.js.map +1 -1
  273. package/dist/domains/dam/imageWidget/components/AImageWidgetMultiple.vue_vue_type_script_setup_true_lang.js.map +1 -1
  274. package/dist/domains/dam/imageWidget/components/AImageWidgetSimple.vue.d.ts +43 -41
  275. package/dist/domains/dam/imageWidget/components/AMediaWidgetSimple.vue.d.ts +31 -29
  276. package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.js.map +1 -1
  277. package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.vue.d.ts +29 -27
  278. package/dist/domains/dam/imageWidget/components/ImageDetailDialogMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  279. package/dist/domains/dam/imageWidget/components/ImageMassOperations.js.map +1 -1
  280. package/dist/domains/dam/imageWidget/components/ImageMassOperations.vue.d.ts +1 -1
  281. package/dist/domains/dam/imageWidget/components/ImageMassOperations.vue_vue_type_script_setup_true_lang.js.map +1 -1
  282. package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.js.map +1 -1
  283. package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue.d.ts +68 -66
  284. package/dist/domains/dam/imageWidget/components/ImageMediaWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  285. package/dist/domains/dam/imageWidget/components/ImageWidgetInner.js.map +1 -1
  286. package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue.d.ts +402 -400
  287. package/dist/domains/dam/imageWidget/components/ImageWidgetInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  288. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.js.map +1 -1
  289. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue.d.ts +384 -382
  290. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleInner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  291. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleItem.js.map +1 -1
  292. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  293. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleLimitDialog.js.map +1 -1
  294. package/dist/domains/dam/imageWidget/components/ImageWidgetMultipleLimitDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  295. package/dist/domains/dam/imageWidget/components/MediaWidgetSimpleDialog.vue.d.ts +7 -5
  296. package/dist/domains/dam/imageWidget/composables/commonAdminImageOptions.js.map +1 -1
  297. package/dist/domains/dam/imageWidget/composables/imageApiCms.js.map +1 -1
  298. package/dist/domains/dam/imageWidget/composables/imageDialogDamAuthors.d.ts +11 -13
  299. package/dist/domains/dam/imageWidget/composables/imageDialogDamAuthors.js.map +1 -1
  300. package/dist/domains/dam/imageWidget/composables/useImageMassOperations.js.map +1 -1
  301. package/dist/domains/dam/imageWidget/store/imageMediaWidgetStore.js.map +1 -1
  302. package/dist/domains/dam/imageWidget/store/imageStore.js.map +1 -1
  303. package/dist/domains/dam/imageWidget/utils/damImage.d.ts +5 -6
  304. package/dist/domains/dam/imageWidget/utils/damImage.js.map +1 -1
  305. package/dist/domains/dam/imageWidget/utils/fieldLockTurns.d.ts +1 -2
  306. package/dist/domains/dam/imageWidget/utils/fieldLockTurns.js.map +1 -1
  307. package/dist/domains/dam/imageWidget/utils/imageSaves.d.ts +10 -14
  308. package/dist/domains/dam/imageWidget/utils/imageSaves.js.map +1 -1
  309. package/dist/domains/dam/imageWidget/utils/metadataToImageMap.js.map +1 -1
  310. package/dist/domains/dam/imageWidget/utils/waitLimit.d.ts +4 -6
  311. package/dist/domains/dam/imageWidget/utils/waitLimit.js.map +1 -1
  312. package/dist/domains/dam/keyword/api/keywordApi.js.map +1 -1
  313. package/dist/domains/dam/keyword/components/DamKeywordFilterRemoteAutocomplete.js.map +1 -1
  314. package/dist/domains/dam/keyword/components/DamKeywordFilterRemoteAutocomplete.vue.d.ts +1 -1
  315. package/dist/domains/dam/keyword/components/DamKeywordFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  316. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteCachedKeywordChip.js.map +1 -1
  317. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteCachedKeywordChip.vue.d.ts +8 -5
  318. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteCachedKeywordChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  319. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.js +1 -1
  320. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.js.map +1 -1
  321. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.vue.d.ts +2 -2
  322. package/dist/domains/dam/keyword/components/KeywordRemoteAutocompleteWithCached.vue_vue_type_script_setup_true_lang.js.map +1 -1
  323. package/dist/domains/dam/keyword/composables/cachedKeywords.d.ts +5 -4
  324. package/dist/domains/dam/keyword/composables/cachedKeywords.js.map +1 -1
  325. package/dist/domains/dam/keyword/composables/damKeywordConfig.d.ts +2 -2
  326. package/dist/domains/dam/keyword/composables/damKeywordConfig.js.map +1 -1
  327. package/dist/domains/dam/types/Asset.d.ts +1 -1
  328. package/dist/domains/dam/types/Asset.js.map +1 -1
  329. package/dist/domains/dam/types/UploadQueue.d.ts +5 -4
  330. package/dist/domains/dam/types/UploadQueue.js.map +1 -1
  331. package/dist/domains/dam/uploadQueue/components/AssetCustomMetadataFormMassOperations.js.map +1 -1
  332. package/dist/domains/dam/uploadQueue/components/AssetCustomMetadataFormMassOperations.vue_vue_type_script_setup_true_lang.js.map +1 -1
  333. package/dist/domains/dam/uploadQueue/components/AssetQueueSelectedSidebar.js.map +1 -1
  334. package/dist/domains/dam/uploadQueue/components/AssetQueueSelectedSidebar.vue.d.ts +2 -2
  335. package/dist/domains/dam/uploadQueue/components/AssetQueueSelectedSidebar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  336. package/dist/domains/dam/uploadQueue/components/UploadQueueDialog.js.map +1 -1
  337. package/dist/domains/dam/uploadQueue/components/UploadQueueDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  338. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingle.js.map +1 -1
  339. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingle.vue_vue_type_script_setup_true_lang.js.map +1 -1
  340. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebar.js.map +1 -1
  341. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebar.vue.d.ts +6 -4
  342. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  343. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadata.js.map +1 -1
  344. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadata.vue.d.ts +1 -1
  345. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadata.vue_vue_type_script_setup_true_lang.js.map +1 -1
  346. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadataContent.js.map +1 -1
  347. package/dist/domains/dam/uploadQueue/components/UploadQueueDialogSingleSidebarMetadataContent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  348. package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.js.map +1 -1
  349. package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.vue.d.ts +6 -6
  350. package/dist/domains/dam/uploadQueue/components/UploadQueueEditable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  351. package/dist/domains/dam/uploadQueue/components/UploadQueueItemEditable.js.map +1 -1
  352. package/dist/domains/dam/uploadQueue/components/UploadQueueItemEditable.vue.d.ts +13 -13
  353. package/dist/domains/dam/uploadQueue/components/UploadQueueItemEditable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  354. package/dist/domains/dam/uploadQueue/components/uploadQueueBindings.d.ts +13 -13
  355. package/dist/domains/dam/uploadQueue/components/uploadQueueBindings.js.map +1 -1
  356. package/dist/domains/dam/uploadQueue/composables/damUploadChunkSize.d.ts +2 -2
  357. package/dist/domains/dam/uploadQueue/composables/damUploadChunkSize.js.map +1 -1
  358. package/dist/domains/dam/uploadQueue/composables/uploadMeter.d.ts +12 -12
  359. package/dist/domains/dam/uploadQueue/composables/uploadMeter.js.map +1 -1
  360. package/dist/domains/dam/uploadQueue/composables/uploadQueueItemRefresh.d.ts +5 -5
  361. package/dist/domains/dam/uploadQueue/composables/uploadQueueItemRefresh.js.map +1 -1
  362. package/dist/domains/dam/uploadQueue/composables/uploadService.d.ts +2 -3
  363. package/dist/domains/dam/uploadQueue/composables/uploadService.js.map +1 -1
  364. package/dist/domains/dam/uploadQueue/composables/useUploadQueueDialog.d.ts +5 -4
  365. package/dist/domains/dam/uploadQueue/composables/useUploadQueueDialog.js.map +1 -1
  366. package/dist/domains/dam/uploadQueue/core/uploadQueueCore.d.ts +3 -2
  367. package/dist/domains/dam/uploadQueue/core/uploadQueueCore.js.map +1 -1
  368. package/dist/domains/dam/uploadQueue/core/uploadQueueCoreTypes.d.ts +8 -5
  369. package/dist/domains/dam/uploadQueue/core/uploadQueueCoreTypes.js.map +1 -1
  370. package/dist/domains/dam/uploadQueue/core/uploadQueueFill.d.ts +3 -3
  371. package/dist/domains/dam/uploadQueue/core/uploadQueueFill.js.map +1 -1
  372. package/dist/domains/dam/uploadQueue/presets/queuePresets.d.ts +8 -5
  373. package/dist/domains/dam/uploadQueue/presets/queuePresets.js.map +1 -1
  374. package/dist/domains/dam/uploadQueue/presets/uploadPresets.d.ts +15 -13
  375. package/dist/domains/dam/uploadQueue/presets/uploadPresets.js.map +1 -1
  376. package/dist/domains/dam/uploadQueue/settlement/uploadPollSchedule.d.ts +7 -7
  377. package/dist/domains/dam/uploadQueue/settlement/uploadPollSchedule.js.map +1 -1
  378. package/dist/domains/dam/uploadQueue/settlement/uploadPoller.d.ts +4 -4
  379. package/dist/domains/dam/uploadQueue/settlement/uploadPoller.js.map +1 -1
  380. package/dist/domains/dam/uploadQueue/settlement/uploadSettle.d.ts +28 -30
  381. package/dist/domains/dam/uploadQueue/settlement/uploadSettle.js.map +1 -1
  382. package/dist/domains/dam/uploadQueue/settlement/uploadSettlement.d.ts +2 -2
  383. package/dist/domains/dam/uploadQueue/settlement/uploadSettlement.js.map +1 -1
  384. package/dist/domains/dam/uploadQueue/settlement/uploadSettlementRuntime.d.ts +2 -2
  385. package/dist/domains/dam/uploadQueue/settlement/uploadSettlementRuntime.js.map +1 -1
  386. package/dist/domains/dam/uploadQueue/settlement/uploadSettlementTypes.d.ts +63 -73
  387. package/dist/domains/dam/uploadQueue/settlement/uploadSettlementTypes.js.map +1 -1
  388. package/dist/domains/dam/uploadQueue/store/uploadQueuesStore.d.ts +8 -9
  389. package/dist/domains/dam/uploadQueue/store/uploadQueuesStore.js.map +1 -1
  390. package/dist/domains/dam/user/api/userApi.d.ts +2 -2
  391. package/dist/domains/dam/user/api/userApi.js.map +1 -1
  392. package/dist/domains/dam/user/components/DamDistributionServiceSelect.js.map +1 -1
  393. package/dist/domains/dam/user/components/DamDistributionServiceSelect.vue.d.ts +1 -1
  394. package/dist/domains/dam/user/components/DamDistributionServiceSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  395. package/dist/domains/dam/user/components/DamExternalProviderAssetSelect.js.map +1 -1
  396. package/dist/domains/dam/user/components/DamExternalProviderAssetSelect.vue.d.ts +1 -1
  397. package/dist/domains/dam/user/components/DamExternalProviderAssetSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  398. package/dist/domains/dam/user/components/DamUserRemoteAutocomplete.js.map +1 -1
  399. package/dist/domains/dam/user/components/DamUserRemoteAutocomplete.vue.d.ts +1 -1
  400. package/dist/domains/dam/user/components/DamUserRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  401. package/dist/domains/dam/user/composables/damUserSelectActions.d.ts +1 -1
  402. package/dist/domains/dam/user/composables/damUserSelectActions.js.map +1 -1
  403. package/dist/domains/dam/user/types/DamDistributionServiceType.d.ts +2 -2
  404. package/dist/domains/dam/user/types/DamDistributionServiceType.js.map +1 -1
  405. package/dist/domains/dam/user/types/DamExternalProviderAssetType.d.ts +1 -1
  406. package/dist/domains/dam/user/types/DamExternalProviderAssetType.js.map +1 -1
  407. package/dist/domains/filters/bookmarks/components/FilterBookmarkDialog.js.map +1 -1
  408. package/dist/domains/filters/bookmarks/components/FilterBookmarkDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  409. package/dist/domains/filters/bookmarks/store/bookmarksStore.d.ts +3 -3
  410. package/dist/domains/filters/bookmarks/store/bookmarksStore.js.map +1 -1
  411. package/dist/domains/filters/components/AFilterDatetimePicker.js.map +1 -1
  412. package/dist/domains/filters/components/AFilterDatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  413. package/dist/domains/filters/components/AFilterInteger.js.map +1 -1
  414. package/dist/domains/filters/components/AFilterInteger.vue_vue_type_script_setup_true_lang.js.map +1 -1
  415. package/dist/domains/filters/components/AFilterString.js.map +1 -1
  416. package/dist/domains/filters/components/AFilterString.vue_vue_type_script_setup_true_lang.js.map +1 -1
  417. package/dist/domains/filters/components/AFilterTimeInterval.js +1 -1
  418. package/dist/domains/filters/components/AFilterTimeInterval.js.map +1 -1
  419. package/dist/domains/filters/components/AFilterTimeInterval.vue.d.ts +5 -3
  420. package/dist/domains/filters/components/AFilterTimeInterval.vue_vue_type_script_setup_true_lang.js.map +1 -1
  421. package/dist/domains/filters/components/AFilterValueObjectOptionsSelect.js.map +1 -1
  422. package/dist/domains/filters/components/AFilterValueObjectOptionsSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  423. package/dist/domains/filters/components/AFilterWrapper.vue.d.ts +17 -15
  424. package/dist/domains/filters/components/AFilterWrapperSidebar.vue.d.ts +5 -3
  425. package/dist/domains/filters/components/FiltersSelected.js.map +1 -1
  426. package/dist/domains/filters/components/FiltersSelected.vue_vue_type_script_setup_true_lang.js.map +1 -1
  427. package/dist/domains/filters/composables/filterFactory.d.ts +16 -26
  428. package/dist/domains/filters/composables/filterFactory.js +38 -31
  429. package/dist/domains/filters/composables/filterFactory.js.map +1 -1
  430. package/dist/domains/filters/datatable/components/ADatatableOrdering.js.map +1 -1
  431. package/dist/domains/filters/datatable/components/ADatatableOrdering.vue_vue_type_script_setup_true_lang.js +3 -1
  432. package/dist/domains/filters/datatable/components/ADatatableOrdering.vue_vue_type_script_setup_true_lang.js.map +1 -1
  433. package/dist/domains/filters/datatable/components/ADatatablePagination.js.map +1 -1
  434. package/dist/domains/filters/datatable/components/ADatatablePagination.vue_vue_type_script_setup_true_lang.js +2 -4
  435. package/dist/domains/filters/datatable/components/ADatatablePagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  436. package/dist/domains/filters/utils/filterInjectionKeys.js.map +1 -1
  437. package/dist/domains/form/components/AFormDatetimePicker.js.map +1 -1
  438. package/dist/domains/form/components/AFormDatetimePicker.vue.d.ts +7 -5
  439. package/dist/domains/form/components/AFormDatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  440. package/dist/domains/form/components/AFormFlagDatetimePicker.js.map +1 -1
  441. package/dist/domains/form/components/AFormFlagDatetimePicker.vue.d.ts +7 -5
  442. package/dist/domains/form/components/AFormFlagDatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  443. package/dist/domains/form/components/AFormSwitch.vue.d.ts +7 -5
  444. package/dist/domains/form/components/AFormTextField.js.map +1 -1
  445. package/dist/domains/form/components/AFormTextField.vue.d.ts +9 -7
  446. package/dist/domains/form/components/AFormTextField.vue_vue_type_script_setup_true_lang.js.map +1 -1
  447. package/dist/domains/form/components/AFormTextarea.vue.d.ts +13 -11
  448. package/dist/domains/form/components/AFormValueObjectOptionsSelect.vue.d.ts +7 -5
  449. package/dist/domains/form/components/ASystemEntityScope.vue.d.ts +5 -3
  450. package/dist/domains/job/api/jobApi.js.map +1 -1
  451. package/dist/domains/job/components/AJobDetailCommon.vue.d.ts +5 -3
  452. package/dist/domains/listEditor/components/AListEditor.js.map +1 -1
  453. package/dist/domains/listEditor/components/AListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  454. package/dist/domains/listEditor/components/ANestedSortableListEditor.js.map +1 -1
  455. package/dist/domains/listEditor/components/ANestedSortableListEditor.vue.d.ts +2 -3
  456. package/dist/domains/listEditor/components/ANestedSortableListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  457. package/dist/domains/listEditor/components/ASortableListEditor.js.map +1 -1
  458. package/dist/domains/listEditor/components/ASortableListEditor.vue.d.ts +2 -3
  459. package/dist/domains/listEditor/components/ASortableListEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  460. package/dist/domains/listEditor/composables/useListEditorController.d.ts +4 -5
  461. package/dist/domains/listEditor/composables/useListEditorController.js.map +1 -1
  462. package/dist/domains/listEditor/composables/useNestedListEditor.d.ts +3 -4
  463. package/dist/domains/listEditor/composables/useNestedListEditor.js.map +1 -1
  464. package/dist/domains/listEditor/composables/useNestedListEditorController.d.ts +5 -4
  465. package/dist/domains/listEditor/composables/useNestedListEditorController.js.map +1 -1
  466. package/dist/domains/listEditor/composables/useReorderMode.js.map +1 -1
  467. package/dist/domains/listEditor/types/listEditorTypes.d.ts +2 -2
  468. package/dist/domains/listEditor/utils/listEditorLoader.d.ts +5 -5
  469. package/dist/domains/listEditor/utils/listEditorLoader.js.map +1 -1
  470. package/dist/domains/listEditor/utils/resolveCompactText.js.map +1 -1
  471. package/dist/domains/log/api/logApi.d.ts +2 -3
  472. package/dist/domains/log/api/logApi.js.map +1 -1
  473. package/dist/domains/log/components/ALogDatatable.js.map +1 -1
  474. package/dist/domains/log/components/ALogDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  475. package/dist/domains/log/components/ALogDetailView.js.map +1 -1
  476. package/dist/domains/log/components/ALogDetailView.vue.d.ts +1 -1
  477. package/dist/domains/log/components/ALogDetailView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  478. package/dist/domains/log/components/ALogFilter.js.map +1 -1
  479. package/dist/domains/log/components/ALogFilter.vue_vue_type_script_setup_true_lang.js.map +1 -1
  480. package/dist/domains/log/components/ALogListView.js.map +1 -1
  481. package/dist/domains/log/components/ALogListView.vue.d.ts +1 -1
  482. package/dist/domains/log/components/ALogListView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  483. package/dist/domains/log/composables/logActions.d.ts +4 -5
  484. package/dist/domains/log/composables/logActions.js.map +1 -1
  485. package/dist/domains/log/composables/logType.d.ts +6 -7
  486. package/dist/domains/log/composables/logType.js.map +1 -1
  487. package/dist/domains/log/filter/logFilter.d.ts +8 -11
  488. package/dist/domains/log/filter/logFilter.js.map +1 -1
  489. package/dist/domains/permission/components/APermissionEditor.js.map +1 -1
  490. package/dist/domains/permission/components/APermissionEditor.vue.d.ts +4 -4
  491. package/dist/domains/permission/components/APermissionEditor.vue_vue_type_script_setup_true_lang.js.map +1 -1
  492. package/dist/domains/permission/composables/permissionActions.d.ts +3 -6
  493. package/dist/domains/permission/composables/permissionActions.js.map +1 -1
  494. package/dist/domains/permission/config/api/permissionConfigApi.d.ts +2 -2
  495. package/dist/domains/permission/config/api/permissionConfigApi.js.map +1 -1
  496. package/dist/domains/permission/config/composables/permissionConfigActions.d.ts +3 -7
  497. package/dist/domains/permission/config/composables/permissionConfigActions.js.map +1 -1
  498. package/dist/domains/permission/config/store/permissionConfigStore.d.ts +2 -4
  499. package/dist/domains/permission/config/store/permissionConfigStore.js.map +1 -1
  500. package/dist/domains/permission/group/api/permissionGroupApi.d.ts +8 -10
  501. package/dist/domains/permission/group/api/permissionGroupApi.js.map +1 -1
  502. package/dist/domains/permission/group/components/APermissionGroupDatatable.js.map +1 -1
  503. package/dist/domains/permission/group/components/APermissionGroupDatatable.vue.d.ts +12 -10
  504. package/dist/domains/permission/group/components/APermissionGroupDatatable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  505. package/dist/domains/permission/group/components/APermissionGroupDetail.js.map +1 -1
  506. package/dist/domains/permission/group/components/APermissionGroupDetail.vue.d.ts +21 -22
  507. package/dist/domains/permission/group/components/APermissionGroupDetail.vue_vue_type_script_setup_true_lang.js.map +1 -1
  508. package/dist/domains/permission/group/components/APermissionGroupManage.js.map +1 -1
  509. package/dist/domains/permission/group/components/APermissionGroupManage.vue.d.ts +21 -22
  510. package/dist/domains/permission/group/components/APermissionGroupManage.vue_vue_type_script_setup_true_lang.js.map +1 -1
  511. package/dist/domains/permission/group/composables/cachedPermissionGroups.js.map +1 -1
  512. package/dist/domains/permission/group/composables/permissionGroupActions.d.ts +6 -8
  513. package/dist/domains/permission/group/composables/permissionGroupActions.js.map +1 -1
  514. package/dist/domains/permission/group/composables/permissionGroupValidations.d.ts +2 -3
  515. package/dist/domains/permission/group/composables/permissionGroupValidations.js.map +1 -1
  516. package/dist/domains/permission/group/filter/permissionGroupFilter.d.ts +2 -3
  517. package/dist/domains/permission/group/filter/permissionGroupFilter.js.map +1 -1
  518. package/dist/domains/permission/group/store/permissionGroupStore.d.ts +3 -6
  519. package/dist/domains/permission/group/store/permissionGroupStore.js.map +1 -1
  520. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocomplete.js.map +1 -1
  521. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  522. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocompleteWithMinimal.js.map +1 -1
  523. package/dist/domains/remoteAutocomplete/components/AFilterRemoteAutocompleteWithMinimal.vue_vue_type_script_setup_true_lang.js.map +1 -1
  524. package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocomplete.js.map +1 -1
  525. package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js.map +1 -1
  526. package/dist/domains/remoteAutocomplete/components/AFormRemoteAutocompleteWithCached.vue.d.ts +5 -3
  527. package/dist/domains/remoteAutocomplete/composables/createRemoteAutocomplete.d.ts +11 -13
  528. package/dist/domains/remoteAutocomplete/composables/createRemoteAutocomplete.js.map +1 -1
  529. package/dist/domains/subjectSelect/components/AFilterWrapperSubjectSelect.vue.d.ts +13 -11
  530. package/dist/domains/subjectSelect/components/ASubjectSelect.js.map +1 -1
  531. package/dist/domains/subjectSelect/components/ASubjectSelect.vue_vue_type_script_setup_true_lang.js.map +1 -1
  532. package/dist/domains/subjectSelect/composables/useSubjectSelect.js +53 -51
  533. package/dist/domains/subjectSelect/composables/useSubjectSelect.js.map +1 -1
  534. package/dist/domains/system/appShell/components/AActionbar.vue.d.ts +7 -5
  535. package/dist/domains/system/appShell/components/ALayoutSwitch.js.map +1 -1
  536. package/dist/domains/system/appShell/components/ALayoutSwitch.vue.d.ts +7 -5
  537. package/dist/domains/system/appShell/components/ALayoutSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  538. package/dist/domains/system/appShell/composables/teleportSlot.d.ts +0 -1
  539. package/dist/domains/system/appShell/composables/teleportSlot.js.map +1 -1
  540. package/dist/domains/system/components/AAlerts.js.map +1 -1
  541. package/dist/domains/system/components/AAlerts.vue_vue_type_script_setup_true_lang.js.map +1 -1
  542. package/dist/domains/system/composables/alerts.js.map +1 -1
  543. package/dist/domains/system/composables/breadcrumbs.d.ts +3 -3
  544. package/dist/domains/system/composables/breadcrumbs.js.map +1 -1
  545. package/dist/domains/system/composables/languageSettings.js.map +1 -1
  546. package/dist/domains/system/composables/loginStatus.js.map +1 -1
  547. package/dist/domains/system/composables/navigationError.d.ts +6 -8
  548. package/dist/domains/system/composables/navigationError.js.map +1 -1
  549. package/dist/domains/system/composables/pageNavigation.d.ts +9 -10
  550. package/dist/domains/system/composables/pageNavigation.js.map +1 -1
  551. package/dist/domains/system/composables/recordActions.d.ts +14 -22
  552. package/dist/domains/system/composables/recordActions.js.map +1 -1
  553. package/dist/domains/system/composables/recordPage.d.ts +23 -38
  554. package/dist/domains/system/composables/recordPage.js.map +1 -1
  555. package/dist/domains/system/composables/routeHistory.d.ts +4 -5
  556. package/dist/domains/system/composables/routeHistory.js.map +1 -1
  557. package/dist/domains/system/composables/sentry.js.map +1 -1
  558. package/dist/domains/system/composables/useDebugFeatures.d.ts +3 -6
  559. package/dist/domains/system/composables/useDebugFeatures.js.map +1 -1
  560. package/dist/domains/system/store/datatablePageStore.d.ts +8 -1
  561. package/dist/domains/system/store/datatablePageStore.js +10 -3
  562. package/dist/domains/system/store/datatablePageStore.js.map +1 -1
  563. package/dist/domains/system/systemBar/components/ASystemBar.js.map +1 -1
  564. package/dist/domains/system/systemBar/components/ASystemBar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  565. package/dist/domains/system/systemBar/utils/appReload.d.ts +5 -5
  566. package/dist/domains/system/systemBar/utils/appReload.js.map +1 -1
  567. package/dist/domains/ui/buttons/action/components/AActionCloseButtonHistory.js.map +1 -1
  568. package/dist/domains/ui/buttons/action/components/AActionCloseButtonHistory.vue.d.ts +2 -3
  569. package/dist/domains/ui/buttons/action/components/AActionCloseButtonHistory.vue_vue_type_script_setup_true_lang.js.map +1 -1
  570. package/dist/domains/ui/buttons/action/components/AActionDeleteButton.js.map +1 -1
  571. package/dist/domains/ui/buttons/action/components/AActionDeleteButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  572. package/dist/domains/ui/buttons/components/ABtnSplit.vue.d.ts +9 -7
  573. package/dist/domains/ui/components/AAvatarColorPicker.js.map +1 -1
  574. package/dist/domains/ui/components/AAvatarColorPicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  575. package/dist/domains/ui/components/ACard.js.map +1 -1
  576. package/dist/domains/ui/components/ACard.vue.d.ts +7 -3
  577. package/dist/domains/ui/components/ACard.vue_vue_type_script_setup_true_lang.js +6 -2
  578. package/dist/domains/ui/components/ACard.vue_vue_type_script_setup_true_lang.js.map +1 -1
  579. package/dist/domains/ui/components/ACardLoader.js.map +1 -1
  580. package/dist/domains/ui/components/ACardLoader.vue.d.ts +1 -0
  581. package/dist/domains/ui/components/ACardLoader.vue_vue_type_script_setup_true_lang.js +13 -7
  582. package/dist/domains/ui/components/ACardLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  583. package/dist/domains/ui/components/AChipNoLink.vue.d.ts +5 -3
  584. package/dist/domains/ui/components/ACopyText.vue.d.ts +9 -7
  585. package/dist/domains/ui/components/ACreateDialog.js.map +1 -1
  586. package/dist/domains/ui/components/ACreateDialog.vue.d.ts +11 -9
  587. package/dist/domains/ui/components/ACreateDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  588. package/dist/domains/ui/components/ADialogToolbar.vue.d.ts +5 -3
  589. package/dist/domains/ui/components/ARow.vue.d.ts +5 -3
  590. package/dist/domains/ui/components/ATimeTrackingFields.js.map +1 -1
  591. package/dist/domains/ui/components/ATimeTrackingFields.vue_vue_type_script_setup_true_lang.js.map +1 -1
  592. package/dist/domains/ui/components/AUserAndTimeTrackingFields.js.map +1 -1
  593. package/dist/domains/ui/components/AUserAndTimeTrackingFields.vue.d.ts +3 -5
  594. package/dist/domains/ui/components/AUserAndTimeTrackingFields.vue_vue_type_script_setup_true_lang.js.map +1 -1
  595. package/dist/domains/ui/datetime/components/ADatetimePicker.js +1 -1
  596. package/dist/domains/ui/datetime/components/ADatetimePicker.js.map +1 -1
  597. package/dist/domains/ui/datetime/components/ADatetimePicker.vue.d.ts +5 -3
  598. package/dist/domains/ui/datetime/components/ADatetimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  599. package/dist/domains/ui/file/components/AFileDropzone.js.map +1 -1
  600. package/dist/domains/ui/file/components/AFileDropzone.vue.d.ts +1 -1
  601. package/dist/domains/ui/file/components/AFileDropzone.vue_vue_type_script_setup_true_lang.js.map +1 -1
  602. package/dist/domains/ui/file/components/AFileInput.js.map +1 -1
  603. package/dist/domains/ui/file/components/AFileInput.vue.d.ts +9 -7
  604. package/dist/domains/ui/file/components/AFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  605. package/dist/domains/ui/file/components/AFileInputDialog.js.map +1 -1
  606. package/dist/domains/ui/file/components/AFileInputDialog.vue.d.ts +9 -7
  607. package/dist/domains/ui/file/components/AFileInputDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  608. package/dist/domains/ui/file/composables/dropzone.js.map +1 -1
  609. package/dist/domains/ui/file/composables/formatAndSizeCheck.js.map +1 -1
  610. package/dist/domains/ui/view/components/AGenericView.vue.d.ts +7 -5
  611. package/dist/domains/ui/view/components/ALoginView.js +1 -1
  612. package/dist/domains/ui/view/components/ALoginView.js.map +1 -1
  613. package/dist/domains/ui/view/components/ALoginView.vue.d.ts +5 -3
  614. package/dist/domains/ui/view/components/ALoginView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  615. package/dist/domains/ui/view/components/ALogoutView.js.map +1 -1
  616. package/dist/domains/ui/view/components/ALogoutView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  617. package/dist/domains/ui/view/components/ANotFoundView.js.map +1 -1
  618. package/dist/domains/ui/view/components/ANotFoundView.vue_vue_type_script_setup_true_lang.js.map +1 -1
  619. package/dist/domains/unsavedGuard/composables/useUnsavedChangesGuard.d.ts +6 -7
  620. package/dist/domains/unsavedGuard/composables/useUnsavedChangesGuard.js.map +1 -1
  621. package/dist/lib.d.ts +2 -2
  622. package/dist/plugins/commonVuetifyConfig.d.ts +3 -3
  623. package/dist/plugins/commonVuetifyConfig.js.map +1 -1
  624. package/dist/plugins/i18n.d.ts +4 -5
  625. package/dist/plugins/i18n.js.map +1 -1
  626. package/dist/plugins/pluginOptions.d.ts +4 -2
  627. package/dist/plugins/pluginOptions.js.map +1 -1
  628. package/dist/plugins/webfontloader.js.map +1 -1
  629. package/dist/shared/error/AnzuApiCancelledError.d.ts +5 -8
  630. package/dist/shared/error/AnzuApiCancelledError.js.map +1 -1
  631. package/dist/shared/error/AnzuError.d.ts +3 -5
  632. package/dist/shared/error/AnzuError.js.map +1 -1
  633. package/dist/shared/error/AuthUnavailableError.d.ts +3 -3
  634. package/dist/shared/error/AuthUnavailableError.js.map +1 -1
  635. package/dist/shared/error/isInCauseChain.d.ts +2 -2
  636. package/dist/shared/error/isInCauseChain.js.map +1 -1
  637. package/dist/shared/types/UserAndTimeTracking.d.ts +5 -5
  638. package/dist/shared/types/Validation.d.ts +4 -5
  639. package/dist/shared/types/common.d.ts +1 -3
  640. package/dist/shared/types/globalComponents.d.ts +5 -6
  641. package/dist/shared/utils/common.js.map +1 -1
  642. package/dist/shared/utils/datetime.d.ts +0 -1
  643. package/dist/shared/utils/datetime.js.map +1 -1
  644. package/dist/shared/utils/datetimePickerValue.d.ts +4 -7
  645. package/dist/shared/utils/datetimePickerValue.js.map +1 -1
  646. package/dist/shared/utils/development.d.ts +3 -3
  647. package/dist/shared/utils/development.js.map +1 -1
  648. package/dist/shared/utils/envConfig.d.ts +4 -4
  649. package/dist/shared/utils/envConfig.js.map +1 -1
  650. package/dist/shared/utils/json.d.ts +1 -1
  651. package/dist/shared/utils/json.js.map +1 -1
  652. package/dist/shared/utils/userAndTimeTracking.d.ts +5 -7
  653. package/dist/shared/utils/userAndTimeTracking.js.map +1 -1
  654. package/dist/shared/validators/vuelidate/common/useValidateHexColor.d.ts +3 -5
  655. package/dist/shared/validators/vuelidate/common/useValidateHexColor.js.map +1 -1
  656. package/dist/testing/appShell.d.ts +11 -11
  657. package/dist/testing/appShell.js.map +1 -1
  658. package/dist/testing/closeButtons.d.ts +9 -11
  659. package/dist/testing/closeButtons.js.map +1 -1
  660. package/dist/testing/declaredDependencies.d.ts +7 -7
  661. package/dist/testing/declaredDependencies.js.map +1 -1
  662. package/dist/testing/generatedRoutes.d.ts +6 -11
  663. package/dist/testing/generatedRoutes.js.map +1 -1
  664. package/dist/testing/routeHistory.d.ts +5 -12
  665. package/dist/testing/routeHistory.js.map +1 -1
  666. package/dist/testing/sortableLists.d.ts +16 -21
  667. package/dist/testing/sortableLists.js.map +1 -1
  668. package/dist/testing/typedRouter.d.ts +0 -1
  669. package/dist/testing/typedRouter.js.map +1 -1
  670. package/package.json +26 -26
  671. package/src/eslint/adminConfig.mjs +19 -27
  672. package/src/eslint/globalComponentNames.mjs +3 -4
  673. package/src/eslint/oxlint.mjs +7 -20
  674. package/src/eslint/plugin.d.mts +2 -4
  675. package/src/eslint/plugin.mjs +18 -34
  676. package/src/eslint/validRouteName.mjs +6 -7
  677. package/src/vite/devWatch.mjs +30 -43
  678. package/src/vite/index.d.mts +5 -5
  679. package/src/vite/sentry.mjs +7 -12
  680. package/src/vite/sourcemaps.mjs +4 -8
@@ -1 +1 @@
1
- {"version":3,"file":"imageApiCms.js","names":["END_POINT","ENTITY","BULK_METADATA_LIMIT","fetchImageListByIds","useApiFetchByIds","execute","ids","fetchImage","useApiRequest","createImage","data","updateImage","deleteImage","useApiCommand","bulkUpdateImages","client","items","resolve","responses","reject","res","response","err","updateImagesSequence","totalCalls","i","offset","reqData"],"sources":["../../../../../src/domains/dam/imageWidget/composables/imageApiCms.ts"],"sourcesContent":["import type { AxiosInstance, AxiosResponse } from 'axios'\nimport type { IntegerId } from '@/shared/types/common'\nimport type { ImageAware, ImageCreateUpdateAware } from '@/domains/dam/types/ImageAware'\nimport { HTTP_STATUS_OK } from '@/shared/statusCodes'\nimport { useApiFetchByIds } from '@/domains/api/composables/useApiFetchByIds'\nimport { useApiCommand, useApiRequest } from '@/domains/api/composables/useApiRequest'\n\nconst END_POINT = '/adm/v1/image'\nexport const ENTITY = 'image'\nexport const SYSTEM_CMS = 'cms'\n\nconst BULK_METADATA_LIMIT = 20\n\nexport const fetchImageListByIds = (client: () => AxiosInstance, ids: IntegerId[]) => {\n const { execute } = useApiFetchByIds<ImageAware>({\n client,\n system: SYSTEM_CMS,\n entity: ENTITY,\n urlTemplate: END_POINT,\n })\n\n return execute(ids)\n}\n\n// `optionalBody`, because a body-less answer here is not a broken endpoint: the callers guard the\n// result with a strict `isNull` and expect to be told there is no image, which is what the helper\n// this replaced did. Normalised to `null` so those guards keep working.\nexport const fetchImage = async (client: () => AxiosInstance, id: IntegerId) => {\n const { execute } = useApiRequest<ImageAware, null>({\n client,\n method: 'GET',\n system: SYSTEM_CMS,\n entity: ENTITY,\n urlTemplate: END_POINT + '/:id',\n optionalBody: true,\n })\n\n return (await execute({ urlParams: { id } })) ?? null\n}\n\nexport const createImage = (client: () => AxiosInstance, data: ImageCreateUpdateAware) => {\n const { execute } = useApiRequest<ImageAware, ImageCreateUpdateAware>({\n client,\n method: 'POST',\n system: SYSTEM_CMS,\n entity: ENTITY,\n urlTemplate: END_POINT,\n })\n\n return execute({ body: data })\n}\n\nexport const updateImage = (client: () => AxiosInstance, id: IntegerId, data: ImageCreateUpdateAware) => {\n const { execute } = useApiRequest<ImageAware, ImageCreateUpdateAware>({\n client,\n method: 'PUT',\n system: SYSTEM_CMS,\n entity: ENTITY,\n urlTemplate: END_POINT + '/:id',\n })\n\n return execute({ urlParams: { id }, body: data })\n}\n\nexport const deleteImage = (client: () => AxiosInstance, id: IntegerId) => {\n const { execute } = useApiCommand({\n client,\n method: 'DELETE',\n system: SYSTEM_CMS,\n entity: ENTITY,\n urlTemplate: END_POINT + '/:id',\n })\n\n return execute({ urlParams: { id } })\n}\n\nexport const bulkUpdateImages = (client: () => AxiosInstance, items: ImageCreateUpdateAware[]) => {\n return new Promise<ImageAware[]>((resolve, reject) => {\n updateImagesSequence(client, items)\n .then((responses) => {\n if (items.length === 0) {\n return resolve([])\n } else if (responses.length === 0) {\n return reject(responses)\n } else if (\n responses.every((res) => {\n return res.status === HTTP_STATUS_OK\n })\n ) {\n const images: ImageAware[] = responses.flatMap((response) => response.data.images)\n return resolve(images)\n } else {\n return reject(responses)\n }\n })\n .catch((err) => {\n //\n return reject(err)\n })\n })\n}\n\nasync function updateImagesSequence(client: () => AxiosInstance, items: ImageCreateUpdateAware[]) {\n const totalCalls = Math.ceil(items.length / BULK_METADATA_LIMIT)\n const responses: AxiosResponse[] = []\n if (items.length === 0) return Promise.resolve([])\n\n for (let i = 0; i < totalCalls; i++) {\n const offset = i * BULK_METADATA_LIMIT\n const reduced = items.slice(offset, offset + BULK_METADATA_LIMIT)\n const reqData = { images: reduced }\n const res = await client().put(END_POINT, JSON.stringify(reqData))\n responses.push(res)\n }\n return responses\n}\n"],"mappings":";;;;AAOA,IAAMA,IAAY,iBACLC,IAAS,SAGhBC,IAAsB,IAEfC,KAAuB,GAA6B,MAAqB;CACpF,IAAM,EAAE,eAAYC,EAA6B;EAC/C;EACA,QAAA;EACA,QAAQH;EACR,aAAaD;CACf,CAAC;CAED,OAAOK,EAAQC,CAAG;AACpB,GAKaC,IAAa,OAAO,GAA6B,MAAkB;CAC9E,IAAM,EAAE,eAAYC,EAAgC;EAClD;EACA,QAAQ;EACR,QAAA;EACA,QAAQP;EACR,aAAaD,IAAY;EACzB,cAAc;CAChB,CAAC;CAED,OAAQ,MAAMK,EAAQ,EAAE,WAAW,EAAE,MAAG,EAAE,CAAC,KAAM;AACnD,GAEaI,KAAe,GAA6B,MAAiC;CACxF,IAAM,EAAE,eAAYD,EAAkD;EACpE;EACA,QAAQ;EACR,QAAA;EACA,QAAQP;EACR,aAAaD;CACf,CAAC;CAED,OAAOK,EAAQ,EAAE,MAAMK,EAAK,CAAC;AAC/B,GAEaC,KAAe,GAA6B,GAAe,MAAiC;CACvG,IAAM,EAAE,eAAYH,EAAkD;EACpE;EACA,QAAQ;EACR,QAAA;EACA,QAAQP;EACR,aAAaD,IAAY;CAC3B,CAAC;CAED,OAAOK,EAAQ;EAAE,WAAW,EAAE,MAAG;EAAG,MAAMK;CAAK,CAAC;AAClD,GAEaE,KAAe,GAA6B,MAAkB;CACzE,IAAM,EAAE,eAAYC,EAAc;EAChC;EACA,QAAQ;EACR,QAAA;EACA,QAAQZ;EACR,aAAaD,IAAY;CAC3B,CAAC;CAED,OAAOK,EAAQ,EAAE,WAAW,EAAE,MAAG,EAAE,CAAC;AACtC,GAEaS,KAAoB,GAA6B,MACrD,IAAI,SAAuB,GAAS,MAAW;CACpD,EAAqBC,GAAQC,CAAK,CAAC,CAChC,MAAM,MACDA,EAAM,WAAW,IACZC,EAAQ,CAAC,CAAC,IACRC,EAAU,WAAW,IACvBC,EAAOD,CAAS,IAEvBA,EAAU,OAAO,MACRE,EAAI,WAAA,GACZ,IAGMH,EADsBC,EAAU,SAAS,MAAaG,EAAS,KAAK,MAC5D,CAAM,IAEdF,EAAOD,CAAS,CAE1B,CAAC,CACD,OAAO,MAECC,EAAOG,CAAG,CAClB;AACL,CAAC;AAGH,eAAeC,EAAqB,GAA6B,GAAiC;CAChG,IAAMC,IAAa,KAAK,KAAKR,EAAM,SAASd,CAAmB,GACzDgB,IAA6B,CAAC;CACpC,IAAIF,EAAM,WAAW,GAAG,OAAO,QAAQ,QAAQ,CAAC,CAAC;CAEjD,KAAK,IAAIS,IAAI,GAAGA,IAAID,GAAY,KAAK;EACnC,IAAME,IAASD,IAAIvB,GAEbyB,IAAU,EAAE,QADFX,EAAM,MAAMU,GAAQA,IAASxB,CACnB,EAAQ,GAC5BkB,IAAM,MAAML,EAAO,CAAC,CAAC,IAAIf,GAAW,KAAK,UAAU2B,CAAO,CAAC;EACjE,EAAU,KAAKP,CAAG;CACpB;CACA,OAAOF;AACT"}
1
+ {"version":3,"file":"imageApiCms.js","names":["END_POINT","ENTITY","BULK_METADATA_LIMIT","fetchImageListByIds","useApiFetchByIds","execute","ids","fetchImage","useApiRequest","createImage","data","updateImage","deleteImage","useApiCommand","bulkUpdateImages","client","items","resolve","responses","reject","res","response","err","updateImagesSequence","totalCalls","i","offset","reqData"],"sources":["../../../../../src/domains/dam/imageWidget/composables/imageApiCms.ts"],"sourcesContent":["import type { AxiosInstance, AxiosResponse } from 'axios'\nimport type { IntegerId } from '@/shared/types/common'\nimport type { ImageAware, ImageCreateUpdateAware } from '@/domains/dam/types/ImageAware'\nimport { HTTP_STATUS_OK } from '@/shared/statusCodes'\nimport { useApiFetchByIds } from '@/domains/api/composables/useApiFetchByIds'\nimport { useApiCommand, useApiRequest } from '@/domains/api/composables/useApiRequest'\n\nconst END_POINT = '/adm/v1/image'\nexport const ENTITY = 'image'\nexport const SYSTEM_CMS = 'cms'\n\nconst BULK_METADATA_LIMIT = 20\n\nexport const fetchImageListByIds = (client: () => AxiosInstance, ids: IntegerId[]) => {\n const { execute } = useApiFetchByIds<ImageAware>({\n client,\n system: SYSTEM_CMS,\n entity: ENTITY,\n urlTemplate: END_POINT,\n })\n\n return execute(ids)\n}\n\n// `optionalBody`: a body-less answer here means there is no image, not a broken endpoint.\n// Callers guard the result with a strict `isNull`, so it is normalised to `null`.\nexport const fetchImage = async (client: () => AxiosInstance, id: IntegerId) => {\n const { execute } = useApiRequest<ImageAware, null>({\n client,\n method: 'GET',\n system: SYSTEM_CMS,\n entity: ENTITY,\n urlTemplate: END_POINT + '/:id',\n optionalBody: true,\n })\n\n return (await execute({ urlParams: { id } })) ?? null\n}\n\nexport const createImage = (client: () => AxiosInstance, data: ImageCreateUpdateAware) => {\n const { execute } = useApiRequest<ImageAware, ImageCreateUpdateAware>({\n client,\n method: 'POST',\n system: SYSTEM_CMS,\n entity: ENTITY,\n urlTemplate: END_POINT,\n })\n\n return execute({ body: data })\n}\n\nexport const updateImage = (client: () => AxiosInstance, id: IntegerId, data: ImageCreateUpdateAware) => {\n const { execute } = useApiRequest<ImageAware, ImageCreateUpdateAware>({\n client,\n method: 'PUT',\n system: SYSTEM_CMS,\n entity: ENTITY,\n urlTemplate: END_POINT + '/:id',\n })\n\n return execute({ urlParams: { id }, body: data })\n}\n\nexport const deleteImage = (client: () => AxiosInstance, id: IntegerId) => {\n const { execute } = useApiCommand({\n client,\n method: 'DELETE',\n system: SYSTEM_CMS,\n entity: ENTITY,\n urlTemplate: END_POINT + '/:id',\n })\n\n return execute({ urlParams: { id } })\n}\n\nexport const bulkUpdateImages = (client: () => AxiosInstance, items: ImageCreateUpdateAware[]) => {\n return new Promise<ImageAware[]>((resolve, reject) => {\n updateImagesSequence(client, items)\n .then((responses) => {\n if (items.length === 0) {\n return resolve([])\n } else if (responses.length === 0) {\n return reject(responses)\n } else if (\n responses.every((res) => {\n return res.status === HTTP_STATUS_OK\n })\n ) {\n const images: ImageAware[] = responses.flatMap((response) => response.data.images)\n return resolve(images)\n } else {\n return reject(responses)\n }\n })\n .catch((err) => {\n //\n return reject(err)\n })\n })\n}\n\nasync function updateImagesSequence(client: () => AxiosInstance, items: ImageCreateUpdateAware[]) {\n const totalCalls = Math.ceil(items.length / BULK_METADATA_LIMIT)\n const responses: AxiosResponse[] = []\n if (items.length === 0) return Promise.resolve([])\n\n for (let i = 0; i < totalCalls; i++) {\n const offset = i * BULK_METADATA_LIMIT\n const reduced = items.slice(offset, offset + BULK_METADATA_LIMIT)\n const reqData = { images: reduced }\n const res = await client().put(END_POINT, JSON.stringify(reqData))\n responses.push(res)\n }\n return responses\n}\n"],"mappings":";;;;AAOA,IAAMA,IAAY,iBACLC,IAAS,SAGhBC,IAAsB,IAEfC,KAAuB,GAA6B,MAAqB;CACpF,IAAM,EAAE,eAAYC,EAA6B;EAC/C;EACA,QAAA;EACA,QAAQH;EACR,aAAaD;CACf,CAAC;CAED,OAAOK,EAAQC,CAAG;AACpB,GAIaC,IAAa,OAAO,GAA6B,MAAkB;CAC9E,IAAM,EAAE,eAAYC,EAAgC;EAClD;EACA,QAAQ;EACR,QAAA;EACA,QAAQP;EACR,aAAaD,IAAY;EACzB,cAAc;CAChB,CAAC;CAED,OAAQ,MAAMK,EAAQ,EAAE,WAAW,EAAE,MAAG,EAAE,CAAC,KAAM;AACnD,GAEaI,KAAe,GAA6B,MAAiC;CACxF,IAAM,EAAE,eAAYD,EAAkD;EACpE;EACA,QAAQ;EACR,QAAA;EACA,QAAQP;EACR,aAAaD;CACf,CAAC;CAED,OAAOK,EAAQ,EAAE,MAAMK,EAAK,CAAC;A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10 +3,10 @@ import { ImageCreateUpdateAware } from '../../types/ImageAware';
3
3
  import { DocId, IntegerId } from '../../../../shared/types/common';
4
4
  interface HeldAsset {
5
5
  asset: AssetDetailItemDto;
6
- /** The file the asset was read for: the file of the image made of that pick. */
6
+ /** The file the asset was read for, i.e. the file of the image made from that pick. */
7
7
  file: DocId;
8
8
  }
9
- /** What a read of the held asset anew has found: the asset with the names of its authors, or the failure. */
9
+ /** Result of re-reading the held asset: the asset with its author names, or the failure. */
10
10
  export type HeldAssetAnew = {
11
11
  of: HeldAsset;
12
12
  asset: AssetDetailItemDto;
@@ -16,19 +16,17 @@ export type HeldAssetAnew = {
16
16
  failure: unknown;
17
17
  };
18
18
  /**
19
- * The image of a held asset, once that asset turns out to have authors: an empty source takes their names. The pick
20
- * makes that image with an empty source, and its dialog does not show the source while it offers the pick, so an
21
- * empty source is the pick's (one of white space alone counts as empty). A source it has came from a save of the image
22
- * elsewhere, and stays: the dialog shows it from then on.
19
+ * Fills an empty source with the authors' names once the held asset turns out to have authors.
20
+ * The pick creates the image with an empty source, and the dialog hides the source while it offers the pick.
21
+ * So an empty or whitespace-only source belongs to the pick. A non-empty source came from a save elsewhere and stays.
23
22
  */
24
23
  export declare const giveNamesToEmptySource: (image: ImageCreateUpdateAware, names: string) => void;
25
24
  /**
26
- * The authors of the DAM the dialog of the image of a widget of one image offers in place of a source: those of an
27
- * asset picked in the library that has none. The widget holds that asset itself, with the file it read it for, and
28
- * offers its authors only in the dialog of the image of that file. They used to be those of the asset in the store of
29
- * the asset detail, which is one for the page: the asset picker, the asset detail and every other widget write there,
30
- * so the dialog offered, and saved, the authors of an asset that was not the image's.
31
- * `shownImage`: the image the dialog of the widget shows; none while it shows none.
25
+ * DAM authors the single-image widget dialog offers in place of a source, for a library-picked asset that has none.
26
+ * The widget holds the asset and the file it was read for, and offers its authors only in that file's image dialog.
27
+ * Do not use the asset detail store: it is shared per page by the picker,
28
+ * detail and other widgets, which caused wrong authors to be saved.
29
+ * `shownImage`: the image the widget dialog shows, or none.
32
30
  */
33
31
  export declare function useImageDialogDamAuthors(configName: string, shownImage: () => ImageCreateUpdateAware | null, readonly: () => boolean): {
34
32
  damAuthorsAsset: import('vue').ComputedRef<{
@@ -428,7 +426,7 @@ export declare function useImageDialogDamAuthors(configName: string, shownImage:
428
426
  takeHeldAnew: (anew: HeldAssetAnew | null, image: ImageCreateUpdateAware | null) => void;
429
427
  letGoOnceSavedWithSource: (image: ImageCreateUpdateAware) => () => void;
430
428
  authorsGivenMeanwhile: (asset: AssetDetailItemDto) => Promise<string | null>;
431
- /** Whether a confirm waits for the read of the asset of a detail that has just closed: its button spins. */
429
+ /** A confirm waits for the read of a just-closed detail's asset. Its button spins. */
432
430
  confirmWaits: import('vue').Ref<boolean, boolean>;
433
431
  };
434
432
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"imageDialogDamAuthors.js","names":["REQUESTS_OF_A_DETAIL_ASSET_READ","giveNamesToEmptySource","image","names","useImageDialogDamAuthors","useCommonAdminCoreDamOptions","configName","useDamConfigState","damClient","useExtSystemIdForCached","assetDetailStore","useAssetDetailStore","useAlerts","held","ref","unmounted","imageOfHeld","shownImage","isNull","staleIn","shallowRef","damAuthorsAsset","computed","offerDamAuthorsOf","offerNoDamAuthors","pickDamAuthors","asset","authors","namesOf","extSystem","getExtSystemByLicence","pageExtSystem","fetchAuthorListByIds","endPointAuthor","author","takeAuthorsOfDetailAsset","detailSave","fetchAsset","endPointAsset","of","source","read","readonly","detailAssetRead","detailAssetReads","waitingConfirm","confirmWaits","dropWaitingConfirm","watch","shown","assetId","cachedExtSystemId","saving","waiting","withinWaitLimit","answer","WAIT_RAN_OUT","showErrorT","again","file","afterDetail","failure","anew","showErrorsDefault","showUnknownError"],"sources":["../../../../../src/domains/dam/imageWidget/composables/imageDialogDamAuthors.ts"],"sourcesContent":["import { computed, onBeforeUnmount, ref, shallowRef, watch } from 'vue'\nimport { fetchAsset } from '@/domains/dam/api/damAssetApi'\nimport { useAssetDetailStore } from '@/domains/dam/assetDetail/store/assetDetailStore'\nimport { fetchAuthorListByIds } from '@/domains/dam/author/api/authorApi'\nimport { useCommonAdminCoreDamOptions } from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport { useExtSystemIdForCached } from '@/domains/dam/composables/extSystemIdForCached'\nimport { useDamConfigState } from '@/domains/dam/config/composables/damConfigState'\nimport type { AssetDetailItemDto } from '@/domains/dam/types/Asset'\nimport type { ImageCreateUpdateAware } from '@/domains/dam/types/ImageAware'\nimport { useAlerts } from '@/domains/system/composables/alerts'\nimport type { DocId, IntegerId } from '@/shared/types/common'\nimport { isNull } from '@/shared/utils/common'\nimport { WAIT_RAN_OUT, withinWaitLimit } from '@/domains/dam/imageWidget/utils/waitLimit'\n\ninterface HeldAsset {\n asset: AssetDetailItemDto\n /** The file the asset was read for: the file of the image made of that pick. */\n file: DocId\n}\n\n/** What a read of the held asset anew has found: the asset with the names of its authors, or the failure. */\nexport type HeldAssetAnew =\n | { of: HeldAsset; asset: AssetDetailItemDto; names: string }\n | { of: HeldAsset; failure: unknown }\n\n/** What the read of a held asset after its detail closed found. */\ntype DetailAssetRead = { of: HeldAsset; asset: AssetDetailItemDto; names: string }\n\n// The requests of a read after a detail has closed, one after another: the rest of the save of the detail, the asset,\n// the licence of the asset (once a page), the names of its authors.\nconst REQUESTS_OF_A_DETAIL_ASSET_READ = 4\n\n/**\n * The image of a held asset, once that asset turns out to have authors: an empty source takes their names. The pick\n * makes that image with an empty source, and its dialog does not show the source while it offers the pick, so an\n * empty source is the pick's (one of white space alone counts as empty). A source it has came from a save of the image\n * elsewhere, and stays: the dialog shows it from then on.\n */\nexport const giveNamesToEmptySource = (image: ImageCreateUpdateAware, names: string) => {\n if (image.texts.source.trim().length === 0) image.texts.source = names\n}\n\n/**\n * The authors of the DAM the dialog of the image of a widget of one image offers in place of a source: those of an\n * asset picked in the library that has none. The widget holds that asset itself, with the file it read it for, and\n * offers its authors only in the dialog of the image of that file. They used to be those of the asset in the store of\n * the asset detail, which is one for the page: the asset picker, the asset detail and every other widget write there,\n * so the dialog offered, and saved, the authors of an asset that was not the image's.\n * `shownImage`: the image the dialog of the widget shows; none while it shows none.\n */\nexport function useImageDialogDamAuthors(\n configName: string,\n shownImage: () => ImageCreateUpdateAware | null,\n readonly: () => boolean\n) {\n const { damClient, endPointAsset, endPointAuthor } = useCommonAdminCoreDamOptions(configName)\n const { getExtSystemByLicence } = useDamConfigState(damClient, configName)\n const { cachedExtSystemId } = useExtSystemIdForCached(configName)\n const assetDetailStore = useAssetDetailStore()\n const { showErrorsDefault, showErrorT, showUnknownError } = useAlerts()\n\n const held = ref<HeldAsset | null>(null)\n // A read may end once the widget is gone.\n let unmounted = false\n onBeforeUnmount(() => {\n unmounted = true\n })\n\n /** The image the dialog shows, when it is the one the held asset was read for. */\n const imageOfHeld = () => {\n const image = shownImage()\n return !isNull(held.value) && !isNull(image) && image.dam.damId === held.value.file ? image : null\n }\n\n // The image the dialog shows, once a read of the held asset for it has failed: what the widget holds may be stale by\n // then, and the dialog shows the source of the image in place of the pick, till it shows an image anew. It went on\n // offering the pick of the asset as it was read before; its confirm, which reads the asset again, wrote nothing, but\n // only after the user had picked.\n const staleIn = shallowRef<ImageCreateUpdateAware | null>(null)\n\n /**\n * The asset whose authors the dialog offers: none unless it shows the image the widget read that asset for, and the\n * last read of it for that image has not failed.\n */\n const damAuthorsAsset = computed(() => {\n if (isNull(held.value)) return null\n const image = imageOfHeld()\n return isNull(image) || image === staleIn.value ? null : held.value.asset\n })\n\n const offerDamAuthorsOf = (asset: AssetDetailItemDto, file: DocId) => {\n held.value = { asset, file }\n }\n\n const offerNoDamAuthors = () => {\n held.value = null\n }\n\n /** The authors the user picks in the dialog. */\n const pickDamAuthors = (authors: DocId[]) => {\n const asset = damAuthorsAsset.value\n if (asset) asset.authors = authors\n }\n\n /** The names of the authors of an asset, under the ext system of its licence; `pageExtSystem` where it tells none. */\n const namesOf = async (asset: AssetDetailItemDto, pageExtSystem: IntegerId) => {\n const extSystem = (await getExtSystemByLicence(asset.licence)) ?? pageExtSystem\n const authorsRes = await fetchAuthorListByIds(damClient, endPointAuthor, extSystem, asset.authors)\n return authorsRes.map((author) => author.name).join(', ')\n }\n\n /**\n * The detail \"edit asset\" of the dialog opens may have given the asset authors. The asset is read again, once the\n * save of the detail that was on its way when it closed is answered: read before that, it would be as it was. Once\n * it has authors the pick of them goes, and an empty source of the image the dialog shows takes their names, as the\n * image of an asset picked with its authors has them (a source it has stays); what was picked in the dialog before\n * gives way. Without authors the dialog goes on offering them, over the asset as it was read now. `pageExtSystem`:\n * the ext system its configuration asked for names under when the detail closed, for an asset whose licence does not\n * tell.\n */\n const takeAuthorsOfDetailAsset = async (\n of: HeldAsset,\n detailSave: Promise<void> | null,\n pageExtSystem: IntegerId\n ): Promise<DetailAssetRead | null> => {\n try {\n await detailSave\n const asset = await fetchAsset(damClient, endPointAsset, of.asset.id)\n const source = asset.authors.length > 0 ? await namesOf(asset, pageExtSystem) : ''\n const read = { of, asset, names: source }\n // The widget is gone or has turned read-only, or holds the asset of another pick by now: nothing is written.\n if (unmounted || readonly() || held.value !== of) return read\n if (asset.authors.length === 0) {\n of.asset = { ...asset, authors: of.asset.authors }\n return read\n }\n // Only into the image that asset was read for. The dialog may have closed meanwhile, or show another image: the\n // widget holds the asset on, and \"edit image\" of the image of that file reads it anew, and gives its empty\n // source the names. Dropped here, the asset was gone, and that source stayed empty.\n const image = imageOfHeld()\n if (isNull(image)) return read\n held.value = null\n giveNamesToEmptySource(image, source)\n return read\n } catch (e) {\n if (unmounted) return null\n showErrorsDefault(e)\n const image = held.value === of ? imageOfHeld() : null\n if (image) staleIn.value = image\n return null\n }\n }\n\n // The read of an asset whose detail has closed last, while it is on its way: \"confirm\" of the dialog waits for it,\n // and \"edit image\" takes what it reads.\n let detailAssetRead: Promise<DetailAssetRead | null> | null = null\n // The reads of assets whose detail has closed, those of one asset in a row, by that asset. A read of another asset\n // does not wait for them: it waited for the save of the detail of the asset the widget held before, and its read.\n const detailAssetReads = new Map<DocId, Promise<DetailAssetRead | null>>()\n // The confirm that waits for it, while one does.\n let waitingConfirm: symbol | null = null\n const confirmWaits = ref(false)\n const dropWaitingConfirm = () => {\n waitingConfirm = null\n confirmWaits.value = false\n }\n // A confirm is for the opening of the dialog it was pressed in. Once the dialog has closed, or shows an image anew,\n // the one that waits is dropped: the read may answer when the dialog has been opened again, and that opening would\n // be confirmed, and its image saved, without a press.\n watch(\n shownImage,\n (image) => {\n dropWaitingConfirm()\n if (image !== staleIn.value) staleIn.value = null\n },\n { flush: 'sync' }\n )\n\n /**\n * \"Confirm\" of the dialog, pressed while the asset of a detail that has just closed is still being read. What the\n * dialog offers may change by that read, and with it what its form asks for: the confirm waits for the read (`true`:\n * nothing more is taken of this press), and `again` has the form take it anew once the read has answered. Pressed\n * again meanwhile, or while a save runs (`saving`), it is not taken a second time. The wait has one time limit\n * (`withinWaitLimit`), the time of the requests of the read one after another (the save of the detail, the asset, the\n * licence, the names of its authors), each as long as the time the application gives one: a DAM slow but answering\n * does not run it out. Once it runs out the press is not taken, the button stops spinning, and the user is told the\n * request timed out. A press after that waits again, while the read is still on its way. A read that fails drops the\n * press as well, the failure said by the read: the dialog shows the source in place of the pick by then, and taken\n * again the press saved the image with that source, without the authors picked when it was pressed.\n */\n const holdConfirmForDetailAssetRead = (saving: boolean, again: () => void) => {\n const read = detailAssetRead\n if (isNull(read)) return false\n if (saving || !isNull(waitingConfirm)) return true\n const waiting = (waitingConfirm = Symbol('confirm'))\n confirmWaits.value = true\n void withinWaitLimit(read, REQUESTS_OF_A_DETAIL_ASSET_READ, configName).then((answer) => {\n if (waitingConfirm !== waiting) return\n dropWaitingConfirm()\n if (answer === WAIT_RAN_OUT) {\n if (!unmounted) showErrorT('error.apiTimedOut.message')\n return\n }\n if (isNull(answer)) return\n again()\n })\n return true\n }\n\n /**\n * `shown`: the asset the detail showed; none when it closed from its loader, or by itself after a read that failed.\n * Nothing is read unless the dialog offers the authors of the asset. What the read goes by is noted here, before\n * anything is awaited.\n */\n const onAssetDetailClose = (shown: AssetDetailItemDto | null) => {\n const of = held.value\n if (isNull(shown) || isNull(of) || isNull(imageOfHeld()) || readonly()) return\n const assetId = of.asset.id\n const detailSave = assetDetailStore.savingOf(assetId, configName)\n const pageExtSystem = cachedExtSystemId.value\n const read = (detailAssetReads.get(assetId) ?? Promise.resolve()).then(() =>\n takeAuthorsOfDetailAsset(of, detailSave, pageExtSystem)\n )\n detailAssetReads.set(assetId, read)\n detailAssetRead = read\n void read.then(() => {\n if (detailAssetReads.get(assetId) === read) detailAssetReads.delete(assetId)\n if (detailAssetRead === read) detailAssetRead = null\n })\n }\n\n /**\n * \"Edit image\" of the image of `file`, the one the held asset was read for. That asset is as it was at its pick, and\n * may have been given authors elsewhere since: the dialog offered a pick of them all the same, and its confirm wrote\n * that pick over them. So it is read anew first. Pressed while a read of it after a detail that has just closed is\n * on its way, that read is the newer answer, and serves here too: the asset was read twice in a row. Read anew where\n * it failed. What is read for is noted here, at the press: that read may drop the held asset. `null` where nothing\n * is to be read: no asset held for that file, or a widget that is read-only.\n */\n const readHeldAnew = (file: DocId | undefined): Promise<HeldAssetAnew> | null => {\n const of = held.value\n if (isNull(of) || of.file !== file || readonly()) return null\n const pageExtSystem = cachedExtSystemId.value\n return (detailAssetRead ?? Promise.resolve(null)).then(async (afterDetail) => {\n if (afterDetail?.of === of) return afterDetail\n try {\n const asset = await fetchAsset(damClient, endPointAsset, of.asset.id)\n return { of, asset, names: asset.authors.length > 0 ? await namesOf(asset, pageExtSystem) : '' }\n } catch (failure) {\n return { of, failure }\n }\n })\n }\n\n /**\n * What `readHeldAnew` found, into the image the dialog shows, once it shows the image of that file. Without authors\n * the held asset is the one read now: the pick starts from what the DAM has, and authors picked in a dialog closed\n * without a confirm do not come back. With authors the pick goes, and an empty source takes their names\n * (`giveNamesToEmptySource`). Those names are the dialog's: closed without a confirm, it does not offer them again,\n * nothing being held then. A failed read is said once, and the dialog shows the source of the image in place of the\n * pick, till it shows an image anew: the widget holds the asset on, and the next \"edit image\" reads it again.\n */\n const takeHeldAnew = (anew: HeldAssetAnew | null, image: ImageCreateUpdateAware | null) => {\n if (isNull(anew) || unmounted || readonly()) return\n if (isNull(image) || image.dam.damId !== anew.of.file) return\n if ('failure' in anew) {\n if (!showErrorsDefault(anew.failure)) showUnknownError()\n if (held.value === anew.of) staleIn.value = image\n return\n }\n if (anew.asset.authors.length === 0) {\n if (held.value === anew.of) anew.of.asset = anew.asset\n return\n }\n if (held.value === anew.of) held.value = null\n giveNamesToEmptySource(image, anew.names)\n }\n\n /**\n * At a confirm of `image`, the image the dialog shows: what lets the asset the widget holds for the file of that image\n * go once the image has been saved, when the dialog showed its source in place of the pick (a read of the asset had\n * failed). The image has a source of its own by then. Held on, the next \"edit image\" read the asset again and showed\n * the pick in place of that source, and a pick and a confirm replaced it. Nothing to let go otherwise.\n */\n const letGoOnceSavedWithSource = (image: ImageCreateUpdateAware) => {\n const of = held.value\n if (isNull(of) || of.file !== image.dam.damId || !isNull(damAuthorsAsset.value)) return () => undefined\n return () => {\n if (held.value === of) held.value = null\n }\n }\n\n /**\n * Read right before the authors picked in the dialog are written into `asset`: the names of the authors it has been\n * given elsewhere meanwhile, `null` while it has none. Throws where the asset or those names cannot be read. Only\n * the DAM could make this read and the write one step: an author given between the two is still written over.\n */\n const authorsGivenMeanwhile = async (asset: AssetDetailItemDto) => {\n const pageExtSystem = cachedExtSystemId.value\n const read = await fetchAsset(damClient, endPointAsset, asset.id)\n return read.authors.length > 0 ? namesOf(read, pageExtSystem) : null\n }\n\n return {\n damAuthorsAsset,\n offerDamAuthorsOf,\n offerNoDamAuthors,\n pickDamAuthors,\n onAssetDetailClose,\n holdConfirmForDetailAssetRead,\n readHeldAnew,\n takeHeldAnew,\n letGoOnceSavedWithSource,\n authorsGivenMeanwhile,\n /** Whether a confirm waits for the read of the asset of a detail that has just closed: its button spins. */\n confirmWaits,\n }\n}\n"],"mappings":";;;;;;;;;;;AA8BA,IA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SAAS8B,GAAS;KAChB,OAAO;MAAE;MAAI;KAAQ;IACvB;GACF,CAAC;EACH;EA2DE,eAjDoB,GAA4B,MAAyC;GACzF,AAAI3C,EAAO4C,CAAI,KAAK/C,KAAa2B,EAAS,KACtCxB,EAAOhB,CAAK,KAAKA,EAAM,IAAI,UAAU4D,EAAK,GAAG,SAC7C,aAAaA,KACVC,EAAkBD,EAAK,OAAO,KAAGE,EAAiB,GACnDnD,EAAK,UAAUiD,EAAK,OAAI,EAAQ,QAAQ5D,MAG1C4D,EAAK,MAAM,QAAQ,WAAW,IAC5BjD,EAAK,UAAUiD,EAAK,OAAI,EAAK,GAAG,QAAQA,EAAK,UAG/CjD,EAAK,UAAUiD,EAAK,OAAI,EAAK,QAAQ,OACzC7D,EAAuBC,GAAO4D,EAAK,KAAK;EAC1C;EAoCE,2BA5BgC,MAAkC;GAClE,IAAMvB,IAAK1B,EAAK;GAEhB,OADIK,EAAOqB,CAAE,KAAKA,EAAG,SAASrC,EAAM,IAAI,SAAS,CAACgB,EAAOG,EAAgB,KAAK,UAAgB,KAAA,UACjF;IACX,AAAIR,EAAK,UAAU0B,MAAI,EAAK,QAAQ;GACtC;EACF;EAuBE,8BAhBmC,MAA8B;GACjE,IAAMR,IAAgBoB,EAAkB,OAClCV,IAAO,MAAMJ,EAAW7B,GAAW8B,GAAeZ,EAAM,EAAE;GAChE,OAAOe,EAAK,QAAQ,SAAS,IAAIb,EAAQa,GAAMV,CAAa,IAAI;EAClE;EAcE;CACF;AACF"}
1
+ {"version":3,"file":"imageDialogDamAuthors.js","names":["REQUESTS_OF_A_DETAIL_ASSET_READ","giveNamesToEmptySource","image","names","useImageDialogDamAuthors","useCommonAdminCoreDamOptions","configName","useDamConfigState","damClient","useExtSystemIdForCached","assetDetailStore","useAssetDetailStore","useAlerts","held","ref","unmounted","imageOfHeld","shownImage","isNull","staleIn","shallowRef","damAuthorsAsset","computed","offerDamAuthorsOf","offerNoDamAuthors","pickDamAuthors","asset","authors","namesOf","extSystem","getExtSystemByLicence","pageExtSystem","fetchAuthorListByIds","endPointAuthor","author","takeAuthorsOfDetailAsset","detailSave","fetchAsset","endPointAsset","of","source","read","readonly","detailAssetRead","detailAssetReads","waitingConfirm","confirmWaits","dropWaitingConfirm","watch","shown","assetId","cachedExtSystemId","saving","waiting","withinWaitLimit","answer","WAIT_RAN_OUT","showErrorT","again","file","afterDetail","failure","anew","showErrorsDefault","showUnknownError"],"sources":["../../../../../src/domains/dam/imageWidget/composables/imageDialogDamAuthors.ts"],"sourcesContent":["import { computed, onBeforeUnmount, ref, shallowRef, watch } from 'vue'\nimport { fetchAsset } from '@/domains/dam/api/damAssetApi'\nimport { useAssetDetailStore } from '@/domains/dam/assetDetail/store/assetDetailStore'\nimport { fetchAuthorListByIds } from '@/domains/dam/author/api/authorApi'\nimport { useCommonAdminCoreDamOptions } from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport { useExtSystemIdForCached } from '@/domains/dam/composables/extSystemIdForCached'\nimport { useDamConfigState } from '@/domains/dam/config/composables/damConfigState'\nimport type { AssetDetailItemDto } from '@/domains/dam/types/Asset'\nimport type { ImageCreateUpdateAware } from '@/domains/dam/types/ImageAware'\nimport { useAlerts } from '@/domains/system/composables/alerts'\nimport type { DocId, IntegerId } from '@/shared/types/common'\nimport { isNull } from '@/shared/utils/common'\nimport { WAIT_RAN_OUT, withinWaitLimit } from '@/domains/dam/imageWidget/utils/waitLimit'\n\ninterface HeldAsset {\n asset: AssetDetailItemDto\n /** The file the asset was read for, i.e. the file of the image made from that pick. */\n file: DocId\n}\n\n/** Result of re-reading the held asset: the asset with its author names, or the failure. */\nexport type HeldAssetAnew =\n | { of: HeldAsset; asset: AssetDetailItemDto; names: string }\n | { of: HeldAsset; failure: unknown }\n\n/** Result of reading a held asset after its detail closed. */\ntype DetailAssetRead = { of: HeldAsset; asset: AssetDetailItemDto; names: string }\n\n// Sequential requests of a read after a detail closes: the rest of the detail save, the asset,\n// the asset licence (once per page), and the author names.\nconst REQUESTS_OF_A_DETAIL_ASSET_READ = 4\n\n/**\n * Fills an empty source with the authors' names once the held asset turns out to have authors.\n * The pick creates the image with an empty source, and the dialog hides the source while it offers the pick.\n * So an empty or whitespace-only source belongs to the pick. A non-empty source came from a save elsewhere and stays.\n */\nexport const giveNamesToEmptySource = (image: ImageCreateUpdateAware, names: string) => {\n if (image.texts.source.trim().length === 0) image.texts.source = names\n}\n\n/**\n * DAM authors the single-image widget dialog offers in place of a source, for a library-picked asset that has none.\n * The widget holds the asset and the file it was read for, and offers its authors only in that file's image dialog.\n * Do not use the asset detail store: it is shared per page by the picker,\n * detail and other widgets, which caused wrong authors to be saved.\n * `shownImage`: the image the widget dialog shows, or none.\n */\nexport function useImageDialogDamAuthors(\n configName: string,\n shownImage: () => ImageCreateUpdateAware | null,\n readonly: () => boolean\n) {\n const { damClient, endPointAsset, endPointAuthor } = useCommonAdminCoreDamOptions(configName)\n const { getExtSystemByLicence } = useDamConfigState(damClient, configName)\n const { cachedExtSystemId } = useExtSystemIdForCached(configName)\n const assetDetailStore = useAssetDetailStore()\n const { showErrorsDefault, showErrorT, showUnknownError } = useAlerts()\n\n const held = ref<HeldAsset | null>(null)\n // A read may end once the widget is gone.\n let unmounted = false\n onBeforeUnmount(() => {\n unmounted = true\n })\n\n /** The image the dialog shows, when it is the one the held asset was read for. */\n const imageOfHeld = () => {\n const image = shownImage()\n return !isNull(held.value) && !isNull(image) && image.dam.damId === held.value.file ? image : null\n }\n\n // The shown image after a read of the held asset for it failed. The held asset may then be stale.\n // The dialog shows the image source instead of the pick until it shows an image again.\n // Otherwise it kept offering the stale pick, and its confirm wrote nothing only after the user had picked.\n const staleIn = shallowRef<ImageCreateUpdateAware | null>(null)\n\n /**\n * The asset whose authors the dialog offers.\n * Null unless the dialog shows the image the asset was read for and the last read for that image has not failed.\n */\n const damAuthorsAsset = computed(() => {\n if (isNull(held.value)) return null\n const image = imageOfHeld()\n return isNull(image) || image === staleIn.value ? null : held.value.asset\n })\n\n const offerDamAuthorsOf = (asset: AssetDetailItemDto, file: DocId) => {\n held.value = { asset, file }\n }\n\n const offerNoDamAuthors = () => {\n held.value = null\n }\n\n const pickDamAuthors = (authors: DocId[]) => {\n const asset = damAuthorsAsset.value\n if (asset) asset.authors = authors\n }\n\n /**\n * Author names resolve under the ext system of the asset licence.\n * Falls back to `pageExtSystem` when the licence has none.\n */\n const namesOf = async (asset: AssetDetailItemDto, pageExtSystem: IntegerId) => {\n const extSystem = (await getExtSystemByLicence(asset.licence)) ?? pageExtSystem\n const authorsRes = await fetchAuthorListByIds(damClient, endPointAuthor, extSystem, asset.authors)\n return authorsRes.map((author) => author.name).join(', ')\n }\n\n /**\n * The \"edit asset\" detail may have added authors, so the asset is read again.\n * The read waits for the detail save that was pending on close. An earlier read returns the old asset.\n * If the asset now has authors, the author pick is dropped and an\n * empty image source takes their names. An existing source stays.\n * `pageExtSystem` is the ext system configured when the detail closed. It is used when the licence gives none.\n */\n const takeAuthorsOfDetailAsset = async (\n of: HeldAsset,\n detailSave: Promise<void> | null,\n pageExtSystem: IntegerId\n ): Promise<DetailAssetRead | null> => {\n try {\n await detailSave\n const asset = await fetchAsset(damClient, endPointAsset, of.asset.id)\n const source = asset.authors.length > 0 ? await namesOf(asset, pageExtSystem) : ''\n const read = { of, asset, names: source }\n // Unmounted, turned read-only, or now holding another pick's asset: write nothing.\n if (unmounted || readonly() || held.value !== of) return read\n if (asset.authors.length === 0) {\n of.asset = { ...asset, authors: of.asset.authors }\n return read\n }\n // Write only into the image the asset was read for. The dialog may have closed or show another image.\n // The widget keeps holding the asset, so \"edit image\" of that file re-reads\n // it and fills the empty source. Dropping it here left that source empty.\n const image = imageOfHeld()\n if (isNull(image)) return read\n held.value = null\n giveNamesToEmptySource(image, source)\n return read\n } catch (e) {\n if (unmounted) return null\n showErrorsDefault(e)\n const image = held.value === of ? imageOfHeld() : null\n if (image) staleIn.value = image\n return null\n }\n }\n\n // The latest pending read of an asset whose detail closed. \"Confirm\" waits for it, and \"edit image\" uses its result.\n let detailAssetRead: Promise<DetailAssetRead | null> | null = null\n // Pending detail-close reads, chained per asset. A read of another asset does not wait for them.\n const detailAssetReads = new Map<DocId, Promise<DetailAssetRead | null>>()\n // The confirm currently waiting for that read, if any.\n let waitingConfirm: symbol | null = null\n const confirmWaits = ref(false)\n const dropWaitingConfirm = () => {\n waitingConfirm = null\n confirmWaits.value = false\n }\n // A confirm belongs to the dialog opening it was pressed in. Drop it when the dialog closes or shows a new image.\n // Otherwise the read could answer after a reopen and confirm and save that opening without a press.\n watch(\n shownImage,\n (image) => {\n dropWaitingConfirm()\n if (image !== staleIn.value) staleIn.value = null\n },\n { flush: 'sync' }\n )\n\n /**\n * \"Confirm\" pressed while a just-closed detail's asset is still read. The read may change what\n * the form asks for, so the confirm waits (`true`) and `again` re-runs it after the read.\n * Repeated presses, or presses while `saving`, are ignored.\n * The wait is limited by `withinWaitLimit` over the read's sequential requests, so a slow\n * but answering DAM does not time out. On timeout the press is dropped and the user is told.\n * A failed read also drops the press. Otherwise it saved the image with the shown source, without the picked authors.\n */\n const holdConfirmForDetailAssetRead = (saving: boolean, again: () => void) => {\n const read = detailAssetRead\n if (isNull(read)) return false\n if (saving || !isNull(waitingConfirm)) return true\n const waiting = (waitingConfirm = Symbol('confirm'))\n confirmWaits.value = true\n void withinWaitLimit(read, REQUESTS_OF_A_DETAIL_ASSET_READ, configName).then((answer) => {\n if (waitingConfirm !== waiting) return\n dropWaitingConfirm()\n if (answer === WAIT_RAN_OUT) {\n if (!unmounted) showErrorT('error.apiTimedOut.message')\n return\n }\n if (isNull(answer)) return\n again()\n })\n return true\n }\n\n /**\n * `shown`: the asset the detail showed; none if it closed from its loader or after a failed read.\n * Reads only if the dialog offers this asset's authors. The read's inputs are captured before any await.\n */\n const onAssetDetailClose = (shown: AssetDetailItemDto | null) => {\n const of = held.value\n if (isNull(shown) || isNull(of) || isNull(imageOfHeld()) || readonly()) return\n const assetId = of.asset.id\n const detailSave = assetDetailStore.savingOf(assetId, configName)\n const pageExtSystem = cachedExtSystemId.value\n const read = (detailAssetReads.get(assetId) ?? Promise.resolve()).then(() =>\n takeAuthorsOfDetailAsset(of, detailSave, pageExtSystem)\n )\n detailAssetReads.set(assetId, read)\n detailAssetRead = read\n void read.then(() => {\n if (detailAssetReads.get(assetId) === read) detailAssetReads.delete(assetId)\n if (detailAssetRead === read) detailAssetRead = null\n })\n }\n\n /**\n * \"Edit image\" of `file`. The held asset is as it was at pick time and may have\n * gained authors since; confirming would overwrite them, so it is re-read first.\n * A pending detail-close read is newer and is reused. A failed one is retried.\n * Inputs are captured at the press because the read may drop the held asset.\n * Returns `null` if no asset is held for that file or the widget is read-only.\n */\n const readHeldAnew = (file: DocId | undefined): Promise<HeldAssetAnew> | null => {\n const of = held.value\n if (isNull(of) || of.file !== file || readonly()) return null\n const pageExtSystem = cachedExtSystemId.value\n return (detailAssetRead ?? Promise.resolve(null)).then(async (afterDetail) => {\n if (afterDetail?.of === of) return afterDetail\n try {\n const asset = await fetchAsset(damClient, endPointAsset, of.asset.id)\n return { of, asset, names: asset.authors.length > 0 ? await namesOf(asset, pageExtSystem) : '' }\n } catch (failure) {\n return { of, failure }\n }\n })\n }\n\n /**\n * Applies a `readHeldAnew` result to the shown image of that file.\n * Without authors the fresh asset becomes the held one, so picks from a dialog closed without confirm do not return.\n * With authors the pick goes and an empty source takes their names (`giveNamesToEmptySource`).\n * A failed read is reported once and the dialog shows the source until\n * a new image is shown. The asset stays held for the next \"edit image\".\n */\n const takeHeldAnew = (anew: HeldAssetAnew | null, image: ImageCreateUpdateAware | null) => {\n if (isNull(anew) || unmounted || readonly()) return\n if (isNull(image) || image.dam.damId !== anew.of.file) return\n if ('failure' in anew) {\n if (!showErrorsDefault(anew.failure)) showUnknownError()\n if (held.value === anew.of) staleIn.value = image\n return\n }\n if (anew.asset.authors.length === 0) {\n if (held.value === anew.of) anew.of.asset = anew.asset\n return\n }\n if (held.value === anew.of) held.value = null\n giveNamesToEmptySource(image, anew.names)\n }\n\n /**\n * On confirm of `image`: release the held asset after save if the dialog showed the source because a read failed.\n * Otherwise the next \"edit image\" re-read the asset, showed the pick again, and a confirm replaced the user's source.\n */\n const letGoOnceSavedWithSource = (image: ImageCreateUpdateAware) => {\n const of = held.value\n if (isNull(of) || of.file !== image.dam.damId || !isNull(damAuthorsAsset.value)) return () => undefined\n return () => {\n if (held.value === of) held.value = null\n }\n }\n\n /**\n * Read right before picked authors are written into `asset`. Returns names of authors\n * given elsewhere meanwhile, or `null` if none. Throws if they cannot be read.\n * Not atomic: an author added between this read and the write is still overwritten.\n */\n const authorsGivenMeanwhile = async (asset: AssetDetailItemDto) => {\n const pageExtSystem = cachedExtSystemId.value\n const read = await fetchAsset(damClient, endPointAsset, asset.id)\n return read.authors.length > 0 ? namesOf(read, pageExtSystem) : null\n }\n\n return {\n damAuthorsAsset,\n offerDamAuthorsOf,\n offerNoDamAuthors,\n pickDamAuthors,\n onAssetDetailClose,\n holdConfirmForDetailAssetRead,\n readHeldAnew,\n takeHeldAnew,\n letGoOnceSavedWithSource,\n authorsGivenMeanwhile,\n /** A confirm waits for the read of a just-closed detail's asset. Its button spins. */\n confirmWaits,\n }\n}\n"],"mappings":";;;;;;;;;;;AA8BA,IAAMA,IAAkC,GAO3BC,KAA0B,GAA+B,MAAkB;CACtF,AAAIC,EAAM,MAAM,OAAO,KAAK,CAAC,CAAC,WAAW,MAAG,EAAM,MAAM,SAASC;AACnE;AASA,SAAgBC,EACd,GACA,GACA,GACA;CACA,IAAM,EAAE,cAAW,kBAAe,sBAAmBC,EAA6BC,CAAU,GACtF,EAAE,6BAA0BC,EAAkBC,GAAWF,CAAU,GACnE,EAAE,yBAAsBG,EAAwBH,CAAU,GAC1DI,IAAmBC,EAAoB,GACvC,EAAE,sBAAmB,eAAY,wBAAqBC,EAAU,GAEhEC,IAAOC,EAAsB,IAAI,GAEnCC,IAAY;CAChB,QAAsB;EACpB,IAAY;CACd,CAAC;CAGD,IAAMC,UAAoB;EACxB,IAAMd,I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,GAAO4D,EAAK,KAAK;EAC1C;EAkCE,2BA5BgC,MAAkC;GAClE,IAAMvB,IAAK1B,EAAK;GAEhB,OADIK,EAAOqB,CAAE,KAAKA,EAAG,SAASrC,EAAM,IAAI,SAAS,CAACgB,EAAOG,EAAgB,KAAK,UAAgB,KAAA,UACjF;IACX,AAAIR,EAAK,UAAU0B,MAAI,EAAK,QAAQ;GACtC;EACF;EAuBE,8BAhBmC,MAA8B;GACjE,IAAMR,IAAgBoB,EAAkB,OAClCV,IAAO,MAAMJ,EAAW7B,GAAW8B,GAAeZ,EAAM,EAAE;GAChE,OAAOe,EAAK,QAAQ,SAAS,IAAIb,EAAQa,GAAMV,CAAa,IAAI;EAClE;EAcE;CACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"useImageMassOperations.js","names":["useImageMassOperations","imageStore","useImageStore","replaceEmptyDescription","items","item","forceReplace","isUndefined","value","replaceEmptySource","useCommonAdminCoreDamOptions","configName","useExtSystemIdForCached","damConfigStore","useDamConfigStoreOf","pageExtSystem","cachedExtSystemId","extSystemOf","licence","namesUnder","authorsRes","fetchAuthorListByIds","damClient","endPointAuthor","extSystem","authorNames","name","author","authorId","i","noAuthors","noSource"],"sources":["../../../../../src/domains/dam/imageWidget/composables/useImageMassOperations.ts"],"sourcesContent":["import { isUndefined } from '@/shared/utils/common'\nimport { useImageStore } from '@/domains/dam/imageWidget/store/imageStore'\nimport type { DocId, IntegerId } from '@/shared/types/common'\nimport { fetchAuthorListByIds } from '@/domains/dam/author/api/authorApi'\nimport { useCommonAdminCoreDamOptions } from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport { useExtSystemIdForCached } from '@/domains/dam/composables/extSystemIdForCached'\nimport { useDamConfigStoreOf } from '@/domains/dam/config/store/damConfigStore'\n\nexport function useImageMassOperations(configName: string) {\n const imageStore = useImageStore()\n\n const replaceEmptyDescription = (value: string, forceReplace = false) => {\n if (imageStore.readonly) return\n const items = imageStore.images\n for (let i = 0; i < items.length; i++) {\n const item = items[i]!\n if (forceReplace || isUndefined(item.texts.description) || item.texts.description.length === 0) {\n item.texts.description = value\n }\n }\n }\n\n const replaceEmptySource = (value: string, forceReplace = false) => {\n if (imageStore.readonly) return\n const items = imageStore.images\n for (let i = 0; i < items.length; i++) {\n const item = items[i]!\n if (forceReplace || isUndefined(item.texts.source) || item.texts.source.length === 0) {\n item.texts.source = value\n // A text the user gives, not the names of a pick of authors.\n imageStore.forgetSourceOfPick(item)\n }\n }\n }\n\n const { damClient, endPointAuthor } = useCommonAdminCoreDamOptions(configName)\n const { cachedExtSystemId } = useExtSystemIdForCached(configName)\n const damConfigStore = useDamConfigStoreOf(configName)\n\n const replaceEmptyAuthors = async (value: DocId[], forceReplace = false) => {\n if (imageStore.readonly) return\n // No authors picked fill nothing: written all the same, they would only take the source of the rows away.\n if (!forceReplace && value.length === 0) return\n // Their names under the ext system of the licence of the asset of each row, as every name of the authors of the\n // DAM the widgets write, and under the one the configuration asks for names under where the page does not know the\n // licence (not read for it): one lookup per ext system. That one went for every row.\n const pageExtSystem = cachedExtSystemId.value\n const extSystemOf = new Map<IntegerId, IntegerId>()\n imageStore.images.forEach((item) => {\n const licence = item.dam.licenceId\n extSystemOf.set(licence, damConfigStore.damConfigLicenceExtSystem.get(licence)?.extSystem ?? pageExtSystem)\n })\n const namesUnder = new Map<IntegerId, string>()\n await Promise.all(\n [...new Set([...extSystemOf.values(), pageExtSystem])].map(async (extSystem) => {\n const authorsRes = await fetchAuthorListByIds(damClient, endPointAuthor, extSystem, [...value])\n const authorNames: string[] = []\n value.forEach((authorId) => {\n const name = authorsRes.find((author) => author.id === authorId)?.name\n if (!isUndefined(name) && name.trim().length > 0) authorNames.push(name)\n })\n namesUnder.set(extSystem, authorNames.join(', '))\n })\n )\n // The widget may have turned read-only while the authors loaded.\n if (imageStore.readonly) return\n const items = imageStore.images\n for (let i = 0; i < items.length; i++) {\n const item = items[i]!\n const noAuthors = isUndefined(item.damAuthors) || item.damAuthors.length === 0\n // Of white space alone it is empty too, as the check of a required source takes it.\n const noSource = isUndefined(item.texts.source) || item.texts.source.trim().length === 0\n // A row that does not offer the authors shows its source: filled in, that source is the user's, and the names\n // of the picked authors are not written over it.\n if (forceReplace || (noAuthors && (item.showDamAuthors || noSource))) {\n item.damAuthors = value\n item.texts.source = namesUnder.get(extSystemOf.get(item.dam.licenceId) ?? pageExtSystem) ?? ''\n imageStore.noteSourceOfPick(item)\n }\n }\n }\n\n return {\n replaceEmptyDescription,\n replaceEmptySource,\n replaceEmptyAuthors,\n }\n}\n"],"mappings":";;;;;;;AAQA,SAAgBA,EAAuB,GAAoB;CACzD,IAAMC,IAAaC,EAAc,GAE3BC,KAA2B,GAAe,IAAe,OAAU;EACvE,IAAIF,EAAW,UAAU;EACzB,IAAMG,IAAQH,EAAW;EACzB,KAAK,IAAI,IAAI,GAAG,IAAIG,EAAM,QAAQ,KAAK;GACrC,IAAMC,IAAOD,EAAM;GACnB,CAAIE,KAAgBC,EAAYF,EAAK,MAAM,WAAW,KAAKA,EAAK,MAAM,YAAY,WAAW,OAC3F,EAAK,MAAM,cAAcG;EAE7B;CACF,GAEMC,KAAsB,GAAe,IAAe,OAAU;EAClE,IAAIR,EAAW,UAAU;EACzB,IAAMG,IAAQH,EAAW;EACzB,KAAK,IAAI,IAAI,GAAG,IAAIG,EAAM,QAAQ,KAAK;GACrC,IAAMC,IAAOD,EAAM;GACnB,CAAIE,KAAgBC,EAAYF,EAAK,MAAM,MAAM,KAAKA,EAAK,MAAM,OAAO,WAAW,OACjF,EAAK,MAAM,SAASG,GAEpBP,EAAW,mBAAmBI,CAAI;EAEtC;CACF,GAEM,EAAE,cAAW,sBAAmBK,EAA6BC,CAAU,GACvE,EAAE,yBAAsBC,EAAwBD,CAAU,GAC1DE,IAAiBC,EAAoBH,CAAU;CA6CrD,OAAO;EACL;EACA;EACA,4BA9CiC,GAAgB,IAAe,OAAU;GAG1E,IAFIV,EAAW,YAEX,CAACK,KAAgBE,EAAM,WAAW,GAAG;G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iBAAiBI,CAAI;GAEpC;EACF;CAMA;AACF"}
1
+ {"version":3,"file":"useImageMassOperations.js","names":["useImageMassOperations","imageStore","useImageStore","replaceEmptyDescription","items","item","forceReplace","isUndefined","value","replaceEmptySource","useCommonAdminCoreDamOptions","configName","useExtSystemIdForCached","damConfigStore","useDamConfigStoreOf","pageExtSystem","cachedExtSystemId","extSystemOf","licence","namesUnder","authorsRes","fetchAuthorListByIds","damClient","endPointAuthor","extSystem","authorNames","name","author","authorId","i","noAuthors","noSource"],"sources":["../../../../../src/domains/dam/imageWidget/composables/useImageMassOperations.ts"],"sourcesContent":["import { isUndefined } from '@/shared/utils/common'\nimport { useImageStore } from '@/domains/dam/imageWidget/store/imageStore'\nimport type { DocId, IntegerId } from '@/shared/types/common'\nimport { fetchAuthorListByIds } from '@/domains/dam/author/api/authorApi'\nimport { useCommonAdminCoreDamOptions } from '@/domains/dam/composables/commonAdminCoreDamOptions'\nimport { useExtSystemIdForCached } from '@/domains/dam/composables/extSystemIdForCached'\nimport { useDamConfigStoreOf } from '@/domains/dam/config/store/damConfigStore'\n\nexport function useImageMassOperations(configName: string) {\n const imageStore = useImageStore()\n\n const replaceEmptyDescription = (value: string, forceReplace = false) => {\n if (imageStore.readonly) return\n const items = imageStore.images\n for (let i = 0; i < items.length; i++) {\n const item = items[i]!\n if (forceReplace || isUndefined(item.texts.description) || item.texts.description.length === 0) {\n item.texts.description = value\n }\n }\n }\n\n const replaceEmptySource = (value: string, forceReplace = false) => {\n if (imageStore.readonly) return\n const items = imageStore.images\n for (let i = 0; i < items.length; i++) {\n const item = items[i]!\n if (forceReplace || isUndefined(item.texts.source) || item.texts.source.length === 0) {\n item.texts.source = value\n // The source is user-given text, not names from an author pick.\n imageStore.forgetSourceOfPick(item)\n }\n }\n }\n\n const { damClient, endPointAuthor } = useCommonAdminCoreDamOptions(configName)\n const { cachedExtSystemId } = useExtSystemIdForCached(configName)\n const damConfigStore = useDamConfigStoreOf(configName)\n\n const replaceEmptyAuthors = async (value: DocId[], forceReplace = false) => {\n if (imageStore.readonly) return\n // Empty picks fill nothing. Writing them would only clear the rows' sources.\n if (!forceReplace && value.length === 0) return\n // Names under the ext system of each row's asset licence, as everywhere else in the widgets.\n // Falls back to the configured ext system when the licence is unknown. One\n // lookup per ext system; the fallback was previously used for every row.\n const pageExtSystem = cachedExtSystemId.value\n const extSystemOf = new Map<IntegerId, IntegerId>()\n imageStore.images.forEach((item) => {\n const licence = item.dam.licenceId\n extSystemOf.set(licence, damConfigStore.damConfigLicenceExtSystem.get(licence)?.extSystem ?? pageExtSystem)\n })\n const namesUnder = new Map<IntegerId, string>()\n await Promise.all(\n [...new Set([...extSystemOf.values(), pageExtSystem])].map(async (extSystem) => {\n const authorsRes = await fetchAuthorListByIds(damClient, endPointAuthor, extSystem, [...value])\n const authorNames: string[] = []\n value.forEach((authorId) => {\n const name = authorsRes.find((author) => author.id === authorId)?.name\n if (!isUndefined(name) && name.trim().length > 0) authorNames.push(name)\n })\n namesUnder.set(extSystem, authorNames.join(', '))\n })\n )\n // The widget may have turned read-only while the authors loaded.\n if (imageStore.readonly) return\n const items = imageStore.images\n for (let i = 0; i < items.length; i++) {\n const item = items[i]!\n const noAuthors = isUndefined(item.damAuthors) || item.damAuthors.length === 0\n // Whitespace counts as empty, as in the required-source check.\n const noSource = isUndefined(item.texts.source) || item.texts.source.trim().length === 0\n // A row not offering the authors shows its source. A filled source is the user's and is not overwritten.\n if (forceReplace || (noAuthors && (item.showDamAuthors || noSource))) {\n item.damAuthors = value\n item.texts.source = namesUnder.get(extSystemOf.get(item.dam.licenceId) ?? pageExtSystem) ?? ''\n imageStore.noteSourceOfPick(item)\n }\n }\n }\n\n return {\n replaceEmptyDescription,\n replaceEmptySource,\n replaceEmptyAuthors,\n }\n}\n"],"mappings":";;;;;;;AAQA,SAAgBA,EAAuB,GAAoB;CACzD,IAAMC,IAAaC,EAAc,GAE3BC,KAA2B,GAAe,IAAe,OAAU;EACvE,IAAIF,EAAW,UAAU;EACz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iB,IAAwB,CAAC;IAK/B,AAJAjB,EAAM,SAAS,MAAa;KAC1B,IAAMkB,IAAON,EAAW,MAAM,MAAWO,EAAO,OAAOC,CAAQ,CAAC,EAAE;KAClE,AAAI,CAACrB,EAAYmB,CAAI,KAAKA,EAAK,KAAK,CAAC,CAAC,SAAS,KAAGD,EAAY,KAAKC,CAAI;IACzE,CAAC,GACDP,EAAW,IAAIK,GAAWC,EAAY,KAAK,IAAI,CAAC;GAClD,CAAC,CACH,GAEIxB,EAAW,UAAU;GACzB,IAAMG,IAAQH,EAAW;GACzB,KAAK,IAAI4B,IAAI,GAAGA,IAAIzB,EAAM,QAAQ,KAAK;IACrC,IAAMC,IAAOD,EAAMyB,IACbC,IAAYvB,EAAYF,EAAK,UAAU,KAAKA,EAAK,WAAW,WAAW,GAEvE0B,IAAWxB,EAAYF,EAAK,MAAM,MAAM,KAAKA,EAAK,MAAM,OAAO,KAAK,CAAC,CAAC,WAAW;IAEvF,CAAIC,KAAiBwB,MAAczB,EAAK,kBAAkB0B,QACxD,EAAK,aAAavB,GAClB,EAAK,MAAM,SAASW,EAAW,IAAIF,EAAY,IAAIZ,EAAK,IAAI,SAAS,KAAKU,CAAa,KAAK,IAC5Fd,EAAW,iBAAiBI,CAAI;GAEpC;EACF;CAMA;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"imageMediaWidgetStore.js","names":["isMediaAware","isNull","item","isImageCreateUpdateAware","useImageMediaWidgetStore","defineStore","detail","ref","shownBy","reset","resetUnlessShown","one","widget","setShownBy","shows","setDetail","data","cloneDeep"],"sources":["../../../../../src/domains/dam/imageWidget/store/imageMediaWidgetStore.ts"],"sourcesContent":["import { defineStore } from 'pinia'\nimport { ref } from 'vue'\nimport type { MediaAware } from '@/domains/dam/types/MediaAware'\nimport type { ImageCreateUpdateAware } from '@/domains/dam/types/ImageAware'\nimport { cloneDeep, isNull } from '@/shared/utils/common'\n\nexport const isMediaAware = (item: MediaAware | ImageCreateUpdateAware | null): item is MediaAware => {\n if (isNull(item)) return false\n return 'damMedia' in item\n}\n\nexport const isImageCreateUpdateAware = (\n item: MediaAware | ImageCreateUpdateAware | null\n): item is ImageCreateUpdateAware => {\n if (isNull(item)) return false\n return !('damMedia' in item) && 'texts' in item\n}\n\nexport const useImageMediaWidgetStore = defineStore('commonAdminImageMediaWidgetStore', () => {\n const detail = ref<MediaAware | ImageCreateUpdateAware | null>(null)\n // The widgets whose dialog shows the detail: an open image dialog, or the form `expandMetadata` draws in the page.\n const shownBy = new Set<symbol>()\n\n function reset() {\n detail.value = null\n }\n\n /** The detail is emptied unless the dialog of a widget other than `widget` shows it: its form would be lost. */\n function resetUnlessShown(widget?: symbol) {\n if ([...shownBy].some((one) => one !== widget)) return\n detail.value = null\n }\n\n /** Whether the dialog of `widget` shows the detail. */\n function setShownBy(widget: symbol, shows: boolean) {\n if (shows) shownBy.add(widget)\n else shownBy.delete(widget)\n }\n\n function setDetail(data: ImageCreateUpdateAware | MediaAware | null) {\n if (isNull(data)) detail.value = null\n detail.value = cloneDeep(data)\n }\n\n return {\n setDetail,\n detail,\n reset,\n resetUnlessShown,\n setShownBy,\n }\n})\n"],"mappings":";;;;AAMA,IAAaA,KAAgB,MAC3B,CAAIC,EAAOC,CAAI,KACR,cAAcA,GAGVC,KACX,MAEA,CAAIF,EAAOC,CAAI,KACR,EAAE,cAAcA,MAAS,WAAWA,GAGhCE,IAA2BC,EAAY,0CAA0C;CAC5F,IAAMC,IAASC,EAAgD,IAAI,GAE7DC,oBAAU,IAAI,IAAY;CAEhC,SAASC,IAAQ;EACf,EAAO,QAAQ;CACjB;CAGA,SAASC,EAAiB,GAAiB;EACzC,AAAI,CAAC,GAAGF,CAAO,CAAC,CAAC,MAAM,MAAQG,MAAQC,CAAM,MAC7C,EAAO,QAAQ;CACjB;CAGA,SAASC,EAAW,GAAgB,GAAgB;EAClD,AAAIC,IAAON,EAAQ,IAAII,CAAM,IACxBJ,EAAQ,OAAOI,CAAM;CAC5B;CAEA,SAASG,EAAU,GAAkD;EAEnE,AADId,EAAOe,CAAI,MAAG,EAAO,QAAQ,OACjC,EAAO,QAAQC,EAAUD,CAAI;CAC/B;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;CACF;AACF,CAAC"}
1
+ {"version":3,"file":"imageMediaWidgetStore.js","names":["isMediaAware","isNull","item","isImageCreateUpdateAware","useImageMediaWidgetStore","defineStore","detail","ref","shownBy","reset","resetUnlessShown","one","widget","setShownBy","shows","setDetail","data","cloneDeep"],"sources":["../../../../../src/domains/dam/imageWidget/store/imageMediaWidgetStore.ts"],"sourcesContent":["import { defineStore } from 'pinia'\nimport { ref } from 'vue'\nimport type { MediaAware } from '@/domains/dam/types/MediaAware'\nimport type { ImageCreateUpdateAware } from '@/domains/dam/types/ImageAware'\nimport { cloneDeep, isNull } from '@/shared/utils/common'\n\nexport const isMediaAware = (item: MediaAware | ImageCreateUpdateAware | null): item is MediaAware => {\n if (isNull(item)) return false\n return 'damMedia' in item\n}\n\nexport const isImageCreateUpdateAware = (\n item: MediaAware | ImageCreateUpdateAware | null\n): item is ImageCreateUpdateAware => {\n if (isNull(item)) return false\n return !('damMedia' in item) && 'texts' in item\n}\n\nexport const useImageMediaWidgetStore = defineStore('commonAdminImageMediaWidgetStore', () => {\n const detail = ref<MediaAware | ImageCreateUpdateAware | null>(null)\n // Widgets whose dialog shows the detail: an open image dialog or the `expandMetadata` form in the page.\n const shownBy = new Set<symbol>()\n\n function reset() {\n detail.value = null\n }\n\n /** Empties the detail unless a widget other than `widget` shows it, since its form would be lost. */\n function resetUnlessShown(widget?: symbol) {\n if ([...shownBy].some((one) => one !== widget)) return\n detail.value = null\n }\n\n function setShownBy(widget: symbol, shows: boolean) {\n if (shows) shownBy.add(widget)\n else shownBy.delete(widget)\n }\n\n function setDetail(data: ImageCreateUpdateAware | MediaAware | null) {\n if (isNull(data)) detail.value = null\n detail.value = cloneDeep(data)\n }\n\n return {\n setDetail,\n detail,\n reset,\n resetUnlessShown,\n setShownBy,\n }\n})\n"],"mappings":";;;;AAMA,IAAaA,KAAgB,MAC3B,CAAIC,EAAOC,CAAI,KACR,cAAcA,GAGVC,KACX,MAEA,CAAIF,EAAOC,CAAI,KACR,EAAE,cAAcA,MAAS,WAAWA,GAGhCE,IAA2BC,EAAY,0CAA0C;CAC5F,IAAMC,IAASC,EAAgD,IAAI,GAE7DC,oBAAU,IAAI,IAAY;CAEhC,SAASC,IAAQ;EACf,EAAO,QAAQ;CACjB;CAGA,SAASC,EAAiB,GAAiB;EACzC,AAAI,CAAC,GAAGF,CAAO,CAAC,CAAC,MAAM,MAAQG,MAAQC,CAAM,MAC7C,EAAO,QAAQ;CACjB;CAEA,SAASC,EAAW,GAAgB,GAAgB;EAClD,AAAIC,IAAON,EAAQ,IAAII,CAAM,IACxBJ,EAAQ,OAAOI,CAAM;CAC5B;CAEA,SAASG,EAAU,GAAkD;EAEnE,AADId,EAAOe,CAAI,MAAG,EAAO,QAAQ,OACjC,EAAO,QAAQC,EAAUD,CAAI;CAC/B;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;CACF;AACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"imageStore.js","names":["useImageStore","defineStore","images","ref","maxPosition","readonly","sourcesOfPicks","setImages","keys","data","item","key","addImages","updateMaxPositionIfGreater","newPosition","removeImageByIndex","removed","index","noteSourceOfPick","forgetSourceOfPick","hasSourceOfPick","reset"],"sources":["../../../../../src/domains/dam/imageWidget/store/imageStore.ts"],"sourcesContent":["import { defineStore } from 'pinia'\nimport { ref } from 'vue'\nimport type { ImageStoreItem } from '@/domains/dam/types/ImageAware'\n\nexport const useImageStore = defineStore('commonAdminImageStore', () => {\n const images = ref<ImageStoreItem[]>([])\n const maxPosition = ref(0)\n // Set by the widget: a read-only one saves nothing, so the mass operations must not change what it shows.\n const readonly = ref(false)\n // The source a pick of authors wrote into a row, by the key of the row: \"fill empty\" of the mass operations writes\n // their names into the source of a row that offers the authors of the DAM, which does not show it. Once the asset of\n // the row turns out to have authors, the widget gives such a source their names, and leaves one of the image's own.\n // Anything else that writes the source of the row takes the mark away: the source is no pick's from then on, also\n // when its text is the same. A row that goes takes its mark with it.\n const sourcesOfPicks = new Map<string, string>()\n\n function setImages(data: ImageStoreItem[]) {\n const keys = new Set(data.map((item) => item.key))\n for (const key of sourcesOfPicks.keys()) {\n if (!keys.has(key)) sourcesOfPicks.delete(key)\n }\n images.value = data\n }\n\n function addImages(data: ImageStoreItem[]) {\n images.value.push(...data)\n }\n\n function updateMaxPositionIfGreater(newPosition: number) {\n if (newPosition > maxPosition.value) {\n maxPosition.value = newPosition\n }\n }\n\n function removeImageByIndex(index: number) {\n const [removed] = images.value.splice(index, 1)\n if (removed) sourcesOfPicks.delete(removed.key)\n }\n\n /** A pick of authors has written their names into the source of the row. */\n function noteSourceOfPick(item: ImageStoreItem) {\n sourcesOfPicks.set(item.key, item.texts.source)\n }\n\n /** Something else than a pick of authors has written the source of the row. */\n function forgetSourceOfPick(item: ImageStoreItem) {\n sourcesOfPicks.delete(item.key)\n }\n\n /** Whether the row still has the source a pick of authors wrote into it. */\n function hasSourceOfPick(item: ImageStoreItem) {\n return sourcesOfPicks.get(item.key) === item.texts.source\n }\n\n function reset() {\n images.value = []\n maxPosition.value = 0\n readonly.value = false\n sourcesOfPicks.clear()\n }\n\n return {\n images,\n maxPosition,\n readonly,\n setImages,\n addImages,\n updateMaxPositionIfGreater,\n removeImageByIndex,\n noteSourceOfPick,\n forgetSourceOfPick,\n hasSourceOfPick,\n reset,\n }\n})\n"],"mappings":";;;AAIA,IAAaA,IAAgBC,EAAY,+BAA+B;CACtE,IAAMC,IAASC,EAAsB,CAAC,CAAC,GACjCC,IAAcD,EAAI,CAAC,GAEnBE,IAAWF,EAAI,EAAK,GAMpBG,oBAAiB,IAAI,IAAoB;CAE/C,SAASC,EAAU,GAAwB;EACzC,IAAMC,IAAO,IAAI,IAAIC,EAAK,KAAK,MAASC,EAAK,GAAG,CAAC;EACjD,KAAK,IAAMC,KAAOL,EAAe,KAAK,GACpC,AAAKE,EAAK,IAAIG,CAAG,KAAGL,EAAe,OAAOK,CAAG;EAE/C,EAAO,QAAQF;CACjB;CAEA,SAASG,EAAU,GAAwB;EACzC,EAAO,MAAM,KAAK,GAAGH,CAAI;CAC3B;CAEA,SAASI,EAA2B,GAAqB;EACvD,AAAIC,IAAcV,EAAY,UAC5B,EAAY,QAAQU;CAExB;CAEA,SAASC,EAAmB,GAAe;EACzC,IAAM,CAACC,KAAWd,EAAO,MAAM,OAAOe,GAAO,CAAC;EAC9C,AAAID,KAASV,EAAe,OAAOU,EAAQ,GAAG;CAChD;CAGA,SAASE,EAAiB,GAAsB;EAC9C,EAAe,IAAIR,EAAK,KAAKA,EAAK,MAAM,MAAM;CAChD;CAGA,SAASS,EAAmB,GAAsB;EAChD,EAAe,OAAOT,EAAK,GAAG;CAChC;CAGA,SAASU,EAAgB,GAAsB;EAC7C,OAAOd,EAAe,IAAII,EAAK,GAAG,MAAMA,EAAK,MAAM;CACrD;CAEA,SAASW,IAAQ;EAIf,AAHA,EAAO,QAAQ,CAAC,GAChB,EAAY,QAAQ,GACpB,EAAS,QAAQ,IACjBf,EAAe,MAAM;CACvB;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF,CAAC"}
1
+ {"version":3,"file":"imageStore.js","names":["useImageStore","defineStore","images","ref","maxPosition","readonly","sourcesOfPicks","setImages","keys","data","item","key","addImages","updateMaxPositionIfGreater","newPosition","removeImageByIndex","removed","index","noteSourceOfPick","forgetSourceOfPick","hasSourceOfPick","reset"],"sources":["../../../../../src/domains/dam/imageWidget/store/imageStore.ts"],"sourcesContent":["import { defineStore } from 'pinia'\nimport { ref } from 'vue'\nimport type { ImageStoreItem } from '@/domains/dam/types/ImageAware'\n\nexport const useImageStore = defineStore('commonAdminImageStore', () => {\n const images = ref<ImageStoreItem[]>([])\n const maxPosition = ref(0)\n // Set by the widget. A read-only widget saves nothing, so mass operations must not change what it shows.\n const readonly = ref(false)\n // Source written into a row by an author pick, by row key. \"Fill empty\"\n // writes names into the hidden source of rows offering DAM authors.\n // When the asset turns out to have authors, such a source gets their names; a user's own source stays.\n // Any other write to the source removes the mark, even with the same text. Removing a row removes its mark.\n const sourcesOfPicks = new Map<string, string>()\n\n function setImages(data: ImageStoreItem[]) {\n const keys = new Set(data.map((item) => item.key))\n for (const key of sourcesOfPicks.keys()) {\n if (!keys.has(key)) sourcesOfPicks.delete(key)\n }\n images.value = data\n }\n\n function addImages(data: ImageStoreItem[]) {\n images.value.push(...data)\n }\n\n function updateMaxPositionIfGreater(newPosition: number) {\n if (newPosition > maxPosition.value) {\n maxPosition.value = newPosition\n }\n }\n\n function removeImageByIndex(index: number) {\n const [removed] = images.value.splice(index, 1)\n if (removed) sourcesOfPicks.delete(removed.key)\n }\n\n function noteSourceOfPick(item: ImageStoreItem) {\n sourcesOfPicks.set(item.key, item.texts.source)\n }\n\n function forgetSourceOfPick(item: ImageStoreItem) {\n sourcesOfPicks.delete(item.key)\n }\n\n function hasSourceOfPick(item: ImageStoreItem) {\n return sourcesOfPicks.get(item.key) === item.texts.source\n }\n\n function reset() {\n images.value = []\n maxPosition.value = 0\n readonly.value = false\n sourcesOfPicks.clear()\n }\n\n return {\n images,\n maxPosition,\n readonly,\n setImages,\n addImages,\n updateMaxPositionIfGreater,\n removeImageByIndex,\n noteSourceOfPick,\n forgetSourceOfPick,\n hasSourceOfPick,\n reset,\n }\n})\n"],"mappings":";;;AAIA,IAAaA,IAAgBC,EAAY,+BAA+B;CACtE,IAAMC,IAASC,EAAsB,CAAC,CAAC,GACjCC,IAAcD,EAAI,CAAC,GAEnBE,IAAWF,EAAI,EAAK,GAKpBG,oBAAiB,IAAI,IAAoB;CAE/C,SAASC,EAAU,GAAwB;EACzC,IAAMC,IAAO,IAAI,IAAIC,EAAK,KAAK,MAASC,EAAK,GAAG,CAAC;EACjD,KAAK,IAAMC,KAAOL,EAAe,KAAK,GACpC,AAAKE,EAAK,IAAIG,CAAG,KAAGL,EAAe,OAAOK,CAAG;EAE/C,EAAO,QAAQF;CACjB;CAEA,SAASG,EAAU,GAAwB;EACzC,EAAO,MAAM,KAAK,GAAGH,CAAI;CAC3B;CAEA,SAASI,EAA2B,GAAqB;EACvD,AAAIC,IAAcV,EAAY,UAC5B,EAAY,QAAQU;CAExB;CAEA,SAASC,EAAmB,GAAe;EACzC,IAAM,CAACC,KAAWd,EAAO,MAAM,OAAOe,GAAO,CAAC;EAC9C,AAAID,KAASV,EAAe,OAAOU,EAAQ,GAAG;CAChD;CAEA,SAASE,EAAiB,GAAsB;EAC9C,EAAe,IAAIR,EAAK,KAAKA,EAAK,MAAM,MAAM;CAChD;CAEA,SAASS,EAAmB,GAAsB;EAChD,EAAe,OAAOT,EAAK,GAAG;CAChC;CAEA,SAASU,EAAgB,GAAsB;EAC7C,OAAOd,EAAe,IAAII,EAAK,GAAG,MAAMA,EAAK,MAAM;CACrD;CAEA,SAASW,IAAQ;EAIf,AAHA,EAAO,QAAQ,CAAC,GAChB,EAAY,QAAQ,GACpB,EAAS,QAAQ,IACjBf,EAAe,MAAM;CACvB;CAEA,OAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF;AACF,CAAC"}
@@ -3,13 +3,12 @@ import { DocId, IntegerId } from '../../../../shared/types/common';
3
3
  export interface DamImageFile {
4
4
  fileId: DocId;
5
5
  licenceId: IntegerId;
6
- /** `mainFileInternal` of the asset; false where it is not known. */
6
+ /** `mainFileInternal` of the asset; false if unknown. */
7
7
  internal?: boolean | null;
8
8
  }
9
9
  /**
10
- * The image of the CMS for a file of the DAM. `position` and `id` are keys of the image only where they are given,
11
- * 0 included: what a caller sends has the keys it had when it built the object by hand. A text is empty where the
12
- * caller names none, and otherwise as handed, whatever a mapping of the application made of it.
10
+ * CMS image for a DAM file. `position` and `id` are set only when given, including 0, to match hand-built objects.
11
+ * Texts are empty when not given, otherwise used as passed, regardless of application mappings.
13
12
  */
14
13
  export declare function createDamImage(file: DamImageFile, texts?: {
15
14
  description?: string;
@@ -20,7 +19,7 @@ export declare function createDamImage(file: DamImageFile, texts?: {
20
19
  id?: IntegerId;
21
20
  }): ImageCreateUpdateAware;
22
21
  /**
23
- * What the image API is sent of an image: its own fields. A widget carries more with it (the asset and the authors
24
- * an upload was mapped from, the key and the authors of a row of the gallery), which no backend reads.
22
+ * Only the image's own fields for the image API. Widget extras
23
+ * such as asset, authors and row key are not read by any backend.
25
24
  */
26
25
  export declare function imageFieldsOf(image: ImageCreateUpdateAware): ImageCreateUpdateAware;
@@ -1 +1 @@
1
- {"version":3,"file":"damImage.js","names":["createDamImage","image","texts","options","file","isUndefined","imageFieldsOf","fields"],"sources":["../../../../../src/domains/dam/imageWidget/utils/damImage.ts"],"sourcesContent":["import type { ImageCreateUpdateAware } from '@/domains/dam/types/ImageAware'\nimport type { DocId, IntegerId } from '@/shared/types/common'\nimport { isUndefined } from '@/shared/utils/common'\n\nexport interface DamImageFile {\n fileId: DocId\n licenceId: IntegerId\n /** `mainFileInternal` of the asset; false where it is not known. */\n internal?: boolean | null\n}\n\n/**\n * The image of the CMS for a file of the DAM. `position` and `id` are keys of the image only where they are given,\n * 0 included: what a caller sends has the keys it had when it built the object by hand. A text is empty where the\n * caller names none, and otherwise as handed, whatever a mapping of the application made of it.\n */\nexport function createDamImage(\n file: DamImageFile,\n texts: { description?: string; source?: string } = {},\n options: { showSource?: boolean; position?: number; id?: IntegerId } = {}\n): ImageCreateUpdateAware {\n const image: ImageCreateUpdateAware = {\n texts: { description: '', source: '', ...texts },\n flags: { showSource: options.showSource ?? true, internal: false, overrideInternal: false },\n dam: { damId: file.fileId, licenceId: file.licenceId, regionPosition: 0, internal: file.internal ?? false },\n }\n if (!isUndefined(options.position)) image.position = options.position\n if (!isUndefined(options.id)) image.id = options.id\n return image\n}\n\n/**\n * What the image API is sent of an image: its own fields. A widget carries more with it (the asset and the authors\n * an upload was mapped from, the key and the authors of a row of the gallery), which no backend reads.\n */\nexport function imageFieldsOf(image: ImageCreateUpdateAware): ImageCreateUpdateAware {\n const fields: ImageCreateUpdateAware = { texts: image.texts, flags: image.flags, dam: image.dam }\n if (!isUndefined(image.position)) fields.position = image.position\n if (!isUndefined(image.id)) fields.id = image.id\n return fields\n}\n"],"mappings":";;AAgBA,SAAgBA,EACd,GACA,IAAmD,CAAC,GACpD,IAAuE,CAAC,GAChD;CACxB,IAAMC,IAAgC;EACpC,OAAO;GAAE,aAAa;GAAI,QAAQ;GAAI,GAAGC;EAAM;EAC/C,OAAO;GAAE,YAAYC,EAAQ,cAAc;GAAM,UAAU;GAAO,kBAAkB;EAAM;EAC1F,KAAK;GAAE,OAAOC,EAAK;GAAQ,WAAWA,EAAK;GAAW,gBAAgB;GAAG,UAAUA,EAAK,YAAY;EAAM;CAC5G;CAGA,OAFKC,EAAYF,EAAQ,QAAQ,MAAG,EAAM,WAAWA,EAAQ,WACxDE,EAAYF,EAAQ,EAAE,MAAG,EAAM,KAAKA,EAAQ,KAC1CF;AACT;AAMA,SAAgBK,EAAc,GAAuD;CACnF,IAAMC,IAAiC;EAAE,OAAON,EAAM;EAAO,OAAOA,EAAM;EAAO,KAAKA,EAAM;CAAI;CAGhG,OAFKI,EAAYJ,EAAM,QAAQ,MAAG,EAAO,WAAWA,EAAM,WACrDI,EAAYJ,EAAM,EAAE,MAAG,EAAO,KAAKA,EAAM,KACvCM;AACT"}
1
+ {"version":3,"file":"damImage.js","names":["createDamImage","image","texts","options","file","isUndefined","imageFieldsOf","fields"],"sources":["../../../../../src/domains/dam/imageWidget/utils/damImage.ts"],"sourcesContent":["import type { ImageCreateUpdateAware } from '@/domains/dam/types/ImageAware'\nimport type { DocId, IntegerId } from '@/shared/types/common'\nimport { isUndefined } from '@/shared/utils/common'\n\nexport interface DamImageFile {\n fileId: DocId\n licenceId: IntegerId\n /** `mainFileInternal` of the asset; false if unknown. */\n internal?: boolean | null\n}\n\n/**\n * CMS image for a DAM file. `position` and `id` are set only when given, including 0, to match hand-built objects.\n * Texts are empty when not given, otherwise used as passed, regardless of application mappings.\n */\nexport function createDamImage(\n file: DamImageFile,\n texts: { description?: string; source?: string } = {},\n options: { showSource?: boolean; position?: number; id?: IntegerId } = {}\n): ImageCreateUpdateAware {\n const image: ImageCreateUpdateAware = {\n texts: { description: '', source: '', ...texts },\n flags: { showSource: options.showSource ?? true, internal: false, overrideInternal: false },\n dam: { damId: file.fileId, licenceId: file.licenceId, regionPosition: 0, internal: file.internal ?? false },\n }\n if (!isUndefined(options.position)) image.position = options.position\n if (!isUndefined(options.id)) image.id = options.id\n return image\n}\n\n/**\n * Only the image's own fields for the image API. Widget extras\n * such as asset, authors and row key are not read by any backend.\n */\nexport function imageFieldsOf(image: ImageCreateUpdateAware): ImageCreateUpdateAware {\n const fields: ImageCreateUpdateAware = { texts: image.texts, flags: image.flags, dam: image.dam }\n if (!isUndefined(image.position)) fields.position = image.position\n if (!isUndefined(image.id)) fields.id = image.id\n return fields\n}\n"],"mappings":";;AAeA,SAAgBA,EACd,GACA,IAAmD,CAAC,GACpD,IAAuE,CAAC,GAChD;CACxB,IAAMC,IAAgC;EACpC,OAAO;GAAE,aAAa;GAAI,QAAQ;GAAI,GAAGC;EAAM;EAC/C,OAAO;GAAE,YAAYC,EAAQ,cAAc;GAAM,UAAU;GAAO,kBAAkB;EAAM;EAC1F,KAAK;GAAE,OAAOC,EAAK;GAAQ,WAAWA,EAAK;GAAW,gBAAgB;GAAG,UAAUA,EAAK,YAAY;EAAM;CAC5G;CAGA,OAFKC,EAAYF,EAAQ,QAAQ,MAAG,EAAM,WAAWA,EAAQ,WACxDE,EAAYF,EAAQ,EAAE,MAAG,EAAM,KAAKA,EAAQ,KAC1CF;AACT;AAMA,SAAgBK,EAAc,GAAuD;CACnF,IAAMC,IAAiC;EAAE,OAAON,EAAM;EAAO,OAAOA,EAAM;EAAO,KAAKA,EAAM;CAAI;CAGhG,OAFKI,EAAYJ,EAAM,QAAQ,MAAG,EAAO,WAAWA,EAAM,WACrDI,EAAYJ,EAAM,EAAE,MAAG,EAAO,KAAKA,EAAM,KACvCM;AACT"}
@@ -1,5 +1,4 @@
1
1
  import { CollabFieldName, CollabRoom } from '../../../collab/types/Collab';
2
- /** A turn of the lock of the field is taken: its number. */
2
+ /** Takes a new lock turn for the field and returns its number. */
3
3
  export declare const takeFieldLockTurn: (room: CollabRoom, field: CollabFieldName) => number;
4
- /** The number of the last turn of the lock of the field. */
5
4
  export declare const lastFieldLockTurn: (room: CollabRoom, field: CollabFieldName) => number;
@@ -1 +1 @@
1
- {"version":3,"file":"fieldLockTurns.js","names":["turns","keyOf","room","field","takeFieldLockTurn","turn","lastFieldLockTurn"],"sources":["../../../../../src/domains/dam/imageWidget/utils/fieldLockTurns.ts"],"sourcesContent":["import type { CollabFieldName, CollabRoom } from '@/domains/collab/types/Collab'\n\n// The turns of the lock of a field of a collaboration room that the image widgets of the page take: each request for\n// the lock and each release, by any widget of that field. A widget drawn again elsewhere (the pin of a sidebar widget\n// in admin-cms) is a second widget of the same field, and the server takes the requests and the releases of both as\n// those of one editor: a release of either frees a lock the other holds.\nconst turns = new Map<string, number>()\n\nconst keyOf = (room: CollabRoom, field: CollabFieldName) => JSON.stringify([room, field])\n\n/** A turn of the lock of the field is taken: its number. */\nexport const takeFieldLockTurn = (room: CollabRoom, field: CollabFieldName) => {\n const turn = (turns.get(keyOf(room, field)) ?? 0) + 1\n turns.set(keyOf(room, field), turn)\n return turn\n}\n\n/** The number of the last turn of the lock of the field. */\nexport const lastFieldLockTurn = (room: CollabRoom, field: CollabFieldName) => turns.get(keyOf(room, field)) ?? 0\n"],"mappings":";AAMA,IAAMA,oBAAQ,IAAI,IAAoB,GAEhCC,KAAS,GAAkB,MAA2B,KAAK,UAAU,CAACC,GAAMC,CAAK,CAAC,GAG3EC,KAAqB,GAAkB,MAA2B;CAC7E,IAAMC,KAAQL,EAAM,IAAIC,EAAMC,GAAMC,CAAK,CAAC,KAAK,KAAK;CAEpD,OADAH,EAAM,IAAIC,EAAMC,GAAMC,CAAK,GAAGE,CAAI,GAC3BA;AACT,GAGaC,KAAqB,GAAkB,MAA2BN,EAAM,IAAIC,EAAMC,GAAMC,CAAK,CAAC,KAAK"}
1
+ {"version":3,"file":"fieldLockTurns.js","names":["turns","keyOf","room","field","takeFieldLockTurn","turn","lastFieldLockTurn"],"sources":["../../../../../src/domains/dam/imageWidget/utils/fieldLockTurns.ts"],"sourcesContent":["import type { CollabFieldName, CollabRoom } from '@/domains/collab/types/Collab'\n\n// Turn counter for collab field locks taken by image widgets: each request and release by any widget of that field.\n// A re-rendered widget (sidebar pin in admin-cms) is a second widget of the same field.\n// The server treats both as one editor, so either's release frees the other's lock.\nconst turns = new Map<string, number>()\n\nconst keyOf = (room: CollabRoom, field: CollabFieldName) => JSON.stringify([room, field])\n\n/** Takes a new lock turn for the field and returns its number. */\nexport const takeFieldLockTurn = (room: CollabRoom, field: CollabFieldName) => {\n const turn = (turns.get(keyOf(room, field)) ?? 0) + 1\n turns.set(keyOf(room, field), turn)\n return turn\n}\n\nexport const lastFieldLockTurn = (room: CollabRoom, field: CollabFieldName) => turns.get(keyOf(room, field)) ?? 0\n"],"mappings":";AAKA,IAAMA,oBAAQ,IAAI,IAAoB,GAEhCC,KAAS,GAAkB,MAA2B,KAAK,UAAU,CAACC,GAAMC,CAAK,CAAC,GAG3EC,KAAqB,GAAkB,MAA2B;CAC7E,IAAMC,KAAQL,EAAM,IAAIC,EAAMC,GAAMC,CAAK,CAAC,KAAK,KAAK;CAEpD,OADAH,EAAM,IAAIC,EAAMC,GAAMC,CAAK,GAAGE,CAAI,GAC3BA;AACT,GAEaC,KAAqB,GAAkB,MAA2BN,EAAM,IAAIC,EAAMC,GAAMC,CAAK,CAAC,KAAK"}
@@ -1,33 +1,29 @@
1
1
  import { ImageCreateUpdateAware } from '../../types/ImageAware';
2
2
  import { IntegerId } from '../../../../shared/types/common';
3
3
  /**
4
- * The widget `holder` holds the images `ids`, and no other: as it reads them, takes those it is given, or goes. The
5
- * answer is how many saves of each of them have been answered by then, by its id.
4
+ * Sets the images `holder` holds to exactly `ids`, on read, on receive, or on unmount (empty).
5
+ * Returns the answered save count per id at that moment.
6
6
  */
7
7
  export declare const holdImages: (config: string, holder: symbol, ids: IntegerId[]) => Map<number, number>;
8
- /**
9
- * The widget `holder` holds the image `id`, or none: as it reads the image, takes one it is given, or goes. The answer
10
- * is how many saves of that image have been answered by then.
11
- */
8
+ /** Single-image form of `holdImages`; `null` holds none. Returns the answered save count of that image. */
12
9
  export declare const holdImage: (config: string, holder: symbol, id: IntegerId | null) => number;
13
10
  /**
14
- * The save of the image a widget has sent: the other widgets of the image know it is on its way and, once it is
15
- * answered, what it saved. `own`: the marks of the saves the widget has on their way, which it does not wait for.
11
+ * Notes a sent image save so other widgets of the image know it is pending and, once answered, what it saved.
12
+ * `own`: marks of the widget's own pending saves, which it does not wait for.
16
13
  */
17
14
  export declare const noteImageSave: <T extends ImageCreateUpdateAware>(config: string, id: IntegerId, own: Set<symbol>, save: Promise<T>) => Promise<T>;
18
15
  /**
19
- * The save of several images at once, as the widget of several images saves them: noted for each image `ids` names, as
20
- * `noteImageSave` notes one, with that image as the answer has it. An image the answer does not have counts as not
21
- * saved.
16
+ * Notes a multi-image save per id in `ids`, as `noteImageSave` does, using each image from the answer.
17
+ * An image missing from the answer counts as not saved.
22
18
  */
23
19
  export declare const noteImagesSave: <T extends ImageCreateUpdateAware>(config: string, ids: IntegerId[], own: Set<symbol>, save: Promise<T[]>) => Promise<T[]>;
24
20
  /**
25
- * Once no save of the image by another widget is on its way (`own`: the widget's own): `over`, and `cancel`, which lets
26
- * the wait go at once and takes it off the note, for an opening that has closed. `null` when none is on its way.
21
+ * Waits until no other widget's save of the image is pending (`own`: the widget's own saves).
22
+ * Returns `over` and `cancel`, which ends the wait and removes it, for a closed opening. `null` if none is pending.
27
23
  */
28
24
  export declare const imageSavesOfOthersOver: (config: string, id: IntegerId, own: Set<symbol>) => {
29
25
  over: Promise<void>;
30
26
  cancel: () => void;
31
27
  } | null;
32
- /** The image as the save answered last has it, when it has been answered since `answeredBefore` of them were. */
28
+ /** The last saved image, if a save was answered after `answeredBefore` answers. */
33
29
  export declare const imageSavedSince: (config: string, id: IntegerId, answeredBefore: number) => ImageCreateUpdateAware | null;
@@ -1 +1 @@
1
- {"version":3,"file":"imageSaves.js","names":["saves","held","keyOf","config","id","savesOf","known","key","of","dropUnheld","holdImages","keys","ids","kept","holder","answered","holdImage","noteImageSave","mark","own","saved","save","cloneDeep","one","noteImagesSave","image","imageSavesOfOthersOver","othersOnTheirWay","waiter","imageSavedSince","answeredBefore"],"sources":["../../../../../src/domains/dam/imageWidget/utils/imageSaves.ts"],"sourcesContent":["import type { ImageCreateUpdateAware } from '@/domains/dam/types/ImageAware'\nimport type { IntegerId } from '@/shared/types/common'\nimport { cloneDeep } from '@/shared/utils/common'\n\n// The saves of an image by the image widgets of the page. A widget drawn again elsewhere (the pin of a sidebar widget\n// in admin-cms) is a second widget of the same image, drawn while the save of the widget it replaced may still be on\n// its way: it read the image before that save took effect, and \"edit metadata\" offered the texts it had read, whose\n// confirm saved them back over the saved ones. The widget of several images (a gallery) holds each of its images, and\n// its save is noted for each of them.\n// The note of an image lives while a widget holds the image or a save of it is on its way: the copy may be drawn only\n// once its configuration has been read, and a widget of the image drawn on the article opened again reads the image as\n// well before that save took effect.\ninterface SavesOfImage {\n /** The widgets that hold the image. */\n holders: Set<symbol>\n /** The saves on their way, each by its mark. */\n onTheirWay: Set<symbol>\n /** How many have been answered. */\n answered: number\n /** The image as the save answered last has it. */\n saved: ImageCreateUpdateAware | null\n /** What waits for saves on their way to be over: let go once it may go. */\n waiting: Array<{ mayGo: () => boolean; go: () => void }>\n}\nconst saves = new Map<string, SavesOfImage>()\n/** The images each widget holds, by the keys of their notes. */\nconst held = new Map<symbol, Set<string>>()\n\nconst keyOf = (config: string, id: IntegerId) => JSON.stringify([config, id])\n\nconst savesOf = (key: string) => {\n const known = saves.get(key)\n if (known) return known\n const of: SavesOfImage = { holders: new Set(), onTheirWay: new Set(), answered: 0, saved: null, waiting: [] }\n saves.set(key, of)\n return of\n}\n\n/** Dropped once no widget holds the image and no save of it is on its way. */\nconst dropUnheld = (key: string, of: SavesOfImage) => {\n if (of.holders.size > 0 || of.onTheirWay.size > 0 || saves.get(key) !== of) return\n saves.delete(key)\n}\n\n/**\n * The widget `holder` holds the images `ids`, and no other: as it reads them, takes those it is given, or goes. The\n * answer is how many saves of each of them have been answered by then, by its id.\n */\nexport const holdImages = (config: string, holder: symbol, ids: IntegerId[]) => {\n const keys = new Map(ids.map((id) => [id, keyOf(config, id)]))\n const kept = new Set(keys.values())\n held.get(holder)?.forEach((key) => {\n if (kept.has(key)) return\n const of = saves.get(key)\n if (!of) return\n of.holders.delete(holder)\n dropUnheld(key, of)\n })\n if (kept.size === 0) held.delete(holder)\n else held.set(holder, kept)\n const answered = new Map<IntegerId, number>()\n keys.forEach((key, id) => {\n const of = savesOf(key)\n of.holders.add(holder)\n answered.set(id, of.answered)\n })\n return answered\n}\n\n/**\n * The widget `holder` holds the image `id`, or none: as it reads the image, takes one it is given, or goes. The answer\n * is how many saves of that image have been answered by then.\n */\nexport const holdImage = (config: string, holder: symbol, id: IntegerId | null) =>\n id === null ? (holdImages(config, holder, []), 0) : holdImages(config, holder, [id]).get(id)!\n\n/**\n * The save of the image a widget has sent: the other widgets of the image know it is on its way and, once it is\n * answered, what it saved. `own`: the marks of the saves the widget has on their way, which it does not wait for.\n */\nexport const noteImageSave = async <T extends ImageCreateUpdateAware>(\n config: string,\n id: IntegerId,\n own: Set<symbol>,\n save: Promise<T>\n) => {\n const key = keyOf(config, id)\n const of = savesOf(key)\n const mark = Symbol('save')\n of.onTheirWay.add(mark)\n own.add(mark)\n try {\n const saved = await save\n of.answered++\n of.saved = cloneDeep(saved)\n return saved\n } finally {\n of.onTheirWay.delete(mark)\n own.delete(mark)\n of.waiting = of.waiting.filter((one) => {\n if (!one.mayGo()) return true\n one.go()\n return false\n })\n dropUnheld(key, of)\n }\n}\n\n/**\n * The save of several images at once, as the widget of several images saves them: noted for each image `ids` names, as\n * `noteImageSave` notes one, with that image as the answer has it. An image the answer does not have counts as not\n * saved.\n */\nexport const noteImagesSave = async <T extends ImageCreateUpdateAware>(\n config: string,\n ids: IntegerId[],\n own: Set<symbol>,\n save: Promise<T[]>\n) => {\n ids.forEach((id) => {\n const one = save.then((saved) => {\n const image = saved.find((answered) => answered.id === id)\n if (!image) throw new Error('not in the answer')\n return image\n })\n // Said by the save itself, to its widget.\n noteImageSave(config, id, own, one).catch(() => undefined)\n })\n return save\n}\n\n/**\n * Once no save of the image by another widget is on its way (`own`: the widget's own): `over`, and `cancel`, which lets\n * the wait go at once and takes it off the note, for an opening that has closed. `null` when none is on its way.\n */\nexport const imageSavesOfOthersOver = (config: string, id: IntegerId, own: Set<symbol>) => {\n const of = saves.get(keyOf(config, id))\n if (!of) return null\n const othersOnTheirWay = () => [...of.onTheirWay].some((mark) => !own.has(mark))\n if (!othersOnTheirWay()) return null\n let waiter: SavesOfImage['waiting'][number] | null = null\n const over = new Promise<void>((go) => {\n waiter = { mayGo: () => !othersOnTheirWay(), go }\n of.waiting.push(waiter)\n })\n const cancel = () => {\n of.waiting = of.waiting.filter((one) => one !== waiter)\n waiter?.go()\n }\n return { over, cancel }\n}\n\n/** The image as the save answered last has it, when it has been answered since `answeredBefore` of them were. */\nexport const imageSavedSince = (config: string, id: IntegerId, answeredBefore: number) => {\n const of = saves.get(keyOf(config, id))\n return !of || !of.saved || of.answered === answeredBefore ? null : cloneDeep(of.saved)\n}\n"],"mappings":";;AAwBA,IAAMA,oBAAQ,IAAI,IAA0B,GAEtCC,oBAAO,IAAI,IAAyB,GAEpCC,KAAS,GAAgB,MAAkB,KAAK,UAAU,CAACC,GAAQC,CAAE,CAAC,GAEtEC,KAAW,MAAgB;CAC/B,IAAMC,IAAQN,EAAM,IAAIO,CAAG;CAC3B,IAAID,GAAO,OAAOA;CAClB,IAAME,IAAmB;EAAE,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AAQ,GAAG;EACb;CACsB;AACxB,GAGaC,KAAmB,GAAgB,GAAe,MAA2B;CACxF,IAAMrB,IAAKR,EAAM,IAAIE,EAAMC,GAAQC,CAAE,CAAC;CACtC,OAAO,CAACI,KAAM,CAACA,EAAG,SAASA,EAAG,aAAasB,IAAiB,OAAOR,EAAUd,EAAG,KAAK;AACvF"}
1
+ {"version":3,"file":"imageSaves.js","names":["saves","held","keyOf","config","id","savesOf","known","key","of","dropUnheld","holdImages","keys","ids","kept","holder","answered","holdImage","noteImageSave","mark","own","saved","save","cloneDeep","one","noteImagesSave","image","imageSavesOfOthersOver","othersOnTheirWay","waiter","imageSavedSince","answeredBefore"],"sources":["../../../../../src/domains/dam/imageWidget/utils/imageSaves.ts"],"sourcesContent":["import type { ImageCreateUpdateAware } from '@/domains/dam/types/ImageAware'\nimport type { IntegerId } from '@/shared/types/common'\nimport { cloneDeep } from '@/shared/utils/common'\n\n// Tracks image saves across the page's image widgets.\n// A re-rendered widget (sidebar pin in admin-cms) may read the image before the\n// previous widget's save lands, and \"edit metadata\" then saved stale texts back.\n// A gallery widget holds and notes each of its images.\n// A note lives while a widget holds the image or a save is pending, since the copy\n// may mount late, and a reopened article may also read before the save lands.\ninterface SavesOfImage {\n holders: Set<symbol>\n /** Pending saves, by mark. */\n onTheirWay: Set<symbol>\n /** Number of answered saves. */\n answered: number\n /** The image as returned by the last answered save. */\n saved: ImageCreateUpdateAware | null\n /** Waiters for pending saves to finish; each runs once `mayGo` allows. */\n waiting: Array<{ mayGo: () => boolean; go: () => void }>\n}\nconst saves = new Map<string, SavesOfImage>()\n/** Images held by each widget, by note key. */\nconst held = new Map<symbol, Set<string>>()\n\nconst keyOf = (config: string, id: IntegerId) => JSON.stringify([config, id])\n\nconst savesOf = (key: string) => {\n const known = saves.get(key)\n if (known) return known\n const of: SavesOfImage = { holders: new Set(), onTheirWay: new Set(), answered: 0, saved: null, waiting: [] }\n saves.set(key, of)\n return of\n}\n\n/** Drops the note once no widget holds the image and no save is pending. */\nconst dropUnheld = (key: string, of: SavesOfImage) => {\n if (of.holders.size > 0 || of.onTheirWay.size > 0 || saves.get(key) !== of) return\n saves.delete(key)\n}\n\n/**\n * Sets the images `holder` holds to exactly `ids`, on read, on receive, or on unmount (empty).\n * Returns the answered save count per id at that moment.\n */\nexport const holdImages = (config: string, holder: symbol, ids: IntegerId[]) => {\n const keys = new Map(ids.map((id) => [id, keyOf(config, id)]))\n const kept = new Set(keys.values())\n held.get(holder)?.forEach((key) => {\n if (kept.has(key)) return\n const of = saves.get(key)\n if (!of) return\n of.holders.delete(holder)\n dropUnheld(key, of)\n })\n if (kept.size === 0) held.delete(holder)\n else held.set(holder, kept)\n const answered = new Map<IntegerId, number>()\n keys.forEach((key, id) => {\n const of = savesOf(key)\n of.holders.add(holder)\n answered.set(id, of.answered)\n })\n return answered\n}\n\n/** Single-image form of `holdImages`; `null` holds none. Returns the answered save count of that image. */\nexport const holdImage = (config: string, holder: symbol, id: IntegerId | null) =>\n id === null ? (holdImages(config, holder, []), 0) : holdImages(config, holder, [id]).get(id)!\n\n/**\n * Notes a sent image save so other widgets of the image know it is pending and, once answered, what it saved.\n * `own`: marks of the widget's own pending saves, which it does not wait for.\n */\nexport const noteImageSave = async <T extends ImageCreateUpdateAware>(\n config: string,\n id: IntegerId,\n own: Set<symbol>,\n save: Promise<T>\n) => {\n const key = keyOf(config, id)\n const of = savesOf(key)\n const mark = Symbol('save')\n of.onTheirWay.add(mark)\n own.add(mark)\n try {\n const saved = await save\n of.answered++\n of.saved = cloneDeep(saved)\n return saved\n } finally {\n of.onTheirWay.delete(mark)\n own.delete(mark)\n of.waiting = of.waiting.filter((one) => {\n if (!one.mayGo()) return true\n one.go()\n return false\n })\n dropUnheld(key, of)\n }\n}\n\n/**\n * Notes a multi-image save per id in `ids`, as `noteImageSave` does, using each image from the answer.\n * An image missing from the answer counts as not saved.\n */\nexport const noteImagesSave = async <T extends ImageCreateUpdateAware>(\n config: string,\n ids: IntegerId[],\n own: Set<symbol>,\n save: Promise<T[]>\n) => {\n ids.forEach((id) => {\n const one = save.then((saved) => {\n const image = saved.find((answered) => answered.id === id)\n if (!image) throw new Error('not in the answer')\n return image\n })\n // The error is reported by the save itself to its widget.\n noteImageSave(config, id, own, one).catch(() => undefined)\n })\n return save\n}\n\n/**\n * Waits until no other widget's save of the image is pending (`own`: the widget's own saves).\n * Returns `over` and `cancel`, which ends the wait and removes it, for a closed opening. `null` if none is pending.\n */\nexport const imageSavesOfOthersOver = (config: string, id: IntegerId, own: Set<symbol>) => {\n const of = saves.get(keyOf(config, id))\n if (!of) return null\n const othersOnTheirWay = () => [...of.onTheirWay].some((mark) => !own.has(mark))\n if (!othersOnTheirWay()) return null\n let waiter: SavesOfImage['waiting'][number] | null = null\n const over = new Promise<void>((go) => {\n waiter = { mayGo: () => !othersOnTheirWay(), go }\n of.waiting.push(waiter)\n })\n const cancel = () => {\n of.waiting = of.waiting.filter((one) => one !== waiter)\n waiter?.go()\n }\n return { over, cancel }\n}\n\n/** The last saved image, if a save was answered after `answeredBefore` answers. */\nexport const imageSavedSince = (config: string, id: IntegerId, answeredBefore: number) => {\n const of = saves.get(keyOf(config, id))\n return !of || !of.saved || of.answered === answeredBefore ? null : cloneDeep(of.saved)\n}\n"],"mappings":";;AAqBA,IAAMA,oBAAQ,IAAI,IAA0B,GAEtCC,oBAAO,IAAI,IAAyB,GAEpCC,KAAS,GAAgB,MAAkB,KAAK,UAAU,CAACC,GAAQC,CAAE,CAAC,GAEtEC,KAAW,MAAgB;CAC/B,IAAMC,IAAQN,EAAM,IAAIO,CAAG;CAC3B,IAAID,GAAO,OAAOA;CAClB,IAAME,IAAmB;EAAE,yBAAS,IAAI,IAAI;EAAG,4BAAY,IAAI,IAAI;EAAG,UAAU;EAAG,OAAO;EAAM,SAAS,CAAC;CAAE;CAE5G,OADAR,EAAM,IAAIO,GAAKC,CAAE,GACVA;AACT,GAGMC,KAAc,GAAa,MAAqB;CACpD,AAAID,EAAG,QAAQ,OAAO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d,EAAG,KAAK;AACvF"}
@@ -1 +1 @@
1
- {"version":3,"file":"metadataToImageMap.js","names":["mapUploadMetadataToImages","assetMetadataMap","bulkItem","isString","authorIdsToFetch","authorId","authorsMap","fetchAuthorListByIds","damClient","endPointAuthor","extSystem","author","queueItems","isNull","queueItem","description","authorIds","authorNames","name","isUndefined","createDamImage"],"sources":["../../../../../src/domains/dam/imageWidget/utils/metadataToImageMap.ts"],"sourcesContent":["import type { AssetMetadataBulkItem } from '@/domains/dam/api/damAssetApi'\nimport type { UploadQueueItem } from '@/domains/dam/types/UploadQueue'\nimport type { ImageCreateUpdateAware } from '@/domains/dam/types/ImageAware'\nimport type { DocId, IntegerId } from '@/shared/types/common'\nimport { isNull, isString, isUndefined } from '@/shared/utils/common'\nimport { fetchAuthorListByIds } from '@/domains/dam/author/api/authorApi'\nimport type { AxiosInstance } from 'axios'\nimport type { AssetDetailItemDto } from '@/domains/dam/types/Asset'\nimport { createDamImage } from '@/domains/dam/imageWidget/utils/damImage'\n\nexport interface UploadMetadataToImageMapItem extends ImageCreateUpdateAware {\n authorIds: DocId[]\n assetId: DocId | undefined\n}\n\nexport type UploadMetadataToImageMapFn = (\n queueItems: UploadQueueItem[],\n bulkItems: AssetMetadataBulkItem[],\n damClient: () => AxiosInstance,\n extSystem: IntegerId,\n licenceId: IntegerId\n) => Promise<UploadMetadataToImageMapItem[]>\n\nexport type AssetSelectMetadataToImageMapFn = (assetRes: AssetDetailItemDto) => {\n description: string\n source: string\n}\n\nexport async function mapUploadMetadataToImages(\n queueItems: UploadQueueItem[],\n bulkItems: AssetMetadataBulkItem[],\n damClient: () => AxiosInstance,\n extSystem: IntegerId,\n licenceId: IntegerId,\n endPointAuthor: string\n): Promise<UploadMetadataToImageMapItem[]> {\n // Build assetId -> { description, authorIds } map\n const assetMetadataMap = new Map<DocId, { description: string; authorIds: DocId[]; mainFileInternal: boolean }>()\n\n bulkItems.forEach((bulkItem) => {\n assetMetadataMap.set(bulkItem.id, {\n description: isString(bulkItem.customData?.description) ? bulkItem.customData.description.trim() : '',\n authorIds: bulkItem.authors,\n mainFileInternal: bulkItem.mainFileInternal ?? false,\n })\n })\n\n // Collect unique author IDs and batch-fetch names only if needed\n const authorIdsToFetch = new Set<DocId>()\n assetMetadataMap.forEach((assetMeta) => {\n assetMeta.authorIds.forEach((authorId) => {\n authorIdsToFetch.add(authorId)\n })\n })\n\n const authorsMap = new Map<DocId, string>()\n if (authorIdsToFetch.size > 0) {\n const authorsRes = await fetchAuthorListByIds(damClient, endPointAuthor, extSystem, [...authorIdsToFetch])\n authorsRes.forEach((author) => {\n authorsMap.set(author.id, author.name)\n })\n }\n\n // Filter valid queue items and map to results\n const validItems = queueItems.filter((queueItem) => !isNull(queueItem.assetId) && !isNull(queueItem.fileId))\n\n return validItems.map((queueItem) => {\n const description = assetMetadataMap.get(queueItem.assetId!)?.description\n const authorIds = assetMetadataMap.get(queueItem.assetId!)?.authorIds\n const authorNames: string[] = []\n if (authorIds) {\n authorIds.forEach((authorId) => {\n const name = authorsMap.get(authorId)\n if (!isUndefined(name) && name.trim().length > 0) {\n authorNames.push(name)\n }\n })\n }\n\n return {\n ...createDamImage(\n {\n fileId: queueItem.fileId as DocId,\n licenceId,\n // Of an asset the save did not answer for: as its row has it, from the read of the asset.\n internal: (assetMetadataMap.get(queueItem.assetId!) ?? queueItem).mainFileInternal,\n },\n { description: description ?? '', source: authorNames.join(', ') }\n ),\n authorIds: authorIds || [],\n assetId: queueItem.assetId || undefined,\n }\n })\n}\n"],"mappings":";;;;AA4BA,eAAsBA,EACpB,GACA,GACA,GACA,GACA,GACA,GACyC;CAEzC,IAAMC,oBAAmB,IAAI,IAAmF;CAEhH,EAAU,SAAS,MAAa;EAC9B,EAAiB,IAAIC,EAAS,IAAI;GAChC,aAAaC,EAASD,EAAS,YAAY,WAAW,IAAIA,EAAS,WAAW,YAAY,KAAK,IAAI;GACnG,WAAWA,EAAS;GACpB,kBAAkBA,EAAS,oBAAoB;EACjD,CAAC;CACH,CAAC;CAGD,IAAME,oBAAmB,IAAI,IAAW;CACxC,EAAiB,SAAS,MAAc;EACtC,EAAU,UAAU,SAAS,MAAa;GACxC,EAAiB,IAAIC,CAAQ;EAC/B,CAAC;CACH,CAAC;CAED,IAAMC,oBAAa,IAAI,IAAmB;CAW1C,OAVIF,EAAiB,OAAO,MAE1B,MADyBG,EAAqBC,GAAWC,GAAgBC,GAAW,CAAC,GAAGN,CAAgB,CAAC,EAAA,CAC9F,SAAS,MAAW;EAC7B,EAAW,IAAIO,EAAO,IAAIA,EAAO,IAAI;CACvC,CAAC,GAIgBC,EAAW,QAAQ,MAAc,CAACC,EAAOC,EAAU,OAAO,KAAK,CAACD,EAAOC,EAAU,MAAM,CAEnG,CAAA,CAAW,KAAK,MAAc;EACnC,IAAMC,IAAcd,EAAiB,IAAIa,EAAU,OAAQ,CAAC,EAAE,aACxDE,IAAYf,EAAiB,IAAIa,EAAU,OAAQ,CAAC,EAAE,WACtDG,IAAwB,CAAC;EAU/B,OATID,KACFA,EAAU,SAAS,MAAa;GAC9B,IAAME,IAAOZ,EAAW,IAAID,CAAQ;GACpC,AAAI,CAACc,EAAYD,CAAI,KAAKA,EAAK,KAAK,CAAC,CAAC,SAAS,KAC7CD,EAAY,KAAKC,CAAI;EAEzB,CAAC,GAGI;GACL,GAAGE,EACD;IACE,QAAQN,EAAU;IAClB;IAEA,WAAWb,EAAiB,IAAIa,EAAU,OAAQ,KAAKA,EAAA,CAAW;GACpE,GACA;IAAE,aAAaC,KAAe;IAAI,QAAQE,EAAY,KAAK,IAAI;GAAE,CACnE;GACA,WAAWD,KAAa,CAAC;GACzB,SAASF,EAAU,WAAW,KAAA;EAChC;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"metadataToImageMap.js","names":["mapUploadMetadataToImages","assetMetadataMap","bulkItem","isString","authorIdsToFetch","authorId","authorsMap","fetchAuthorListByIds","damClient","endPointAuthor","extSystem","author","queueItems","isNull","queueItem","description","authorIds","authorNames","name","isUndefined","createDamImage"],"sources":["../../../../../src/domains/dam/imageWidget/utils/metadataToImageMap.ts"],"sourcesContent":["import type { AssetMetadataBulkItem } from '@/domains/dam/api/damAssetApi'\nimport type { UploadQueueItem } from '@/domains/dam/types/UploadQueue'\nimport type { ImageCreateUpdateAware } from '@/domains/dam/types/ImageAware'\nimport type { DocId, IntegerId } from '@/shared/types/common'\nimport { isNull, isString, isUndefined } from '@/shared/utils/common'\nimport { fetchAuthorListByIds } from '@/domains/dam/author/api/authorApi'\nimport type { AxiosInstance } from 'axios'\nimport type { AssetDetailItemDto } from '@/domains/dam/types/Asset'\nimport { createDamImage } from '@/domains/dam/imageWidget/utils/damImage'\n\nexport interface UploadMetadataToImageMapItem extends ImageCreateUpdateAware {\n authorIds: DocId[]\n assetId: DocId | undefined\n}\n\nexport type UploadMetadataToImageMapFn = (\n queueItems: UploadQueueItem[],\n bulkItems: AssetMetadataBulkItem[],\n damClient: () => AxiosInstance,\n extSystem: IntegerId,\n licenceId: IntegerId\n) => Promise<UploadMetadataToImageMapItem[]>\n\nexport type AssetSelectMetadataToImageMapFn = (assetRes: AssetDetailItemDto) => {\n description: string\n source: string\n}\n\nexport async function mapUploadMetadataToImages(\n queueItems: UploadQueueItem[],\n bulkItems: AssetMetadataBulkItem[],\n damClient: () => AxiosInstance,\n extSystem: IntegerId,\n licenceId: IntegerId,\n endPointAuthor: string\n): Promise<UploadMetadataToImageMapItem[]> {\n // Build assetId -> { description, authorIds } map\n const assetMetadataMap = new Map<DocId, { description: string; authorIds: DocId[]; mainFileInternal: boolean }>()\n\n bulkItems.forEach((bulkItem) => {\n assetMetadataMap.set(bulkItem.id, {\n description: isString(bulkItem.customData?.description) ? bulkItem.customData.description.trim() : '',\n authorIds: bulkItem.authors,\n mainFileInternal: bulkItem.mainFileInternal ?? false,\n })\n })\n\n // Collect unique author IDs and batch-fetch names only if needed\n const authorIdsToFetch = new Set<DocId>()\n assetMetadataMap.forEach((assetMeta) => {\n assetMeta.authorIds.forEach((authorId) => {\n authorIdsToFetch.add(authorId)\n })\n })\n\n const authorsMap = new Map<DocId, string>()\n if (authorIdsToFetch.size > 0) {\n const authorsRes = await fetchAuthorListByIds(damClient, endPointAuthor, extSystem, [...authorIdsToFetch])\n authorsRes.forEach((author) => {\n authorsMap.set(author.id, author.name)\n })\n }\n\n // Filter valid queue items and map to results\n const validItems = queueItems.filter((queueItem) => !isNull(queueItem.assetId) && !isNull(queueItem.fileId))\n\n return validItems.map((queueItem) => {\n const description = assetMetadataMap.get(queueItem.assetId!)?.description\n const authorIds = assetMetadataMap.get(queueItem.assetId!)?.authorIds\n const authorNames: string[] = []\n if (authorIds) {\n authorIds.forEach((authorId) => {\n const name = authorsMap.get(authorId)\n if (!isUndefined(name) && name.trim().length > 0) {\n authorNames.push(name)\n }\n })\n }\n\n return {\n ...createDamImage(\n {\n fileId: queueItem.fileId as DocId,\n licenceId,\n // For an asset not in the save answer, use its row value from the asset read.\n internal: (assetMetadataMap.get(queueItem.assetId!) ?? queueItem).mainFileInternal,\n },\n { description: description ?? '', source: authorNames.join(', ') }\n ),\n authorIds: authorIds || [],\n assetId: queueItem.assetId || undefined,\n }\n })\n}\n"],"mappings":";;;;AA4BA,eAAsBA,EACpB,GACA,GACA,GACA,GACA,GACA,GACyC;CAEzC,IAAMC,oBAAmB,IAAI,IAAmF;CAEhH,EAAU,SAAS,MAAa;EAC9B,EAAiB,IAAIC,EAAS,IAAI;GAChC,aAAaC,EAASD,EAAS,YAAY,WAAW,IAAIA,EAAS,WAAW,YAAY,KAAK,IAAI;GACnG,WAAWA,EAAS;GACpB,kBAAkBA,EAAS,oBAAoB;EACjD,CAAC;CACH,CAAC;CAGD,IAAME,oBAAmB,IAAI,IAAW;CACxC,EAAiB,SAAS,MAAc;EACtC,EAAU,UAAU,SAAS,MAAa;GACxC,EAAiB,IAAIC,CAAQ;EAC/B,CAAC;CACH,CAAC;CAED,IAAMC,oBAAa,IAAI,IAAmB;CAW1C,OAVIF,EAAiB,OAAO,MAE1B,MADyBG,EAAqBC,GAAWC,GAAgBC,GAAW,CAAC,GAAGN,CAAgB,CAAC,EAAA,CAC9F,SAAS,MAAW;EAC7B,EAAW,IAAIO,EAAO,IAAIA,EAAO,IAAI;CACvC,CAAC,GAIgBC,EAAW,QAAQ,MAAc,CAACC,EAAOC,EAAU,OAAO,KAAK,CAACD,EAAOC,EAAU,MAAM,CAEnG,CAAA,CAAW,KAAK,MAAc;EACnC,IAAMC,IAAcd,EAAiB,IAAIa,EAAU,OAAQ,CAAC,EAAE,aACxDE,IAAYf,EAAiB,IAAIa,EAAU,OAAQ,CAAC,EAAE,WACtDG,IAAwB,CAAC;EAU/B,OATID,KACFA,EAAU,SAAS,MAAa;GAC9B,IAAME,IAAOZ,EAAW,IAAID,CAAQ;GACpC,AAAI,CAACc,EAAYD,CAAI,KAAKA,EAAK,KAAK,CAAC,CAAC,SAAS,KAC7CD,EAAY,KAAKC,CAAI;EAEzB,CAAC,GAGI;GACL,GAAGE,EACD;IACE,QAAQN,EAAU;IAClB;IAEA,WAAWb,EAAiB,IAAIa,EAAU,OAAQ,KAAKA,EAAA,CAAW;GACpE,GACA;IAAE,aAAaC,KAAe;IAAI,QAAQE,EAAY,KAAK,IAAI;GAAE,CACnE;GACA,WAAWD,KAAa,CAAC;GACzB,SAASF,EAAU,WAAW,KAAA;EAChC;CACF,CAAC;AACH"}
@@ -1,10 +1,8 @@
1
- /** What a wait that has run out answers. */
2
1
  export declare const WAIT_RAN_OUT: unique symbol;
3
2
  /**
4
- * `wait`, for at most the time the application gives a request to the DAM (`apiTimeout` of the DAM configuration
5
- * `configName`, else the root `coreDam.apiTimeout`, in seconds; 30 where it gives none), once for each of the `requests`
6
- * it is made of, one after another. What a widget waits for may be a request of another widget, or several in a row,
7
- * and a client without a time limit of its own never ends a request that does not answer: the widget waited on,
8
- * without an end.
3
+ * Limits `wait` to the DAM request timeout per each of `requests` in sequence:
4
+ * `apiTimeout` of config `configName`, else `coreDam.apiTimeout`, else 30 seconds.
5
+ * The awaited work may be another widget's requests, and a client without its
6
+ * own timeout never ends an unanswered request, so the widget waited forever.
9
7
  */
10
8
  export declare const withinWaitLimit: <T>(wait: Promise<T>, requests: number, configName: string) => Promise<T | typeof WAIT_RAN_OUT>;
@@ -1 +1 @@
1
- {"version":3,"file":"waitLimit.js","names":["WAIT_RAN_OUT","DEFAULT_LIMIT_SECONDS","withinWaitLimit","configs","coreDamOptions","seconds","configName","limit","isNumber","requests","timer","ranOut","resolve","wait"],"sources":["../../../../../src/domains/dam/imageWidget/utils/waitLimit.ts"],"sourcesContent":["import { coreDamOptions } from '@/plugins/pluginOptions'\nimport { isNumber } from '@/shared/utils/common'\n\n/** What a wait that has run out answers. */\nexport const WAIT_RAN_OUT = Symbol('wait ran out')\n\nconst DEFAULT_LIMIT_SECONDS = 30\n\n/**\n * `wait`, for at most the time the application gives a request to the DAM (`apiTimeout` of the DAM configuration\n * `configName`, else the root `coreDam.apiTimeout`, in seconds; 30 where it gives none), once for each of the `requests`\n * it is made of, one after another. What a widget waits for may be a request of another widget, or several in a row,\n * and a client without a time limit of its own never ends a request that does not answer: the widget waited on,\n * without an end.\n */\nexport const withinWaitLimit = <T>(\n wait: Promise<T>,\n requests: number,\n configName: string\n): Promise<T | typeof WAIT_RAN_OUT> => {\n const configs = coreDamOptions.value?.configs\n const ofConfig = configs && Object.hasOwn(configs, configName) ? configs[configName]?.apiTimeout : undefined\n const seconds = ofConfig ?? coreDamOptions.value?.apiTimeout\n const limit = (isNumber(seconds) && seconds > 0 ? seconds : DEFAULT_LIMIT_SECONDS) * 1000 * requests\n let timer: ReturnType<typeof setTimeout> | undefined\n const ranOut = new Promise<typeof WAIT_RAN_OUT>((resolve) => {\n timer = setTimeout(() => resolve(WAIT_RAN_OUT), limit)\n })\n return Promise.race([wait, ranOut]).finally(() => clearTimeout(timer))\n}\n"],"mappings":";;;AAIA,IAAaA,IAAe,OAAO,cAAc,GAE3CC,IAAwB,IASjBC,KACX,GACA,GACA,MACqC;CACrC,IAAMC,IAAUC,EAAe,OAAO,SAEhCC,KADWF,KAAW,OAAO,OAAOA,GAASG,CAAU,IAAIH,EAAQG,EAAW,EAAE,aAAa,KAAA,MACvEF,EAAe,OAAO,YAC5CG,KAASC,EAASH,CAAO,KAAKA,IAAU,IAAIA,IAAUJ,KAAyB,MAAOQ,GACxFC,GACEC,IAAS,IAAI,SAA8B,MAAY;EAC3D,IAAQ,iBAAiBC,EAAQZ,CAAY,GAAGO,CAAK;CACvD,CAAC;CACD,OAAO,QAAQ,KAAK,CAACM,GAAMF,CAAM,CAAC,CAAC,CAAC,cAAc,aAAaD,CAAK,CAAC;AACvE"}
1
+ {"version":3,"file":"waitLimit.js","names":["WAIT_RAN_OUT","DEFAULT_LIMIT_SECONDS","withinWaitLimit","configs","coreDamOptions","seconds","configName","limit","isNumber","requests","timer","ranOut","resolve","wait"],"sources":["../../../../../src/domains/dam/imageWidget/utils/waitLimit.ts"],"sourcesContent":["import { coreDamOptions } from '@/plugins/pluginOptions'\nimport { isNumber } from '@/shared/utils/common'\n\nexport const WAIT_RAN_OUT = Symbol('wait ran out')\n\nconst DEFAULT_LIMIT_SECONDS = 30\n\n/**\n * Limits `wait` to the DAM request timeout per each of `requests` in sequence:\n * `apiTimeout` of config `configName`, else `coreDam.apiTimeout`, else 30 seconds.\n * The awaited work may be another widget's requests, and a client without its\n * own timeout never ends an unanswered request, so the widget waited forever.\n */\nexport const withinWaitLimit = <T>(\n wait: Promise<T>,\n requests: number,\n configName: string\n): Promise<T | typeof WAIT_RAN_OUT> => {\n const configs = coreDamOptions.value?.configs\n const ofConfig = configs && Object.hasOwn(configs, configName) ? configs[configName]?.apiTimeout : undefined\n const seconds = ofConfig ?? coreDamOptions.value?.apiTimeout\n const limit = (isNumber(seconds) && seconds > 0 ? seconds : DEFAULT_LIMIT_SECONDS) * 1000 * requests\n let timer: ReturnType<typeof setTimeout> | undefined\n const ranOut = new Promise<typeof WAIT_RAN_OUT>((resolve) => {\n timer = setTimeout(() => resolve(WAIT_RAN_OUT), limit)\n })\n return Promise.race([wait, ranOut]).finally(() => clearTimeout(timer))\n}\n"],"mappings":";;;AAGA,IAAaA,IAAe,OAAO,cAAc,GAE3CC,IAAwB,IAQjBC,KACX,GACA,GACA,MACqC;CACrC,IAAMC,IAAUC,EAAe,OAAO,SAEhCC,KADWF,KAAW,OAAO,OAAOA,GAASG,CAAU,IAAIH,EAAQG,EAAW,EAAE,aAAa,KAAA,MACvEF,EAAe,OAAO,YAC5CG,KAASC,EAASH,CAAO,KAAKA,IAAU,IAAIA,IAAUJ,KAAyB,MAAOQ,GACxFC,GACEC,IAAS,IAAI,SAA8B,MAAY;EAC3D,IAAQ,iBAAiBC,EAAQZ,CAAY,GAAGO,CAAK;CACvD,CAAC;CACD,OAAO,QAAQ,KAAK,CAACM,GAAMF,CAAM,CAAC,CAAC,CAAC,cAAc,aAAaD,CAAK,CAAC;AACvE"}
@@ -1 +1 @@
1
- {"version":3,"file":"keywordApi.js","names":["LIST","ENTITY","fetchKeywordListByIds","useApiFetchByIds","SYSTEM_CORE_DAM","endPoint","execute","ids","useFetchKeywordList","useApiFetchList","createKeyword","useApiRequest","data"],"sources":["../../../../../src/domains/dam/keyword/api/keywordApi.ts"],"sourcesContent":["import type { AxiosInstance } from 'axios'\nimport type { DamKeyword } from '@/domains/dam/keyword/types/DamKeyword'\nimport { SYSTEM_CORE_DAM } from '@/domains/dam/api/damConstants'\nimport { useApiFetchList } from '@/domains/api/composables/useApiFetchList'\nimport { useApiFetchByIds } from '@/domains/api/composables/useApiFetchByIds'\nimport { useApiRequest } from '@/domains/api/composables/useApiRequest'\n\n// The address of the keywords is the application's to say (`endPointKeyword` of its DAM configuration).\nconst LIST = '/ext-system/:extSystemId'\nexport const ENTITY = 'keyword'\n\nexport const fetchKeywordListByIds = (\n client: () => AxiosInstance,\n endPoint: string,\n extSystemId: number,\n ids: string[]\n) => {\n const { execute } = useApiFetchByIds<DamKeyword>({\n client,\n system: SYSTEM_CORE_DAM,\n entity: ENTITY,\n urlTemplate: endPoint + LIST + '/search',\n urlParams: { extSystemId },\n isSearchApi: true,\n })\n\n return execute(ids)\n}\n\nexport const useFetchKeywordList = (client: () => AxiosInstance, endPoint: string, extSystemId: number) =>\n useApiFetchList<DamKeyword>({\n client,\n system: SYSTEM_CORE_DAM,\n entity: ENTITY,\n urlTemplate: endPoint + LIST,\n urlParams: { extSystemId },\n })\n\nexport const createKeyword = (client: () => AxiosInstance, endPoint: string, data: DamKeyword) => {\n const { execute } = useApiRequest<DamKeyword, DamKeyword>({\n client,\n method: 'POST',\n system: SYSTEM_CORE_DAM,\n entity: ENTITY,\n urlTemplate: endPoint,\n })\n\n return execute({ body: data })\n}\n"],"mappings":";;;;;AAQA,IAAMA,IAAO,4BACAC,IAAS,WAETC,KACX,GACA,GACA,GACA,MACG;CACH,IAAM,EAAE,eAAYC,EAA6B;EAC/C;EACA,QAAQC;EACR,QAAQH;EACR,aAAaI,IAAW;EACxB,WAAW,EAAE,eAAY;EACzB,aAAa;CACf,CAAC;CAED,OAAOC,EAAQC,CAAG;AACpB,GAEaC,KAAuB,GAA6B,GAAkB,MACjFC,EAA4B;CAC1B;CACA,QAAQL;CACR,QAAQH;CACR,aAAaI,IAAWL;CACxB,WAAW,EAAE,eAAY;AAC3B,CAAC,GAEUU,KAAiB,GAA6B,GAAkB,MAAqB;CAChG,IAAM,EAAE,eAAYC,EAAsC;EACxD;EACA,QAAQ;EACR,QAAQP;EACR,QAAQH;EACR,aAAaI;CACf,CAAC;CAED,OAAOC,EAAQ,EAAE,MAAMM,EAAK,CAAC;AAC/B"}
1
+ {"version":3,"file":"keywordApi.js","names":["LIST","ENTITY","fetchKeywordListByIds","useApiFetchByIds","SYSTEM_CORE_DAM","endPoint","execute","ids","useFetchKeywordList","useApiFetchList","createKeyword","useApiRequest","data"],"sources":["../../../../../src/domains/dam/keyword/api/keywordApi.ts"],"sourcesContent":["import type { AxiosInstance } from 'axios'\nimport type { DamKeyword } from '@/domains/dam/keyword/types/DamKeyword'\nimport { SYSTEM_CORE_DAM } from '@/domains/dam/api/damConstants'\nimport { useApiFetchList } from '@/domains/api/composables/useApiFetchList'\nimport { useApiFetchByIds } from '@/domains/api/composables/useApiFetchByIds'\nimport { useApiRequest } from '@/domains/api/composables/useApiRequest'\n\n// The keyword endpoint comes from the application (`endPointKeyword` of its DAM configuration).\nconst LIST = '/ext-system/:extSystemId'\nexport const ENTITY = 'keyword'\n\nexport const fetchKeywordListByIds = (\n client: () => AxiosInstance,\n endPoint: string,\n extSystemId: number,\n ids: string[]\n) => {\n const { execute } = useApiFetchByIds<DamKeyword>({\n client,\n system: SYSTEM_CORE_DAM,\n entity: ENTITY,\n urlTemplate: endPoint + LIST + '/search',\n urlParams: { extSystemId },\n isSearchApi: true,\n })\n\n return execute(ids)\n}\n\nexport const useFetchKeywordList = (client: () => AxiosInstance, endPoint: string, extSystemId: number) =>\n useApiFetchList<DamKeyword>({\n client,\n system: SYSTEM_CORE_DAM,\n entity: ENTITY,\n urlTemplate: endPoint + LIST,\n urlParams: { extSystemId },\n })\n\nexport const createKeyword = (client: () => AxiosInstance, endPoint: string, data: DamKeyword) => {\n const { execute } = useApiRequest<DamKeyword, DamKeyword>({\n client,\n method: 'POST',\n system: SYSTEM_CORE_DAM,\n entity: ENTITY,\n urlTemplate: endPoint,\n })\n\n return execute({ body: data })\n}\n"],"mappings":";;;;;AAQA,IAAMA,IAAO,4BACAC,IAAS,WAETC,KACX,GACA,GACA,GACA,MACG;CACH,IAAM,EAAE,eAAYC,EAA6B;EAC/C;EACA,QAAQC;EACR,QAAQH;EACR,aAAaI,IAAW;EACxB,WAAW,EAAE,eAAY;EACzB,aAAa;CACf,CAAC;CAED,OAAOC,EAAQC,CAAG;AACpB,GAEaC,KAAuB,GAA6B,GAAkB,MACjFC,EAA4B;CAC1B;CACA,QAAQL;CACR,QAAQH;CACR,aAAaI,IAAWL;CACxB,WAAW,EAAE,eAAY;AAC3B,CAAC,GAEUU,KAAiB,GAA6B,GAAkB,MAAqB;CAChG,IAAM,EAAE,eAAYC,EAAsC;EACxD;EACA,QAAQ;EACR,QAAQP;EACR,QAAQH;EACR,aAAaI;CACf,CAAC;CAED,OAAOC,EAAQ,EAAE,MAAMM,EAAK,CAAC;AAC/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"DamKeywordFilterRemoteAutocomplete.js","names":["_sfc_main","DamKeywordFilterRemoteAutocomplete_vue_vue_type_script_setup_true_lang_default","DamKeywordFilterRemoteAutocomplete_default"],"sources":["../../../../../src/domains/dam/keyword/components/DamKeywordFilterRemoteAutocomplete.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useKeywordSelectActions } from '@/domains/dam/keyword/composables/keywordActions'\nimport { useKeywordInnerFilter } from '@/domains/dam/keyword/filter/KeywordFilter'\nimport AFilterRemoteAutocomplete from '@/domains/remoteAutocomplete/components/AFilterRemoteAutocomplete.vue'\nimport type { IntegerId } from '@/shared/types/common'\nimport { provide } from 'vue'\nimport { FilterInnerConfigKey, FilterInnerDataKey } from '@/domains/filters/utils/filterInjectionKeys'\nimport { useDamConfigName } from '@/domains/dam/composables/damConfigName'\n\nconst props = withDefaults(\n defineProps<{\n name: string\n extSystem: IntegerId\n /** The DAM configuration to work under. Left out: that of the component it is in, else `default`. */\n configName?: string\n }>(),\n {\n configName: undefined,\n }\n)\nconst emit = defineEmits<{\n (e: 'change'): void\n}>()\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst damConfigName = useDamConfigName(props.configName)\n\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst { fetchItems, fetchItemsByIds } = useKeywordSelectActions(props.extSystem, damConfigName)\n\nconst { filterData, filterConfig } = useKeywordInnerFilter()\nprovide(FilterInnerConfigKey, filterConfig)\nprovide(FilterInnerDataKey, filterData)\n</script>\n\n<template>\n <AFilterRemoteAutocomplete\n :name=\"name\"\n :fetch-items=\"fetchItems\"\n :fetch-items-by-ids=\"fetchItemsByIds\"\n filter-by-field=\"text\"\n :filter-sort-by=\"null\"\n @change=\"emit('change')\"\n />\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"DamKeywordFilterRemoteAutocomplete.js","names":["_sfc_main","DamKeywordFilterRemoteAutocomplete_vue_vue_type_script_setup_true_lang_default","DamKeywordFilterRemoteAutocomplete_default"],"sources":["../../../../../src/domains/dam/keyword/components/DamKeywordFilterRemoteAutocomplete.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useKeywordSelectActions } from '@/domains/dam/keyword/composables/keywordActions'\nimport { useKeywordInnerFilter } from '@/domains/dam/keyword/filter/KeywordFilter'\nimport AFilterRemoteAutocomplete from '@/domains/remoteAutocomplete/components/AFilterRemoteAutocomplete.vue'\nimport type { IntegerId } from '@/shared/types/common'\nimport { provide } from 'vue'\nimport { FilterInnerConfigKey, FilterInnerDataKey } from '@/domains/filters/utils/filterInjectionKeys'\nimport { useDamConfigName } from '@/domains/dam/composables/damConfigName'\n\nconst props = withDefaults(\n defineProps<{\n name: string\n extSystem: IntegerId\n /** DAM configuration to use. Defaults to the parent component's, else `default`. */\n configName?: string\n }>(),\n {\n configName: undefined,\n }\n)\nconst emit = defineEmits<{\n (e: 'change'): void\n}>()\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst damConfigName = useDamConfigName(props.configName)\n\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst { fetchItems, fetchItemsByIds } = useKeywordSelectActions(props.extSystem, damConfigName)\n\nconst { filterData, filterConfig } = useKeywordInnerFilter()\nprovide(FilterInnerConfigKey, filterConfig)\nprovide(FilterInnerDataKey, filterData)\n</script>\n\n<template>\n <AFilterRemoteAutocomplete\n :name=\"name\"\n :fetch-items=\"fetchItems\"\n :fetch-items-by-ids=\"fetchItemsByIds\"\n filter-by-field=\"text\"\n :filter-sort-by=\"null\"\n @change=\"emit('change')\"\n />\n</template>\n"],"mappings":""}
@@ -2,7 +2,7 @@ import { IntegerId } from '../../../../shared/types/common';
2
2
  type __VLS_Props = {
3
3
  name: string;
4
4
  extSystem: IntegerId;
5
- /** The DAM configuration to work under. Left out: that of the component it is in, else `default`. */
5
+ /** DAM configuration to use. Defaults to the parent component's, else `default`. */
6
6
  configName?: string;
7
7
  };
8
8
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
@@ -1 +1 @@
1
- {"version":3,"file":"DamKeywordFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","AFilterRemoteAutocomplete","_unref","AFilterRemoteAutocomplete_default","DamKeywordFilterRemoteAutocomplete_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","damConfigName","useDamConfigName","useKeywordSelectActions","useKeywordInnerFilter","provide","FilterInnerConfigKey","filterConfig","FilterInnerDataKey","filterData","openBlock","createBlock","unref","fetchItems","fetchItemsByIds","_cache"],"sources":["../../../../../src/domains/dam/keyword/components/DamKeywordFilterRemoteAutocomplete.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useKeywordSelectActions } from '@/domains/dam/keyword/composables/keywordActions'\nimport { useKeywordInnerFilter } from '@/domains/dam/keyword/filter/KeywordFilter'\nimport AFilterRemoteAutocomplete from '@/domains/remoteAutocomplete/components/AFilterRemoteAutocomplete.vue'\nimport type { IntegerId } from '@/shared/types/common'\nimport { provide } from 'vue'\nimport { FilterInnerConfigKey, FilterInnerDataKey } from '@/domains/filters/utils/filterInjectionKeys'\nimport { useDamConfigName } from '@/domains/dam/composables/damConfigName'\n\nconst props = withDefaults(\n defineProps<{\n name: string\n extSystem: IntegerId\n /** The DAM configuration to work under. Left out: that of the component it is in, else `default`. */\n configName?: string\n }>(),\n {\n configName: undefined,\n }\n)\nconst emit = defineEmits<{\n (e: 'change'): void\n}>()\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst damConfigName = useDamConfigName(props.configName)\n\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst { fetchItems, fetchItemsByIds } = useKeywordSelectActions(props.extSystem, damConfigName)\n\nconst { filterData, filterConfig } = useKeywordInnerFilter()\nprovide(FilterInnerConfigKey, filterConfig)\nprovide(FilterInnerDataKey, filterData)\n</script>\n\n<template>\n <AFilterRemoteAutocomplete\n :name=\"name\"\n :fetch-items=\"fetchItems\"\n :fetch-items-by-ids=\"fetchItemsByIds\"\n filter-by-field=\"text\"\n :filter-sort-by=\"null\"\n @change=\"emit('change')\"\n />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EASA,IAAMO,IAAQC,GAWRC,IAAOH,GAIPI,IAAgBC,EAAiBJ,EAAM,UAAU,GAGjD,EAAE,eAAY,uBAAoBK,EAAwBL,EAAM,WAAWG,CAAa,GAExF,EAAE,eAAY,oBAAiBG,EAAsB;E,OAC3DC,EAAQC,GAAsBC,CAAY,GAC1CF,EAAQG,GAAoBC,CAAU,I,UAIpClB,EAAA,GAAAC,EAOEC,GAAA;GANC,MAAMM,EAAA;GACN,eAAaL,EAAAmB,CAAA;GACb,sBAAoBnB,EAAAoB,CAAA;GACrB,mBAAgB;GACf,kBAAgB;GAChB,UAAM,AAAAC,EAAA,QAAA,MAAEf,EAAI,QAAA"}
1
+ {"version":3,"file":"DamKeywordFilterRemoteAutocomplete.vue_vue_type_script_setup_true_lang.js","names":["_openBlock","_createBlock","AFilterRemoteAutocomplete","_unref","AFilterRemoteAutocomplete_default","DamKeywordFilterRemoteAutocomplete_vue_vue_type_script_setup_true_lang_default","__emit","props","__props","emit","damConfigName","useDamConfigName","useKeywordSelectActions","useKeywordInnerFilter","provide","FilterInnerConfigKey","filterConfig","FilterInnerDataKey","filterData","openBlock","createBlock","unref","fetchItems","fetchItemsByIds","_cache"],"sources":["../../../../../src/domains/dam/keyword/components/DamKeywordFilterRemoteAutocomplete.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useKeywordSelectActions } from '@/domains/dam/keyword/composables/keywordActions'\nimport { useKeywordInnerFilter } from '@/domains/dam/keyword/filter/KeywordFilter'\nimport AFilterRemoteAutocomplete from '@/domains/remoteAutocomplete/components/AFilterRemoteAutocomplete.vue'\nimport type { IntegerId } from '@/shared/types/common'\nimport { provide } from 'vue'\nimport { FilterInnerConfigKey, FilterInnerDataKey } from '@/domains/filters/utils/filterInjectionKeys'\nimport { useDamConfigName } from '@/domains/dam/composables/damConfigName'\n\nconst props = withDefaults(\n defineProps<{\n name: string\n extSystem: IntegerId\n /** DAM configuration to use. Defaults to the parent component's, else `default`. */\n configName?: string\n }>(),\n {\n configName: undefined,\n }\n)\nconst emit = defineEmits<{\n (e: 'change'): void\n}>()\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst damConfigName = useDamConfigName(props.configName)\n\n// eslint-disable-next-line vue/no-setup-props-reactivity-loss\nconst { fetchItems, fetchItemsByIds } = useKeywordSelectActions(props.extSystem, damConfigName)\n\nconst { filterData, filterConfig } = useKeywordInnerFilter()\nprovide(FilterInnerConfigKey, filterConfig)\nprovide(FilterInnerDataKey, filterData)\n</script>\n\n<template>\n <AFilterRemoteAutocomplete\n :name=\"name\"\n :fetch-items=\"fetchItems\"\n :fetch-items-by-ids=\"fetchItemsByIds\"\n filter-by-field=\"text\"\n :filter-sort-by=\"null\"\n @change=\"emit('change')\"\n />\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EASA,IAAMO,IAAQC,GAWRC,IAAOH,GAIPI,IAAgBC,EAAiBJ,EAAM,UAAU,GAGjD,EAAE,eAAY,uBAAoBK,EAAwBL,EAAM,WAAWG,CAAa,GAExF,EAAE,eAAY,oBAAiBG,EAAsB;E,OAC3DC,EAAQC,GAAsBC,CAAY,GAC1CF,EAAQG,GAAoBC,CAAU,I,UAIpClB,EAAA,GAAAC,EAOEC,GAAA;GANC,MAAMM,EAAA;GACN,eAAaL,EAAAmB,CAAA;GACb,sBAAoBnB,EAAAoB,CAAA;GACrB,mBAAgB;GACf,kBAAgB;GAChB,UAAM,AAAAC,EAAA,QAAA,MAAEf,EAAI,QAAA"}