@parallelworks/ui 0.41.0 → 0.43.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 (283) hide show
  1. package/README.md +25 -0
  2. package/dist/ai/components/AllocationSelector.d.ts +3 -4
  3. package/dist/ai/components/AllocationSelector.js +37 -33
  4. package/dist/ai/components/AttachmentManager.js +7 -7
  5. package/dist/ai/components/AttachmentUpload.js +5 -5
  6. package/dist/ai/components/BranchNavigator.js +1 -1
  7. package/dist/ai/components/ChatEmptyState.js +2 -2
  8. package/dist/ai/components/ChatInput.js +10 -8
  9. package/dist/ai/components/ChatLayout.js +4 -5
  10. package/dist/ai/components/ChatMessage.js +12 -12
  11. package/dist/ai/components/ChatMessageList.js +9 -9
  12. package/dist/ai/components/ChatSidebar.js +8 -9
  13. package/dist/ai/components/ChatThread.js +4 -4
  14. package/dist/ai/components/ComposerChrome.d.ts +2 -2
  15. package/dist/ai/components/ComposerChrome.js +3 -6
  16. package/dist/ai/components/DragOverlay.js +2 -2
  17. package/dist/ai/components/ModelSelector.d.ts +5 -3
  18. package/dist/ai/components/ModelSelector.js +102 -339
  19. package/dist/ai/components/PastedText.js +11 -11
  20. package/dist/ai/components/ProviderIssueBanner.d.ts +2 -0
  21. package/dist/ai/components/ProviderIssueBanner.js +34 -16
  22. package/dist/ai/components/Reasoning.js +4 -4
  23. package/dist/ai/components/ShareDialog.js +43 -35
  24. package/dist/ai/components/SlashMenu.d.ts +12 -2
  25. package/dist/ai/components/SlashMenu.js +29 -13
  26. package/dist/ai/components/agent/ActivityLine.js +3 -3
  27. package/dist/ai/components/agent/AgentMessageParts.js +20 -20
  28. package/dist/ai/components/agent/PermissionPicker.js +13 -11
  29. package/dist/ai/components/conversationActions.d.ts +4 -6
  30. package/dist/ai/components/conversationActions.js +9 -13
  31. package/dist/ai/core/ChatProvider.js +1 -1
  32. package/dist/ai/core/config.js +1 -1
  33. package/dist/ai/core/providerIssues.d.ts +7 -0
  34. package/dist/ai/core/providerIssues.js +9 -1
  35. package/dist/ai/core/useKeyboardShortcuts.d.ts +4 -0
  36. package/dist/ai/core/useKeyboardShortcuts.js +8 -2
  37. package/dist/ai/index.d.ts +0 -1
  38. package/dist/ai/index.js +1 -2
  39. package/dist/ai/strings.d.ts +19 -0
  40. package/dist/ai/strings.js +18 -1
  41. package/dist/ai/ui/Avatar.js +5 -5
  42. package/dist/ai/ui/ConversationSidebar.d.ts +0 -1
  43. package/dist/ai/ui/ConversationSidebar.js +6 -7
  44. package/dist/ai/ui/Markdown.js +3 -3
  45. package/dist/ai/ui/Notice.js +6 -6
  46. package/dist/ai/ui/chip.d.ts +4 -0
  47. package/dist/ai/ui/chip.js +8 -0
  48. package/dist/ai/ui/sidebar.d.ts +6 -5
  49. package/dist/ai/ui/sidebar.js +39 -43
  50. package/dist/components/ActionMenu.d.ts +13 -0
  51. package/dist/components/ActionMenu.js +30 -0
  52. package/dist/components/Avatar.js +6 -6
  53. package/dist/components/Breadcrumbs.js +1 -1
  54. package/dist/components/Button.js +10 -10
  55. package/dist/components/Callout.js +2 -2
  56. package/dist/components/Card.js +3 -3
  57. package/dist/components/Combobox.d.ts +49 -0
  58. package/dist/components/Combobox.js +405 -0
  59. package/dist/components/ConfirmModal.js +11 -11
  60. package/dist/components/ContextMenu.d.ts +23 -0
  61. package/dist/components/ContextMenu.js +89 -0
  62. package/dist/components/CopyToClipboard.js +2 -2
  63. package/dist/components/CreateModal.d.ts +19 -38
  64. package/dist/components/CreateModal.js +116 -267
  65. package/dist/components/DescriptionList.js +8 -8
  66. package/dist/components/Filter.js +2 -2
  67. package/dist/components/FilterPill.js +2 -2
  68. package/dist/components/HoverCard.d.ts +14 -0
  69. package/dist/components/HoverCard.js +33 -0
  70. package/dist/components/IconButton.d.ts +5 -5
  71. package/dist/components/IconButton.js +18 -22
  72. package/dist/components/InfoTip.d.ts +15 -0
  73. package/dist/components/InfoTip.js +60 -0
  74. package/dist/components/Input.js +5 -5
  75. package/dist/components/LetterBadge.js +2 -2
  76. package/dist/components/Loader.js +3 -3
  77. package/dist/components/Markdown.js +1 -1
  78. package/dist/components/MarkdownImpl.js +2 -2
  79. package/dist/components/Menu.d.ts +33 -0
  80. package/dist/components/Menu.js +86 -0
  81. package/dist/components/MenuEntries.d.ts +56 -0
  82. package/dist/components/MenuEntries.js +123 -0
  83. package/dist/components/Modal.d.ts +29 -0
  84. package/dist/components/Modal.js +47 -0
  85. package/dist/components/Overview.js +11 -10
  86. package/dist/components/PageHeader.d.ts +10 -16
  87. package/dist/components/PageHeader.js +69 -95
  88. package/dist/components/Pagination.js +5 -5
  89. package/dist/components/Provider.d.ts +5 -11
  90. package/dist/components/Provider.js +11 -14
  91. package/dist/components/Radio.d.ts +8 -0
  92. package/dist/components/Radio.js +16 -0
  93. package/dist/components/SectionHeader.js +2 -2
  94. package/dist/components/SegmentedControl.d.ts +6 -5
  95. package/dist/components/SegmentedControl.js +34 -30
  96. package/dist/components/Select.d.ts +27 -0
  97. package/dist/components/Select.js +78 -0
  98. package/dist/components/SettingModeOption.d.ts +5 -8
  99. package/dist/components/SettingModeOption.js +10 -12
  100. package/dist/components/SettingRow.js +4 -4
  101. package/dist/components/SettingsCard.js +4 -4
  102. package/dist/components/SettingsGroup.js +2 -2
  103. package/dist/components/Sort.js +1 -1
  104. package/dist/components/StatusBadge.js +7 -7
  105. package/dist/components/StatusIcons.js +4 -4
  106. package/dist/components/Switch.d.ts +22 -0
  107. package/dist/components/Switch.js +28 -0
  108. package/dist/components/Table.js +11 -11
  109. package/dist/components/Tooltip.d.ts +24 -20
  110. package/dist/components/Tooltip.js +58 -76
  111. package/dist/components/comboboxItems.d.ts +24 -0
  112. package/dist/components/comboboxItems.js +10 -0
  113. package/dist/components/floating.d.ts +14 -0
  114. package/dist/components/floating.js +21 -0
  115. package/dist/components/search.d.ts +2 -0
  116. package/dist/components/search.js +14 -0
  117. package/dist/editor/Editor.js +1 -1
  118. package/dist/editor/EditorField.js +16 -21
  119. package/dist/editor/FormCodePanel.js +19 -19
  120. package/dist/editor/Monaco.js +3 -3
  121. package/dist/file-explorer/FileExplorer.js +77 -81
  122. package/dist/file-explorer/FileExplorerContext.js +2 -2
  123. package/dist/file-explorer/FilePreview/CodePreviewEditor.js +1 -1
  124. package/dist/file-explorer/FilePreview/Inline.js +1 -1
  125. package/dist/file-explorer/FilePreview/StreamedBadge.js +5 -6
  126. package/dist/file-explorer/FilePreview/Viewer.js +8 -8
  127. package/dist/file-explorer/FilePreview/index.d.ts +1 -1
  128. package/dist/file-explorer/FilePreview/index.js +49 -83
  129. package/dist/file-explorer/FileRow.d.ts +4 -3
  130. package/dist/file-explorer/FileRow.js +32 -38
  131. package/dist/file-explorer/FileRowsWindow.d.ts +3 -2
  132. package/dist/file-explorer/FileRowsWindow.js +4 -4
  133. package/dist/file-explorer/FileTable.d.ts +3 -2
  134. package/dist/file-explorer/FileTable.js +3 -3
  135. package/dist/file-explorer/LoadMoreRow.js +1 -1
  136. package/dist/file-explorer/TreeView.js +11 -16
  137. package/dist/file-explorer/helpers.js +11 -12
  138. package/dist/file-explorer/toasts.js +11 -11
  139. package/dist/form/FieldGroup.d.ts +11 -0
  140. package/dist/form/FieldGroup.js +36 -0
  141. package/dist/form/FieldWrapper.js +4 -4
  142. package/dist/form/Fields/BooleanField.js +23 -33
  143. package/dist/form/Fields/CheckboxGroupField.d.ts +1 -1
  144. package/dist/form/Fields/CheckboxGroupField.js +9 -13
  145. package/dist/form/Fields/ColorField.d.ts +1 -2
  146. package/dist/form/Fields/ColorField.js +6 -11
  147. package/dist/form/Fields/DropdownField.d.ts +3 -13
  148. package/dist/form/Fields/DropdownField.js +40 -27
  149. package/dist/form/Fields/DurationField.d.ts +1 -2
  150. package/dist/form/Fields/DurationField.js +25 -32
  151. package/dist/form/Fields/LabelField.js +2 -2
  152. package/dist/form/Fields/MultiDropdownField.d.ts +6 -12
  153. package/dist/form/Fields/MultiDropdownField.js +31 -22
  154. package/dist/form/Fields/NumberField.d.ts +1 -1
  155. package/dist/form/Fields/NumberField.js +65 -35
  156. package/dist/form/Fields/ObjectField.d.ts +1 -1
  157. package/dist/form/Fields/ObjectField.js +12 -43
  158. package/dist/form/Fields/RadioField.d.ts +1 -1
  159. package/dist/form/Fields/RadioField.js +30 -41
  160. package/dist/form/Fields/RangeField.d.ts +1 -2
  161. package/dist/form/Fields/RangeField.js +23 -16
  162. package/dist/form/Fields/StringField.d.ts +1 -2
  163. package/dist/form/Fields/StringField.js +58 -26
  164. package/dist/form/Fields/TextAreaField.js +12 -10
  165. package/dist/form/Form.d.ts +30 -48
  166. package/dist/form/Form.js +306 -412
  167. package/dist/form/FormLayout.js +9 -9
  168. package/dist/form/Wizard/WizardContainer.d.ts +1 -4
  169. package/dist/form/Wizard/WizardContainer.js +40 -56
  170. package/dist/form/Wizard/WizardNavigation.js +1 -1
  171. package/dist/form/Wizard/WizardStepContent.d.ts +1 -5
  172. package/dist/form/Wizard/WizardStepContent.js +11 -16
  173. package/dist/form/Wizard/WizardStepIndicator.js +6 -6
  174. package/dist/form/Wizard/types.d.ts +0 -14
  175. package/dist/form/fieldRegistry.d.ts +1 -1
  176. package/dist/form/fieldRegistry.js +6 -6
  177. package/dist/form/formEditing.js +1 -1
  178. package/dist/form/index.d.ts +5 -4
  179. package/dist/form/index.js +6 -7
  180. package/dist/form/lib.js +3 -2
  181. package/dist/form/types/fieldComponentTypes.d.ts +8 -10
  182. package/dist/form/useChoiceField.d.ts +18 -0
  183. package/dist/form/useChoiceField.js +46 -0
  184. package/dist/form/useFieldValue.d.ts +7 -0
  185. package/dist/form/useFieldValue.js +20 -0
  186. package/dist/form/useParsedOpts.d.ts +3 -1
  187. package/dist/form/useParsedOpts.js +12 -17
  188. package/dist/form/utils/dependentOptions.d.ts +8 -4
  189. package/dist/form/utils/dependentOptions.js +25 -17
  190. package/dist/form/utils/fieldItems.d.ts +32 -0
  191. package/dist/form/utils/fieldItems.js +32 -0
  192. package/dist/form/utils/fieldPath.d.ts +10 -0
  193. package/dist/form/utils/fieldPath.js +20 -0
  194. package/dist/form/utils/shareEqual.d.ts +6 -0
  195. package/dist/form/utils/shareEqual.js +38 -0
  196. package/dist/graph/AnnotationBanner.js +8 -8
  197. package/dist/graph/Collapse.d.ts +1 -0
  198. package/dist/graph/Collapse.js +6 -27
  199. package/dist/graph/Connectors.js +5 -5
  200. package/dist/graph/DependencyGraph.js +20 -19
  201. package/dist/graph/GraphEditor.js +30 -41
  202. package/dist/graph/GraphEditorDialogs.js +17 -17
  203. package/dist/graph/GraphNode.js +1 -1
  204. package/dist/graph/InputDialog.js +19 -22
  205. package/dist/graph/InputsEditor.js +58 -66
  206. package/dist/graph/JobSummary.js +42 -39
  207. package/dist/graph/MatrixGroup.js +1 -1
  208. package/dist/graph/ProblemsButton.js +18 -19
  209. package/dist/graph/Reveal.js +1 -1
  210. package/dist/graph/ShortcutsButton.js +15 -18
  211. package/dist/graph/SuggestionInput.d.ts +5 -10
  212. package/dist/graph/SuggestionInput.js +14 -18
  213. package/dist/graph/ToolbarPopover.d.ts +11 -6
  214. package/dist/graph/ToolbarPopover.js +35 -67
  215. package/dist/graph/TreeView.js +24 -37
  216. package/dist/graph/WorkflowSettingsDialog.js +4 -4
  217. package/dist/graph/editorChrome.js +13 -12
  218. package/dist/graph/editorFields.js +29 -29
  219. package/dist/graph/editorPrimitives.d.ts +1 -1
  220. package/dist/graph/editorPrimitives.js +10 -7
  221. package/dist/graph/editorRows.js +103 -97
  222. package/dist/graph/fieldProblems.js +2 -2
  223. package/dist/graph/graphEditorState.d.ts +4 -3
  224. package/dist/graph/inputRefs.js +9 -9
  225. package/dist/graph/settingsViews.js +6 -7
  226. package/dist/graph/stepWith.js +6 -6
  227. package/dist/index.d.ts +14 -15
  228. package/dist/index.js +15 -14
  229. package/dist/list/ActionToolbar.d.ts +6 -14
  230. package/dist/list/ActionToolbar.js +48 -96
  231. package/dist/list/ListPage.d.ts +6 -12
  232. package/dist/list/ListPage.js +46 -29
  233. package/dist/list/ListPager.js +4 -4
  234. package/dist/list/ListTable.js +5 -5
  235. package/dist/list/ListViewControls.d.ts +5 -4
  236. package/dist/list/ListViewControls.js +177 -267
  237. package/dist/list/UserHoverCard.d.ts +3 -17
  238. package/dist/list/UserHoverCard.js +21 -45
  239. package/dist/list/index.d.ts +3 -4
  240. package/dist/list/index.js +3 -4
  241. package/dist/list/listSearch.js +12 -11
  242. package/dist/list/rowMenu.d.ts +68 -0
  243. package/dist/list/rowMenu.js +136 -0
  244. package/dist/logviewer/LogViewer.js +26 -26
  245. package/dist/styles.css +1 -1
  246. package/package.json +7 -13
  247. package/dist/ai/ui/Dropdown.d.ts +0 -31
  248. package/dist/ai/ui/Dropdown.js +0 -110
  249. package/dist/components/AddMenu.d.ts +0 -18
  250. package/dist/components/AddMenu.js +0 -46
  251. package/dist/components/BareModal.d.ts +0 -17
  252. package/dist/components/BareModal.js +0 -77
  253. package/dist/components/CollapsiblePanel.d.ts +0 -27
  254. package/dist/components/CollapsiblePanel.js +0 -77
  255. package/dist/components/Dropdown.d.ts +0 -28
  256. package/dist/components/Dropdown.js +0 -355
  257. package/dist/components/Listbox.d.ts +0 -21
  258. package/dist/components/Listbox.js +0 -119
  259. package/dist/components/MultiSelect.d.ts +0 -22
  260. package/dist/components/MultiSelect.js +0 -168
  261. package/dist/components/SwitchToggle.d.ts +0 -15
  262. package/dist/components/SwitchToggle.js +0 -57
  263. package/dist/components/SwitchToggleSmall.d.ts +0 -6
  264. package/dist/components/SwitchToggleSmall.js +0 -14
  265. package/dist/components/Toggle.d.ts +0 -6
  266. package/dist/components/Toggle.js +0 -20
  267. package/dist/components/dropdownUtils.d.ts +0 -37
  268. package/dist/components/dropdownUtils.js +0 -99
  269. package/dist/form/SpecialTypes/DropdownWrapper.d.ts +0 -25
  270. package/dist/form/SpecialTypes/DropdownWrapper.js +0 -28
  271. package/dist/form/SpecialTypes/FormikCustomDropdown.d.ts +0 -51
  272. package/dist/form/SpecialTypes/FormikCustomDropdown.js +0 -119
  273. package/dist/form/SpecialTypes/FormikCustomInput.d.ts +0 -19
  274. package/dist/form/SpecialTypes/FormikCustomInput.js +0 -121
  275. package/dist/form/SpecialTypes/FormikMultiSelectDropdown.d.ts +0 -13
  276. package/dist/form/SpecialTypes/FormikMultiSelectDropdown.js +0 -31
  277. package/dist/form/SpecialTypes/FormikNumericInput.d.ts +0 -9
  278. package/dist/form/SpecialTypes/FormikNumericInput.js +0 -60
  279. package/dist/form/SpecialTypes/index.d.ts +0 -3
  280. package/dist/list/HoverCard.d.ts +0 -24
  281. package/dist/list/HoverCard.js +0 -73
  282. package/dist/list/RowContextMenu.d.ts +0 -127
  283. package/dist/list/RowContextMenu.js +0 -515
