@anvilkit/plugin-asset-manager 0.1.9 → 0.1.10

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 (235) hide show
  1. package/README.md +96 -3
  2. package/dist/adapters/data-url.d.cts +1 -0
  3. package/dist/adapters/data-url.d.cts.map +1 -1
  4. package/dist/adapters/data-url.d.ts +1 -0
  5. package/dist/adapters/data-url.d.ts.map +1 -1
  6. package/dist/adapters/s3-multipart.cjs +425 -0
  7. package/dist/adapters/s3-multipart.d.cts +43 -0
  8. package/dist/adapters/s3-multipart.d.cts.map +1 -0
  9. package/dist/adapters/s3-multipart.d.ts +43 -0
  10. package/dist/adapters/s3-multipart.d.ts.map +1 -0
  11. package/dist/adapters/s3-multipart.js +387 -0
  12. package/dist/adapters/s3-presigned.d.cts +2 -0
  13. package/dist/adapters/s3-presigned.d.cts.map +1 -1
  14. package/dist/adapters/s3-presigned.d.ts +2 -0
  15. package/dist/adapters/s3-presigned.d.ts.map +1 -1
  16. package/dist/i18n/provider.d.cts +1 -0
  17. package/dist/i18n/provider.d.cts.map +1 -1
  18. package/dist/i18n/provider.d.ts +1 -0
  19. package/dist/i18n/provider.d.ts.map +1 -1
  20. package/dist/index.cjs +14 -0
  21. package/dist/index.d.cts +9 -3
  22. package/dist/index.d.cts.map +1 -1
  23. package/dist/index.d.ts +9 -3
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +3 -1
  26. package/dist/plugin.cjs +152 -12
  27. package/dist/plugin.d.cts +49 -1
  28. package/dist/plugin.d.cts.map +1 -1
  29. package/dist/plugin.d.ts +49 -1
  30. package/dist/plugin.d.ts.map +1 -1
  31. package/dist/plugin.js +147 -13
  32. package/dist/sources/composite-source.cjs +3 -0
  33. package/dist/sources/composite-source.d.cts.map +1 -1
  34. package/dist/sources/composite-source.d.ts.map +1 -1
  35. package/dist/sources/composite-source.js +3 -0
  36. package/dist/sources/federated-search.cjs +45 -7
  37. package/dist/sources/federated-search.d.cts.map +1 -1
  38. package/dist/sources/federated-search.d.ts.map +1 -1
  39. package/dist/sources/federated-search.js +45 -7
  40. package/dist/sources/provider.d.cts +5 -0
  41. package/dist/sources/provider.d.cts.map +1 -1
  42. package/dist/sources/provider.d.ts +5 -0
  43. package/dist/sources/provider.d.ts.map +1 -1
  44. package/dist/sources/unsplash/index.d.cts +1 -0
  45. package/dist/sources/unsplash/index.d.cts.map +1 -1
  46. package/dist/sources/unsplash/index.d.ts +1 -0
  47. package/dist/sources/unsplash/index.d.ts.map +1 -1
  48. package/dist/testing/index.d.cts +4 -0
  49. package/dist/testing/index.d.cts.map +1 -1
  50. package/dist/testing/index.d.ts +4 -0
  51. package/dist/testing/index.d.ts.map +1 -1
  52. package/dist/types/categories.d.cts +3 -0
  53. package/dist/types/categories.d.cts.map +1 -1
  54. package/dist/types/categories.d.ts +3 -0
  55. package/dist/types/categories.d.ts.map +1 -1
  56. package/dist/types/data-source.d.cts +9 -0
  57. package/dist/types/data-source.d.cts.map +1 -1
  58. package/dist/types/data-source.d.ts +9 -0
  59. package/dist/types/data-source.d.ts.map +1 -1
  60. package/dist/types/filter.d.cts +11 -0
  61. package/dist/types/filter.d.cts.map +1 -1
  62. package/dist/types/filter.d.ts +11 -0
  63. package/dist/types/filter.d.ts.map +1 -1
  64. package/dist/types/folders.d.cts +2 -0
  65. package/dist/types/folders.d.cts.map +1 -1
  66. package/dist/types/folders.d.ts +2 -0
  67. package/dist/types/folders.d.ts.map +1 -1
  68. package/dist/types/options.d.cts +57 -1
  69. package/dist/types/options.d.cts.map +1 -1
  70. package/dist/types/options.d.ts +57 -1
  71. package/dist/types/options.d.ts.map +1 -1
  72. package/dist/types/resumable.cjs +42 -0
  73. package/dist/types/resumable.d.cts +204 -0
  74. package/dist/types/resumable.d.cts.map +1 -0
  75. package/dist/types/resumable.d.ts +204 -0
  76. package/dist/types/resumable.d.ts.map +1 -0
  77. package/dist/types/resumable.js +4 -0
  78. package/dist/types/transform.cjs +18 -0
  79. package/dist/types/transform.d.cts +45 -0
  80. package/dist/types/transform.d.cts.map +1 -0
  81. package/dist/types/transform.d.ts +45 -0
  82. package/dist/types/transform.d.ts.map +1 -0
  83. package/dist/types/transform.js +1 -0
  84. package/dist/types/types.d.cts +17 -0
  85. package/dist/types/types.d.cts.map +1 -1
  86. package/dist/types/types.d.ts +17 -0
  87. package/dist/types/types.d.ts.map +1 -1
  88. package/dist/types/unsplash.d.cts +2 -0
  89. package/dist/types/unsplash.d.cts.map +1 -1
  90. package/dist/types/unsplash.d.ts +2 -0
  91. package/dist/types/unsplash.d.ts.map +1 -1
  92. package/dist/ui/AssetBrowser.d.cts +3 -1
  93. package/dist/ui/AssetBrowser.d.cts.map +1 -1
  94. package/dist/ui/AssetBrowser.d.ts +3 -1
  95. package/dist/ui/AssetBrowser.d.ts.map +1 -1
  96. package/dist/ui/AssetCommandPalette.d.cts +4 -1
  97. package/dist/ui/AssetCommandPalette.d.cts.map +1 -1
  98. package/dist/ui/AssetCommandPalette.d.ts +4 -1
  99. package/dist/ui/AssetCommandPalette.d.ts.map +1 -1
  100. package/dist/ui/AssetManagerUI.cjs +3 -1
  101. package/dist/ui/AssetManagerUI.d.cts +11 -2
  102. package/dist/ui/AssetManagerUI.d.cts.map +1 -1
  103. package/dist/ui/AssetManagerUI.d.ts +11 -2
  104. package/dist/ui/AssetManagerUI.d.ts.map +1 -1
  105. package/dist/ui/AssetManagerUI.js +3 -1
  106. package/dist/ui/DeleteAssetDialog.d.cts +4 -1
  107. package/dist/ui/DeleteAssetDialog.d.cts.map +1 -1
  108. package/dist/ui/DeleteAssetDialog.d.ts +4 -1
  109. package/dist/ui/DeleteAssetDialog.d.ts.map +1 -1
  110. package/dist/ui/DeleteFolderDialog.d.cts +4 -1
  111. package/dist/ui/DeleteFolderDialog.d.cts.map +1 -1
  112. package/dist/ui/DeleteFolderDialog.d.ts +4 -1
  113. package/dist/ui/DeleteFolderDialog.d.ts.map +1 -1
  114. package/dist/ui/EmptyFolderState.d.cts +4 -1
  115. package/dist/ui/EmptyFolderState.d.cts.map +1 -1
  116. package/dist/ui/EmptyFolderState.d.ts +4 -1
  117. package/dist/ui/EmptyFolderState.d.ts.map +1 -1
  118. package/dist/ui/FolderBreadcrumb.d.cts +4 -1
  119. package/dist/ui/FolderBreadcrumb.d.cts.map +1 -1
  120. package/dist/ui/FolderBreadcrumb.d.ts +4 -1
  121. package/dist/ui/FolderBreadcrumb.d.ts.map +1 -1
  122. package/dist/ui/FolderNameDialog.d.cts +3 -1
  123. package/dist/ui/FolderNameDialog.d.cts.map +1 -1
  124. package/dist/ui/FolderNameDialog.d.ts +3 -1
  125. package/dist/ui/FolderNameDialog.d.ts.map +1 -1
  126. package/dist/ui/FolderTree.d.cts +4 -1
  127. package/dist/ui/FolderTree.d.cts.map +1 -1
  128. package/dist/ui/FolderTree.d.ts +4 -1
  129. package/dist/ui/FolderTree.d.ts.map +1 -1
  130. package/dist/ui/MetadataPanel.d.cts +4 -1
  131. package/dist/ui/MetadataPanel.d.cts.map +1 -1
  132. package/dist/ui/MetadataPanel.d.ts +4 -1
  133. package/dist/ui/MetadataPanel.d.ts.map +1 -1
  134. package/dist/ui/MoveTargetPicker.d.cts +3 -1
  135. package/dist/ui/MoveTargetPicker.d.cts.map +1 -1
  136. package/dist/ui/MoveTargetPicker.d.ts +3 -1
  137. package/dist/ui/MoveTargetPicker.d.ts.map +1 -1
  138. package/dist/ui/ReplaceAssetDialog.cjs +7 -2
  139. package/dist/ui/ReplaceAssetDialog.d.cts +5 -2
  140. package/dist/ui/ReplaceAssetDialog.d.cts.map +1 -1
  141. package/dist/ui/ReplaceAssetDialog.d.ts +5 -2
  142. package/dist/ui/ReplaceAssetDialog.d.ts.map +1 -1
  143. package/dist/ui/ReplaceAssetDialog.js +7 -2
  144. package/dist/ui/UnsplashPanel.d.cts +4 -1
  145. package/dist/ui/UnsplashPanel.d.cts.map +1 -1
  146. package/dist/ui/UnsplashPanel.d.ts +4 -1
  147. package/dist/ui/UnsplashPanel.d.ts.map +1 -1
  148. package/dist/ui/UploadButton.cjs +7 -2
  149. package/dist/ui/UploadButton.d.cts +6 -2
  150. package/dist/ui/UploadButton.d.cts.map +1 -1
  151. package/dist/ui/UploadButton.d.ts +6 -2
  152. package/dist/ui/UploadButton.d.ts.map +1 -1
  153. package/dist/ui/UploadButton.js +7 -2
  154. package/dist/utils/asset-reference.cjs +87 -4
  155. package/dist/utils/asset-reference.d.cts +30 -6
  156. package/dist/utils/asset-reference.d.cts.map +1 -1
  157. package/dist/utils/asset-reference.d.ts +30 -6
  158. package/dist/utils/asset-reference.d.ts.map +1 -1
  159. package/dist/utils/asset-reference.js +83 -3
  160. package/dist/utils/csp.cjs +16 -0
  161. package/dist/utils/csp.d.cts +23 -0
  162. package/dist/utils/csp.d.cts.map +1 -1
  163. package/dist/utils/csp.d.ts +23 -0
  164. package/dist/utils/csp.d.ts.map +1 -1
  165. package/dist/utils/csp.js +16 -0
  166. package/dist/utils/data-source.cjs +19 -5
  167. package/dist/utils/data-source.d.cts +5 -1
  168. package/dist/utils/data-source.d.cts.map +1 -1
  169. package/dist/utils/data-source.d.ts +5 -1
  170. package/dist/utils/data-source.d.ts.map +1 -1
  171. package/dist/utils/data-source.js +19 -5
  172. package/dist/utils/errors.d.cts +5 -0
  173. package/dist/utils/errors.d.cts.map +1 -1
  174. package/dist/utils/errors.d.ts +5 -0
  175. package/dist/utils/errors.d.ts.map +1 -1
  176. package/dist/utils/query-param-transform.cjs +101 -0
  177. package/dist/utils/query-param-transform.d.cts +46 -0
  178. package/dist/utils/query-param-transform.d.cts.map +1 -0
  179. package/dist/utils/query-param-transform.d.ts +46 -0
  180. package/dist/utils/query-param-transform.d.ts.map +1 -0
  181. package/dist/utils/query-param-transform.js +60 -0
  182. package/dist/utils/registry.cjs +3 -0
  183. package/dist/utils/registry.d.cts +8 -0
  184. package/dist/utils/registry.d.cts.map +1 -1
  185. package/dist/utils/registry.d.ts +8 -0
  186. package/dist/utils/registry.d.ts.map +1 -1
  187. package/dist/utils/registry.js +3 -0
  188. package/dist/utils/resolver.cjs +19 -11
  189. package/dist/utils/resolver.d.cts +24 -0
  190. package/dist/utils/resolver.d.cts.map +1 -1
  191. package/dist/utils/resolver.d.ts +24 -0
  192. package/dist/utils/resolver.d.ts.map +1 -1
  193. package/dist/utils/resolver.js +19 -11
  194. package/dist/utils/retry.d.cts +2 -0
  195. package/dist/utils/retry.d.cts.map +1 -1
  196. package/dist/utils/retry.d.ts +2 -0
  197. package/dist/utils/retry.d.ts.map +1 -1
  198. package/dist/utils/run-resumable-upload.cjs +160 -0
  199. package/dist/utils/run-resumable-upload.d.cts +56 -0
  200. package/dist/utils/run-resumable-upload.d.cts.map +1 -0
  201. package/dist/utils/run-resumable-upload.d.ts +56 -0
  202. package/dist/utils/run-resumable-upload.d.ts.map +1 -0
  203. package/dist/utils/run-resumable-upload.js +122 -0
  204. package/dist/utils/sniff-file-type.cjs +209 -0
  205. package/dist/utils/sniff-file-type.d.cts +25 -0
  206. package/dist/utils/sniff-file-type.d.cts.map +1 -0
  207. package/dist/utils/sniff-file-type.d.ts +25 -0
  208. package/dist/utils/sniff-file-type.d.ts.map +1 -0
  209. package/dist/utils/sniff-file-type.js +164 -0
  210. package/dist/utils/studio-asset-source.cjs +11 -6
  211. package/dist/utils/studio-asset-source.d.cts +5 -1
  212. package/dist/utils/studio-asset-source.d.cts.map +1 -1
  213. package/dist/utils/studio-asset-source.d.ts +5 -1
  214. package/dist/utils/studio-asset-source.d.ts.map +1 -1
  215. package/dist/utils/studio-asset-source.js +11 -6
  216. package/dist/utils/upload-session-store.cjs +125 -0
  217. package/dist/utils/upload-session-store.d.cts +55 -0
  218. package/dist/utils/upload-session-store.d.cts.map +1 -0
  219. package/dist/utils/upload-session-store.d.ts +55 -0
  220. package/dist/utils/upload-session-store.d.ts.map +1 -0
  221. package/dist/utils/upload-session-store.js +84 -0
  222. package/dist/utils/validate-upload-result.cjs +9 -1
  223. package/dist/utils/validate-upload-result.d.cts +1 -0
  224. package/dist/utils/validate-upload-result.d.cts.map +1 -1
  225. package/dist/utils/validate-upload-result.d.ts +1 -0
  226. package/dist/utils/validate-upload-result.d.ts.map +1 -1
  227. package/dist/utils/validate-upload-result.js +9 -1
  228. package/dist/version.cjs +1 -1
  229. package/dist/version.d.cts +1 -1
  230. package/dist/version.d.cts.map +1 -1
  231. package/dist/version.d.ts +1 -1
  232. package/dist/version.d.ts.map +1 -1
  233. package/dist/version.js +1 -1
  234. package/meta/config.json +1 -1
  235. package/package.json +40 -10
