@strapi/upload 5.52.0 → 5.52.2

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 (198) hide show
  1. package/dist/admin/future/components/TruncatedText.js +76 -0
  2. package/dist/admin/future/components/TruncatedText.js.map +1 -0
  3. package/dist/admin/future/components/TruncatedText.mjs +74 -0
  4. package/dist/admin/future/components/TruncatedText.mjs.map +1 -0
  5. package/dist/admin/future/components/UploadProgressDialog.js +36 -1
  6. package/dist/admin/future/components/UploadProgressDialog.js.map +1 -1
  7. package/dist/admin/future/components/UploadProgressDialog.mjs +37 -2
  8. package/dist/admin/future/components/UploadProgressDialog.mjs.map +1 -1
  9. package/dist/admin/future/hooks/useApiErrorMessage.js +61 -0
  10. package/dist/admin/future/hooks/useApiErrorMessage.js.map +1 -0
  11. package/dist/admin/future/hooks/useApiErrorMessage.mjs +39 -0
  12. package/dist/admin/future/hooks/useApiErrorMessage.mjs.map +1 -0
  13. package/dist/admin/future/hooks/useTracking.js +57 -0
  14. package/dist/admin/future/hooks/useTracking.js.map +1 -0
  15. package/dist/admin/future/hooks/useTracking.mjs +53 -0
  16. package/dist/admin/future/hooks/useTracking.mjs.map +1 -0
  17. package/dist/admin/future/pages/Assets/AssetsPage.js +31 -0
  18. package/dist/admin/future/pages/Assets/AssetsPage.js.map +1 -1
  19. package/dist/admin/future/pages/Assets/AssetsPage.mjs +31 -0
  20. package/dist/admin/future/pages/Assets/AssetsPage.mjs.map +1 -1
  21. package/dist/admin/future/pages/Assets/components/AssetActionsMenu.js +13 -11
  22. package/dist/admin/future/pages/Assets/components/AssetActionsMenu.js.map +1 -1
  23. package/dist/admin/future/pages/Assets/components/AssetActionsMenu.mjs +13 -11
  24. package/dist/admin/future/pages/Assets/components/AssetActionsMenu.mjs.map +1 -1
  25. package/dist/admin/future/pages/Assets/components/AssetDetails/AssetDetailsDrawer.js +62 -51
  26. package/dist/admin/future/pages/Assets/components/AssetDetails/AssetDetailsDrawer.js.map +1 -1
  27. package/dist/admin/future/pages/Assets/components/AssetDetails/AssetDetailsDrawer.mjs +62 -51
  28. package/dist/admin/future/pages/Assets/components/AssetDetails/AssetDetailsDrawer.mjs.map +1 -1
  29. package/dist/admin/future/pages/Assets/components/AssetsGrid.js +3 -4
  30. package/dist/admin/future/pages/Assets/components/AssetsGrid.js.map +1 -1
  31. package/dist/admin/future/pages/Assets/components/AssetsGrid.mjs +4 -5
  32. package/dist/admin/future/pages/Assets/components/AssetsGrid.mjs.map +1 -1
  33. package/dist/admin/future/pages/Assets/components/AssetsSearchInput.js +11 -1
  34. package/dist/admin/future/pages/Assets/components/AssetsSearchInput.js.map +1 -1
  35. package/dist/admin/future/pages/Assets/components/AssetsSearchInput.mjs +11 -1
  36. package/dist/admin/future/pages/Assets/components/AssetsSearchInput.mjs.map +1 -1
  37. package/dist/admin/future/pages/Assets/components/AssetsTable.js +6 -4
  38. package/dist/admin/future/pages/Assets/components/AssetsTable.js.map +1 -1
  39. package/dist/admin/future/pages/Assets/components/AssetsTable.mjs +6 -4
  40. package/dist/admin/future/pages/Assets/components/AssetsTable.mjs.map +1 -1
  41. package/dist/admin/future/pages/Assets/components/BulkActionsBar.js +10 -1
  42. package/dist/admin/future/pages/Assets/components/BulkActionsBar.js.map +1 -1
  43. package/dist/admin/future/pages/Assets/components/BulkActionsBar.mjs +10 -1
  44. package/dist/admin/future/pages/Assets/components/BulkActionsBar.mjs.map +1 -1
  45. package/dist/admin/future/pages/Assets/components/BulkMoveDialog.js +3 -2
  46. package/dist/admin/future/pages/Assets/components/BulkMoveDialog.js.map +1 -1
  47. package/dist/admin/future/pages/Assets/components/BulkMoveDialog.mjs +3 -2
  48. package/dist/admin/future/pages/Assets/components/BulkMoveDialog.mjs.map +1 -1
  49. package/dist/admin/future/pages/Assets/components/Dnd/AssetsDndProvider.js +4 -2
  50. package/dist/admin/future/pages/Assets/components/Dnd/AssetsDndProvider.js.map +1 -1
  51. package/dist/admin/future/pages/Assets/components/Dnd/AssetsDndProvider.mjs +4 -2
  52. package/dist/admin/future/pages/Assets/components/Dnd/AssetsDndProvider.mjs.map +1 -1
  53. package/dist/admin/future/pages/Assets/components/FilterMenu.js +18 -2
  54. package/dist/admin/future/pages/Assets/components/FilterMenu.js.map +1 -1
  55. package/dist/admin/future/pages/Assets/components/FilterMenu.mjs +18 -2
  56. package/dist/admin/future/pages/Assets/components/FilterMenu.mjs.map +1 -1
  57. package/dist/admin/future/pages/Assets/components/FolderActionsMenu.js +9 -7
  58. package/dist/admin/future/pages/Assets/components/FolderActionsMenu.js.map +1 -1
  59. package/dist/admin/future/pages/Assets/components/FolderActionsMenu.mjs +9 -7
  60. package/dist/admin/future/pages/Assets/components/FolderActionsMenu.mjs.map +1 -1
  61. package/dist/admin/future/pages/Assets/components/FolderFormDialog.js +12 -0
  62. package/dist/admin/future/pages/Assets/components/FolderFormDialog.js.map +1 -1
  63. package/dist/admin/future/pages/Assets/components/FolderFormDialog.mjs +12 -0
  64. package/dist/admin/future/pages/Assets/components/FolderFormDialog.mjs.map +1 -1
  65. package/dist/admin/future/pages/Assets/components/FolderTree/FolderTree.js +21 -38
  66. package/dist/admin/future/pages/Assets/components/FolderTree/FolderTree.js.map +1 -1
  67. package/dist/admin/future/pages/Assets/components/FolderTree/FolderTree.mjs +23 -40
  68. package/dist/admin/future/pages/Assets/components/FolderTree/FolderTree.mjs.map +1 -1
  69. package/dist/admin/future/pages/Assets/components/SortMenu.js +14 -0
  70. package/dist/admin/future/pages/Assets/components/SortMenu.js.map +1 -1
  71. package/dist/admin/future/pages/Assets/components/SortMenu.mjs +14 -0
  72. package/dist/admin/future/pages/Assets/components/SortMenu.mjs.map +1 -1
  73. package/dist/admin/future/pages/Assets/hooks/useAssetSelection.js +5 -0
  74. package/dist/admin/future/pages/Assets/hooks/useAssetSelection.js.map +1 -1
  75. package/dist/admin/future/pages/Assets/hooks/useAssetSelection.mjs +6 -1
  76. package/dist/admin/future/pages/Assets/hooks/useAssetSelection.mjs.map +1 -1
  77. package/dist/admin/future/pages/Assets/hooks/useIsAssetDetailsOpen.js +30 -0
  78. package/dist/admin/future/pages/Assets/hooks/useIsAssetDetailsOpen.js.map +1 -0
  79. package/dist/admin/future/pages/Assets/hooks/useIsAssetDetailsOpen.mjs +26 -0
  80. package/dist/admin/future/pages/Assets/hooks/useIsAssetDetailsOpen.mjs.map +1 -0
  81. package/dist/admin/future/pages/Assets/utils/selection.js +17 -0
  82. package/dist/admin/future/pages/Assets/utils/selection.js.map +1 -1
  83. package/dist/admin/future/pages/Assets/utils/selection.mjs +17 -1
  84. package/dist/admin/future/pages/Assets/utils/selection.mjs.map +1 -1
  85. package/dist/admin/future/services/api.js +123 -19
  86. package/dist/admin/future/services/api.js.map +1 -1
  87. package/dist/admin/future/services/api.mjs +125 -21
  88. package/dist/admin/future/services/api.mjs.map +1 -1
  89. package/dist/admin/future/services/assets.js +11 -23
  90. package/dist/admin/future/services/assets.js.map +1 -1
  91. package/dist/admin/future/services/assets.mjs +11 -23
  92. package/dist/admin/future/services/assets.mjs.map +1 -1
  93. package/dist/admin/future/services/uploadFileViaXHR.js +9 -3
  94. package/dist/admin/future/services/uploadFileViaXHR.js.map +1 -1
  95. package/dist/admin/future/services/uploadFileViaXHR.mjs +9 -3
  96. package/dist/admin/future/services/uploadFileViaXHR.mjs.map +1 -1
  97. package/dist/admin/future/store/uploadProgress.js +44 -5
  98. package/dist/admin/future/store/uploadProgress.js.map +1 -1
  99. package/dist/admin/future/store/uploadProgress.mjs +43 -6
  100. package/dist/admin/future/store/uploadProgress.mjs.map +1 -1
  101. package/dist/admin/future/utils/getApiErrorMessage.js +20 -0
  102. package/dist/admin/future/utils/getApiErrorMessage.js.map +1 -0
  103. package/dist/admin/future/utils/getApiErrorMessage.mjs +18 -0
  104. package/dist/admin/future/utils/getApiErrorMessage.mjs.map +1 -0
  105. package/dist/admin/hooks/useAIMetadataJob.js +1 -1
  106. package/dist/admin/hooks/useAIMetadataJob.js.map +1 -1
  107. package/dist/admin/hooks/useAIMetadataJob.mjs +1 -1
  108. package/dist/admin/hooks/useAIMetadataJob.mjs.map +1 -1
  109. package/dist/admin/pages/SettingsPage/SettingsPage.js +2 -2
  110. package/dist/admin/pages/SettingsPage/SettingsPage.js.map +1 -1
  111. package/dist/admin/pages/SettingsPage/SettingsPage.mjs +2 -2
  112. package/dist/admin/pages/SettingsPage/SettingsPage.mjs.map +1 -1
  113. package/dist/admin/src/future/components/TruncatedText.d.ts +32 -0
  114. package/dist/admin/src/future/hooks/useApiErrorMessage.d.ts +17 -0
  115. package/dist/admin/src/future/hooks/useTracking.d.ts +29 -0
  116. package/dist/admin/src/future/pages/Assets/components/AssetActionsMenu.d.ts +5 -3
  117. package/dist/admin/src/future/pages/Assets/components/FolderActionsMenu.d.ts +5 -4
  118. package/dist/admin/src/future/pages/Assets/hooks/useAssetSelection.d.ts +2 -0
  119. package/dist/admin/src/future/pages/Assets/hooks/useIsAssetDetailsOpen.d.ts +18 -0
  120. package/dist/admin/src/future/pages/Assets/utils/selection.d.ts +10 -0
  121. package/dist/admin/src/future/services/api.d.ts +6 -7
  122. package/dist/admin/src/future/services/uploadFileViaXHR.d.ts +6 -1
  123. package/dist/admin/src/future/store/uploadProgress.d.ts +16 -1
  124. package/dist/admin/src/future/utils/getApiErrorMessage.d.ts +1 -0
  125. package/dist/admin/translations/ca.json.js +1 -1
  126. package/dist/admin/translations/ca.json.mjs +1 -1
  127. package/dist/admin/translations/de.json.js +1 -1
  128. package/dist/admin/translations/de.json.mjs +1 -1
  129. package/dist/admin/translations/en.json.js +2 -1
  130. package/dist/admin/translations/en.json.js.map +1 -1
  131. package/dist/admin/translations/en.json.mjs +2 -1
  132. package/dist/admin/translations/en.json.mjs.map +1 -1
  133. package/dist/admin/translations/es.json.js +1 -1
  134. package/dist/admin/translations/es.json.mjs +1 -1
  135. package/dist/admin/translations/fr.json.js +1 -1
  136. package/dist/admin/translations/fr.json.mjs +1 -1
  137. package/dist/admin/translations/ja.json.js +1 -1
  138. package/dist/admin/translations/ja.json.mjs +1 -1
  139. package/dist/admin/translations/ko.json.js +1 -1
  140. package/dist/admin/translations/ko.json.mjs +1 -1
  141. package/dist/admin/translations/nl.json.js +1 -1
  142. package/dist/admin/translations/nl.json.mjs +1 -1
  143. package/dist/admin/translations/pl.json.js +1 -1
  144. package/dist/admin/translations/pl.json.mjs +1 -1
  145. package/dist/admin/translations/pt-BR.json.js +1 -1
  146. package/dist/admin/translations/pt-BR.json.mjs +1 -1
  147. package/dist/admin/translations/ru.json.js +1 -1
  148. package/dist/admin/translations/ru.json.mjs +1 -1
  149. package/dist/admin/translations/sk.json.js +1 -1
  150. package/dist/admin/translations/sk.json.mjs +1 -1
  151. package/dist/admin/translations/tr.json.js +1 -1
  152. package/dist/admin/translations/tr.json.mjs +1 -1
  153. package/dist/admin/translations/uk.json.js +1 -1
  154. package/dist/admin/translations/uk.json.mjs +1 -1
  155. package/dist/admin/translations/zh-Hans.json.js +1 -1
  156. package/dist/admin/translations/zh-Hans.json.mjs +1 -1
  157. package/dist/admin/translations/zh.json.js +1 -1
  158. package/dist/admin/translations/zh.json.mjs +1 -1
  159. package/dist/server/controllers/admin-file.js +27 -9
  160. package/dist/server/controllers/admin-file.js.map +1 -1
  161. package/dist/server/controllers/admin-file.mjs +27 -9
  162. package/dist/server/controllers/admin-file.mjs.map +1 -1
  163. package/dist/server/controllers/admin-upload.js +24 -8
  164. package/dist/server/controllers/admin-upload.js.map +1 -1
  165. package/dist/server/controllers/admin-upload.mjs +24 -8
  166. package/dist/server/controllers/admin-upload.mjs.map +1 -1
  167. package/dist/server/routes/admin.js +41 -21
  168. package/dist/server/routes/admin.js.map +1 -1
  169. package/dist/server/routes/admin.mjs +41 -21
  170. package/dist/server/routes/admin.mjs.map +1 -1
  171. package/dist/server/services/ai-metadata.js +25 -5
  172. package/dist/server/services/ai-metadata.js.map +1 -1
  173. package/dist/server/services/ai-metadata.mjs +1 -1
  174. package/dist/server/services/ai-metadata.mjs.map +1 -1
  175. package/dist/server/services/upload.js +4 -0
  176. package/dist/server/services/upload.js.map +1 -1
  177. package/dist/server/services/upload.mjs +4 -0
  178. package/dist/server/services/upload.mjs.map +1 -1
  179. package/dist/server/src/controllers/admin-file.d.ts +29 -8
  180. package/dist/server/src/controllers/admin-file.d.ts.map +1 -1
  181. package/dist/server/src/controllers/admin-upload.d.ts +20 -4
  182. package/dist/server/src/controllers/admin-upload.d.ts.map +1 -1
  183. package/dist/server/src/controllers/index.d.ts +4 -4
  184. package/dist/server/src/index.d.ts +4 -4
  185. package/dist/server/src/routes/admin.d.ts.map +1 -1
  186. package/dist/server/src/services/ai-metadata.d.ts +2 -2
  187. package/dist/server/src/services/ai-metadata.d.ts.map +1 -1
  188. package/dist/server/src/services/upload.d.ts.map +1 -1
  189. package/dist/shared/contracts/ai-metadata-jobs.d.ts +10 -32
  190. package/dist/shared/contracts/ai-metadata-jobs.d.ts.map +1 -1
  191. package/dist/shared/contracts/files.d.ts +10 -10
  192. package/dist/shared/contracts/files.d.ts.map +1 -1
  193. package/package.json +7 -7
  194. package/dist/admin/future/utils/getBulkMoveErrorMessage.js +0 -23
  195. package/dist/admin/future/utils/getBulkMoveErrorMessage.js.map +0 -1
  196. package/dist/admin/future/utils/getBulkMoveErrorMessage.mjs +0 -21
  197. package/dist/admin/future/utils/getBulkMoveErrorMessage.mjs.map +0 -1
  198. package/dist/admin/src/future/utils/getBulkMoveErrorMessage.d.ts +0 -1