@@ -0,0 +1,24 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface ComboboxItem<Value = string> {
3
+ value: Value;
4
+ label: string;
5
+ description?: string | undefined;
6
+ icon?: ReactNode;
7
+ disabled?: boolean | undefined;
8
+ }
9
+ export interface ComboboxGroup<Value = string> {
10
+ label: string;
11
+ /** Leads the heading, such as a provider's logo. */
12
+ icon?: ReactNode;
13
+ /** Follows the label, such as who shared the group or a status like "Not responding". */
14
+ description?: string | undefined;
15
+ /** Empty for a group that only reports a status; a search finds it by its heading. */
16
+ items: readonly ComboboxLeaf<Value>[];
17
+ }
18
+ /** One item: an option, or a bare string labelled by its value. */
19
+ export type ComboboxLeaf<Value = string> = ComboboxItem<Value> | (Value & string);
20
+ /** Items, groups under headings, or both: items between groups list where they sit, without a heading. */
21
+ export type ComboboxItems<Value = string> = readonly (ComboboxLeaf<Value> | ComboboxGroup<Value>)[];
22
+ export declare function isComboboxGroup<Value>(item: ComboboxLeaf<Value> | ComboboxGroup<Value>): item is ComboboxGroup<Value>;
23
+ /** Every item, out of their groups. */
24
+ export declare function comboboxLeaves<Value>(items: ComboboxItems<Value>): ComboboxLeaf<Value>[];
@@ -0,0 +1,10 @@
1
+ //#region src/components/comboboxItems.ts
2
+ function isComboboxGroup(item) {
3
+ return typeof item === "object" && "items" in item;
4
+ }
5
+ /** Every item, out of their groups. */
6
+ function comboboxLeaves(items) {
7
+ return items.flatMap((item) => isComboboxGroup(item) ? item.items : [item]);
8
+ }
9
+ //#endregion
10
+ export { comboboxLeaves, isComboboxGroup };
@@ -0,0 +1,14 @@
1
+ /** Popups portal into the host's .ds-root when it has one, so they inherit the
2
+ * design system's CSS variables; undefined lets the portal use document.body. */
3
+ export declare function portalContainer(): HTMLElement | undefined;
4
+ /** Above dialogs and sticky chrome; hidden while its anchor is scrolled out of view. */
5
+ export declare const positionerClassName = "z-[10000] outline-none data-anchor-hidden:invisible";
6
+ /** A panel of choices: a menu, a select's list, a combobox's list. */
7
+ export declare const panelClassName = "rounded-lg border border-(--theme-border) bg-(--theme-app-bg) text-sm text-(--theme-app) shadow-(--theme-shadow-lg) outline-none origin-(--transform-origin) transition-[transform,opacity] duration-100 data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0";
8
+ /** A row in a panel. */
9
+ export declare const panelItemClassName = "flex w-full cursor-pointer select-none items-center gap-2 px-3 py-1.5 text-left outline-none data-highlighted:bg-(--theme-hover) data-highlighted:text-(--theme-hover-text) data-disabled:cursor-not-allowed data-disabled:opacity-50";
10
+ /** A tooltip's or infotip's small inverted surface. */
11
+ export declare const tipClassName = "rounded-md bg-(--theme-app) px-2 py-1 text-xs text-(--theme-app-bg) shadow-(--theme-shadow) whitespace-pre-line break-words data-instant:transition-none origin-(--transform-origin) transition-[transform,opacity] duration-100 data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0";
12
+ export declare const tipArrowClassName = "size-2 rotate-45 bg-(--theme-app) data-[side=top]:-bottom-1 data-[side=bottom]:-top-1 data-[side=left]:-right-1 data-[side=right]:-left-1";
13
+ /** A hover card's surface; the card sets its own width and padding. */
14
+ export declare const cardClassName = "overflow-hidden rounded-xl border border-(--theme-border) bg-(--theme-panel-bg) text-(--theme-app) shadow-(--theme-shadow-lg) outline-none origin-(--transform-origin) transition-[transform,opacity] duration-100 data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0";
@@ -0,0 +1,21 @@
1
+ //#region src/components/floating.ts
2
+ /** Popups portal into the host's .ds-root when it has one, so they inherit the
3
+ * design system's CSS variables; undefined lets the portal use document.body. */
4
+ function portalContainer() {
5
+ if (typeof document === "undefined") return;
6
+ return document.querySelector(".ds-root") ?? void 0;
7
+ }
8
+ /** Above dialogs and sticky chrome; hidden while its anchor is scrolled out of view. */
9
+ var positionerClassName = "z-[10000] outline-none data-anchor-hidden:invisible";
10
+ var enterExit = "origin-(--transform-origin) transition-[transform,opacity] duration-100 data-starting-style:scale-95 data-starting-style:opacity-0 data-ending-style:scale-95 data-ending-style:opacity-0";
11
+ /** A panel of choices: a menu, a select's list, a combobox's list. */
12
+ var panelClassName = `rounded-lg border border-(--theme-border) bg-(--theme-app-bg) text-sm text-(--theme-app) shadow-(--theme-shadow-lg) outline-none ${enterExit}`;
13
+ /** A row in a panel. */
14
+ var panelItemClassName = "flex w-full cursor-pointer select-none items-center gap-2 px-3 py-1.5 text-left outline-none data-highlighted:bg-(--theme-hover) data-highlighted:text-(--theme-hover-text) data-disabled:cursor-not-allowed data-disabled:opacity-50";
15
+ /** A tooltip's or infotip's small inverted surface. */
16
+ var tipClassName = `rounded-md bg-(--theme-app) px-2 py-1 text-xs text-(--theme-app-bg) shadow-(--theme-shadow) whitespace-pre-line break-words data-instant:transition-none ${enterExit}`;
17
+ var tipArrowClassName = "size-2 rotate-45 bg-(--theme-app) data-[side=top]:-bottom-1 data-[side=bottom]:-top-1 data-[side=left]:-right-1 data-[side=right]:-left-1";
18
+ /** A hover card's surface; the card sets its own width and padding. */
19
+ var cardClassName = `overflow-hidden rounded-xl border border-(--theme-border) bg-(--theme-panel-bg) text-(--theme-app) shadow-(--theme-shadow-lg) outline-none ${enterExit}`;
20
+ //#endregion
21
+ export { cardClassName, panelClassName, panelItemClassName, portalContainer, positionerClassName, tipArrowClassName, tipClassName };
@@ -0,0 +1,2 @@
1
+ /** Whether a query matches any of the texts, the way every picker in the package searches. */
2
+ export declare function useQueryMatch(): (query: string, ...texts: (string | undefined)[]) => boolean;
@@ -0,0 +1,14 @@
1
+ import { useCallback } from "react";
2
+ import { Combobox } from "@base-ui/react/combobox";
3
+ //#region src/components/search.ts
4
+ var fold = (text) => text.replaceAll("-", "");
5
+ /** Whether a query matches any of the texts, the way every picker in the package searches. */
6
+ function useQueryMatch() {
7
+ const { contains } = Combobox.useFilter();
8
+ return useCallback((query, ...texts) => {
9
+ const q = fold(query);
10
+ return texts.some((text) => text !== void 0 && contains(fold(text), q));
11
+ }, [contains]);
12
+ }
13
+ //#endregion
14
+ export { useQueryMatch };
@@ -1,6 +1,6 @@
1
1
  import Loader from "../components/Loader.js";