@@ -1,4 +1,6 @@
1
+ import * as React from "react";
1
2
  import type { UploadResult } from "../types/types.js";
3
+ /** Props for the asset metadata editing dialog. */
2
4
  export interface MetadataPanelProps {
3
5
  /**
4
6
  * Asset whose metadata is being edited. When `null`, the panel is
@@ -17,5 +19,6 @@ export interface MetadataPanelProps {
17
19
  }) => void | Promise<void>;
18
20
  readonly onCancel: () => void;
19
21
  }
20
- export declare function MetadataPanel({ asset, onCancel, onConfirm, }: MetadataPanelProps): import("react/jsx-runtime").JSX.Element;
22
+ /** Dialog panel for editing an asset name and tag metadata. */
23
+ export declare function MetadataPanel({ asset, onCancel, onConfirm, }: MetadataPanelProps): React.JSX.Element;
21
24
  //# sourceMappingURL=MetadataPanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MetadataPanel.d.ts","sourceRoot":"","sources":["../../src/ui/MetadataPanel.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,kBAAkB;IAClC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACpC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,CACnB,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,KAC7D,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,wBAAgB,aAAa,CAAC,EAC7B,KAAK,EACL,QAAQ,EACR,SAAS,GACT,EAAE,kBAAkB,2CA2JpB"}
1
+ {"version":3,"file":"MetadataPanel.d.ts","sourceRoot":"","sources":["../../src/ui/MetadataPanel.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,mDAAmD;AACnD,MAAM,WAAW,kBAAkB;IAClC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACpC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,CACnB,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,KAC7D,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,+DAA+D;AAC/D,wBAAgB,aAAa,CAAC,EAC7B,KAAK,EACL,QAAQ,EACR,SAAS,GACT,EAAE,kBAAkB,qBA2JpB"}
@@ -1,3 +1,4 @@
1
+ import * as React from "react";
1
2
  import type { AssetFolder } from "../types/folders.js";
2
3
  /**
3
4
  * Keyboard-accessible move-target picker — the a11y fallback for drag-to-folder.
@@ -12,5 +13,6 @@ export interface MoveTargetPickerProps {
12
13
  readonly onPick: (folderId: string | null) => void | Promise<void>;
13
14
  readonly rootLabel?: string;
14
15
  }
15
- export declare function MoveTargetPicker({ open, onOpenChange, folders, onPick, rootLabel, }: MoveTargetPickerProps): import("react/jsx-runtime").JSX.Element;
16
+ /** Dialog for choosing the destination folder for an asset or folder move. */
17
+ export declare function MoveTargetPicker({ open, onOpenChange, folders, onPick, rootLabel, }: MoveTargetPickerProps): React.JSX.Element;
16
18
  //# sourceMappingURL=MoveTargetPicker.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MoveTargetPicker.d.cts","sourceRoot":"","sources":["../../src/ui/MoveTargetPicker.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,gBAAgB,CAAC,EAChC,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,MAAM,EACN,SAAS,GACT,EAAE,qBAAqB,2CAgEvB"}
1
+ {"version":3,"file":"MoveTargetPicker.d.cts","sourceRoot":"","sources":["../../src/ui/MoveTargetPicker.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAAC,EAChC,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,MAAM,EACN,SAAS,GACT,EAAE,qBAAqB,qBAgEvB"}
@@ -1,3 +1,4 @@
1
+ import * as React from "react";
1
2
  import type { AssetFolder } from "../types/folders.js";
2
3
  /**
3
4
  * Keyboard-accessible move-target picker — the a11y fallback for drag-to-folder.
@@ -12,5 +13,6 @@ export interface MoveTargetPickerProps {
12
13
  readonly onPick: (folderId: string | null) => void | Promise<void>;
13
14
  readonly rootLabel?: string;
14
15
  }
15
- export declare function MoveTargetPicker({ open, onOpenChange, folders, onPick, rootLabel, }: MoveTargetPickerProps): import("react/jsx-runtime").JSX.Element;
16
+ /** Dialog for choosing the destination folder for an asset or folder move. */
17
+ export declare function MoveTargetPicker({ open, onOpenChange, folders, onPick, rootLabel, }: MoveTargetPickerProps): React.JSX.Element;
16
18
  //# sourceMappingURL=MoveTargetPicker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MoveTargetPicker.d.ts","sourceRoot":"","sources":["../../src/ui/MoveTargetPicker.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,gBAAgB,CAAC,EAChC,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,MAAM,EACN,SAAS,GACT,EAAE,qBAAqB,2CAgEvB"}
1
+ {"version":3,"file":"MoveTargetPicker.d.ts","sourceRoot":"","sources":["../../src/ui/MoveTargetPicker.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAAC,EAChC,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,MAAM,EACN,SAAS,GACT,EAAE,qBAAqB,qBAgEvB"}
@@ -36,13 +36,17 @@ const button_namespaceObject = require("@anvilkit/ui/button");
36
36
  const dialog_namespaceObject = require("@anvilkit/ui/dialog");
37
37
  const external_react_namespaceObject = require("react");
38
38
  const external_plugin_cjs_namespaceObject = require("../plugin.cjs");
39
- function ReplaceAssetDialog({ acceptedMimeTypes, asset, maxFileSize, onCancel, onConfirm }) {
39
+ function ReplaceAssetDialog({ acceptedFileExtensions, acceptedMimeTypes, asset, maxFileSize, onCancel, onConfirm }) {
40
40
  const msg = (0, i18n_namespaceObject.useMsg)();
41
41
  const inputRef = external_react_namespaceObject.useRef(null);
42
42
  const [selectedFile, setSelectedFile] = external_react_namespaceObject.useState(null);
43
43
  const [error, setError] = external_react_namespaceObject.useState(null);
44
44
  const [busy, setBusy] = external_react_namespaceObject.useState(false);
45
- const acceptAttr = external_react_namespaceObject.useMemo(()=>acceptedMimeTypes?.join(","), [
45
+ const acceptAttr = external_react_namespaceObject.useMemo(()=>[
46
+ ...acceptedMimeTypes ?? [],
47
+ ...acceptedFileExtensions ?? []
48
+ ].join(",") || void 0, [
49
+ acceptedFileExtensions,
46
50
  acceptedMimeTypes
47
51
  ]);
48
52
  function resetPicker() {
@@ -55,6 +59,7 @@ function ReplaceAssetDialog({ acceptedMimeTypes, asset, maxFileSize, onCancel, o
55
59
  if (!file) return;
56
60
  try {
57
61
  (0, external_plugin_cjs_namespaceObject.validateSelectedFile)(file, {
62
+ acceptedFileExtensions,
58
63
  acceptedMimeTypes,
59
64
  maxFileSize
60
65
  });
@@ -1,6 +1,8 @@
1
+ import * as React from "react";
1
2
  import type { AssetManagerOptions } from "../types/options.js";
2
3
  import type { UploadResult } from "../types/types.js";
3
- export interface ReplaceAssetDialogProps extends Pick<AssetManagerOptions, "acceptedMimeTypes" | "maxFileSize"> {
4
+ /** Props for the replace-asset file selection dialog. */
5
+ export interface ReplaceAssetDialogProps extends Pick<AssetManagerOptions, "acceptedFileExtensions" | "acceptedMimeTypes" | "maxFileSize"> {
4
6
  /** Asset to replace. `null` closes the dialog. */
5
7
  readonly asset: UploadResult | null;
6
8
  /**
@@ -11,5 +13,6 @@ export interface ReplaceAssetDialogProps extends Pick<AssetManagerOptions, "acce
11
13
  readonly onConfirm: (asset: UploadResult, file: File) => void | Promise<void>;
12
14
  readonly onCancel: () => void;
13
15
  }
14
- export declare function ReplaceAssetDialog({ acceptedMimeTypes, asset, maxFileSize, onCancel, onConfirm, }: ReplaceAssetDialogProps): import("react/jsx-runtime").JSX.Element;
16
+ /** Dialog that validates and confirms selecting a replacement file for an asset. */
17
+ export declare function ReplaceAssetDialog({ acceptedFileExtensions, acceptedMimeTypes, asset, maxFileSize, onCancel, onConfirm, }: ReplaceAssetDialogProps): React.JSX.Element;
15
18
  //# sourceMappingURL=ReplaceAssetDialog.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReplaceAssetDialog.d.cts","sourceRoot":"","sources":["../../src/ui/ReplaceAssetDialog.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,uBAChB,SAAQ,IAAI,CAAC,mBAAmB,EAAE,mBAAmB,GAAG,aAAa,CAAC;IACtE,kDAAkD;IAClD,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACpC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9E,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,wBAAgB,kBAAkB,CAAC,EAClC,iBAAiB,EACjB,KAAK,EACL,WAAW,EACX,QAAQ,EACR,SAAS,GACT,EAAE,uBAAuB,2CAuIzB"}
1
+ {"version":3,"file":"ReplaceAssetDialog.d.cts","sourceRoot":"","sources":["../../src/ui/ReplaceAssetDialog.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,yDAAyD;AACzD,MAAM,WAAW,uBAChB,SAAQ,IAAI,CACX,mBAAmB,EACnB,wBAAwB,GAAG,mBAAmB,GAAG,aAAa,CAC9D;IACD,kDAAkD;IAClD,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACpC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9E,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,oFAAoF;AACpF,wBAAgB,kBAAkB,CAAC,EAClC,sBAAsB,EACtB,iBAAiB,EACjB,KAAK,EACL,WAAW,EACX,QAAQ,EACR,SAAS,GACT,EAAE,uBAAuB,qBA8IzB"}
@@ -1,6 +1,8 @@
1
+ import * as React from "react";
1
2
  import type { AssetManagerOptions } from "../types/options.js";
2
3
  import type { UploadResult } from "../types/types.js";
3
- export interface ReplaceAssetDialogProps extends Pick<AssetManagerOptions, "acceptedMimeTypes" | "maxFileSize"> {
4
+ /** Props for the replace-asset file selection dialog. */
5
+ export interface ReplaceAssetDialogProps extends Pick<AssetManagerOptions, "acceptedFileExtensions" | "acceptedMimeTypes" | "maxFileSize"> {
4
6
  /** Asset to replace. `null` closes the dialog. */
5
7
  readonly asset: UploadResult | null;
6
8
  /**
@@ -11,5 +13,6 @@ export interface ReplaceAssetDialogProps extends Pick<AssetManagerOptions, "acce
11
13
  readonly onConfirm: (asset: UploadResult, file: File) => void | Promise<void>;
12
14
  readonly onCancel: () => void;
13
15
  }
14
- export declare function ReplaceAssetDialog({ acceptedMimeTypes, asset, maxFileSize, onCancel, onConfirm, }: ReplaceAssetDialogProps): import("react/jsx-runtime").JSX.Element;
16
+ /** Dialog that validates and confirms selecting a replacement file for an asset. */
17
+ export declare function ReplaceAssetDialog({ acceptedFileExtensions, acceptedMimeTypes, asset, maxFileSize, onCancel, onConfirm, }: ReplaceAssetDialogProps): React.JSX.Element;
15
18
  //# sourceMappingURL=ReplaceAssetDialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReplaceAssetDialog.d.ts","sourceRoot":"","sources":["../../src/ui/ReplaceAssetDialog.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,uBAChB,SAAQ,IAAI,CAAC,mBAAmB,EAAE,mBAAmB,GAAG,aAAa,CAAC;IACtE,kDAAkD;IAClD,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACpC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9E,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,wBAAgB,kBAAkB,CAAC,EAClC,iBAAiB,EACjB,KAAK,EACL,WAAW,EACX,QAAQ,EACR,SAAS,GACT,EAAE,uBAAuB,2CAuIzB"}
1
+ {"version":3,"file":"ReplaceAssetDialog.d.ts","sourceRoot":"","sources":["../../src/ui/ReplaceAssetDialog.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,yDAAyD;AACzD,MAAM,WAAW,uBAChB,SAAQ,IAAI,CACX,mBAAmB,EACnB,wBAAwB,GAAG,mBAAmB,GAAG,aAAa,CAC9D;IACD,kDAAkD;IAClD,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAC;IACpC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9E,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;CAC9B;AAED,oFAAoF;AACpF,wBAAgB,kBAAkB,CAAC,EAClC,sBAAsB,EACtB,iBAAiB,EACjB,KAAK,EACL,WAAW,EACX,QAAQ,EACR,SAAS,GACT,EAAE,uBAAuB,qBA8IzB"}
@@ -4,13 +4,17 @@ import { Button } from "@anvilkit/ui/button";
4
4
  import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "@anvilkit/ui/dialog";
5
5
  import { validateSelectedFile } from "../plugin.js";
6
6
  import * as __rspack_external_react from "react";
7
- function ReplaceAssetDialog({ acceptedMimeTypes, asset, maxFileSize, onCancel, onConfirm }) {
7
+ function ReplaceAssetDialog({ acceptedFileExtensions, acceptedMimeTypes, asset, maxFileSize, onCancel, onConfirm }) {
8
8
  const msg = useMsg();
9
9
  const inputRef = __rspack_external_react.useRef(null);
10
10
  const [selectedFile, setSelectedFile] = __rspack_external_react.useState(null);
11
11
  const [error, setError] = __rspack_external_react.useState(null);
12
12
  const [busy, setBusy] = __rspack_external_react.useState(false);
13
- const acceptAttr = __rspack_external_react.useMemo(()=>acceptedMimeTypes?.join(","), [
13
+ const acceptAttr = __rspack_external_react.useMemo(()=>[
14
+ ...acceptedMimeTypes ?? [],
15
+ ...acceptedFileExtensions ?? []
16
+ ].join(",") || void 0, [
17
+ acceptedFileExtensions,
14
18
  acceptedMimeTypes
15
19
  ]);
16
20
  function resetPicker() {
@@ -23,6 +27,7 @@ function ReplaceAssetDialog({ acceptedMimeTypes, asset, maxFileSize, onCancel, o
23
27
  if (!file) return;
24
28
  try {
25
29
  validateSelectedFile(file, {
30
+ acceptedFileExtensions,
26
31
  acceptedMimeTypes,
27
32
  maxFileSize
28
33
  });
@@ -1,3 +1,4 @@
1
+ import * as React from "react";
1
2
  import type { AssetTheme } from "../sources/provider.js";
2
3
  /** A browsed Unsplash result + the attribution the tile must show. */
3
4
  export interface UnsplashResult {
@@ -8,6 +9,7 @@ export interface UnsplashResult {
8
9
  readonly unsplashUrl: string;
9
10
  }
10
11
  export type UnsplashPanelStatus = "idle" | "loading" | "rateLimited" | "error" | "disabled";
12
+ /** Props for the Unsplash browsing panel. */
11
13
  export interface UnsplashPanelProps {
12
14
  readonly themes: readonly AssetTheme[];
13
15
  readonly activeThemeId?: string;
@@ -24,5 +26,6 @@ export interface UnsplashPanelProps {
24
26
  /** Skeleton tile count while loading the first page. */
25
27
  readonly skeletonCount?: number;
26
28
  }
27
- export declare function UnsplashPanel({ themes, activeThemeId, onThemeChange, query, onQueryChange, results, status, onPick, onLoadMore, themeLabel, skeletonCount, }: UnsplashPanelProps): import("react/jsx-runtime").JSX.Element;
29
+ /** Browse, search, and pick assets from the configured Unsplash provider. */
30
+ export declare function UnsplashPanel({ themes, activeThemeId, onThemeChange, query, onQueryChange, results, status, onPick, onLoadMore, themeLabel, skeletonCount, }: UnsplashPanelProps): React.JSX.Element;
28
31
  //# sourceMappingURL=UnsplashPanel.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UnsplashPanel.d.cts","sourceRoot":"","sources":["../../src/ui/UnsplashPanel.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGzD,sEAAsE;AACtE,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,MAAM,mBAAmB,GAC5B,MAAM,GACN,SAAS,GACT,aAAa,GACb,OAAO,GACP,UAAU,CAAC;AAEd,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,MAAM,EAAE,SAAS,UAAU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etTheme } from "../sources/provider.js";
2
3
  /** A browsed Unsplash result + the attribution the tile must show. */
3
4
  export interface UnsplashResult {
@@ -8,6 +9,7 @@ export interface UnsplashResult {
8
9
  readonly unsplashUrl: string;
9
10
  }
10
11
  export type UnsplashPanelStatus = "idle" | "loading" | "rateLimited" | "error" | "disabled";
12
+ /** Props for the Unsplash browsing panel. */
11
13
  export interface UnsplashPanelProps {
12
14
  readonly themes: readonly AssetTheme[];
13
15
  readonly activeThemeId?: string;
@@ -24,5 +26,6 @@ export interface UnsplashPanelProps {
24
26
  /** Skeleton tile count while loading the first page. */
25
27
  readonly skeletonCount?: number;
26
28
  }
27
- export declare function UnsplashPanel({ themes, activeThemeId, onThemeChange, query, onQueryChange, results, status, onPick, onLoadMore, themeLabel, skeletonCount, }: UnsplashPanelProps): import("react/jsx-runtime").JSX.Element;
29
+ /** Browse, search, and pick assets from the configured Unsplash provider. */
30
+ export declare function UnsplashPanel({ themes, activeThemeId, onThemeChange, query, onQueryChange, results, status, onPick, onLoadMore, themeLabel, skeletonCount, }: UnsplashPanelProps): React.JSX.Element;
28
31
  //# sourceMappingURL=UnsplashPanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UnsplashPanel.d.ts","sourceRoot":"","sources":["../../src/ui/UnsplashPanel.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGzD,sEAAsE;AACtE,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,MAAM,mBAAmB,GAC5B,MAAM,GACN,SAAS,GACT,aAAa,GACb,OAAO,GACP,UAAU,CAAC;AAEd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AkB,qBA8JpB"}
@@ -41,7 +41,7 @@ function handleDragOver(event) {
41
41
  event.stopPropagation();
42
42
  if (event.dataTransfer) event.dataTransfer.dropEffect = "copy";
43
43
  }
44
- function UploadButton({ acceptedMimeTypes, allowMixedScriptHostnames, dataUrlAllowlistOptIn, maxFileSize, onError, onProgress, onUploaded, uploader }) {
44
+ function UploadButton({ acceptedFileExtensions, acceptedMimeTypes, allowMixedScriptHostnames, dataUrlAllowlistOptIn, maxFileSize, onError, onProgress, onUploaded, uploader }) {
45
45
  const msg = (0, i18n_namespaceObject.useMsg)();
46
46
  const inputRef = external_react_namespaceObject.useRef(null);
47
47
  const [errorMessage, setErrorMessage] = external_react_namespaceObject.useState(null);
@@ -50,7 +50,11 @@ function UploadButton({ acceptedMimeTypes, allowMixedScriptHostnames, dataUrlAll
50
50
  const isUploading = null !== batch;
51
51
  const uploadAbortRef = external_react_namespaceObject.useRef(null);
52
52
  external_react_namespaceObject.useEffect(()=>()=>uploadAbortRef.current?.abort(), []);
53
- const acceptAttr = external_react_namespaceObject.useMemo(()=>acceptedMimeTypes?.join(","), [
53
+ const acceptAttr = external_react_namespaceObject.useMemo(()=>[
54
+ ...acceptedMimeTypes ?? [],
55
+ ...acceptedFileExtensions ?? []
56
+ ].join(",") || void 0, [
57
+ acceptedFileExtensions,
54
58
  acceptedMimeTypes
55
59
  ]);
56
60
  async function processFiles(files) {
@@ -73,6 +77,7 @@ function UploadButton({ acceptedMimeTypes, allowMixedScriptHostnames, dataUrlAll
73
77
  const file = files[index];
74
78
  if (file) try {
75
79
  (0, external_plugin_cjs_namespaceObject.validateSelectedFile)(file, {
80
+ acceptedFileExtensions,
76
81
  acceptedMimeTypes,
77
82
  maxFileSize
78
83
  });
@@ -1,10 +1,13 @@
1
+ import * as React from "react";
1
2
  import type { AssetManagerOptions } from "../types/options.js";
2
3
  import type { UploadAdapter, UploadResult } from "../types/types.js";
4
+ /** Aggregate progress snapshot for the active upload batch. */
3
5
  export interface UploadProgressSnapshot {
4
6
  readonly completed: number;
5
7
  readonly total: number;
6
8
  }
7
- export interface UploadButtonProps extends Pick<AssetManagerOptions, "acceptedMimeTypes" | "maxFileSize" | "dataUrlAllowlistOptIn" | "allowMixedScriptHostnames"> {
9
+ /** Props for the upload button and drop-zone component. */
10
+ export interface UploadButtonProps extends Pick<AssetManagerOptions, "acceptedFileExtensions" | "acceptedMimeTypes" | "maxFileSize" | "dataUrlAllowlistOptIn" | "allowMixedScriptHostnames"> {
8
11
  /**
9
12
  * Binary uploader. Required at the UI boundary even though
10
13
  * `AssetManagerOptions.uploader` is optional — the plugin passes the
@@ -20,5 +23,6 @@ export interface UploadButtonProps extends Pick<AssetManagerOptions, "acceptedMi
20
23
  */
21
24
  readonly onProgress?: (snapshot: UploadProgressSnapshot | null) => void;
22
25
  }
23
- export declare function UploadButton({ acceptedMimeTypes, allowMixedScriptHostnames, dataUrlAllowlistOptIn, maxFileSize, onError, onProgress, onUploaded, uploader, }: UploadButtonProps): import("react/jsx-runtime").JSX.Element;
26
+ /** Upload control with file picker, drag/drop, progress, and validation. */
27
+ export declare function UploadButton({ acceptedFileExtensions, acceptedMimeTypes, allowMixedScriptHostnames, dataUrlAllowlistOptIn, maxFileSize, onError, onProgress, onUploaded, uploader, }: UploadButtonProps): React.JSX.Element;
24
28
  //# sourceMappingURL=UploadButton.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UploadButton.d.cts","sourceRoot":"","sources":["../../src/ui/UploadButton.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGrE,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iBAChB,SAAQ,IAAI,CACX,mBAAmB,EACj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CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,sBAAsB,GAAG,IAAI,KAAK,IAAI,CAAC;CACxE;AAYD,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,EAC5B,sBAAsB,EACtB,iBAAiB,EACjB,yBAAyB,EACzB,qBAAqB,EACrB,WAAW,EACX,OAAO,EACP,UAAU,EACV,UAAU,EACV,QAAQ,GACR,EAAE,iBAAiB,qBA0LnB"}
@@ -1,10 +1,13 @@
1
+ import * as React from "react";
1
2
  import type { AssetManagerOptions } from "../types/options.js";
2
3
  import type { UploadAdapter, UploadResult } from "../types/types.js";
4
+ /** Aggregate progress snapshot for the active upload batch. */
3
5
  export interface UploadProgressSnapshot {
4
6
  readonly completed: number;
5
7
  readonly total: number;
6
8
  }
7
- export interface UploadButtonProps extends Pick<AssetManagerOptions, "acceptedMimeTypes" | "maxFileSize" | "dataUrlAllowlistOptIn" | "allowMixedScriptHostnames"> {
9
+ /** Props for the upload button and drop-zone component. */
10
+ export interface UploadButtonProps extends Pick<AssetManagerOptions, "acceptedFileExtensions" | "acceptedMimeTypes" | "maxFileSize" | "dataUrlAllowlistOptIn" | "allowMixedScriptHostnames"> {
8
11
  /**
9
12
  * Binary uploader. Required at the UI boundary even though
10
13
  * `AssetManagerOptions.uploader` is optional — the plugin passes the
@@ -20,5 +23,6 @@ export interface UploadButtonProps extends Pick<AssetManagerOptions, "acceptedMi
20
23
  */
21
24
  readonly onProgress?: (snapshot: UploadProgressSnapshot | null) => void;
22
25
  }
23
- export declare function UploadButton({ acceptedMimeTypes, allowMixedScriptHostnames, dataUrlAllowlistOptIn, maxFileSize, onError, onProgress, onUploaded, uploader, }: UploadButtonProps): import("react/jsx-runtime").JSX.Element;
26
+ /** Upload control with file picker, drag/drop, progress, and validation. */
27
+ export declare function UploadButton({ acceptedFileExtensions, acceptedMimeTypes, allowMixedScriptHostnames, dataUrlAllowlistOptIn, maxFileSize, onError, onProgress, onUploaded, uploader, }: UploadButtonProps): React.JSX.Element;
24
28
  //# sourceMappingURL=UploadButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UploadButton.d.ts","sourceRoot":"","sources":["../../src/ui/UploadButton.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGrE,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iBAChB,SAAQ,IAAI,CACX,mBAAmB,EACjB,mBAAmB,GACnB,aAAa,GACb,uBAAuB,GACvB,2BAA2B,CAC7B;IACD;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IACpD,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,sBAAsB,GAAG,IAAI,KAAK,IAAI,CAAC;CACxE;AAYD,wBAAgB,YAAY,CAAC,EAC5B,iBAAiB,EACjB,yBAAyB,EACzB,qBAAqB,EACrB,WAAW,EACX,OAAO,EACP,UAAU,EACV,UAAU,EACV,QAAQ,GACR,EAAE,iBAAiB,2CAmLnB"}
1
+ {"version":3,"file":"UploadButton.d.ts","sourceRoot":"","sources":["../../src/ui/UploadButton.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGrE,+DAA+D;AAC/D,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED,2DAA2D;AAC3D,MAAM,WAAW,iBAChB,SAAQ,IAAI,CACX,mBAAmB,EACjB,wBAAwB,GACxB,mBAAmB,GACnB,aAAa,GACb,uBAAuB,GACvB,2BAA2B,CAC7B;IACD;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;IACpD,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,sBAAsB,GAAG,IAAI,KAAK,IAAI,CAAC;CACxE;AAYD,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,EAC5B,sBAAsB,EACtB,iBAAiB,EACjB,yBAAyB,EACzB,qBAAqB,EACrB,WAAW,EACX,OAAO,EACP,UAAU,EACV,UAAU,EACV,QAAQ,GACR,EAAE,iBAAiB,qBA0LnB"}
@@ -9,7 +9,7 @@ function handleDragOver(event) {
9
9
  event.stopPropagation();
10
10
  if (event.dataTransfer) event.dataTransfer.dropEffect = "copy";
11
11
  }
12
- function UploadButton({ acceptedMimeTypes, allowMixedScriptHostnames, dataUrlAllowlistOptIn, maxFileSize, onError, onProgress, onUploaded, uploader }) {
12
+ function UploadButton({ acceptedFileExtensions, acceptedMimeTypes, allowMixedScriptHostnames, dataUrlAllowlistOptIn, maxFileSize, onError, onProgress, onUploaded, uploader }) {
13
13
  const msg = useMsg();
14
14
  const inputRef = __rspack_external_react.useRef(null);
15
15
  const [errorMessage, setErrorMessage] = __rspack_external_react.useState(null);
@@ -18,7 +18,11 @@ function UploadButton({ acceptedMimeTypes, allowMixedScriptHostnames, dataUrlAll
18
18
  const isUploading = null !== batch;
19
19
  const uploadAbortRef = __rspack_external_react.useRef(null);
20
20
  __rspack_external_react.useEffect(()=>()=>uploadAbortRef.current?.abort(), []);
21
- const acceptAttr = __rspack_external_react.useMemo(()=>acceptedMimeTypes?.join(","), [
21
+ const acceptAttr = __rspack_external_react.useMemo(()=>[
22
+ ...acceptedMimeTypes ?? [],
23
+ ...acceptedFileExtensions ?? []
24
+ ].join(",") || void 0, [
25
+ acceptedFileExtensions,
22
26
  acceptedMimeTypes
23
27
  ]);
24
28
  async function processFiles(files) {
@@ -41,6 +45,7 @@ function UploadButton({ acceptedMimeTypes, allowMixedScriptHostnames, dataUrlAll
41
45
  const file = files[index];
42
46
  if (file) try {
43
47
  validateSelectedFile(file, {
48
+ acceptedFileExtensions,
44
49
  acceptedMimeTypes,
45
50
  maxFileSize
46
51
  });
@@ -27,15 +27,98 @@ var __webpack_require__ = {};
27
27
  })();
28
28
  var __webpack_exports__ = {};
29
29
  __webpack_require__.r(__webpack_exports__);
30
- function createAssetReference(id) {
31
- return `asset://${id}`;
30
+ const ASSET_REFERENCE_PREFIX = "asset://";
31
+ function createAssetReference(id, transform) {
32
+ const base = `${ASSET_REFERENCE_PREFIX}${encodeId(id)}`;
33
+ if (void 0 === transform) return base;
34
+ const query = encodeTransform(transform);
35
+ return "" === query ? base : `${base}?${query}`;
36
+ }
37
+ function parseAssetReference(url) {
38
+ if (!url.startsWith(ASSET_REFERENCE_PREFIX)) return null;
39
+ const rest = url.slice(ASSET_REFERENCE_PREFIX.length);
40
+ const queryIndex = rest.indexOf("?");
41
+ const id = decodeId((-1 === queryIndex ? rest : rest.slice(0, queryIndex)).trim());
42
+ if ("" === id) return null;
43
+ if (-1 === queryIndex) return {
44
+ id
45
+ };
46
+ const transform = decodeTransform(rest.slice(queryIndex + 1));
47
+ return void 0 === transform ? {
48
+ id
49
+ } : {
50
+ id,
51
+ transform
52
+ };
53
+ }
54
+ function encodeId(id) {
55
+ return id.replace(/%/g, "%25").replace(/\?/g, "%3F").replace(/#/g, "%23");
56
+ }
57
+ function decodeId(id) {
58
+ return id.replace(/%3F/gi, "?").replace(/%23/gi, "#").replace(/%25/g, "%");
59
+ }
60
+ const FITS = new Set([
61
+ "cover",
62
+ "contain",
63
+ "fill",
64
+ "inside",
65
+ "outside"
66
+ ]);
67
+ const FORMATS = new Set([
68
+ "webp",
69
+ "avif",
70
+ "jpeg",
71
+ "png",
72
+ "auto"
73
+ ]);
74
+ function encodeTransform(transform) {
75
+ const params = new URLSearchParams();
76
+ if (void 0 !== transform.width) params.set("w", String(transform.width));
77
+ if (void 0 !== transform.height) params.set("h", String(transform.height));
78
+ if (void 0 !== transform.fit) params.set("fit", transform.fit);
79
+ if (void 0 !== transform.format) params.set("fm", transform.format);
80
+ if (void 0 !== transform.quality) params.set("q", String(transform.quality));
81
+ if (void 0 !== transform.dpr) params.set("dpr", String(transform.dpr));
82
+ return params.toString();
83
+ }
84
+ function decodeTransform(query) {
85
+ const params = new URLSearchParams(query);
86
+ const out = {};
87
+ const width = toPositiveInteger(params.get("w"));
88
+ if (void 0 !== width) out.width = width;
89
+ const height = toPositiveInteger(params.get("h"));
90
+ if (void 0 !== height) out.height = height;
91
+ const fit = params.get("fit");
92
+ if (FITS.has(fit)) out.fit = fit;
93
+ const format = params.get("fm");
94
+ if (FORMATS.has(format)) out.format = format;
95
+ const quality = toPositiveInteger(params.get("q"));
96
+ if (void 0 !== quality && quality <= 100) out.quality = quality;
97
+ const dpr = toPositiveNumber(params.get("dpr"));
98
+ if (void 0 !== dpr) out.dpr = dpr;
99
+ return Object.keys(out).length > 0 ? out : void 0;
100
+ }
101
+ const DECIMAL_INTEGER_RE = /^[0-9]+$/;
102
+ const DECIMAL_NUMBER_RE = /^[0-9]+(?:\.[0-9]+)?$/;
103
+ function toPositiveInteger(value) {
104
+ if (null === value || !DECIMAL_INTEGER_RE.test(value)) return;
105
+ const n = Number(value);
106
+ return Number.isSafeInteger(n) && n > 0 ? n : void 0;
107
+ }
108
+ function toPositiveNumber(value) {
109
+ if (null === value || !DECIMAL_NUMBER_RE.test(value)) return;
110
+ const n = Number(value);
111
+ return Number.isFinite(n) && n > 0 ? n : void 0;
32
112
  }
33
113
  __webpack_require__.d(__webpack_exports__, {
34
- createAssetReference: ()=>createAssetReference
114
+ createAssetReference: ()=>createAssetReference,
115
+ parseAssetReference: ()=>parseAssetReference
35
116
  });
36
117
  exports.createAssetReference = __webpack_exports__.createAssetReference;
118
+ exports.parseAssetReference = __webpack_exports__.parseAssetReference;
37
119
  for(var __rspack_i in __webpack_exports__)if (-1 === [
38
- "createAssetReference"
120
+ "createAssetReference",
121
+ "parseAssetReference"
39
122
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
40
123
  Object.defineProperty(exports, '__esModule', {
41
124
  value: true
@@ -1,10 +1,34 @@
1
1
  /**
2
- * @file Canonical `asset://${id}` reference helper.
2
+ * @file Canonical `asset://<id>` reference codec.
3
3
  *
4
- * Lives in its own file so both `plugin.ts` (which dispatches asset
5
- * references into Puck data) and `studio-asset-source.ts` (which
6
- * surfaces the URL to the sidebar's `image` module) can reuse it
7
- * without creating a circular import between them.
4
+ * Lives in its own file so both `plugin.ts` (which dispatches asset references
5
+ * into Puck data) and `resolver.ts` / `studio-asset-source.ts` can reuse it
6
+ * without a circular import. A reference may carry an optional transform query
7
+ * (`asset://<id>?w=800&fm=webp`) requesting a derivative rendition; the IR
8
+ * resolver decodes it and maps it to a derivative URL via the host's
9
+ * `TransformResolver` (review finding #9).
8
10
  */
9
- export declare function createAssetReference(id: string): string;
11
+ import type { AssetTransform } from "../types/transform.js";
12
+ /**
13
+ * Build the opaque `asset://<id>` reference stored in page data for an asset.
14
+ * The IR resolver ({@link createIRAssetResolver}) turns it back into a validated
15
+ * URL at export / render time; it is never a directly-loadable URL itself.
16
+ *
17
+ * Pass a {@link AssetTransform} to request a derivative rendition — it is
18
+ * encoded as a stable query (`?w=&h=&fit=&fm=&q=&dpr=`) and applied by the
19
+ * resolver's configured `TransformResolver`.
20
+ */
21
+ export declare function createAssetReference(id: string, transform?: AssetTransform): string;
22
+ /** Parsed components of an `asset://` reference. */
23
+ export interface ParsedAssetReference {
24
+ readonly id: string;
25
+ /** Present only when the reference carried a (well-formed) transform query. */
26
+ readonly transform?: AssetTransform;
27
+ }
28
+ /**
29
+ * Parse an `asset://<id>[?transform]` reference. Returns `null` for any non-
30
+ * asset URL or an empty id. Malformed transform params are ignored rather than
31
+ * failing the parse (references can be host- or tamper-supplied).
32
+ */
33
+ export declare function parseAssetReference(url: string): ParsedAssetReference | null;
10
34
  //# sourceMappingURL=asset-reference.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"asset-reference.d.cts","sourceRoot":"","sources":["../../src/utils/asset-reference.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEvD"}
1
+ {"version":3,"file":"asset-reference.d.cts","sourceRoot":"","sources":["../../src/utils/asset-reference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAI5D;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CACnC,EAAE,EAAE,MAAM,EACV,SAAS,CAAC,EAAE,cAAc,GACxB,MAAM,CAKR;AAED,oDAAoD;AACpD,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,QAAQ,CAAC,SAAS,CAAC,EAAE,cAAc,CAAC;CACpC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI,CAW5E"}
@@ -1,10 +1,34 @@
1
1
  /**
2
- * @file Canonical `asset://${id}` reference helper.
2
+ * @file Canonical `asset://<id>` reference codec.
3
3
  *
4
- * Lives in its own file so both `plugin.ts` (which dispatches asset
5
- * references into Puck data) and `studio-asset-source.ts` (which
6
- * surfaces the URL to the sidebar's `image` module) can reuse it
7
- * without creating a circular import between them.
4
+ * Lives in its own file so both `plugin.ts` (which dispatches asset references
5
+ * into Puck data) and `resolver.ts` / `studio-asset-source.ts` can reuse it
6
+ * without a circular import. A reference may carry an optional transform query
7
+ * (`asset://<id>?w=800&fm=webp`) requesting a derivative rendition; the IR
8
+ * resolver decodes it and maps it to a derivative URL via the host's
9
+ * `TransformResolver` (review finding #9).
8
10
  */
9
- export declare function createAssetReference(id: string): string;
11
+ import type { AssetTransform } from "../types/transform.js";
12
+ /**
13
+ * Build the opaque `asset://<id>` reference stored in page data for an asset.
14
+ * The IR resolver ({@link createIRAssetResolver}) turns it back into a validated
15
+ * URL at export / render time; it is never a directly-loadable URL itself.
16
+ *
17
+ * Pass a {@link AssetTransform} to request a derivative rendition — it is
18
+ * encoded as a stable query (`?w=&h=&fit=&fm=&q=&dpr=`) and applied by the
19
+ * resolver's configured `TransformResolver`.
20
+ */
21
+ export declare function createAssetReference(id: string, transform?: AssetTransform): string;
22
+ /** Parsed components of an `asset://` reference. */
23
+ export interface ParsedAssetReference {
24
+ readonly id: string;
25
+ /** Present only when the reference carried a (well-formed) transform query. */
26
+ readonly transform?: AssetTransform;
27
+ }
28
+ /**
29
+ * Parse an `asset://<id>[?transform]` reference. Returns `null` for any non-
30
+ * asset URL or an empty id. Malformed transform params are ignored rather than
31
+ * failing the parse (references can be host- or tamper-supplied).
32
+ */
33
+ export declare function parseAssetReference(url: string): ParsedAssetReference | null;
10
34
  //# sourceMappingURL=asset-reference.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"asset-reference.d.ts","sourceRoot":"","sources":["../../src/utils/asset-reference.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEvD"}
1
+ {"version":3,"file":"asset-reference.d.ts","sourceRoot":"","sources":["../../src/utils/asset-reference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAI5D;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CACnC,EAAE,EAAE,MAAM,EACV,SAAS,CAAC,EAAE,cAAc,GACxB,MAAM,CAKR;AAED,oDAAoD;AACpD,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,QAAQ,CAAC,SAAS,CAAC,EAAE,cAAc,CAAC;CACpC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI,CAW5E"}