@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
@@ -1,4 +1,3 @@
1
- import { useWorkflowEditing } from "../components/Provider.js";
2
1
  import { BiSolidTrashAlt } from "../icons/bi/BiSolidTrashAlt.js";
3
2
  import { BsArrowsCollapse } from "../icons/bs/BsArrowsCollapse.js";
4
3
  import { BsDash } from "../icons/bs/BsDash.js";
@@ -12,9 +11,11 @@ import { GoPlus } from "../icons/go/GoPlus.js";
12
11
  import { HiDuplicate } from "../icons/hi/HiDuplicate.js";
13
12
  import { MdDragHandle } from "../icons/md/MdDragHandle.js";
14
13
  import { TbAlertTriangle } from "../icons/tb/TbAlertTriangle.js";
15
- import { TOOLTIP_ID } from "../components/Tooltip.js";
14
+ import { Tooltip } from "../components/Tooltip.js";
15
+ import { useWorkflowEditing } from "../components/Provider.js";
16
+ import { menuDivider } from "../components/MenuEntries.js";
17
+ import { useContextMenu } from "../components/ContextMenu.js";
16
18
  import { IconButton } from "../components/IconButton.js";
17
- import { useRowMenu } from "../list/RowContextMenu.js";
18
19
  import { MarqueeBox, createStore, reclaimFocus, returningFocus, trackDrag, useFocusAfterDialog, usePressOutside, useStore } from "./editorPrimitives.js";
19
20
  import { useGraphEditorStrings, useInputsEditorStrings } from "./editorStrings.js";
20
21
  import { asRecord } from "./records.js";
@@ -28,9 +29,9 @@ import { ALT_KEY, MOD_KEY } from "./ShortcutsButton.js";
28
29
  import { AddChip, BarDivider, DragLabel, EditorBar } from "./editorChrome.js";
29
30
  import { addPageEdit, splitIntoPagesEdits, unsplitPagesEdits, wizardGroupDefinition } from "./inputPages.js";
30
31
  import { inputCell, linesIn, rowsOf, snapSplit } from "./inputRows.js";
31
- import cx from "classnames";
32
+ import { clsx } from "clsx";
33
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
32
34
  import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
33
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
34
35
  //#region src/graph/InputsEditor.tsx