2
- import { Suspense, lazy } from "react";
3
2
  import { jsx } from "react/jsx-runtime";
3
+ import { Suspense, lazy } from "react";
4
4
  //#region src/editor/Editor.tsx
5
5
  var MonacoEditor = lazy(() => import("./Monaco.js"));
6
6
  function Editor(props) {
@@ -1,32 +1,27 @@
1
1
  import { FieldWrapper } from "../form/FieldWrapper.js";
2
+ import { useFieldValue } from "../form/useFieldValue.js";
2
3
  import Editor from "./Editor.js";
3
- import cx from "classnames";
4
- import { useMemo, useRef } from "react";
4
+ import { clsx } from "clsx";
5
5
  import { jsx } from "react/jsx-runtime";
6
- import { useField, useFormikContext } from "formik";
6
+ import { useMemo, useRef } from "react";
7
+ import { useFormContext, useWatch } from "react-hook-form";
7
8
  //#region src/editor/EditorField.tsx
8
- function hasResetKeys(obj) {
9
- return typeof obj === "object" && obj !== null && "editorKeyPostfix" in obj && typeof obj.editorKeyPostfix === "string";
10
- }
11
9
  function EditorField(props) {
12
- const { field, label, labelPosition, disabled, onChange, tooltipComponent, spaceCompact, setFormDirty } = props;
10
+ const { field, label, labelPosition, disabled, onChange, tooltipComponent, spaceCompact } = props;
13
11
  const fieldName = field.name ?? "";
14
- const [fieldState] = useField(fieldName);
15
- const { setFieldValue, setFieldTouched, values } = useFormikContext();
16
- const debounceRef = useRef(null);
12
+ const [value, change] = useFieldValue(fieldName);
17
13
  const touchedRef = useRef(false);
18
14
  const handleChange = (val) => {
19
15
  touchedRef.current = true;
20
- if (debounceRef.current) clearTimeout(debounceRef.current);
21
- debounceRef.current = setTimeout(() => {
22
- onChange?.(val);
23
- setFieldTouched(fieldName, true);
24
- setFieldValue(fieldName, val);
25
- setFormDirty(true);
26
- }, 500);
16
+ onChange?.(val);
17
+ change(val);
27
18
  };
28
- let editorKeyPostfix = "";
29
- if (hasResetKeys(values)) editorKeyPostfix = values.editorKeyPostfix;
19
+ const { control } = useFormContext();
20
+ const resetKey = useWatch({
21
+ control,
22
+ name: "editorKeyPostfix"
23
+ });
24
+ const editorKeyPostfix = typeof resetKey === "string" ? resetKey : "";
30
25
  const postfixKey = useMemo(() => {
31
26
  const randomKey = Math.random().toString(36).substring(7);
32
27
  return editorKeyPostfix || randomKey;
@@ -41,8 +36,8 @@ function EditorField(props) {
41
36
  ariaLabel: label,
42
37
  height: "200px",
43
38
  path: fieldName,
44
- ...touchedRef.current ? {} : { value: fieldState.value },
45
- className: cx("bg-(--theme-input-bg) w-11 border focus:border rounded text-[10px] leading-4 pl-[6px]", disabled && "opacity-75"),
39
+ ...touchedRef.current || value === void 0 ? {} : { value },
40
+ className: clsx("bg-(--theme-input-bg) w-11 border focus:border rounded text-[10px] leading-4 pl-[6px]", disabled && "opacity-75"),
46
41
  readOnly: disabled,
47
42
  onChange: handleChange,
48
43
  language: field.options?.language || "shell"
@@ -1,14 +1,15 @@
1
- import { useNotify, useStrings, useWorkflowEngine } from "../components/Provider.js";
2
1
  import { FaCheck } from "../icons/fa/FaCheck.js";
3
2
  import { FiCopy } from "../icons/fi/FiCopy.js";
4
3
  import { LuEye } from "../icons/lu/LuEye.js";
5
4
  import { LuEyeOff } from "../icons/lu/LuEyeOff.js";
6
- import SwitchToggleSmall from "../components/SwitchToggleSmall.js";
5
+ import { Tooltip } from "../components/Tooltip.js";
6
+ import { useNotify, useStrings, useWorkflowEngine } from "../components/Provider.js";
7
+ import { Switch } from "../components/Switch.js";
7
8
  import { flattenGroups, impureSetValueFromPath } from "../form/lib.js";
8
9
  import Editor from "./Editor.js";
9
- import cx from "classnames";
10
- import { useId, useRef, useState } from "react";
10
+ import { clsx } from "clsx";
11
11
  import { jsx, jsxs } from "react/jsx-runtime";
12
+ import { useRef, useState } from "react";
12
13
  //#region src/editor/FormCodePanel.tsx
13
14
  var isObject = (value) => typeof value === "object" && value !== null;
14
15
  var shouldIgnoreField = (engine, fieldSchema, inputs, arrayIndex) => {
@@ -73,7 +74,6 @@ function FormCodePanel({ formJSON, data, mutate, height = "600px", disabled = fa
73
74
  const engine = useWorkflowEngine();
74
75
  const notify = useNotify();
75
76
  const { common: t } = useStrings();
76
- const uid = useId();
77
77
  const [jsonHasErrors, setJsonHasErrors] = useState(false);
78
78
  const [showHidden, setShowHidden] = useState(false);
79
79
  const [copied, setCopied] = useState(false);
@@ -103,22 +103,22 @@ function FormCodePanel({ formJSON, data, mutate, height = "600px", disabled = fa
103
103
  style: { height },
104
104
  className: "flex w-full flex-col gap-2",
105
105
  children: [/* @__PURE__ */ jsxs("div", {
106
- className: cx("flex min-h-0 flex-1 flex-col overflow-hidden rounded-md border", jsonHasErrors ? "border-red-500" : "border-(--theme-border)"),
106
+ className: clsx("flex min-h-0 flex-1 flex-col overflow-hidden rounded-md border", jsonHasErrors ? "border-red-500" : "border-(--theme-border)"),
107
107
  children: [/* @__PURE__ */ jsxs("div", {
108
108
  className: "bg-(--theme-muted-panel-bg) text-(--theme-muted-panel-color) flex shrink-0 items-center gap-3 border-b border-(--theme-border) px-3 py-2",
109
- children: [hasHiddenFields && /* @__PURE__ */ jsxs("label", {
110
- htmlFor: `${uid}-show-hidden`,
111
- title: t.showHiddenFieldsHint,
112
- className: "flex cursor-pointer select-none items-center gap-2 text-sm text-(--theme-app)",
113
- children: [/* @__PURE__ */ jsx(SwitchToggleSmall, {
114
- id: `${uid}-show-hidden`,
115
- value: showHidden,
116
- "aria-label": t.showHiddenFields,
117
- onClick: () => setShowHidden((prev) => !prev)
118
- }), /* @__PURE__ */ jsxs("span", {
119
- className: "flex items-center gap-1.5",
120
- children: [showHidden ? /* @__PURE__ */ jsx(LuEye, {}) : /* @__PURE__ */ jsx(LuEyeOff, {}), t.showHiddenFields]
121
- })]
109
+ children: [hasHiddenFields && /* @__PURE__ */ jsx(Tooltip, {
110
+ content: t.showHiddenFieldsHint,
111
+ children: /* @__PURE__ */ jsxs("label", {
112
+ className: "flex cursor-pointer select-none items-center gap-2 text-sm text-(--theme-app)",
113
+ children: [/* @__PURE__ */ jsx(Switch, {
114
+ size: "sm",
115
+ checked: showHidden,
116
+ onCheckedChange: setShowHidden
117
+ }), /* @__PURE__ */ jsxs("span", {
118
+ className: "flex items-center gap-1.5",
119
+ children: [showHidden ? /* @__PURE__ */ jsx(LuEye, {}) : /* @__PURE__ */ jsx(LuEyeOff, {}), t.showHiddenFields]
120
+ })]
121
+ })
122
122
  }), /* @__PURE__ */ jsxs("button", {
123
123
  type: "button",
124
124
  onClick: handleCopy,
@@ -7,9 +7,9 @@ import { defineEditorThemes, getThemeName } from "./themes.js";
7
7
  import { setupMonacoWorkers } from "./workers.js";
8
8
  import { holdListeners, modelFor } from "./editorModel.js";
9
9
  import { ensureYamlLanguage } from "./yamlLanguage.js";
10
- import cx from "classnames";
11
- import { useEffect, useLayoutEffect, useRef } from "react";
10
+ import { clsx } from "clsx";
12
11
  import { jsx } from "react/jsx-runtime";
12
+ import { useEffect, useLayoutEffect, useRef } from "react";
13
13
  import * as monaco from "monaco-editor";
14
14
  //#region src/editor/Monaco.tsx
15
15
  setupMonacoWorkers();
@@ -116,7 +116,7 @@ function MonacoEditor({ className, disabled, onChange = noop, onValidate = noop,
116
116
  width,
117
117
  height
118
118
  },
119
- className: cx("relative border rounded", className),
119
+ className: clsx("relative border rounded", className),
120
120
  ref: (ref) => {
121
121
  if (ref && !monacoRef.current) {
122
122
  defineEditorThemes(monaco.editor);
@@ -1,5 +1,3 @@
1
- import { safeUrl } from "../safeUrl.js";
2
- import { useNotify, useSlots, useStrings } from "../components/Provider.js";
3
1
  import { BiSolidTrashAlt } from "../icons/bi/BiSolidTrashAlt.js";
4
2
  import { BsArrowsCollapse } from "../icons/bs/BsArrowsCollapse.js";
5
3
  import { FaAngleDown } from "../icons/fa/FaAngleDown.js";
@@ -16,16 +14,21 @@ import { LuEye } from "../icons/lu/LuEye.js";
16
14
  import { MdRefresh } from "../icons/md/MdRefresh.js";
17
15
  import { PiShareBold } from "../icons/pi/PiShareBold.js";
18
16
  import { TbAlertTriangle } from "../icons/tb/TbAlertTriangle.js";
17
+ import { MenuItem, MenuPopup, MenuSeparator } from "../components/Menu.js";
18
+ import { safeUrl } from "../safeUrl.js";
19
19
  import { keyedByContent } from "../components/keys.js";
20
- import { TOOLTIP_ID, TooltipInfo } from "../components/Tooltip.js";
20
+ import { Tooltip } from "../components/Tooltip.js";
21
+ import { useNotify, useSlots, useStrings } from "../components/Provider.js";
21
22
  import { ConfirmModal } from "../components/ConfirmModal.js";
23
+ import { useContextMenu } from "../components/ContextMenu.js";
22
24
  import CopyToClipboard, { CopyCodeBlock } from "../components/CopyToClipboard.js";
25
+ import { InfoTip } from "../components/InfoTip.js";
23
26
  import { CreateModal } from "../components/CreateModal.js";
24
27
  import Loader from "../components/Loader.js";
25
- import { assembleRowMenu, useCopySubmenu, useRowMenu } from "../list/RowContextMenu.js";
26
28
  import { StatusBadge } from "../components/StatusBadge.js";
27
29
  import { Table } from "../components/Table.js";
28
30
  import { ListActionsHeader, ListSkeleton, listTableFixedProps, listTableProps } from "../list/ListTable.js";
31
+ import { assembleRowMenu, useCopySubmenu } from "../list/rowMenu.js";
29
32
  import { calculateUploadNodesTotalSize, createTreeBuilder, formatFileSize, getDirectoryNameError, getDirectoryObjectPath, getNodeChildren, getObjectKeyFromNode, getParentPath, getUploadNodesFromDataTransferItems, getUriScheme, pruneNodesInsideSelectedDirectories, removeLeadingAndTrailingSlashes } from "./lib/utils.js";
30
33
  import { useFileExplorer } from "./FileExplorerContext.js";
31
34
  import { PREVIEW_URL_EXPIRES_IN, canPreview } from "./FilePreview/previewType.js";
@@ -39,11 +42,11 @@ import { FileTableHeaders } from "./FileTableHeaders.js";
39
42
  import { FileTable } from "./FileTable.js";
40
43
  import { advanceListing, beginLoadingMore, canAutoLoadMore, clearListingError, clearListingsUnder, hasMore, incompletePaths, isListed, isLoadingMore, loadMoreError, nextHydrationStep, recordListingError, replaceListing } from "./lib/paging.js";
41
44
  import { TreeView } from "./TreeView.js";
42
- import { Menu, MenuButton, MenuItem, MenuItems, MenuSeparator } from "@headlessui/react";
43
- import cx from "classnames";
45
+ import { Menu } from "@base-ui/react/menu";
46
+ import { clsx } from "clsx";
47
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
44
48
  import { useCallback, useEffect, useEffectEvent, useLayoutEffect, useMemo, useRef, useState } from "react";
45
49
  import { useLocalStorage } from "usehooks-ts";
46
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
47
50
  import { DateTime } from "luxon";
48
51
  import { Resizable } from "re-resizable";
49
52
  //#region src/file-explorer/FileExplorer.tsx
@@ -258,7 +261,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
258
261
  const [pendingDelete, setPendingDelete] = useState(null);
259
262
  const [detailTab, setDetailTab] = useState("details");
260
263
  useEffect(() => clearPreviewCache, []);
261
- const { openMenu, contextMenu } = useRowMenu();
264
+ const { openMenu, contextMenu } = useContextMenu();
262
265
  const [sidebarWidth, setSidebarWidth] = useLocalStorage(SIDEBAR_WIDTH_STORAGE_KEY, 300);
263
266
  const handleToggleExpand = useCallback((path) => {
264
267
  setExpandedPaths((prev) => {
@@ -630,7 +633,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
630
633
  key: "create-folder",
631
634
  label: t.createFolder.action,
632
635
  icon: /* @__PURE__ */ jsx(FaRegFolder, {}),
633
- onSelect: () => openCreateFolder(node)
636
+ onClick: () => openCreateFolder(node)
634
637
  }];
635
638
  };
636
639
  const buildRowMenu = (node) => {
@@ -644,20 +647,20 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
644
647
  key: "preview",
645
648
  label: t.preview.preview,
646
649
  icon: /* @__PURE__ */ jsx(LuEye, {}),
647
- onSelect: () => openPreview(node)
650
+ onClick: () => openPreview(node)
648
651
  });
649
652
  if (isFile) {
650
653
  actions.push({
651
654
  key: "download",
652
655
  label: t.preview.download,
653
656
  icon: /* @__PURE__ */ jsx(FiDownload, {}),
654
- onSelect: () => downloadNode(node)
657
+ onClick: () => downloadNode(node)
655
658
  });
656
659
  if (nodeCanShare) actions.push({
657
660
  key: "share",
658
661
  label: t.preview.shareFile,
659
662
  icon: /* @__PURE__ */ jsx(PiShareBold, {}),
660
- onSelect: () => onShareFileButtonClick(node)
663
+ onClick: () => onShareFileButtonClick(node)
661
664
  });
662
665
  }
663
666
  actions.push(...getCreateFolderActions(node, storage));
@@ -667,13 +670,12 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
667
670
  label: t.preview.delete,
668
671
  icon: /* @__PURE__ */ jsx(BiSolidTrashAlt, {}),
669
672
  destructive: true,
670
- onSelect: () => deleteNode(node)
673
+ onClick: () => deleteNode(node)
671
674
  });
672
675
  const lead = [{
673
- kind: "action",
674
676
  label: isFile ? t.preview.viewDetails : t.preview.openFolder,
675
677
  icon: isFile ? /* @__PURE__ */ jsx(FiFileText, {}) : /* @__PURE__ */ jsx(FaRegFolder, {}),
676
- onSelect: () => handleSelectTreeItem(node.path, node)
678
+ onClick: () => handleSelectTreeItem(node.path, node)
677
679
  }];
678
680
  const uriExtras = uris.map((value) => ({
679
681
  label: `${getUriScheme(value).toUpperCase()} URI`,
@@ -694,7 +696,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
694
696
  if (items.length === 0) return;
695
697
  e.preventDefault();
696
698
  e.stopPropagation();
697
- openMenu(e.clientX, e.clientY, items);
699
+ openMenu(e, items);
698
700
  };
699
701
  const renderBreadcrumb = () => {
700
702
  const chain = [];
@@ -951,24 +953,24 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
951
953
  className: "flex items-center justify-end h-10 px-3 shrink-0 border-b theme-border",
952
954
  children: /* @__PURE__ */ jsxs("div", {
953
955
  className: "flex gap-x-0.5",
954
- children: [/* @__PURE__ */ jsx("button", {
955
- type: "button",
956
- "aria-label": t.chrome.refresh,
957
- "data-tooltip-id": TOOLTIP_ID,
958
- "data-tooltip-content": "Refresh",
959
- "data-tooltip-class-name": "z-50",
960
- className: "inline-flex items-center justify-center h-7 w-7 rounded-md cursor-pointer theme-muted-text hover:theme-text hover:theme-hover transition-colors duration-150 focus:outline-none focus-visible:ring-1 focus-visible:ring-(--theme-link)",
961
- onClick: () => handleRefresh(),
962
- children: /* @__PURE__ */ jsx(MdRefresh, { className: "h-3.5 w-3.5" })
963
- }), /* @__PURE__ */ jsx("button", {
964
- type: "button",
965
- "aria-label": t.chrome.collapse,
966
- "data-tooltip-id": TOOLTIP_ID,
967
- "data-tooltip-content": "Collapse All",
968
- "data-tooltip-class-name": "z-50",
969
- className: "inline-flex items-center justify-center h-7 w-7 rounded-md cursor-pointer theme-muted-text hover:theme-text hover:theme-hover transition-colors duration-150 focus:outline-none focus-visible:ring-1 focus-visible:ring-(--theme-link)",
970
- onClick: collapseAll,
971
- children: /* @__PURE__ */ jsx(BsArrowsCollapse, { className: "h-3.5 w-3.5" })
956
+ children: [/* @__PURE__ */ jsx(Tooltip, {
957
+ content: t.chrome.refresh,
958
+ children: /* @__PURE__ */ jsx("button", {
959
+ type: "button",
960
+ "aria-label": t.chrome.refresh,
961
+ className: "inline-flex items-center justify-center h-7 w-7 rounded-md cursor-pointer theme-muted-text hover:theme-text hover:theme-hover transition-colors duration-150 focus:outline-none focus-visible:ring-1 focus-visible:ring-(--theme-link)",
962
+ onClick: () => handleRefresh(),
963
+ children: /* @__PURE__ */ jsx(MdRefresh, { className: "h-3.5 w-3.5" })
964
+ })
965
+ }), /* @__PURE__ */ jsx(Tooltip, {
966
+ content: t.chrome.collapse,
967
+ children: /* @__PURE__ */ jsx("button", {
968
+ type: "button",
969
+ "aria-label": t.chrome.collapse,
970
+ className: "inline-flex items-center justify-center h-7 w-7 rounded-md cursor-pointer theme-muted-text hover:theme-text hover:theme-hover transition-colors duration-150 focus:outline-none focus-visible:ring-1 focus-visible:ring-(--theme-link)",
971
+ onClick: collapseAll,
972
+ children: /* @__PURE__ */ jsx(BsArrowsCollapse, { className: "h-3.5 w-3.5" })
973
+ })
972
974
  })]
973
975
  })
974
976
  }), /* @__PURE__ */ jsx(TreeView, {
@@ -1028,10 +1030,9 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
1028
1030
  icon: getNodeIcon(rootNode, slots.storageIconUrl, t.chrome.storageIconAlt),
1029
1031
  storageCount: getNodeChildren(parentToChildrenMap, rootNode.path).length,
1030
1032
  getItems: () => [{
1031
- kind: "action",
1032
1033
  label: t.preview.open,
1033
1034
  icon: /* @__PURE__ */ jsx(FaRegFolder, {}),
1034
- onSelect: () => openUserNode(rootNode)
1035
+ onClick: () => openUserNode(rootNode)
1035
1036
  }],
1036
1037
  openMenu,
1037
1038
  onOpen: openUserNode
@@ -1041,7 +1042,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
1041
1042
  selectedStorage: null,
1042
1043
  onRefresh: handleRefresh
1043
1044
  })]
1044
- }) : !selectedNode ? /* @__PURE__ */ jsx(NoFileSelectedPreview, {}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
1045
+ }) : !selectedNode ? /* @__PURE__ */ jsx(NoFileSelectedPreview, {}) : /* @__PURE__ */ jsxs(Fragment, { children: [
1045
1046
  /* @__PURE__ */ jsxs("div", {
1046
1047
  className: "flex items-center justify-between gap-3 px-4 h-12 shrink-0 border-b theme-border",
1047
1048
  children: [renderBreadcrumb(), /* @__PURE__ */ jsxs("div", {
@@ -1093,7 +1094,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
1093
1094
  children: t.createFolder.action
1094
1095
  })]
1095
1096
  }),
1096
- selectedNodeCanWrite && selectedNodeCanUpload && /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsxs(MenuButton, {
1097
+ selectedNodeCanWrite && selectedNodeCanUpload && /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsxs(Menu.Trigger, {
1097
1098
  "aria-label": t.chrome.upload,
1098
1099
  className: "btn btn-info cursor-pointer flex items-center justify-between pr-0.5!",
1099
1100
  disabled: selectedNode.type === "file" || !selectedNode.storageId,
@@ -1101,23 +1102,18 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
1101
1102
  className: "hidden md:inline",
1102
1103
  children: t.chrome.upload
1103
1104
  })] }), /* @__PURE__ */ jsx(FaAngleDown, { className: "h-4 w-4 ml-2" })]
1104
- }), /* @__PURE__ */ jsxs(MenuItems, {
1105
- transition: true,
1106
- anchor: "bottom end",
1107
- className: "theme-panel w-36 rounded-md border p-1 mt-1 shadow-lg z-50 origin-top-right transition duration-100\n ease-out data-closed:scale-95 data-closed:opacity-0 focus:outline-none",
1108
- children: [/* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsx("button", {
1109
- type: "button",
1110
- className: "text-sm rounded-sm hover:theme-hover cursor-pointer w-full items-center px-2 py-1.5",
1105
+ }), /* @__PURE__ */ jsxs(MenuPopup, {
1106
+ align: "end",
1107
+ className: "w-36",
1108
+ children: [/* @__PURE__ */ jsx(MenuItem, {
1111
1109
  onClick: () => fileInputRef.current?.click(),
1112
1110
  children: "Select Files"
1113
- }) }), /* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsx("button", {
1114
- type: "button",
1115
- className: "text-sm rounded-sm hover:theme-hover cursor-pointer w-full items-center px-2 py-1.5",
1111
+ }), /* @__PURE__ */ jsx(MenuItem, {
1116
1112
  onClick: () => folderInputRef.current?.click(),
1117
1113
  children: "Select Folder"
1118
- }) })]
1114
+ })]
1119
1115
  })] }),
1120
- /* @__PURE__ */ jsxs(Menu, { children: [/* @__PURE__ */ jsxs(MenuButton, {
1116
+ /* @__PURE__ */ jsxs(Menu.Root, { children: [/* @__PURE__ */ jsxs(Menu.Trigger, {
1121
1117
  "aria-label": t.chrome.download,
1122
1118
  className: "btn btn-info cursor-pointer flex items-center justify-between pr-0.5!",
1123
1119
  disabled: checkedItems.size === 0 && selectedNode.type !== "file" || hasFolderSelected() || !selectedNode.storageId,
@@ -1125,28 +1121,28 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
1125
1121
  className: "hidden md:inline",
1126
1122
  children: t.chrome.download
1127
1123
  })] }), /* @__PURE__ */ jsx(FaAngleDown, { className: "h-4 w-4 ml-2" })]
1128
- }), /* @__PURE__ */ jsxs(MenuItems, {
1129
- transition: true,
1130
- anchor: "bottom end",
1131
- className: "theme-panel w-72 rounded-md border p-1 mt-1 shadow-lg z-50 origin-top-right transition duration-100 \n ease-out data-closed:scale-95 data-closed:opacity-0 focus:outline-none",
1132
- children: [/* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsx("button", {
1133
- type: "button",
1134
- className: "text-sm rounded-sm hover:theme-hover cursor-pointer w-full items-center px-2 py-1.5",
1124
+ }), /* @__PURE__ */ jsxs(MenuPopup, {
1125
+ align: "end",
1126
+ className: "w-72",
1127
+ children: [/* @__PURE__ */ jsx(MenuItem, {
1135
1128
  onClick: handleDownload,
1136
1129
  children: t.chrome.downloadFromBrowser
1137
- }) }), downloadCommand && downloadCommandText && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(MenuSeparator, { className: "my-0.5 h-px theme-border" }), /* @__PURE__ */ jsx(MenuItem, { children: /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
1138
- className: "text-sm w-full text-center pointer-events-none px-2 py-1.5",
1139
- children: downloadCommand.label
1140
- }), /* @__PURE__ */ jsx(CopyCodeBlock, {
1141
- textToCopy: downloadCommandText,
1142
- children: /* @__PURE__ */ jsx("div", {
1143
- className: "overflow-x-auto text-xs",
1144
- children: keyedByContent(downloadCommandText.split("\n"), (l) => l).map(({ key, item: line }) => /* @__PURE__ */ jsx("div", {
1145
- className: "whitespace-nowrap",
1146
- children: line
1147
- }, key))
1148
- })
1149
- })] }) })] })]
1130
+ }), downloadCommand && downloadCommandText && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MenuSeparator, {}), /* @__PURE__ */ jsxs("div", {
1131
+ className: "px-2 py-1.5",
1132
+ children: [/* @__PURE__ */ jsx("p", {
1133
+ className: "text-sm text-center pb-1.5",
1134
+ children: downloadCommand.label
1135
+ }), /* @__PURE__ */ jsx(CopyCodeBlock, {
1136
+ textToCopy: downloadCommandText,
1137
+ children: /* @__PURE__ */ jsx("div", {
1138
+ className: "overflow-x-auto text-xs",
1139
+ children: keyedByContent(downloadCommandText.split("\n"), (l) => l).map(({ key, item: line }) => /* @__PURE__ */ jsx("div", {
1140
+ className: "whitespace-nowrap",
1141
+ children: line
1142
+ }, key))
1143
+ })
1144
+ })]
1145
+ })] })]
1150
1146
  })] }),
