@parallelworks/ui 0.18.0 → 0.19.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 (161) hide show
  1. package/README.md +86 -6
  2. package/dist/ai/adapter/memoryStore.d.ts +8 -0
  3. package/dist/ai/adapter/mock/index.d.ts +2 -0
  4. package/dist/ai/adapter/mock/index.js +81 -0
  5. package/dist/ai/adapter/mock/mockAdapter.d.ts +4 -0
  6. package/dist/ai/adapter/openai/createOpenAIStream.d.ts +9 -0
  7. package/dist/ai/adapter/openai/errors.d.ts +3 -0
  8. package/dist/ai/adapter/openai/index.d.ts +6 -0
  9. package/dist/ai/adapter/openai/index.js +334 -0
  10. package/dist/ai/adapter/openai/openaiAdapter.d.ts +9 -0
  11. package/dist/ai/adapter/openai/responses.d.ts +4 -0
  12. package/dist/ai/adapter/openai/sse.d.ts +24 -0
  13. package/dist/ai/adapter/openai/wire.d.ts +40 -0
  14. package/dist/ai/adapter/types.d.ts +131 -0
  15. package/dist/ai/agent/classifier.d.ts +2 -0
  16. package/dist/ai/agent/diff.d.ts +35 -0
  17. package/dist/ai/agent/diffHighlight.d.ts +6 -0
  18. package/dist/ai/agent/index.d.ts +6 -0
  19. package/dist/ai/agent/permissions.d.ts +11 -0
  20. package/dist/ai/agent/toolfmt.d.ts +18 -0
  21. package/dist/ai/agent/transcript.d.ts +38 -0
  22. package/dist/ai/ai.css +325 -0
  23. package/dist/ai/components/AllocationSelector.d.ts +4 -0
  24. package/dist/ai/components/AttachmentManager.d.ts +1 -0
  25. package/dist/ai/components/AttachmentUpload.d.ts +24 -0
  26. package/dist/ai/components/BlockedGroupBanner.d.ts +1 -0
  27. package/dist/ai/components/BranchNavigator.d.ts +8 -0
  28. package/dist/ai/components/ChatEmptyState.d.ts +3 -0
  29. package/dist/ai/components/ChatInput.d.ts +45 -0
  30. package/dist/ai/components/ChatLayout.d.ts +5 -0
  31. package/dist/ai/components/ChatMessage.d.ts +24 -0
  32. package/dist/ai/components/ChatMessageList.d.ts +35 -0
  33. package/dist/ai/components/ChatSidebar.d.ts +5 -0
  34. package/dist/ai/components/ChatThread.d.ts +3 -0
  35. package/dist/ai/components/ComposerChrome.d.ts +18 -0
  36. package/dist/ai/components/ComposerFrame.d.ts +16 -0
  37. package/dist/ai/components/DragOverlay.d.ts +5 -0
  38. package/dist/ai/components/ModelSelector.d.ts +6 -0
  39. package/dist/ai/components/ShareDialog.d.ts +11 -0
  40. package/dist/ai/components/SlashMenu.d.ts +28 -0
  41. package/dist/ai/components/agent/ActivityLine.d.ts +21 -0
  42. package/dist/ai/components/agent/AgentMessageParts.d.ts +54 -0
  43. package/dist/ai/components/agent/PermissionPicker.d.ts +11 -0
  44. package/dist/ai/components/attachmentKeys.d.ts +4 -0
  45. package/dist/ai/core/ChatProvider.d.ts +66 -0
  46. package/dist/ai/core/KeyboardShortcutsProvider.d.ts +5 -0
  47. package/dist/ai/core/chatReducer.d.ts +114 -0
  48. package/dist/ai/core/config.d.ts +47 -0
  49. package/dist/ai/core/events.d.ts +1 -0
  50. package/dist/ai/core/exportConversation.d.ts +4 -0
  51. package/dist/ai/core/greeting.d.ts +3 -0
  52. package/dist/ai/core/parts.d.ts +11 -0
  53. package/dist/ai/core/useDragDrop.d.ts +14 -0
  54. package/dist/ai/core/useKeyboardShortcuts.d.ts +12 -0
  55. package/dist/ai/core/useSSEStream.d.ts +34 -0
  56. package/dist/ai/index.d.ts +40 -0
  57. package/dist/ai/index.js +6645 -0
  58. package/dist/ai/strings.d.ts +167 -0
  59. package/dist/ai/types.d.ts +236 -0
  60. package/dist/ai/ui/Avatar.d.ts +8 -0
  61. package/dist/ai/ui/Dropdown.d.ts +31 -0
  62. package/dist/ai/ui/Markdown.d.ts +8 -0
  63. package/dist/ai/ui/Notice.d.ts +21 -0
  64. package/dist/ai/ui/buttons.d.ts +1 -0
  65. package/dist/ai/ui/codeBreaks.d.ts +16 -0
  66. package/dist/ai/ui/prose.d.ts +1 -0
  67. package/dist/ai/ui/sidebar.d.ts +81 -0
  68. package/dist/ai/utils.d.ts +4 -0
  69. package/dist/assets/{editor.worker-CuBRIwi-.js → editor.worker-BmHUIVG4.js} +194 -163
  70. package/dist/assets/{json.worker-8ytS02vz.js → json.worker-D8bJ92nw.js} +384 -338
  71. package/dist/assets/{yaml.worker-DJC-VUcv.js → yaml.worker-C4gyGAko.js} +15657 -13823
  72. package/dist/chunks/{CodePreviewEditor-4lx3kE-w.js → CodePreviewEditor-YqQBz1YL.js} +1 -1
  73. package/dist/chunks/ConfirmModal-aOR4O1QE.js +79 -0
  74. package/dist/chunks/{FieldWrapper-Bef01EWO.js → FieldWrapper-Cszwg-4B.js} +3 -7
  75. package/dist/chunks/{CreateModal-BY6DLmur.js → Markdown-CM-FenNE.js} +19 -91
  76. package/dist/chunks/Monaco-DJ8MW-Dq.js +110 -0
  77. package/dist/chunks/{PageHeader-l49p1nM9.js → PageHeader-0kG_iypP.js} +67 -65
  78. package/dist/chunks/{Provider-Ghua9PkN.js → Provider-CDYurraE.js} +54 -20
  79. package/dist/chunks/{SwitchToggle-CHPP8uZQ.js → SwitchToggle-DShNdcao.js} +135 -132
  80. package/dist/chunks/{Table-4OHjdKdO.js → Table-DU2MW8xz.js} +5 -3
  81. package/dist/chunks/{Tooltip-Crxo_eU_.js → Tooltip-K5HJr4_p.js} +31 -4
  82. package/dist/chunks/duration-BOv8Phl8.js +17 -0
  83. package/dist/chunks/{editor-9_uVtUyy.js → editor-Dk1rbV75.js} +32 -18
  84. package/dist/chunks/focus-D_iZJTW1.js +7 -0
  85. package/dist/chunks/{list-qrojZZNv.js → list-CJm875m7.js} +377 -370
  86. package/dist/chunks/logviewer-BTKuQWzw.js +828 -0
  87. package/dist/chunks/memoryStore-CC91S5LP.js +152 -0
  88. package/dist/chunks/types-Yy0NrerF.js +11 -0
  89. package/dist/components/Avatar.d.ts +1 -1
  90. package/dist/components/Breadcrumbs.d.ts +1 -1
  91. package/dist/components/Dropdown.d.ts +1 -1
  92. package/dist/components/EmptyState.d.ts +1 -1
  93. package/dist/components/Indicator.d.ts +2 -2
  94. package/dist/components/Input.d.ts +1 -1
  95. package/dist/components/LetterBadge.d.ts +1 -1
  96. package/dist/components/MarkdownImpl.d.ts +1 -1
  97. package/dist/components/Provider.d.ts +16 -65
  98. package/dist/components/SettingRow.d.ts +1 -1
  99. package/dist/components/SettingsGroup.d.ts +1 -1
  100. package/dist/components/focus.d.ts +2 -0
  101. package/dist/components/keys.d.ts +12 -0
  102. package/dist/duration.d.ts +3 -0
  103. package/dist/editor/Monaco.d.ts +1 -20
  104. package/dist/editor/index.d.ts +2 -1
  105. package/dist/editor/index.js +2 -2
  106. package/dist/editor/yaml.d.ts +5 -0
  107. package/dist/engine.d.ts +98 -0
  108. package/dist/file-explorer/FileExplorer.d.ts +11 -2
  109. package/dist/file-explorer/FileExplorerContext.d.ts +1 -1
  110. package/dist/file-explorer/FilePreview/CodePreviewEditor.d.ts +1 -1
  111. package/dist/file-explorer/FilePreview/previewType.d.ts +1 -1
  112. package/dist/file-explorer/FileRow.d.ts +1 -1
  113. package/dist/file-explorer/helpers.d.ts +4 -4
  114. package/dist/file-explorer/index.d.ts +3 -3
  115. package/dist/file-explorer/index.js +613 -647
  116. package/dist/file-explorer/lib/types.d.ts +6 -1
  117. package/dist/file-explorer/lib/utils.d.ts +1 -3
  118. package/dist/file-explorer/useNearEnd.d.ts +1 -1
  119. package/dist/form/FieldWrapper.d.ts +2 -2
  120. package/dist/form/Fields/ResourceOptionIcon.d.ts +1 -1
  121. package/dist/form/Form.d.ts +4 -21
  122. package/dist/form/index.d.ts +11 -12
  123. package/dist/form/index.js +1488 -1611
  124. package/dist/form/lib.d.ts +6 -1
  125. package/dist/form/types/fieldComponentTypes.d.ts +3 -2
  126. package/dist/form/types/fieldTypes.d.ts +6 -20
  127. package/dist/form/useParsedOpts.d.ts +1 -1
  128. package/dist/form/utils/{slurmDuration.d.ts → duration.d.ts} +2 -2
  129. package/dist/{workflow → graph}/MatrixGroup.d.ts +2 -2
  130. package/dist/{workflow → graph}/index.d.ts +1 -1
  131. package/dist/{workflow → graph}/index.js +215 -180
  132. package/dist/{workflow → graph}/types.d.ts +3 -3
  133. package/dist/icons.d.ts +20 -21
  134. package/dist/index.d.ts +38 -40
  135. package/dist/index.js +347 -346
  136. package/dist/list/ListTable.d.ts +1 -1
  137. package/dist/list/ListViewControls.d.ts +2 -2
  138. package/dist/list/index.d.ts +9 -9
  139. package/dist/list/index.js +2 -2
  140. package/dist/logviewer/LogViewer.d.ts +1 -1
  141. package/dist/logviewer/index.d.ts +1 -0
  142. package/dist/logviewer/index.js +2 -742
  143. package/dist/logviewer/segments.d.ts +9 -0
  144. package/dist/styles/fonts.css +4 -4
  145. package/dist/styles/theme.css +6 -4
  146. package/dist/styles.css +1 -1
  147. package/dist/theme/index.js +2 -2
  148. package/package.json +38 -14
  149. package/LICENSE +0 -202
  150. package/dist/chunks/Monaco-C1POOdVv.js +0 -1046
  151. package/dist/editor/usesGitlab.d.ts +0 -97
  152. package/dist/form/Fields/BucketReadOnlyField.d.ts +0 -7
  153. package/dist/form/types/workflow-schema.d.ts +0 -1145
  154. package/dist/form/utils/pwResolver.d.ts +0 -18
  155. package/dist/chunks/{MarkdownImpl-Bq4QhrtA.js → MarkdownImpl-CyeTVvSt.js} +1 -1
  156. /package/dist/{workflow → graph}/AnnotationBanner.d.ts +0 -0
  157. /package/dist/{workflow → graph}/Collapse.d.ts +0 -0
  158. /package/dist/{workflow → graph}/DependencyGraph.d.ts +0 -0
  159. /package/dist/{workflow → graph}/JobSummary.d.ts +0 -0
  160. /package/dist/{workflow → graph}/Reveal.d.ts +0 -0
  161. /package/dist/{workflow → graph}/TreeView.d.ts +0 -0