@@ -0,0 +1,76 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var React = require('react');
5
+ var designSystem = require('@strapi/design-system');
6
+
7
+ /**
8
+ * Text that ellipsizes, with a tooltip carrying the full value once it actually
9
+ * does. Used for folder and asset names, which are user-supplied and routinely
10
+ * longer than the column, card or rail holding them.
11
+ *
12
+ * The tooltip is conditional rather than always-on: a permanent tooltip would
13
+ * make every short name hoverable for no reason, and would announce a
14
+ * description that merely repeats the visible text.
15
+ *
16
+ * Whether the text is truncated can't be derived from the string — it depends on
17
+ * the rendered width — so it has to be measured. That measurement happens when
18
+ * the pointer or focus arrives, not at mount.
19
+ *
20
+ * Measuring at mount is the obvious approach and it does not work here. The
21
+ * reading is only correct once the row's width constraint has reached this span,
22
+ * and the tree remounts its rows during first render: the instance that survives
23
+ * can take its one measurement while still unconstrained, conclude it fits, and
24
+ * be stuck there. Nothing corrects it afterwards, because a ResizeObserver on
25
+ * this span never fires again — an ancestor clamps the row, so the text
26
+ * overflows inside a box whose own size stops changing.
27
+ *
28
+ * Reading on hover sidesteps all of that. It is the only moment the answer is
29
+ * needed, the layout is settled by then, and nothing is cached across remounts
30
+ * or resizes that could go stale.
31
+ */ const TruncatedText = ({ children, ...props })=>{
32
+ const textRef = React.useRef(null);
33
+ const [isTruncated, setIsTruncated] = React.useState(false);
34
+ const checkTruncation = ()=>{
35
+ const el = textRef.current;
36
+ if (el) {
37
+ setIsTruncated(el.scrollWidth > el.clientWidth);
38
+ }
39
+ };
40
+ // A ref callback rather than useRef alone, so the first measurement happens
41
+ // when the node attaches and again whenever it is replaced. The tree remounts
42
+ // its rows during first render, and a value measured against the discarded
43
+ // node would never be revisited — this re-runs against the node that survives.
44
+ const attachRef = (el)=>{
45
+ textRef.current = el;
46
+ if (el) {
47
+ checkTruncation();
48
+ }
49
+ };
50
+ // The Tooltip stays mounted and the *label* is what's conditional, rather than
51
+ // swapping between a wrapped and unwrapped span. Swapping loses the first
52
+ // hover: the measurement that decides to show a tooltip is itself triggered by
53
+ // the pointer arriving, so the trigger would mount underneath a pointer that
54
+ // has already entered, and Radix — which starts watching at mount — sees no
55
+ // enter event and stays closed until the pointer leaves and returns.
56
+ //
57
+ // With `label` empty the DS Tooltip renders its child as-is and attaches
58
+ // nothing, so untruncated text still costs no DOM node and announces no
59
+ // description duplicating what is already on screen.
60
+ return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Tooltip, {
61
+ label: isTruncated ? children : undefined,
62
+ children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
63
+ ref: attachRef,
64
+ ellipsis: true,
65
+ // Focus is covered as well as hover: the tooltip has to be reachable by
66
+ // keyboard, and these rows are buttons.
67
+ onPointerEnter: checkTruncation,
68
+ onFocus: checkTruncation,
69
+ ...props,
70
+ children: children
71
+ })
72
+ });
73
+ };
74
+
75
+ exports.TruncatedText = TruncatedText;
76
+ //# sourceMappingURL=TruncatedText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TruncatedText.js","sources":["../../../../admin/src/future/components/TruncatedText.tsx"],"sourcesContent":["import { useRef, useState } from 'react';\n\nimport { Tooltip, Typography, type TypographyProps } from '@strapi/design-system';\n\ninterface TruncatedTextProps extends Omit<TypographyProps, 'children' | 'ellipsis'> {\n /** The full text. Doubles as the tooltip content once it no longer fits. */\n children: string;\n}\n\n/**\n * Text that ellipsizes, with a tooltip carrying the full value once it actually\n * does. Used for folder and asset names, which are user-supplied and routinely\n * longer than the column, card or rail holding them.\n *\n * The tooltip is conditional rather than always-on: a permanent tooltip would\n * make every short name hoverable for no reason, and would announce a\n * description that merely repeats the visible text.\n *\n * Whether the text is truncated can't be derived from the string — it depends on\n * the rendered width — so it has to be measured. That measurement happens when\n * the pointer or focus arrives, not at mount.\n *\n * Measuring at mount is the obvious approach and it does not work here. The\n * reading is only correct once the row's width constraint has reached this span,\n * and the tree remounts its rows during first render: the instance that survives\n * can take its one measurement while still unconstrained, conclude it fits, and\n * be stuck there. Nothing corrects it afterwards, because a ResizeObserver on\n * this span never fires again — an ancestor clamps the row, so the text\n * overflows inside a box whose own size stops changing.\n *\n * Reading on hover sidesteps all of that. It is the only moment the answer is\n * needed, the layout is settled by then, and nothing is cached across remounts\n * or resizes that could go stale.\n */\nexport const TruncatedText = ({ children, ...props }: TruncatedTextProps) => {\n const textRef = useRef<HTMLSpanElement | null>(null);\n const [isTruncated, setIsTruncated] = useState(false);\n\n const checkTruncation = () => {\n const el = textRef.current;\n\n if (el) {\n setIsTruncated(el.scrollWidth > el.clientWidth);\n }\n };\n\n // A ref callback rather than useRef alone, so the first measurement happens\n // when the node attaches and again whenever it is replaced. The tree remounts\n // its rows during first render, and a value measured against the discarded\n // node would never be revisited — this re-runs against the node that survives.\n const attachRef = (el: HTMLSpanElement | null) => {\n textRef.current = el;\n\n if (el) {\n checkTruncation();\n }\n };\n\n // The Tooltip stays mounted and the *label* is what's conditional, rather than\n // swapping between a wrapped and unwrapped span. Swapping loses the first\n // hover: the measurement that decides to show a tooltip is itself triggered by\n // the pointer arriving, so the trigger would mount underneath a pointer that\n // has already entered, and Radix — which starts watching at mount — sees no\n // enter event and stays closed until the pointer leaves and returns.\n //\n // With `label` empty the DS Tooltip renders its child as-is and attaches\n // nothing, so untruncated text still costs no DOM node and announces no\n // description duplicating what is already on screen.\n return (\n <Tooltip label={isTruncated ? children : undefined}>\n <Typography\n ref={attachRef}\n ellipsis\n // Focus is covered as well as hover: the tooltip has to be reachable by\n // keyboard, and these rows are buttons.\n onPointerEnter={checkTruncation}\n onFocus={checkTruncation}\n {...props}\n >\n {children}\n </Typography>\n </Tooltip>\n );\n};\n"],"names":["TruncatedText","children","props","textRef","useRef","isTruncated","setIsTruncated","useState","checkTruncation","el","current","scrollWidth","clientWidth","attachRef","_jsx","Tooltip","label","undefined","Typography","ref","ellipsis","onPointerEnter","onFocus"],"mappings":";;;;;;AASA;;;;;;;;;;;;;;;;;;;;;;;;UAyBaA,aAAAA,GAAgB,CAAC,EAAEC,QAAQ,EAAE,GAAGC,KAAAA,EAA2B,GAAA;AACtE,IAAA,MAAMC,UAAUC,YAAAA,CAA+B,IAAA,CAAA;AAC/C,IAAA,MAAM,CAACC,WAAAA,EAAaC,cAAAA,CAAe,GAAGC,cAAAA,CAAS,KAAA,CAAA;AAE/C,IAAA,MAAMC,eAAAA,GAAkB,IAAA;QACtB,MAAMC,EAAAA,GAAKN,QAAQO,OAAO;AAE1B,QAAA,IAAID,EAAAA,EAAI;AACNH,YAAAA,cAAAA,CAAeG,EAAAA,CAAGE,WAAW,GAAGF,EAAAA,CAAGG,WAAW,CAAA;AAChD,QAAA;AACF,IAAA,CAAA;;;;;AAMA,IAAA,MAAMC,YAAY,CAACJ,EAAAA,GAAAA;AACjBN,QAAAA,OAAAA,CAAQO,OAAO,GAAGD,EAAAA;AAElB,QAAA,IAAIA,EAAAA,EAAI;AACND,YAAAA,eAAAA,EAAAA;AACF,QAAA;AACF,IAAA,CAAA;;;;;;;;;;;AAYA,IAAA,qBACEM,cAAA,CAACC,oBAAAA,EAAAA;AAAQC,QAAAA,KAAAA,EAAOX,cAAcJ,QAAAA,GAAWgB,SAAAA;AACvC,QAAA,QAAA,gBAAAH,cAAA,CAACI,uBAAAA,EAAAA;YACCC,GAAAA,EAAKN,SAAAA;YACLO,QAAQ,EAAA,IAAA;;;YAGRC,cAAAA,EAAgBb,eAAAA;YAChBc,OAAAA,EAASd,eAAAA;AACR,YAAA,GAAGN,KAAK;AAERD,YAAAA,QAAAA,EAAAA;;;AAIT;;;;"}
@@ -0,0 +1,74 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { useRef, useState } from 'react';
3
+ import { Tooltip, Typography } from '@strapi/design-system';
4
+
5
+ /**
6
+ * Text that ellipsizes, with a tooltip carrying the full value once it actually
7
+ * does. Used for folder and asset names, which are user-supplied and routinely
8
+ * longer than the column, card or rail holding them.
9
+ *
10
+ * The tooltip is conditional rather than always-on: a permanent tooltip would
11
+ * make every short name hoverable for no reason, and would announce a
12
+ * description that merely repeats the visible text.
13
+ *
14
+ * Whether the text is truncated can't be derived from the string — it depends on
15
+ * the rendered width — so it has to be measured. That measurement happens when
16
+ * the pointer or focus arrives, not at mount.
17
+ *
18
+ * Measuring at mount is the obvious approach and it does not work here. The
19
+ * reading is only correct once the row's width constraint has reached this span,
20
+ * and the tree remounts its rows during first render: the instance that survives
21
+ * can take its one measurement while still unconstrained, conclude it fits, and
22
+ * be stuck there. Nothing corrects it afterwards, because a ResizeObserver on
23
+ * this span never fires again — an ancestor clamps the row, so the text
24
+ * overflows inside a box whose own size stops changing.
25
+ *
26
+ * Reading on hover sidesteps all of that. It is the only moment the answer is
27
+ * needed, the layout is settled by then, and nothing is cached across remounts
28
+ * or resizes that could go stale.
29
+ */ const TruncatedText = ({ children, ...props })=>{
30
+ const textRef = useRef(null);
31
+ const [isTruncated, setIsTruncated] = useState(false);
32
+ const checkTruncation = ()=>{
33
+ const el = textRef.current;
34
+ if (el) {
35
+ setIsTruncated(el.scrollWidth > el.clientWidth);
36
+ }
37
+ };
38
+ // A ref callback rather than useRef alone, so the first measurement happens
39
+ // when the node attaches and again whenever it is replaced. The tree remounts
40
+ // its rows during first render, and a value measured against the discarded
41
+ // node would never be revisited — this re-runs against the node that survives.
42
+ const attachRef = (el)=>{
43
+ textRef.current = el;
44
+ if (el) {
45
+ checkTruncation();
46
+ }
47
+ };
48
+ // The Tooltip stays mounted and the *label* is what's conditional, rather than
49
+ // swapping between a wrapped and unwrapped span. Swapping loses the first
50
+ // hover: the measurement that decides to show a tooltip is itself triggered by
51
+ // the pointer arriving, so the trigger would mount underneath a pointer that
52
+ // has already entered, and Radix — which starts watching at mount — sees no
53
+ // enter event and stays closed until the pointer leaves and returns.
54
+ //
55
+ // With `label` empty the DS Tooltip renders its child as-is and attaches
56
+ // nothing, so untruncated text still costs no DOM node and announces no
57
+ // description duplicating what is already on screen.
58
+ return /*#__PURE__*/ jsx(Tooltip, {
59
+ label: isTruncated ? children : undefined,
60
+ children: /*#__PURE__*/ jsx(Typography, {
61
+ ref: attachRef,
62
+ ellipsis: true,
63
+ // Focus is covered as well as hover: the tooltip has to be reachable by
64
+ // keyboard, and these rows are buttons.
65
+ onPointerEnter: checkTruncation,
66
+ onFocus: checkTruncation,
67
+ ...props,
68
+ children: children
69
+ })
70
+ });
71
+ };
72
+
73
+ export { TruncatedText };
74
+ //# sourceMappingURL=TruncatedText.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TruncatedText.mjs","sources":["../../../../admin/src/future/components/TruncatedText.tsx"],"sourcesContent":["import { useRef, useState } from 'react';\n\nimport { Tooltip, Typography, type TypographyProps } from '@strapi/design-system';\n\ninterface TruncatedTextProps extends Omit<TypographyProps, 'children' | 'ellipsis'> {\n /** The full text. Doubles as the tooltip content once it no longer fits. */\n children: string;\n}\n\n/**\n * Text that ellipsizes, with a tooltip carrying the full value once it actually\n * does. Used for folder and asset names, which are user-supplied and routinely\n * longer than the column, card or rail holding them.\n *\n * The tooltip is conditional rather than always-on: a permanent tooltip would\n * make every short name hoverable for no reason, and would announce a\n * description that merely repeats the visible text.\n *\n * Whether the text is truncated can't be derived from the string — it depends on\n * the rendered width — so it has to be measured. That measurement happens when\n * the pointer or focus arrives, not at mount.\n *\n * Measuring at mount is the obvious approach and it does not work here. The\n * reading is only correct once the row's width constraint has reached this span,\n * and the tree remounts its rows during first render: the instance that survives\n * can take its one measurement while still unconstrained, conclude it fits, and\n * be stuck there. Nothing corrects it afterwards, because a ResizeObserver on\n * this span never fires again — an ancestor clamps the row, so the text\n * overflows inside a box whose own size stops changing.\n *\n * Reading on hover sidesteps all of that. It is the only moment the answer is\n * needed, the layout is settled by then, and nothing is cached across remounts\n * or resizes that could go stale.\n */\nexport const TruncatedText = ({ children, ...props }: TruncatedTextProps) => {\n const textRef = useRef<HTMLSpanElement | null>(null);\n const [isTruncated, setIsTruncated] = useState(false);\n\n const checkTruncation = () => {\n const el = textRef.current;\n\n if (el) {\n setIsTruncated(el.scrollWidth > el.clientWidth);\n }\n };\n\n // A ref callback rather than useRef alone, so the first measurement happens\n // when the node attaches and again whenever it is replaced. The tree remounts\n // its rows during first render, and a value measured against the discarded\n // node would never be revisited — this re-runs against the node that survives.\n const attachRef = (el: HTMLSpanElement | null) => {\n textRef.current = el;\n\n if (el) {\n checkTruncation();\n }\n };\n\n // The Tooltip stays mounted and the *label* is what's conditional, rather than\n // swapping between a wrapped and unwrapped span. Swapping loses the first\n // hover: the measurement that decides to show a tooltip is itself triggered by\n // the pointer arriving, so the trigger would mount underneath a pointer that\n // has already entered, and Radix — which starts watching at mount — sees no\n // enter event and stays closed until the pointer leaves and returns.\n //\n // With `label` empty the DS Tooltip renders its child as-is and attaches\n // nothing, so untruncated text still costs no DOM node and announces no\n // description duplicating what is already on screen.\n return (\n <Tooltip label={isTruncated ? children : undefined}>\n <Typography\n ref={attachRef}\n ellipsis\n // Focus is covered as well as hover: the tooltip has to be reachable by\n // keyboard, and these rows are buttons.\n onPointerEnter={checkTruncation}\n onFocus={checkTruncation}\n {...props}\n >\n {children}\n </Typography>\n </Tooltip>\n );\n};\n"],"names":["TruncatedText","children","props","textRef","useRef","isTruncated","setIsTruncated","useState","checkTruncation","el","current","scrollWidth","clientWidth","attachRef","_jsx","Tooltip","label","undefined","Typography","ref","ellipsis","onPointerEnter","onFocus"],"mappings":";;;;AASA;;;;;;;;;;;;;;;;;;;;;;;;UAyBaA,aAAAA,GAAgB,CAAC,EAAEC,QAAQ,EAAE,GAAGC,KAAAA,EAA2B,GAAA;AACtE,IAAA,MAAMC,UAAUC,MAAAA,CAA+B,IAAA,CAAA;AAC/C,IAAA,MAAM,CAACC,WAAAA,EAAaC,cAAAA,CAAe,GAAGC,QAAAA,CAAS,KAAA,CAAA;AAE/C,IAAA,MAAMC,eAAAA,GAAkB,IAAA;QACtB,MAAMC,EAAAA,GAAKN,QAAQO,OAAO;AAE1B,QAAA,IAAID,EAAAA,EAAI;AACNH,YAAAA,cAAAA,CAAeG,EAAAA,CAAGE,WAAW,GAAGF,EAAAA,CAAGG,WAAW,CAAA;AAChD,QAAA;AACF,IAAA,CAAA;;;;;AAMA,IAAA,MAAMC,YAAY,CAACJ,EAAAA,GAAAA;AACjBN,QAAAA,OAAAA,CAAQO,OAAO,GAAGD,EAAAA;AAElB,QAAA,IAAIA,EAAAA,EAAI;AACND,YAAAA,eAAAA,EAAAA;AACF,QAAA;AACF,IAAA,CAAA;;;;;;;;;;;AAYA,IAAA,qBACEM,GAAA,CAACC,OAAAA,EAAAA;AAAQC,QAAAA,KAAAA,EAAOX,cAAcJ,QAAAA,GAAWgB,SAAAA;AACvC,QAAA,QAAA,gBAAAH,GAAA,CAACI,UAAAA,EAAAA;YACCC,GAAAA,EAAKN,SAAAA;YACLO,QAAQ,EAAA,IAAA;;;YAGRC,cAAAA,EAAgBb,eAAAA;YAChBc,OAAAA,EAASd,eAAAA;AACR,YAAA,GAAGN,KAAK;AAERD,YAAAA,QAAAA,EAAAA;;;AAIT;;;;"}
@@ -483,6 +483,25 @@ const FileRowRenderer = ({ file })=>{
483
483
  const isCurrentFile = file.status === 'uploading';
484
484
  const isCompleted = file.status === 'complete';
485
485
  const isCancelled = file.status === 'cancelled';
486
+ const isQueued = file.status === 'pending';
487
+ if (isQueued) {
488
+ // No bar: there is nothing to report yet, and an indeterminate bar would read
489
+ // as "in progress" on a file the pool has not picked up.
490
+ return /*#__PURE__*/ jsxRuntime.jsx(FileRow, {
491
+ icon: /*#__PURE__*/ jsxRuntime.jsx(icons.Clock, {
492
+ fill: "neutral600"
493
+ }),
494
+ fileName: file.name,
495
+ children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
496
+ variant: "pi",
497
+ textColor: "neutral600",
498
+ children: formatMessage({
499
+ id: translations.getTranslationKey('upload.progress.file.queued'),
500
+ defaultMessage: 'Queued'
501
+ })
502
+ })
503
+ });
504
+ }
486
505
  if (isCurrentFile) {
487
506
  // Determinate only once bytes are actually being reported — a known `size` is not
488
507
  // enough. The two upload flows differ here:
@@ -523,7 +542,17 @@ const FileRowRenderer = ({ file })=>{
523
542
  children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
524
543
  variant: "pi",
525
544
  textColor: "neutral600",
526
- children: file.error
545
+ children: file.error ? /**
546
+ * The server may return a machine-readable code (e.g. `FileTooBig` from the
547
+ * body middleware) or an already human-readable sentence (e.g. the upload
548
+ * plugin's size-limit message). Translate the former, fall back to the latter.
549
+ */ formatMessage({
550
+ id: translations.getTranslationKey(`apiError.${file.error}`),
551
+ defaultMessage: file.error
552
+ }) : formatMessage({
553
+ id: translations.getTranslationKey('upload.generic-error'),
554
+ defaultMessage: 'An error occurred while uploading the file.'
555
+ })
527
556
  })