1151
1147
  /* @__PURE__ */ jsxs("button", {
1152
1148
  type: "button",
@@ -1217,7 +1213,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
1217
1213
  const createdDt = selectedNode.created ? DateTime.fromISO(selectedNode.created) : null;
1218
1214
  const previewable = canPreview(selectedNode);
1219
1215
  const effectiveTab = previewable ? detailTab : "details";
1220
- const tabClass = (active) => cx("mx-2.5 border-b-2 px-1 py-2.5 text-[13px] font-medium cursor-pointer transition-colors", active ? "theme-text border-(--theme-element)" : "theme-muted-text border-transparent hover:theme-text");
1216
+ const tabClass = (active) => clsx("mx-2.5 border-b-2 px-1 py-2.5 text-[13px] font-medium cursor-pointer transition-colors", active ? "theme-text border-(--theme-element)" : "theme-muted-text border-transparent hover:theme-text");
1221
1217
  return /* @__PURE__ */ jsxs("div", {
1222
1218
  className: "flex h-full min-h-0 flex-col",
1223
1219
  children: [/* @__PURE__ */ jsxs("div", {
@@ -1267,7 +1263,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
1267
1263
  className: "tabular-nums",
1268
1264
  children: formatFileSize(selectedNode.size)
1269
1265
  }),
1270
- modifiedDt && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
1266
+ modifiedDt && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
1271
1267
  "aria-hidden": true,
1272
1268
  children: "·"
1273
1269
  }), /* @__PURE__ */ jsxs("span", { children: ["Modified ", modifiedDt.toRelative()] })] })
