filecove 0.0.0-stage → 0.2.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 (280) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/LICENSE +21 -0
  3. package/README.md +65 -2
  4. package/THIRD_PARTY_NOTICES.md +63 -0
  5. package/dist/components/buttons/toolbar-actions.d.ts +28 -0
  6. package/dist/components/buttons/tooltip-icon-button.d.ts +14 -0
  7. package/dist/components/downloads/download-panel.d.ts +23 -0
  8. package/dist/components/drag/drag-preview.d.ts +24 -0
  9. package/dist/components/file-manager/announcer.d.ts +14 -0
  10. package/dist/components/file-manager/content/file-grid.d.ts +8 -0
  11. package/dist/components/file-manager/content/file-list.d.ts +9 -0
  12. package/dist/components/file-manager/content/folder-view.d.ts +83 -0
  13. package/dist/components/file-manager/content/item-icon.d.ts +16 -0
  14. package/dist/components/file-manager/content/no-sections.d.ts +11 -0
  15. package/dist/components/file-manager/content/search-results.d.ts +40 -0
  16. package/dist/components/file-manager/content/search-tabs.d.ts +29 -0
  17. package/dist/components/file-manager/content/trash-bar.d.ts +13 -0
  18. package/dist/components/file-manager/context-menu/context-menu.d.ts +20 -0
  19. package/dist/components/file-manager/dialogs/conflict-step.d.ts +28 -0
  20. package/dist/components/file-manager/dialogs/delete-dialog.d.ts +49 -0
  21. package/dist/components/file-manager/dialogs/image-viewer.d.ts +42 -0
  22. package/dist/components/file-manager/dialogs/name-dialog.d.ts +41 -0
  23. package/dist/components/file-manager/dialogs/paste-dialog.d.ts +39 -0
  24. package/dist/components/file-manager/dialogs/preview-dialog.d.ts +75 -0
  25. package/dist/components/file-manager/dialogs/restore-dialog.d.ts +41 -0
  26. package/dist/components/file-manager/dialogs/shortcuts-dialog.d.ts +36 -0
  27. package/dist/components/file-manager/dialogs/transfer-dialog.d.ts +71 -0
  28. package/dist/components/file-manager/dialogs/upload-dialog.d.ts +34 -0
  29. package/dist/components/file-manager/file-manager.d.ts +320 -0
  30. package/dist/components/file-manager/find-layer.d.ts +29 -0
  31. package/dist/components/file-manager/header-bar/header-bar.d.ts +65 -0
  32. package/dist/components/file-manager/header-bar/history-menu.d.ts +18 -0
  33. package/dist/components/file-manager/header-bar/path-bar.d.ts +19 -0
  34. package/dist/components/file-manager/header-bar/path-field.d.ts +23 -0
  35. package/dist/components/file-manager/header-bar/search-field.d.ts +27 -0
  36. package/dist/components/file-manager/header-bar/search-sections-menu.d.ts +25 -0
  37. package/dist/components/file-manager/header-bar/view-menu.d.ts +39 -0
  38. package/dist/components/file-manager/notice-bar.d.ts +36 -0
  39. package/dist/components/file-manager/properties-pane.d.ts +53 -0
  40. package/dist/components/file-manager/resize-edge.d.ts +39 -0
  41. package/dist/components/file-manager/selection-bar.d.ts +15 -0
  42. package/dist/components/file-manager/sidebar/location-item.d.ts +36 -0
  43. package/dist/components/file-manager/sidebar/main-menu.d.ts +23 -0
  44. package/dist/components/file-manager/sidebar/sidebar.d.ts +80 -0
  45. package/dist/components/icons/check-badge.d.ts +3 -0
  46. package/dist/components/icons/create-icon.d.ts +20 -0
  47. package/dist/components/icons/file-icon.d.ts +19 -0
  48. package/dist/components/icons/icon-provider.d.ts +21 -0
  49. package/dist/components/icons/icon-slot.d.ts +6 -0
  50. package/dist/components/icons/icon.d.ts +19 -0
  51. package/dist/components/icons/locked-icon.d.ts +9 -0
  52. package/dist/components/media-manager/asset-delete.d.ts +29 -0
  53. package/dist/components/media-manager/asset-hold.d.ts +32 -0
  54. package/dist/components/media-manager/asset-option.d.ts +74 -0
  55. package/dist/components/media-manager/asset-trail.d.ts +13 -0
  56. package/dist/components/media-manager/choice-list.d.ts +29 -0
  57. package/dist/components/media-manager/choices-pane.d.ts +50 -0
  58. package/dist/components/media-manager/choose-bar.d.ts +26 -0
  59. package/dist/components/media-manager/drop-zone.d.ts +7 -0
  60. package/dist/components/media-manager/group-check.d.ts +13 -0
  61. package/dist/components/media-manager/group-create.d.ts +20 -0
  62. package/dist/components/media-manager/group-path.d.ts +24 -0
  63. package/dist/components/media-manager/library-list.d.ts +23 -0
  64. package/dist/components/media-manager/media-asset.d.ts +65 -0
  65. package/dist/components/media-manager/media-edit-many.d.ts +33 -0
  66. package/dist/components/media-manager/media-fields.d.ts +31 -0
  67. package/dist/components/media-manager/media-filter-chips.d.ts +17 -0
  68. package/dist/components/media-manager/media-filters-dialog.d.ts +39 -0
  69. package/dist/components/media-manager/media-filters.d.ts +37 -0
  70. package/dist/components/media-manager/media-form.d.ts +29 -0
  71. package/dist/components/media-manager/media-frame.d.ts +77 -0
  72. package/dist/components/media-manager/media-grid.d.ts +114 -0
  73. package/dist/components/media-manager/media-group.d.ts +29 -0
  74. package/dist/components/media-manager/media-header.d.ts +80 -0
  75. package/dist/components/media-manager/media-manager.d.ts +309 -0
  76. package/dist/components/media-manager/media-move.d.ts +30 -0
  77. package/dist/components/media-manager/media-picker.d.ts +140 -0
  78. package/dist/components/media-manager/media-picture.d.ts +26 -0
  79. package/dist/components/media-manager/media-process.d.ts +26 -0
  80. package/dist/components/media-manager/media-row.d.ts +13 -0
  81. package/dist/components/media-manager/media-step.d.ts +33 -0
  82. package/dist/components/media-manager/media-tile.d.ts +15 -0
  83. package/dist/components/media-manager/media-upload.d.ts +46 -0
  84. package/dist/components/media-manager/open-button.d.ts +15 -0
  85. package/dist/components/media-manager/picker-frame.d.ts +33 -0
  86. package/dist/components/media-manager/selection-bar.d.ts +25 -0
  87. package/dist/components/media-manager/upload-tile.d.ts +17 -0
  88. package/dist/components/properties/properties-panel.d.ts +53 -0
  89. package/dist/components/properties/property-display.d.ts +15 -0
  90. package/dist/components/properties/property-editor.d.ts +26 -0
  91. package/dist/components/properties/property-input.d.ts +36 -0
  92. package/dist/components/transfers/transfer-panel.d.ts +25 -0
  93. package/dist/components/ui/backdrop.d.ts +7 -0
  94. package/dist/components/ui/button-base.d.ts +7 -0
  95. package/dist/components/ui/button.d.ts +18 -0
  96. package/dist/components/ui/checkbox.d.ts +24 -0
  97. package/dist/components/ui/chip.d.ts +18 -0
  98. package/dist/components/ui/circular-progress.d.ts +14 -0
  99. package/dist/components/ui/collapse.d.ts +9 -0
  100. package/dist/components/ui/dialog.d.ts +40 -0
  101. package/dist/components/ui/divider.d.ts +4 -0
  102. package/dist/components/ui/icon-button.d.ts +12 -0
  103. package/dist/components/ui/linear-progress.d.ts +13 -0
  104. package/dist/components/ui/link.d.ts +4 -0
  105. package/dist/components/ui/menu.d.ts +77 -0
  106. package/dist/components/ui/root-providers.d.ts +16 -0
  107. package/dist/components/ui/text-field.d.ts +38 -0
  108. package/dist/components/ui/text.d.ts +21 -0
  109. package/dist/components/ui/tooltip.d.ts +24 -0
  110. package/dist/components/uploads/upload-panel.d.ts +31 -0
  111. package/dist/contexts/asset-look-context.d.ts +1 -0
  112. package/dist/contexts/cut-context.d.ts +6 -0
  113. package/dist/contexts/data-context.d.ts +12 -0
  114. package/dist/contexts/direction-context.d.ts +2 -0
  115. package/dist/contexts/drag-context.d.ts +36 -0
  116. package/dist/contexts/icon-context.d.ts +10 -0
  117. package/dist/contexts/locale-context.d.ts +2 -0
  118. package/dist/contexts/moving-context.d.ts +7 -0
  119. package/dist/create-icon-D2vnnBQX.js +40 -0
  120. package/dist/create-icon-D2vnnBQX.js.map +1 -0
  121. package/dist/hooks/use-announcer.d.ts +20 -0
  122. package/dist/hooks/use-asset-look.d.ts +6 -0
  123. package/dist/hooks/use-asset-states.d.ts +12 -0
  124. package/dist/hooks/use-chosen-column.d.ts +16 -0
  125. package/dist/hooks/use-clipboard-follow.d.ts +12 -0
  126. package/dist/hooks/use-controlled.d.ts +18 -0
  127. package/dist/hooks/use-cut-ids.d.ts +3 -0
  128. package/dist/hooks/use-dev-checks.d.ts +16 -0
  129. package/dist/hooks/use-download-queue.d.ts +19 -0
  130. package/dist/hooks/use-dragged-ids.d.ts +3 -0
  131. package/dist/hooks/use-drop-target.d.ts +48 -0
  132. package/dist/hooks/use-entry-drag.d.ts +46 -0
  133. package/dist/hooks/use-files-drop.d.ts +20 -0
  134. package/dist/hooks/use-folder.d.ts +14 -0
  135. package/dist/hooks/use-fork-ref.d.ts +6 -0
  136. package/dist/hooks/use-form-send.d.ts +12 -0
  137. package/dist/hooks/use-found.d.ts +10 -0
  138. package/dist/hooks/use-icon-config.d.ts +2 -0
  139. package/dist/hooks/use-level-filters.d.ts +112 -0
  140. package/dist/hooks/use-level-search.d.ts +21 -0
  141. package/dist/hooks/use-locale.d.ts +10 -0
  142. package/dist/hooks/use-location-history.d.ts +42 -0
  143. package/dist/hooks/use-long-press.d.ts +25 -0
  144. package/dist/hooks/use-marquee.d.ts +35 -0
  145. package/dist/hooks/use-match-count.d.ts +8 -0
  146. package/dist/hooks/use-media-search.d.ts +44 -0
  147. package/dist/hooks/use-moving-ids.d.ts +3 -0
  148. package/dist/hooks/use-picks.d.ts +39 -0
  149. package/dist/hooks/use-preview-contents.d.ts +33 -0
  150. package/dist/hooks/use-properties.d.ts +25 -0
  151. package/dist/hooks/use-scroll-measure.d.ts +34 -0
  152. package/dist/hooks/use-search.d.ts +12 -0
  153. package/dist/hooks/use-selection.d.ts +29 -0
  154. package/dist/hooks/use-setting.d.ts +21 -0
  155. package/dist/hooks/use-stable-set.d.ts +6 -0
  156. package/dist/hooks/use-swipe.d.ts +41 -0
  157. package/dist/hooks/use-text-direction.d.ts +8 -0
  158. package/dist/hooks/use-thumbnail.d.ts +8 -0
  159. package/dist/hooks/use-transfer-queue.d.ts +22 -0
  160. package/dist/hooks/use-tree-rows.d.ts +9 -0
  161. package/dist/hooks/use-tree-selection.d.ts +19 -0
  162. package/dist/hooks/use-type-ahead.d.ts +9 -0
  163. package/dist/hooks/use-type-icons.d.ts +10 -0
  164. package/dist/hooks/use-upload-queue.d.ts +24 -0
  165. package/dist/hooks/use-virtual-lines.d.ts +27 -0
  166. package/dist/hooks/use-virtual-rows.d.ts +31 -0
  167. package/dist/hooks/use-wheel-zoom.d.ts +10 -0
  168. package/dist/icon-sets/filled.d.ts +6 -0
  169. package/dist/icon-sets/filled.js +76 -0
  170. package/dist/icon-sets/filled.js.map +1 -0
  171. package/dist/icon-sets/outlined.d.ts +6 -0
  172. package/dist/icon-sets/outlined.js +73 -0
  173. package/dist/icon-sets/outlined.js.map +1 -0
  174. package/dist/icon-sets/rounded.d.ts +6 -0
  175. package/dist/icon-sets/rounded.js +73 -0
  176. package/dist/icon-sets/rounded.js.map +1 -0
  177. package/dist/icon-sets/sharp.d.ts +6 -0
  178. package/dist/icon-sets/sharp.js +73 -0
  179. package/dist/icon-sets/sharp.js.map +1 -0
  180. package/dist/icon-sets/two-tone.d.ts +6 -0
  181. package/dist/icon-sets/two-tone.js +188 -0
  182. package/dist/icon-sets/two-tone.js.map +1 -0
  183. package/dist/index.d.ts +18 -0
  184. package/dist/index.js +32651 -0
  185. package/dist/index.js.map +1 -0
  186. package/dist/locales/en-us.d.ts +7 -0
  187. package/dist/store/download-queue.d.ts +37 -0
  188. package/dist/store/folder-store.d.ts +79 -0
  189. package/dist/store/keyboard-layout.d.ts +11 -0
  190. package/dist/store/properties-cache.d.ts +73 -0
  191. package/dist/store/thumbnail-cache.d.ts +30 -0
  192. package/dist/store/transfer-across.d.ts +24 -0
  193. package/dist/store/transfer-queue.d.ts +59 -0
  194. package/dist/store/upload-queue.d.ts +83 -0
  195. package/dist/styles/arrived.d.ts +6 -0
  196. package/dist/styles/classes.d.ts +212 -0
  197. package/dist/styles/layout.d.ts +55 -0
  198. package/dist/styles/media-layout.d.ts +36 -0
  199. package/dist/styles/order.d.ts +1 -0
  200. package/dist/styles.css +7632 -0
  201. package/dist/styles.layer.css +7634 -0
  202. package/dist/types/action.d.ts +296 -0
  203. package/dist/types/adapter.d.ts +922 -0
  204. package/dist/types/api.d.ts +192 -0
  205. package/dist/types/clipboard.d.ts +45 -0
  206. package/dist/types/download.d.ts +41 -0
  207. package/dist/types/drag.d.ts +57 -0
  208. package/dist/types/folder.d.ts +47 -0
  209. package/dist/types/icon.d.ts +20 -0
  210. package/dist/types/index.d.ts +27 -0
  211. package/dist/types/limits.d.ts +49 -0
  212. package/dist/types/locale.d.ts +1132 -0
  213. package/dist/types/main-menu.d.ts +20 -0
  214. package/dist/types/media.d.ts +631 -0
  215. package/dist/types/menu.d.ts +82 -0
  216. package/dist/types/navigation.d.ts +88 -0
  217. package/dist/types/preview.d.ts +54 -0
  218. package/dist/types/previewer.d.ts +67 -0
  219. package/dist/types/properties.d.ts +111 -0
  220. package/dist/types/property-definition.d.ts +286 -0
  221. package/dist/types/search.d.ts +46 -0
  222. package/dist/types/section.d.ts +98 -0
  223. package/dist/types/selection.d.ts +52 -0
  224. package/dist/types/slots.d.ts +218 -0
  225. package/dist/types/transfer.d.ts +68 -0
  226. package/dist/types/tree.d.ts +97 -0
  227. package/dist/types/undo.d.ts +133 -0
  228. package/dist/types/upload.d.ts +189 -0
  229. package/dist/types/view.d.ts +192 -0
  230. package/dist/utils/action-groups.d.ts +17 -0
  231. package/dist/utils/bidi.d.ts +15 -0
  232. package/dist/utils/clipboard.d.ts +30 -0
  233. package/dist/utils/cx.d.ts +2 -0
  234. package/dist/utils/dom.d.ts +36 -0
  235. package/dist/utils/download.d.ts +30 -0
  236. package/dist/utils/field-errors.d.ts +26 -0
  237. package/dist/utils/files.d.ts +48 -0
  238. package/dist/utils/format.d.ts +10 -0
  239. package/dist/utils/groups.d.ts +29 -0
  240. package/dist/utils/hidden.d.ts +3 -0
  241. package/dist/utils/keyboard.d.ts +21 -0
  242. package/dist/utils/limits.d.ts +7 -0
  243. package/dist/utils/media.d.ts +146 -0
  244. package/dist/utils/menu-position.d.ts +13 -0
  245. package/dist/utils/names.d.ts +21 -0
  246. package/dist/utils/navigation.d.ts +28 -0
  247. package/dist/utils/path.d.ts +33 -0
  248. package/dist/utils/permissions.d.ts +56 -0
  249. package/dist/utils/preview.d.ts +27 -0
  250. package/dist/utils/property-value.d.ts +41 -0
  251. package/dist/utils/resize.d.ts +2 -0
  252. package/dist/utils/search.d.ts +24 -0
  253. package/dist/utils/sections.d.ts +11 -0
  254. package/dist/utils/selection.d.ts +30 -0
  255. package/dist/utils/sets.d.ts +2 -0
  256. package/dist/utils/shortcut.d.ts +74 -0
  257. package/dist/utils/slots.d.ts +15 -0
  258. package/dist/utils/sort.d.ts +47 -0
  259. package/dist/utils/transfer.d.ts +48 -0
  260. package/dist/utils/trash.d.ts +25 -0
  261. package/dist/utils/undo.d.ts +63 -0
  262. package/dist/utils/zoom.d.ts +14 -0
  263. package/docs/README.md +55 -0
  264. package/docs/actions.md +301 -0
  265. package/docs/adapter.md +229 -0
  266. package/docs/copy-move-trash-undo.md +97 -0
  267. package/docs/customizing.md +247 -0
  268. package/docs/getting-started.md +168 -0
  269. package/docs/locale-and-rtl.md +58 -0
  270. package/docs/media-manager.md +498 -0
  271. package/docs/previewing.md +124 -0
  272. package/docs/properties.md +125 -0
  273. package/docs/recipes/in-memory-adapter.md +149 -0
  274. package/docs/recipes/rest-adapter.md +225 -0
  275. package/docs/recipes/s3-adapter.md +137 -0
  276. package/docs/search.md +73 -0
  277. package/docs/sections.md +119 -0
  278. package/docs/state-and-api.md +190 -0
  279. package/docs/uploads-and-downloads.md +144 -0
  280. package/package.json +90 -4
