@orthacms/media-admin 0.0.0-reserve.0

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 (214) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -0
  3. package/dist/index.d.ts +3 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +1 -0
  6. package/dist/lib/components/AssetActionsMenu/index.d.ts +37 -0
  7. package/dist/lib/components/AssetActionsMenu/index.d.ts.map +1 -0
  8. package/dist/lib/components/AssetActionsMenu/index.js +57 -0
  9. package/dist/lib/components/AssetDetailDrawer/MetaRow/index.d.ts +11 -0
  10. package/dist/lib/components/AssetDetailDrawer/MetaRow/index.d.ts.map +1 -0
  11. package/dist/lib/components/AssetDetailDrawer/MetaRow/index.js +9 -0
  12. package/dist/lib/components/AssetDetailDrawer/index.d.ts +28 -0
  13. package/dist/lib/components/AssetDetailDrawer/index.d.ts.map +1 -0
  14. package/dist/lib/components/AssetDetailDrawer/index.js +93 -0
  15. package/dist/lib/components/EntryMediaTab/MediaFieldSection/index.d.ts +28 -0
  16. package/dist/lib/components/EntryMediaTab/MediaFieldSection/index.d.ts.map +1 -0
  17. package/dist/lib/components/EntryMediaTab/MediaFieldSection/index.js +52 -0
  18. package/dist/lib/components/EntryMediaTab/index.d.ts +11 -0
  19. package/dist/lib/components/EntryMediaTab/index.d.ts.map +1 -0
  20. package/dist/lib/components/EntryMediaTab/index.js +31 -0
  21. package/dist/lib/components/FolderActionsMenu/index.d.ts +21 -0
  22. package/dist/lib/components/FolderActionsMenu/index.d.ts.map +1 -0
  23. package/dist/lib/components/FolderActionsMenu/index.js +25 -0
  24. package/dist/lib/components/MediaAltTextWidget/index.d.ts +9 -0
  25. package/dist/lib/components/MediaAltTextWidget/index.d.ts.map +1 -0
  26. package/dist/lib/components/MediaAltTextWidget/index.js +66 -0
  27. package/dist/lib/components/MediaBreadcrumbs/index.d.ts +11 -0
  28. package/dist/lib/components/MediaBreadcrumbs/index.d.ts.map +1 -0
  29. package/dist/lib/components/MediaEmptyState/index.d.ts +13 -0
  30. package/dist/lib/components/MediaEmptyState/index.d.ts.map +1 -0
  31. package/dist/lib/components/MediaEmptyState/index.js +38 -0
  32. package/dist/lib/components/MediaFieldControl/MediaFieldItem/index.d.ts +34 -0
  33. package/dist/lib/components/MediaFieldControl/MediaFieldItem/index.d.ts.map +1 -0
  34. package/dist/lib/components/MediaFieldControl/MediaFieldItem/index.js +117 -0
  35. package/dist/lib/components/MediaFieldControl/index.d.ts +61 -0
  36. package/dist/lib/components/MediaFieldControl/index.d.ts.map +1 -0
  37. package/dist/lib/components/MediaFieldControl/index.js +422 -0
  38. package/dist/lib/components/MediaFoldersNav/MediaFolderTreeItem/index.d.ts +17 -0
  39. package/dist/lib/components/MediaFoldersNav/MediaFolderTreeItem/index.d.ts.map +1 -0
  40. package/dist/lib/components/MediaFoldersNav/MediaFolderTreeItem/index.js +37 -0
  41. package/dist/lib/components/MediaFoldersNav/index.d.ts +22 -0
  42. package/dist/lib/components/MediaFoldersNav/index.d.ts.map +1 -0
  43. package/dist/lib/components/MediaFoldersNav/index.js +40 -0
  44. package/dist/lib/components/MediaGrid/MediaAssetCard/index.d.ts +18 -0
  45. package/dist/lib/components/MediaGrid/MediaAssetCard/index.d.ts.map +1 -0
  46. package/dist/lib/components/MediaGrid/MediaAssetCard/index.js +29 -0
  47. package/dist/lib/components/MediaGrid/MediaFolderCard/index.d.ts +16 -0
  48. package/dist/lib/components/MediaGrid/MediaFolderCard/index.d.ts.map +1 -0
  49. package/dist/lib/components/MediaGrid/MediaFolderCard/index.js +25 -0
  50. package/dist/lib/components/MediaGrid/index.d.ts +24 -0
  51. package/dist/lib/components/MediaGrid/index.d.ts.map +1 -0
  52. package/dist/lib/components/MediaGrid/index.js +20 -0
  53. package/dist/lib/components/MediaKindBadge/index.d.ts +10 -0
  54. package/dist/lib/components/MediaKindBadge/index.d.ts.map +1 -0
  55. package/dist/lib/components/MediaKindBadge/index.js +30 -0
  56. package/dist/lib/components/MediaKindIcon/index.d.ts +11 -0
  57. package/dist/lib/components/MediaKindIcon/index.d.ts.map +1 -0
  58. package/dist/lib/components/MediaKindIcon/index.js +20 -0
  59. package/dist/lib/components/MediaLibrarySkeleton/index.d.ts +18 -0
  60. package/dist/lib/components/MediaLibrarySkeleton/index.d.ts.map +1 -0
  61. package/dist/lib/components/MediaLibrarySkeleton/index.js +43 -0
  62. package/dist/lib/components/MediaPagination/index.d.ts +26 -0
  63. package/dist/lib/components/MediaPagination/index.d.ts.map +1 -0
  64. package/dist/lib/components/MediaPagination/index.js +52 -0
  65. package/dist/lib/components/MediaPickerDialog/MediaPickerTile/index.d.ts +17 -0
  66. package/dist/lib/components/MediaPickerDialog/MediaPickerTile/index.d.ts.map +1 -0
  67. package/dist/lib/components/MediaPickerDialog/MediaPickerTile/index.js +43 -0
  68. package/dist/lib/components/MediaPickerDialog/index.d.ts +21 -0
  69. package/dist/lib/components/MediaPickerDialog/index.d.ts.map +1 -0
  70. package/dist/lib/components/MediaPickerDialog/index.js +208 -0
  71. package/dist/lib/components/MediaSelectionBar/index.d.ts +18 -0
  72. package/dist/lib/components/MediaSelectionBar/index.d.ts.map +1 -0
  73. package/dist/lib/components/MediaSelectionBar/index.js +26 -0
  74. package/dist/lib/components/MediaStorageStat/index.d.ts +9 -0
  75. package/dist/lib/components/MediaStorageStat/index.d.ts.map +1 -0
  76. package/dist/lib/components/MediaStorageStat/index.js +31 -0
  77. package/dist/lib/components/MediaStorageWidget/index.d.ts +10 -0
  78. package/dist/lib/components/MediaStorageWidget/index.d.ts.map +1 -0
  79. package/dist/lib/components/MediaStorageWidget/index.js +93 -0
  80. package/dist/lib/components/MediaTable/MediaAssetRow/index.d.ts +17 -0
  81. package/dist/lib/components/MediaTable/MediaAssetRow/index.d.ts.map +1 -0
  82. package/dist/lib/components/MediaTable/MediaFolderRow/index.d.ts +16 -0
  83. package/dist/lib/components/MediaTable/MediaFolderRow/index.d.ts.map +1 -0
  84. package/dist/lib/components/MediaTable/index.d.ts +26 -0
  85. package/dist/lib/components/MediaTable/index.d.ts.map +1 -0
  86. package/dist/lib/components/MediaThumbnail/index.d.ts +19 -0
  87. package/dist/lib/components/MediaThumbnail/index.d.ts.map +1 -0
  88. package/dist/lib/components/MediaThumbnail/index.js +26 -0
  89. package/dist/lib/components/MediaToolbar/index.d.ts +19 -0
  90. package/dist/lib/components/MediaToolbar/index.d.ts.map +1 -0
  91. package/dist/lib/components/MediaToolbar/index.js +62 -0
  92. package/dist/lib/components/MediaTopBar/index.d.ts +20 -0
  93. package/dist/lib/components/MediaTopBar/index.d.ts.map +1 -0
  94. package/dist/lib/components/MediaTopBar/index.js +35 -0
  95. package/dist/lib/components/MediaUploadBanner/MediaUploadRow/index.d.ts +14 -0
  96. package/dist/lib/components/MediaUploadBanner/MediaUploadRow/index.d.ts.map +1 -0
  97. package/dist/lib/components/MediaUploadBanner/MediaUploadRow/index.js +51 -0
  98. package/dist/lib/components/MediaUploadBanner/index.d.ts +24 -0
  99. package/dist/lib/components/MediaUploadBanner/index.d.ts.map +1 -0
  100. package/dist/lib/components/MediaUploadBanner/index.js +99 -0
  101. package/dist/lib/components/MediaUploadsWidget/index.d.ts +7 -0
  102. package/dist/lib/components/MediaUploadsWidget/index.d.ts.map +1 -0
  103. package/dist/lib/components/MediaUploadsWidget/index.js +70 -0
  104. package/dist/lib/components/MoveAssetsDialog/DestinationOption/index.d.ts +19 -0
  105. package/dist/lib/components/MoveAssetsDialog/DestinationOption/index.d.ts.map +1 -0
  106. package/dist/lib/components/MoveAssetsDialog/DestinationOption/index.js +10 -0
  107. package/dist/lib/components/MoveAssetsDialog/index.d.ts +18 -0
  108. package/dist/lib/components/MoveAssetsDialog/index.d.ts.map +1 -0
  109. package/dist/lib/components/MoveAssetsDialog/index.js +41 -0
  110. package/dist/lib/components/NewFolderDialog/index.d.ts +13 -0
  111. package/dist/lib/components/NewFolderDialog/index.d.ts.map +1 -0
  112. package/dist/lib/components/NewFolderDialog/index.js +45 -0
  113. package/dist/lib/components/RenameDialog/index.d.ts +13 -0
  114. package/dist/lib/components/RenameDialog/index.d.ts.map +1 -0
  115. package/dist/lib/components/RenameDialog/index.js +37 -0
  116. package/dist/lib/components/UploadDialog/StagedFileRow/index.d.ts +25 -0
  117. package/dist/lib/components/UploadDialog/StagedFileRow/index.d.ts.map +1 -0
  118. package/dist/lib/components/UploadDialog/StagedFileRow/index.js +82 -0
  119. package/dist/lib/components/UploadDialog/index.d.ts +50 -0
  120. package/dist/lib/components/UploadDialog/index.d.ts.map +1 -0
  121. package/dist/lib/components/UploadDialog/index.js +120 -0
  122. package/dist/lib/components/WysiwygLibrarySource/index.d.ts +14 -0
  123. package/dist/lib/components/WysiwygLibrarySource/index.d.ts.map +1 -0
  124. package/dist/lib/components/WysiwygLibrarySource/index.js +28 -0
  125. package/dist/lib/components/WysiwygUploadSource/index.d.ts +25 -0
  126. package/dist/lib/components/WysiwygUploadSource/index.d.ts.map +1 -0
  127. package/dist/lib/components/WysiwygUploadSource/index.js +102 -0
  128. package/dist/lib/constants/index.d.ts +82 -0
  129. package/dist/lib/constants/index.d.ts.map +1 -0
  130. package/dist/lib/constants/index.js +75 -0
  131. package/dist/lib/hooks/useMediaInsights/index.d.ts +32 -0
  132. package/dist/lib/hooks/useMediaInsights/index.d.ts.map +1 -0
  133. package/dist/lib/hooks/useMediaInsights/index.js +85 -0
  134. package/dist/lib/hooks/useMediaLibrary/index.d.ts +83 -0
  135. package/dist/lib/hooks/useMediaLibrary/index.d.ts.map +1 -0
  136. package/dist/lib/hooks/useMediaLibrary/index.js +341 -0
  137. package/dist/lib/hooks/usePendingMediaUploads/index.d.ts +26 -0
  138. package/dist/lib/hooks/usePendingMediaUploads/index.d.ts.map +1 -0
  139. package/dist/lib/hooks/usePendingMediaUploads/index.js +217 -0
  140. package/dist/lib/hooks/useUploadQueue/index.d.ts +33 -0
  141. package/dist/lib/hooks/useUploadQueue/index.d.ts.map +1 -0
  142. package/dist/lib/hooks/useUploadQueue/index.js +218 -0
  143. package/dist/lib/hooks/useWysiwygAssetPicker/index.d.ts +23 -0
  144. package/dist/lib/hooks/useWysiwygAssetPicker/index.d.ts.map +1 -0
  145. package/dist/lib/infrastructure/apiMessage/index.d.ts +17 -0
  146. package/dist/lib/infrastructure/apiMessage/index.d.ts.map +1 -0
  147. package/dist/lib/infrastructure/apiMessage/index.js +30 -0
  148. package/dist/lib/infrastructure/httpMediaGateway/index.d.ts +9 -0
  149. package/dist/lib/infrastructure/httpMediaGateway/index.d.ts.map +1 -0
  150. package/dist/lib/infrastructure/httpMediaGateway/index.js +157 -0
  151. package/dist/lib/infrastructure/httpMediaInsightsGateway/index.d.ts +8 -0
  152. package/dist/lib/infrastructure/httpMediaInsightsGateway/index.d.ts.map +1 -0
  153. package/dist/lib/infrastructure/httpMediaInsightsGateway/index.js +35 -0
  154. package/dist/lib/infrastructure/mediaGateway/index.d.ts +120 -0
  155. package/dist/lib/infrastructure/mediaGateway/index.d.ts.map +1 -0
  156. package/dist/lib/infrastructure/mediaGateway/index.js +1 -0
  157. package/dist/lib/infrastructure/mediaInsightsGateway/index.d.ts +46 -0
  158. package/dist/lib/infrastructure/mediaInsightsGateway/index.d.ts.map +1 -0
  159. package/dist/lib/infrastructure/mediaInsightsGateway/index.js +6 -0
  160. package/dist/lib/infrastructure/mediaKeys/index.d.ts +23 -0
  161. package/dist/lib/infrastructure/mediaKeys/index.d.ts.map +1 -0
  162. package/dist/lib/infrastructure/mediaKeys/index.js +11 -0
  163. package/dist/lib/infrastructure/mediaMapper/index.d.ts +50 -0
  164. package/dist/lib/infrastructure/mediaMapper/index.d.ts.map +1 -0
  165. package/dist/lib/infrastructure/mediaMapper/index.js +39 -0
  166. package/dist/lib/pages/MediaLibraryPage/index.d.ts +23 -0
  167. package/dist/lib/pages/MediaLibraryPage/index.d.ts.map +1 -0
  168. package/dist/lib/pages/MediaLibraryPage/index.js +425 -0
  169. package/dist/lib/types/mediaAsset/index.d.ts +44 -0
  170. package/dist/lib/types/mediaAsset/index.d.ts.map +1 -0
  171. package/dist/lib/types/mediaAsset/index.js +1 -0
  172. package/dist/lib/types/mediaFieldDisplay/index.d.ts +48 -0
  173. package/dist/lib/types/mediaFieldDisplay/index.d.ts.map +1 -0
  174. package/dist/lib/types/mediaFieldDisplay/index.js +1 -0
  175. package/dist/lib/types/mediaFolder/index.d.ts +16 -0
  176. package/dist/lib/types/mediaFolder/index.d.ts.map +1 -0
  177. package/dist/lib/types/mediaFolder/index.js +1 -0
  178. package/dist/lib/types/pendingUpload/index.d.ts +38 -0
  179. package/dist/lib/types/pendingUpload/index.d.ts.map +1 -0
  180. package/dist/lib/types/pendingUpload/index.js +1 -0
  181. package/dist/lib/types/upload/index.d.ts +37 -0
  182. package/dist/lib/types/upload/index.d.ts.map +1 -0
  183. package/dist/lib/types/upload/index.js +1 -0
  184. package/dist/lib/utils/assetGradient/index.d.ts +8 -0
  185. package/dist/lib/utils/assetGradient/index.d.ts.map +1 -0
  186. package/dist/lib/utils/assetGradient/index.js +16 -0
  187. package/dist/lib/utils/assetHandlers/index.d.ts +11 -0
  188. package/dist/lib/utils/assetHandlers/index.d.ts.map +1 -0
  189. package/dist/lib/utils/assetHandlers/index.js +17 -0
  190. package/dist/lib/utils/folderContents/index.d.ts +17 -0
  191. package/dist/lib/utils/folderContents/index.d.ts.map +1 -0
  192. package/dist/lib/utils/folderContents/index.js +35 -0
  193. package/dist/lib/utils/folderTree/index.d.ts +13 -0
  194. package/dist/lib/utils/folderTree/index.d.ts.map +1 -0
  195. package/dist/lib/utils/folderTree/index.js +15 -0
  196. package/dist/lib/utils/formatBytes/index.d.ts +6 -0
  197. package/dist/lib/utils/formatBytes/index.d.ts.map +1 -0
  198. package/dist/lib/utils/formatBytes/index.js +17 -0
  199. package/dist/lib/utils/formatDuration/index.d.ts +6 -0
  200. package/dist/lib/utils/formatDuration/index.d.ts.map +1 -0
  201. package/dist/lib/utils/formatDuration/index.js +13 -0
  202. package/dist/lib/utils/kindFromMime/index.d.ts +10 -0
  203. package/dist/lib/utils/kindFromMime/index.d.ts.map +1 -0
  204. package/dist/lib/utils/kindFromMime/index.js +27 -0
  205. package/dist/lib/utils/mediaAccept/index.d.ts +30 -0
  206. package/dist/lib/utils/mediaAccept/index.d.ts.map +1 -0
  207. package/dist/lib/utils/mediaAccept/index.js +63 -0
  208. package/dist/lib/utils/mediaPlugin/index.d.ts +15 -0
  209. package/dist/lib/utils/mediaPlugin/index.d.ts.map +1 -0
  210. package/dist/lib/utils/mediaPlugin/index.js +177 -0
  211. package/dist/lib/utils/toWysiwygEmbed/index.d.ts +23 -0
  212. package/dist/lib/utils/toWysiwygEmbed/index.d.ts.map +1 -0
  213. package/dist/lib/utils/toWysiwygEmbed/index.js +44 -0
  214. package/package.json +50 -0