35
36
  var createFormStore = () => createStore({
36
37
  drag: null,
@@ -98,17 +99,18 @@ function inputsInBox(root, box) {
98
99
  return outermost((holder ? touched.filter(({ path }) => below(path, holder)) : touched).map(({ path }) => path));
99
100
  }
100
101
  function ChromeButton({ label, onClick, children }) {
101
- return /* @__PURE__ */ jsx("button", {
102
- type: "button",
103
- "aria-label": label,
104
- "data-tooltip-id": TOOLTIP_ID,
105
- "data-tooltip-content": label,
106
- className: "flex h-5 w-5 cursor-pointer items-center justify-center rounded hover:bg-(--theme-muted-panel-bg) hover:text-(--theme-app)",
107
- onClick: (e) => {
108
- e.stopPropagation();
109
- onClick(e);
110
- },
111
- children
102
+ return /* @__PURE__ */ jsx(Tooltip, {
103
+ content: label,
104
+ children: /* @__PURE__ */ jsx("button", {
105
+ type: "button",
106
+ "aria-label": label,
107
+ className: "flex h-5 w-5 cursor-pointer items-center justify-center rounded hover:bg-(--theme-muted-panel-bg) hover:text-(--theme-app)",
108
+ onClick: (e) => {
109
+ e.stopPropagation();
110
+ onClick(e);
111
+ },
112
+ children
113
+ })
112
114
  });
113
115
  }
114
116
  /** An input's row: its field, with a toolbar of its type, drag grip and actions on hover. */
@@ -132,7 +134,7 @@ function InputRow({ path, hidden = false, instance, children }) {
132
134
  const childKey = hidden ? editing.inputChildrenKey(definition["type"]) : void 0;
133
135
  const outline = childKey && childKey !== "template" ? namesIn(asRecord(definition[childKey])) : null;
134
136
  const flagged = hidden && definition["hidden"] !== void 0 && definition["hidden"] !== false;
135
- const actions = /* @__PURE__ */ jsxs(Fragment$1, { children: [
137
+ const actions = /* @__PURE__ */ jsxs(Fragment, { children: [
136
138
  /* @__PURE__ */ jsx("button", {
137
139
  type: "button",
138
140
  "aria-label": t.inputActions,
@@ -140,15 +142,13 @@ function InputRow({ path, hidden = false, instance, children }) {
140
142
  className: "flex h-5 w-5 cursor-grab items-center justify-center rounded hover:bg-(--theme-muted-panel-bg)",
141
143
  onPointerDown: (e) => api.startDrag(e, path, name),
142
144
  onClick: (e) => {
143
- const r = e.currentTarget.getBoundingClientRect();
144
- api.openMenu(r.left, r.bottom, path);
145
+ api.openMenu(e.currentTarget, path);
145
146
  },
146
147
  children: /* @__PURE__ */ jsx(MdDragHandle, { className: "h-3.5 w-3.5" })
147
148
  }),
148
- /* @__PURE__ */ jsx("span", {
149
- "data-tooltip-id": TOOLTIP_ID,
150
- "data-tooltip-content": name,
151
- children: /* @__PURE__ */ jsx(TypeBadge, { type: text(definition["type"]) })
149
+ /* @__PURE__ */ jsx(Tooltip, {
150
+ content: name,
151
+ children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(TypeBadge, { type: text(definition["type"]) }) })
152
152
  }),
153
153
  (definition["type"] === "group" || definition["type"] === "list") && /* @__PURE__ */ jsx(PageActions, {
154
154
  api,
@@ -163,8 +163,7 @@ function InputRow({ path, hidden = false, instance, children }) {
163
163
  /* @__PURE__ */ jsx(ChromeButton, {
164
164
  label: t.addInputBelow,
165
165
  onClick: (e) => {
166
- const r = e.currentTarget.getBoundingClientRect();
167
- api.openTypeMenu(r.right, r.bottom, parent, index + 1);
166
+ api.openTypeMenu(e.currentTarget, parent, index + 1);
168
167
  },
169
168
  children: /* @__PURE__ */ jsx(FaPlus, { className: "h-3 w-3" })
170
169
  }),
@@ -176,8 +175,7 @@ function InputRow({ path, hidden = false, instance, children }) {
176
175
  /* @__PURE__ */ jsx(ChromeButton, {
177
176
  label: t.inputActions,
178
177
  onClick: (e) => {
179
- const r = e.currentTarget.getBoundingClientRect();
180
- api.openMenu(r.right, r.bottom, path);
178
+ api.openMenu(e.currentTarget, path);
181
179
  },
182
180
  children: /* @__PURE__ */ jsx(BsThreeDots, { className: "h-3 w-3" })
183
181
  })
@@ -189,7 +187,7 @@ function InputRow({ path, hidden = false, instance, children }) {
189
187
  "data-input-index": index,
190
188
  ...hidden ? { "data-input-hidden": "" } : {},
191
189
  ...selected ? { "data-selected": "" } : {},
192
- className: cx("relative w-full", hidden && "mb-[15px]", found.length > 0 && "rounded-md ring-2 ring-(--theme-error)", selected && "isolate before:pointer-events-none before:absolute before:-inset-x-2 before:-inset-y-1 before:-z-10 before:rounded-lg before:bg-(--theme-element)/15 before:ring-2 before:ring-(--theme-element) before:content-['']"),
190
+ className: clsx("relative w-full", hidden && "mb-[15px]", found.length > 0 && "rounded-md ring-2 ring-(--theme-error)", selected && "isolate before:pointer-events-none before:absolute before:-inset-x-2 before:-inset-y-1 before:-z-10 before:rounded-lg before:bg-(--theme-element)/15 before:ring-2 before:ring-(--theme-element) before:content-['']"),
193
191
  onPointerOver: (e) => {
194
192
  e.stopPropagation();
195
193
  api.hover(copy);
@@ -197,7 +195,7 @@ function InputRow({ path, hidden = false, instance, children }) {
197
195
  onContextMenu: (e) => {
198
196
  e.preventDefault();
199
197
  e.stopPropagation();
200
- api.openMenu(e.clientX, e.clientY, path);
198
+ api.openMenu(e, path);
201
199
  },
202
200
  children: [
203
201
  hidden ? /* @__PURE__ */ jsxs("div", {
@@ -218,22 +216,23 @@ function InputRow({ path, hidden = false, instance, children }) {
218
216
  })
219
217
  ]
220
218
  }) : /* @__PURE__ */ jsx("div", {
221
- className: cx("flex justify-end overflow-hidden transition-[height] duration-150 focus-within:h-7", active ? "h-7" : "h-0"),
219
+ className: clsx("flex justify-end overflow-hidden transition-[height] duration-150 focus-within:h-7", active ? "h-7" : "h-0"),
222
220
  children: /* @__PURE__ */ jsx("div", {
223
221
  "data-input-chrome": true,
224
222
  className: "flex h-6 items-center gap-0.5 rounded-md border theme-border bg-(--theme-panel-bg) px-1 py-0.5 text-[11px] leading-4 theme-muted-text shadow-sm",
225
223
  children: actions
226
224
  })
227
225
  }),
228
- found.length > 0 && /* @__PURE__ */ jsx("button", {
229
- type: "button",
230
- "data-input-chrome": true,
231
- "aria-label": g.problemCount(found.length),
232
- "data-tooltip-id": "global-tooltip",
233
- "data-tooltip-content": found.map((problem) => problem.slice(problem.indexOf("\n") + 1)).join("\n"),
234
- className: "absolute -left-2 -top-2 z-10 flex h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-(--theme-panel-bg) text-(--theme-error) shadow-sm",
235
- onClick: () => api.reveal(Number.parseInt(found[0] ?? "0", 10)),
236
- children: /* @__PURE__ */ jsx(TbAlertTriangle, { className: "h-3.5 w-3.5" })
226
+ found.length > 0 && /* @__PURE__ */ jsx(Tooltip, {
227
+ content: found.map((problem) => problem.slice(problem.indexOf("\n") + 1)).join("\n"),
228
+ children: /* @__PURE__ */ jsx("button", {
229
+ type: "button",
230
+ "data-input-chrome": true,
231
+ "aria-label": g.problemCount(found.length),
232
+ className: "absolute -left-2 -top-2 z-10 flex h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-(--theme-panel-bg) text-(--theme-error) shadow-sm",
233
+ onClick: () => api.reveal(Number.parseInt(found[0] ?? "0", 10)),
234
+ children: /* @__PURE__ */ jsx(TbAlertTriangle, { className: "h-3.5 w-3.5" })
235
+ })
237
236
  }),
238
237
  children,
239
238
  outline && /* @__PURE__ */ jsxs("div", {
@@ -263,7 +262,7 @@ function PageActions({ api, parent, list, bar = false }) {
263
262
  onClick: () => api.splitIntoPages(parent),
264
263
  children: /* @__PURE__ */ jsx(BsFiles, { className: "h-3 w-3" })
265
264
  });
266
- return bar ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(AddChip, {
265
+ return bar ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(AddChip, {
267
266
  icon: /* @__PURE__ */ jsx(FaPlus, { className: "h-3 w-3" }),
268
267
  label: t.page,
269
268
  hint: t.addPage,
@@ -274,7 +273,7 @@ function PageActions({ api, parent, list, bar = false }) {
274
273
  size: "sm",
275
274
  variant: "ghost",
276
275
  onClick: () => api.unsplitPages(parent)
277
- })] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ChromeButton, {
276
+ })] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ChromeButton, {
278
277
  label: t.addPage,
279
278
  onClick: () => api.addPage(parent),
280
279
  children: /* @__PURE__ */ jsx(GoPlus, { className: "h-3 w-3" })
@@ -328,10 +327,9 @@ function AddInput({ parent }) {
328
327
  return /* @__PURE__ */ jsxs("button", {
329
328
  type: "button",
330
329
  "data-input-add": key(parent),
331
- className: cx("mb-[15px] flex cursor-pointer items-center gap-1.5 text-[13px] theme-muted-text hover:text-(--theme-link)", ADD_INDENT[Math.min(parent.length, ADD_INDENT.length - 1)]),
330
+ className: clsx("mb-[15px] flex cursor-pointer items-center gap-1.5 text-[13px] theme-muted-text hover:text-(--theme-link)", ADD_INDENT[Math.min(parent.length, ADD_INDENT.length - 1)]),
332
331
  onClick: (e) => {
333
- const r = e.currentTarget.getBoundingClientRect();
334
- api.openTypeMenu(r.left, r.bottom, parent, Number.MAX_SAFE_INTEGER);
332
+ api.openTypeMenu(e.currentTarget, parent, Number.MAX_SAFE_INTEGER);
335
333
  },
336
334
  children: [/* @__PURE__ */ jsx(FaPlus, { className: "h-3 w-3" }), parent.length === 0 ? t.addInputHere : t.addFieldTo(name)]
337
335
  });
@@ -350,13 +348,11 @@ function typeSearch(labels) {
350
348
  function typeMenu(labels, pick) {
351
349
  const types = labels.types;
352
350
  const item = (type) => ({
353
- kind: "action",
354
351
  label: types[type] ?? type,
355
352
  keywords: type,
356
- onSelect: () => pick(type)
353
+ onClick: () => pick(type)
357
354
  });
358
355
  return [...INPUT_TYPE_GROUPS.map(([group, list]) => ({
359
- kind: "submenu",
360
356
  label: labels.typeGroups[group],
361
357
  items: list.map(item)
362
358
  }))];
@@ -754,7 +750,7 @@ function InputsFormEditor({ editor, inputs, children }) {
754
750
  editor,
755
751
  inputs
756
752
  };
757
- const rowMenu = useRowMenu();
753
+ const rowMenu = useContextMenu();
758
754
  const openMenu = useMemo(() => returningFocus(rowMenu.openMenu, () => containerRef.current), [rowMenu.openMenu]);
759
755
  const contextMenu = rowMenu.contextMenu;
760
756
  useFocusAfterDialog(store, () => containerRef.current);
@@ -827,7 +823,7 @@ function InputsFormEditor({ editor, inputs, children }) {
827
823
  }));
828
824
  };
829
825
  const unsplitPages = (parent) => sendAll(unsplitPagesEdits(listAt(parent), parent, childKeyAt(parent)));
830
- const openTypeMenu = (x, y, parent, index, placement) => openMenu(x, y, typeMenu(t, (type) => create(parent, index, type, placement)), void 0, typeSearch(t));
826
+ const openTypeMenu = (at, parent, index, placement) => openMenu(at, typeMenu(t, (type) => create(parent, index, type, placement)), { search: typeSearch(t) });
831
827
  const edit = (path) => store.set({ dialog: {
832
828
  kind: "edit",
833
829
  path
@@ -914,7 +910,10 @@ function InputsFormEditor({ editor, inputs, children }) {
914
910
  }
915
911
  if (!gap) return;
916
912
  if (!paths) {
917
- openTypeMenu(client.x, client.y, gap.parent, gap.index, placementOf(gap));
913
+ openTypeMenu({
914
+ clientX: client.x,
915
+ clientY: client.y
916
+ }, gap.parent, gap.index, placementOf(gap));
918
917
  return;
919
918
  }
920
919
  containerRef.current?.focus({ preventScroll: true });
@@ -964,33 +963,29 @@ function InputsFormEditor({ editor, inputs, children }) {
964
963
  const count = namesIn(containerAt(editing, latest.current.inputs, parent)).length;
965
964
  return [
966
965
  {
967
- kind: "action",
968
966
  label: t.editInput,
969
967
  icon: /* @__PURE__ */ jsx(FaEdit, {}),
970
- onSelect: () => edit(path)
968
+ onClick: () => edit(path)
971
969
  },
972
970
  {
973
- kind: "submenu",
974
971
  label: t.addInputBelow,
975
972
  icon: /* @__PURE__ */ jsx(FaPlus, {}),
976
973
  items: typeMenu(t, (type) => create(parent, index + 1, type)),
977
974
  search: typeSearch(t)
978
975
  },
979
976
  {
980
- kind: "action",
981
977
  label: t.duplicate,
982
978
  icon: /* @__PURE__ */ jsx(HiDuplicate, {}),
983
- onSelect: () => send({
979
+ onClick: () => send({
984
980
  type: "duplicateInput",
985
981
  path
986
982
  })
987
983
  },
988
984
  {
989
- kind: "action",
990
985
  label: t.moveUp,
991
986
  icon: /* @__PURE__ */ jsx(FaArrowUp, {}),
992
987
  disabled: index <= 0,
993
- onSelect: () => send({
988
+ onClick: () => send({
994
989
  type: "moveInputs",
995
990
  paths: [path],
996
991
  parent,
@@ -998,24 +993,22 @@ function InputsFormEditor({ editor, inputs, children }) {
998
993
  })
999
994
  },
1000
995
  {
1001
- kind: "action",
1002
996
  label: t.moveDown,
1003
997
  icon: /* @__PURE__ */ jsx(FaArrowDown, {}),
1004
998
  disabled: index >= count - 1,
1005
- onSelect: () => send({
999
+ onClick: () => send({
1006
1000
  type: "moveInputs",
1007
1001
  paths: [path],
1008
1002
  parent,
1009
1003
  index: index + 2
1010
1004
  })
1011
1005
  },
1012
- { kind: "divider" },
1006
+ menuDivider,
1013
1007
  {
1014
- kind: "action",
1015
1008
  label: t.deleteInput,
1016
1009
  icon: /* @__PURE__ */ jsx(BiSolidTrashAlt, {}),
1017
1010
  destructive: true,
1018
- onSelect: () => remove(path)
1011
+ onClick: () => remove(path)
1019
1012
  }
1020
1013
  ];
1021
1014
  };
@@ -1090,7 +1083,7 @@ function InputsFormEditor({ editor, inputs, children }) {
1090
1083
  definition,
1091
1084
  edit,
1092
1085
  remove,
1093
- openMenu: (x, y, path) => openMenu(x, y, menuFor(path)),
1086
+ openMenu: (at, path) => openMenu(at, menuFor(path)),
1094
1087
  openTypeMenu,
1095
1088
  startDrag,
1096
1089
  startResize,
@@ -1343,11 +1336,10 @@ function InputsFormEditor({ editor, inputs, children }) {
1343
1336
  hint: t.addInputHint,
1344
1337
  onPointerDown: (e) => api.startDrag(e, null, t.addInput),
1345
1338
  onClick: (e) => {
1346
- const r = e.currentTarget.getBoundingClientRect();
1347
1339
  const form = isWizard(inputs) ? pagesIn(inputs) : [];
1348
1340
  const last = form.at(-1);
1349
1341
  if (last) wizardPages.setPage("[]", (wizardPages.count("[]") ?? form.length) - 1);
1350
- api.openTypeMenu(r.left, r.bottom, last ? [last] : [], Number.MAX_SAFE_INTEGER);
1342
+ api.openTypeMenu(e.currentTarget, last ? [last] : [], Number.MAX_SAFE_INTEGER);
1351
1343
  }
1352
1344
  }),
1353
1345
  /* @__PURE__ */ jsx(PageActions, {
@@ -1383,7 +1375,7 @@ function DropIndicator({ store, container }) {
1383
1375
  const root = container.current;
1384
1376
  if (!drag || !root) return null;
1385
1377
  const rect = root.getBoundingClientRect();
1386
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [drag.gap?.beside ? /* @__PURE__ */ jsx("div", {
1378
+ return /* @__PURE__ */ jsxs(Fragment, { children: [drag.gap?.beside ? /* @__PURE__ */ jsx("div", {
1387
1379
  className: "pointer-events-none absolute z-20 w-1 rounded-full bg-(--theme-element)",
1388
1380
  style: {
1389
1381
  left: drag.gap.beside.x - rect.left - 2,
@@ -1,12 +1,12 @@
1
- import { useNavigation, useSlots, useStrings, useWorkflowEngine } from "../components/Provider.js";
2
1
  import { IoDocumentTextOutline } from "../icons/io5/IoDocumentTextOutline.js";
3
2
  import { PiArrowBendUpRightBold } from "../icons/pi/PiArrowBendUpRightBold.js";
4
- import { TOOLTIP_ID } from "../components/Tooltip.js";
3
+ import { Tooltip } from "../components/Tooltip.js";
4
+ import { useNavigation, useSlots, useStrings, useWorkflowEngine } from "../components/Provider.js";
5
5
  import { Indicator } from "../components/Indicator.js";
6
6
  import { jobLabel } from "./util.js";
7
7
  import { AddStepButton, EditableJobRow, EditableStepRow } from "./editorRows.js";
8
8
  import { Reveal } from "./Reveal.js";
9
- import cx from "classnames";
9
+ import { clsx } from "clsx";
10
10
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
11
  //#region src/graph/JobSummary.tsx
12
12
  function UsesIcon({ uses, subworkflow }) {
@@ -15,17 +15,18 @@ function UsesIcon({ uses, subworkflow }) {
15
15
  const { jobActions } = useStrings();
16
16
  if (!uses || !slots.workflowIcon) return null;
17
17
  const open = () => navigation.openStepSource(uses, subworkflow.sourceUrl);
18
- return /* @__PURE__ */ jsx("button", {
19
- type: "button",
20
- "aria-label": jobActions.openOriginalWorkflow,
21
- "data-tooltip-id": TOOLTIP_ID,
22
- "data-tooltip-content": jobActions.openOriginalWorkflow,
23
- onClick: open,
24
- className: "cursor-pointer",
25
- children: slots.workflowIcon({
26
- image: subworkflow.image,
27
- type: subworkflow.type,
28
- className: "ml-1.5 h-[1.2em] w-[1.2em]"
18
+ return /* @__PURE__ */ jsx(Tooltip, {
19
+ content: jobActions.openOriginalWorkflow,
20
+ children: /* @__PURE__ */ jsx("button", {
21
+ type: "button",
22
+ "aria-label": jobActions.openOriginalWorkflow,
23
+ onClick: open,
24
+ className: "cursor-pointer",
25
+ children: slots.workflowIcon({
26
+ image: subworkflow.image,
27
+ type: subworkflow.type,
28
+ className: "ml-1.5 h-[1.2em] w-[1.2em]"
29
+ })
29
30
  })
30
31
  });
31
32
  }
@@ -41,7 +42,7 @@ function Joblist(inputs) {
41
42
  type: "button",
42
43
  "aria-expanded": inputs.isStepsOpen(jobName),
43
44
  onClick: () => inputs.onJobClick(jobName),
44
- className: cx("flex items-center gap-x-1.5 w-full text-left", jobStatus === "skipped" || jobStatus === "skipped-failed" ? "cursor-default" : "cursor-pointer"),
45
+ className: clsx("flex items-center gap-x-1.5 w-full text-left", jobStatus === "skipped" || jobStatus === "skipped-failed" ? "cursor-default" : "cursor-pointer"),
45
46
  children: [!inputs.preview && /* @__PURE__ */ jsx(Indicator, { status: jobStatus }), /* @__PURE__ */ jsx("div", {
46
47
  className: "font-medium",
47
48
  children: label
@@ -66,45 +67,47 @@ function Joblist(inputs) {
66
67
  const stepButton = /* @__PURE__ */ jsxs("button", {
67
68
  type: "button",
68
69
  onClick: () => inputs.onStepClick(jobName, i),
69
- className: cx(inputs.preview ? "ml-1.5" : "ml-4", "gap-x-1.5 flex items-center text-left"),
70
+ className: clsx(inputs.preview ? "ml-1.5" : "ml-4", "gap-x-1.5 flex items-center text-left"),
70
71
  "data-testid": stepLabel,
71
72
  children: [inputs.preview ? "↳" : /* @__PURE__ */ jsx(Indicator, { status: step.status }), /* @__PURE__ */ jsx("div", { children: stepLabel })]
72
73
  });
73
74
  return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs("div", {
74
- className: cx("flex items-center", step.status === "skipped" || step.status === "skipped-failed" ? "cursor-default" : "cursor-pointer"),
75
+ className: clsx("flex items-center", step.status === "skipped" || step.status === "skipped-failed" ? "cursor-default" : "cursor-pointer"),
75
76
  children: [(inputs.editable || inputs.editableSteps) && !step.linkedStep ? /* @__PURE__ */ jsx(EditableStepRow, {
76
77
  job: job?._matrix?.originaljob ?? jobName,
77
78
  index: i,
78
79
  label: stepLabel,
79
80
  children: stepButton
80
81
  }) : stepButton, step.subworkflow && /* @__PURE__ */ jsxs(Fragment, { children: [
81
- /* @__PURE__ */ jsx("button", {
82
- type: "button",
83
- "aria-label": jobActions.openSubworkflowLogs,
84
- "data-tooltip-id": "global-tooltip",
85
- "data-tooltip-content": jobActions.openSubworkflowLogs,
86
- onClick: (e) => {
87
- e.stopPropagation();
88
- inputs.onStepLogClick(jobName, i);
89
- },
90
- className: "link ml-1",
91
- children: /* @__PURE__ */ jsx(IoDocumentTextOutline, { className: "w-[1.2em] h-[1.2em]" })
82
+ /* @__PURE__ */ jsx(Tooltip, {
83
+ content: jobActions.openSubworkflowLogs,
84
+ children: /* @__PURE__ */ jsx("button", {
85
+ type: "button",
86
+ "aria-label": jobActions.openSubworkflowLogs,
87
+ onClick: (e) => {
88
+ e.stopPropagation();
89
+ inputs.onStepLogClick(jobName, i);
90
+ },
91
+ className: "link ml-1",
92
+ children: /* @__PURE__ */ jsx(IoDocumentTextOutline, { className: "w-[1.2em] h-[1.2em]" })
93
+ })
92
94
  }),
93
95
  /* @__PURE__ */ jsx(UsesIcon, {
94
96
  uses: step.uses,
95
97
  subworkflow: step.subworkflow
96
98
  }),
97
- /* @__PURE__ */ jsx("button", {
98
- type: "button",
99
- "aria-label": jobActions.openInNewGraph,
100
- "data-tooltip-id": "global-tooltip",
101
- "data-tooltip-content": jobActions.openInNewGraph,
102
- onClick: (e) => {
103
- e.stopPropagation();
104
- inputs.onSubworkflowIcon(jobName, i);
105
- },
106
- className: "link ml-1",
107
- children: /* @__PURE__ */ jsx(PiArrowBendUpRightBold, { className: "w-[1.2em] h-[1.2em]" })
99
+ /* @__PURE__ */ jsx(Tooltip, {
100
+ content: jobActions.openInNewGraph,
101
+ children: /* @__PURE__ */ jsx("button", {
102
+ type: "button",
103
+ "aria-label": jobActions.openInNewGraph,
104
+ onClick: (e) => {
105
+ e.stopPropagation();
106
+ inputs.onSubworkflowIcon(jobName, i);
107
+ },
108
+ className: "link ml-1",
109
+ children: /* @__PURE__ */ jsx(PiArrowBendUpRightBold, { className: "w-[1.2em] h-[1.2em]" })
110
+ })
108
111
  })
109
112
  ] })]
110
113
  }), canExpand && inputs.renderSubworkflow(jobName, i)] }, stepKey);
@@ -4,8 +4,8 @@ import { EditableJobRow } from "./editorRows.js";
4
4
  import { Reveal } from "./Reveal.js";
5
5
  import { Joblist } from "./JobSummary.js";
6
6
  import { GraphNode } from "./GraphNode.js";
7
- import { memo } from "react";
8
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
+ import { memo } from "react";
9
9
  //#region src/graph/MatrixGroup.tsx
10
10
  /** Matrix group item in the summary sidebar. */
11
11
  function MatrixGroupSummaryItem({ matrixGroup, status, isExpanded, onToggle, jobs, handlers, preview }) {
@@ -1,32 +1,31 @@
1
1
  import { TbAlertTriangle } from "../icons/tb/TbAlertTriangle.js";
2
2
  import { keyedByContent } from "../components/keys.js";
3
- import { TOOLTIP_ID } from "../components/Tooltip.js";
3
+ import { Tooltip } from "../components/Tooltip.js";
4
4
  import { useGraphEditorStrings } from "./editorStrings.js";
5
5
  import { ToolbarPopover } from "./ToolbarPopover.js";
6
- import { useRef, useState } from "react";
7
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
6
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import { useState } from "react";
8
8
  //#region src/graph/ProblemsButton.tsx
9
9
  /** A toolbar's count of the problems it lists, which opens the list. */
10
10
  function ProblemsButton({ problems }) {
11
11
  const t = useGraphEditorStrings();
12
12
  const [open, setOpen] = useState(false);
13
- const button = useRef(null);
14
13
  if (problems.length === 0) return null;
15
14
  const label = t.problemCount(problems.length);
16
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("button", {
17
- ref: button,
18
- type: "button",
19
- "aria-label": label,
20
- "aria-expanded": open,
21
- ...open ? {} : { "data-tooltip-id": TOOLTIP_ID },
22
- "data-tooltip-content": label,
23
- className: "flex h-7 cursor-pointer items-center gap-1 rounded px-2 text-xs font-medium text-(--theme-error) theme-hover",
24
- onClick: () => setOpen((current) => !current),
25
- children: [/* @__PURE__ */ jsx(TbAlertTriangle, { className: "h-3.5 w-3.5" }), problems.length]
26
- }), open && /* @__PURE__ */ jsxs(ToolbarPopover, {
27
- anchor: button,
15
+ return /* @__PURE__ */ jsxs(ToolbarPopover, {
28
16
  label,
29
- onClose: () => setOpen(false),
17
+ open,
18
+ onOpenChange: setOpen,
19
+ trigger: /* @__PURE__ */ jsx(Tooltip, {
20
+ content: label,
21
+ disabled: open,
22
+ children: /* @__PURE__ */ jsxs("button", {
23
+ type: "button",
24
+ "aria-label": label,
25
+ className: "flex h-7 cursor-pointer items-center gap-1 rounded px-2 text-xs font-medium text-(--theme-error) theme-hover",
26
+ children: [/* @__PURE__ */ jsx(TbAlertTriangle, { className: "h-3.5 w-3.5" }), problems.length]
27
+ })
28
+ }),
30
29
  children: [/* @__PURE__ */ jsx("div", {
31
30
  className: "mb-2 text-[0.8125rem] font-semibold",
32
31
  children: label
@@ -34,7 +33,7 @@ function ProblemsButton({ problems }) {
34
33
  className: "flex flex-col gap-0.5",
35
34
  children: keyedByContent(problems, (problem) => `${problem.line}:${problem.message}`).map(({ key, item: problem }) => {
36
35
  const { pick } = problem;
37
- const text = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
36
+ const text = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
38
37
  className: "mr-1.5 theme-muted-text",
39
38
  children: t.problemLine(problem.line)
40
39
  }), /* @__PURE__ */ jsx("span", {
@@ -55,7 +54,7 @@ function ProblemsButton({ problems }) {
55
54
  }) }, key);
56
55
  })
57
56
  })]
58
- })] });
57
+ });
59
58
  }
60
59
  //#endregion
61
60
  export { ProblemsButton };
@@ -1,5 +1,5 @@
1
- import { useLayoutEffect, useRef, useState } from "react";
2
1
  import { jsx } from "react/jsx-runtime";
2
+ import { useLayoutEffect, useRef, useState } from "react";
3
3
  //#region src/graph/Reveal.tsx
4
4
  var EASE = "cubic-bezier(0.25, 0.1, 0.25, 1)";
5
5
  var ROWS_TRANSITION = `grid-template-rows 200ms ${EASE}`;
@@ -2,8 +2,8 @@ import { LuKeyboard } from "../icons/lu/LuKeyboard.js";
2
2
  import { IconButton } from "../components/IconButton.js";
3
3
  import { useGraphEditorStrings } from "./editorStrings.js";
4
4
  import { ToolbarPopover } from "./ToolbarPopover.js";
5
- import { Fragment, useRef, useState } from "react";
6
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { Fragment as Fragment$1, useState } from "react";
7
7
  //#region src/graph/ShortcutsButton.tsx
8
8
  var MOD_KEY = typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform) ? "⌘" : "Ctrl";
9
9
  var ALT_KEY = typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform) ? "⌥" : "Alt";
@@ -11,20 +11,17 @@ var ALT_KEY = typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigat
11
11
  function ShortcutsButton({ groups }) {
12
12
  const t = useGraphEditorStrings();
13
13
  const [open, setOpen] = useState(false);
14
- const button = useRef(null);
15
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(IconButton, {
16
- ref: button,
17
- icon: /* @__PURE__ */ jsx(LuKeyboard, { className: "h-4 w-4" }),
14
+ return /* @__PURE__ */ jsxs(ToolbarPopover, {
18
15
  label: t.shortcuts,
19
- size: "sm",
20
- variant: "ghost",
21
- "aria-expanded": open,
22
- showTooltip: !open,
23
- onClick: () => setOpen((current) => !current)
24
- }), open && /* @__PURE__ */ jsxs(ToolbarPopover, {
25
- anchor: button,
26
- label: t.shortcuts,
27
- onClose: () => setOpen(false),
16
+ open,
17
+ onOpenChange: setOpen,
18
+ trigger: /* @__PURE__ */ jsx(IconButton, {
19
+ icon: /* @__PURE__ */ jsx(LuKeyboard, { className: "h-4 w-4" }),
20
+ label: t.shortcuts,
21
+ size: "sm",
22
+ variant: "ghost",
23
+ showTooltip: !open
24
+ }),
28
25
  children: [/* @__PURE__ */ jsx("div", {
29
26
  className: "text-[0.8125rem] font-semibold",
30
27
  children: t.shortcuts
@@ -35,9 +32,9 @@ function ShortcutsButton({ groups }) {
35
32
  children: group.title
36
33
  }), /* @__PURE__ */ jsx("dl", {
37
34
  className: "grid grid-cols-[8.5rem_1fr] items-baseline gap-x-3 gap-y-1.5",
38
- children: group.shortcuts.map((shortcut) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
35
+ children: group.shortcuts.map((shortcut) => /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("dt", {
39
36
  className: "flex flex-wrap items-center gap-1",
40
- children: shortcut.combos.map((keys, i) => /* @__PURE__ */ jsxs(Fragment, { children: [i > 0 && /* @__PURE__ */ jsx("span", {
37
+ children: shortcut.combos.map((keys, i) => /* @__PURE__ */ jsxs(Fragment$1, { children: [i > 0 && /* @__PURE__ */ jsx("span", {
41
38
  className: "theme-muted-text",
42
39
  children: "/"
43
40
  }), keys.map((key) => /* @__PURE__ */ jsx("kbd", {
@@ -50,7 +47,7 @@ function ShortcutsButton({ groups }) {
50
47
  })] }, shortcut.does))
51
48
  })]
52
49
  }, group.title))]
53
- })] });
50
+ });
54
51
  }
55
52
  //#endregion
56
53
  export { ALT_KEY, MOD_KEY, ShortcutsButton };
@@ -1,18 +1,13 @@
1
- import { type IProps as DropdownProps } from '../components/Dropdown.js';
2
- import type { IOptions } from '../components/dropdownUtils.js';
1
+ import { type AutocompleteProps, type ComboboxItem } from '../components/Combobox.js';
3
2
  /** A value a typed field offers, with what it means. */
4
3
  export interface Suggestion {
5
4
  value: string;
6
5
  label?: string | undefined;
7
6
  }
8
- export declare function suggestionOptions(suggestions: Suggestion[]): (IOptions | string)[];
7
+ /** A labelled suggestion shows its meaning, with the value it writes beneath. */
8
+ export declare function suggestionItems(suggestions: Suggestion[]): ComboboxItem[];
9
9
  export declare const FIELD_TEXT_BOX = "py-3 pl-4 rounded-lg text-sm !bg-[var(--theme-muted-panel-bg)]";
10
- /**
11
- * The dropdown for a field that takes any typed value as well as the ones it offers. Any of
12
- * the dropdown's own props can still be passed, such as `allowCustomValue={false}`.
13
- */
14
- export declare function SuggestionInput({ value, onChange, suggestions, allowCustomValue, ...props }: Omit<DropdownProps, 'options' | 'value' | 'onChange'> & {
15
- value: string;
16
- onChange: (value: string) => void;
10
+ /** A field that takes any typed value, offering `suggestions` as it's typed. */
11
+ export declare function SuggestionInput({ suggestions, ...props }: Omit<AutocompleteProps, 'items' | 'className' | 'defaultValue'> & {
17
12
  suggestions: Suggestion[];
18
13
  }): import("react").JSX.Element;