@@ -1284,9 +1280,9 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
1284
1280
  children: [/* @__PURE__ */ jsx(ShareFileButton, {
1285
1281
  node: selectedNode,
1286
1282
  onShare: onShareFileButtonClick
1287
- }), /* @__PURE__ */ jsx(TooltipInfo, {
1283
+ }), /* @__PURE__ */ jsx(InfoTip, {
1288
1284
  text: "This will generate a pre-signed URL for this file. Anyone with this link can temporarily access and download the file, even if they don't have an account. The link will automatically expire after 12 hours.",
1289
- place: "right"
1285
+ side: "right"
1290
1286
  })]
1291
1287
  }),
1292
1288
  /* @__PURE__ */ jsxs("div", {
@@ -1297,21 +1293,21 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
1297
1293
  }), /* @__PURE__ */ jsxs("dl", {
1298
1294
  className: "grid grid-cols-[minmax(0,140px)_1fr] gap-x-6 gap-y-2 text-sm",
1299
1295
  children: [
1300
- typeof selectedNode.size === "number" && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("dt", {
1296
+ typeof selectedNode.size === "number" && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
1301
1297
  className: "theme-muted-text",
1302
1298
  children: t.chrome.size
1303
1299
  }), /* @__PURE__ */ jsx("dd", {
1304
1300
  className: "tabular-nums",
1305
1301
  children: formatFileSize(selectedNode.size)
1306
1302
  })] }),