@@ -0,0 +1,120 @@
1
+ import type { MediaAsset } from '../../types/mediaAsset';
2
+ import type { MediaFolder } from '../../types/mediaFolder';
3
+ /** Folders plus a per-folder asset-count map (keyed by folder id + root). */
4
+ export type MediaFoldersResult = {
5
+ folders: MediaFolder[];
6
+ /** folder id → direct asset count, including `ROOT_FOLDER_ID` for the root. */
7
+ folderCounts: Map<string, number>;
8
+ };
9
+ /**
10
+ * How a listing is browsed — the whole of it, sent to the server.
11
+ *
12
+ * Every field here used to be applied in the browser over one fixed page of
13
+ * 100, which meant "oldest first" ordered the *newest hundred* and a search
14
+ * could not see a file that existed. They belong on the request because only
15
+ * the server can see the whole folder.
16
+ */
17
+ export type ListAssetsParams = {
18
+ /** Folder to list — an admin folder id or the root sentinel. */
19
+ folderId: string;
20
+ /** Free-text match over the asset name. Blank means no search. */
21
+ search?: string;
22
+ /** A `MediaKind`, or the `all` sentinel for no kind filter. */
23
+ kind?: string;
24
+ /** One of the server's whitelisted sorts. */
25
+ sort?: string;
26
+ /** 1-based page number. */
27
+ page: number;
28
+ /** How many assets to return. The server caps this at 100. */
29
+ pageSize: number;
30
+ };
31
+ /**
32
+ * One page of assets plus the count the pager needs. `total` counts everything
33
+ * matching the search and filter across the whole folder, not what came back in
34
+ * `items` — which is the number the old gateway threw away.
35
+ */
36
+ export type MediaAssetPage = {
37
+ items: MediaAsset[];
38
+ total: number;
39
+ page: number;
40
+ pageSize: number;
41
+ };
42
+ /** Create-folder input. `parentId` is an admin folder id or the root sentinel. */
43
+ export type CreateFolderInput = {
44
+ name: string;
45
+ parentId: string;
46
+ };
47
+ /** Rename input for a folder or an asset. */
48
+ export type RenameInput = {
49
+ id: string;
50
+ name: string;
51
+ };
52
+ /**
53
+ * Partial update of an asset's descriptive metadata. `alt` is sent verbatim —
54
+ * the server normalizes a blank string back to "no alt", so clearing the field
55
+ * clears the description rather than storing whitespace that would count as
56
+ * covered in the alt-coverage insight.
57
+ */
58
+ export type UpdateAssetInput = {
59
+ id: string;
60
+ alt: string;
61
+ };
62
+ /** Move input — the target folder is an admin id or the root sentinel. */
63
+ export type MoveAssetsInput = {
64
+ ids: string[];
65
+ folderId: string;
66
+ };
67
+ /**
68
+ * One file queued for upload, with the description its author wrote for it.
69
+ *
70
+ * Alt text rides along with the bytes rather than waiting for a later edit:
71
+ * the moment the author is looking at the image is the only moment they can
72
+ * describe it cheaply, and an asset that lands with `alt: null` is one nothing
73
+ * in the product will ever ask about again.
74
+ */
75
+ export type StagedUpload = {
76
+ file: File;
77
+ /** Alt text for an image; omitted or blank means "not described". */
78
+ alt?: string;
79
+ };
80
+ /** Per-request upload options — progress reporting and caller cancellation. */
81
+ export type UploadOptions = {
82
+ /** Alt text stored on the created asset (blank/absent → no description). */
83
+ alt?: string;
84
+ /**
85
+ * Called as the request body is written, with the whole-number percentage
86
+ * of bytes sent (0–100). Axios only reports this while the browser is
87
+ * uploading; the server's own processing time lands at 100% and waits.
88
+ */
89
+ onProgress?: (percent: number) => void;
90
+ /** Aborts the in-flight request (the user cancelled the upload). */
91
+ signal?: AbortSignal;
92
+ };
93
+ /**
94
+ * The port over the media API — the single seam the plugin talks to instead of
95
+ * `apiClient` directly. Every method takes/returns the admin's models (root is
96
+ * the `ROOT_FOLDER_ID` sentinel, translated to `null` at the wire). The `http*`
97
+ * implementation is the only place `apiClient` is used.
98
+ */
99
+ export type MediaGateway = {
100
+ listFolders(): Promise<MediaFoldersResult>;
101
+ listAssets(params: ListAssetsParams): Promise<MediaAssetPage>;
102
+ createFolder(input: CreateFolderInput): Promise<void>;
103
+ renameFolder(input: RenameInput): Promise<void>;
104
+ deleteFolder(id: string): Promise<void>;
105
+ /**
106
+ * Uploads **one** file and returns the created asset (the server echoes its
107
+ * view). The queue (concurrency, per-file progress, retries) is the
108
+ * caller's — the gateway stays a thin one-request-per-call seam so a failure
109
+ * maps to exactly one file. The upload-queue caller ignores the return; the
110
+ * media-field picker uses it to set the field value to the new asset id.
111
+ */
112
+ uploadFile(folderId: string, file: File, options?: UploadOptions): Promise<MediaAsset>;
113
+ renameAsset(input: RenameInput): Promise<void>;
114
+ /** Updates an asset's descriptive metadata (today: its alt text). */
115
+ updateAsset(input: UpdateAssetInput): Promise<void>;
116
+ moveAssets(input: MoveAssetsInput): Promise<void>;
117
+ duplicateAssets(ids: string[]): Promise<void>;
118
+ deleteAssets(ids: string[]): Promise<void>;
119
+ };
120
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/mediaGateway/index.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The media Insights read models, restated from the server's view contracts —
3
+ * the admin can't import across the app boundary, exactly as with every other
4
+ * wire type in this package.
5
+ */
6
+ /** Storage used by one media kind. */
7
+ export type MediaKindUsage = {
8
+ /** `image` · `video` · `audio` · `document` · `archive`. */
9
+ kind: string;
10
+ count: number;
11
+ bytes: number;
12
+ };
13
+ /** What the workspace's media library is made of. */
14
+ export type MediaStorage = {
15
+ kinds: MediaKindUsage[];
16
+ totalBytes: number;
17
+ totalCount: number;
18
+ };
19
+ /** Assets uploaded per time bucket. */
20
+ export type MediaUploads = {
21
+ points: {
22
+ bucket: string;
23
+ value: number;
24
+ }[];
25
+ granularity: 'day' | 'week' | 'month';
26
+ total: number;
27
+ };
28
+ /** Alt-text coverage across the workspace's images. */
29
+ export type MediaAltCoverage = {
30
+ images: number;
31
+ withAlt: number;
32
+ missing: number;
33
+ };
34
+ /**
35
+ * The port over the media Insights endpoints — one method per widget, mirroring
36
+ * one route per widget. {@link httpMediaInsightsGateway} is the implementation.
37
+ */
38
+ export type MediaInsightsGateway = {
39
+ /** `GET /insights/media/storage` — assets and bytes per kind. */
40
+ storage(): Promise<MediaStorage>;
41
+ /** `GET /insights/media/uploads` — assets added per bucket. */
42
+ uploads(days: number): Promise<MediaUploads>;
43
+ /** `GET /insights/media/alt` — alt-text coverage across images. */
44
+ altCoverage(): Promise<MediaAltCoverage>;
45
+ };
46
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/mediaInsightsGateway/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,sCAAsC;AACtC,MAAM,MAAM,cAAc,GAAG;IACzB,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,qDAAqD;AACrD,MAAM,MAAM,YAAY,GAAG;IACvB,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,uCAAuC;AACvC,MAAM,MAAM,YAAY,GAAG;IACvB,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5C,WAAW,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,uDAAuD;AACvD,MAAM,MAAM,gBAAgB,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAC/B,iEAAiE;IACjE,OAAO,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC;IACjC,+DAA+D;IAC/D,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC7C,mEAAmE;IACnE,WAAW,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAC5C,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The media Insights read models, restated from the server's view contracts —
3
+ * the admin can't import across the app boundary, exactly as with every other
4
+ * wire type in this package.
5
+ */
6
+ export {};
@@ -0,0 +1,23 @@
1
+ import type { ListAssetsParams } from '../mediaGateway';
2
+ /**
3
+ * The part of a listing that decides which assets come back. Everything the
4
+ * server filters, orders or pages by is in the key, so changing a control
5
+ * fetches its own page instead of re-reading one built under the previous
6
+ * controls. `folderId` stays a separate segment: it is the thing the user
7
+ * navigates, and keeping it above the rest makes a folder's pages
8
+ * invalidatable on their own.
9
+ */
10
+ type AssetListKey = Omit<ListAssetsParams, 'folderId'>;
11
+ /**
12
+ * TanStack Query keys for the Media Library cache, scoped per workspace so one
13
+ * workspace's folders/assets never bleed into another's. Mutations invalidate
14
+ * `mediaKeys.all(workspaceId)`, which is a prefix of every key below, so it
15
+ * still refreshes the folders and whichever asset page is on screen.
16
+ */
17
+ export declare const mediaKeys: {
18
+ all: (workspaceId: string) => readonly ["media", string];
19
+ folders: (workspaceId: string) => readonly ["media", string, "folders"];
20
+ assets: (workspaceId: string, folderId: string, list: AssetListKey) => readonly ["media", string, "assets", string, AssetListKey];
21
+ };
22
+ export {};
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/mediaKeys/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAExD;;;;;;;GAOG;AACH,KAAK,YAAY,GAAG,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,SAAS;uBACC,MAAM;2BACF,MAAM;0BAEP,MAAM,YAAY,MAAM,QAAQ,YAAY;CAErE,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * TanStack Query keys for the Media Library cache, scoped per workspace so one
3
+ * workspace's folders/assets never bleed into another's. Mutations invalidate
4
+ * `mediaKeys.all(workspaceId)`, which is a prefix of every key below, so it
5
+ * still refreshes the folders and whichever asset page is on screen.
6
+ */
7
+ export const mediaKeys = {
8
+ all: (workspaceId) => ['media', workspaceId],
9
+ folders: (workspaceId) => ['media', workspaceId, 'folders'],
10
+ assets: (workspaceId, folderId, list) => ['media', workspaceId, 'assets', folderId, list]
11
+ };
@@ -0,0 +1,50 @@
1
+ import type { MediaAsset } from '../../types/mediaAsset';
2
+ import type { MediaFolder } from '../../types/mediaFolder';
3
+ /**
4
+ * Wire shape of an asset from the media API (mirrors the server's `AssetView`).
5
+ * The admin restates it locally — it can't import the server package across the
6
+ * module boundary.
7
+ */
8
+ export type AssetResponse = {
9
+ id: string;
10
+ name: string;
11
+ folderId: string | null;
12
+ kind: string;
13
+ mimeType: string;
14
+ size: number;
15
+ url: string;
16
+ variants: string[];
17
+ width: number | null;
18
+ height: number | null;
19
+ duration: number | null;
20
+ tags: string[];
21
+ alt: string | null;
22
+ uploadedBy: string;
23
+ createdAt: string;
24
+ updatedAt: string;
25
+ };
26
+ /** Wire shape of a folder (mirrors the server's `FolderView`). */
27
+ export type FolderResponse = {
28
+ id: string;
29
+ name: string;
30
+ parentId: string | null;
31
+ assetCount: number;
32
+ createdAt: string;
33
+ };
34
+ /** The folders listing envelope (mirrors the server's `FoldersView`). */
35
+ export type FoldersResponse = {
36
+ folders: FolderResponse[];
37
+ rootAssetCount: number;
38
+ };
39
+ /** One page of assets (mirrors the server's `AssetListView`). */
40
+ export type AssetListResponse = {
41
+ items: AssetResponse[];
42
+ total: number;
43
+ page: number;
44
+ pageSize: number;
45
+ };
46
+ /** Maps a wire folder to the admin model; a null parent → the root sentinel. */
47
+ export declare function toMediaFolder(dto: FolderResponse): MediaFolder;
48
+ /** Maps a wire asset to the admin model; a null folder → the root sentinel. */
49
+ export declare function toMediaAsset(dto: AssetResponse): MediaAsset;
50
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/infrastructure/mediaMapper/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,kEAAkE;AAClE,MAAM,MAAM,cAAc,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,yEAAyE;AACzE,MAAM,MAAM,eAAe,GAAG;IAC1B,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,iEAAiE;AACjE,MAAM,MAAM,iBAAiB,GAAG;IAC5B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,GAAG,EAAE,cAAc,GAAG,WAAW,CAO9D;AASD,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,UAAU,CAsB3D"}
@@ -0,0 +1,39 @@
1
+ import { ROOT_FOLDER_ID } from '../../constants';
2
+ /** Maps a wire folder to the admin model; a null parent → the root sentinel. */
3
+ export function toMediaFolder(dto) {
4
+ return {
5
+ id: dto.id,
6
+ name: dto.name,
7
+ parentId: dto.parentId ?? ROOT_FOLDER_ID,
8
+ createdAt: dto.createdAt
9
+ };
10
+ }
11
+ /** The `?variant=` download URL when the asset has that derivative, else null. */
12
+ function variantUrl(dto, name) {
13
+ return dto.variants.includes(name)
14
+ ? `${dto.url}?variant=${name}`
15
+ : undefined;
16
+ }
17
+ /** Maps a wire asset to the admin model; a null folder → the root sentinel. */
18
+ export function toMediaAsset(dto) {
19
+ return {
20
+ id: dto.id,
21
+ name: dto.name,
22
+ kind: dto.kind,
23
+ url: dto.url,
24
+ thumbUrl: variantUrl(dto, 'thumb'),
25
+ previewUrl: variantUrl(dto, 'preview'),
26
+ mimeType: dto.mimeType,
27
+ size: dto.size,
28
+ folderId: dto.folderId ?? ROOT_FOLDER_ID,
29
+ dimensions: dto.width !== null && dto.height !== null
30
+ ? { width: dto.width, height: dto.height }
31
+ : undefined,
32
+ duration: dto.duration ?? undefined,
33
+ tags: dto.tags,
34
+ alt: dto.alt ?? undefined,
35
+ uploadedBy: dto.uploadedBy,
36
+ createdAt: dto.createdAt,
37
+ updatedAt: dto.updatedAt
38
+ };
39
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The Media Library, mounted inside the workspace shell at
3
+ * `/workspaces/:id/media`. `useMediaLibrary` is the store — folders and the open
4
+ * folder's assets come from `@orthacms/media-server`, and every action (browse
5
+ * folders, upload, create folder, rename, duplicate, move, delete, filter, sort,
6
+ * open the detail drawer) runs against the API, firing a toast per action —
7
+ * except uploads, whose status lives in the `MediaUploadBanner`. Controls gate
8
+ * on the real `media:*` matrix via `useHasPermission`.
9
+ *
10
+ * A sticky `MediaTopBar` heads the page (the shared icon-tile + breadcrumb
11
+ * header every admin page carries), spanning both panes. Below it sits a
12
+ * two-pane layout — a folders sidebar beside the asset browser — plus the detail
13
+ * drawer and the create/rename/move/upload dialogs. Both panes sit
14
+ * **flush on the canvas** (no muted board, no bordered island), mirroring the
15
+ * Content Library's work area: the sidebar is divided by a hairline `border-r`
16
+ * and each pane scrolls independently. Sized with `flex-1` against the workspace
17
+ * shell's `min-h-svh` column — NOT its own `svh` calc — so there is exactly one
18
+ * viewport measurement in the chain; a second, independently rounded one can end
19
+ * up a pixel taller (visible at browser zoom ≠ 100%) and give the document a
20
+ * phantom scrollbar beside the pane's own.
21
+ */
22
+ export declare function MediaLibraryPage(): import("react").JSX.Element;
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/pages/MediaLibraryPage/index.tsx"],"names":[],"mappings":"AA2KA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,gCA2jB/B"}