@parallelworks/ui 0.18.0 → 0.19.1

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 (349) hide show
  1. package/README.md +86 -6
  2. package/dist/ai/adapter/memoryStore.d.ts +8 -0
  3. package/dist/ai/adapter/memoryStore.js +152 -0
  4. package/dist/ai/adapter/mock/index.d.ts +2 -0
  5. package/dist/ai/adapter/mock/index.js +3 -0
  6. package/dist/ai/adapter/mock/mockAdapter.d.ts +4 -0
  7. package/dist/ai/adapter/mock/mockAdapter.js +81 -0
  8. package/dist/ai/adapter/openai/createOpenAIStream.d.ts +9 -0
  9. package/dist/ai/adapter/openai/createOpenAIStream.js +33 -0
  10. package/dist/ai/adapter/openai/errors.d.ts +3 -0
  11. package/dist/ai/adapter/openai/errors.js +37 -0
  12. package/dist/ai/adapter/openai/index.d.ts +6 -0
  13. package/dist/ai/adapter/openai/index.js +6 -0
  14. package/dist/ai/adapter/openai/openaiAdapter.d.ts +9 -0
  15. package/dist/ai/adapter/openai/openaiAdapter.js +54 -0
  16. package/dist/ai/adapter/openai/responses.d.ts +4 -0
  17. package/dist/ai/adapter/openai/responses.js +108 -0
  18. package/dist/ai/adapter/openai/sse.d.ts +24 -0
  19. package/dist/ai/adapter/openai/sse.js +112 -0
  20. package/dist/ai/adapter/openai/wire.d.ts +40 -0
  21. package/dist/ai/adapter/types.d.ts +131 -0
  22. package/dist/ai/adapter/types.js +11 -0
  23. package/dist/ai/agent/classifier.d.ts +2 -0
  24. package/dist/ai/agent/classifier.js +12 -0
  25. package/dist/ai/agent/diff.d.ts +35 -0
  26. package/dist/ai/agent/diff.js +223 -0
  27. package/dist/ai/agent/diffHighlight.d.ts +6 -0
  28. package/dist/ai/agent/diffHighlight.js +101 -0
  29. package/dist/ai/agent/index.d.ts +6 -0
  30. package/dist/ai/agent/permissions.d.ts +11 -0
  31. package/dist/ai/agent/permissions.js +29 -0
  32. package/dist/ai/agent/toolfmt.d.ts +18 -0
  33. package/dist/ai/agent/toolfmt.js +383 -0
  34. package/dist/ai/agent/transcript.d.ts +38 -0
  35. package/dist/ai/agent/transcript.js +127 -0
  36. package/dist/ai/ai.css +325 -0
  37. package/dist/ai/components/AllocationSelector.d.ts +4 -0
  38. package/dist/ai/components/AllocationSelector.js +56 -0
  39. package/dist/ai/components/AttachmentManager.d.ts +1 -0
  40. package/dist/ai/components/AttachmentManager.js +144 -0
  41. package/dist/ai/components/AttachmentUpload.d.ts +24 -0
  42. package/dist/ai/components/AttachmentUpload.js +179 -0
  43. package/dist/ai/components/BlockedGroupBanner.d.ts +1 -0
  44. package/dist/ai/components/BlockedGroupBanner.js +29 -0
  45. package/dist/ai/components/BranchNavigator.d.ts +8 -0
  46. package/dist/ai/components/BranchNavigator.js +57 -0
  47. package/dist/ai/components/ChatEmptyState.d.ts +3 -0
  48. package/dist/ai/components/ChatEmptyState.js +171 -0
  49. package/dist/ai/components/ChatInput.d.ts +45 -0
  50. package/dist/ai/components/ChatInput.js +265 -0
  51. package/dist/ai/components/ChatLayout.d.ts +5 -0
  52. package/dist/ai/components/ChatLayout.js +15 -0
  53. package/dist/ai/components/ChatMessage.d.ts +24 -0
  54. package/dist/ai/components/ChatMessage.js +338 -0
  55. package/dist/ai/components/ChatMessageList.d.ts +35 -0
  56. package/dist/ai/components/ChatMessageList.js +301 -0
  57. package/dist/ai/components/ChatSidebar.d.ts +5 -0
  58. package/dist/ai/components/ChatSidebar.js +345 -0
  59. package/dist/ai/components/ChatThread.d.ts +3 -0
  60. package/dist/ai/components/ChatThread.js +198 -0
  61. package/dist/ai/components/ComposerChrome.d.ts +18 -0
  62. package/dist/ai/components/ComposerChrome.js +50 -0
  63. package/dist/ai/components/ComposerFrame.d.ts +16 -0
  64. package/dist/ai/components/ComposerFrame.js +33 -0
  65. package/dist/ai/components/DragOverlay.d.ts +5 -0
  66. package/dist/ai/components/DragOverlay.js +20 -0
  67. package/dist/ai/components/ModelSelector.d.ts +6 -0
  68. package/dist/ai/components/ModelSelector.js +343 -0
  69. package/dist/ai/components/ShareDialog.d.ts +11 -0
  70. package/dist/ai/components/ShareDialog.js +260 -0
  71. package/dist/ai/components/SlashMenu.d.ts +28 -0
  72. package/dist/ai/components/SlashMenu.js +91 -0
  73. package/dist/ai/components/agent/ActivityLine.d.ts +21 -0
  74. package/dist/ai/components/agent/ActivityLine.js +151 -0
  75. package/dist/ai/components/agent/AgentMessageParts.d.ts +54 -0
  76. package/dist/ai/components/agent/AgentMessageParts.js +721 -0
  77. package/dist/ai/components/agent/PermissionPicker.d.ts +11 -0
  78. package/dist/ai/components/agent/PermissionPicker.js +38 -0
  79. package/dist/ai/components/attachmentKeys.d.ts +4 -0
  80. package/dist/ai/components/attachmentKeys.js +10 -0
  81. package/dist/ai/core/ChatProvider.d.ts +66 -0
  82. package/dist/ai/core/ChatProvider.js +848 -0
  83. package/dist/ai/core/KeyboardShortcutsProvider.d.ts +5 -0
  84. package/dist/ai/core/KeyboardShortcutsProvider.js +9 -0
  85. package/dist/ai/core/chatReducer.d.ts +114 -0
  86. package/dist/ai/core/chatReducer.js +223 -0
  87. package/dist/ai/core/config.d.ts +47 -0
  88. package/dist/ai/core/config.js +45 -0
  89. package/dist/ai/core/events.d.ts +1 -0
  90. package/dist/ai/core/events.js +4 -0
  91. package/dist/ai/core/exportConversation.d.ts +4 -0
  92. package/dist/ai/core/exportConversation.js +42 -0
  93. package/dist/ai/core/greeting.d.ts +3 -0
  94. package/dist/ai/core/greeting.js +38 -0
  95. package/dist/ai/core/parts.d.ts +11 -0
  96. package/dist/ai/core/parts.js +84 -0
  97. package/dist/ai/core/useDragDrop.d.ts +14 -0
  98. package/dist/ai/core/useDragDrop.js +36 -0
  99. package/dist/ai/core/useKeyboardShortcuts.d.ts +12 -0
  100. package/dist/ai/core/useKeyboardShortcuts.js +77 -0
  101. package/dist/ai/core/useSSEStream.d.ts +34 -0
  102. package/dist/ai/core/useSSEStream.js +98 -0
  103. package/dist/ai/index.d.ts +40 -0
  104. package/dist/ai/index.js +44 -0
  105. package/dist/ai/strings.d.ts +167 -0
  106. package/dist/ai/strings.js +175 -0
  107. package/dist/ai/types.d.ts +236 -0
  108. package/dist/ai/ui/Avatar.d.ts +8 -0
  109. package/dist/ai/ui/Avatar.js +35 -0
  110. package/dist/ai/ui/Dropdown.d.ts +31 -0
  111. package/dist/ai/ui/Dropdown.js +110 -0
  112. package/dist/ai/ui/Markdown.d.ts +8 -0
  113. package/dist/ai/ui/Markdown.js +79 -0
  114. package/dist/ai/ui/Notice.d.ts +21 -0
  115. package/dist/ai/ui/Notice.js +77 -0
  116. package/dist/ai/ui/buttons.d.ts +1 -0
  117. package/dist/ai/ui/codeBreaks.d.ts +16 -0
  118. package/dist/ai/ui/codeBreaks.js +36 -0
  119. package/dist/ai/ui/prose.d.ts +1 -0
  120. package/dist/ai/ui/prose.js +13 -0
  121. package/dist/ai/ui/sidebar.d.ts +81 -0
  122. package/dist/ai/ui/sidebar.js +148 -0
  123. package/dist/ai/utils.d.ts +4 -0
  124. package/dist/ai/utils.js +23 -0
  125. package/dist/assets/{editor.worker-CuBRIwi-.js → editor.worker-BmHUIVG4.js} +194 -163
  126. package/dist/assets/{json.worker-8ytS02vz.js → json.worker-D8bJ92nw.js} +384 -338
  127. package/dist/assets/{yaml.worker-DJC-VUcv.js → yaml.worker-C4gyGAko.js} +15657 -13823
  128. package/dist/components/AddMenu.js +46 -0
  129. package/dist/components/Avatar.d.ts +1 -1
  130. package/dist/components/Avatar.js +46 -0
  131. package/dist/{chunks/BareModal-BtRiQezg.js → components/BareModal.js} +1 -1
  132. package/dist/components/Breadcrumbs.d.ts +1 -1
  133. package/dist/components/Breadcrumbs.js +83 -0
  134. package/dist/components/Button.js +83 -0
  135. package/dist/components/Callout.js +23 -0
  136. package/dist/components/Card.js +31 -0
  137. package/dist/components/CollapsiblePanel.js +77 -0
  138. package/dist/components/ConfirmModal.js +74 -0
  139. package/dist/components/CopyToClipboard.js +81 -0
  140. package/dist/{chunks/CreateModal-BY6DLmur.js → components/CreateModal.js} +10 -189
  141. package/dist/components/DescriptionList.js +42 -0
  142. package/dist/components/Dropdown.d.ts +1 -1
  143. package/dist/components/Dropdown.js +349 -0
  144. package/dist/components/EmptyState.d.ts +1 -1
  145. package/dist/components/EmptyState.js +27 -0
  146. package/dist/components/Filter.js +32 -0
  147. package/dist/components/FilterPill.js +13 -0
  148. package/dist/components/IconButton.js +34 -0
  149. package/dist/components/Indicator.d.ts +2 -2
  150. package/dist/{chunks/Indicator-hBSIxOPK.js → components/Indicator.js} +1 -1
  151. package/dist/components/Input.d.ts +1 -1
  152. package/dist/components/Input.js +88 -0
  153. package/dist/components/LetterBadge.d.ts +1 -1
  154. package/dist/components/LetterBadge.js +13 -0
  155. package/dist/components/Listbox.js +123 -0
  156. package/dist/{chunks/Loader-BXoXTZGc.js → components/Loader.js} +1 -1
  157. package/dist/components/Markdown.js +15 -0
  158. package/dist/components/MarkdownImpl.d.ts +1 -1
  159. package/dist/components/MultiSelect.js +171 -0
  160. package/dist/components/Overview.js +39 -0
  161. package/dist/components/PageHeader.js +194 -0
  162. package/dist/components/Pagination.js +35 -0
  163. package/dist/components/Provider.d.ts +16 -65
  164. package/dist/{chunks/Provider-Ghua9PkN.js → components/Provider.js} +54 -20
  165. package/dist/{chunks/RequiredMark-DfLdYbYZ.js → components/RequiredMark.js} +1 -1
  166. package/dist/components/SectionHeader.js +11 -0
  167. package/dist/components/SettingModeOption.js +30 -0
  168. package/dist/components/SettingRow.d.ts +1 -1
  169. package/dist/components/SettingRow.js +35 -0
  170. package/dist/components/SettingsCard.js +31 -0
  171. package/dist/components/SettingsGroup.d.ts +1 -1
  172. package/dist/components/SettingsGroup.js +17 -0
  173. package/dist/components/Sort.js +42 -0
  174. package/dist/components/StatusBadge.js +63 -0
  175. package/dist/components/SwitchToggle.js +59 -0
  176. package/dist/{chunks/SwitchToggleSmall-FcsaYSTs.js → components/SwitchToggleSmall.js} +1 -1
  177. package/dist/{chunks/Table-4OHjdKdO.js → components/Table.js} +7 -5
  178. package/dist/components/Toggle.js +20 -0
  179. package/dist/{chunks/Tooltip-Crxo_eU_.js → components/Tooltip.js} +6 -4
  180. package/dist/{chunks/StatusBadge-C1Blx_cW.js → components/dropdownUtils.js} +2 -63
  181. package/dist/components/focus.d.ts +2 -0
  182. package/dist/components/focus.js +7 -0
  183. package/dist/components/ghostButton.js +7 -0
  184. package/dist/components/inputClasses.js +4 -0
  185. package/dist/components/keys.d.ts +12 -0
  186. package/dist/components/keys.js +27 -0
  187. package/dist/components/relativeTime.js +32 -0
  188. package/dist/{chunks/useCssIsDark-DHr05dG2.js → components/useCssIsDark.js} +1 -1
  189. package/dist/duration.d.ts +3 -0
  190. package/dist/duration.js +17 -0
  191. package/dist/editor/Editor.js +13 -0
  192. package/dist/editor/EditorField.js +53 -0
  193. package/dist/editor/FormCodePanel.js +173 -0
  194. package/dist/editor/Monaco.d.ts +1 -20
  195. package/dist/editor/Monaco.js +112 -0
  196. package/dist/editor/index.d.ts +2 -1
  197. package/dist/editor/index.js +7 -2
  198. package/dist/editor/themes.js +91 -0
  199. package/dist/editor/workers.js +29 -0
  200. package/dist/editor/yaml.d.ts +5 -0
  201. package/dist/editor/yaml.js +15 -0
  202. package/dist/engine.d.ts +98 -0
  203. package/dist/file-explorer/FileExplorer.d.ts +11 -2
  204. package/dist/file-explorer/FileExplorer.js +1402 -0
  205. package/dist/file-explorer/FileExplorerContext.d.ts +1 -1
  206. package/dist/file-explorer/FileExplorerContext.js +370 -0
  207. package/dist/file-explorer/FilePreview/CodePreviewEditor.d.ts +1 -1
  208. package/dist/{chunks/CodePreviewEditor-4lx3kE-w.js → file-explorer/FilePreview/CodePreviewEditor.js} +3 -2
  209. package/dist/file-explorer/FilePreview/Inline.js +45 -0
  210. package/dist/file-explorer/FilePreview/StreamedBadge.js +16 -0
  211. package/dist/file-explorer/FilePreview/Viewer.js +526 -0
  212. package/dist/file-explorer/FilePreview/index.js +266 -0
  213. package/dist/file-explorer/FilePreview/parse.js +63 -0
  214. package/dist/file-explorer/FilePreview/previewCache.js +98 -0
  215. package/dist/file-explorer/FilePreview/previewType.d.ts +1 -1
  216. package/dist/file-explorer/FilePreview/previewType.js +151 -0
  217. package/dist/file-explorer/FilePreview/readCappedBytes.js +196 -0
  218. package/dist/file-explorer/FilePreview/useObjectBlobUrl.js +95 -0
  219. package/dist/file-explorer/FilePreview/useObjectText.js +109 -0
  220. package/dist/file-explorer/FilePreview/usePresignedUrl.js +73 -0
  221. package/dist/file-explorer/FileRow.d.ts +1 -1
  222. package/dist/file-explorer/FileRow.js +165 -0
  223. package/dist/file-explorer/FileRowsWindow.js +92 -0
  224. package/dist/file-explorer/FileTable.js +172 -0
  225. package/dist/file-explorer/FileTableHeaders.js +49 -0
  226. package/dist/file-explorer/LoadMoreRow.js +46 -0
  227. package/dist/file-explorer/TreeView.js +376 -0
  228. package/dist/file-explorer/helpers.d.ts +4 -4
  229. package/dist/file-explorer/helpers.js +537 -0
  230. package/dist/file-explorer/index.d.ts +3 -3
  231. package/dist/file-explorer/index.js +7 -5705
  232. package/dist/file-explorer/lib/batch.js +39 -0
  233. package/dist/file-explorer/lib/errors.js +9 -0
  234. package/dist/file-explorer/lib/paging.js +124 -0
  235. package/dist/file-explorer/lib/types.d.ts +6 -1
  236. package/dist/file-explorer/lib/utils.d.ts +1 -3
  237. package/dist/file-explorer/lib/utils.js +322 -0
  238. package/dist/file-explorer/toasts.js +400 -0
  239. package/dist/file-explorer/treeRows.js +73 -0
  240. package/dist/file-explorer/useNearEnd.d.ts +1 -1
  241. package/dist/file-explorer/useNearEnd.js +27 -0
  242. package/dist/form/FieldWrapper.d.ts +2 -2
  243. package/dist/form/FieldWrapper.js +54 -0
  244. package/dist/form/Fields/BooleanField.js +51 -0
  245. package/dist/form/Fields/CheckboxGroupField.js +72 -0
  246. package/dist/form/Fields/ColorField.js +33 -0
  247. package/dist/form/Fields/DropdownField.js +49 -0
  248. package/dist/form/Fields/DurationField.js +130 -0
  249. package/dist/form/Fields/LabelField.js +19 -0
  250. package/dist/form/Fields/MultiDropdownField.js +40 -0
  251. package/dist/form/Fields/NumberField.js +51 -0
  252. package/dist/form/Fields/ObjectField.js +54 -0
  253. package/dist/form/Fields/RadioField.js +49 -0
  254. package/dist/form/Fields/RangeField.js +58 -0
  255. package/dist/form/Fields/ResourceOptionIcon.d.ts +1 -1
  256. package/dist/form/Fields/ResourceOptionIcon.js +21 -0
  257. package/dist/form/Fields/StepField.js +6 -0
  258. package/dist/form/Fields/StringField.js +37 -0
  259. package/dist/form/Fields/TextAreaField.js +31 -0
  260. package/dist/form/Fields/durationValidity.js +11 -0
  261. package/dist/form/Form.d.ts +4 -21
  262. package/dist/form/Form.js +643 -0
  263. package/dist/form/SpecialTypes/DropdownWrapper.js +30 -0
  264. package/dist/form/SpecialTypes/FormikCustomDropdown.js +122 -0
  265. package/dist/form/SpecialTypes/FormikCustomInput.js +111 -0
  266. package/dist/form/SpecialTypes/FormikMultiSelectDropdown.js +31 -0
  267. package/dist/form/SpecialTypes/FormikNumericInput.js +60 -0
  268. package/dist/form/Wizard/WizardContainer.js +138 -0
  269. package/dist/form/Wizard/WizardNavigation.js +92 -0
  270. package/dist/form/Wizard/WizardStepContent.js +35 -0
  271. package/dist/form/Wizard/WizardStepIndicator.js +108 -0
  272. package/dist/form/Wizard/useWizardState.js +118 -0
  273. package/dist/form/Wizard/utils.js +34 -0
  274. package/dist/form/fieldContext.js +26 -0
  275. package/dist/form/fieldRegistry.js +50 -0
  276. package/dist/form/index.d.ts +11 -12
  277. package/dist/form/index.js +18 -2445
  278. package/dist/form/lib.d.ts +6 -1
  279. package/dist/{chunks/FieldWrapper-Bef01EWO.js → form/lib.js} +5 -104
  280. package/dist/form/types/fieldComponentTypes.d.ts +3 -2
  281. package/dist/form/types/fieldTypes.d.ts +6 -20
  282. package/dist/form/useParsedOpts.d.ts +1 -1
  283. package/dist/form/useParsedOpts.js +62 -0
  284. package/dist/form/usePrevious.js +11 -0
  285. package/dist/form/utils/checkShowIfObject.js +14 -0
  286. package/dist/form/utils/{slurmDuration.d.ts → duration.d.ts} +2 -2
  287. package/dist/form/utils/duration.js +69 -0
  288. package/dist/form/utils/getParentValue.js +23 -0
  289. package/dist/form/utils/getPlaceholder.js +9 -0
  290. package/dist/form/utils/getValueUsingPath.js +23 -0
  291. package/dist/form/utils/secondaryField.js +22 -0
  292. package/dist/graph/AnnotationBanner.js +141 -0
  293. package/dist/graph/Collapse.js +41 -0
  294. package/dist/{workflow/index.js → graph/DependencyGraph.js} +76 -1163
  295. package/dist/graph/JobSummary.js +104 -0
  296. package/dist/{workflow → graph}/MatrixGroup.d.ts +2 -2
  297. package/dist/graph/MatrixGroup.js +107 -0
  298. package/dist/graph/Reveal.js +57 -0
  299. package/dist/graph/TreeView.js +711 -0
  300. package/dist/{workflow → graph}/index.d.ts +1 -1
  301. package/dist/graph/index.js +2 -0
  302. package/dist/{workflow → graph}/types.d.ts +3 -3
  303. package/dist/graph/types.js +6 -0
  304. package/dist/icons.d.ts +20 -21
  305. package/dist/index.d.ts +38 -40
  306. package/dist/index.js +47 -599
  307. package/dist/list/ActionToolbar.js +184 -0
  308. package/dist/list/HoverCard.js +73 -0
  309. package/dist/list/ListPage.js +145 -0
  310. package/dist/list/ListPager.js +59 -0
  311. package/dist/list/ListTable.d.ts +1 -1
  312. package/dist/list/ListTable.js +163 -0
  313. package/dist/list/ListViewControls.d.ts +2 -2
  314. package/dist/list/ListViewControls.js +372 -0
  315. package/dist/list/RowContextMenu.js +350 -0
  316. package/dist/list/UserHoverCard.js +117 -0
  317. package/dist/list/index.d.ts +9 -9
  318. package/dist/list/index.js +11 -2
  319. package/dist/list/listSearch.js +137 -0
  320. package/dist/list/listView.js +210 -0
  321. package/dist/list/textEntry.js +10 -0
  322. package/dist/logviewer/LogViewer.d.ts +1 -1
  323. package/dist/logviewer/LogViewer.js +750 -0
  324. package/dist/logviewer/index.d.ts +1 -0
  325. package/dist/logviewer/index.js +3 -742
  326. package/dist/logviewer/segments.d.ts +9 -0
  327. package/dist/logviewer/segments.js +80 -0
  328. package/dist/styles/fonts.css +4 -4
  329. package/dist/styles/theme.css +6 -4
  330. package/dist/styles.css +1 -1
  331. package/dist/theme/index.js +2 -2
  332. package/package.json +38 -14
  333. package/LICENSE +0 -202
  334. package/dist/chunks/Monaco-C1POOdVv.js +0 -1046
  335. package/dist/chunks/PageHeader-l49p1nM9.js +0 -690
  336. package/dist/chunks/SwitchToggle-CHPP8uZQ.js +0 -755
  337. package/dist/chunks/editor-9_uVtUyy.js +0 -347
  338. package/dist/chunks/list-qrojZZNv.js +0 -1411
  339. package/dist/editor/usesGitlab.d.ts +0 -97
  340. package/dist/form/Fields/BucketReadOnlyField.d.ts +0 -7
  341. package/dist/form/types/workflow-schema.d.ts +0 -1145
  342. package/dist/form/utils/pwResolver.d.ts +0 -18
  343. package/dist/{chunks/MarkdownImpl-Bq4QhrtA.js → components/MarkdownImpl.js} +1 -1
  344. /package/dist/{workflow → graph}/AnnotationBanner.d.ts +0 -0
  345. /package/dist/{workflow → graph}/Collapse.d.ts +0 -0
  346. /package/dist/{workflow → graph}/DependencyGraph.d.ts +0 -0
  347. /package/dist/{workflow → graph}/JobSummary.d.ts +0 -0
  348. /package/dist/{workflow → graph}/Reveal.d.ts +0 -0
  349. /package/dist/{workflow → graph}/TreeView.d.ts +0 -0
