@revenexx/studio-integrations 2.0.0 → 2.1.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 (73) hide show
  1. package/CHANGELOG.md +135 -0
  2. package/README.md +1 -0
  3. package/dist/module.json +1 -1
  4. package/dist/runtime/components/Integrations/CredentialCreateDialog.vue +6 -6
  5. package/dist/runtime/components/Integrations/CredentialDetailDialog.vue +134 -131
  6. package/dist/runtime/components/Integrations/CredentialLogo.vue +1 -1
  7. package/dist/runtime/components/Integrations/CredentialRevenexxSource.vue +1 -1
  8. package/dist/runtime/components/Integrations/CredentialTypePicker.vue +6 -6
  9. package/dist/runtime/components/Integrations/ExpressionInput.d.vue.ts +2 -0
  10. package/dist/runtime/components/Integrations/ExpressionInput.vue +90 -11
  11. package/dist/runtime/components/Integrations/ExpressionInput.vue.d.ts +2 -0
  12. package/dist/runtime/components/Integrations/GroupFrameView.vue +121 -121
  13. package/dist/runtime/components/Integrations/NodeConfigField.vue +20 -5
  14. package/dist/runtime/components/Integrations/NodeInspector.vue +44 -41
  15. package/dist/runtime/components/Integrations/NodePalette.vue +52 -37
  16. package/dist/runtime/components/Integrations/RunActionsMenu.vue +6 -5
  17. package/dist/runtime/components/Integrations/RunDetailPanel.d.vue.ts +7 -0
  18. package/dist/runtime/components/Integrations/RunDetailPanel.vue +14 -2
  19. package/dist/runtime/components/Integrations/RunDetailPanel.vue.d.ts +7 -0
  20. package/dist/runtime/components/Integrations/RunsTable.vue +7 -26
  21. package/dist/runtime/components/Integrations/StickyNoteView.vue +1 -0
  22. package/dist/runtime/components/Integrations/WorkflowCreateDialog.vue +10 -6
  23. package/dist/runtime/components/Integrations/WorkflowEditor.vue +224 -225
  24. package/dist/runtime/components/Integrations/WorkflowExportDialog.d.vue.ts +6 -0
  25. package/dist/runtime/components/Integrations/WorkflowExportDialog.vue +71 -0
  26. package/dist/runtime/components/Integrations/WorkflowExportDialog.vue.d.ts +6 -0
  27. package/dist/runtime/components/Integrations/WorkflowImportFileStep.d.vue.ts +8 -0
  28. package/dist/runtime/components/Integrations/WorkflowImportFileStep.vue +95 -0
  29. package/dist/runtime/components/Integrations/WorkflowImportFileStep.vue.d.ts +8 -0
  30. package/dist/runtime/components/Integrations/WorkflowNodeView.vue +5 -4
  31. package/dist/runtime/components/Integrations/WorkflowRunReplayPanel.vue +0 -7
  32. package/dist/runtime/components/Integrations/WorkflowTriggerView.vue +2 -2
  33. package/dist/runtime/components/Integrations/WorkflowVariablesDialog.vue +2 -3
  34. package/dist/runtime/components/Integrations/WorkflowsTable.vue +14 -8
  35. package/dist/runtime/composables/useIntegrationsNodes.js +4 -1
  36. package/dist/runtime/composables/useIntegrationsWorkflows.d.ts +3 -1
  37. package/dist/runtime/composables/useIntegrationsWorkflows.js +5 -22
  38. package/dist/runtime/composables/useNow.d.ts +17 -0
  39. package/dist/runtime/composables/useNow.js +16 -0
  40. package/dist/runtime/composables/useWorkflowFile.d.ts +21 -0
  41. package/dist/runtime/composables/useWorkflowFile.js +63 -0
  42. package/dist/runtime/data/expressionEditor.d.ts +11 -1
  43. package/dist/runtime/data/expressionEditor.js +2 -1
  44. package/dist/runtime/data/nodeIcons.d.ts +14 -0
  45. package/dist/runtime/data/nodeIcons.js +57 -14
  46. package/dist/runtime/data/nodeRunData.js +1 -1
  47. package/dist/runtime/data/payloadForm.js +1 -1
  48. package/dist/runtime/i18n/messages/de.json +42 -0
  49. package/dist/runtime/i18n/messages/en.json +42 -0
  50. package/dist/runtime/pages/integrations/audit.vue +3 -3
  51. package/dist/runtime/pages/integrations/credentials/oauth-complete.vue +2 -2
  52. package/dist/runtime/pages/integrations/index.vue +5 -10
  53. package/dist/runtime/pages/integrations/schedules.vue +13 -1
  54. package/dist/runtime/pages/integrations/templates/index.vue +40 -40
  55. package/dist/runtime/pages/integrations/workflows/[id].vue +324 -244
  56. package/dist/runtime/types/integrations.d.ts +13 -0
  57. package/dist/runtime/utils/credentialState.d.ts +0 -7
  58. package/dist/runtime/utils/credentialState.js +0 -12
  59. package/dist/runtime/utils/localize.d.ts +12 -0
  60. package/dist/runtime/utils/localize.js +1 -1
  61. package/dist/runtime/utils/paletteOrder.d.ts +29 -0
  62. package/dist/runtime/utils/paletteOrder.js +46 -0
  63. package/dist/runtime/utils/relativeTime.d.ts +29 -0
  64. package/dist/runtime/utils/relativeTime.js +23 -0
  65. package/dist/runtime/utils/runFeedQuery.d.ts +12 -6
  66. package/dist/runtime/utils/runFeedQuery.js +3 -18
  67. package/dist/runtime/utils/settingValue.d.ts +33 -0
  68. package/dist/runtime/utils/settingValue.js +8 -0
  69. package/dist/runtime/utils/statusStyle.d.ts +8 -8
  70. package/dist/runtime/utils/statusStyle.js +4 -1
  71. package/dist/runtime/utils/workflowFile.d.ts +119 -0
  72. package/dist/runtime/utils/workflowFile.js +192 -0
  73. package/package.json +8 -3