@@ -1,15 +1,14 @@
1
- import { i as useNotify, u as useStrings } from "./Provider-Ghua9PkN.js";
1
+ import { d as useWorkflowEngine, i as useNotify, u as useStrings } from "./Provider-CDYurraE.js";
2
2
  import { CheckIcon, CopyIcon, EyeIcon, EyeOffIcon } from "../icons.js";
3
3
  import { t as Loader } from "./Loader-BXoXTZGc.js";
4
4
  import { t as SwitchToggleSmall } from "./SwitchToggleSmall-FcsaYSTs.js";
5
- import { i as impureSetValueFromPath, r as flattenGroups, t as FieldWrapper } from "./FieldWrapper-Bef01EWO.js";
5
+ import { i as impureSetValueFromPath, r as flattenGroups, t as FieldWrapper } from "./FieldWrapper-Cszwg-4B.js";
6
6
  import cx from "classnames";
7
7
  import { Suspense, lazy, useId, useMemo, useRef, useState } from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
- import { convertToDynamicForm, parseStringsOfObj, parseStringsOfObjReady } from "@parallelworks/workflow-parser";
10
9
  import { useField, useFormikContext } from "formik";
11
10
  //#region src/editor/Editor.tsx
12
- var MonacoEditor = lazy(() => import("./Monaco-C1POOdVv.js"));
11
+ var MonacoEditor = lazy(() => import("./Monaco-DJ8MW-Dq.js"));
13
12
  function Editor({ ...props }) {
14
13
  return /* @__PURE__ */ jsx(Suspense, {
15
14
  fallback: /* @__PURE__ */ jsx(Loader, { text: "Loading editor..." }),
@@ -65,16 +64,16 @@ function EditorField(props) {
65
64
  //#endregion
66
65
  //#region src/editor/FormCodePanel.tsx
67
66
  var isObject = (value) => typeof value === "object" && value !== null;
68
- var shouldIgnoreField = (fieldSchema, inputs, arrayIndex) => {
67
+ var shouldIgnoreField = (engine, fieldSchema, inputs, arrayIndex) => {
69
68
  if (!fieldSchema?.["ignore"] || !fieldSchema?.["hidden"]) return false;
70
- if (!parseStringsOfObjReady) return false;
71
- return parseStringsOfObj({
69
+ if (!engine.isReady()) return false;
70
+ return engine.evaluate({
72
71
  inputs,
73
- obj: convertToDynamicForm(fieldSchema),
72
+ obj: engine.convertInputs(fieldSchema),
74
73
  index: arrayIndex ?? -1
75
74
  })["hidden"] === true;
76
75
  };
77
- var filterFields = (formJSON, data, prefix, rootData, arrayIndex) => {
76
+ var filterFields = (engine, formJSON, data, prefix, rootData, arrayIndex) => {
78
77
  const filteredFields = [];
79
78
  return {
80
79
  filteredFields,
@@ -91,7 +90,7 @@ var filterFields = (formJSON, data, prefix, rootData, arrayIndex) => {
91
90
  let filteredNested = {};
92
91
  const item = value[i];
93
92
  if (isObject(item)) {
94
- const result = filterFields(isObject(nestedSchema) ? nestedSchema : {}, item, key + `[${i}].`, rootData || data, i);
93
+ const result = filterFields(engine, isObject(nestedSchema) ? nestedSchema : {}, item, key + `[${i}].`, rootData || data, i);
95
94
  filteredNested = result.filtered;
96
95
  filteredFieldsNested = result.filteredFields;
97
96
  } else filteredNested = item;
@@ -101,7 +100,7 @@ var filterFields = (formJSON, data, prefix, rootData, arrayIndex) => {
101
100
  return acc;
102
101
  }
103
102
  if (fieldSchema && isObject(value)) {
104
- const { filteredFields: filteredFieldsNested, filtered: filteredNested } = filterFields(isObject(fieldSchema) ? fieldSchema : {}, value, key + ".", rootData || data, arrayIndex);
103
+ const { filteredFields: filteredFieldsNested, filtered: filteredNested } = filterFields(engine, isObject(fieldSchema) ? fieldSchema : {}, value, key + ".", rootData || data, arrayIndex);
105
104
  filteredFields.push(...filteredFieldsNested);
106
105
  acc[key] = filteredNested;
107
106
  return acc;
@@ -115,7 +114,7 @@ var filterFields = (formJSON, data, prefix, rootData, arrayIndex) => {
115
114
  return acc;
116
115
  }
117
116
  const contextData = rootData || data;
118
- if (isObject(fieldSchema) && shouldIgnoreField(fieldSchema, contextData, arrayIndex)) return acc;
117
+ if (isObject(fieldSchema) && shouldIgnoreField(engine, fieldSchema, contextData, arrayIndex)) return acc;
119
118
  acc[key] = value;
120
119
  return acc;
121
120
  }, {})
@@ -128,6 +127,7 @@ var populateFiltered = (filteredFields, data) => {
128
127
  return data;
129
128
  };
130
129
  function FormCodePanel({ formJSON, data, mutate, height = "600px", disabled = false }) {
130
+ const engine = useWorkflowEngine();
131
131
  const notify = useNotify();
132
132
  const { common: t } = useStrings();
133
133
  const uid = useId();
@@ -138,7 +138,7 @@ function FormCodePanel({ formJSON, data, mutate, height = "600px", disabled = fa
138
138
  const isValidJson = (errors) => {
139
139
  setJsonHasErrors(errors.length > 0);
140
140
  };
141
- const { filteredFields, filtered } = filterFields(flattenGroups(formJSON), data || {});
141
+ const { filteredFields, filtered } = filterFields(engine, flattenGroups(formJSON), data || {});
142
142
  const hasHiddenFields = filteredFields.length > 0;
143
143
  const displayObj = showHidden && hasHiddenFields ? populateFiltered(filteredFields, structuredClone(filtered)) : filtered;
144
144
  const showHiddenRef = useRef(showHidden);
@@ -212,7 +212,7 @@ function FormCodePanel({ formJSON, data, mutate, height = "600px", disabled = fa
212
212
  if (!isObject(parsed)) return;
213
213
  mutate(showHiddenRef.current ? parsed : populateFiltered(filteredFieldsRef.current, parsed));
214
214
  } catch {
215
- console.log("JSON.parse error in slurm editor");
215
+ console.log("JSON.parse error in form code editor");
216
216
  }
217
217
  },
218
218
  language: "json",
@@ -320,17 +320,17 @@ function getThemeName(isDark, disabled) {
320
320
  var monacoEnvironment = { getWorker(_moduleId, label) {
321
321
  if (label === "json") return new Worker(new URL(
322
322
  /* @vite-ignore */
323
- "/assets/json.worker-8ytS02vz.js",
323
+ "/assets/json.worker-D8bJ92nw.js",
324
324
  "" + import.meta.url
325
325
  ), { type: "module" });
326
326
  if (label === "yaml") return new Worker(new URL(
327
327
  /* @vite-ignore */
328
- "/assets/yaml.worker-DJC-VUcv.js",
328
+ "/assets/yaml.worker-C4gyGAko.js",
329
329
  "" + import.meta.url
330
330
  ), { type: "module" });
331
331
  return new Worker(new URL(
332
332
  /* @vite-ignore */
333
- "/assets/editor.worker-CuBRIwi-.js",
333
+ "/assets/editor.worker-BmHUIVG4.js",
334
334
  "" + import.meta.url
335
335
  ), { type: "module" });
336
336
  } };
@@ -344,4 +344,18 @@ function setupMonacoWorkers() {
344
344
  window.MonacoEnvironment = monacoEnvironment;
345
345
  }
346
346
  //#endregion
347
- export { EditorField as a, FormCodePanel as i, defineEditorThemes as n, Editor as o, getThemeName as r, setupMonacoWorkers as t };
347
+ //#region src/editor/yaml.ts
348
+ var schemas = [];
349
+ var apply;
350
+ /** Adds JSON schemas that validate and complete YAML models whose URI matches. */
351
+ function configureEditorYaml(added) {
352
+ schemas = [...schemas, ...added];
353
+ apply?.(schemas);
354
+ }
355
+ /** Lets the loaded editor pick up schemas added before or after it loads. */
356
+ function onYamlSchemas(listener) {
357
+ apply = listener;
358
+ listener(schemas);
359
+ }
360
+ //#endregion
361
+ export { getThemeName as a, Editor as c, defineEditorThemes as i, onYamlSchemas as n, FormCodePanel as o, setupMonacoWorkers as r, EditorField as s, configureEditorYaml as t };
@@ -0,0 +1,7 @@
1
+ //#region src/components/focus.ts
2
+ /** A ref that focuses a field once, when it mounts; stable so re-renders never move focus back. */
3
+ function focusOnMount(element) {
4
+ element?.focus();
5
+ }
6
+ //#endregion
7
+ export { focusOnMount as t };