@@ -0,0 +1,194 @@
1
+ import { useLink, useSlots, useStrings } from "./Provider.js";
2
+ import { AddIcon, ChevronRightIcon, EditIcon, MoreIcon } from "../icons.js";
3
+ import { keyedByContent } from "./keys.js";
4
+ import { TOOLTIP_ID } from "./Tooltip.js";
5
+ import { AddMenu } from "./AddMenu.js";
6
+ import { useBreadcrumb } from "./Breadcrumbs.js";
7
+ import { useRowMenu } from "../list/RowContextMenu.js";
8
+ import cx from "classnames";
9
+ import { Fragment, useLayoutEffect } from "react";
10
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
+ import { createPortal } from "react-dom";
12
+ //#region src/components/PageHeader.tsx
13
+ var headerActionButtonClasses = "flex items-center justify-center w-6 h-6 rounded-md shrink-0 cursor-pointer text-(--theme-muted-text-color) hover:text-(--theme-app) hover:bg-(--theme-muted-panel-bg) transition-colors";
14
+ var headerAddButtonClasses = "inline-flex h-[26px] shrink-0 items-center gap-1.5 rounded-md border border-(--theme-border) px-2 text-xs font-medium cursor-pointer text-(--theme-muted-text-color) hover:bg-(--theme-muted-panel-bg) hover:text-(--theme-app) transition-colors";
15
+ /** With menu, the plus opens a chooser; otherwise navigates to or calls the
16
+ * single action. `word` is the visible verb; `label` stays the full action for
17
+ * the tooltip and screen readers. */
18
+ function HeaderAddButton({ to, onClick, label, word = "add", menu, disabled = false, disabledHint }) {
19
+ const { common } = useStrings();
20
+ const Link = useLink();
21
+ const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(AddIcon, { className: "w-3 h-3" }), /* @__PURE__ */ jsx("span", { children: word === "create" ? common.create : common.add })] });
22
+ if (menu) return /* @__PURE__ */ jsx(AddMenu, {
23
+ items: menu,
24
+ label,
25
+ buttonClassName: headerAddButtonClasses,
26
+ children: content
27
+ });
28
+ if (to) return /* @__PURE__ */ jsx(Link, {
29
+ to,
30
+ "aria-label": label,
31
+ title: label,
32
+ className: headerAddButtonClasses,
33
+ children: content
34
+ });
35
+ const hint = disabled ? disabledHint : void 0;
36
+ return /* @__PURE__ */ jsx("button", {
37
+ type: "button",
38
+ onClick: disabled ? void 0 : onClick,
39
+ "aria-label": hint ? `${label}. ${hint}` : label,
40
+ "aria-disabled": disabled || void 0,
41
+ ...hint ? {
42
+ "data-tooltip-id": TOOLTIP_ID,
43
+ "data-tooltip-content": hint
44
+ } : { title: label },
45
+ className: cx(headerAddButtonClasses, "aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:hover:bg-transparent aria-disabled:hover:text-(--theme-muted-text-color)"),
46
+ children: content
47
+ });
48
+ }
49
+ function HeaderActionMenu({ items, label = "Actions" }) {
50
+ if (items.length === 0) return null;
51
+ return /* @__PURE__ */ jsx(AddMenu, {
52
+ items,
53
+ label,
54
+ buttonClassName: headerActionButtonClasses,
55
+ children: /* @__PURE__ */ jsx(MoreIcon, { className: "w-3.5 h-3.5" })
56
+ });
57
+ }
58
+ /** The header "…" trigger for a RowMenuItem menu — same rendering (submenus,
59
+ * destructive styling) as the list pages' right-click context menus. */
60
+ function HeaderRowMenu({ items, label = "Actions" }) {
61
+ const { openMenu, contextMenu } = useRowMenu();
62
+ if (items.length === 0) return null;
63
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("button", {
64
+ type: "button",
65
+ "aria-label": label,
66
+ title: label,
67
+ className: headerActionButtonClasses,
68
+ onClick: (e) => {
69
+ const r = e.currentTarget.getBoundingClientRect();
70
+ openMenu(r.left, r.bottom + 4, items);
71
+ },
72
+ children: /* @__PURE__ */ jsx(MoreIcon, { className: "w-3.5 h-3.5" })
73
+ }), contextMenu] });
74
+ }
75
+ function HeaderEditButton({ to, onClick, label = "Edit", disabled, tooltip }) {
76
+ const Link = useLink();
77
+ const tooltipProps = tooltip ? {
78
+ "data-tooltip-id": TOOLTIP_ID,
79
+ "data-tooltip-content": tooltip
80
+ } : {};
81
+ if (to && !disabled) return /* @__PURE__ */ jsx(Link, {
82
+ to,
83
+ "aria-label": label,
84
+ ...tooltip ? {} : { title: label },
85
+ className: headerActionButtonClasses,
86
+ ...tooltipProps,
87
+ children: /* @__PURE__ */ jsx(EditIcon, { className: "w-3 h-3" })
88
+ });
89
+ return /* @__PURE__ */ jsx("button", {
90
+ type: "button",
91
+ onClick,
92
+ disabled,
93
+ "aria-label": label,
94
+ title: tooltip ? void 0 : label,
95
+ className: cx(headerActionButtonClasses, disabled && "opacity-50 cursor-not-allowed hover:bg-transparent"),
96
+ ...tooltipProps,
97
+ children: /* @__PURE__ */ jsx(EditIcon, { className: "w-3 h-3" })
98
+ });
99
+ }
100
+ /** Renders nothing when the modern breadcrumb strip isn't mounted (classic chrome or self-headered pages). */
101
+ function BreadcrumbsTitleAction({ children }) {
102
+ const { titleActionSlot } = useBreadcrumb();
103
+ if (!titleActionSlot) return null;
104
+ return createPortal(children, titleActionSlot);
105
+ }
106
+ function BreadcrumbsRightAction({ children }) {
107
+ const { rightActionSlot } = useBreadcrumb();
108
+ if (!rightActionSlot) return null;
109
+ return createPortal(children, rightActionSlot);
110
+ }
111
+ var breadcrumbsActionClasses = "flex items-center gap-1 link text-xs whitespace-nowrap disabled:opacity-50 disabled:cursor-not-allowed";
112
+ function BreadcrumbsActionButton({ icon: Icon, label, ariaLabel, to, onClick, disabled, tooltip }) {
113
+ const Link = useLink();
114
+ const tip = tooltip ? {
115
+ "data-tooltip-id": TOOLTIP_ID,
116
+ "data-tooltip-content": tooltip
117
+ } : {};
118
+ const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Icon, { className: "w-3 h-3" }), label] });
119
+ if (to && !disabled) return /* @__PURE__ */ jsx(Link, {
120
+ to,
121
+ className: breadcrumbsActionClasses,
122
+ ...ariaLabel ? { "aria-label": ariaLabel } : {},
123
+ ...tip,
124
+ children: content
125
+ });
126
+ return /* @__PURE__ */ jsx("button", {
127
+ type: "button",
128
+ onClick,
129
+ disabled,
130
+ className: breadcrumbsActionClasses,
131
+ ...ariaLabel ? { "aria-label": ariaLabel } : {},
132
+ ...tip,
133
+ children: content
134
+ });
135
+ }
136
+ function PageHeader({ breadcrumbs, title, titleAction, actions, toolbar, className, sticky = true, stickyTopClassName = "top-0" }) {
137
+ const { setHidden } = useBreadcrumb();
138
+ const Link = useLink();
139
+ const { breadcrumbPin, navToggle } = useSlots();
140
+ useLayoutEffect(() => {
141
+ setHidden(true);
142
+ return () => setHidden(false);
143
+ }, [setHidden]);
144
+ const crumbs = [...breadcrumbs ?? []];
145
+ const lastLabel = crumbs[crumbs.length - 1]?.label;
146
+ if (title !== null && title !== void 0 && title !== lastLabel) crumbs.push({ label: title });
147
+ const crumbRow = crumbs.length > 0 && /* @__PURE__ */ jsxs("div", {
148
+ className: "flex items-center gap-1.5 min-w-0",
149
+ children: [
150
+ /* @__PURE__ */ jsx("nav", {
151
+ "aria-label": "Breadcrumb",
152
+ className: "flex items-center gap-2 min-w-0 text-[13px]",
153
+ children: keyedByContent(crumbs, (c) => c.href ?? (typeof c.label === "string" ? c.label : "crumb")).map(({ key, item: crumb }, idx) => {
154
+ if (idx === crumbs.length - 1) return /* @__PURE__ */ jsx("h1", {
155
+ className: "m-0 text-[13px] font-medium leading-none text-(--theme-app) truncate",
156
+ children: crumb.label
157
+ }, key);
158
+ return /* @__PURE__ */ jsxs(Fragment, { children: [crumb.href ? /* @__PURE__ */ jsx(Link, {
159
+ to: crumb.href,
160
+ className: "text-(--theme-muted-text-color) hover:text-(--theme-app) transition-colors cursor-pointer whitespace-nowrap",
161
+ children: crumb.label
162
+ }) : /* @__PURE__ */ jsx("span", {
163
+ className: "text-(--theme-muted-text-color) whitespace-nowrap",
164
+ children: crumb.label
165
+ }), /* @__PURE__ */ jsx(ChevronRightIcon, { className: "w-3 h-3 opacity-60 shrink-0 text-(--theme-muted-text-color)" })] }, key);
166
+ })
167
+ }),
168
+ titleAction,
169
+ breadcrumbPin?.({ crumbs })
170
+ ]
171
+ });
172
+ const actionCluster = actions && /* @__PURE__ */ jsx("div", {
173
+ className: "flex items-center gap-1.5 shrink-0",
174
+ children: actions
175
+ });
176
+ const toggle = navToggle?.();
177
+ const hasLeading = !!crumbRow || !!toggle;
178
+ const leading = hasLeading ? /* @__PURE__ */ jsxs("div", {
179
+ className: "flex items-center gap-2 min-w-0",
180
+ children: [toggle, crumbRow]
181
+ }) : /* @__PURE__ */ jsx("div", {});
182
+ return /* @__PURE__ */ jsxs("div", {
183
+ className: cx(sticky && cx("sticky z-20", stickyTopClassName), "w-full bg-(--theme-app-bg)", className),
184
+ children: [/* @__PURE__ */ jsxs("div", {
185
+ className: cx("flex items-center justify-between gap-6 px-4 h-11", hasLeading && "border-b border-(--theme-border)"),
186
+ children: [leading, actionCluster]
187
+ }), toolbar && /* @__PURE__ */ jsx("div", {
188
+ className: "px-4",
189
+ children: toolbar
190
+ })]
191
+ });
192
+ }
193
+ //#endregion
194
+ export { BreadcrumbsActionButton, BreadcrumbsRightAction, BreadcrumbsTitleAction, HeaderActionMenu, HeaderAddButton, HeaderEditButton, HeaderRowMenu, PageHeader, headerActionButtonClasses };
@@ -0,0 +1,35 @@
1
+ import { useStrings } from "./Provider.js";
2
+ import cx from "classnames";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ //#region src/components/Pagination.tsx
5
+ function Pagination({ endingNumber, endingTime, nextCallback, prevCallback, roundedBottom, startingNumber, startingTime, nextDisabled, prevDisabled, name, useTimeRange = false }) {
6
+ const t = useStrings().list;
7
+ return /* @__PURE__ */ jsxs("nav", {
8
+ className: cx(roundedBottom && "rounded-b-2xl", "theme-muted-panel flex items-center justify-between border-t theme-border px-4 py-1 sm:px-6"),
9
+ "aria-label": "Pagination",
10
+ children: [/* @__PURE__ */ jsx("div", {
11
+ className: cx("hidden", (startingNumber !== void 0 && startingNumber !== null && endingNumber !== void 0 && endingNumber !== null || startingTime && endingTime) && "sm:block"),
12
+ children: /* @__PURE__ */ jsx("p", {
13
+ className: "text-sm whitespace-nowrap",
14
+ children: useTimeRange && startingTime && endingTime ? t.paginationShowingTimeRange(name ?? "", startingTime, endingTime) : t.paginationShowing(name ?? "", startingNumber ?? "", endingNumber ?? "")
15
+ })
16
+ }), /* @__PURE__ */ jsxs("div", {
17
+ className: "flex flex-1 justify-between sm:justify-end gap-x-2",
18
+ children: [/* @__PURE__ */ jsx("button", {
19
+ type: "button",
20
+ disabled: prevDisabled,
21
+ onClick: prevCallback,
22
+ className: cx("link text-sm", prevDisabled && "disabled"),
23
+ children: t.paginationPrevious
24
+ }), /* @__PURE__ */ jsx("button", {
25
+ type: "button",
26
+ disabled: nextDisabled,
27
+ onClick: nextCallback,
28
+ className: cx("link text-sm", nextDisabled && "disabled"),
29
+ children: t.paginationNext
30
+ })]
31
+ })]
32
+ });
33
+ }
34
+ //#endregion
35
+ export { Pagination };
@@ -1,5 +1,6 @@
1
1
  import type { Dispatch, ReactNode, SetStateAction } from 'react';