@@ -1,13 +1,15 @@
1
1
  <script setup>
2
2
  import { computed, inject, onBeforeUnmount, onMounted, ref, useId, watch } from "vue";
3
3
  import { Editor, EditorContent } from "@tiptap/vue-3";
4
- import { Node } from "@tiptap/core";
4
+ import { Mark, Node } from "@tiptap/core";
5
+ import { NodeSelection, TextSelection } from "@tiptap/pm/state";
6
+ import { isHistoryTransaction } from "@tiptap/pm/history";
5
7
  import Document from "@tiptap/extension-document";
6
8
  import Paragraph from "@tiptap/extension-paragraph";
7
9
  import Text from "@tiptap/extension-text";
8
10
  import History from "@tiptap/extension-history";
9
11
  import { resolveExpressionText } from "../../data/nodeRunData";
10
- import { EXPR_TOKEN_NODE, docToText, hasRawTokenText, textToDoc } from "../../data/expressionEditor";
12
+ import { EXPR_EDITING_MARK, EXPR_TOKEN_NODE, docToText, hasRawTokenText, textToDoc, textToInlineContent } from "../../data/expressionEditor";
11
13
  const props = defineProps({
12
14
  modelValue: { type: null, required: true },
13
15
  placeholder: { type: String, required: false },
@@ -17,7 +19,7 @@ const props = defineProps({
17
19
  label: { type: String, required: false },
18
20
  multiline: { type: Boolean, required: false }
19
21
  });
20
- const emit = defineEmits(["update:modelValue"]);
22
+ const emit = defineEmits(["update:modelValue", "blur"]);
21
23
  const t = useIntegrationsT();
22
24
  const text = computed(() => String(props.modelValue ?? ""));
23
25
  const OPEN = "${{ ";
@@ -68,19 +70,33 @@ const ExprToken = Node.create({
68
70
  return ["span", { "data-expr-token": String(node.attrs.token) }, String(node.attrs.token)];
69
71
  },
70
72
  addNodeView() {
71
- return ({ node }) => {
73
+ return ({ node, getPos }) => {
72
74
  const dom = document.createElement("span");
73
75
  dom.className = "expr-pill";
74
76
  dom.textContent = tokenLabel(String(node.attrs.token));
75
77
  dom.title = String(node.attrs.token);
78
+ dom.addEventListener("mousedown", (e) => {
79
+ if (e.button !== 0 || e.shiftKey || e.ctrlKey || e.metaKey || e.altKey) return;
80
+ const pos = getPos();
81
+ if (pos !== void 0 && onPillMousedown(pos)) e.preventDefault();
82
+ });
76
83
  return { dom };
77
84
  };
78
85
  }
79
86
  });
87
+ const ExprEditing = Mark.create({
88
+ name: EXPR_EDITING_MARK,
89
+ inclusive: true,
90
+ // No `parseHTML`: the mark is only ever made by `openPill`. Parsed back, a copy
91
+ // of opened text would paste as text nobody opened, left unpilled.
92
+ renderHTML() {
93
+ return ["span", { "data-expr-editing": "", class: "expr-editing" }, 0];
94
+ }
95
+ });
80
96
  const lineMode = () => ({ multiline: props.multiline });
81
97
  function editableAttributes() {
82
98
  return {
83
- "role": "textbox",
99
+ role: "textbox",
84
100
  ...props.multiline ? { "aria-multiline": "true" } : {},
85
101
  ...props.label ? { "aria-label": props.label } : {}
86
102
  };
@@ -94,13 +110,66 @@ function endOfLine(line) {
94
110
  });
95
111
  return pos;
96
112
  }
113
+ function openPill(pos, node) {
114
+ if (node.type.name !== EXPR_TOKEN_NODE) return false;
115
+ const { state, dispatch } = editor.view;
116
+ const token = String(node.attrs.token);
117
+ const textNode = state.schema.text(token, [state.schema.marks[EXPR_EDITING_MARK].create()]);
118
+ const tr = state.tr.replaceWith(pos, pos + node.nodeSize, textNode);
119
+ tr.setSelection(TextSelection.create(tr.doc, pos + token.length));
120
+ dispatch(tr);
121
+ editor.commands.focus();
122
+ return true;
123
+ }
124
+ function onPillMousedown(pos) {
125
+ const view = editor.view;
126
+ const sel = view.state.selection;
127
+ if (sel instanceof NodeSelection && sel.from === pos) return openPill(pos, sel.node);
128
+ view.focus();
129
+ view.dispatch(view.state.tr.setSelection(NodeSelection.create(view.state.doc, pos)));
130
+ return true;
131
+ }
132
+ function editingRanges() {
133
+ const ranges = [];
134
+ editor.state.doc.descendants((node, pos) => {
135
+ if (node.isText && node.marks.some((m) => m.type.name === EXPR_EDITING_MARK)) {
136
+ ranges.push({ from: pos, to: pos + node.nodeSize });
137
+ }
138
+ });
139
+ return ranges;
140
+ }
141
+ function closeEditing() {
142
+ if (editor.isDestroyed) return;
143
+ const ranges = editingRanges();
144
+ if (!ranges.length) return;
145
+ const { state, dispatch } = editor.view;
146
+ const tr = state.tr;
147
+ for (const r of ranges.reverse()) {
148
+ const raw = state.doc.textBetween(r.from, r.to);
149
+ tr.replaceWith(r.from, r.to, textToInlineContent(raw).map((n) => state.schema.nodeFromJSON(n)));
150
+ }
151
+ dispatch(tr);
152
+ }
97
153
  const editor = new Editor({
98
- extensions: [Document, Paragraph, Text, History, ExprToken],
154
+ extensions: [Document, Paragraph, Text, History, ExprToken, ExprEditing],
99
155
  content: textToDoc(text.value, lineMode()),
100
156
  editorProps: {
101
- // Single line: swallow Enter (paragraph splits would break the field). A
102
- // multiline field wants exactly that split, so it lets the key through.
103
- handleKeyDown: (_view, event) => !props.multiline && event.key === "Enter" && !event.isComposing,
157
+ // A selected pill is not replaced by what is typed: a click on it selects it
158
+ // (`onPillMousedown`), and a click into the field followed by typing used to
159
+ // put text beside the value, never over it. Deleting it is Backspace's job.
160
+ handleTextInput: (view, _from, _to, input) => {
161
+ const sel = view.state.selection;
162
+ if (!(sel instanceof NodeSelection) || sel.node.type.name !== EXPR_TOKEN_NODE) return false;
163
+ const tr = view.state.tr.insertText(input, sel.to);
164
+ view.dispatch(tr.setSelection(TextSelection.create(tr.doc, sel.to + input.length)));
165
+ return true;
166
+ },
167
+ handleKeyDown: (view, event) => {
168
+ if (event.isComposing || event.key !== "Enter") return false;
169
+ const sel = view.state.selection;
170
+ if (sel instanceof NodeSelection && openPill(sel.from, sel.node)) return true;
171
+ return !props.multiline;
172
+ },
104
173
  attributes: editableAttributes()
105
174
  },
106
175
  onUpdate({ editor: ed }) {
@@ -114,9 +183,19 @@ const editor = new Editor({
114
183
  }
115
184
  if (raw !== text.value) emit("update:modelValue", raw);
116
185
  },
186
+ onSelectionUpdate({ editor: ed, transaction }) {
187
+ if (isHistoryTransaction(transaction)) return;
188
+ const { from, to } = ed.state.selection;
189
+ const ranges = editingRanges();
190
+ if (ranges.length && !ranges.some((r) => from >= r.from && to <= r.to)) closeEditing();
191
+ },
117
192
  onFocus() {
118
193
  if (insertHandler) insertHandler.value = insertToken;
119
194
  if (hasSuggestions.value) open.value = true;
195
+ },
196
+ onBlur() {
197
+ closeEditing();
198
+ emit("blur");
120
199
  }
121
200
  });
122
201
  onBeforeUnmount(() => {
@@ -280,9 +359,9 @@ function insert(expr) {
280
359
  v-if="listOpen"
281
360
  :id="pickerId"
282
361
  role="group"
283
- @keydown="onPickerKeydown"
284
362
  :aria-label="t('integration.nodeConfig.expression.picker.aria')"
285
363
  class="absolute right-0 top-full z-50 mt-1 flex max-h-72 w-80 flex-col rounded-md border border-black/[0.08] bg-white text-sm shadow-lg"
364
+ @keydown="onPickerKeydown"
286
365
  >
287
366
  <div class="shrink-0 border-b border-black/[0.06] p-1">
288
367
  <input
@@ -322,5 +401,5 @@ function insert(expr) {
322
401
  </template>
323
402
 
324
403
  <style>
325
- .expr-editor .ProseMirror{align-items:center;display:flex;height:100%;outline:none;overflow-x:auto;scrollbar-width:none}.expr-editor .ProseMirror p{line-height:30px;margin:0;white-space:pre}.expr-editor.expr-multiline{--expr-line:1.375rem;max-height:calc(var(--expr-line)*10 + .5rem);min-height:calc(var(--expr-line)*4 + .5rem);overflow-x:hidden;overflow-y:auto;padding-bottom:.25rem;padding-top:.25rem}.expr-editor.expr-multiline .ProseMirror{display:block;height:auto;overflow-x:visible}.expr-editor.expr-multiline .ProseMirror p{line-height:var(--expr-line);white-space:pre-wrap}.expr-pill{align-items:center;background:rgba(16,185,129,.1);border:1px solid rgba(16,185,129,.25);border-radius:6px;color:#047857;display:inline-flex;font-family:ui-sans-serif,system-ui,sans-serif;font-size:11px;height:20px;line-height:1;margin:0 2px;padding:0 7px;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap}.expr-pill.ProseMirror-selectednode{outline:2px solid rgba(16,185,129,.5)}
404
+ .expr-editor .ProseMirror{align-items:center;display:flex;height:100%;outline:none;overflow-x:auto;scrollbar-width:none}.expr-editor .ProseMirror p{line-height:30px;margin:0;white-space:pre}.expr-editor.expr-multiline{--expr-line:1.375rem;max-height:calc(var(--expr-line)*10 + .5rem);min-height:calc(var(--expr-line)*4 + .5rem);overflow-x:hidden;overflow-y:auto;padding-bottom:.25rem;padding-top:.25rem}.expr-editor.expr-multiline .ProseMirror{display:block;height:auto;overflow-x:visible}.expr-editor.expr-multiline .ProseMirror p{line-height:var(--expr-line);white-space:pre-wrap}.expr-pill{align-items:center;background:rgba(16,185,129,.1);border:1px solid rgba(16,185,129,.25);border-radius:6px;color:#047857;cursor:text;display:inline-flex;font-family:ui-sans-serif,system-ui,sans-serif;font-size:11px;height:20px;line-height:1;margin:0 2px;padding:0 7px;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;white-space:nowrap}.expr-editing{background:rgba(16,185,129,.08);border-radius:4px;color:#047857;font-family:ui-monospace,monospace}.expr-pill.ProseMirror-selectednode{outline:2px solid rgba(16,185,129,.5)}
326
405
  </style>
@@ -21,7 +21,9 @@ type __VLS_Props = {
21
21
  };
22
22
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
23
  "update:modelValue": (value: string) => any;
24
+ blur: () => any;
24
25
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
25
26
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
27
+ onBlur?: (() => any) | undefined;
26
28
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
29
  export default _default;
@@ -91,143 +91,143 @@ function onResizeEnd() {
91
91
 
92
92
  <template>
93
93
  <div class="relative">
94
- <NodeToolbar :is-visible="toolbarVisible" :position="Position.Top" :offset="8">
95
- <div
96
- class="flex items-center gap-1 rounded-lg border border-black/[0.06] bg-white px-1.5 py-1 shadow-md"
97
- @mouseenter="onHoverEnter"
98
- @mouseleave="onHoverLeave"
99
- >
100
- <button
101
- v-for="(c, i) in GROUP_COLORS"
102
- :key="i"
103
- type="button"
104
- class="size-6 rounded-full border transition hover:scale-110"
105
- :class="(data.group.color ?? 4) === i ? 'ring-2 ring-black/25 ring-offset-1' : ''"
106
- :style="{ backgroundColor: c.chip, borderColor: c.border }"
107
- :title="t(c.nameKey)"
108
- :aria-label="t(c.nameKey)"
109
- @click="data.actions?.setColor(i)"
110
- />
111
- <div class="mx-0.5 h-4 w-px bg-black/10" />
112
- <button
113
- type="button"
114
- class="flex size-6 items-center justify-center rounded-md text-muted-foreground transition hover:bg-muted/50 hover:text-foreground"
115
- :title="collapsed ? t('integration.canvas.group.action.expand') : t('integration.canvas.group.action.collapse')"
116
- @click="data.actions?.toggleCollapse()"
117
- >
118
- <component :is="collapsed ? ChevronsUpDown : ChevronsDownUp" :size="13" />
119
- </button>
120
- <button
121
- type="button"
122
- class="flex size-6 items-center justify-center rounded-md text-muted-foreground transition hover:bg-muted/50 hover:text-foreground"
123
- :title="t('integration.canvas.group.action.ungroup')"
124
- @click="data.actions?.ungroup()"
94
+ <NodeToolbar :is-visible="toolbarVisible" :position="Position.Top" :offset="8">
95
+ <div
96
+ class="flex items-center gap-1 rounded-lg border border-black/[0.06] bg-white px-1.5 py-1 shadow-md"
97
+ @mouseenter="onHoverEnter"
98
+ @mouseleave="onHoverLeave"
125
99
  >
126
- <Ungroup :size="13" />
127
- </button>
128
- <button
129
- type="button"
130
- class="flex size-6 items-center justify-center rounded-md text-muted-foreground transition hover:bg-rose-50 hover:text-rose-600"
131
- :title="t('integration.canvas.group.action.removeFrame')"
132
- @click="data.actions?.ungroup()"
133
- >
134
- <TrashBin :size="13" />
135
- </button>
136
- </div>
137
- </NodeToolbar>
100
+ <button
101
+ v-for="(c, i) in GROUP_COLORS"
102
+ :key="i"
103
+ type="button"
104
+ class="size-6 rounded-full border transition hover:scale-110"
105
+ :class="(data.group.color ?? 4) === i ? 'ring-2 ring-black/25 ring-offset-1' : ''"
106
+ :style="{ backgroundColor: c.chip, borderColor: c.border }"
107
+ :title="t(c.nameKey)"
108
+ :aria-label="t(c.nameKey)"
109
+ @click="data.actions?.setColor(i)"
110
+ />
111
+ <div class="mx-0.5 h-4 w-px bg-black/10" />
112
+ <button
113
+ type="button"
114
+ class="flex size-6 items-center justify-center rounded-md text-muted-foreground transition hover:bg-muted/50 hover:text-foreground"
115
+ :title="collapsed ? t('integration.canvas.group.action.expand') : t('integration.canvas.group.action.collapse')"
116
+ @click="data.actions?.toggleCollapse()"
117
+ >
118
+ <component :is="collapsed ? ChevronsUpDown : ChevronsDownUp" :size="13" />
119
+ </button>
120
+ <button
121
+ type="button"
122
+ class="flex size-6 items-center justify-center rounded-md text-muted-foreground transition hover:bg-muted/50 hover:text-foreground"
123
+ :title="t('integration.canvas.group.action.ungroup')"
124
+ @click="data.actions?.ungroup()"
125
+ >
126
+ <Ungroup :size="13" />
127
+ </button>
128
+ <button
129
+ type="button"
130
+ class="flex size-6 items-center justify-center rounded-md text-muted-foreground transition hover:bg-rose-50 hover:text-rose-600"
131
+ :title="t('integration.canvas.group.action.removeFrame')"
132
+ @click="data.actions?.ungroup()"
133
+ >
134
+ <TrashBin :size="13" />
135
+ </button>
136
+ </div>
137
+ </NodeToolbar>
138
138
 
139
- <!-- Collapsed: compact stand-in card with generic edge handles. -->
140
- <template v-if="collapsed">
141
- <Handle
142
- :id="inputHandleId('top')"
143
- type="target"
144
- :position="Position.Top"
145
- class="!size-3 !rounded-full !border-2 !border-white !bg-slate-500 !shadow-sm"
146
- />
147
- <!-- The collapsed card stops its own double-click unconditionally, which is
139
+ <!-- Collapsed: compact stand-in card with generic edge handles. -->
140
+ <template v-if="collapsed">
141
+ <Handle
142
+ :id="inputHandleId('top')"
143
+ type="target"
144
+ :position="Position.Top"
145
+ class="!size-3 !rounded-full !border-2 !border-white !bg-slate-500 !shadow-sm"
146
+ />
147
+ <!-- The collapsed card stops its own double-click unconditionally, which is
148
148
  safe: both read-only panels build every frame with `collapsed: false`, so
149
149
  this surface is the editor's alone. -->
150
- <div
151
- class="w-[220px] rounded-lg border-2 bg-white transition-all duration-150"
152
- :style="{ borderColor: color.border }"
153
- :class="selected ? 'shadow-[0_0_0_2px_rgba(59,130,246,0.2)]' : 'shadow-sm hover:shadow-md'"
154
- @mouseenter="onHoverEnter"
155
- @mouseleave="onHoverLeave"
156
- @dblclick.stop="data.actions?.toggleCollapse()"
157
- >
158
- <div class="flex items-center gap-2.5 px-3 py-2.5">
159
- <span class="flex size-8 shrink-0 items-center justify-center rounded-md text-white" :style="{ backgroundColor: color.chip }">
160
- <ChevronsUpDown :size="15" />
161
- </span>
162
- <div class="min-w-0 flex-1">
163
- <div class="truncate text-sm font-semibold leading-tight text-foreground">{{ label }}</div>
164
- <div class="mt-0.5 text-sm text-muted-foreground">{{ memberCountText }}</div>
150
+ <div
151
+ class="w-[220px] rounded-lg border-2 bg-white transition-all duration-150"
152
+ :style="{ borderColor: color.border }"
153
+ :class="selected ? 'shadow-[0_0_0_2px_rgba(59,130,246,0.2)]' : 'shadow-sm hover:shadow-md'"
154
+ @mouseenter="onHoverEnter"
155
+ @mouseleave="onHoverLeave"
156
+ @dblclick.stop="data.actions?.toggleCollapse()"
157
+ >
158
+ <div class="flex items-center gap-2.5 px-3 py-2.5">
159
+ <span class="flex size-8 shrink-0 items-center justify-center rounded-md text-white" :style="{ backgroundColor: color.chip }">
160
+ <ChevronsUpDown :size="15" />
161
+ </span>
162
+ <div class="min-w-0 flex-1">
163
+ <div class="truncate text-sm font-semibold leading-tight text-foreground">{{ label }}</div>
164
+ <div class="mt-0.5 text-sm text-muted-foreground">{{ memberCountText }}</div>
165
+ </div>
165
166
  </div>
166
167
  </div>
167
- </div>
168
- <Handle
169
- :id="outputHandleId('default', 'bottom')"
170
- type="source"
171
- :position="Position.Bottom"
172
- class="!size-3 !rounded-full !border-2 !border-white !bg-slate-500 !shadow-sm"
173
- />
174
- </template>
168
+ <Handle
169
+ :id="outputHandleId('default', 'bottom')"
170
+ type="source"
171
+ :position="Position.Bottom"
172
+ class="!size-3 !rounded-full !border-2 !border-white !bg-slate-500 !shadow-sm"
173
+ />
174
+ </template>
175
175
 
176
- <!-- Expanded: the frame behind the members. -->
177
- <div
178
- v-else
179
- class="pointer-events-none relative rounded-xl border-2 border-dashed transition-colors"
180
- :class="selected ? 'shadow-[0_0_0_2px_rgba(59,130,246,0.15)]' : ''"
181
- :style="{
176
+ <!-- Expanded: the frame behind the members. -->
177
+ <div
178
+ v-else
179
+ class="pointer-events-none relative rounded-xl border-2 border-dashed transition-colors"
180
+ :class="selected ? 'shadow-[0_0_0_2px_rgba(59,130,246,0.15)]' : ''"
181
+ :style="{
182
182
  width: `${frameW}px`,
183
183
  height: `${frameH}px`,
184
184
  backgroundColor: color.bg,
185
185
  borderColor: color.border
186
186
  }"
187
- >
188
- <div
189
- class="pointer-events-auto flex cursor-grab items-center gap-1.5 px-3 pt-1.5 active:cursor-grabbing"
190
- @mouseenter="onHoverEnter"
191
- @mouseleave="onHoverLeave"
192
187
  >
193
- <input
194
- v-if="editing"
195
- ref="inputEl"
196
- v-model="draft"
197
- :aria-label="t('integration.canvas.group.input.nameAria')"
198
- class="nodrag w-40 rounded border border-black/[0.1] bg-white px-1 py-0.5 text-sm font-semibold focus:outline-none focus:ring-2 focus:ring-primary/40"
199
- @blur="commitRename"
200
- @keydown.enter.prevent="commitRename"
201
- @keydown.stop
202
- @mousedown.stop
188
+ <div
189
+ class="pointer-events-auto flex cursor-grab items-center gap-1.5 px-3 pt-1.5 active:cursor-grabbing"
190
+ @mouseenter="onHoverEnter"
191
+ @mouseleave="onHoverLeave"
203
192
  >
204
- <span
205
- v-else
206
- class="select-none text-sm font-semibold"
193
+ <input
194
+ v-if="editing"
195
+ ref="inputEl"
196
+ v-model="draft"
197
+ :aria-label="t('integration.canvas.group.input.nameAria')"
198
+ class="nodrag w-40 rounded border border-black/[0.1] bg-white px-1 py-0.5 text-sm font-semibold focus:outline-none focus:ring-2 focus:ring-primary/40"
199
+ @blur="commitRename"
200
+ @keydown.enter.prevent="commitRename"
201
+ @keydown.stop
202
+ @mousedown.stop
203
+ >
204
+ <span
205
+ v-else
206
+ class="select-none text-sm font-semibold"
207
+ :style="{ color: color.chip }"
208
+ @dblclick="onLabelDoubleClick"
209
+ >
210
+ {{ label }}
211
+ </span>
212
+ <span class="select-none text-xs text-muted-foreground">· {{ memberCountText }}</span>
213
+ </div>
214
+
215
+ <!-- Bottom-right resize handle (editable frames only). -->
216
+ <div
217
+ v-if="editable"
218
+ class="nodrag pointer-events-auto absolute bottom-0 right-0 flex size-5 cursor-se-resize items-end justify-end p-1"
207
219
  :style="{ color: color.chip }"
208
- @dblclick="onLabelDoubleClick"
220
+ :title="t('integration.canvas.group.action.resize')"
221
+ @pointerdown="onResizeStart"
222
+ @pointermove="onResizeMove"
223
+ @pointerup="onResizeEnd"
224
+ @pointercancel="onResizeEnd"
209
225
  >
210
- {{ label }}
211
- </span>
212
- <span class="select-none text-xs text-muted-foreground">· {{ memberCountText }}</span>
213
- </div>
214
-
215
- <!-- Bottom-right resize handle (editable frames only). -->
216
- <div
217
- v-if="editable"
218
- class="nodrag pointer-events-auto absolute bottom-0 right-0 flex size-5 cursor-se-resize items-end justify-end p-1"
219
- :style="{ color: color.chip }"
220
- :title="t('integration.canvas.group.action.resize')"
221
- @pointerdown="onResizeStart"
222
- @pointermove="onResizeMove"
223
- @pointerup="onResizeEnd"
224
- @pointercancel="onResizeEnd"
225
- >
226
- <svg viewBox="0 0 8 8" class="size-2.5" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round">
227
- <path d="M7 1 1 7" />
228
- <path d="M7 4.5 4.5 7" />
229
- </svg>
226
+ <svg viewBox="0 0 8 8" class="size-2.5" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round">
227
+ <path d="M7 1 1 7" />
228
+ <path d="M7 4.5 4.5 7" />
229
+ </svg>
230
+ </div>
230
231
  </div>
231
232
  </div>
232
- </div>
233
233
  </template>
@@ -19,6 +19,7 @@ import { fromModelValue, toItemValue, toModelValue } from "../../utils/selectOpt
19
19
  import { credentialState } from "../../utils/credentialState";
20
20
  import { defaultsFor } from "../../utils/configDefaults";
21
21
  import { applyingFields, settingApplies, staleKeys } from "../../utils/settingCondition";
22
+ import { coerceSettingValue } from "../../utils/settingValue";
22
23
  const props = defineProps({
23
24
  field: { type: Object, required: true },
24
25
  config: { type: Object, required: true },
@@ -38,8 +39,20 @@ const emit = defineEmits(["set", "declare-state"]);
38
39
  const t = useIntegrationsT();
39
40
  const value = computed(() => props.config[props.field.key]);
40
41
  function write(v) {
42
+ emit("set", props.field.key, coerceSettingValue(props.field, v));
43
+ }
44
+ function writeTyped(v) {
41
45
  emit("set", props.field.key, v);
42
46
  }
47
+ function commitTyped() {
48
+ const committed = coerceSettingValue(props.field, value.value);
49
+ if (committed !== value.value) emit("set", props.field.key, committed);
50
+ }
51
+ const expressionText = computed(() => {
52
+ const v = value.value;
53
+ if (typeof v === "string") return v;
54
+ return typeof v === "number" ? String(v) : "";
55
+ });
43
56
  const exprHint = "${{ \u2026 }}";
44
57
  const descriptionText = computed(() => resolveLocalized(props.field.description));
45
58
  const inRow = computed(() => props.rowIndex !== void 0);
@@ -65,9 +78,10 @@ const formatError = computed(() => {
65
78
  }
66
79
  }
67
80
  }
68
- if (typeof v === "number") {
69
- if (val.min != null && v < val.min) return t("integration.nodeConfig.validation.min", { min: val.min });
70
- if (val.max != null && v > val.max) return t("integration.nodeConfig.validation.max", { max: val.max });
81
+ const n = coerceSettingValue(props.field, v);
82
+ if (typeof n === "number") {
83
+ if (val.min != null && n < val.min) return t("integration.nodeConfig.validation.min", { min: val.min });
84
+ if (val.max != null && n > val.max) return t("integration.nodeConfig.validation.max", { max: val.max });
71
85
  }
72
86
  return null;
73
87
  });
@@ -433,14 +447,15 @@ function setArrayItemField(index, fieldKey, v) {
433
447
  <!-- typed control flipped to expression mode -->
434
448
  <IntegrationsExpressionInput
435
449
  v-else-if="showExpression"
436
- :model-value="typeof value === 'string' ? value : ''"
450
+ :model-value="expressionText"
437
451
  :placeholder="resolveLocalized(field.placeholder)"
438
452
  :variables="variables"
439
453
  :upstream-outputs="upstreamOutputs"
440
454
  :invalid="invalid"
441
455
  :label="controlName"
442
456
  :multiline="isMultiline"
443
- @update:model-value="(v) => write(v)"
457
+ @update:model-value="(v) => writeTyped(v)"
458
+ @blur="commitTyped"
444
459
  />
445
460
 
446
461
  <!-- dynamic options — resolved at author time via config:resolve. Ahead of
@@ -193,9 +193,12 @@ const parameterFields = computed(() => applyingConfig.value.filter((f) => !SETTI
193
193
  const settingsFields = computed(() => applyingConfig.value.filter((f) => SETTINGS_FIELD_KEY.test(f.key)));
194
194
  const FOLD_ABOVE = 4;
195
195
  const ALWAYS_DRAWN = 3;
196
- const foldedFields = computed(
197
- () => parameterFields.value.length > FOLD_ABOVE ? parameterFields.value.slice(ALWAYS_DRAWN).filter((f) => !f.required) : []
198
- );
196
+ const foldedFields = computed(() => {
197
+ const fields = parameterFields.value;
198
+ if (fields.length <= FOLD_ABOVE) return [];
199
+ const lastRequired = fields.findLastIndex((f) => f.required);
200
+ return fields.slice(Math.max(ALWAYS_DRAWN, lastRequired + 1));
201
+ });
199
202
  const foldedKeys = computed(() => new Set(foldedFields.value.map((f) => f.key)));
200
203
  const foldAnchorKey = computed(() => foldedFields.value[0]?.key);
201
204
  function optionalShouldOpen() {
@@ -1215,7 +1218,7 @@ async function runTestStep() {
1215
1218
  </span>
1216
1219
  </button>
1217
1220
  <div v-show="!sectionClosed(s.id)" class="space-y-2 border-t border-black/[0.06] px-2 py-2">
1218
- <!-- These ports belong to an UPSTREAM node, so the sentence is that
1221
+ <!-- These ports belong to an UPSTREAM node, so the sentence is that
1219
1222
  node's. On a 300px column it is a tooltip rather than text: the
1220
1223
  values below are what this panel is for, and a sentence per port
1221
1224
  pushes them out of view. The readable copy is the Output tab
@@ -1233,50 +1236,50 @@ async function runTestStep() {
1233
1236
  sentence is read by resting on the port's name or the space around
1234
1237
  its rows rather than on a row itself. Where a reader is owed the
1235
1238
  text outright, that is the Output tab. -->
1236
- <div
1237
- v-for="p in s.ports"
1238
- :key="p.name"
1239
- class="space-y-1 pl-0.5"
1240
- :title="resolveLocalized(p.description) || void 0"
1241
- >
1242
- <div v-if="s.ports.length > 1 || p.kind !== 'default'" class="flex items-center gap-1.5">
1243
- <span class="size-1.5 rounded-full" :class="portDotClass(p.kind, p.name)" />
1244
- <span class="text-[10px] font-medium uppercase tracking-wider text-muted-foreground">{{ p.name }}</span>
1245
- </div>
1246
- <!-- Schema rows, n8n-style: glyph · key · sampled value. -->
1247
- <div class="space-y-px">
1248
- <button
1249
- type="button"
1250
- :class="rowClass"
1251
- :aria-label="nodeOutputExpr(s.id, p.name)"
1252
- :title="nodeOutputExpr(s.id, p.name)"
1253
- draggable="true"
1254
- @dragstart="onChipDragStart($event, nodeOutputExpr(s.id, p.name))"
1255
- @click="insertExpression(nodeOutputExpr(s.id, p.name))"
1256
- >
1257
- <span class="w-3 shrink-0 text-center font-semibold text-slate-400">{}</span>
1258
- <span class="shrink-0 font-medium"><span v-for="(seg, i) in highlightSegments(p.name)" :key="i" :class="seg.hit ? 'rounded-[2px] bg-amber-200/80' : ''">{{ seg.text }}</span></span>
1259
- </button>
1260
- <div class="space-y-px pl-3">
1239
+ <div
1240
+ v-for="p in s.ports"
1241
+ :key="p.name"
1242
+ class="space-y-1 pl-0.5"
1243
+ :title="resolveLocalized(p.description) || void 0"
1244
+ >
1245
+ <div v-if="s.ports.length > 1 || p.kind !== 'default'" class="flex items-center gap-1.5">
1246
+ <span class="size-1.5 rounded-full" :class="portDotClass(p.kind, p.name)" />
1247
+ <span class="text-[10px] font-medium uppercase tracking-wider text-muted-foreground">{{ p.name }}</span>
1248
+ </div>
1249
+ <!-- Schema rows, n8n-style: glyph · key · sampled value. -->
1250
+ <div class="space-y-px">
1261
1251
  <button
1262
- v-for="f in p.fields"
1263
- :key="f.name"
1264
1252
  type="button"
1265
1253
  :class="rowClass"
1266
- :aria-label="nodeOutputExpr(s.id, p.name, f.name)"
1267
- :title="nodeOutputExpr(s.id, p.name, f.name) + (f.dataType ? ' \xB7 ' + f.dataType : '')"
1254
+ :aria-label="nodeOutputExpr(s.id, p.name)"
1255
+ :title="nodeOutputExpr(s.id, p.name)"
1268
1256
  draggable="true"
1269
- @dragstart="onChipDragStart($event, nodeOutputExpr(s.id, p.name, f.name))"
1270
- @click="insertExpression(nodeOutputExpr(s.id, p.name, f.name))"
1257
+ @dragstart="onChipDragStart($event, nodeOutputExpr(s.id, p.name))"
1258
+ @click="insertExpression(nodeOutputExpr(s.id, p.name))"
1271
1259
  >
1272
- <span class="w-3 shrink-0 text-center font-semibold" :class="typeGlyph(f.dataType)?.cls ?? 'text-slate-300'">{{ typeGlyph(f.dataType)?.char ?? "\xB7" }}</span>
1273
- <span class="shrink-0"><span v-for="(seg, i) in highlightSegments(f.name)" :key="i" :class="seg.hit ? 'rounded-[2px] bg-amber-200/80' : ''">{{ seg.text }}</span></span>
1274
- <span v-if="chipValue(s.id, p.name, f.name) !== null" class="min-w-0 flex-1 truncate text-slate-400">{{ chipValue(s.id, p.name, f.name) }}</span>
1260
+ <span class="w-3 shrink-0 text-center font-semibold text-slate-400">{}</span>
1261
+ <span class="shrink-0 font-medium"><span v-for="(seg, i) in highlightSegments(p.name)" :key="i" :class="seg.hit ? 'rounded-[2px] bg-amber-200/80' : ''">{{ seg.text }}</span></span>
1275
1262
  </button>
1263
+ <div class="space-y-px pl-3">
1264
+ <button
1265
+ v-for="f in p.fields"
1266
+ :key="f.name"
1267
+ type="button"
1268
+ :class="rowClass"
1269
+ :aria-label="nodeOutputExpr(s.id, p.name, f.name)"
1270
+ :title="nodeOutputExpr(s.id, p.name, f.name) + (f.dataType ? ' \xB7 ' + f.dataType : '')"
1271
+ draggable="true"
1272
+ @dragstart="onChipDragStart($event, nodeOutputExpr(s.id, p.name, f.name))"
1273
+ @click="insertExpression(nodeOutputExpr(s.id, p.name, f.name))"
1274
+ >
1275
+ <span class="w-3 shrink-0 text-center font-semibold" :class="typeGlyph(f.dataType)?.cls ?? 'text-slate-300'">{{ typeGlyph(f.dataType)?.char ?? "\xB7" }}</span>
1276
+ <span class="shrink-0"><span v-for="(seg, i) in highlightSegments(f.name)" :key="i" :class="seg.hit ? 'rounded-[2px] bg-amber-200/80' : ''">{{ seg.text }}</span></span>
1277
+ <span v-if="chipValue(s.id, p.name, f.name) !== null" class="min-w-0 flex-1 truncate text-slate-400">{{ chipValue(s.id, p.name, f.name) }}</span>
1278
+ </button>
1279
+ </div>
1276
1280
  </div>
1277
1281
  </div>
1278
1282
  </div>
1279
- </div>
1280
1283
  </div>
1281
1284
  </div>
1282
1285
 
@@ -1838,9 +1841,9 @@ async function runTestStep() {
1838
1841
  :depth="0"
1839
1842
  :variables="variables"
1840
1843
  :state-namespaces="offeredStateNamespaces"
1841
- @declare-state="stageStateNamespace"
1842
1844
  :upstream-outputs="upstreamOutputs"
1843
1845
  :refused="refusedFields?.[field.key]"
1846
+ @declare-state="stageStateNamespace"
1844
1847
  @set="(k, v) => writeConfig(k, v)"
1845
1848
  />
1846
1849
  </template>
@@ -1881,9 +1884,9 @@ async function runTestStep() {
1881
1884
  :depth="0"
1882
1885
  :variables="variables"
1883
1886
  :state-namespaces="offeredStateNamespaces"
1884
- @declare-state="stageStateNamespace"
1885
1887
  :upstream-outputs="upstreamOutputs"
1886
1888
  :refused="refusedFields?.[field.key]"
1889
+ @declare-state="stageStateNamespace"
1887
1890
  @set="(k, v) => writeConfig(k, v)"
1888
1891
  />
1889
1892
  </div>