528
557
  });
529
558
  }
@@ -574,6 +603,9 @@ const UploadProgressDialog = ()=>{
574
603
  // in-flight row, not just the first (a `find` here dated to the strictly
575
604
  // sequential era and hid all but the lowest-index worker's row).
576
605
  const uploadingFiles = files.filter((f)=>f.status === 'uploading');
606
+ // Everything the pool has not reached yet. Listed in queue order, which is the
607
+ // order `files` is already in, so a row's position tells the user where it sits.
608
+ const queuedFiles = files.filter((f)=>f.status === 'pending');
577
609
  const completedFiles = files.filter((f)=>f.status === 'complete' || f.status === 'error' || f.status === 'cancelled').sort((a, b)=>{
578
610
  // Sort priority: error > cancelled > complete
579
611
  const priority = {
@@ -613,6 +645,9 @@ const UploadProgressDialog = ()=>{
613
645
  uploadingFiles.map((file)=>/*#__PURE__*/ jsxRuntime.jsx(FileRowRenderer, {
614
646
  file: file
615
647
  }, file.index)),
648
+ queuedFiles.map((file)=>/*#__PURE__*/ jsxRuntime.jsx(FileRowRenderer, {
649
+ file: file
650
+ }, file.index)),
616
651
  completedFiles.length > 0 && /*#__PURE__*/ jsxRuntime.jsx(CompletedFilesList, {
617
652
  children: completedFiles.map((file)=>/*#__PURE__*/ jsxRuntime.jsx(FileRowRenderer, {
618
653
  file: file
@@ -1 +1 @@
1
- {"version":3,"file":"UploadProgressDialog.js","sources":["../../../../admin/src/future/components/UploadProgressDialog.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Flex, IconButton, TextButton, Typography } from '@strapi/design-system';\nimport {\n ArrowsCounterClockwise,\n Check,\n CheckCircle,\n ChevronDown,\n Cross,\n CrossCircle,\n Information,\n MinusCircle,\n Sparkle,\n Upload,\n WarningCircle,\n} from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { keyframes, styled } from 'styled-components';\n\nimport { abortUpload, useRetryCancelledFilesMutation } from '../services/api';\nimport { useTypedDispatch, useTypedSelector } from '../store/hooks';\nimport {\n closeUploadProgress,\n toggleMinimize,\n cancelUpload,\n selectAggregateProgress,\n selectMetadataProgress,\n selectIsGeneratingMetadata,\n selectMetadataOutcome,\n} from '../store/uploadProgress';\nimport { getTranslationKey } from '../utils/translations';\n\nimport { Drawer } from './Drawer';\n\nimport type { FileMetadataStatus, FileProgress, FileProgressStatus } from '../store/uploadProgress';\nimport type { MessageDescriptor } from 'react-intl';\n\n/* -------------------------------------------------------------------------------------------------\n * DialogHeader\n * -----------------------------------------------------------------------------------------------*/\n\nconst HeaderStatusMessage = ({\n title,\n subtitle,\n metadataSubtitle,\n}: {\n title: string;\n subtitle?: string;\n metadataSubtitle?: string;\n}) => {\n return (\n <Flex direction=\"column\" alignItems=\"flex-start\" paddingLeft={2}>\n <Drawer.Title>\n <Typography variant=\"omega\">{title}</Typography>\n </Drawer.Title>\n <Drawer.Description>\n <Typography variant=\"pi\" textColor=\"neutral600\">\n {subtitle}\n </Typography>\n </Drawer.Description>\n {metadataSubtitle && (\n <Typography variant=\"pi\" textColor=\"neutral600\">\n {metadataSubtitle}\n </Typography>\n )}\n </Flex>\n );\n};\n\nconst HeaderStatusIcon = styled(Flex)`\n padding: ${({ theme }) => theme.spaces[3]};\n border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 ${theme.borderRadius}`};\n\n > svg {\n height: 24px;\n width: 24px;\n }\n`;\n\nconst HeaderStatusWrapper = styled(Flex)`\n align-items: center;\n`;\n\ntype HeaderStatusProps = {\n status: 'uploading' | 'success' | 'error' | 'canceled';\n progress?: number;\n totalFiles: number;\n successfulCount: number;\n errorCount: number;\n /**\n * Count-based metadata progress, or `null` when no row entered the metadata phase.\n * Shown as an extra subtitle while generation is still in flight.\n */\n metadataProgress: number | null;\n /** Whether any row is still generating — drives whether the subtitle shows at all. */\n isGeneratingMetadata: boolean;\n /**\n * Terminal per-outcome counts, or `null` while the phase is unfinished or was never\n * entered. Replaces the in-flight subtitle once generation settles.\n */\n metadataOutcome: { generated: number; skipped: number; failed: number } | null;\n};\n\nconst HeaderStatus = ({\n status,\n progress,\n totalFiles,\n successfulCount,\n errorCount,\n metadataProgress,\n isGeneratingMetadata,\n metadataOutcome,\n}: HeaderStatusProps) => {\n const { formatMessage } = useIntl();\n\n // Completion is upload-driven, so the terminal header can appear while metadata is\n // still generating — the subtitle keeps ticking underneath until it settles.\n //\n // Gated on work actually being in flight rather than on `progress < 100`: in a\n // sequential batch the percentage touches 100% between files, which would blink the\n // subtitle out and back in on every upload.\n //\n // Once the phase settles the line is not dropped but replaced with the outcome, so the\n // header keeps confirming what happened instead of silently losing the message.\n const metadataSubtitle = (() => {\n if (metadataProgress !== null && isGeneratingMetadata) {\n return formatMessage(\n {\n id: getTranslationKey('upload.progress.generatingMetadata.withCount'),\n defaultMessage: 'Generating metadata with AI ({percentage}%)',\n },\n { percentage: metadataProgress }\n );\n }\n\n if (metadataOutcome === null) {\n return undefined;\n }\n\n // Only `generated` rows had metadata written, so only they can be reported as a\n // success. With none, there is nothing to confirm — an all-skipped batch of\n // non-images would otherwise read as \"generated on 0 files\". Per-row sublines\n // already spell out skipped and failed outcomes.\n if (metadataOutcome.generated === 0) {\n return undefined;\n }\n\n if (metadataOutcome.failed > 0) {\n return formatMessage(\n {\n id: getTranslationKey('upload.progress.metadataGenerated.withFailures'),\n defaultMessage: '{generatedCount} generated, {failedCount} failed',\n },\n { generatedCount: metadataOutcome.generated, failedCount: metadataOutcome.failed }\n );\n }\n\n return formatMessage(\n {\n id: getTranslationKey('upload.progress.metadataGenerated.withCount'),\n defaultMessage:\n '{count, plural, one {Metadata successfully generated on # file} other {Metadata successfully generated on # files}}',\n },\n { count: metadataOutcome.generated }\n );\n })();\n\n if (status === 'error') {\n return (\n <HeaderStatusWrapper>\n <HeaderStatusIcon background=\"danger200\">\n <Cross fill=\"danger700\" />\n </HeaderStatusIcon>\n <HeaderStatusMessage\n title={formatMessage({\n id: getTranslationKey('upload.progress.failed'),\n defaultMessage: 'Upload failed',\n })}\n subtitle={formatMessage({\n id: getTranslationKey('upload.progress.failed.subtitle'),\n defaultMessage: 'Please try to upload files again',\n })}\n />\n </HeaderStatusWrapper>\n );\n }\n\n if (status === 'success') {\n const subtitle =\n errorCount > 0\n ? formatMessage(\n {\n id: getTranslationKey('upload.progress.success.subtitle.withErrors'),\n defaultMessage: '{successCount} uploaded, {errorCount} failed',\n },\n { successCount: successfulCount, errorCount }\n )\n : formatMessage(\n {\n id: getTranslationKey('upload.progress.success.subtitle'),\n defaultMessage: '{count} files uploaded successfully',\n },\n { count: successfulCount }\n );\n\n return (\n <HeaderStatusWrapper>\n <HeaderStatusIcon background=\"success200\">\n <Check fill=\"success700\" />\n </HeaderStatusIcon>\n <HeaderStatusMessage\n title={formatMessage({\n id: getTranslationKey('upload.progress.success'),\n defaultMessage: 'Upload successful!',\n })}\n subtitle={subtitle}\n metadataSubtitle={metadataSubtitle}\n />\n </HeaderStatusWrapper>\n );\n }\n\n if (status === 'canceled') {\n return (\n <HeaderStatusWrapper>\n <HeaderStatusIcon background=\"neutral200\">\n <MinusCircle fill=\"neutral700\" />\n </HeaderStatusIcon>\n <HeaderStatusMessage\n title={formatMessage({\n id: getTranslationKey('upload.progress.canceled'),\n defaultMessage: 'Upload canceled',\n })}\n subtitle={formatMessage({\n id: getTranslationKey('upload.progress.canceled.subtitle'),\n defaultMessage: 'Some files were not uploaded',\n })}\n metadataSubtitle={metadataSubtitle}\n />\n </HeaderStatusWrapper>\n );\n }\n\n if (status === 'uploading') {\n const progressPercentage = progress ? Math.round(progress) : 0;\n\n return (\n <HeaderStatusWrapper>\n <HeaderStatusIcon background=\"primary200\">\n <Upload fill=\"primary700\" />\n </HeaderStatusIcon>\n <HeaderStatusMessage\n title={formatMessage(\n {\n id: getTranslationKey('upload.progress.uploading.withCount'),\n defaultMessage: 'Uploading {total} items ({percentage}%)',\n },\n {\n total: totalFiles,\n percentage: progressPercentage,\n }\n )}\n metadataSubtitle={metadataSubtitle}\n />\n </HeaderStatusWrapper>\n );\n }\n\n return null;\n};\n\nconst HeaderIconButton = styled(IconButton)`\n &:hover {\n background: transparent;\n }\n`;\n\nconst ChevronWrapper = styled.span<{ $isMinimized: boolean }>`\n display: flex;\n transition: transform 0.5s ease-in-out;\n transform: ${({ $isMinimized }) => ($isMinimized ? 'rotate(180deg)' : 'rotate(0deg)')};\n`;\n\nconst HEADER_COLOR_MAP = {\n uploading: { background: 'primary100' },\n canceled: { background: 'neutral100' },\n success: { background: 'success100' },\n error: { background: 'danger100' },\n} as const;\n\nconst DialogHeader = ({ handleClose }: { handleClose: () => void }) => {\n const { formatMessage } = useIntl();\n\n const { isMinimized, files, uploadId, totalFiles } = useTypedSelector(\n (state) => state.uploadProgress\n );\n const progress = useTypedSelector(selectAggregateProgress);\n const metadataProgress = useTypedSelector(selectMetadataProgress);\n const isGeneratingMetadata = useTypedSelector(selectIsGeneratingMetadata);\n const metadataOutcome = useTypedSelector(selectMetadataOutcome);\n const dispatch = useTypedDispatch();\n const [retryCancelledFiles] = useRetryCancelledFilesMutation();\n\n // The batch is complete once every file has reached a terminal state. Byte-weighted\n // progress can't be used here because errored/cancelled rows never reach 100%.\n const isComplete =\n files.length > 0 &&\n files.every((f) => f.status === 'complete' || f.status === 'error' || f.status === 'cancelled');\n const isAllUploaded = isComplete;\n const isAllErrored = isComplete && files.every((f) => f.status === 'error');\n const hasCancelledFiles = files.some((f) => f.status === 'cancelled');\n const successfulCount = files.filter((f) => f.status === 'complete').length;\n const errorCount = files.filter((f) => f.status === 'error').length;\n // Success includes partial success (some files succeeded, even if some failed)\n const isSuccess = isComplete && successfulCount > 0 && !hasCancelledFiles;\n const status = ((): HeaderStatusProps['status'] => {\n if (isAllErrored) return 'error';\n if (isSuccess) return 'success';\n if (hasCancelledFiles) return 'canceled';\n\n return 'uploading';\n })();\n\n const handleCancel = () => {\n abortUpload(uploadId);\n dispatch(cancelUpload());\n };\n\n const handleRetry = async () => {\n try {\n await retryCancelledFiles().unwrap();\n } catch {\n // Error is already dispatched to store from the API queryFn\n }\n };\n\n const handleToggleMinimize = () => {\n dispatch(toggleMinimize());\n };\n\n return (\n <Flex\n background={HEADER_COLOR_MAP[status].background}\n justifyContent=\"space-between\"\n margin={1}\n hasRadius\n >\n <HeaderStatus\n status={status}\n progress={progress}\n totalFiles={totalFiles}\n successfulCount={successfulCount}\n errorCount={errorCount}\n metadataProgress={metadataProgress}\n isGeneratingMetadata={isGeneratingMetadata}\n metadataOutcome={metadataOutcome}\n />\n <Flex gap={1}>\n {!isAllUploaded && (\n <TextButton onClick={handleCancel} fontWeight=\"bold\">\n {formatMessage({\n id: getTranslationKey('upload.progress.cancel'),\n defaultMessage: 'Cancel all',\n })}\n </TextButton>\n )}\n {hasCancelledFiles && (\n <TextButton onClick={handleRetry} fontWeight=\"bold\">\n {formatMessage({\n id: getTranslationKey('upload.progress.retry'),\n defaultMessage: 'Retry',\n })}\n </TextButton>\n )}\n <HeaderIconButton\n onClick={handleToggleMinimize}\n label={formatMessage({\n id: getTranslationKey(\n isMinimized ? 'upload.progress.maximize' : 'upload.progress.minimize'\n ),\n defaultMessage: isMinimized ? 'Maximize' : 'Minimize',\n })}\n variant=\"ghost\"\n >\n <ChevronWrapper $isMinimized={isMinimized}>\n <ChevronDown />\n </ChevronWrapper>\n </HeaderIconButton>\n {isComplete && (\n <Drawer.CloseButton\n onClose={handleClose}\n label={formatMessage({\n id: getTranslationKey('upload.progress.close'),\n defaultMessage: 'Close',\n })}\n />\n )}\n </Flex>\n </Flex>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * UploadProgressDialog\n * -----------------------------------------------------------------------------------------------*/\n\nconst ProgressTrack = styled.div`\n width: 100%;\n height: ${({ theme }) => theme.spaces[1]};\n background-color: ${({ theme }) => theme.colors.neutral200};\n border-radius: 4px;\n overflow: hidden;\n`;\n\nconst ProgressIndicator = styled.div<{ $percent: number }>`\n height: 100%;\n width: ${({ $percent }) => $percent}%;\n background-color: ${({ theme }) => theme.colors.primary700};\n border-radius: 4px;\n transition: width 0.15s linear;\n`;\n\nconst DeterminateBar = ({ percent }: { percent: number }) => {\n const clamped = Math.min(100, Math.max(0, Math.round(percent)));\n return (\n <ProgressTrack role=\"progressbar\" aria-valuemin={0} aria-valuemax={100} aria-valuenow={clamped}>\n <ProgressIndicator $percent={clamped} />\n </ProgressTrack>\n );\n};\n\nconst INDETERMINATE_INDICATOR_WIDTH = 40;\n\n/**\n * `translateX` percentages resolve against the *indicator's* own width, not the track's.\n * So -100% is exactly \"fully off the left edge\" regardless of the width above, and the\n * end offset converts a full track width into those same own-width units. Both ends sit\n * flush off-track, which keeps entry and exit symmetric — a smaller start offset would\n * make the bar pop in already partly visible.\n */\nconst indeterminateSlide = keyframes`\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(${(100 / INDETERMINATE_INDICATOR_WIDTH) * 100}%);\n }\n`;\n\nconst IndeterminateIndicator = styled.div`\n height: 100%;\n width: ${INDETERMINATE_INDICATOR_WIDTH}%;\n background-color: ${({ theme }) => theme.colors.primary700};\n border-radius: 4px;\n /* Linear, not an eased curve: the DS easings decelerate to a stop, which on a loop\n reads as a stall at the wrap point. Constant speed is what makes it read as a sweep. */\n animation: ${indeterminateSlide} 1.2s linear infinite;\n\n /* A perpetually moving bar is a vestibular trigger; fall back to a static track fill. */\n @media (prefers-reduced-motion: reduce) {\n animation: none;\n width: 100%;\n opacity: 0.5;\n }\n`;\n\n/**\n * Progress bar for work whose completion fraction is genuinely unknowable, rather\n * than merely unknown-yet: the AI metadata endpoint answers in one go, and the URL\n * flow can't report bytes until the server has fetched the file and knows its size.\n *\n * Deliberately omits `aria-valuenow` — that absence is precisely how ARIA conveys\n * an indeterminate progressbar, so assistive tech announces \"busy\" instead of \"0%\".\n */\nconst IndeterminateBar = () => {\n return (\n <ProgressTrack role=\"progressbar\" aria-valuemin={0} aria-valuemax={100}>\n <IndeterminateIndicator />\n </ProgressTrack>\n );\n};\n\nconst FileRow = ({\n icon,\n fileName,\n children,\n}: {\n icon: React.ReactNode;\n fileName: string;\n children: React.ReactNode;\n}) => {\n return (\n <Flex direction=\"column\" alignItems=\"stretch\" justifyContent=\"center\" gap={1} width=\"100%\">\n <Flex gap={2}>\n {icon}\n <Typography variant=\"omega\" fontWeight=\"semiBold\" ellipsis>\n {fileName}\n </Typography>\n </Flex>\n {children}\n </Flex>\n );\n};\n\n/**\n * Icon + subline for a successfully uploaded row, keyed by its metadata phase.\n * `'none'` covers rows that never entered the phase — AI metadata disabled — and\n * renders exactly as before this feature existed. Non-images do enter the phase and\n * land on `skipped`.\n *\n * `skipped` uses a neutral `Information` icon, deliberately distinct from\n * generated/failed/cancelled — skipping is an expected outcome for a non-image, not a\n * problem to flag.\n */\nconst COMPLETED_ROW_PRESENTATION: Record<\n FileMetadataStatus | 'none',\n { icon: React.ReactNode; message: MessageDescriptor }\n> = {\n none: {\n icon: <CheckCircle fill=\"success500\" />,\n message: {\n id: getTranslationKey('upload.progress.file.uploaded'),\n defaultMessage: 'Uploaded',\n },\n },\n generating: {\n icon: <Sparkle fill=\"primary600\" />,\n message: {\n id: getTranslationKey('upload.progress.file.generatingMetadata'),\n defaultMessage: 'Uploaded • Generating metadata…',\n },\n },\n generated: {\n icon: <CheckCircle fill=\"success500\" />,\n message: {\n id: getTranslationKey('upload.progress.file.metadataGenerated'),\n defaultMessage: 'Uploaded • Metadata generated',\n },\n },\n skipped: {\n icon: <Information fill=\"neutral500\" />,\n message: {\n id: getTranslationKey('upload.progress.file.metadataSkipped'),\n defaultMessage: 'Upload complete • Metadata generation skipped',\n },\n },\n failed: {\n icon: <WarningCircle fill=\"warning500\" />,\n message: {\n id: getTranslationKey('upload.progress.file.metadataFailed'),\n defaultMessage: 'Upload complete • Metadata generation failed',\n },\n },\n};\n\nconst FileRowRenderer = ({ file }: { file: FileProgress }) => {\n const { formatMessage } = useIntl();\n const isError = file.status === 'error';\n const isCurrentFile = file.status === 'uploading';\n const isCompleted = file.status === 'complete';\n const isCancelled = file.status === 'cancelled';\n\n if (isCurrentFile) {\n // Determinate only once bytes are actually being reported — a known `size` is not\n // enough. The two upload flows differ here:\n // - the direct-file flow streams real byte counts from XHR, so `uploadedBytes`\n // climbs and a determinate bar is meaningful;\n // - the URL flow learns the size from the `file:uploading` SSE event but receives\n // no incremental counts at all (the next event is `file:complete`), so\n // `uploadedBytes` stays 0 for the whole transfer.\n // Keying off `size` alone froze URL rows at a determinate 0% for the entire upload;\n // keying off reported bytes keeps them animating until there is a fraction to show.\n const hasReportedProgress = file.size > 0 && file.uploadedBytes > 0;\n\n return (\n <FileRow icon={<ArrowsCounterClockwise fill=\"secondary600\" />} fileName={file.name}>\n <Typography variant=\"pi\" textColor=\"neutral600\">\n {formatMessage({\n id: getTranslationKey('upload.progress.file.uploading'),\n defaultMessage: 'Uploading...',\n })}\n </Typography>\n {hasReportedProgress ? (\n <DeterminateBar percent={(file.uploadedBytes / file.size) * 100} />\n ) : (\n <IndeterminateBar />\n )}\n </FileRow>\n );\n }\n\n if (isError) {\n return (\n <FileRow icon={<CrossCircle fill=\"danger500\" />} fileName={file.name}>\n <Typography variant=\"pi\" textColor=\"neutral600\">\n {file.error}\n </Typography>\n </FileRow>\n );\n }\n\n if (isCancelled) {\n return (\n <FileRow icon={<MinusCircle fill=\"neutral600\" />} fileName={file.name}>\n <Typography variant=\"pi\" textColor=\"neutral600\">\n {formatMessage({\n id: getTranslationKey('upload.progress.file.canceled'),\n defaultMessage: 'Canceled',\n })}\n </Typography>\n </FileRow>\n );\n }\n\n if (isCompleted) {\n // The upload succeeded; the metadata phase (if any) drives both the icon and the\n // subline from here on — a metadata failure shows a warning, not an upload error.\n const { icon, message } = COMPLETED_ROW_PRESENTATION[file.metadataStatus ?? 'none'];\n\n return (\n <FileRow icon={icon} fileName={file.name}>\n <Typography variant=\"pi\" textColor=\"neutral600\">\n {formatMessage(message)}\n </Typography>\n {/* Generation has no intermediate progress to report, so the bar stays indeterminate. */}\n {file.metadataStatus === 'generating' && <IndeterminateBar />}\n </FileRow>\n );\n }\n\n return null;\n};\n\nconst CompletedFilesList = styled(Flex)`\n flex-direction: column;\n gap: ${({ theme }) => theme.spaces[2]};\n width: 100%;\n`;\n\nexport const UploadProgressDialog = () => {\n const dispatch = useTypedDispatch();\n const { isVisible, isMinimized, files } = useTypedSelector((state) => state.uploadProgress);\n\n // With concurrent uploads several files are `uploading` at once — render every\n // in-flight row, not just the first (a `find` here dated to the strictly\n // sequential era and hid all but the lowest-index worker's row).\n const uploadingFiles = files.filter((f) => f.status === 'uploading');\n const completedFiles = files\n .filter((f) => f.status === 'complete' || f.status === 'error' || f.status === 'cancelled')\n .sort((a, b) => {\n // Sort priority: error > cancelled > complete\n const priority: Record<FileProgressStatus, number> = {\n error: 0,\n cancelled: 1,\n complete: 2,\n uploading: 3,\n pending: 4,\n };\n return priority[a.status] - priority[b.status];\n });\n\n const handleClose = () => {\n dispatch(closeUploadProgress());\n };\n\n return (\n <Drawer.Root isVisible={isVisible} onClose={handleClose}>\n <Drawer.Body animationDirection=\"up\" width=\"41.6rem\" maxHeight=\"34.2rem\">\n <DialogHeader handleClose={handleClose} />\n <Drawer.ScrollableContent isContentExpanded={!isMinimized}>\n <Flex\n direction=\"column\"\n alignItems=\"stretch\"\n gap={4}\n paddingTop={4}\n paddingBottom={4}\n paddingLeft={4}\n paddingRight={4}\n >\n {uploadingFiles.map((file) => (\n <FileRowRenderer key={file.index} file={file} />\n ))}\n\n {completedFiles.length > 0 && (\n <CompletedFilesList>\n {completedFiles.map((file) => (\n <FileRowRenderer key={file.index} file={file} />\n ))}\n </CompletedFilesList>\n )}\n </Flex>\n </Drawer.ScrollableContent>\n </Drawer.Body>\n </Drawer.Root>\n );\n};\n"],"names":["HeaderStatusMessage","title","subtitle","metadataSubtitle","_jsxs","Flex","direction","alignItems","paddingLeft","_jsx","Drawer","Title","Typography","variant","Description","textColor","HeaderStatusIcon","styled","theme","spaces","borderRadius","HeaderStatusWrapper","HeaderStatus","status","progress","totalFiles","successfulCount","errorCount","metadataProgress","isGeneratingMetadata","metadataOutcome","formatMessage","useIntl","id","getTranslationKey","defaultMessage","percentage","undefined","generated","failed","generatedCount","failedCount","count","background","Cross","fill","successCount","Check","MinusCircle","progressPercentage","Math","round","Upload","total","HeaderIconButton","IconButton","ChevronWrapper","span","$isMinimized","HEADER_COLOR_MAP","uploading","canceled","success","error","DialogHeader","handleClose","isMinimized","files","uploadId","useTypedSelector","state","uploadProgress","selectAggregateProgress","selectMetadataProgress","selectIsGeneratingMetadata","selectMetadataOutcome","dispatch","useTypedDispatch","retryCancelledFiles","useRetryCancelledFilesMutation","isComplete","length","every","f","isAllUploaded","isAllErrored","hasCancelledFiles","some","filter","isSuccess","handleCancel","abortUpload","cancelUpload","handleRetry","unwrap","handleToggleMinimize","toggleMinimize","justifyContent","margin","hasRadius","gap","TextButton","onClick","fontWeight","label","ChevronDown","CloseButton","onClose","ProgressTrack","div","colors","neutral200","ProgressIndicator","$percent","primary700","DeterminateBar","percent","clamped","min","max","role","aria-valuemin","aria-valuemax","aria-valuenow","INDETERMINATE_INDICATOR_WIDTH","indeterminateSlide","keyframes","IndeterminateIndicator","IndeterminateBar","FileRow","icon","fileName","children","width","ellipsis","COMPLETED_ROW_PRESENTATION","none","CheckCircle","message","generating","Sparkle","skipped","Information","WarningCircle","FileRowRenderer","file","isError","isCurrentFile","isCompleted","isCancelled","hasReportedProgress","size","uploadedBytes","ArrowsCounterClockwise","name","CrossCircle","metadataStatus","CompletedFilesList","UploadProgressDialog","isVisible","uploadingFiles","completedFiles","sort","a","b","priority","cancelled","complete","pending","closeUploadProgress","Root","Body","animationDirection","maxHeight","ScrollableContent","isContentExpanded","paddingTop","paddingBottom","paddingRight","map","index"],"mappings":";;;;;;;;;;;;;;AAqCA;;qGAIA,MAAMA,sBAAsB,CAAC,EAC3BC,KAAK,EACLC,QAAQ,EACRC,gBAAgB,EAKjB,GAAA;AACC,IAAA,qBACEC,eAAA,CAACC,iBAAAA,EAAAA;QAAKC,SAAAA,EAAU,QAAA;QAASC,UAAAA,EAAW,YAAA;QAA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AAS1C,WAAAA;gCAC1C7D,eAAA,CAACM,cAAOiK,IAAI,EAAA;YAACC,kBAAAA,EAAmB,IAAA;YAAKvC,KAAAA,EAAM,SAAA;YAAUwC,SAAAA,EAAU,SAAA;;8BAC7DpK,cAAA,CAACuD,YAAAA,EAAAA;oBAAaC,WAAAA,EAAaA;;AAC3B,8BAAAxD,cAAA,CAACC,cAAOoK,iBAAiB,EAAA;AAACC,oBAAAA,iBAAAA,EAAmB,CAAC7G,WAAAA;AAC5C,oBAAA,QAAA,gBAAA9D,eAAA,CAACC,iBAAAA,EAAAA;wBACCC,SAAAA,EAAU,QAAA;wBACVC,UAAAA,EAAW,SAAA;wBACX6F,GAAAA,EAAK,CAAA;wBACL4E,UAAAA,EAAY,CAAA;wBACZC,aAAAA,EAAe,CAAA;wBACfzK,WAAAA,EAAa,CAAA;wBACb0K,YAAAA,EAAc,CAAA;;AAEblB,4BAAAA,cAAAA,CAAemB,GAAG,CAAC,CAAClC,IAAAA,iBACnBxI,cAAA,CAACuI,eAAAA,EAAAA;oCAAiCC,IAAAA,EAAMA;AAAlBA,iCAAAA,EAAAA,IAAAA,CAAKmC,KAAK,CAAA,CAAA;4BAGjCnB,cAAAA,CAAehF,MAAM,GAAG,CAAA,kBACvBxE,cAAA,CAACoJ,kBAAAA,EAAAA;AACEI,gCAAAA,QAAAA,EAAAA,cAAAA,CAAekB,GAAG,CAAC,CAAClC,IAAAA,iBACnBxI,cAAA,CAACuI,eAAAA,EAAAA;wCAAiCC,IAAAA,EAAMA;AAAlBA,qCAAAA,EAAAA,IAAAA,CAAKmC,KAAK,CAAA;;;;;;;;AASlD;;;;"}
1
+ {"version":3,"file":"UploadProgressDialog.js","sources":["../../../../admin/src/future/components/UploadProgressDialog.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Flex, IconButton, TextButton, Typography } from '@strapi/design-system';\nimport {\n ArrowsCounterClockwise,\n Check,\n CheckCircle,\n ChevronDown,\n Clock,\n Cross,\n CrossCircle,\n Information,\n MinusCircle,\n Sparkle,\n Upload,\n WarningCircle,\n} from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { keyframes, styled } from 'styled-components';\n\nimport { abortUpload, useRetryCancelledFilesMutation } from '../services/api';\nimport { useTypedDispatch, useTypedSelector } from '../store/hooks';\nimport {\n closeUploadProgress,\n toggleMinimize,\n cancelUpload,\n selectAggregateProgress,\n selectMetadataProgress,\n selectIsGeneratingMetadata,\n selectMetadataOutcome,\n} from '../store/uploadProgress';\nimport { getTranslationKey } from '../utils/translations';\n\nimport { Drawer } from './Drawer';\n\nimport type { FileMetadataStatus, FileProgress, FileProgressStatus } from '../store/uploadProgress';\nimport type { MessageDescriptor } from 'react-intl';\n\n/* -------------------------------------------------------------------------------------------------\n * DialogHeader\n * -----------------------------------------------------------------------------------------------*/\n\nconst HeaderStatusMessage = ({\n title,\n subtitle,\n metadataSubtitle,\n}: {\n title: string;\n subtitle?: string;\n metadataSubtitle?: string;\n}) => {\n return (\n <Flex direction=\"column\" alignItems=\"flex-start\" paddingLeft={2}>\n <Drawer.Title>\n <Typography variant=\"omega\">{title}</Typography>\n </Drawer.Title>\n <Drawer.Description>\n <Typography variant=\"pi\" textColor=\"neutral600\">\n {subtitle}\n </Typography>\n </Drawer.Description>\n {metadataSubtitle && (\n <Typography variant=\"pi\" textColor=\"neutral600\">\n {metadataSubtitle}\n </Typography>\n )}\n </Flex>\n );\n};\n\nconst HeaderStatusIcon = styled(Flex)`\n padding: ${({ theme }) => theme.spaces[3]};\n border-radius: ${({ theme }) => `${theme.borderRadius} 0 0 ${theme.borderRadius}`};\n\n > svg {\n height: 24px;\n width: 24px;\n }\n`;\n\nconst HeaderStatusWrapper = styled(Flex)`\n align-items: center;\n`;\n\ntype HeaderStatusProps = {\n status: 'uploading' | 'success' | 'error' | 'canceled';\n progress?: number;\n totalFiles: number;\n successfulCount: number;\n errorCount: number;\n /**\n * Count-based metadata progress, or `null` when no row entered the metadata phase.\n * Shown as an extra subtitle while generation is still in flight.\n */\n metadataProgress: number | null;\n /** Whether any row is still generating — drives whether the subtitle shows at all. */\n isGeneratingMetadata: boolean;\n /**\n * Terminal per-outcome counts, or `null` while the phase is unfinished or was never\n * entered. Replaces the in-flight subtitle once generation settles.\n */\n metadataOutcome: { generated: number; skipped: number; failed: number } | null;\n};\n\nconst HeaderStatus = ({\n status,\n progress,\n totalFiles,\n successfulCount,\n errorCount,\n metadataProgress,\n isGeneratingMetadata,\n metadataOutcome,\n}: HeaderStatusProps) => {\n const { formatMessage } = useIntl();\n\n // Completion is upload-driven, so the terminal header can appear while metadata is\n // still generating — the subtitle keeps ticking underneath until it settles.\n //\n // Gated on work actually being in flight rather than on `progress < 100`: in a\n // sequential batch the percentage touches 100% between files, which would blink the\n // subtitle out and back in on every upload.\n //\n // Once the phase settles the line is not dropped but replaced with the outcome, so the\n // header keeps confirming what happened instead of silently losing the message.\n const metadataSubtitle = (() => {\n if (metadataProgress !== null && isGeneratingMetadata) {\n return formatMessage(\n {\n id: getTranslationKey('upload.progress.generatingMetadata.withCount'),\n defaultMessage: 'Generating metadata with AI ({percentage}%)',\n },\n { percentage: metadataProgress }\n );\n }\n\n if (metadataOutcome === null) {\n return undefined;\n }\n\n // Only `generated` rows had metadata written, so only they can be reported as a\n // success. With none, there is nothing to confirm — an all-skipped batch of\n // non-images would otherwise read as \"generated on 0 files\". Per-row sublines\n // already spell out skipped and failed outcomes.\n if (metadataOutcome.generated === 0) {\n return undefined;\n }\n\n if (metadataOutcome.failed > 0) {\n return formatMessage(\n {\n id: getTranslationKey('upload.progress.metadataGenerated.withFailures'),\n defaultMessage: '{generatedCount} generated, {failedCount} failed',\n },\n { generatedCount: metadataOutcome.generated, failedCount: metadataOutcome.failed }\n );\n }\n\n return formatMessage(\n {\n id: getTranslationKey('upload.progress.metadataGenerated.withCount'),\n defaultMessage:\n '{count, plural, one {Metadata successfully generated on # file} other {Metadata successfully generated on # files}}',\n },\n { count: metadataOutcome.generated }\n );\n })();\n\n if (status === 'error') {\n return (\n <HeaderStatusWrapper>\n <HeaderStatusIcon background=\"danger200\">\n <Cross fill=\"danger700\" />\n </HeaderStatusIcon>\n <HeaderStatusMessage\n title={formatMessage({\n id: getTranslationKey('upload.progress.failed'),\n defaultMessage: 'Upload failed',\n })}\n subtitle={formatMessage({\n id: getTranslationKey('upload.progress.failed.subtitle'),\n defaultMessage: 'Please try to upload files again',\n })}\n />\n </HeaderStatusWrapper>\n );\n }\n\n if (status === 'success') {\n const subtitle =\n errorCount > 0\n ? formatMessage(\n {\n id: getTranslationKey('upload.progress.success.subtitle.withErrors'),\n defaultMessage: '{successCount} uploaded, {errorCount} failed',\n },\n { successCount: successfulCount, errorCount }\n )\n : formatMessage(\n {\n id: getTranslationKey('upload.progress.success.subtitle'),\n defaultMessage: '{count} files uploaded successfully',\n },\n { count: successfulCount }\n );\n\n return (\n <HeaderStatusWrapper>\n <HeaderStatusIcon background=\"success200\">\n <Check fill=\"success700\" />\n </HeaderStatusIcon>\n <HeaderStatusMessage\n title={formatMessage({\n id: getTranslationKey('upload.progress.success'),\n defaultMessage: 'Upload successful!',\n })}\n subtitle={subtitle}\n metadataSubtitle={metadataSubtitle}\n />\n </HeaderStatusWrapper>\n );\n }\n\n if (status === 'canceled') {\n return (\n <HeaderStatusWrapper>\n <HeaderStatusIcon background=\"neutral200\">\n <MinusCircle fill=\"neutral700\" />\n </HeaderStatusIcon>\n <HeaderStatusMessage\n title={formatMessage({\n id: getTranslationKey('upload.progress.canceled'),\n defaultMessage: 'Upload canceled',\n })}\n subtitle={formatMessage({\n id: getTranslationKey('upload.progress.canceled.subtitle'),\n defaultMessage: 'Some files were not uploaded',\n })}\n metadataSubtitle={metadataSubtitle}\n />\n </HeaderStatusWrapper>\n );\n }\n\n if (status === 'uploading') {\n const progressPercentage = progress ? Math.round(progress) : 0;\n\n return (\n <HeaderStatusWrapper>\n <HeaderStatusIcon background=\"primary200\">\n <Upload fill=\"primary700\" />\n </HeaderStatusIcon>\n <HeaderStatusMessage\n title={formatMessage(\n {\n id: getTranslationKey('upload.progress.uploading.withCount'),\n defaultMessage: 'Uploading {total} items ({percentage}%)',\n },\n {\n total: totalFiles,\n percentage: progressPercentage,\n }\n )}\n metadataSubtitle={metadataSubtitle}\n />\n </HeaderStatusWrapper>\n );\n }\n\n return null;\n};\n\nconst HeaderIconButton = styled(IconButton)`\n &:hover {\n background: transparent;\n }\n`;\n\nconst ChevronWrapper = styled.span<{ $isMinimized: boolean }>`\n display: flex;\n transition: transform 0.5s ease-in-out;\n transform: ${({ $isMinimized }) => ($isMinimized ? 'rotate(180deg)' : 'rotate(0deg)')};\n`;\n\nconst HEADER_COLOR_MAP = {\n uploading: { background: 'primary100' },\n canceled: { background: 'neutral100' },\n success: { background: 'success100' },\n error: { background: 'danger100' },\n} as const;\n\nconst DialogHeader = ({ handleClose }: { handleClose: () => void }) => {\n const { formatMessage } = useIntl();\n\n const { isMinimized, files, uploadId, totalFiles } = useTypedSelector(\n (state) => state.uploadProgress\n );\n const progress = useTypedSelector(selectAggregateProgress);\n const metadataProgress = useTypedSelector(selectMetadataProgress);\n const isGeneratingMetadata = useTypedSelector(selectIsGeneratingMetadata);\n const metadataOutcome = useTypedSelector(selectMetadataOutcome);\n const dispatch = useTypedDispatch();\n const [retryCancelledFiles] = useRetryCancelledFilesMutation();\n\n // The batch is complete once every file has reached a terminal state. Byte-weighted\n // progress can't be used here because errored/cancelled rows never reach 100%.\n const isComplete =\n files.length > 0 &&\n files.every((f) => f.status === 'complete' || f.status === 'error' || f.status === 'cancelled');\n const isAllUploaded = isComplete;\n const isAllErrored = isComplete && files.every((f) => f.status === 'error');\n const hasCancelledFiles = files.some((f) => f.status === 'cancelled');\n const successfulCount = files.filter((f) => f.status === 'complete').length;\n const errorCount = files.filter((f) => f.status === 'error').length;\n // Success includes partial success (some files succeeded, even if some failed)\n const isSuccess = isComplete && successfulCount > 0 && !hasCancelledFiles;\n const status = ((): HeaderStatusProps['status'] => {\n if (isAllErrored) return 'error';\n if (isSuccess) return 'success';\n if (hasCancelledFiles) return 'canceled';\n\n return 'uploading';\n })();\n\n const handleCancel = () => {\n abortUpload(uploadId);\n dispatch(cancelUpload());\n };\n\n const handleRetry = async () => {\n try {\n await retryCancelledFiles().unwrap();\n } catch {\n // Error is already dispatched to store from the API queryFn\n }\n };\n\n const handleToggleMinimize = () => {\n dispatch(toggleMinimize());\n };\n\n return (\n <Flex\n background={HEADER_COLOR_MAP[status].background}\n justifyContent=\"space-between\"\n margin={1}\n hasRadius\n >\n <HeaderStatus\n status={status}\n progress={progress}\n totalFiles={totalFiles}\n successfulCount={successfulCount}\n errorCount={errorCount}\n metadataProgress={metadataProgress}\n isGeneratingMetadata={isGeneratingMetadata}\n metadataOutcome={metadataOutcome}\n />\n <Flex gap={1}>\n {!isAllUploaded && (\n <TextButton onClick={handleCancel} fontWeight=\"bold\">\n {formatMessage({\n id: getTranslationKey('upload.progress.cancel'),\n defaultMessage: 'Cancel all',\n })}\n </TextButton>\n )}\n {hasCancelledFiles && (\n <TextButton onClick={handleRetry} fontWeight=\"bold\">\n {formatMessage({\n id: getTranslationKey('upload.progress.retry'),\n defaultMessage: 'Retry',\n })}\n </TextButton>\n )}\n <HeaderIconButton\n onClick={handleToggleMinimize}\n label={formatMessage({\n id: getTranslationKey(\n isMinimized ? 'upload.progress.maximize' : 'upload.progress.minimize'\n ),\n defaultMessage: isMinimized ? 'Maximize' : 'Minimize',\n })}\n variant=\"ghost\"\n >\n <ChevronWrapper $isMinimized={isMinimized}>\n <ChevronDown />\n </ChevronWrapper>\n </HeaderIconButton>\n {isComplete && (\n <Drawer.CloseButton\n onClose={handleClose}\n label={formatMessage({\n id: getTranslationKey('upload.progress.close'),\n defaultMessage: 'Close',\n })}\n />\n )}\n </Flex>\n </Flex>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * UploadProgressDialog\n * -----------------------------------------------------------------------------------------------*/\n\nconst ProgressTrack = styled.div`\n width: 100%;\n height: ${({ theme }) => theme.spaces[1]};\n background-color: ${({ theme }) => theme.colors.neutral200};\n border-radius: 4px;\n overflow: hidden;\n`;\n\nconst ProgressIndicator = styled.div<{ $percent: number }>`\n height: 100%;\n width: ${({ $percent }) => $percent}%;\n background-color: ${({ theme }) => theme.colors.primary700};\n border-radius: 4px;\n transition: width 0.15s linear;\n`;\n\nconst DeterminateBar = ({ percent }: { percent: number }) => {\n const clamped = Math.min(100, Math.max(0, Math.round(percent)));\n return (\n <ProgressTrack role=\"progressbar\" aria-valuemin={0} aria-valuemax={100} aria-valuenow={clamped}>\n <ProgressIndicator $percent={clamped} />\n </ProgressTrack>\n );\n};\n\nconst INDETERMINATE_INDICATOR_WIDTH = 40;\n\n/**\n * `translateX` percentages resolve against the *indicator's* own width, not the track's.\n * So -100% is exactly \"fully off the left edge\" regardless of the width above, and the\n * end offset converts a full track width into those same own-width units. Both ends sit\n * flush off-track, which keeps entry and exit symmetric — a smaller start offset would\n * make the bar pop in already partly visible.\n */\nconst indeterminateSlide = keyframes`\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(${(100 / INDETERMINATE_INDICATOR_WIDTH) * 100}%);\n }\n`;\n\nconst IndeterminateIndicator = styled.div`\n height: 100%;\n width: ${INDETERMINATE_INDICATOR_WIDTH}%;\n background-color: ${({ theme }) => theme.colors.primary700};\n border-radius: 4px;\n /* Linear, not an eased curve: the DS easings decelerate to a stop, which on a loop\n reads as a stall at the wrap point. Constant speed is what makes it read as a sweep. */\n animation: ${indeterminateSlide} 1.2s linear infinite;\n\n /* A perpetually moving bar is a vestibular trigger; fall back to a static track fill. */\n @media (prefers-reduced-motion: reduce) {\n animation: none;\n width: 100%;\n opacity: 0.5;\n }\n`;\n\n/**\n * Progress bar for work whose completion fraction is genuinely unknowable, rather\n * than merely unknown-yet: the AI metadata endpoint answers in one go, and the URL\n * flow can't report bytes until the server has fetched the file and knows its size.\n *\n * Deliberately omits `aria-valuenow` — that absence is precisely how ARIA conveys\n * an indeterminate progressbar, so assistive tech announces \"busy\" instead of \"0%\".\n */\nconst IndeterminateBar = () => {\n return (\n <ProgressTrack role=\"progressbar\" aria-valuemin={0} aria-valuemax={100}>\n <IndeterminateIndicator />\n </ProgressTrack>\n );\n};\n\nconst FileRow = ({\n icon,\n fileName,\n children,\n}: {\n icon: React.ReactNode;\n fileName: string;\n children: React.ReactNode;\n}) => {\n return (\n <Flex direction=\"column\" alignItems=\"stretch\" justifyContent=\"center\" gap={1} width=\"100%\">\n <Flex gap={2}>\n {icon}\n <Typography variant=\"omega\" fontWeight=\"semiBold\" ellipsis>\n {fileName}\n </Typography>\n </Flex>\n {children}\n </Flex>\n );\n};\n\n/**\n * Icon + subline for a successfully uploaded row, keyed by its metadata phase.\n * `'none'` covers rows that never entered the phase — AI metadata disabled — and\n * renders exactly as before this feature existed. Non-images do enter the phase and\n * land on `skipped`.\n *\n * `skipped` uses a neutral `Information` icon, deliberately distinct from\n * generated/failed/cancelled — skipping is an expected outcome for a non-image, not a\n * problem to flag.\n */\nconst COMPLETED_ROW_PRESENTATION: Record<\n FileMetadataStatus | 'none',\n { icon: React.ReactNode; message: MessageDescriptor }\n> = {\n none: {\n icon: <CheckCircle fill=\"success500\" />,\n message: {\n id: getTranslationKey('upload.progress.file.uploaded'),\n defaultMessage: 'Uploaded',\n },\n },\n generating: {\n icon: <Sparkle fill=\"primary600\" />,\n message: {\n id: getTranslationKey('upload.progress.file.generatingMetadata'),\n defaultMessage: 'Uploaded • Generating metadata…',\n },\n },\n generated: {\n icon: <CheckCircle fill=\"success500\" />,\n message: {\n id: getTranslationKey('upload.progress.file.metadataGenerated'),\n defaultMessage: 'Uploaded • Metadata generated',\n },\n },\n skipped: {\n icon: <Information fill=\"neutral500\" />,\n message: {\n id: getTranslationKey('upload.progress.file.metadataSkipped'),\n defaultMessage: 'Upload complete • Metadata generation skipped',\n },\n },\n failed: {\n icon: <WarningCircle fill=\"warning500\" />,\n message: {\n id: getTranslationKey('upload.progress.file.metadataFailed'),\n defaultMessage: 'Upload complete • Metadata generation failed',\n },\n },\n};\n\nconst FileRowRenderer = ({ file }: { file: FileProgress }) => {\n const { formatMessage } = useIntl();\n const isError = file.status === 'error';\n const isCurrentFile = file.status === 'uploading';\n const isCompleted = file.status === 'complete';\n const isCancelled = file.status === 'cancelled';\n const isQueued = file.status === 'pending';\n\n if (isQueued) {\n // No bar: there is nothing to report yet, and an indeterminate bar would read\n // as \"in progress\" on a file the pool has not picked up.\n return (\n <FileRow icon={<Clock fill=\"neutral600\" />} fileName={file.name}>\n <Typography variant=\"pi\" textColor=\"neutral600\">\n {formatMessage({\n id: getTranslationKey('upload.progress.file.queued'),\n defaultMessage: 'Queued',\n })}\n </Typography>\n </FileRow>\n );\n }\n\n if (isCurrentFile) {\n // Determinate only once bytes are actually being reported — a known `size` is not\n // enough. The two upload flows differ here:\n // - the direct-file flow streams real byte counts from XHR, so `uploadedBytes`\n // climbs and a determinate bar is meaningful;\n // - the URL flow learns the size from the `file:uploading` SSE event but receives\n // no incremental counts at all (the next event is `file:complete`), so\n // `uploadedBytes` stays 0 for the whole transfer.\n // Keying off `size` alone froze URL rows at a determinate 0% for the entire upload;\n // keying off reported bytes keeps them animating until there is a fraction to show.\n const hasReportedProgress = file.size > 0 && file.uploadedBytes > 0;\n\n return (\n <FileRow icon={<ArrowsCounterClockwise fill=\"secondary600\" />} fileName={file.name}>\n <Typography variant=\"pi\" textColor=\"neutral600\">\n {formatMessage({\n id: getTranslationKey('upload.progress.file.uploading'),\n defaultMessage: 'Uploading...',\n })}\n </Typography>\n {hasReportedProgress ? (\n <DeterminateBar percent={(file.uploadedBytes / file.size) * 100} />\n ) : (\n <IndeterminateBar />\n )}\n </FileRow>\n );\n }\n\n if (isError) {\n return (\n <FileRow icon={<CrossCircle fill=\"danger500\" />} fileName={file.name}>\n <Typography variant=\"pi\" textColor=\"neutral600\">\n {file.error\n ? /**\n * The server may return a machine-readable code (e.g. `FileTooBig` from the\n * body middleware) or an already human-readable sentence (e.g. the upload\n * plugin's size-limit message). Translate the former, fall back to the latter.\n */\n formatMessage({\n id: getTranslationKey(`apiError.${file.error}`),\n defaultMessage: file.error,\n })\n : formatMessage({\n id: getTranslationKey('upload.generic-error'),\n defaultMessage: 'An error occurred while uploading the file.',\n })}\n </Typography>\n </FileRow>\n );\n }\n\n if (isCancelled) {\n return (\n <FileRow icon={<MinusCircle fill=\"neutral600\" />} fileName={file.name}>\n <Typography variant=\"pi\" textColor=\"neutral600\">\n {formatMessage({\n id: getTranslationKey('upload.progress.file.canceled'),\n defaultMessage: 'Canceled',\n })}\n </Typography>\n </FileRow>\n );\n }\n\n if (isCompleted) {\n // The upload succeeded; the metadata phase (if any) drives both the icon and the\n // subline from here on — a metadata failure shows a warning, not an upload error.\n const { icon, message } = COMPLETED_ROW_PRESENTATION[file.metadataStatus ?? 'none'];\n\n return (\n <FileRow icon={icon} fileName={file.name}>\n <Typography variant=\"pi\" textColor=\"neutral600\">\n {formatMessage(message)}\n </Typography>\n {/* Generation has no intermediate progress to report, so the bar stays indeterminate. */}\n {file.metadataStatus === 'generating' && <IndeterminateBar />}\n </FileRow>\n );\n }\n\n return null;\n};\n\nconst CompletedFilesList = styled(Flex)`\n flex-direction: column;\n gap: ${({ theme }) => theme.spaces[2]};\n width: 100%;\n`;\n\nexport const UploadProgressDialog = () => {\n const dispatch = useTypedDispatch();\n const { isVisible, isMinimized, files } = useTypedSelector((state) => state.uploadProgress);\n\n // With concurrent uploads several files are `uploading` at once — render every\n // in-flight row, not just the first (a `find` here dated to the strictly\n // sequential era and hid all but the lowest-index worker's row).\n const uploadingFiles = files.filter((f) => f.status === 'uploading');\n // Everything the pool has not reached yet. Listed in queue order, which is the\n // order `files` is already in, so a row's position tells the user where it sits.\n const queuedFiles = files.filter((f) => f.status === 'pending');\n const completedFiles = files\n .filter((f) => f.status === 'complete' || f.status === 'error' || f.status === 'cancelled')\n .sort((a, b) => {\n // Sort priority: error > cancelled > complete\n const priority: Record<FileProgressStatus, number> = {\n error: 0,\n cancelled: 1,\n complete: 2,\n uploading: 3,\n pending: 4,\n };\n return priority[a.status] - priority[b.status];\n });\n\n const handleClose = () => {\n dispatch(closeUploadProgress());\n };\n\n return (\n <Drawer.Root isVisible={isVisible} onClose={handleClose}>\n <Drawer.Body animationDirection=\"up\" width=\"41.6rem\" maxHeight=\"34.2rem\">\n <DialogHeader handleClose={handleClose} />\n <Drawer.ScrollableContent isContentExpanded={!isMinimized}>\n <Flex\n direction=\"column\"\n alignItems=\"stretch\"\n gap={4}\n paddingTop={4}\n paddingBottom={4}\n paddingLeft={4}\n paddingRight={4}\n >\n {uploadingFiles.map((file) => (\n <FileRowRenderer key={file.index} file={file} />\n ))}\n\n {queuedFiles.map((file) => (\n <FileRowRenderer key={file.index} file={file} />\n ))}\n\n {completedFiles.length > 0 && (\n <CompletedFilesList>\n {completedFiles.map((file) => (\n <FileRowRenderer key={file.index} file={file} />\n ))}\n </CompletedFilesList>\n )}\n </Flex>\n </Drawer.ScrollableContent>\n </Drawer.Body>\n </Drawer.Root>\n );\n};\n"],"names":["HeaderStatusMessage","title","subtitle","metadataSubtitle","_jsxs","Flex","direction","alignItems","paddingLeft","_jsx","Drawer","Title","Typography","variant","Description","textColor","HeaderStatusIcon","styled","theme","spaces","borderRadius","HeaderStatusWrapper","HeaderStatus","status","progress","totalFiles","successfulCount","errorCount","metadataProgress","isGeneratingMetadata","metadataOutcome","formatMessage","useIntl","id","getTranslationKey","defaultMessage","percentage","undefined","generated","failed","generatedCount","failedCount","count","background","Cross","fill","successCount","Check","MinusCircle","progressPercentage","Math","round","Upload","total","HeaderIconButton","IconButton","ChevronWrapper","span","$isMinimized","HEADER_COLOR_MAP","uploading","canceled","success","error","DialogHeader","handleClose","isMinimized","files","uploadId","useTypedSelector","state","uploadProgress","selectAggregateProgress","selectMetadataProgress","selectIsGeneratingMetadata","selectMetadataOutcome","dispatch","useTypedDispatch","retryCancelledFiles","useRetryCancelledFilesMutation","isComplete","length","every","f","isAllUploaded","isAllErrored","hasCancelledFiles","some","filter","isSuccess","handleCancel","abortUpload","cancelUpload","handleRetry","unwrap","handleToggleMinimize","toggleMinimize","justifyContent","margin","hasRadius","gap","TextButton","onClick","fontWeight","label","ChevronDown","CloseButton","onClose","ProgressTrack","div","colors","neutral200","ProgressIndicator","$percent","primary700","DeterminateBar","percent","clamped","min","max","role","aria-valuemin","aria-valuemax","aria-valuenow","INDETERMINATE_INDICATOR_WIDTH","indeterminateSlide","keyframes","IndeterminateIndicator","IndeterminateBar","FileRow","icon","fileName","children","width","ellipsis","COMPLETED_ROW_PRESENTATION","none","CheckCircle","message","generating","Sparkle","skipped","Information","WarningCircle","FileRowRenderer","file","isError","isCurrentFile","isCompleted","isCancelled","isQueued","Clock","name","hasReportedProgress","size","uploadedBytes","ArrowsCounterClockwise","CrossCircle","metadataStatus","CompletedFilesList","UploadProgressDialog","isVisible","uploadingFiles","queuedFiles","completedFiles","sort","a","b","priority","cancelled","complete","pending","closeUploadProgress","Root","Body","animationDirection","maxHeight","ScrollableContent","isContentExpanded","paddingTop","paddingBottom","paddingRight","map","index"],"mappings":";;;;;;;;;;;;;;AAsCA;;qGAIA,MAAMA,sBAAsB,CAAC,EAC3BC,KAAK,EACLC,QAAQ,EACRC,gBAAgB,EAKjB,GAAA;AACC,IAAA,qBACEC,eAAA,CAACC,iBAAAA,EAAAA;QAAKC,SAAAA,EAAU,QAAA;QAASC,UAAAA,EAAW,YAAA;QAAaC,WAAAA,EAAa,CAAA;;AAC5D,0BAAAC,cAAA,CAACC,cAAOC,KAAK,EAAA;AACX,gBAAA,QAAA,gBAAAF,cAAA,CAACG,uBAAAA,EAAAA;oBAAWC,OAAAA,EAAQ,OAAA;AAASZ,oBAAAA,QAAAA,EAAAA;;;AAE/B,0BAAAQ,cAAA,CAACC,cAAOI,WAAW,EAAA;AACjB,gBAAA,QAAA,gBAAAL,cAAA,CAACG,uBAAAA,EAAAA;oBAAWC,OAAAA,EAAQ,IAAA;oBAAKE,SAAAA,EAAU,YAAA;AAChCb,oBAAAA,QAAAA,EAAAA;;;AAG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A;AAAlBA,iCAAAA,EAAAA,IAAAA,CAAKsC,KAAK,CAAA,CAAA;AAGjCpB,4BAAAA,WAAAA,CAAYmB,GAAG,CAAC,CAACrC,IAAAA,iBAChBxI,cAAA,CAACuI,eAAAA,EAAAA;oCAAiCC,IAAAA,EAAMA;AAAlBA,iCAAAA,EAAAA,IAAAA,CAAKsC,KAAK,CAAA,CAAA;4BAGjCnB,cAAAA,CAAenF,MAAM,GAAG,CAAA,kBACvBxE,cAAA,CAACsJ,kBAAAA,EAAAA;AACEK,gCAAAA,QAAAA,EAAAA,cAAAA,CAAekB,GAAG,CAAC,CAACrC,IAAAA,iBACnBxI,cAAA,CAACuI,eAAAA,EAAAA;wCAAiCC,IAAAA,EAAMA;AAAlBA,qCAAAA,EAAAA,IAAAA,CAAKsC,KAAK,CAAA;;;;;;;;AASlD;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import 'react';
3
3
  import { Flex, IconButton, TextButton, Typography } from '@strapi/design-system';
4
- import { ChevronDown, ArrowsCounterClockwise, CrossCircle, MinusCircle, Cross, Check, Upload, WarningCircle, Information, CheckCircle, Sparkle } from '@strapi/icons';
4
+ import { ChevronDown, Clock, ArrowsCounterClockwise, CrossCircle, MinusCircle, Cross, Check, Upload, WarningCircle, Information, CheckCircle, Sparkle } from '@strapi/icons';
5
5
  import { useIntl } from 'react-intl';
6
6
  import { styled, keyframes } from 'styled-components';
7
7
  import { useRetryCancelledFilesMutation, abortUpload } from '../services/api.mjs';
@@ -481,6 +481,25 @@ const FileRowRenderer = ({ file })=>{
481
481
  const isCurrentFile = file.status === 'uploading';
482
482
  const isCompleted = file.status === 'complete';
483
483
  const isCancelled = file.status === 'cancelled';
484
+ const isQueued = file.status === 'pending';
485
+ if (isQueued) {
486
+ // No bar: there is nothing to report yet, and an indeterminate bar would read
487
+ // as "in progress" on a file the pool has not picked up.
488
+ return /*#__PURE__*/ jsx(FileRow, {
489
+ icon: /*#__PURE__*/ jsx(Clock, {
490
+ fill: "neutral600"
491
+ }),
492
+ fileName: file.name,
493
+ children: /*#__PURE__*/ jsx(Typography, {
494
+ variant: "pi",
495
+ textColor: "neutral600",
496
+ children: formatMessage({
497
+ id: getTranslationKey('upload.progress.file.queued'),
498
+ defaultMessage: 'Queued'
499
+ })
500
+ })
501
+ });
502
+ }
484
503
  if (isCurrentFile) {
485
504
  // Determinate only once bytes are actually being reported — a known `size` is not
486
505
  // enough. The two upload flows differ here:
@@ -521,7 +540,17 @@ const FileRowRenderer = ({ file })=>{
521
540
  children: /*#__PURE__*/ jsx(Typography, {
522
541
  variant: "pi",
523
542
  textColor: "neutral600",
524
- children: file.error
543
+ children: file.error ? /**
544
+ * The server may return a machine-readable code (e.g. `FileTooBig` from the
545
+ * body middleware) or an already human-readable sentence (e.g. the upload
546
+ * plugin's size-limit message). Translate the former, fall back to the latter.
547
+ */ formatMessage({
548
+ id: getTranslationKey(`apiError.${file.error}`),
549
+ defaultMessage: file.error
550
+ }) : formatMessage({
551
+ id: getTranslationKey('upload.generic-error'),
552
+ defaultMessage: 'An error occurred while uploading the file.'
553
+ })
525
554
  })
526
555
  });
527
556
  }
@@ -572,6 +601,9 @@ const UploadProgressDialog = ()=>{
572
601
  // in-flight row, not just the first (a `find` here dated to the strictly
573
602
  // sequential era and hid all but the lowest-index worker's row).
574
603
  const uploadingFiles = files.filter((f)=>f.status === 'uploading');
604
+ // Everything the pool has not reached yet. Listed in queue order, which is the
605
+ // order `files` is already in, so a row's position tells the user where it sits.
606
+ const queuedFiles = files.filter((f)=>f.status === 'pending');
575
607
  const completedFiles = files.filter((f)=>f.status === 'complete' || f.status === 'error' || f.status === 'cancelled').sort((a, b)=>{
576
608
  // Sort priority: error > cancelled > complete
577
609
  const priority = {
@@ -611,6 +643,9 @@ const UploadProgressDialog = ()=>{
611
643
  uploadingFiles.map((file)=>/*#__PURE__*/ jsx(FileRowRenderer, {
612
644
  file: file
613
645
  }, file.index)),
646
+ queuedFiles.map((file)=>/*#__PURE__*/ jsx(FileRowRenderer, {
647
+ file: file
648
+ }, file.index)),
614
649
  completedFiles.length > 0 && /*#__PURE__*/ jsx(CompletedFilesList, {
615
650
  children: completedFiles.map((file)=>/*#__PURE__*/ jsx(FileRowRenderer, {
616
651
  file: file