package/docs/search.md ADDED
@@ -0,0 +1,73 @@
1
+ # Search
2
+
3
+ There are two searches, as in GNOME Files.
4
+
5
+ ## The open folder's search
6
+
7
+ Ctrl+F, or the button beside the path bar, filters the open folder as the user types: the entries whose names hold every word typed, anywhere, in any order, case and accents aside. It needs nothing of the adapter; it filters the listing already there.
8
+
9
+ ## Search everywhere
10
+
11
+ Ctrl+Shift+F, or the magnifier at the top of the sidebar, searches every section whose adapter has `search`:
12
+
13
+ ```ts
14
+ search?(rootId: string, query: string, options: {
15
+ signal: AbortSignal;
16
+ cursor?: string;
17
+ showHidden: boolean;
18
+ filters?: Readonly<Record<string, unknown>>; // a media library's filters; never from the file manager
19
+ }): Promise<SearchResult>;
20
+
21
+ interface SearchResult {
22
+ matches: SearchMatch[];
23
+ nextCursor?: string;
24
+ }
25
+
26
+ interface SearchMatch {
27
+ entry: FileEntry;
28
+ trail: FolderRef[]; // the folders from the root searched down to the one holding the entry
29
+ score?: number; // higher is better, for a backend that ranks its matches
30
+ }
31
+ ```
32
+
33
+ - It's called once per section, with the section's `rootId`, so two sections sharing an adapter are searched apart. `query` is what's typed, trimmed, a moment after the typing stops (300 ms, `limits.searchDelay`).
34
+ - **How entries match is your backend's call.** Every word anywhere in the name, as the folder search does, is a good default; full-text search in contents is fine too.
35
+ - **`trail`** is required: the folders from the root down to the entry's folder, not counting the root itself, empty for an entry right in the root. The file manager never parses ids, so the trail is how it shows where each result is, opens its folder, and acts on it there.
36
+ - **Paging** works as `list`'s does: return `nextCursor` for more, and results show as they arrive. To cap the results, stop handing a cursor back.
37
+ - **`showHidden`** says whether hidden files are showing, so the backend can leave out hidden entries and what's in hidden folders.
38
+ - **Reject with an `Error`** to show its message beside that section's results, with Try again.
39
+ - **The media manager** calls the same `search` for its libraries, from the open group down, and hands a library's filters as `filters`, with an empty `query` while only filters are set (see [Searching and filtering](media-manager.md#searching-and-filtering)).
40
+
41
+ ```ts
42
+ async search(rootId, query, { signal, cursor, showHidden }) {
43
+ const params = new URLSearchParams({ root: rootId, q: query, hidden: String(showHidden) });
44
+ if (cursor) params.set("cursor", cursor);
45
+
46
+ const response = await fetch(`/api/search?${params}`, { signal });
47
+ if (!response.ok) throw new Error("Couldn't search.");
48
+
49
+ const body = await response.json();
50
+ return {
51
+ matches: body.matches.map((match: ApiMatch) => ({ entry: toEntry(match.entry), trail: match.trail })),
52
+ nextCursor: body.nextCursor ?? undefined,
53
+ };
54
+ }
55
+ ```
56
+
57
+ The results show in the content, with a tab per section when there are several, and work as a folder does: select, open, drag, preview, and act on them through the context menu. Their Location column says where each is. They start ordered by relevance (by `score` when the backend gives it, otherwise by how well the name answers what's typed), and the column headers order them otherwise. After a change made through the file manager the search runs again, so a result renamed or deleted updates.
58
+
59
+ A selection from several folders gets only the actions marked `acrossFolders` (see [Actions](actions.md#a-searchs-results-from-several-folders)).
60
+
61
+ Sections without `search` aren't searched, and aren't crawled with `list` either, which would be a request per folder. The trash section is never searched. With no section that can be searched, there's no search everywhere.
62
+
63
+ The field's sections menu lets the user leave sections out; that's public state too (`searchExcludedSections`).
64
+
65
+ ## From your own code
66
+
67
+ ```ts
68
+ apiRef.current?.search("everywhere", "invoice");
69
+ apiRef.current?.search("folder");
70
+ apiRef.current?.closeSearch();
71
+ ```
72
+
73
+ The search itself can be controlled, as `search` / `defaultSearch` / `onSearchChange`, a `{ scope, query }` or `null` while closed. See [State and the API](state-and-api.md).
@@ -0,0 +1,119 @@
1
+ # Sections
2
+
3
+ filecove has no built-in locations: no Home, no Trash, no Network. What the sidebar shows is yours, as **sections**, each an independent root folder.
4
+
5
+ ```ts
6
+ interface Section {
7
+ id: string;
8
+ label: string;
9
+ icon?: IconSource; // an icon name ("home", "drive", "pictures"...) or your own element
10
+ rootId: string; // the folder it opens at, an id its adapter understands
11
+ adapter?: FileAdapter; // its own backend; the file manager's `adapter` when omitted
12
+ showFolders?: boolean; // the folder tree under its row; true by default
13
+ importFrom?: SectionImports; // which other sections entries can come in from
14
+ acceptUploads?: boolean | string; // which files can be uploaded into it
15
+ readOnly?: boolean; // nothing changes in it through the file manager
16
+ trash?: boolean; // it's its adapter's trash
17
+ }
18
+ ```
19
+
20
+ Sections come in groups, each divided from the next by a rule, with an optional heading:
21
+
22
+ ```tsx
23
+ const sections: SectionGroup[] = [
24
+ {
25
+ id: "mine",
26
+ sections: [
27
+ { id: "home", label: "Home", icon: "home", rootId: "/users/ada" },
28
+ { id: "shared", label: "Shared with me", icon: "share", rootId: "/shared/ada" },
29
+ ],
30
+ },
31
+ {
32
+ id: "projects",
33
+ title: "Projects",
34
+ sections: [
35
+ { id: "site", label: "Website", icon: "folder", rootId: "/projects/site" },
36
+ { id: "api", label: "API service", icon: "folder", rootId: "/projects/api" },
37
+ ],
38
+ },
39
+ ];
40
+
41
+ <FileManager adapter={adapter} sections={sections} actions={actions} />;
42
+ ```
43
+
44
+ ## Independent roots
45
+
46
+ Sections are independent even when they share an adapter: `/projects/site` and `/projects/site/src` can both be sections, and each has its own place in the history and its own tree. The file manager knows nothing of how they relate; it never compares ids to see that one is inside another.
47
+
48
+ What sections sharing **one adapter object** do share is what's listed, so a folder renamed in one section shows renamed in every other section showing it.
49
+
50
+ ## A single section
51
+
52
+ For one root, pass `section` instead of `sections`. Its folders fill the sidebar as the tree itself, with no section row above them:
53
+
54
+ ```tsx
55
+ <FileManager adapter={adapter} section={{ id: "files", label: "Files", rootId: "/" }} actions={actions} />
56
+ ```
57
+
58
+ The root is reached through the path bar's first segment. With `showFolders: false`, the single section shows as one plain row instead.
59
+
60
+ ## Plain places
61
+
62
+ `showFolders: false` makes a section a plain row with no tree beneath it, as GNOME Files shows its places. It opens in the content when clicked.
63
+
64
+ ## Several backends
65
+
66
+ Each section can bring its own `adapter`, so one file manager can show a server's folders beside a bucket's:
67
+
68
+ ```tsx
69
+ const sections: SectionGroup[] = [
70
+ {
71
+ id: "places",
72
+ sections: [
73
+ { id: "server", label: "Server", icon: "drive", rootId: "/" }, // the file manager's adapter
74
+ { id: "media", label: "Media bucket", icon: "pictures", rootId: "", adapter: bucketAdapter },
75
+ ],
76
+ },
77
+ ];
78
+ ```
79
+
80
+ Entries can be copied and moved between them. Within one adapter, the adapter's own `copy` and `move` do it. Between two, the file manager does it itself, reading through one adapter's `list` and `content` and writing through the other's `upload` and `createFolder` (and for a move, `delete` on the source), as a desktop copies between disks. Dropping onto another backend copies, unless Shift or ⌘ is held, which moves. See [Copy, move, trash and undo](copy-move-trash-undo.md#between-backends).
81
+
82
+ ## Which sections take entries from which
83
+
84
+ `importFrom` narrows which other sections entries can be moved or copied into this one from, by dragging, pasting, Move to… or Copy to…:
85
+
86
+ ```ts
87
+ { id: "site", label: "Website", rootId: "/site", importFrom: { allow: ["api"] } } // only from "api"
88
+ { id: "api", label: "API", rootId: "/api", importFrom: { deny: ["design"] } } // from all but "design"
89
+ { id: "design", label: "Design", rootId: "/design", importFrom: false } // from nowhere else
90
+ ```
91
+
92
+ The default is `true`, every section. Moving and copying within a section is always allowed (permissions aside).
93
+
94
+ ## Limiting uploads
95
+
96
+ `acceptUploads` says which files can be uploaded into a section's folders:
97
+
98
+ ```ts
99
+ { id: "photos", label: "Photos", rootId: "/photos", acceptUploads: "image/*,video/*" }
100
+ { id: "archive", label: "Archive", rootId: "/archive", acceptUploads: false }
101
+ ```
102
+
103
+ `true` (the default) takes anything, `false` nothing, and a string takes what a file input's `accept` would: extensions (`.pdf`), MIME types (`image/png`) and wildcards (`image/*`). The file picker offers only those types, and files of other types that are dropped or pasted are left out, saying which types the section takes. Your adapter's `upload` still has the final say.
104
+
105
+ ## Read-only sections
106
+
107
+ `readOnly: true` makes a section read-only through the file manager, whatever its adapter allows: nothing is created, uploaded, pasted, dropped, renamed, moved or deleted in it. Its entries can still be opened, previewed, downloaded and copied out. The same folders shown in another section still change there.
108
+
109
+ For read-only folders and files decided by the backend, use permissions instead (see [The adapter](adapter.md#permissions)).
110
+
111
+ ## The trash section
112
+
113
+ `trash: true` marks a section as its adapter's trash, rooted where the adapter's `trash` puts entries. See [Copy, move, trash and undo](copy-move-trash-undo.md#the-trash).
114
+
115
+ ## Changing sections after mounting
116
+
117
+ `sections` may change at any time: a section added shows, one removed takes its places out of the history (the open one goes to the first section's root), and one rooted elsewhere or served by another adapter goes back to its root. New section objects with the same `id`, `rootId` and `adapter` change nothing.
118
+
119
+ `sections` may also be empty, as while your app is still fetching them: the content says there's nothing to show, and the `location` you pass waits for its section to arrive.
@@ -0,0 +1,190 @@
1
+ # State and the API
2
+
3
+ ## Controlled or not
4
+
5
+ Most of what the user changes can be left to the file manager, or kept by your app, as MUI's components do it. Each piece of state has three props:
6
+
7
+ - **`x`**: the value, which makes it controlled. The user's changes are only asked for through the callback, and happen once you pass the new value back.
8
+ - **`defaultX`**: where it starts, when the file manager keeps it.
9
+ - **`onXChange`**: told every change, controlled or not.
10
+
11
+ Which one is decided on mounting; switching later, or changing a `default…` prop after mounting, warns in development.
12
+
13
+ | State | Props | Default |
14
+ |---|---|---|
15
+ | Location | `location`, `defaultLocation`, `onLocationChange(location, reason)` | the first section's root |
16
+ | View | `view`, `defaultView`, `onViewChange` | `"list"` |
17
+ | Zoom | `zoom`, `defaultZoom`, `onZoomChange` | `{ list: 0, grid: 0 }` |
18
+ | Order | `sort`, `defaultSort`, `onSortChange` | relevance (name, A to Z, in folders) |
19
+ | Hidden files shown | `showHidden`, `defaultShowHidden`, `onShowHiddenChange` | `false` |
20
+ | Docked sidebar hidden | `sidebarHidden`, `defaultSidebarHidden`, `onSidebarHiddenChange` | `false` |
21
+ | Docked sidebar's width | `sidebarWidth`, `defaultSidebarWidth`, `onSidebarWidthChange` | 248 (200 to 360) |
22
+ | Docked properties shown | `propertiesOpen`, `defaultPropertiesOpen`, `onPropertiesOpenChange` | `false` |
23
+ | Docked properties' width | `propertiesWidth`, `defaultPropertiesWidth`, `onPropertiesWidthChange` | 300 (240 to 480) |
24
+ | Tree folders expanded | `expandedFolders`, `defaultExpandedFolders`, `onExpandedFoldersChange` | the section opened in |
25
+ | Search | `search`, `defaultSearch`, `onSearchChange` | `null` (closed) |
26
+ | Sections a search everywhere leaves out | `searchExcludedSections`, `defaultSearchExcludedSections`, `onSearchExcludedSectionsChange` | none |
27
+ | Selection | `selectedIds`, `defaultSelectedIds`, `onSelectionChange(ids, details)` | none |
28
+
29
+ ### Keeping view settings across visits
30
+
31
+ The file manager writes nothing to storage itself. Keep what you want kept:
32
+
33
+ ```tsx
34
+ const [view, setView] = useLocalStorage<ViewMode>("files.view", "list");
35
+ const [showHidden, setShowHidden] = useLocalStorage("files.hidden", false);
36
+
37
+ <FileManager
38
+ view={view}
39
+ onViewChange={setView}
40
+ showHidden={showHidden}
41
+ onShowHiddenChange={setShowHidden}
42
+ /* ... */
43
+ />;
44
+ ```
45
+
46
+ Or, to start from what was saved and let the file manager keep it from there, pass the `default…` props and save in the callbacks.
47
+
48
+ ## The location
49
+
50
+ ```ts
51
+ interface FileManagerLocation {
52
+ sectionId: string;
53
+ trail: FolderRef[]; // the folders below the section's root, outermost first; [] for the root
54
+ }
55
+
56
+ type LocationChangeReason = "navigate" | "back" | "forward" | "replace";
57
+ ```
58
+
59
+ The trail is built from `FolderRef`s (`{ id, name }`), not from parsing ids. When you pass one, it isn't checked against listings; a folder that isn't there shows as failed to open.
60
+
61
+ `reason` says why it changed: the user went somewhere (`"navigate"`), back or forward, or the place was rewritten in place (`"replace"`), as when a folder it was in was renamed or deleted. A URL kept in step replaces its entry for `"replace"` and pushes one otherwise.
62
+
63
+ ### Keeping it in the URL
64
+
65
+ ```tsx
66
+ import { useEffect, useState } from "react";
67
+ import type { FileManagerLocation, LocationChangeReason } from "filecove";
68
+
69
+ const read = (): FileManagerLocation | undefined => {
70
+ try {
71
+ return JSON.parse(decodeURIComponent(location.hash.slice(1)));
72
+ } catch {
73
+ return undefined;
74
+ }
75
+ };
76
+
77
+ export function useHashLocation(fallback: FileManagerLocation) {
78
+ const [place, setPlace] = useState(() => read() ?? fallback);
79
+
80
+ useEffect(() => {
81
+ const onPop = () => setPlace(read() ?? fallback);
82
+ window.addEventListener("popstate", onPop);
83
+ return () => window.removeEventListener("popstate", onPop);
84
+ }, [fallback]);
85
+
86
+ const change = (next: FileManagerLocation, reason: LocationChangeReason) => {
87
+ const url = `#${encodeURIComponent(JSON.stringify(next))}`;
88
+ if (reason === "replace") history.replaceState(null, "", url);
89
+ else history.pushState(null, "", url);
90
+ setPlace(next);
91
+ };
92
+
93
+ return [place, change] as const;
94
+ }
95
+
96
+ // const [place, setPlace] = useHashLocation({ sectionId: "home", trail: [] });
97
+ // <FileManager location={place} onLocationChange={setPlace} /* ... */ />
98
+ ```
99
+
100
+ The file manager keeps its own back and forward history. A location you pass that's where its back or forward leads counts as going there, so the browser's back button and the file manager's stay in step.
101
+
102
+ A location in a section the file manager doesn't have shows the first section's root, asked for as `"replace"`.
103
+
104
+ ## The selection
105
+
106
+ ```ts
107
+ onSelectionChange?: (ids: string[], details: { entries: FileEntry[]; location: FileManagerLocation }) => void;
108
+ ```
109
+
110
+ `ids` is what to pass back as `selectedIds`. `details.entries` are the selected entries the content lists, in its order, which is what to act on (a selected entry hidden by "Show hidden files" is in `ids` but not in `entries`).
111
+
112
+ - Every folder opens with nothing selected. Going somewhere from inside the file manager asks for an empty selection, but a `location` you change leaves the selection to you, so you can open a folder with an entry selected.
113
+ - Ids set from outside are revealed once the folder is listed: the first is scrolled to, and takes the focus if the content has it.
114
+ - Ids the folder doesn't list drop out once all of it has come.
115
+ - A search everywhere's results have their own selection, which isn't told.
116
+
117
+ ## The API
118
+
119
+ `apiRef` takes a `FileManagerApi`, for a toolbar or code of your own:
120
+
121
+ ```tsx
122
+ import { useRef } from "react";
123
+ import type { FileManagerApi } from "filecove";
124
+
125
+ const apiRef = useRef<FileManagerApi>(null);
126
+
127
+ <FileManager apiRef={apiRef} /* ... */ />;
128
+ <button onClick={() => apiRef.current?.refresh()}>Reload</button>;
129
+ ```
130
+
131
+ | Method | Does |
132
+ |---|---|
133
+ | `navigate(location)`, `back()`, `forward()` | goes somewhere, as the user would |
134
+ | `refresh(folderIds?, { adapter }?)` | lists folders again, or every saved listing; after changes made outside the file manager |
135
+ | `reveal(entryId, location?)` | selects an entry and scrolls to it, going to `location` first |
136
+ | `actionContext(entries?, location?)` | the context menu's `ActionContext`, for any operation (see [Actions](actions.md)) |
137
+ | `download(entries?, location?)` | downloads entries, or the folder itself; `false` if nothing could be |
138
+ | `search(scope, query?)`, `closeSearch()` | opens or closes the search |
139
+ | `editPath()` | opens the path field, as Ctrl+L does |
140
+ | `goToPath(path)` | goes where a typed path leads; resolves `{ ok: true, location, entryId? }` or `{ ok: false, message }` |
141
+ | `focus()` | moves the focus into the content |
142
+ | `showShortcuts()` | opens the keyboard shortcuts window |
143
+ | `undo()`, `redo()` | as Ctrl+Z and Shift+Ctrl+Z; `false` with nothing to do |
144
+
145
+ The object stays the same while the file manager is mounted. `actionContext` is built as of the call, so ask again after the selection or location changes.
146
+
147
+ ```ts
148
+ // A "New folder" button outside the file manager.
149
+ const context = apiRef.current?.actionContext();
150
+ <button disabled={!context?.createFolder} onClick={() => context?.createFolder?.()}>New folder</button>;
151
+ ```
152
+
153
+ ```ts
154
+ // After your own code adds a file behind the file manager's back.
155
+ await api.importFrom(url, folderId);
156
+ apiRef.current?.refresh([folderId]);
157
+ ```
158
+
159
+ ## Limits
160
+
161
+ `limits` sets how much runs at once and how much is kept, for a backend that takes more or less than the defaults:
162
+
163
+ | Field | Default | Sets |
164
+ |---|---|---|
165
+ | `uploads` | 3 | upload calls at once |
166
+ | `downloads` | 3 | downloads prepared at once |
167
+ | `transfers` | 3 | copies and moves at once |
168
+ | `thumbnails` | 6 | `thumbnail` calls at once |
169
+ | `keptThumbnails` | 1,000 | thumbnails kept while nothing shows them |
170
+ | `keptEntries` | 20,000 | entries kept in listings nothing shows |
171
+ | `undoSteps` | 20 | changes kept to undo (0 for none) |
172
+ | `searchDelay` | 300 | ms after typing stops before a search everywhere |
173
+
174
+ ```tsx
175
+ <FileManager limits={{ uploads: 6, thumbnails: 12 }} /* ... */ />
176
+ ```
177
+
178
+ Changes take effect at once. `Infinity` is no limit.
179
+
180
+ ## `relistAfter`
181
+
182
+ How old, in ms, a folder's listing may be before opening the folder lists it again in the background. 0 (the default) lists it every time it opens; `Infinity` never does, leaving changes made elsewhere to `apiRef.current.refresh()`.
183
+
184
+ ## The root element
185
+
186
+ `FileManager` takes the root `div`'s own attributes (`id`, `className`, `style`, `aria-*`, `data-*`, handlers) and a `ref`. Your handlers run before the file manager's own; calling `preventDefault` in an `onKeyDown` keeps the file manager from acting on that key. `title` is the sidebar's heading, "Files" by default.
187
+
188
+ ## Props changing after mounting
189
+
190
+ Everything may change after mounting, `sections` and `adapter` included. Actions, previewers, slots, text and limits take effect at once. A `default…` prop changing does nothing (and warns in development).
@@ -0,0 +1,144 @@
1
+ # Uploads and downloads
2
+
3
+ Both run in the background while the user goes on browsing, each shown in a panel under the content once it takes a moment, with its progress, Cancel and Try again.
4
+
5
+ ## Uploads
6
+
7
+ ```ts
8
+ upload?(file: File, folderId: string, options: {
9
+ signal: AbortSignal;
10
+ conflict: "replace" | "keepBoth" | "skip";
11
+ onProgress: (loaded: number, total: number) => void;
12
+ values?: Readonly<Record<string, unknown>>; // a media library's upload form; never set by FileManager
13
+ }): Promise<FileEntry | UploadResult | void>;
14
+ ```
15
+
16
+ **One file per call.** The file manager decides how many run at once (3 by default, `limits.uploads`), so each file has its own progress, error and cancel. How the bytes travel (a form post, S3 multipart, tus, chunks) is your adapter's business.
17
+
18
+ With `upload`, the user can upload by:
19
+
20
+ - `context.upload()`, which opens the browser's file picker, from an action of yours (see [Actions](actions.md)), or `context.upload(files)` with files you already have;
21
+ - `context.uploadFolder()`, a folder picker, when the adapter also has `createFolder`;
22
+ - dropping files and folders from the desktop onto a folder, the open folder's empty space, a tree row or a path segment;
23
+ - pasting files copied on the desktop with Ctrl+V, where the browser hands them over (screenshots and copied pictures always come through).
24
+
25
+ A typical upload over `XMLHttpRequest`, which reports progress where `fetch` can't:
26
+
27
+ ```ts
28
+ upload(file, folderId, { signal, conflict, onProgress }) {
29
+ return new Promise((resolve, reject) => {
30
+ const xhr = new XMLHttpRequest();
31
+ const body = new FormData();
32
+
33
+ body.append("file", file);
34
+ body.append("folder", folderId);
35
+ body.append("conflict", conflict);
36
+
37
+ xhr.open("POST", "/api/upload");
38
+ xhr.responseType = "json";
39
+ xhr.upload.onprogress = (event) => onProgress(event.loaded, event.total);
40
+ xhr.onload = () =>
41
+ xhr.status < 300
42
+ ? resolve(toEntry(xhr.response))
43
+ : reject(new Error(xhr.response?.message ?? "Couldn't upload the file."));
44
+ xhr.onerror = () => reject(new Error("The connection was lost."));
45
+ signal.addEventListener("abort", () => {
46
+ xhr.abort();
47
+ reject(new DOMException("Aborted", "AbortError"));
48
+ });
49
+ xhr.send(body);
50
+ });
51
+ }
52
+ ```
53
+
54
+ - **Resolve with the file's entry** as it now is. That's how the file manager finds and highlights it, even when it was kept under another name beside one of the same name, and how a copy from another backend can be undone. Resolving with nothing works, but then a file kept under another name isn't found.
55
+ - **Or with an `UploadResult`**, `{ entry, existing?, trail? }`, when the backend already had the file and hands that back (`existing: true`), or put it in another folder (`trail`, the folders holding it). The upload panel's row then says "Already there" and where it is, and the media manager says so and points to it (see [A file the backend already has](media-manager.md#a-file-the-backend-already-has)). The file manager doesn't offer "Show in folder" for a file in another folder, and a copy from another backend that lands on a file the backend already had can't be undone, as undoing it would delete that file.
56
+ - **`conflict`**: the file manager checks the folder's listing first and asks the user about clashing names (Keep both, Replace, Skip). Skipped files aren't sent at all. What it passes is what to do with a clash it didn't see.
57
+ - **Reject with an `Error`** to show its message in the file's row, e.g. "This file is larger than 2 GB."
58
+ - **`onProgress`** is optional to call; without it, the row shows the file as uploading with no figure.
59
+
60
+ ### Folders
61
+
62
+ Folders are uploaded with the same `upload`, plus `createFolder`: each folder is made first in the one above it, then its files are sent into its id. So the contract has nothing extra for folders, and a backend without real folders (a bucket) makes them in `createFolder` as it does for New folder. A folder that already has the name is merged into, when the user chooses so.
63
+
64
+ Without `createFolder`, folders are left out of an upload, saying so.
65
+
66
+ ### What's checked first
67
+
68
+ - Files whose type the section doesn't take (`acceptUploads`, see [Sections](sections.md#limiting-uploads)).
69
+ - Names your `checkName` refuses.
70
+ - Names the folder already has, asked about.
71
+
72
+ Uploads can't be undone, so an upload starting ends the undo history.
73
+
74
+ ## Downloads
75
+
76
+ Three members hand files over to save. A single file prefers the first:
77
+
78
+ ```ts
79
+ // One file: the preview's member, called with purpose "download".
80
+ content?(entry, { signal, purpose, onProgress }): Promise<FileContent>;
81
+
82
+ // Folders, several entries, or a single file when there's no `content`: one file to save, e.g. a zip.
83
+ download?(entries: FileEntry[], { signal, showHidden, onProgress }): Promise<DownloadContent>;
84
+
85
+ // Entries from several folders, a search's results: one file to save.
86
+ downloadAcross?(groups: EntriesInFolder[], { signal, showHidden, onProgress }): Promise<DownloadContent>;
87
+
88
+ type DownloadContent = ({ url: string } | { blob: Blob }) & { name?: string };
89
+ ```
90
+
91
+ With either, `context.download()` is there, and the preview has a Download button. Without `download`, only single files can be downloaded.
92
+
93
+ ```ts
94
+ async download(entries, { signal }) {
95
+ const response = await fetch("/api/zip", {
96
+ method: "POST",
97
+ body: JSON.stringify({ ids: entries.map((entry) => entry.id) }),
98
+ headers: { "content-type": "application/json" },
99
+ signal,
100
+ });
101
+
102
+ if (!response.ok) {
103
+ throw new Error((await response.json()).message ?? "Couldn't prepare the download.");
104
+ }
105
+
106
+ return { blob: await response.blob(), name: entries.length === 1 ? `${entries[0].name}.zip` : "files.zip" };
107
+ }
108
+ ```
109
+
110
+ Or, better for large archives, have the server build the zip and hand back a URL for the browser to download itself, so the bytes don't pass through the page:
111
+
112
+ ```ts
113
+ async download(entries, { signal }) {
114
+ const { url } = await api.prepareZip(entries.map((entry) => entry.id), signal);
115
+ return { url };
116
+ }
117
+ ```
118
+
119
+ ### How the file is saved
120
+
121
+ - **A blob** is saved under `name`, or the entry's name, or for several entries the folder's name.
122
+ - **A URL on the page's origin** is saved under that name too.
123
+ - **A URL on another origin** (a CDN, a signed bucket URL) opens in a new tab, as browsers ignore a link's `download` name across origins. **Have the server send `Content-Disposition: attachment`**, and the browser closes that tab as it saves the file under the server's name. Without it, the file opens in the tab instead.
124
+ - Browsers only open that tab soon after a click. A download that took a while to prepare waits in the panel as "ready", with a button that saves it.
125
+
126
+ Once the browser has the file, its own downloads show the progress. `onProgress` is for what comes before: fetching a blob, or a server packing a zip if it can say how far it has got.
127
+
128
+ ### The arguments
129
+
130
+ - The entries of one `download` call share a parent. A folder downloaded from its own menu, the open folder or a section's root, comes as an entry with only `id`, `name` and `kind`.
131
+ - `showHidden` says whether hidden files were showing, so a backend can leave them out of a folder's zip while the user isn't seeing them.
132
+ - `downloadAcross` gets each folder with its entries. Files from different folders may share a name, which the zip has to keep apart, e.g. a folder per folder. Without it, such a selection downloads one file per folder.
133
+
134
+ Up to 3 downloads are prepared at once (`limits.downloads`). Asking for the same entries again while they're being prepared starts nothing new.
135
+
136
+ ### From your own code
137
+
138
+ ```ts
139
+ apiRef.current?.download(); // the open folder
140
+ apiRef.current?.download(selectedEntries); // entries of the open folder
141
+ apiRef.current?.download(entries, otherLocation); // entries of another folder
142
+ ```
143
+
144
+ It returns `false` when there was nothing it could download.
package/package.json CHANGED
@@ -1,6 +1,92 @@
1
1
  {
2
2
  "name": "filecove",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "A file manager and media manager for React: bring your own backend through a small adapter.",
5
+ "keywords": [
6
+ "react",
7
+ "file-manager",
8
+ "file-explorer",
9
+ "file-browser",
10
+ "media-library",
11
+ "media-manager",
12
+ "media-picker",
13
+ "uploader"
14
+ ],
15
+ "license": "MIT",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/KC3NZO/filecove.git"
19
+ },
20
+ "homepage": "https://github.com/KC3NZO/filecove/tree/main/docs#readme",
21
+ "bugs": {
22
+ "url": "https://github.com/KC3NZO/filecove/issues"
23
+ },
24
+ "type": "module",
25
+ "files": [
26
+ "dist",
27
+ "docs",
28
+ "CHANGELOG.md",
29
+ "THIRD_PARTY_NOTICES.md"
30
+ ],
31
+ "module": "./dist/index.js",
32
+ "types": "./dist/index.d.ts",
33
+ "exports": {
34
+ ".": {
35
+ "types": "./dist/index.d.ts",
36
+ "import": "./dist/index.js"
37
+ },
38
+ "./icons/filled": {
39
+ "types": "./dist/icon-sets/filled.d.ts",
40
+ "import": "./dist/icon-sets/filled.js"
41
+ },
42
+ "./icons/outlined": {
43
+ "types": "./dist/icon-sets/outlined.d.ts",
44
+ "import": "./dist/icon-sets/outlined.js"
45
+ },
46
+ "./icons/rounded": {
47
+ "types": "./dist/icon-sets/rounded.d.ts",
48
+ "import": "./dist/icon-sets/rounded.js"
49
+ },
50
+ "./icons/sharp": {
51
+ "types": "./dist/icon-sets/sharp.d.ts",
52
+ "import": "./dist/icon-sets/sharp.js"
53
+ },
54
+ "./icons/two-tone": {
55
+ "types": "./dist/icon-sets/two-tone.d.ts",
56
+ "import": "./dist/icon-sets/two-tone.js"
57
+ },
58
+ "./styles.css": "./dist/styles.css",
59
+ "./styles.layer.css": "./dist/styles.layer.css",
60
+ "./package.json": "./package.json"
61
+ },
62
+ "sideEffects": [
63
+ "**/*.css"
64
+ ],
65
+ "scripts": {
66
+ "dev": "vite",
67
+ "build": "tsc -b && vite build",
68
+ "lint": "oxlint",
69
+ "preview": "vite preview",
70
+ "build:lib": "vite build -c vite.lib.config.ts && tsc -p tsconfig.lib.json && bun scripts/clean-declarations.ts",
71
+ "prepublishOnly": "bun run build:lib"
72
+ },
73
+ "peerDependencies": {
74
+ "react": "^19.0.0",
75
+ "react-dom": "^19.0.0"
76
+ },
77
+ "dependencies": {
78
+ "@base-ui/react": "^1.9.0",
79
+ "@react-symbols/icons": "^1.4.1"
80
+ },
81
+ "devDependencies": {
82
+ "@types/node": "^24.13.3",
83
+ "@types/react": "^19.2.18",
84
+ "@types/react-dom": "^19.2.7",
85
+ "@vitejs/plugin-react": "^6.1.1",
86
+ "oxlint": "^1.81.0",
87
+ "react": "^19.2.8",
88
+ "react-dom": "^19.2.8",
89
+ "typescript": "~6.0.2",
90
+ "vite": "^8.3.0"
91
+ }
92
+ }