2
- import type { RunLink } from '../workflow/types.js';
2
+ import type { WorkflowEngine } from '../engine.js';
3
+ import type { RunLink } from '../graph/types.js';
3
4
  export type UIToastId = string | number;
4
5
  export interface UIToastOptions {
5
6
  toastId?: UIToastId;
@@ -244,6 +245,7 @@ export interface UIStrings {
244
245
  collapse: string;
245
246
  upload: string;
246
247
  download: string;
248
+ downloadFromBrowser: string;
247
249
  access: string;
248
250
  manageAccess: string;
249
251
  delete: string;
@@ -318,10 +320,6 @@ export interface UIStrings {
318
320
  invalidDuration: string;
319
321
  durationOutOfRange: (min: string, max: string) => string;
320
322
  durationBelowMin: (min: string) => string;
321
- readOnly: string;
322
- readWrite: string;
323
- readOnlyDescription: string;
324
- readOnlyForced: string;
325
323
  };
326
324
  time: {
327
325
  now: string;
@@ -373,18 +371,11 @@ export interface UIStrings {
373
371
  }
374
372
  export interface UINavigation {
375
373
  goTo: (to: string) => void;
376
- toWorkflow: (name: string) => void;
377
- toMarketItem: (name: string) => void;
374
+ /** Opens the source of a step that runs another workflow, named by its `uses`;
375
+ * `sourceUrl` is a page the server resolved for it, when there is one. */
376
+ openStepSource: (uses: string, sourceUrl?: string) => void;
378
377
  openExternal: (href: string) => void;
379
378
  }
380
- export type WorkflowJsonRef = {
381
- kind: 'marketplace';
382
- slug: string;
383
- version: string;
384
- } | {
385
- kind: 'workflow';
386
- name: string;
387
- };
388
379
  export interface RunFileResult {
389
380
  data: string | undefined;
390
381
  isLoading: boolean;
@@ -400,11 +391,6 @@ export interface UIData {
400
391
  useRunFile: (slug: string, path: string | null, options?: {
401
392
  refreshInterval?: number;
402
393
  }) => RunFileResult;
403
- /**
404
- * Resolves a workflow reference to its parsed JSON definition, for the YAML
405
- * editor's input completion. Absent, that completion silently no-ops.
406
- */
407
- resolveWorkflowJson?: (ref: WorkflowJsonRef) => Promise<unknown>;
408
394
  /**
409
395
  * Provisions browser-access CORS rules on a storage. Absent, the storage
410
396
  * explorer hides its "add CORS rules" affordance.
@@ -418,48 +404,6 @@ export interface UIData {
418
404
  error?: string;
419
405
  }>;
420
406
  usePersistedState: PersistedStateHook;
421
- /**
422
- * Repository completions for `uses:`, bound by the host because the credential
423
- * lives on the platform. Absent, those completions no-op.
424
- */
425
- repoSuggestions?: {
426
- refs: (repo: string) => Promise<RepoRef[]>;
427
- files: (repo: string, ref: string, path: string) => Promise<RepoEntry[]>;
428
- file: (repo: string, ref: string, path: string) => Promise<string>;
429
- repos: (owner: string) => Promise<RepoSummary[]>;
430
- gitlabProjects: (search: string, host?: string) => Promise<GitlabProject[]>;
431
- owners: (provider: 'github' | 'gitlab', search: string, host?: string) => Promise<RepoOwner[]>;
432
- };
433
- }
434
- /** One branch, tag or commit a `uses:` reference can name. */
435
- export interface RepoRef {
436
- name: string;
437
- kind: string;
438
- detail: string;
439
- }
440
- /** One repository in an owner listing. */
441
- export interface RepoSummary {
442
- name: string;
443
- description: string;
444
- private: boolean;
445
- }
446
- /** One account, organization or group a repository can live under. */
447
- export interface RepoOwner {
448
- name: string;
449
- kind: string;
450
- host?: string | undefined;
451
- }
452
- /** One GitLab project, with the server a $host must name to reach it. */
453
- export interface GitlabProject {
454
- path: string;
455
- host: string;
456
- description: string;
457
- private: boolean;
458
- }
459
- /** One entry in a repository directory listing. */
460
- export interface RepoEntry {
461
- path: string;
462
- type: 'blob' | 'tree';
463
407
  }
464
408
  import type { FieldComponent } from '../form/fieldRegistry.js';
465
409
  import type { PageHeaderCrumb } from './PageHeader.js';
@@ -530,25 +474,31 @@ export interface UISlots {
530
474
  * trail — the host's app-nav toggle. Absent hides it. */
531
475
  navToggle?: () => ReactNode;
532
476
  }
477
+ /** An engine, or a loader so the host can keep the engine out of its first-load bundle. */
478
+ export type WorkflowEngineSource = WorkflowEngine | (() => Promise<WorkflowEngine>);
533
479
  export interface UIProviderValue {
534
480
  notify: UINotify;
535
481
  strings: UIStrings;
536
482
  navigation: UINavigation;
537
483
  data: UIData;
538
484
  slots: UISlots;
485
+ engine?: WorkflowEngineSource | undefined;
539
486
  }
540
487
  export declare function useNotify(): UINotify;
541
488
  export declare function useStrings(): UIStrings;
542
489
  export declare function useNavigation(): UINavigation;
543
490
  export declare function useSlots(): UISlots;
544
- export declare function useWorkflowJsonResolver(): ((ref: WorkflowJsonRef) => Promise<unknown>) | undefined;
491
+ /** The engine when one is provided and `enabled`; suspends while a loader resolves. */
492
+ export declare function useOptionalWorkflowEngine(enabled?: boolean): WorkflowEngine | undefined;
493
+ export declare function useWorkflowEngine(): WorkflowEngine;
494
+ /** Resolves the engine without suspending, for async callers such as editor completions. */
495
+ export declare function useWorkflowEngineLoader(): () => Promise<WorkflowEngine | undefined>;
545
496
  export declare function useProvisionCorsRules(): UIData['provisionCorsRules'];
546
- export declare function useRepoSuggestions(): UIData['repoSuggestions'];
547
497
  export declare function useRunFile(slug: string, path: string | null, options?: {
548
498
  refreshInterval?: number;
549
499
  }): RunFileResult;
550
500
  export declare function usePersistedState<T>(key: string, defaultValue: T): [T, Dispatch<SetStateAction<T>>];
551
- export declare function UIProvider({ notify, strings, navigation, data, slots, children, }: {
501
+ export declare function UIProvider({ notify, strings, navigation, data, slots, engine, children, }: {
552
502
  notify?: Partial<UINotify>;
553
503
  strings?: {
554
504
  [G in keyof UIStrings]?: UIStrings[G] extends object ? Partial<UIStrings[G]> : UIStrings[G];
@@ -556,5 +506,6 @@ export declare function UIProvider({ notify, strings, navigation, data, slots, c
556
506
  navigation?: Partial<UINavigation>;
557
507
  data?: Partial<UIData>;
558
508
  slots?: UISlots;
509
+ engine?: WorkflowEngineSource;
559
510
  children: React.ReactNode;
560
511
  }): import("react").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { createContext, useContext, useMemo } from "react";
1
+ import { createContext, use, useCallback, useContext, useEffect, useMemo } from "react";
2
2
  import { useLocalStorage } from "usehooks-ts";
3
3
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
4
4
  //#region src/components/Provider.tsx
@@ -85,7 +85,7 @@ var DEFAULTS = {
85
85
  timeRangeActive: "Time range active",
86
86
  timeRangeOn: "ON",
87
87
  filterByTimeRange: "Filter by time range",
88
- timeRangeHelp: "Times are interpreted in your local timezone. Applying a range re-queries the journal on the cluster and replaces what is loaded. Setting an end time stops live tailing until you clear it.",
88
+ timeRangeHelp: "Times are interpreted in your local timezone. Applying a range re-queries the log source and replaces what is loaded. Setting an end time stops live tailing until you clear it.",
89
89
  timeRangeFrom: "From",
90
90
  timeRangeTo: "To",
91
91
  apply: "Apply",
@@ -188,7 +188,7 @@ var DEFAULTS = {
188
188
  },
189
189
  propagating: {
190
190
  title: "Propagating CORS rules",
191
- description: "Azure is rolling out the new rules to its storage endpoints. This usually completes within a minute.",
191
+ description: "The storage provider is rolling out the new rules to its endpoints. This usually completes within a minute.",
192
192
  stages: {
193
193
  submitted: "Submitted",
194
194
  propagating: "Propagating",
@@ -246,6 +246,7 @@ var DEFAULTS = {
246
246
  collapse: "Collapse",
247
247
  upload: "Upload",
248
248
  download: "Download",
249
+ downloadFromBrowser: "From browser",
249
250
  access: "Access",
250
251
  manageAccess: "Manage Access",
251
252
  delete: "Delete",
@@ -319,11 +320,7 @@ var DEFAULTS = {
319
320
  form: {
320
321
  invalidDuration: "Enter a duration as DD-HH:MM:SS or HH:MM:SS.",
321
322
  durationOutOfRange: (min, max) => `Must be between ${min} and ${max}.`,
322
- durationBelowMin: (min) => `Must be at least ${min}.`,
323
- readOnly: "Read-only",
324
- readWrite: "Read-write",
325
- readOnlyDescription: "Read-only mounts can list and download objects, but cannot upload, modify, or delete them.",
326
- readOnlyForced: "Your access to this bucket is read-only, so this mount cannot be writable."
323
+ durationBelowMin: (min) => `Must be at least ${min}.`
327
324
  },
328
325
  time: {
329
326
  now: "now",
@@ -392,8 +389,8 @@ var DEFAULTS = {
392
389
  className: "font-medium",
393
390
  children: startTime
394
391
  }),
392
+ " to",
395
393
  " ",
396
- "to ",
397
394
  /* @__PURE__ */ jsx("span", {
398
395
  className: "font-medium",
399
396
  children: endTime
@@ -403,8 +400,9 @@ var DEFAULTS = {
403
400
  },
404
401
  navigation: {
405
402
  goTo: (to) => window.location.assign(to),
406
- toWorkflow: () => {},
407
- toMarketItem: () => {},
403
+ openStepSource: (_uses, sourceUrl) => {
404
+ if (sourceUrl) window.open(sourceUrl, "_blank");
405
+ },
408
406
  openExternal: (href) => window.open(href, "_blank")
409
407
  },
410
408
  data: {
@@ -426,15 +424,46 @@ function useNavigation() {
426
424
  function useSlots() {
427
425
  return useContext(UIContext).slots;
428
426
  }
429
- function useWorkflowJsonResolver() {
430
- return useContext(UIContext).data.resolveWorkflowJson;
427
+ var loadedEngines = /* @__PURE__ */ new WeakMap();
428
+ function loadEngine(load) {
429
+ let entry = loadedEngines.get(load);
430
+ if (!entry) {
431
+ const created = { promise: load() };
432
+ created.promise.then((engine) => {
433
+ created.engine = engine;
434
+ });
435
+ loadedEngines.set(load, created);
436
+ entry = created;
437
+ }
438
+ return entry;
439
+ }
440
+ function resolveEngine(source) {
441
+ if (typeof source !== "function") return source;
442
+ const entry = loadEngine(source);
443
+ return entry.engine ?? use(entry.promise);
444
+ }
445
+ /** The engine when one is provided and `enabled`; suspends while a loader resolves. */
446
+ function useOptionalWorkflowEngine(enabled = true) {
447
+ const source = useContext(UIContext).engine;
448
+ if (!enabled || !source) return;
449
+ return resolveEngine(source);
450
+ }
451
+ function useWorkflowEngine() {
452
+ const source = useContext(UIContext).engine;
453
+ if (!source) throw new Error("Workflow forms and graphs need a UIProvider with an engine.");
454
+ return resolveEngine(source);
455
+ }
456
+ /** Resolves the engine without suspending, for async callers such as editor completions. */
457
+ function useWorkflowEngineLoader() {
458
+ const source = useContext(UIContext).engine;
459
+ return useCallback(async () => {
460
+ if (!source) return;
461
+ return typeof source === "function" ? loadEngine(source).promise : source;
462
+ }, [source]);
431
463
  }
432
464
  function useProvisionCorsRules() {
433
465
  return useContext(UIContext).data.provisionCorsRules;
434
466
  }
435
- function useRepoSuggestions() {
436
- return useContext(UIContext).data.repoSuggestions;
437
- }
438
467
  function useRunFile(slug, path, options) {
439
468
  const { useRunFile: boundUseRunFile } = useContext(UIContext).data;
440
469
  return boundUseRunFile(slug, path, options);
@@ -443,7 +472,10 @@ function usePersistedState(key, defaultValue) {
443
472
  const { usePersistedState: boundUsePersistedState } = useContext(UIContext).data;
444
473
  return boundUsePersistedState(key, defaultValue);
445
474
  }
446
- function UIProvider({ notify, strings, navigation, data, slots, children }) {
475
+ function UIProvider({ notify, strings, navigation, data, slots, engine, children }) {
476
+ useEffect(() => {
477
+ if (typeof engine === "function") loadEngine(engine);
478
+ }, [engine]);
447
479
  const value = useMemo(() => ({
448
480
  notify: {
449
481
  ...DEFAULTS.notify,
@@ -500,13 +532,15 @@ function UIProvider({ notify, strings, navigation, data, slots, children }) {
500
532
  ...DEFAULTS.data,
501
533
  ...data
502
534
  },
503
- slots: slots ?? DEFAULTS.slots
535
+ slots: slots ?? DEFAULTS.slots,
536
+ engine
504
537
  }), [
505
538
  notify,
506
539
  strings,
507
540
  navigation,
508
541
  data,
509
- slots
542
+ slots,
543
+ engine
510
544
  ]);
511
545
  return /* @__PURE__ */ jsx(UIContext.Provider, {
512
546
  value,
@@ -514,4 +548,4 @@ function UIProvider({ notify, strings, navigation, data, slots, children }) {
514
548
  });
515
549
  }
516
550
  //#endregion
517
- export { usePersistedState as a, useRunFile as c, useWorkflowJsonResolver as d, useNotify as i, useSlots as l, useLink as n, useProvisionCorsRules as o, useNavigation as r, useRepoSuggestions as s, UIProvider as t, useStrings as u };
551
+ export { UIProvider, useLink, useNavigation, useNotify, useOptionalWorkflowEngine, usePersistedState, useProvisionCorsRules, useRunFile, useSlots, useStrings, useWorkflowEngine, useWorkflowEngineLoader };
@@ -8,4 +8,4 @@ function RequiredMark() {
8
8
  });
9
9
  }
10
10
  //#endregion
11
- export { RequiredMark as t };
11
+ export { RequiredMark };
@@ -0,0 +1,11 @@
1
+ import cx from "classnames";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/components/SectionHeader.tsx
4
+ function SectionHeader({ children, className = "", size = "md" }) {
5
+ return /* @__PURE__ */ jsx("div", {
6
+ className: cx("w-full font-semibold", size === "sm" ? "mb-2 text-sm theme-text" : "text-lg", className),
7
+ children
8
+ });
9
+ }
10
+ //#endregion
11
+ export { SectionHeader as default };
@@ -0,0 +1,30 @@
1
+ import cx from "classnames";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ //#region src/components/SettingModeOption.tsx
4
+ /** A labeled + described radio option row, used inside a SettingsCard to pick
5
+ * between modes (e.g. default vs custom). Stacked rows share the card's
6
+ * dividers via `isFirst`. */
7
+ function SettingModeOption({ name, checked, onSelect, label, description, isFirst, disabled }) {
8
+ return /* @__PURE__ */ jsxs("label", {
9
+ className: cx("flex items-start gap-3 px-5 py-4", disabled ? "cursor-default opacity-60" : "cursor-pointer", !isFirst && "border-t theme-border"),
10
+ children: [/* @__PURE__ */ jsx("input", {
11
+ type: "radio",
12
+ name,
13
+ checked,
14
+ onChange: onSelect,
15
+ disabled,
16
+ className: "mt-0.5 w-4 h-4 theme-input shrink-0"
17
+ }), /* @__PURE__ */ jsxs("div", {
18
+ className: "min-w-0",
19
+ children: [/* @__PURE__ */ jsx("div", {
20
+ className: "font-semibold theme-text leading-tight",
21
+ children: label
22
+ }), /* @__PURE__ */ jsx("div", {
23
+ className: "theme-muted-text text-xs leading-snug mt-0.5",
24
+ children: description
25
+ })]
26
+ })]
27
+ });
28
+ }
29
+ //#endregion
30
+ export { SettingModeOption };
@@ -12,7 +12,7 @@ export declare function SettingRow({ label, htmlFor, helpText, children, isFirst
12
12
  * double toggle. */
13
13
  onClick?: () => void;
14
14
  }): import("react").JSX.Element;
15
- export declare function SettingSection({ title, isFirst, }: {
15
+ export declare function SettingSection({ title, isFirst }: {
16
16
  title: string;
17
17
  isFirst?: boolean;
18
18
  }): import("react").JSX.Element;
@@ -0,0 +1,35 @@
1
+ import cx from "classnames";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ //#region src/components/SettingRow.tsx
4
+ function SettingRow({ label, htmlFor, helpText, children, isFirst, fill, onClick }) {
5
+ return /* @__PURE__ */ jsxs("div", {
6
+ role: "none",
7
+ onClick,
8
+ className: cx("px-5 py-5 grid grid-cols-1 gap-x-8 gap-y-2", fill ? "md:grid-cols-[200px_1fr]" : "md:grid-cols-[1fr_auto]", !isFirst && "border-t theme-border", onClick && "cursor-pointer select-none hover:theme-hover transition-colors"),
9
+ children: [/* @__PURE__ */ jsxs("div", {
10
+ className: "flex flex-col gap-y-1",
11
+ children: [/* @__PURE__ */ jsx("label", {
12
+ htmlFor,
13
+ className: "font-semibold theme-text leading-tight",
14
+ children: label
15
+ }), helpText && /* @__PURE__ */ jsx("div", {
16
+ className: "theme-muted-text text-xs leading-snug",
17
+ children: helpText
18
+ })]
19
+ }), /* @__PURE__ */ jsx("div", {
20
+ className: cx("min-w-0", !fill && "flex items-center justify-end"),
21
+ children
22
+ })]
23
+ });
24
+ }
25
+ function SettingSection({ title, isFirst }) {
26
+ return /* @__PURE__ */ jsx("div", {
27
+ className: cx("px-5 py-3 theme-muted-panel", !isFirst && "border-t theme-border"),
28
+ children: /* @__PURE__ */ jsx("h2", {
29
+ className: "font-semibold text-sm uppercase tracking-wider theme-muted-text",
30
+ children: title
31
+ })
32
+ });
33
+ }
34
+ //#endregion
35
+ export { SettingRow, SettingSection };
@@ -0,0 +1,31 @@
1
+ import cx from "classnames";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ //#region src/components/SettingsCard.tsx
4
+ /**
5
+ * A settings card: an optional sentence-case section label sits above a
6
+ * bordered panel of rows. The label carries the breathing-room rhythm between
7
+ * cards; the rows inside provide their own dividers via SettingRow's `isFirst`.
8
+ */
9
+ function SettingsCard({ title, description, action, actionAlign = "adjacent", overflowVisible, children, className }) {
10
+ return /* @__PURE__ */ jsxs("section", {
11
+ className: cx("mt-10 first:mt-0", className),
12
+ children: [(title || action) && /* @__PURE__ */ jsxs("div", {
13
+ className: "mb-3 px-0.5",
14
+ children: [/* @__PURE__ */ jsxs("div", {
15
+ className: cx("flex items-center gap-1.5", actionAlign === "right" && "justify-between"),
16
+ children: [title && /* @__PURE__ */ jsx("h2", {
17
+ className: "text-[15px] font-semibold theme-text leading-none",
18
+ children: title
19
+ }), action]
20
+ }), description && /* @__PURE__ */ jsx("p", {
21
+ className: "text-xs theme-muted-text mt-1.5 leading-snug",
22
+ children: description
23
+ })]
24
+ }), /* @__PURE__ */ jsx("div", {
25
+ className: cx("panel", overflowVisible ? "overflow-visible" : "overflow-hidden"),
26
+ children
27
+ })]
28
+ });
29
+ }
30
+ //#endregion
31
+ export { SettingsCard as default };
@@ -4,5 +4,5 @@ interface SettingsGroupProps {
4
4
  children: React.ReactNode;
5
5
  className?: string;
6
6
  }
7
- export default function SettingsGroup({ title, children, className, }: SettingsGroupProps): React.JSX.Element;
7
+ export default function SettingsGroup({ title, children, className }: SettingsGroupProps): React.JSX.Element;
8
8
  export {};