1307
- selectedNode.contentType && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("dt", {
1303
+ selectedNode.contentType && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
1308
1304
  className: "theme-muted-text",
1309
1305
  children: "Content Type"
1310
1306
  }), /* @__PURE__ */ jsx("dd", {
1311
1307
  className: "font-mono text-xs",
1312
1308
  children: selectedNode.contentType
1313
1309
  })] }),
1314
- createdDt && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("dt", {
1310
+ createdDt && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
1315
1311
  className: "theme-muted-text",
1316
1312
  children: t.chrome.created
1317
1313
  }), /* @__PURE__ */ jsxs("dd", { children: [
@@ -1322,7 +1318,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
1322
1318
  children: ["· ", createdDt.toRelative()]
1323
1319
  })
1324
1320
  ] })] }),
1325
- modifiedDt && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("dt", {
1321
+ modifiedDt && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
1326
1322
  className: "theme-muted-text",
1327
1323
  children: "Last Modified"
1328
1324
  }), /* @__PURE__ */ jsxs("dd", { children: [
@@ -1333,14 +1329,14 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
1333
1329
  children: ["· ", modifiedDt.toRelative()]
1334
1330
  })
1335
1331
  ] })] }),
1336
- selectedNode.hash && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("dt", {
1332
+ selectedNode.hash && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
1337
1333
  className: "theme-muted-text",
1338
1334
  children: t.chrome.hash
1339
1335
  }), /* @__PURE__ */ jsx("dd", {
1340
1336
  className: "font-mono text-xs break-all",
1341
1337
  children: selectedNode.hash.replace(/^"|"$/g, "")
1342
1338
  })] }),
1343
- selectedNode.storageClass && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("dt", {
1339
+ selectedNode.storageClass && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
1344
1340
  className: "theme-muted-text",
1345
1341
  children: "Storage Class"
1346
1342
  }), /* @__PURE__ */ jsx("dd", {
@@ -1420,7 +1416,7 @@ function FileExplorer({ storages, onRefresh, refreshKey, onOpenFile, showUserHie
1420
1416
  }),
1421
1417
  " ",
1422
1418
  /* @__PURE__ */ jsx("span", {
1423
- className: cx(isUploadSizeExceeded(pendingUpload?.totalSize ?? 0) && "text-amber-800 font-semibold"),
1419
+ className: clsx(isUploadSizeExceeded(pendingUpload?.totalSize ?? 0) && "text-amber-800 font-semibold"),
1424
1420
  children: formatFileSize(pendingUpload?.totalSize ?? 0)
1425
1421
  })
1426
1422
  ]
@@ -1,10 +1,10 @@
1
- import { useNotify, useStrings } from "../components/Provider.js";
2
1
  import { keyedByContent } from "../components/keys.js";
2
+ import { useNotify, useStrings } from "../components/Provider.js";
3
3
  import { mapWithConcurrency } from "./lib/batch.js";
4
4
  import { calculateUploadNodesTotalSize, getUploadSessionETA, removeLeadingSlash } from "./lib/utils.js";
5
5
  import { UploadSessionToast } from "./toasts.js";
6
- import { createContext, use, useRef } from "react";
7
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { createContext, use, useRef } from "react";
8
8
  //#region src/file-explorer/FileExplorerContext.tsx
9
9
  var UPLOAD_CONCURRENCY = 3;
10
10
  var FileExplorerContext = createContext(void 0);