@pipe0/react 0.2.3 → 0.2.5

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @pipe0/elements-react
2
2
 
3
+ ## 0.2.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 5bc8c5b: Add bucket pipes
8
+ - Updated dependencies [5bc8c5b]
9
+ - @pipe0/base@0.5.5
10
+
11
+ ## 0.2.4
12
+
13
+ ### Patch Changes
14
+
15
+ - ddcacd1: Fix zod resolver imports
16
+ - Updated dependencies [ddcacd1]
17
+ - @pipe0/base@0.5.4
18
+
3
19
  ## 0.2.3
4
20
 
5
21
  ### Patch Changes
@@ -1,12 +1,154 @@
1
1
  import { cn } from "../../../lib/utils.mjs";
2
2
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../ui/select.mjs";
3
3
  import { WidgetStrip } from "../../../widgets/widget-strip.mjs";
4
+ import { SuggestCombobox } from "../../internal/combobox/suggest-combobox.mjs";
5
+ import { useMemo, useState } from "react";
4
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { tryDecodeBucketContract } from "@pipe0/base";
5
8
 
6
9
  //#region src/components/defaults/adapters/context-select-input.tsx
10
+ /**
11
+ * Compound variant (`meta.mappingPath` set — the bucket input): one component
12
+ * owning the slug select/create AND the entry-field mapping + contract at
13
+ * sibling paths. Two modes, decided by the contract:
14
+ *
15
+ * - EXISTING bucket (selected option carries `data.contract`): the bucket's
16
+ * schema fields are listed, each mapped to a row column (same-named columns
17
+ * prefill).
18
+ * - NEW slug (created via `Add "<name>"`): a plain fields picker — the picked
19
+ * column names become the new bucket's schema on first write.
20
+ *
21
+ * The sibling paths are unregistered in the payload schema (they render no
22
+ * input of their own), so this adapter is their only writer — local state
23
+ * mirrors them and `form.setValue` keeps the payload in sync.
24
+ */
25
+ function MappedContextSelect(field) {
26
+ const meta = field.meta;
27
+ const mappingPath = meta.mappingPath;
28
+ const contractPath = meta.contractPath;
29
+ const fieldOptions = meta.fieldOptions ?? [];
30
+ const keyLabel = meta.keyLabel ?? "Field";
31
+ const [mapping, setMappingState] = useState(() => field.form.getValues(mappingPath) ?? []);
32
+ const [contract, setContractState] = useState(() => field.form.getValues(contractPath) ?? "");
33
+ const writeMapping = (next) => {
34
+ setMappingState(next);
35
+ field.form.setValue(mappingPath, next, {
36
+ shouldDirty: true,
37
+ shouldTouch: true
38
+ });
39
+ };
40
+ const writeContract = (next) => {
41
+ setContractState(next);
42
+ field.form.setValue(contractPath, next, {
43
+ shouldDirty: true,
44
+ shouldTouch: true
45
+ });
46
+ };
47
+ const schema = useMemo(() => tryDecodeBucketContract(contract), [contract]);
48
+ const onPick = (value) => {
49
+ field.onSelect(value);
50
+ if (!value) {
51
+ writeContract("");
52
+ writeMapping([]);
53
+ return;
54
+ }
55
+ const optionContract = field.options.find((o) => o.value === value)?.data?.contract ?? "";
56
+ writeContract(optionContract);
57
+ const optionSchema = tryDecodeBucketContract(optionContract);
58
+ if (optionSchema) writeMapping(Object.keys(optionSchema.input_fields).map((bucketField) => ({
59
+ field_name: fieldOptions.some((o) => o.value === bucketField) ? bucketField : "",
60
+ entry_field: bucketField
61
+ })));
62
+ else writeMapping([]);
63
+ };
64
+ return /* @__PURE__ */ jsxs("div", {
65
+ "data-p0": "input",
66
+ className: cn("pz:flex pz:flex-col pz:gap-2", field.pending && "pz:opacity-60"),
67
+ children: [
68
+ /* @__PURE__ */ jsx(SuggestCombobox, {
69
+ value: field.selectedValue ? [field.selectedValue] : [],
70
+ onChange: (next) => onPick(next.at(-1) ?? ""),
71
+ options: field.options,
72
+ allowCreate: true,
73
+ disabled: field.pending,
74
+ ariaInvalid: !!field.error,
75
+ placeholder: field.pending ? "Loading…" : field.meta.placeholder ?? "",
76
+ emptyLabel: "Type a name to create one"
77
+ }),
78
+ field.suggestionsDisabled && /* @__PURE__ */ jsx("div", {
79
+ className: "pz:text-xs pz:text-muted-foreground pz:italic",
80
+ children: field.suggestionsDisabledReason ?? "Suggestions unavailable"
81
+ }),
82
+ field.selectedValue && schema && /* @__PURE__ */ jsxs("div", {
83
+ className: "pz:flex pz:flex-col pz:gap-1",
84
+ children: [/* @__PURE__ */ jsxs("p", {
85
+ className: "pz:text-xs pz:text-muted-foreground",
86
+ children: [
87
+ "A bucket entry is identified by the field",
88
+ Object.keys(schema.input_fields).length > 1 ? "s" : "",
89
+ " below. Pick the row column that supplies each one."
90
+ ]
91
+ }), mapping.map((entry, idx) => /* @__PURE__ */ jsxs("div", {
92
+ className: "pz:flex pz:items-center pz:gap-2",
93
+ children: [/* @__PURE__ */ jsxs("span", {
94
+ className: "pz:basis-1/3 pz:truncate pz:text-xs pz:text-muted-foreground",
95
+ title: entry.entry_field,
96
+ children: [entry.entry_field, " ←"]
97
+ }), /* @__PURE__ */ jsx("div", {
98
+ className: "pz:flex-1",
99
+ children: /* @__PURE__ */ jsx(SuggestCombobox, {
100
+ value: entry.field_name ? [entry.field_name] : [],
101
+ onChange: (next) => writeMapping(mapping.map((m, j) => j === idx ? {
102
+ ...m,
103
+ field_name: next.at(-1) ?? ""
104
+ } : m)),
105
+ options: fieldOptions,
106
+ ariaInvalid: !entry.field_name,
107
+ placeholder: `Column for ${keyLabel.toLowerCase()} "${entry.entry_field}"…`,
108
+ emptyLabel: "No columns available"
109
+ })
110
+ })]
111
+ }, entry.entry_field ?? entry.field_name))]
112
+ }),
113
+ field.selectedValue && !schema && /* @__PURE__ */ jsxs("div", {
114
+ className: "pz:flex pz:flex-col pz:gap-1",
115
+ children: [/* @__PURE__ */ jsx("p", {
116
+ className: "pz:text-xs pz:text-muted-foreground",
117
+ children: "New bucket: pick the column(s) that identify an entry. Their names become the bucket's schema when it is created on first write."
118
+ }), /* @__PURE__ */ jsx(SuggestCombobox, {
119
+ value: mapping.map((m) => m.field_name),
120
+ onChange: (next) => writeMapping(next.map((field_name) => ({ field_name }))),
121
+ options: fieldOptions,
122
+ ariaInvalid: mapping.length === 0,
123
+ placeholder: "Select identifying columns…",
124
+ emptyLabel: "No columns available",
125
+ reorderable: true
126
+ })]
127
+ })
128
+ ]
129
+ });
130
+ }
7
131
  function ContextSelectInputAdapter(field) {
8
132
  const hasOptions = field.options.length > 0;
9
133
  const selectedOption = field.options.find((o) => o.value === field.selectedValue);
134
+ if (field.meta.mappingPath) return /* @__PURE__ */ jsx(MappedContextSelect, { ...field });
135
+ if (field.meta.allowCreate) return /* @__PURE__ */ jsxs("div", {
136
+ "data-p0": "input",
137
+ className: cn("pz:flex pz:flex-col pz:gap-1", field.pending && "pz:opacity-60"),
138
+ children: [/* @__PURE__ */ jsx(SuggestCombobox, {
139
+ value: field.selectedValue ? [field.selectedValue] : [],
140
+ onChange: (next) => field.onSelect(next.at(-1) ?? ""),
141
+ options: field.options,
142
+ allowCreate: true,
143
+ disabled: field.pending,
144
+ ariaInvalid: !!field.error,
145
+ placeholder: field.pending ? "Loading…" : field.meta.placeholder ?? "",
146
+ emptyLabel: "Type a name to create one"
147
+ }), field.suggestionsDisabled && /* @__PURE__ */ jsxs("div", {
148
+ className: "pz:text-xs pz:gap-y-1 pz:text-muted-foreground pz:italic",
149
+ children: [field.suggestionsDisabledReason ?? "Suggestions unavailable", " "]
150
+ })]
151
+ });
10
152
  const placeholder = field.pending ? "Loading…" : field.meta.placeholder ?? "";
11
153
  return /* @__PURE__ */ jsxs("div", {
12
154
  "data-p0": "input",
@@ -1 +1 @@
1
- {"version":3,"file":"context-select-input.mjs","names":[],"sources":["../../../../src/components/defaults/adapters/context-select-input.tsx"],"sourcesContent":["import type { StoreOption } from \"@pipe0/base\";\nimport { cn } from \"../../../lib/utils.js\";\nimport type { FieldHandle } from \"../../../types/field-handle.js\";\nimport { WidgetStrip } from \"../../../widgets/widget-strip.js\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"../../ui/select.js\";\n\nexport function ContextSelectInputAdapter(field: FieldHandle<\"context_select_input\">) {\n const hasOptions = field.options.length > 0;\n const selectedOption = field.options.find((o) => o.value === field.selectedValue);\n\n // ONE always-controlled Select across every state (loading / gated / ready).\n // Rendering a separate <Select> tree per state — or using\n // `value={... || undefined}` — flips Base UI between uncontrolled and\n // controlled, which warns and now actually fires on the loading→ready\n // transition (the field finally re-renders through it). `null` is Base UI's\n // controlled \"no selection\" sentinel (cf. connector-input + the `v === null`\n // guard below), so the value is never `undefined` and the control stays\n // controlled for its whole lifetime. State differences are expressed only via\n // `disabled` / `placeholder` / the helper line below — not via remounting.\n const placeholder = field.pending ? \"Loading…\" : (field.meta.placeholder ?? \"\");\n\n return (\n <div\n data-p0=\"input\"\n className={cn(\"pz:flex pz:flex-col pz:gap-1\", field.pending && \"pz:opacity-60\")}\n >\n <Select\n value={field.selectedValue || null}\n onValueChange={(v) => {\n if (v === null) return;\n field.onSelect(v);\n }}\n name={field.path}\n disabled={field.pending || field.suggestionsDisabled || !hasOptions}\n >\n <SelectTrigger id={field.id} aria-invalid={!!field.error} className=\"pz:w-full\">\n <SelectValue placeholder={placeholder}>\n {selectedOption ? (\n <span className=\"pz:flex pz:items-center pz:gap-2\">\n <WidgetStrip widgets={selectedOption.widgets} />\n <span>{selectedOption.label}</span>\n </span>\n ) : undefined}\n </SelectValue>\n </SelectTrigger>\n <SelectContent>\n {field.options.map((opt: StoreOption) => (\n <SelectItem key={opt.value} value={opt.value} label={opt.label}>\n <span className=\"pz:flex pz:items-center pz:gap-2\">\n <WidgetStrip widgets={opt.widgets} />\n <span>{opt.label}</span>\n </span>\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n {field.suggestionsDisabled ? (\n <div className=\"pz:text-xs pz:gap-y-1 pz:text-muted-foreground pz:italic\">\n {field.suggestionsDisabledReason ?? \"Suggestions unavailable\"}{\" \"}\n </div>\n ) : !field.pending && !hasOptions ? (\n <span className=\"pz:text-xs pz:text-muted-foreground\">No fields available</span>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;AAMA,SAAgB,0BAA0B,OAA4C;CACpF,MAAM,aAAa,MAAM,QAAQ,SAAS;CAC1C,MAAM,iBAAiB,MAAM,QAAQ,MAAM,MAAM,EAAE,UAAU,MAAM,cAAc;CAWjF,MAAM,cAAc,MAAM,UAAU,aAAc,MAAM,KAAK,eAAe;AAE5E,QACE,qBAAC,OAAD;EACE,WAAQ;EACR,WAAW,GAAG,gCAAgC,MAAM,WAAW,gBAAgB;YAFjF,CAIE,qBAAC,QAAD;GACE,OAAO,MAAM,iBAAiB;GAC9B,gBAAgB,MAAM;AACpB,QAAI,MAAM,KAAM;AAChB,UAAM,SAAS,EAAE;;GAEnB,MAAM,MAAM;GACZ,UAAU,MAAM,WAAW,MAAM,uBAAuB,CAAC;aAP3D,CASE,oBAAC,eAAD;IAAe,IAAI,MAAM;IAAI,gBAAc,CAAC,CAAC,MAAM;IAAO,WAAU;cAClE,oBAAC,aAAD;KAA0B;eACvB,iBACC,qBAAC,QAAD;MAAM,WAAU;gBAAhB,CACE,oBAAC,aAAD,EAAa,SAAS,eAAe,SAAW,GAChD,oBAAC,QAAD,YAAO,eAAe,OAAa,EAC9B;UACL;KACQ;IACA,GAChB,oBAAC,eAAD,YACG,MAAM,QAAQ,KAAK,QAClB,oBAAC,YAAD;IAA4B,OAAO,IAAI;IAAO,OAAO,IAAI;cACvD,qBAAC,QAAD;KAAM,WAAU;eAAhB,CACE,oBAAC,aAAD,EAAa,SAAS,IAAI,SAAW,GACrC,oBAAC,QAAD,YAAO,IAAI,OAAa,EACnB;;IACI,EALI,IAAI,MAKR,CACb,EACY,EACT;MACR,MAAM,sBACL,qBAAC,OAAD;GAAK,WAAU;aAAf,CACG,MAAM,6BAA6B,2BAA2B,IAC3D;OACJ,CAAC,MAAM,WAAW,CAAC,aACrB,oBAAC,QAAD;GAAM,WAAU;aAAsC;GAA0B,IAC9E,KACA"}
1
+ {"version":3,"file":"context-select-input.mjs","names":[],"sources":["../../../../src/components/defaults/adapters/context-select-input.tsx"],"sourcesContent":["import { type StoreOption, tryDecodeBucketContract } from \"@pipe0/base\";\nimport { useMemo, useState } from \"react\";\nimport { cn } from \"../../../lib/utils.js\";\nimport type { FieldHandle } from \"../../../types/field-handle.js\";\nimport { WidgetStrip } from \"../../../widgets/widget-strip.js\";\nimport { SuggestCombobox } from \"../../internal/combobox/suggest-combobox.js\";\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from \"../../ui/select.js\";\n\ntype MappingEntry = { field_name: string; entry_field?: string };\n\n/**\n * Compound variant (`meta.mappingPath` set — the bucket input): one component\n * owning the slug select/create AND the entry-field mapping + contract at\n * sibling paths. Two modes, decided by the contract:\n *\n * - EXISTING bucket (selected option carries `data.contract`): the bucket's\n * schema fields are listed, each mapped to a row column (same-named columns\n * prefill).\n * - NEW slug (created via `Add \"<name>\"`): a plain fields picker — the picked\n * column names become the new bucket's schema on first write.\n *\n * The sibling paths are unregistered in the payload schema (they render no\n * input of their own), so this adapter is their only writer — local state\n * mirrors them and `form.setValue` keeps the payload in sync.\n */\nfunction MappedContextSelect(field: FieldHandle<\"context_select_input\">) {\n const meta = field.meta;\n const mappingPath = meta.mappingPath as string;\n const contractPath = meta.contractPath as string;\n const fieldOptions = meta.fieldOptions ?? [];\n const keyLabel = meta.keyLabel ?? \"Field\";\n\n const [mapping, setMappingState] = useState<MappingEntry[]>(\n () => (field.form.getValues(mappingPath) as MappingEntry[]) ?? [],\n );\n const [contract, setContractState] = useState<string>(\n () => (field.form.getValues(contractPath) as string) ?? \"\",\n );\n const writeMapping = (next: MappingEntry[]) => {\n setMappingState(next);\n field.form.setValue(mappingPath, next, { shouldDirty: true, shouldTouch: true });\n };\n const writeContract = (next: string) => {\n setContractState(next);\n field.form.setValue(contractPath, next, { shouldDirty: true, shouldTouch: true });\n };\n\n const schema = useMemo(() => tryDecodeBucketContract(contract), [contract]);\n\n const onPick = (value: string) => {\n field.onSelect(value);\n if (!value) {\n writeContract(\"\");\n writeMapping([]);\n return;\n }\n const option = field.options.find((o) => o.value === value);\n const optionContract = option?.data?.contract ?? \"\";\n writeContract(optionContract);\n const optionSchema = tryDecodeBucketContract(optionContract);\n if (optionSchema) {\n // Existing bucket: one mapping row per schema field, prefilled with the\n // same-named row column when it exists.\n writeMapping(\n Object.keys(optionSchema.input_fields).map((bucketField) => ({\n field_name: fieldOptions.some((o) => o.value === bucketField) ? bucketField : \"\",\n entry_field: bucketField,\n })),\n );\n } else {\n // Freshly created slug: start with an empty picker.\n writeMapping([]);\n }\n };\n\n return (\n <div\n data-p0=\"input\"\n className={cn(\"pz:flex pz:flex-col pz:gap-2\", field.pending && \"pz:opacity-60\")}\n >\n <SuggestCombobox\n value={field.selectedValue ? [field.selectedValue] : []}\n onChange={(next) => onPick(next.at(-1) ?? \"\")}\n options={field.options}\n allowCreate\n disabled={field.pending}\n ariaInvalid={!!field.error}\n placeholder={field.pending ? \"Loading…\" : (field.meta.placeholder ?? \"\")}\n emptyLabel=\"Type a name to create one\"\n />\n {field.suggestionsDisabled && (\n <div className=\"pz:text-xs pz:text-muted-foreground pz:italic\">\n {field.suggestionsDisabledReason ?? \"Suggestions unavailable\"}\n </div>\n )}\n\n {field.selectedValue && schema && (\n <div className=\"pz:flex pz:flex-col pz:gap-1\">\n <p className=\"pz:text-xs pz:text-muted-foreground\">\n A bucket entry is identified by the field\n {Object.keys(schema.input_fields).length > 1 ? \"s\" : \"\"} below. Pick the row column that\n supplies each one.\n </p>\n {mapping.map((entry, idx) => (\n <div\n key={entry.entry_field ?? entry.field_name}\n className=\"pz:flex pz:items-center pz:gap-2\"\n >\n <span\n className=\"pz:basis-1/3 pz:truncate pz:text-xs pz:text-muted-foreground\"\n title={entry.entry_field}\n >\n {entry.entry_field} ←\n </span>\n <div className=\"pz:flex-1\">\n <SuggestCombobox\n value={entry.field_name ? [entry.field_name] : []}\n onChange={(next) =>\n writeMapping(\n mapping.map((m, j) =>\n j === idx ? { ...m, field_name: next.at(-1) ?? \"\" } : m,\n ),\n )\n }\n options={fieldOptions}\n ariaInvalid={!entry.field_name}\n placeholder={`Column for ${keyLabel.toLowerCase()} \"${entry.entry_field}\"…`}\n emptyLabel=\"No columns available\"\n />\n </div>\n </div>\n ))}\n </div>\n )}\n\n {field.selectedValue && !schema && (\n <div className=\"pz:flex pz:flex-col pz:gap-1\">\n <p className=\"pz:text-xs pz:text-muted-foreground\">\n New bucket: pick the column(s) that identify an entry. Their names become the bucket's\n schema when it is created on first write.\n </p>\n <SuggestCombobox\n value={mapping.map((m) => m.field_name)}\n onChange={(next) => writeMapping(next.map((field_name) => ({ field_name })))}\n options={fieldOptions}\n ariaInvalid={mapping.length === 0}\n placeholder=\"Select identifying columns…\"\n emptyLabel=\"No columns available\"\n reorderable\n />\n </div>\n )}\n </div>\n );\n}\n\nexport function ContextSelectInputAdapter(field: FieldHandle<\"context_select_input\">) {\n const hasOptions = field.options.length > 0;\n const selectedOption = field.options.find((o) => o.value === field.selectedValue);\n\n // Compound variant: slug + dependent entry-field mapping (see MappedContextSelect).\n if (field.meta.mappingPath) {\n return <MappedContextSelect {...field} />;\n }\n\n // Creatable variant: a single-select combobox where typing an unknown value\n // offers an inline `Add \"<name>\"` row. Selection REPLACES (no maxItems gate —\n // that would require removing the chip before picking another option).\n if (field.meta.allowCreate) {\n return (\n <div\n data-p0=\"input\"\n className={cn(\"pz:flex pz:flex-col pz:gap-1\", field.pending && \"pz:opacity-60\")}\n >\n <SuggestCombobox\n value={field.selectedValue ? [field.selectedValue] : []}\n onChange={(next) => field.onSelect(next.at(-1) ?? \"\")}\n options={field.options}\n allowCreate\n disabled={field.pending}\n ariaInvalid={!!field.error}\n placeholder={field.pending ? \"Loading…\" : (field.meta.placeholder ?? \"\")}\n emptyLabel=\"Type a name to create one\"\n />\n {field.suggestionsDisabled && (\n <div className=\"pz:text-xs pz:gap-y-1 pz:text-muted-foreground pz:italic\">\n {field.suggestionsDisabledReason ?? \"Suggestions unavailable\"}{\" \"}\n </div>\n )}\n </div>\n );\n }\n\n // ONE always-controlled Select across every state (loading / gated / ready).\n // Rendering a separate <Select> tree per state — or using\n // `value={... || undefined}` — flips Base UI between uncontrolled and\n // controlled, which warns and now actually fires on the loading→ready\n // transition (the field finally re-renders through it). `null` is Base UI's\n // controlled \"no selection\" sentinel (cf. connector-input + the `v === null`\n // guard below), so the value is never `undefined` and the control stays\n // controlled for its whole lifetime. State differences are expressed only via\n // `disabled` / `placeholder` / the helper line below — not via remounting.\n const placeholder = field.pending ? \"Loading…\" : (field.meta.placeholder ?? \"\");\n\n return (\n <div\n data-p0=\"input\"\n className={cn(\"pz:flex pz:flex-col pz:gap-1\", field.pending && \"pz:opacity-60\")}\n >\n <Select\n value={field.selectedValue || null}\n onValueChange={(v) => {\n if (v === null) return;\n field.onSelect(v);\n }}\n name={field.path}\n disabled={field.pending || field.suggestionsDisabled || !hasOptions}\n >\n <SelectTrigger id={field.id} aria-invalid={!!field.error} className=\"pz:w-full\">\n <SelectValue placeholder={placeholder}>\n {selectedOption ? (\n <span className=\"pz:flex pz:items-center pz:gap-2\">\n <WidgetStrip widgets={selectedOption.widgets} />\n <span>{selectedOption.label}</span>\n </span>\n ) : undefined}\n </SelectValue>\n </SelectTrigger>\n <SelectContent>\n {field.options.map((opt: StoreOption) => (\n <SelectItem key={opt.value} value={opt.value} label={opt.label}>\n <span className=\"pz:flex pz:items-center pz:gap-2\">\n <WidgetStrip widgets={opt.widgets} />\n <span>{opt.label}</span>\n </span>\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n {field.suggestionsDisabled ? (\n <div className=\"pz:text-xs pz:gap-y-1 pz:text-muted-foreground pz:italic\">\n {field.suggestionsDisabledReason ?? \"Suggestions unavailable\"}{\" \"}\n </div>\n ) : !field.pending && !hasOptions ? (\n <span className=\"pz:text-xs pz:text-muted-foreground\">No fields available</span>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAS,oBAAoB,OAA4C;CACvE,MAAM,OAAO,MAAM;CACnB,MAAM,cAAc,KAAK;CACzB,MAAM,eAAe,K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;IACA,GAChB,oBAAC,eAAD,YACG,MAAM,QAAQ,KAAK,QAClB,oBAAC,YAAD;IAA4B,OAAO,IAAI;IAAO,OAAO,IAAI;cACvD,qBAAC,QAAD;KAAM,WAAU;eAAhB,CACE,oBAAC,aAAD,EAAa,SAAS,IAAI,SAAW,GACrC,oBAAC,QAAD,YAAO,IAAI,OAAa,EACnB;;IACI,EALI,IAAI,MAKR,CACb,EACY,EACT;MACR,MAAM,sBACL,qBAAC,OAAD;GAAK,WAAU;aAAf,CACG,MAAM,6BAA6B,2BAA2B,IAC3D;OACJ,CAAC,MAAM,WAAW,CAAC,aACrB,oBAAC,QAAD;GAAM,WAAU;aAAsC;GAA0B,IAC9E,KACA"}
@@ -1 +1 @@
1
- {"version":3,"file":"tagged-ordered-multi-create-input.mjs","names":[],"sources":["../../../../src/components/defaults/adapters/tagged-ordered-multi-create-input.tsx"],"sourcesContent":["import {\n closestCenter,\n DndContext,\n type DragEndEvent,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport { horizontalListSortingStrategy, SortableContext, useSortable } from \"@dnd-kit/sortable\";\nimport type { PipesFieldDefinitionWithName, WidgetsByKind } from \"@pipe0/base\";\nimport { XIcon } from \"lucide-react\";\nimport { type CSSProperties, type ReactNode, useEffect, useId, useMemo, useRef, useState } from \"react\";\nimport useSWR from \"swr\";\nimport { useDebouncedFn } from \"../../../hooks/use-debounced-fn.js\";\nimport { cn } from \"../../../lib/utils.js\";\nimport type { FieldHandle } from \"../../../types/field-handle.js\";\nimport { FieldTypeBadge } from \"../../../widgets/field-type-badge.js\";\nimport { WidgetStrip } from \"../../../widgets/widget-strip.js\";\nimport { IconGripVertical } from \"../../internal/icons.js\";\nimport { filterOptions, type PayloadOption } from \"../../internal/multi-select-popover-trigger.js\";\nimport { Button } from \"../../ui/button.js\";\nimport {\n Combobox,\n ComboboxChips,\n ComboboxChipsInput,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxGroup,\n ComboboxItem,\n ComboboxLabel,\n ComboboxList,\n ComboboxTrigger,\n useComboboxAnchor,\n} from \"../../ui/combobox.js\";\n\n/**\n * Detects whether a raw value is a single, exclusive Liquid field reference\n * (e.g. `\"{{ company_domain }}\"` or `\"{{ field | filter }}\"`). Mixed content\n * such as `\"Head of {{ company }}\"` returns false and is treated as text.\n */\nconst PURE_TAG_RE =\n /^\\s*\\{\\{\\s*([a-zA-Z_][a-zA-Z0-9_.]*)(?:\\s*\\|\\s*[^}]+)?\\s*\\}\\}\\s*$/;\n\ntype ParsedChip =\n | { kind: \"field\"; fieldName: string; raw: string }\n | { kind: \"text\"; text: string; raw: string };\n\nfunction parseChip(raw: string): ParsedChip {\n const m = raw.match(PURE_TAG_RE);\n if (m) return { kind: \"field\", fieldName: m[1], raw };\n return { kind: \"text\", text: raw, raw };\n}\n\n/**\n * Sky-blue pill matching `TagChipDecoration`'s field chip styling so a\n * field-reference chip outside tiptap reads identically to one inside\n * `LiquidEditor`.\n */\nconst FIELD_CHIP_CLASS =\n \"pz:flex pz:h-[calc(--spacing(5.25))] pz:w-fit pz:items-center pz:gap-1 pz:rounded-sm pz:bg-sky-100 pz:pl-0.5 pz:pr-0 pz:text-xs pz:font-medium pz:whitespace-nowrap pz:text-sky-900\";\n\nconst TEXT_CHIP_CLASS =\n \"pz:flex pz:h-[calc(--spacing(5.25))] pz:w-fit pz:items-center pz:gap-1 pz:rounded-sm pz:bg-muted pz:pl-0.5 pz:pr-0 pz:text-xs pz:font-medium pz:whitespace-nowrap pz:text-foreground\";\n\n/** Drop target for an item carried by the Combobox value channel. */\ntype Item = {\n /** Canonical value to store in the field — text as-is, or `{{ fieldName }}`. */\n value: string;\n /** Display label in the dropdown. */\n label: string;\n kind: \"field\" | \"text\" | \"create\";\n widgets?: WidgetsByKind;\n};\n\nexport function TaggedOrderedMultiCreateInputAdapter(\n field: FieldHandle<\"tagged_ordered_multi_create_input\">,\n) {\n const { items, setItems, options, loadOptions, inputFields, meta } = field;\n const maxItems = meta.maxItems;\n const placeholder = meta.placeholder;\n\n const [input, setInput] = useState(\"\");\n const [debouncedQuery, setDebouncedQuery] = useState(\"\");\n const [open, setOpen] = useState(false);\n\n const isAsync = typeof loadOptions === \"function\";\n const debouncedSetQuery = useDebouncedFn((q: string) => setDebouncedQuery(q), 300);\n\n // Async suggestions — same SWR pattern as `SuggestCombobox`.\n const instanceId = useId();\n const swrKey: readonly [string, string] | null =\n loadOptions && (open || debouncedQuery !== \"\") ? [instanceId, debouncedQuery] : null;\n const {\n data: asyncResults = null,\n isLoading: swrIsLoading,\n isValidating: swrIsValidating,\n } = useSWR<PayloadOption[], Error, readonly [string, string] | null>(\n swrKey,\n async ([, q]) => {\n if (!loadOptions) return [];\n const opts = await loadOptions(q);\n return opts.filter((o) => !!o.value);\n },\n { keepPreviousData: true },\n );\n const loading = swrIsLoading || swrIsValidating;\n\n const trimmedInput = input.trim();\n\n const fieldRefItems = useMemo<Item[]>(() => {\n if (!inputFields?.length) return [];\n const q = trimmedInput.toLowerCase();\n return inputFields\n .filter((f) => !q || f.resolvedName.toLowerCase().includes(q))\n .map<Item>((f) => ({\n value: `{{ ${f.resolvedName} }}`,\n label: f.resolvedName,\n kind: \"field\",\n }));\n }, [inputFields, trimmedInput]);\n\n const suggestionItems = useMemo<Item[]>(() => {\n const source: PayloadOption[] = isAsync ? (asyncResults ?? []) : (options ?? []);\n const ranked: PayloadOption[] = isAsync ? source : filterOptions(source, input);\n return ranked.map<Item>((o) => ({\n value: o.value,\n label: o.label,\n kind: \"text\",\n widgets: o.widgets,\n }));\n }, [isAsync, asyncResults, options, input]);\n\n const matchesExistingSuggestion = useMemo(\n () =>\n suggestionItems.some((o) => o.value.toLowerCase() === trimmedInput.toLowerCase()) ||\n fieldRefItems.some((f) => f.value.toLowerCase() === trimmedInput.toLowerCase()),\n [suggestionItems, fieldRefItems, trimmedInput],\n );\n\n const showCreateRow = trimmedInput.length > 0 && !matchesExistingSuggestion;\n\n // Flat items list — fed to base-ui as the universe of pickable items so its\n // keyboard navigation has a single ordering to work with. The visual\n // grouping is done by `ComboboxGroup` in the render below; base-ui ranges\n // over `items` linearly and matches by reference.\n const allItems = useMemo<Item[]>(() => {\n const list: Item[] = [];\n for (const f of fieldRefItems) list.push(f);\n for (const s of suggestionItems) list.push(s);\n if (showCreateRow) {\n list.push({\n value: trimmedInput,\n label: `Add \"${trimmedInput}\"`,\n kind: \"create\",\n });\n }\n return list;\n }, [fieldRefItems, suggestionItems, showCreateRow, trimmedInput]);\n\n const atMax = maxItems !== undefined && items.length >= maxItems;\n\n // Stable per-position ids so `@dnd-kit` keys survive even when two chips\n // share the same raw string (uncommon, but allowed — the user could insert\n // the same field reference twice in a waterfall).\n const idsRef = useRef<string[]>([]);\n if (idsRef.current.length !== items.length) {\n if (idsRef.current.length < items.length) {\n idsRef.current = [\n ...idsRef.current,\n ...Array.from(\n { length: items.length - idsRef.current.length },\n () => crypto.randomUUID(),\n ),\n ];\n } else {\n idsRef.current = idsRef.current.slice(0, items.length);\n }\n }\n const chipIds = idsRef.current;\n\n const sortSensors = useSensors(\n useSensor(PointerSensor, { activationConstraint: { distance: 4 } }),\n useSensor(KeyboardSensor),\n );\n\n const handleDragEnd = (event: DragEndEvent) => {\n const { active, over } = event;\n if (!over || active.id === over.id) return;\n const from = chipIds.indexOf(String(active.id));\n const to = chipIds.indexOf(String(over.id));\n if (from === -1 || to === -1) return;\n const nextItems = [...items];\n const [movedValue] = nextItems.splice(from, 1);\n nextItems.splice(to, 0, movedValue);\n const nextIds = [...chipIds];\n const [movedId] = nextIds.splice(from, 1);\n nextIds.splice(to, 0, movedId);\n idsRef.current = nextIds;\n setItems(nextItems);\n };\n\n const removeAt = (index: number) => {\n idsRef.current = idsRef.current.filter((_, i) => i !== index);\n setItems(items.filter((_, i) => i !== index));\n };\n\n const appendValue = (value: string) => {\n if (atMax || !value) return;\n idsRef.current = [...idsRef.current, crypto.randomUUID()];\n setItems([...items, value]);\n };\n\n const clearInput = () => {\n setInput(\"\");\n if (isAsync) debouncedSetQuery(\"\");\n };\n\n const anchor = useComboboxAnchor();\n\n return (\n <div data-p0=\"input\" className=\"pz:flex pz:flex-col pz:gap-1\">\n <Combobox<Item, true>\n multiple\n items={allItems}\n filter={null}\n open={open}\n onOpenChange={setOpen}\n // Chips are rendered manually so base-ui doesn't manage them — keep\n // `value` empty and capture picks via `onValueChange`. Same trick as\n // `IncludeExcludeCombobox`.\n value={[] as Item[]}\n onValueChange={(next) => {\n if (!Array.isArray(next) || next.length === 0) return;\n const last = next[next.length - 1] as Item;\n appendValue(last.value);\n clearInput();\n }}\n isItemEqualToValue={(a, b) => (a as Item).value === (b as Item).value}\n itemToStringLabel={(item) => (item as Item).label}\n itemToStringValue={(item) => (item as Item).value}\n inputValue={input}\n onInputValueChange={(v) => {\n setInput(v);\n if (isAsync) debouncedSetQuery(v);\n }}\n >\n <ComboboxChips aria-invalid={!!field.error || undefined} ref={anchor}>\n <DndContext\n sensors={sortSensors}\n collisionDetection={closestCenter}\n onDragEnd={handleDragEnd}\n >\n <SortableContext items={chipIds} strategy={horizontalListSortingStrategy}>\n {items.map((raw, index) => {\n const parsed = parseChip(raw);\n return (\n <ChipPill\n key={chipIds[index]}\n id={chipIds[index]}\n parsed={parsed}\n onRemove={() => removeAt(index)}\n />\n );\n })}\n </SortableContext>\n </DndContext>\n <ComboboxChipsInput\n placeholder={items.length === 0 ? placeholder : undefined}\n aria-invalid={!!field.error || undefined}\n onKeyDown={(e) => {\n if (e.key === \"Backspace\" && input.length === 0) {\n if (items.length === 0) return;\n e.preventDefault();\n removeAt(items.length - 1);\n return;\n }\n if (e.key !== \"Enter\" || e.nativeEvent.isComposing) return;\n if (trimmedInput.length === 0) return;\n e.preventDefault();\n e.stopPropagation();\n if (atMax) return;\n // Prefer exact suggestion match, then exact field match, else\n // create a text entry.\n const exactSuggestion = suggestionItems.find(\n (o) => o.value.toLowerCase() === trimmedInput.toLowerCase(),\n );\n const exactField = fieldRefItems.find(\n (f) => f.label.toLowerCase() === trimmedInput.toLowerCase(),\n );\n const toAdd = exactSuggestion?.value ?? exactField?.value ?? trimmedInput;\n appendValue(toAdd);\n clearInput();\n }}\n />\n <ComboboxTrigger className=\"pz:ml-auto pz:bg-transparent pz:hover:bg-transparent\" />\n </ComboboxChips>\n <ComboboxContent anchor={anchor}>\n {loading && allItems.length > 0 && (\n <span\n aria-label=\"Loading\"\n className=\"pz:absolute pz:right-2 pz:top-2 pz:z-10 pz:inline-block pz:h-3 pz:w-3 pz:animate-spin pz:rounded-full pz:border-2 pz:border-muted-foreground/30 pz:border-t-muted-foreground\"\n />\n )}\n {loading && allItems.length === 0 && (\n <div\n role=\"status\"\n aria-label=\"Loading\"\n className=\"pz:flex pz:items-center pz:justify-center pz:py-6\"\n >\n <span className=\"pz:inline-block pz:h-5 pz:w-5 pz:animate-spin pz:rounded-full pz:border-2 pz:border-muted-foreground/30 pz:border-t-muted-foreground\" />\n </div>\n )}\n <ComboboxList\n className={cn(\n loading &&\n allItems.length > 0 &&\n \"pz:opacity-50 pz:transition-opacity pz:pointer-events-none\",\n )}\n >\n {atMax && (\n <div className=\"pz:px-2 pz:py-1.5 pz:text-xs pz:text-muted-foreground\">\n Maximum {maxItems} item{maxItems === 1 ? \"\" : \"s\"} reached.\n </div>\n )}\n\n {fieldRefItems.length > 0 && (\n <ComboboxGroup>\n <ComboboxLabel>Field references</ComboboxLabel>\n {fieldRefItems.map((it) => (\n <ComboboxItem\n key={`field:${it.value}`}\n value={it}\n disabled={atMax}\n >\n <span className=\"pz:inline-flex pz:items-center pz:rounded-sm pz:bg-sky-100 pz:px-1 pz:text-sky-900\">\n {it.label}\n </span>\n </ComboboxItem>\n ))}\n </ComboboxGroup>\n )}\n\n {suggestionItems.length > 0 && (\n <ComboboxGroup>\n <ComboboxLabel>Suggestions</ComboboxLabel>\n {suggestionItems.map((it) => (\n <ComboboxItem\n key={`text:${it.value}`}\n value={it}\n disabled={atMax}\n >\n {it.widgets && (\n <WidgetStrip widgets={pickLeadingWidgets(it.widgets)} size={14} />\n )}\n <span className=\"pz:flex-1 pz:truncate\">{it.label}</span>\n {it.widgets?.field_type && (\n <FieldTypeBadge\n type={it.widgets.field_type.type}\n format={it.widgets.field_type.format}\n />\n )}\n </ComboboxItem>\n ))}\n </ComboboxGroup>\n )}\n\n {showCreateRow && (\n <ComboboxItem\n key={`__create__:${trimmedInput}`}\n value={{ value: trimmedInput, label: `Add \"${trimmedInput}\"`, kind: \"create\" }}\n className=\"pz:italic\"\n disabled={atMax}\n >\n {`Add \"${trimmedInput}\"`}\n </ComboboxItem>\n )}\n\n {!loading && allItems.length === 0 && (\n <ComboboxEmpty>\n {trimmedInput.length > 0 ? \"No matches\" : \"Type to add a role\"}\n </ComboboxEmpty>\n )}\n </ComboboxList>\n </ComboboxContent>\n </Combobox>\n </div>\n );\n}\n\nfunction pickLeadingWidgets(widgets: WidgetsByKind): WidgetsByKind {\n const { field_type: _ignored, ...rest } = widgets;\n return rest;\n}\n\nfunction ChipPill({\n id,\n parsed,\n onRemove,\n}: {\n id: string;\n parsed: ParsedChip;\n onRemove: () => void;\n}) {\n const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({\n id,\n });\n const style: CSSProperties = {\n transform: transform\n ? `translate3d(${Math.round(transform.x)}px, ${Math.round(transform.y)}px, 0)`\n : undefined,\n transition,\n opacity: isDragging ? 0.6 : 1,\n };\n const isField = parsed.kind === \"field\";\n const label = isField ? parsed.fieldName : parsed.text;\n return (\n <ChipShell\n setNodeRef={setNodeRef}\n style={style}\n attributes={attributes}\n listeners={listeners}\n kind={parsed.kind}\n onRemove={onRemove}\n >\n <span className=\"pz:px-1\">{label || <span className=\"pz:text-muted-foreground\">empty</span>}</span>\n </ChipShell>\n );\n}\n\nfunction ChipShell({\n setNodeRef,\n style,\n attributes,\n listeners,\n kind,\n onRemove,\n children,\n}: {\n setNodeRef: (n: HTMLElement | null) => void;\n style: CSSProperties;\n // biome-ignore lint/suspicious/noExplicitAny: dnd-kit attribute/listener shape\n attributes: any;\n // biome-ignore lint/suspicious/noExplicitAny: dnd-kit attribute/listener shape\n listeners: any;\n kind: ParsedChip[\"kind\"];\n onRemove: () => void;\n children: ReactNode;\n}) {\n return (\n <span\n ref={setNodeRef}\n style={style}\n className={cn(kind === \"field\" ? FIELD_CHIP_CLASS : TEXT_CHIP_CLASS)}\n data-chip-kind={kind}\n {...attributes}\n >\n <span\n role=\"button\"\n tabIndex={-1}\n aria-label=\"Drag to reorder\"\n className=\"pz:flex pz:items-center pz:justify-center pz:cursor-grab pz:text-muted-foreground pz:hover:text-foreground pz:touch-none\"\n {...listeners}\n >\n <IconGripVertical width={12} height={12} />\n </span>\n {children}\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-xs\"\n className=\"pz:opacity-50 pz:hover:opacity-100\"\n onClick={(e) => {\n e.stopPropagation();\n onRemove();\n }}\n aria-label=\"Remove\"\n >\n <XIcon className=\"pz:pointer-events-none\" />\n </Button>\n </span>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAyCA,MAAM,cACJ;AAMF,SAAS,UAAU,KAAyB;CAC1C,MAAM,IAAI,IAAI,MAAM,YAAY;AAChC,KAAI,EAAG,QAAO;EAAE,MAAM;EAAS,WAAW,EAAE;EAAI;EAAK;AACrD,QAAO;EAAE,MAAM;EAAQ,MAAM;EAAK;EAAK;;;;;;;AAQzC,MAAM,mBACJ;AAEF,MAAM,kBACJ;AAYF,SAAgB,qCACd,OACA;CACA,MAAM,EAAE,OAAO,UAAU,SAAS,aAAa,aAAa,SAAS;CACrE,MAAM,WAAW,KAAK;CACtB,MAAM,cAAc,KAAK;CAEzB,MAAM,CAAC,OAAO,YAAY,SAAS,GAAG;CACtC,MAAM,CAAC,gBAAgB,qBAAqB,SAAS,GAAG;CACxD,MAAM,CAAC,MAAM,WAAW,SAAS,MAAM;CAEvC,MAAM,UAAU,OAAO,gBAAgB;CACvC,MAAM,oBAAoB,gBAAgB,MAAc,kBAAkB,E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ClD,QACE,oBAAC,WAAD;EACc;EACL;EACK;EACD;EACX,MAAM,OAAO;EACH;YAEV,oBAAC,QAAD;GAAM,WAAU;aAAW,SAAS,oBAAC,QAAD;IAAM,WAAU;cAA2B;IAAY;GAAQ;EACzF;;AAIhB,SAAS,UAAU,EACjB,YACA,OACA,YACA,WACA,MACA,UACA,YAWC;AACD,QACE,qBAAC,QAAD;EACE,KAAK;EACE;EACP,WAAW,GAAG,SAAS,UAAU,mBAAmB,gBAAgB;EACpE,kBAAgB;EAChB,GAAI;YALN;GAOE,oBAAC,QAAD;IACE,MAAK;IACL,UAAU;IACV,cAAW;IACX,WAAU;IACV,GAAI;cAEJ,oBAAC,kBAAD;KAAkB,OAAO;KAAI,QAAQ;KAAM;IACtC;GACN;GACD,oBAAC,QAAD;IACE,MAAK;IACL,SAAQ;IACR,MAAK;IACL,WAAU;IACV,UAAU,MAAM;AACd,OAAE,iBAAiB;AACnB,eAAU;;IAEZ,cAAW;cAEX,oBAAC,OAAD,EAAO,WAAU,0BAA2B;IACrC;GACJ"}
1
+ {"version":3,"file":"tagged-ordered-multi-create-input.mjs","names":[],"sources":["../../../../src/components/defaults/adapters/tagged-ordered-multi-create-input.tsx"],"sourcesContent":["import {\n closestCenter,\n DndContext,\n type DragEndEvent,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport { horizontalListSortingStrategy, SortableContext, useSortable } from \"@dnd-kit/sortable\";\nimport type { PipesFieldDefinitionWithName, WidgetsByKind } from \"@pipe0/base\";\nimport { XIcon } from \"lucide-react\";\nimport {\n type CSSProperties,\n type ReactNode,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport useSWR from \"swr\";\nimport { useDebouncedFn } from \"../../../hooks/use-debounced-fn.js\";\nimport { cn } from \"../../../lib/utils.js\";\nimport type { FieldHandle } from \"../../../types/field-handle.js\";\nimport { FieldTypeBadge } from \"../../../widgets/field-type-badge.js\";\nimport { WidgetStrip } from \"../../../widgets/widget-strip.js\";\nimport { IconGripVertical } from \"../../internal/icons.js\";\nimport { filterOptions, type PayloadOption } from \"../../internal/multi-select-popover-trigger.js\";\nimport { Button } from \"../../ui/button.js\";\nimport {\n Combobox,\n ComboboxChips,\n ComboboxChipsInput,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxGroup,\n ComboboxItem,\n ComboboxLabel,\n ComboboxList,\n ComboboxTrigger,\n useComboboxAnchor,\n} from \"../../ui/combobox.js\";\n\n/**\n * Detects whether a raw value is a single, exclusive Liquid field reference\n * (e.g. `\"{{ company_domain }}\"` or `\"{{ field | filter }}\"`). Mixed content\n * such as `\"Head of {{ company }}\"` returns false and is treated as text.\n */\nconst PURE_TAG_RE = /^\\s*\\{\\{\\s*([a-zA-Z_][a-zA-Z0-9_.]*)(?:\\s*\\|\\s*[^}]+)?\\s*\\}\\}\\s*$/;\n\ntype ParsedChip =\n | { kind: \"field\"; fieldName: string; raw: string }\n | { kind: \"text\"; text: string; raw: string };\n\nfunction parseChip(raw: string): ParsedChip {\n const m = raw.match(PURE_TAG_RE);\n if (m) return { kind: \"field\", fieldName: m[1], raw };\n return { kind: \"text\", text: raw, raw };\n}\n\n/**\n * Sky-blue pill matching `TagChipDecoration`'s field chip styling so a\n * field-reference chip outside tiptap reads identically to one inside\n * `LiquidEditor`.\n */\nconst FIELD_CHIP_CLASS =\n \"pz:flex pz:h-[calc(--spacing(5.25))] pz:w-fit pz:items-center pz:gap-1 pz:rounded-sm pz:bg-sky-100 pz:pl-0.5 pz:pr-0 pz:text-xs pz:font-medium pz:whitespace-nowrap pz:text-sky-900\";\n\nconst TEXT_CHIP_CLASS =\n \"pz:flex pz:h-[calc(--spacing(5.25))] pz:w-fit pz:items-center pz:gap-1 pz:rounded-sm pz:bg-muted pz:pl-0.5 pz:pr-0 pz:text-xs pz:font-medium pz:whitespace-nowrap pz:text-foreground\";\n\n/** Drop target for an item carried by the Combobox value channel. */\ntype Item = {\n /** Canonical value to store in the field — text as-is, or `{{ fieldName }}`. */\n value: string;\n /** Display label in the dropdown. */\n label: string;\n kind: \"field\" | \"text\" | \"create\";\n widgets?: WidgetsByKind;\n};\n\nexport function TaggedOrderedMultiCreateInputAdapter(\n field: FieldHandle<\"tagged_ordered_multi_create_input\">,\n) {\n const { items, setItems, options, loadOptions, inputFields, meta } = field;\n const maxItems = meta.maxItems;\n const placeholder = meta.placeholder;\n\n const [input, setInput] = useState(\"\");\n const [debouncedQuery, setDebouncedQuery] = useState(\"\");\n const [open, setOpen] = useState(false);\n\n const isAsync = typeof loadOptions === \"function\";\n const debouncedSetQuery = useDebouncedFn((q: string) => setDebouncedQuery(q), 300);\n\n // Async suggestions — same SWR pattern as `SuggestCombobox`.\n const instanceId = useId();\n const swrKey: readonly [string, string] | null =\n loadOptions && (open || debouncedQuery !== \"\") ? [instanceId, debouncedQuery] : null;\n const {\n data: asyncResults = null,\n isLoading: swrIsLoading,\n isValidating: swrIsValidating,\n } = useSWR<PayloadOption[], Error, readonly [string, string] | null>(\n swrKey,\n async ([, q]) => {\n if (!loadOptions) return [];\n const opts = await loadOptions(q);\n return opts.filter((o) => !!o.value);\n },\n { keepPreviousData: true },\n );\n const loading = swrIsLoading || swrIsValidating;\n\n const trimmedInput = input.trim();\n\n const fieldRefItems = useMemo<Item[]>(() => {\n if (!inputFields?.length) return [];\n const q = trimmedInput.toLowerCase();\n return inputFields\n .filter((f) => !q || f.resolvedName.toLowerCase().includes(q))\n .map<Item>((f) => ({\n value: `{{ ${f.resolvedName} }}`,\n label: f.resolvedName,\n kind: \"field\",\n }));\n }, [inputFields, trimmedInput]);\n\n const suggestionItems = useMemo<Item[]>(() => {\n const source: PayloadOption[] = isAsync ? (asyncResults ?? []) : (options ?? []);\n const ranked: PayloadOption[] = isAsync ? source : filterOptions(source, input);\n return ranked.map<Item>((o) => ({\n value: o.value,\n label: o.label,\n kind: \"text\",\n widgets: o.widgets,\n }));\n }, [isAsync, asyncResults, options, input]);\n\n const matchesExistingSuggestion = useMemo(\n () =>\n suggestionItems.some((o) => o.value.toLowerCase() === trimmedInput.toLowerCase()) ||\n fieldRefItems.some((f) => f.value.toLowerCase() === trimmedInput.toLowerCase()),\n [suggestionItems, fieldRefItems, trimmedInput],\n );\n\n const showCreateRow = trimmedInput.length > 0 && !matchesExistingSuggestion;\n\n // Flat items list — fed to base-ui as the universe of pickable items so its\n // keyboard navigation has a single ordering to work with. The visual\n // grouping is done by `ComboboxGroup` in the render below; base-ui ranges\n // over `items` linearly and matches by reference.\n const allItems = useMemo<Item[]>(() => {\n const list: Item[] = [];\n for (const f of fieldRefItems) list.push(f);\n for (const s of suggestionItems) list.push(s);\n if (showCreateRow) {\n list.push({\n value: trimmedInput,\n label: `Add \"${trimmedInput}\"`,\n kind: \"create\",\n });\n }\n return list;\n }, [fieldRefItems, suggestionItems, showCreateRow, trimmedInput]);\n\n const atMax = maxItems !== undefined && items.length >= maxItems;\n\n // Stable per-position ids so `@dnd-kit` keys survive even when two chips\n // share the same raw string (uncommon, but allowed — the user could insert\n // the same field reference twice in a waterfall).\n const idsRef = useRef<string[]>([]);\n if (idsRef.current.length !== items.length) {\n if (idsRef.current.length < items.length) {\n idsRef.current = [\n ...idsRef.current,\n ...Array.from({ length: items.length - idsRef.current.length }, () => crypto.randomUUID()),\n ];\n } else {\n idsRef.current = idsRef.current.slice(0, items.length);\n }\n }\n const chipIds = idsRef.current;\n\n const sortSensors = useSensors(\n useSensor(PointerSensor, { activationConstraint: { distance: 4 } }),\n useSensor(KeyboardSensor),\n );\n\n const handleDragEnd = (event: DragEndEvent) => {\n const { active, over } = event;\n if (!over || active.id === over.id) return;\n const from = chipIds.indexOf(String(active.id));\n const to = chipIds.indexOf(String(over.id));\n if (from === -1 || to === -1) return;\n const nextItems = [...items];\n const [movedValue] = nextItems.splice(from, 1);\n nextItems.splice(to, 0, movedValue);\n const nextIds = [...chipIds];\n const [movedId] = nextIds.splice(from, 1);\n nextIds.splice(to, 0, movedId);\n idsRef.current = nextIds;\n setItems(nextItems);\n };\n\n const removeAt = (index: number) => {\n idsRef.current = idsRef.current.filter((_, i) => i !== index);\n setItems(items.filter((_, i) => i !== index));\n };\n\n const appendValue = (value: string) => {\n if (atMax || !value) return;\n idsRef.current = [...idsRef.current, crypto.randomUUID()];\n setItems([...items, value]);\n };\n\n const clearInput = () => {\n setInput(\"\");\n if (isAsync) debouncedSetQuery(\"\");\n };\n\n const anchor = useComboboxAnchor();\n\n return (\n <div data-p0=\"input\" className=\"pz:flex pz:flex-col pz:gap-1\">\n <Combobox<Item, true>\n multiple\n items={allItems}\n filter={null}\n open={open}\n onOpenChange={setOpen}\n // Chips are rendered manually so base-ui doesn't manage them — keep\n // `value` empty and capture picks via `onValueChange`. Same trick as\n // `IncludeExcludeCombobox`.\n value={[] as Item[]}\n onValueChange={(next) => {\n if (!Array.isArray(next) || next.length === 0) return;\n const last = next[next.length - 1] as Item;\n appendValue(last.value);\n clearInput();\n }}\n isItemEqualToValue={(a, b) => (a as Item).value === (b as Item).value}\n itemToStringLabel={(item) => (item as Item).label}\n itemToStringValue={(item) => (item as Item).value}\n inputValue={input}\n onInputValueChange={(v) => {\n setInput(v);\n if (isAsync) debouncedSetQuery(v);\n }}\n >\n <ComboboxChips aria-invalid={!!field.error || undefined} ref={anchor}>\n <DndContext\n sensors={sortSensors}\n collisionDetection={closestCenter}\n onDragEnd={handleDragEnd}\n >\n <SortableContext items={chipIds} strategy={horizontalListSortingStrategy}>\n {items.map((raw, index) => {\n const parsed = parseChip(raw);\n return (\n <ChipPill\n key={chipIds[index]}\n id={chipIds[index]}\n parsed={parsed}\n onRemove={() => removeAt(index)}\n />\n );\n })}\n </SortableContext>\n </DndContext>\n <ComboboxChipsInput\n placeholder={items.length === 0 ? placeholder : undefined}\n aria-invalid={!!field.error || undefined}\n onKeyDown={(e) => {\n if (e.key === \"Backspace\" && input.length === 0) {\n if (items.length === 0) return;\n e.preventDefault();\n removeAt(items.length - 1);\n return;\n }\n if (e.key !== \"Enter\" || e.nativeEvent.isComposing) return;\n if (trimmedInput.length === 0) return;\n e.preventDefault();\n e.stopPropagation();\n if (atMax) return;\n // Prefer exact suggestion match, then exact field match, else\n // create a text entry.\n const exactSuggestion = suggestionItems.find(\n (o) => o.value.toLowerCase() === trimmedInput.toLowerCase(),\n );\n const exactField = fieldRefItems.find(\n (f) => f.label.toLowerCase() === trimmedInput.toLowerCase(),\n );\n const toAdd = exactSuggestion?.value ?? exactField?.value ?? trimmedInput;\n appendValue(toAdd);\n clearInput();\n }}\n />\n <ComboboxTrigger className=\"pz:ml-auto pz:bg-transparent pz:hover:bg-transparent\" />\n </ComboboxChips>\n <ComboboxContent anchor={anchor}>\n {loading && allItems.length > 0 && (\n <span\n aria-label=\"Loading\"\n className=\"pz:absolute pz:right-2 pz:top-2 pz:z-10 pz:inline-block pz:h-3 pz:w-3 pz:animate-spin pz:rounded-full pz:border-2 pz:border-muted-foreground/30 pz:border-t-muted-foreground\"\n />\n )}\n {loading && allItems.length === 0 && (\n <div\n role=\"status\"\n aria-label=\"Loading\"\n className=\"pz:flex pz:items-center pz:justify-center pz:py-6\"\n >\n <span className=\"pz:inline-block pz:h-5 pz:w-5 pz:animate-spin pz:rounded-full pz:border-2 pz:border-muted-foreground/30 pz:border-t-muted-foreground\" />\n </div>\n )}\n <ComboboxList\n className={cn(\n loading &&\n allItems.length > 0 &&\n \"pz:opacity-50 pz:transition-opacity pz:pointer-events-none\",\n )}\n >\n {atMax && (\n <div className=\"pz:px-2 pz:py-1.5 pz:text-xs pz:text-muted-foreground\">\n Maximum {maxItems} item{maxItems === 1 ? \"\" : \"s\"} reached.\n </div>\n )}\n\n {fieldRefItems.length > 0 && (\n <ComboboxGroup>\n <ComboboxLabel>Field references</ComboboxLabel>\n {fieldRefItems.map((it) => (\n <ComboboxItem key={`field:${it.value}`} value={it} disabled={atMax}>\n <span className=\"pz:inline-flex pz:items-center pz:rounded-sm pz:bg-sky-100 pz:px-1 pz:text-sky-900\">\n {it.label}\n </span>\n </ComboboxItem>\n ))}\n </ComboboxGroup>\n )}\n\n {suggestionItems.length > 0 && (\n <ComboboxGroup>\n <ComboboxLabel>Suggestions</ComboboxLabel>\n {suggestionItems.map((it) => (\n <ComboboxItem key={`text:${it.value}`} value={it} disabled={atMax}>\n {it.widgets && (\n <WidgetStrip widgets={pickLeadingWidgets(it.widgets)} size={14} />\n )}\n <span className=\"pz:flex-1 pz:truncate\">{it.label}</span>\n {it.widgets?.field_type && (\n <FieldTypeBadge\n type={it.widgets.field_type.type}\n format={it.widgets.field_type.format}\n />\n )}\n </ComboboxItem>\n ))}\n </ComboboxGroup>\n )}\n\n {showCreateRow && (\n <ComboboxItem\n key={`__create__:${trimmedInput}`}\n value={{ value: trimmedInput, label: `Add \"${trimmedInput}\"`, kind: \"create\" }}\n className=\"pz:italic\"\n disabled={atMax}\n >\n {`Add \"${trimmedInput}\"`}\n </ComboboxItem>\n )}\n\n {!loading && allItems.length === 0 && (\n <ComboboxEmpty>\n {trimmedInput.length > 0 ? \"No matches\" : \"Type to add a role\"}\n </ComboboxEmpty>\n )}\n </ComboboxList>\n </ComboboxContent>\n </Combobox>\n </div>\n );\n}\n\nfunction pickLeadingWidgets(widgets: WidgetsByKind): WidgetsByKind {\n const { field_type: _ignored, ...rest } = widgets;\n return rest;\n}\n\nfunction ChipPill({\n id,\n parsed,\n onRemove,\n}: {\n id: string;\n parsed: ParsedChip;\n onRemove: () => void;\n}) {\n const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({\n id,\n });\n const style: CSSProperties = {\n transform: transform\n ? `translate3d(${Math.round(transform.x)}px, ${Math.round(transform.y)}px, 0)`\n : undefined,\n transition,\n opacity: isDragging ? 0.6 : 1,\n };\n const isField = parsed.kind === \"field\";\n const label = isField ? parsed.fieldName : parsed.text;\n return (\n <ChipShell\n setNodeRef={setNodeRef}\n style={style}\n attributes={attributes}\n listeners={listeners}\n kind={parsed.kind}\n onRemove={onRemove}\n >\n <span className=\"pz:px-1\">\n {label || <span className=\"pz:text-muted-foreground\">empty</span>}\n </span>\n </ChipShell>\n );\n}\n\nfunction ChipShell({\n setNodeRef,\n style,\n attributes,\n listeners,\n kind,\n onRemove,\n children,\n}: {\n setNodeRef: (n: HTMLElement | null) => void;\n style: CSSProperties;\n // biome-ignore lint/suspicious/noExplicitAny: dnd-kit attribute/listener shape\n attributes: any;\n // biome-ignore lint/suspicious/noExplicitAny: dnd-kit attribute/listener shape\n listeners: any;\n kind: ParsedChip[\"kind\"];\n onRemove: () => void;\n children: ReactNode;\n}) {\n return (\n <span\n ref={setNodeRef}\n style={style}\n className={cn(kind === \"field\" ? FIELD_CHIP_CLASS : TEXT_CHIP_CLASS)}\n data-chip-kind={kind}\n {...attributes}\n >\n <span\n role=\"button\"\n tabIndex={-1}\n aria-label=\"Drag to reorder\"\n className=\"pz:flex pz:items-center pz:justify-center pz:cursor-grab pz:text-muted-foreground pz:hover:text-foreground pz:touch-none\"\n {...listeners}\n >\n <IconGripVertical width={12} height={12} />\n </span>\n {children}\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-xs\"\n className=\"pz:opacity-50 pz:hover:opacity-100\"\n onClick={(e) => {\n e.stopPropagation();\n onRemove();\n }}\n aria-label=\"Remove\"\n >\n <XIcon className=\"pz:pointer-events-none\" />\n </Button>\n </span>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiDA,MAAM,cAAc;AAMpB,SAAS,UAAU,KAAyB;CAC1C,MAAM,IAAI,IAAI,MAAM,YAAY;AAChC,KAAI,EAAG,QAAO;EAAE,MAAM;EAAS,WAAW,EAAE;EAAI;EAAK;AACrD,QAAO;EAAE,MAAM;EAAQ,MAAM;EAAK;EAAK;;;;;;;AAQzC,MAAM,mBACJ;AAEF,MAAM,kBACJ;AAYF,SAAgB,qCACd,OACA;CACA,MAAM,EAAE,OAAO,UAAU,SAAS,aAAa,aAAa,SAAS;CACrE,MAAM,WAAW,KAAK;CACtB,MAAM,cAAc,KAAK;CAEzB,MAAM,CAA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F,MAAM,QAAuB;EAC3B,WAAW,YACP,eAAe,KAAK,MAAM,UAAU,EAAE,CAAC,MAAM,KAAK,MAAM,UAAU,EAAE,CAAC,UACrE;EACJ;EACA,SAAS,aAAa,KAAM;EAC7B;CAED,MAAM,QADU,OAAO,SAAS,UACR,OAAO,YAAY,OAAO;AAClD,QACE,oBAAC,WAAD;EACc;EACL;EACK;EACD;EACX,MAAM,OAAO;EACH;YAEV,oBAAC,QAAD;GAAM,WAAU;aACb,SAAS,oBAAC,QAAD;IAAM,WAAU;cAA2B;IAAY;GAC5D;EACG;;AAIhB,SAAS,UAAU,EACjB,YACA,OACA,YACA,WACA,MACA,UACA,YAWC;AACD,QACE,qBAAC,QAAD;EACE,KAAK;EACE;EACP,WAAW,GAAG,SAAS,UAAU,mBAAmB,gBAAgB;EACpE,kBAAgB;EAChB,GAAI;YALN;GAOE,oBAAC,QAAD;IACE,MAAK;IACL,UAAU;IACV,cAAW;IACX,WAAU;IACV,GAAI;cAEJ,oBAAC,kBAAD;KAAkB,OAAO;KAAI,QAAQ;KAAM;IACtC;GACN;GACD,oBAAC,QAAD;IACE,MAAK;IACL,SAAQ;IACR,MAAK;IACL,WAAU;IACV,UAAU,MAAM;AACd,OAAE,iBAAiB;AACnB,eAAU;;IAEZ,cAAW;cAEX,oBAAC,OAAD,EAAO,WAAU,0BAA2B;IACrC;GACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-form-core.d.mts","names":[],"sources":["../../src/hooks/use-form-core.ts"],"mappings":";;KA8BY,cAAA;AAAA,KASA,cAAA;EACV,MAAA,EAAQ,cAAA,EADgB;EAGxB,QAAA,WAFsB;EAItB,cAAA,WAJQ;EAMR,mBAAA,WAFA;EAIA,yBAAA;AAAA"}
1
+ {"version":3,"file":"use-form-core.d.mts","names":[],"sources":["../../src/hooks/use-form-core.ts"],"mappings":";;KA+BY,cAAA;AAAA,KASA,cAAA;EACV,MAAA,EAAQ,cAAA,EADgB;EAGxB,QAAA,WAFsB;EAItB,cAAA,WAJQ;EAMR,mBAAA,WAFA;EAIA,yBAAA;AAAA"}
@@ -1,8 +1,9 @@
1
1
  import { buildSectionHandles } from "../utils/build-section-handlers.mjs";
2
2
  import { mergeFormStores } from "../utils/merge-form-stores.mjs";
3
3
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
4
+ import { joinConnectionString } from "@pipe0/base";
4
5
  import { useForm } from "react-hook-form";
5
- import { zodResolver } from "@hookform/resolvers/zod";
6
+ import { standardSchemaResolver } from "@hookform/resolvers/standard-schema";
6
7
 
7
8
  //#region src/hooks/use-form-core.ts
8
9
  function collectEnabledSlots(formConfig) {
@@ -49,10 +50,12 @@ function useFormCore(options) {
49
50
  const [connectionsStatus, setConnectionsStatus] = useState(resolvers?.getConnections ? "loading" : "idle");
50
51
  const [fieldLoadStates, setFieldLoadStates] = useState({});
51
52
  const form = useForm({
52
- resolver: zodResolver(schema),
53
+ resolver: standardSchemaResolver(schema),
53
54
  defaultValues
54
55
  });
55
56
  const mergeStore = useCallback((incoming) => setStore((old) => mergeFormStores(old, incoming)), [setStore]);
57
+ const formConfigRef = useRef(formConfig);
58
+ formConfigRef.current = formConfig;
56
59
  useEffect(() => {
57
60
  if (!resolvers?.getConnections) {
58
61
  setConnectionsStatus("idle");
@@ -70,6 +73,25 @@ function useFormCore(options) {
70
73
  value: c.public_id,
71
74
  widgets: { provider_logo: { provider: c.provider } }
72
75
  })) } } });
76
+ const connectorField = formConfigRef.current.flatMap((section) => section.groups.flatMap((group) => group.fields)).map((field) => field).find((field) => field.type === "connector_input");
77
+ if (connectorField?.type === "connector_input" && connectorField.connectorMode === "required") {
78
+ const current = form.getValues(connectorField.path);
79
+ const isEmpty = current == null || (current.connections?.length ?? 0) === 0;
80
+ const defaults = conns.filter((c) => c.is_default);
81
+ if (isEmpty && defaults.length > 0) form.setValue(connectorField.path, {
82
+ strategy: "first",
83
+ connections: defaults.map((c) => ({
84
+ type: "vault",
85
+ connection: joinConnectionString({
86
+ provider: c.provider,
87
+ id: c.public_id
88
+ })
89
+ }))
90
+ }, {
91
+ shouldDirty: false,
92
+ shouldValidate: false
93
+ });
94
+ }
73
95
  setConnectionsStatus("ready");
74
96
  }).catch(() => {
75
97
  if (!cancelled) setConnectionsStatus("error");
@@ -1 +1 @@
1
- {"version":3,"file":"use-form-core.mjs","names":[],"sources":["../../src/hooks/use-form-core.ts"],"sourcesContent":["import { zodResolver } from \"@hookform/resolvers/zod\";\nimport type {\n EnabledIf,\n EnabledResult,\n FormResolvers,\n FormSection,\n FormStore,\n GeneratedInputMeta,\n PipesEnvironment,\n ProviderName,\n} from \"@pipe0/base\";\nimport {\n type Dispatch,\n type SetStateAction,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { type FieldValues, type UseFormReturn, useForm } from \"react-hook-form\";\nimport type { AnyFieldProps, ConstantSuggestion, SecretSuggestion } from \"../types/field-props.js\";\nimport type { FormSectionHandle } from \"../types/form-handle.js\";\nimport { buildSectionHandles } from \"../utils/build-section-handlers.js\";\nimport { mergeFormStores } from \"../utils/merge-form-stores.js\";\n\n// ---------------------------------------------------------------------------\n// Public types\n// ---------------------------------------------------------------------------\n\nexport type ResourceStatus = \"idle\" | \"loading\" | \"ready\" | \"error\";\n\nexport type SlotId = \"field\" | \"suggestions\";\n\nexport type FieldEnabledState = {\n disabled: boolean;\n reason?: string;\n};\n\nexport type FieldLoadState = {\n status: ResourceStatus;\n /** Field-level disabled (from `meta.enabledIf`). */\n disabled: boolean;\n /** Field-level disabled reason. */\n disabledReason?: string;\n /** Suggestions sub-feature gate (from `optionsDef.enabledIf`). */\n suggestionsDisabled: boolean;\n /** Suggestions sub-feature reason. */\n suggestionsDisabledReason?: string;\n};\n\nexport interface UseFormCoreOptions<T extends FieldValues> {\n pipeOrSearchId: string;\n kind: \"pipe\" | \"search\" | \"effect\";\n schema: any;\n publicKey: string;\n defaultValues?: T;\n formConfig: FormSection[];\n resolvers?: FormResolvers;\n store: FormStore;\n setStore: Dispatch<SetStateAction<FormStore>>;\n environment?: PipesEnvironment;\n /**\n * Form-level scope tags. Bundled into every `resolvers.getSecrets` call so\n * the backend can return only the secrets allowed in the declared scopes\n * (intersection on top of cascade visibility).\n */\n scopes?: string[];\n /**\n * Current team context. Bundled into every `resolvers.getSecrets` call so\n * the backend can restrict team-level secrets to exactly this team.\n */\n teamId?: string;\n}\n\nexport interface UseFormCoreReturn<T extends FieldValues> {\n connectionsStatus: ResourceStatus;\n /** Map of field path → load state for dynamic context_select_input fields. */\n fieldLoadStates: Record<string, FieldLoadState>;\n /** Subset of `fieldLoadStates` where `status === \"error\"`. RHF-style. */\n fieldLoaderErrors: Record<string, FieldLoadState>;\n /** Subset of `fieldLoadStates` where `status === \"loading\"`. RHF-style. */\n loadingFieldLoaders: Record<string, FieldLoadState>;\n /** True when any field loader has errored. */\n hasFieldLoaderError: boolean;\n /** True when any field loader is currently loading. */\n isFieldLoaderLoading: boolean;\n form: UseFormReturn<T, any, any>;\n sections: FormSectionHandle[];\n fields: AnyFieldProps[];\n reset: (values?: T) => void;\n}\n\ntype EnabledSlot = {\n fieldPath: string;\n slotId: SlotId;\n enabledIf: EnabledIf;\n /** Only present for \"suggestions\" slots — used to drive option fetching. */\n optionsDef?: {\n requires: { connection?: ProviderName; fields?: readonly string[] };\n };\n};\n\nfunction collectEnabledSlots(formConfig: FormSection[]): EnabledSlot[] {\n const out: EnabledSlot[] = [];\n for (const section of formConfig) {\n for (const group of section.groups) {\n for (const field of group.fields as GeneratedInputMeta[]) {\n if (field.enabledIf) {\n out.push({\n fieldPath: field.path,\n slotId: \"field\",\n enabledIf: field.enabledIf,\n });\n }\n const supportsOptionsDef =\n field.type === \"context_select_input\" || field.type === \"tagged_text_input\";\n if (supportsOptionsDef && \"optionsDef\" in field && field.optionsDef) {\n const optionsDef = field.optionsDef as EnabledSlot[\"optionsDef\"] & {\n enabledIf?: EnabledIf;\n };\n if (optionsDef?.enabledIf) {\n out.push({\n fieldPath: field.path,\n slotId: \"suggestions\",\n enabledIf: optionsDef.enabledIf,\n optionsDef,\n });\n } else {\n // Even without a sub-feature enabledIf, we still need to track\n // this field as having a fetchable suggestions slot — it's\n // always enabled and the fetch fires on every value change.\n out.push({\n fieldPath: field.path,\n slotId: \"suggestions\",\n enabledIf: () => ({ disabled: false }),\n optionsDef,\n });\n }\n }\n }\n }\n }\n return out;\n}\n\nfunction getPathValue(obj: unknown, path: string): unknown {\n const parts = path.split(\".\");\n let cur: any = obj;\n for (const part of parts) {\n if (cur == null) return undefined;\n cur = cur[part];\n }\n return cur;\n}\n\nfunction evalSlot(slot: EnabledSlot, payload: unknown): EnabledResult {\n return slot.enabledIf(payload);\n}\n\n// ---------------------------------------------------------------------------\n// Hook\n// ---------------------------------------------------------------------------\n\nexport function useFormCore<T extends FieldValues>(\n options: UseFormCoreOptions<T>,\n): UseFormCoreReturn<T> {\n const {\n schema,\n publicKey,\n defaultValues,\n formConfig,\n resolvers,\n pipeOrSearchId,\n kind,\n setStore,\n environment = \"production\",\n scopes,\n teamId,\n } = options;\n\n // Stable signature for `scopes` so its identity doesn't churn the effect\n // dep across renders when callers pass a fresh array literal each time.\n const scopesKey = useMemo(() => (scopes ? JSON.stringify(scopes) : \"\"), [scopes]);\n\n // --- Per-resource status ---\n const [connectionsStatus, setConnectionsStatus] = useState<ResourceStatus>(\n resolvers?.getConnections ? \"loading\" : \"idle\",\n );\n const [fieldLoadStates, setFieldLoadStates] = useState<Record<string, FieldLoadState>>({});\n\n // --- Form ---\n const form = useForm<T>({\n resolver: zodResolver(schema),\n defaultValues: defaultValues as any,\n });\n\n // --- Helpers ---\n const mergeStore = useCallback(\n (incoming: FormStore) => setStore((old) => mergeFormStores(old, incoming)),\n [setStore],\n );\n\n // --- Effect 1: Load connections ---\n useEffect(() => {\n if (!resolvers?.getConnections) {\n setConnectionsStatus(\"idle\");\n return;\n }\n\n let cancelled = false;\n setConnectionsStatus(\"loading\");\n\n Promise.resolve(resolvers.getConnections({ id: pipeOrSearchId, environment }))\n .then((conns) => {\n if (cancelled) return;\n\n mergeStore({\n field_options: {\n connections: {\n options: conns.map((c) => ({\n label: c.public_id,\n value: c.public_id,\n widgets: {\n provider_logo: { provider: c.provider as ProviderName },\n },\n })),\n },\n },\n });\n\n setConnectionsStatus(\"ready\");\n })\n .catch(() => {\n if (!cancelled) setConnectionsStatus(\"error\");\n });\n\n return () => {\n cancelled = true;\n };\n }, [pipeOrSearchId, environment, resolvers?.getConnections, mergeStore]);\n\n // --- Curried secrets search ---\n // Each keystroke in the reference picker fires this with the latest query.\n // The picker handles debounce + race-correctness; here we just bundle in\n // form-level args (environment / scopes / teamId) and call the resolver.\n // No caching: every call hits the resolver. Returns [] if no resolver.\n const getSecretsResolver = resolvers?.getSecrets;\n const searchSecrets = useCallback(\n async (query: string): Promise<SecretSuggestion[]> => {\n if (!getSecretsResolver) return [];\n return Promise.resolve(getSecretsResolver({ query, environment, scopes, teamId }));\n },\n // `scopesKey` is the stable serialization of `scopes`; depending on the\n // raw array would churn the callback identity on every parent render.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [getSecretsResolver, environment, scopesKey, teamId],\n );\n\n // --- Curried constants search ---\n // Mirrors `searchSecrets` exactly. Same per-keystroke contract, same\n // form-level arg bundling. Returns [] when no resolver is wired.\n const getConstantsResolver = resolvers?.getConstants;\n const searchConstants = useCallback(\n async (query: string): Promise<ConstantSuggestion[]> => {\n if (!getConstantsResolver) return [];\n return Promise.resolve(getConstantsResolver({ query, environment, scopes, teamId }));\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [getConstantsResolver, environment, scopesKey, teamId],\n );\n\n // --- Effect 2: Evaluate enabledIf slots + drive context_select fetching ---\n const slots = useMemo(() => collectEnabledSlots(formConfig), [formConfig]);\n\n // Subscribe to all form value changes so resolvers re-evaluate.\n const watchedValues = form.watch();\n\n // Evaluate every slot against the current payload. Keep the result\n // serialized so the effect's deps stay stable across reference-identical\n // re-renders.\n const slotResults = useMemo(() => {\n const out: Record<string, EnabledResult> = {};\n for (const slot of slots) {\n out[`${slot.fieldPath}::${slot.slotId}`] = evalSlot(slot, watchedValues);\n }\n return out;\n }, [slots, watchedValues]);\n const slotResultsSig = useMemo(() => JSON.stringify(slotResults), [slotResults]);\n\n // Track previous results so we can detect enabled→disabled transitions\n // (drives field-value clearing) and last-fired fetch signatures.\n const prevResultsRef = useRef<Record<string, EnabledResult>>({});\n const lastFiredSigRef = useRef<Record<string, string>>({});\n\n useEffect(() => {\n if (slots.length === 0) return;\n\n let cancelled = false;\n const nextLoadStates: Record<string, FieldLoadState> = {\n ...fieldLoadStates,\n };\n\n // Group slot results by field path for the load-state map.\n const byField: Record<string, { field?: EnabledResult; suggestions?: EnabledResult }> = {};\n for (const slot of slots) {\n const r = slotResults[`${slot.fieldPath}::${slot.slotId}`];\n if (r == null) continue;\n byField[slot.fieldPath] ??= {};\n byField[slot.fieldPath][slot.slotId] = r;\n }\n\n for (const slot of slots) {\n const key = `${slot.fieldPath}::${slot.slotId}`;\n const r = slotResults[key];\n if (r == null) continue;\n const prev = prevResultsRef.current[key];\n\n // Field-slot only: on enabled→disabled, reset the value to the field's\n // configured default (from the seeded defaultValues) rather than `\"\"`.\n // `\"\"` is invalid for non-string fields — e.g. a gated boolean fails\n // `z.boolean()` and a nullable int's `null` default would coerce to `0`.\n // Fall back to `\"\"` only when there's NO default at the path, so explicit\n // `null`/`false` defaults survive (this resets an optional int back to\n // empty when its gate turns off).\n if (slot.slotId === \"field\" && r.disabled && prev != null && !prev.disabled) {\n const def = getPathValue(defaultValues, slot.fieldPath);\n form.setValue(slot.fieldPath as any, (def === undefined ? \"\" : def) as any, {\n shouldDirty: true,\n shouldTouch: true,\n });\n }\n\n // Suggestions-slot: drive the existing context_select_input fetch.\n if (slot.slotId === \"suggestions\" && resolvers?.getFieldContext) {\n // If suggestions are gated, skip the fetch and reset dedupe so\n // re-enabling re-fires.\n if (r.disabled) {\n delete lastFiredSigRef.current[slot.fieldPath];\n continue;\n }\n\n // Resolve the connection for the legacy `requires.connection`\n // (still needed to pick the right secret for the fetch).\n const watchedConnections = (\n watchedValues as {\n connector?: { connections?: { connection?: string }[] };\n }\n )?.connector?.connections;\n const required = slot.optionsDef?.requires;\n\n let connectionId: string | undefined;\n if (required?.connection) {\n const match = watchedConnections?.find((c) =>\n c?.connection?.startsWith(`${required.connection}_`),\n );\n connectionId = match?.connection;\n // No matching connection — can't fetch, even if enabledIf passed.\n if (!connectionId) continue;\n }\n\n // Per-field signature for dedupe.\n const perFieldSig = JSON.stringify({\n connectionId,\n deps: required?.fields?.map((d) => getPathValue(watchedValues, d)) ?? [],\n });\n if (lastFiredSigRef.current[slot.fieldPath] === perFieldSig) continue;\n lastFiredSigRef.current[slot.fieldPath] = perFieldSig;\n\n // Mark loading for this field's fetch.\n const existing = nextLoadStates[slot.fieldPath];\n nextLoadStates[slot.fieldPath] = {\n status: \"loading\",\n disabled: existing?.disabled ?? false,\n disabledReason: existing?.disabledReason,\n suggestionsDisabled: false,\n suggestionsDisabledReason: undefined,\n };\n\n const idKey = kind === \"search\" ? \"search_id\" : kind === \"effect\" ? \"effect_id\" : \"pipe_id\";\n\n Promise.resolve(\n resolvers.getFieldContext({\n fieldPath: slot.fieldPath,\n query: \"\",\n payload: {\n ...(watchedValues as Record<string, unknown>),\n [idKey]: pipeOrSearchId,\n },\n }),\n )\n .then((incoming: FormStore) => {\n if (cancelled) return;\n mergeStore(incoming);\n setFieldLoadStates((s) => ({\n ...s,\n [slot.fieldPath]: {\n ...(s[slot.fieldPath] ?? {\n disabled: false,\n suggestionsDisabled: false,\n }),\n status: \"ready\",\n },\n }));\n })\n .catch(() => {\n if (cancelled) return;\n setFieldLoadStates((s) => ({\n ...s,\n [slot.fieldPath]: {\n ...(s[slot.fieldPath] ?? {\n disabled: false,\n suggestionsDisabled: false,\n }),\n status: \"error\",\n },\n }));\n });\n }\n }\n\n // Reflect the latest enabledIf evaluation into fieldLoadStates so the\n // adapters and field-wrapper can render the disabled state.\n for (const fieldPath of Object.keys(byField)) {\n const { field: fieldR, suggestions: sugR } = byField[fieldPath]!;\n const prevState = nextLoadStates[fieldPath];\n nextLoadStates[fieldPath] = {\n status: prevState?.status ?? \"idle\",\n disabled: fieldR == null ? (prevState?.disabled ?? false) : fieldR.disabled,\n disabledReason: fieldR == null ? prevState?.disabledReason : fieldR.message,\n suggestionsDisabled:\n sugR == null ? (prevState?.suggestionsDisabled ?? false) : sugR.disabled,\n suggestionsDisabledReason:\n sugR == null ? prevState?.suggestionsDisabledReason : sugR.message,\n };\n }\n\n setFieldLoadStates(nextLoadStates);\n prevResultsRef.current = slotResults;\n\n return () => {\n cancelled = true;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [slotResultsSig, slots, pipeOrSearchId]);\n\n // --- Sections & fields ---\n const isSubmitted = form.formState.isSubmitted;\n const formErrors = form.formState.errors;\n\n // `watchedValues` and `formErrors` must be in the dep array: field handles\n // bake `form.getValues(path)` snapshots into `field.value` / textareaProps /\n // selectedValue, and adapters render those as controlled inputs. Without\n // these deps, the memo never refreshes on keystrokes and the controlled\n // inputs snap back to their stale snapshot — typing/selecting appears to\n // do nothing. See FieldRenderer's memo comment for the intended contract.\n const sections = useMemo(\n () =>\n buildSectionHandles(formConfig, form as any, publicKey, {\n fieldLoadStates,\n searchSecrets,\n searchConstants,\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n formConfig,\n form,\n publicKey,\n fieldLoadStates,\n isSubmitted,\n searchSecrets,\n searchConstants,\n watchedValues,\n formErrors,\n ],\n );\n\n const fields = useMemo(\n () => sections.flatMap((s) => s.groups.flatMap((g) => g.fields)),\n [sections],\n );\n\n const { fieldLoaderErrors, loadingFieldLoaders, hasFieldLoaderError, isFieldLoaderLoading } =\n useMemo(() => {\n const errors: Record<string, FieldLoadState> = {};\n const loading: Record<string, FieldLoadState> = {};\n for (const [path, state] of Object.entries(fieldLoadStates)) {\n if (state.status === \"error\") errors[path] = state;\n else if (state.status === \"loading\") loading[path] = state;\n }\n return {\n fieldLoaderErrors: errors,\n loadingFieldLoaders: loading,\n hasFieldLoaderError: Object.keys(errors).length > 0,\n isFieldLoaderLoading: Object.keys(loading).length > 0,\n };\n }, [fieldLoadStates]);\n\n return {\n connectionsStatus,\n fieldLoadStates,\n fieldLoaderErrors,\n loadingFieldLoaders,\n hasFieldLoaderError,\n isFieldLoaderLoading,\n form,\n sections,\n fields,\n reset: form.reset,\n };\n}\n"],"mappings":";;;;;;;AAuGA,SAAS,oBAAoB,YAA0C;CACrE,MAAM,MAAqB,EAAE;AAC7B,MAAK,MAAM,WAAW,WACpB,MAAK,MAAM,SAAS,QAAQ,OAC1B,MAAK,MAAM,SAAS,MAAM,QAAgC;AACxD,MAAI,MAAM,UACR,KAAI,KAAK;GACP,WAAW,MAAM;GACjB,QAAQ;GACR,WAAW,MAAM;GAClB,CAAC;AAIJ,OADE,MAAM,SAAS,0BAA0B,MAAM,SAAS,wBAChC,gBAAgB,SAAS,MAAM,YAAY;GACnE,MAAM,aAAa,MAAM;AAGzB,OAAI,YAAY,UACd,KAAI,KAAK;IACP,WAAW,MAAM;IACjB,QAAQ;IACR,WAAW,WAAW;IACtB;IACD,CAAC;OAKF,KAAI,KAAK;IACP,WAAW,MAAM;IACjB,QAAQ;IACR,kBAAkB,EAAE,UAAU,OAAO;IACrC;IACD,CAAC;;;AAMZ,QAAO;;AAGT,SAAS,aAAa,KAAc,MAAuB;CACzD,MAAM,QAAQ,KAAK,MAAM,IAAI;CAC7B,IAAI,MAAW;AACf,MAAK,MAAM,QAAQ,OAAO;AACxB,MAAI,OAAO,KAAM,QAAO;AACxB,QAAM,IAAI;;AAEZ,QAAO;;AAGT,SAAS,SAAS,MAAmB,SAAiC;AACpE,QAAO,KAAK,UAAU,QAAQ;;AAOhC,SAAgB,YACd,SACsB;CACtB,MAAM,EACJ,QACA,WACA,eACA,YACA,WACA,gBACA,MACA,UACA,cAAc,cACd,QACA,WACE;CAIJ,MAAM,YAAY,cAAe,SAAS,KAAK,UAA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AO,KAAK;EACb"}
1
+ {"version":3,"file":"use-form-core.mjs","names":[],"sources":["../../src/hooks/use-form-core.ts"],"sourcesContent":["import { standardSchemaResolver } from \"@hookform/resolvers/standard-schema\";\nimport type {\n EnabledIf,\n EnabledResult,\n FormResolvers,\n FormSection,\n FormStore,\n GeneratedInputMeta,\n PipesEnvironment,\n ProviderName,\n} from \"@pipe0/base\";\nimport { joinConnectionString } from \"@pipe0/base\";\nimport {\n type Dispatch,\n type SetStateAction,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { type FieldValues, type UseFormReturn, useForm } from \"react-hook-form\";\nimport type { AnyFieldProps, ConstantSuggestion, SecretSuggestion } from \"../types/field-props.js\";\nimport type { FormSectionHandle } from \"../types/form-handle.js\";\nimport { buildSectionHandles } from \"../utils/build-section-handlers.js\";\nimport { mergeFormStores } from \"../utils/merge-form-stores.js\";\n\n// ---------------------------------------------------------------------------\n// Public types\n// ---------------------------------------------------------------------------\n\nexport type ResourceStatus = \"idle\" | \"loading\" | \"ready\" | \"error\";\n\nexport type SlotId = \"field\" | \"suggestions\";\n\nexport type FieldEnabledState = {\n disabled: boolean;\n reason?: string;\n};\n\nexport type FieldLoadState = {\n status: ResourceStatus;\n /** Field-level disabled (from `meta.enabledIf`). */\n disabled: boolean;\n /** Field-level disabled reason. */\n disabledReason?: string;\n /** Suggestions sub-feature gate (from `optionsDef.enabledIf`). */\n suggestionsDisabled: boolean;\n /** Suggestions sub-feature reason. */\n suggestionsDisabledReason?: string;\n};\n\nexport interface UseFormCoreOptions<T extends FieldValues> {\n pipeOrSearchId: string;\n kind: \"pipe\" | \"search\" | \"effect\";\n schema: any;\n publicKey: string;\n defaultValues?: T;\n formConfig: FormSection[];\n resolvers?: FormResolvers;\n store: FormStore;\n setStore: Dispatch<SetStateAction<FormStore>>;\n environment?: PipesEnvironment;\n /**\n * Form-level scope tags. Bundled into every `resolvers.getSecrets` call so\n * the backend can return only the secrets allowed in the declared scopes\n * (intersection on top of cascade visibility).\n */\n scopes?: string[];\n /**\n * Current team context. Bundled into every `resolvers.getSecrets` call so\n * the backend can restrict team-level secrets to exactly this team.\n */\n teamId?: string;\n}\n\nexport interface UseFormCoreReturn<T extends FieldValues> {\n connectionsStatus: ResourceStatus;\n /** Map of field path → load state for dynamic context_select_input fields. */\n fieldLoadStates: Record<string, FieldLoadState>;\n /** Subset of `fieldLoadStates` where `status === \"error\"`. RHF-style. */\n fieldLoaderErrors: Record<string, FieldLoadState>;\n /** Subset of `fieldLoadStates` where `status === \"loading\"`. RHF-style. */\n loadingFieldLoaders: Record<string, FieldLoadState>;\n /** True when any field loader has errored. */\n hasFieldLoaderError: boolean;\n /** True when any field loader is currently loading. */\n isFieldLoaderLoading: boolean;\n form: UseFormReturn<T, any, any>;\n sections: FormSectionHandle[];\n fields: AnyFieldProps[];\n reset: (values?: T) => void;\n}\n\ntype EnabledSlot = {\n fieldPath: string;\n slotId: SlotId;\n enabledIf: EnabledIf;\n /** Only present for \"suggestions\" slots — used to drive option fetching. */\n optionsDef?: {\n requires: { connection?: ProviderName; fields?: readonly string[] };\n };\n};\n\nfunction collectEnabledSlots(formConfig: FormSection[]): EnabledSlot[] {\n const out: EnabledSlot[] = [];\n for (const section of formConfig) {\n for (const group of section.groups) {\n for (const field of group.fields as GeneratedInputMeta[]) {\n if (field.enabledIf) {\n out.push({\n fieldPath: field.path,\n slotId: \"field\",\n enabledIf: field.enabledIf,\n });\n }\n const supportsOptionsDef =\n field.type === \"context_select_input\" || field.type === \"tagged_text_input\";\n if (supportsOptionsDef && \"optionsDef\" in field && field.optionsDef) {\n const optionsDef = field.optionsDef as EnabledSlot[\"optionsDef\"] & {\n enabledIf?: EnabledIf;\n };\n if (optionsDef?.enabledIf) {\n out.push({\n fieldPath: field.path,\n slotId: \"suggestions\",\n enabledIf: optionsDef.enabledIf,\n optionsDef,\n });\n } else {\n // Even without a sub-feature enabledIf, we still need to track\n // this field as having a fetchable suggestions slot — it's\n // always enabled and the fetch fires on every value change.\n out.push({\n fieldPath: field.path,\n slotId: \"suggestions\",\n enabledIf: () => ({ disabled: false }),\n optionsDef,\n });\n }\n }\n }\n }\n }\n return out;\n}\n\nfunction getPathValue(obj: unknown, path: string): unknown {\n const parts = path.split(\".\");\n let cur: any = obj;\n for (const part of parts) {\n if (cur == null) return undefined;\n cur = cur[part];\n }\n return cur;\n}\n\nfunction evalSlot(slot: EnabledSlot, payload: unknown): EnabledResult {\n return slot.enabledIf(payload);\n}\n\n// ---------------------------------------------------------------------------\n// Hook\n// ---------------------------------------------------------------------------\n\nexport function useFormCore<T extends FieldValues>(\n options: UseFormCoreOptions<T>,\n): UseFormCoreReturn<T> {\n const {\n schema,\n publicKey,\n defaultValues,\n formConfig,\n resolvers,\n pipeOrSearchId,\n kind,\n setStore,\n environment = \"production\",\n scopes,\n teamId,\n } = options;\n\n // Stable signature for `scopes` so its identity doesn't churn the effect\n // dep across renders when callers pass a fresh array literal each time.\n const scopesKey = useMemo(() => (scopes ? JSON.stringify(scopes) : \"\"), [scopes]);\n\n // --- Per-resource status ---\n const [connectionsStatus, setConnectionsStatus] = useState<ResourceStatus>(\n resolvers?.getConnections ? \"loading\" : \"idle\",\n );\n const [fieldLoadStates, setFieldLoadStates] = useState<Record<string, FieldLoadState>>({});\n\n // --- Form ---\n const form = useForm<T>({\n resolver: standardSchemaResolver(schema),\n defaultValues: defaultValues as any,\n });\n\n // --- Helpers ---\n const mergeStore = useCallback(\n (incoming: FormStore) => setStore((old) => mergeFormStores(old, incoming)),\n [setStore],\n );\n\n // Latest-ref for formConfig: Effect 1 reads it for the connector prefill but\n // must not depend on it (formConfig rebuilds on every store merge, which\n // would re-fire the connections fetch in a loop).\n const formConfigRef = useRef(formConfig);\n formConfigRef.current = formConfig;\n\n // --- Effect 1: Load connections ---\n useEffect(() => {\n if (!resolvers?.getConnections) {\n setConnectionsStatus(\"idle\");\n return;\n }\n\n let cancelled = false;\n setConnectionsStatus(\"loading\");\n\n Promise.resolve(resolvers.getConnections({ id: pipeOrSearchId, environment }))\n .then((conns) => {\n if (cancelled) return;\n\n mergeStore({\n field_options: {\n connections: {\n options: conns.map((c) => ({\n label: c.public_id,\n value: c.public_id,\n widgets: {\n provider_logo: { provider: c.provider as ProviderName },\n },\n })),\n },\n },\n });\n\n // Prefill default connections into an EMPTY required connector. A\n // stored payload with a required connector always carries >=1\n // connection (min-1 validation), so an empty required connector\n // implies a fresh create form — prefilling never overwrites a\n // user's or stored choice. Runs once per connections load, so a\n // user clearing the field afterwards is not fought.\n const connectorField = formConfigRef.current\n .flatMap((section) => section.groups.flatMap((group) => group.fields))\n .map((field) => field as GeneratedInputMeta)\n .find((field) => field.type === \"connector_input\");\n if (\n connectorField?.type === \"connector_input\" &&\n connectorField.connectorMode === \"required\"\n ) {\n const current = form.getValues(connectorField.path as any) as\n | { connections?: { connection: string }[] }\n | null\n | undefined;\n const isEmpty = current == null || (current.connections?.length ?? 0) === 0;\n const defaults = conns.filter((c) => c.is_default);\n if (isEmpty && defaults.length > 0) {\n form.setValue(\n connectorField.path as any,\n {\n strategy: \"first\",\n connections: defaults.map((c) => ({\n type: \"vault\",\n connection: joinConnectionString({ provider: c.provider, id: c.public_id }),\n })),\n } as any,\n // Not dirtying: a freshly opened form with a prefilled default\n // should still count as pristine.\n { shouldDirty: false, shouldValidate: false },\n );\n }\n }\n\n setConnectionsStatus(\"ready\");\n })\n .catch(() => {\n if (!cancelled) setConnectionsStatus(\"error\");\n });\n\n return () => {\n cancelled = true;\n };\n }, [pipeOrSearchId, environment, resolvers?.getConnections, mergeStore]);\n\n // --- Curried secrets search ---\n // Each keystroke in the reference picker fires this with the latest query.\n // The picker handles debounce + race-correctness; here we just bundle in\n // form-level args (environment / scopes / teamId) and call the resolver.\n // No caching: every call hits the resolver. Returns [] if no resolver.\n const getSecretsResolver = resolvers?.getSecrets;\n const searchSecrets = useCallback(\n async (query: string): Promise<SecretSuggestion[]> => {\n if (!getSecretsResolver) return [];\n return Promise.resolve(getSecretsResolver({ query, environment, scopes, teamId }));\n },\n // `scopesKey` is the stable serialization of `scopes`; depending on the\n // raw array would churn the callback identity on every parent render.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [getSecretsResolver, environment, scopesKey, teamId],\n );\n\n // --- Curried constants search ---\n // Mirrors `searchSecrets` exactly. Same per-keystroke contract, same\n // form-level arg bundling. Returns [] when no resolver is wired.\n const getConstantsResolver = resolvers?.getConstants;\n const searchConstants = useCallback(\n async (query: string): Promise<ConstantSuggestion[]> => {\n if (!getConstantsResolver) return [];\n return Promise.resolve(getConstantsResolver({ query, environment, scopes, teamId }));\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [getConstantsResolver, environment, scopesKey, teamId],\n );\n\n // --- Effect 2: Evaluate enabledIf slots + drive context_select fetching ---\n const slots = useMemo(() => collectEnabledSlots(formConfig), [formConfig]);\n\n // Subscribe to all form value changes so resolvers re-evaluate.\n const watchedValues = form.watch();\n\n // Evaluate every slot against the current payload. Keep the result\n // serialized so the effect's deps stay stable across reference-identical\n // re-renders.\n const slotResults = useMemo(() => {\n const out: Record<string, EnabledResult> = {};\n for (const slot of slots) {\n out[`${slot.fieldPath}::${slot.slotId}`] = evalSlot(slot, watchedValues);\n }\n return out;\n }, [slots, watchedValues]);\n const slotResultsSig = useMemo(() => JSON.stringify(slotResults), [slotResults]);\n\n // Track previous results so we can detect enabled→disabled transitions\n // (drives field-value clearing) and last-fired fetch signatures.\n const prevResultsRef = useRef<Record<string, EnabledResult>>({});\n const lastFiredSigRef = useRef<Record<string, string>>({});\n\n useEffect(() => {\n if (slots.length === 0) return;\n\n let cancelled = false;\n const nextLoadStates: Record<string, FieldLoadState> = {\n ...fieldLoadStates,\n };\n\n // Group slot results by field path for the load-state map.\n const byField: Record<string, { field?: EnabledResult; suggestions?: EnabledResult }> = {};\n for (const slot of slots) {\n const r = slotResults[`${slot.fieldPath}::${slot.slotId}`];\n if (r == null) continue;\n byField[slot.fieldPath] ??= {};\n byField[slot.fieldPath][slot.slotId] = r;\n }\n\n for (const slot of slots) {\n const key = `${slot.fieldPath}::${slot.slotId}`;\n const r = slotResults[key];\n if (r == null) continue;\n const prev = prevResultsRef.current[key];\n\n // Field-slot only: on enabled→disabled, reset the value to the field's\n // configured default (from the seeded defaultValues) rather than `\"\"`.\n // `\"\"` is invalid for non-string fields — e.g. a gated boolean fails\n // `z.boolean()` and a nullable int's `null` default would coerce to `0`.\n // Fall back to `\"\"` only when there's NO default at the path, so explicit\n // `null`/`false` defaults survive (this resets an optional int back to\n // empty when its gate turns off).\n if (slot.slotId === \"field\" && r.disabled && prev != null && !prev.disabled) {\n const def = getPathValue(defaultValues, slot.fieldPath);\n form.setValue(slot.fieldPath as any, (def === undefined ? \"\" : def) as any, {\n shouldDirty: true,\n shouldTouch: true,\n });\n }\n\n // Suggestions-slot: drive the existing context_select_input fetch.\n if (slot.slotId === \"suggestions\" && resolvers?.getFieldContext) {\n // If suggestions are gated, skip the fetch and reset dedupe so\n // re-enabling re-fires.\n if (r.disabled) {\n delete lastFiredSigRef.current[slot.fieldPath];\n continue;\n }\n\n // Resolve the connection for the legacy `requires.connection`\n // (still needed to pick the right secret for the fetch).\n const watchedConnections = (\n watchedValues as {\n connector?: { connections?: { connection?: string }[] };\n }\n )?.connector?.connections;\n const required = slot.optionsDef?.requires;\n\n let connectionId: string | undefined;\n if (required?.connection) {\n const match = watchedConnections?.find((c) =>\n c?.connection?.startsWith(`${required.connection}_`),\n );\n connectionId = match?.connection;\n // No matching connection — can't fetch, even if enabledIf passed.\n if (!connectionId) continue;\n }\n\n // Per-field signature for dedupe.\n const perFieldSig = JSON.stringify({\n connectionId,\n deps: required?.fields?.map((d) => getPathValue(watchedValues, d)) ?? [],\n });\n if (lastFiredSigRef.current[slot.fieldPath] === perFieldSig) continue;\n lastFiredSigRef.current[slot.fieldPath] = perFieldSig;\n\n // Mark loading for this field's fetch.\n const existing = nextLoadStates[slot.fieldPath];\n nextLoadStates[slot.fieldPath] = {\n status: \"loading\",\n disabled: existing?.disabled ?? false,\n disabledReason: existing?.disabledReason,\n suggestionsDisabled: false,\n suggestionsDisabledReason: undefined,\n };\n\n const idKey = kind === \"search\" ? \"search_id\" : kind === \"effect\" ? \"effect_id\" : \"pipe_id\";\n\n Promise.resolve(\n resolvers.getFieldContext({\n fieldPath: slot.fieldPath,\n query: \"\",\n payload: {\n ...(watchedValues as Record<string, unknown>),\n [idKey]: pipeOrSearchId,\n },\n }),\n )\n .then((incoming: FormStore) => {\n if (cancelled) return;\n mergeStore(incoming);\n setFieldLoadStates((s) => ({\n ...s,\n [slot.fieldPath]: {\n ...(s[slot.fieldPath] ?? {\n disabled: false,\n suggestionsDisabled: false,\n }),\n status: \"ready\",\n },\n }));\n })\n .catch(() => {\n if (cancelled) return;\n setFieldLoadStates((s) => ({\n ...s,\n [slot.fieldPath]: {\n ...(s[slot.fieldPath] ?? {\n disabled: false,\n suggestionsDisabled: false,\n }),\n status: \"error\",\n },\n }));\n });\n }\n }\n\n // Reflect the latest enabledIf evaluation into fieldLoadStates so the\n // adapters and field-wrapper can render the disabled state.\n for (const fieldPath of Object.keys(byField)) {\n const { field: fieldR, suggestions: sugR } = byField[fieldPath]!;\n const prevState = nextLoadStates[fieldPath];\n nextLoadStates[fieldPath] = {\n status: prevState?.status ?? \"idle\",\n disabled: fieldR == null ? (prevState?.disabled ?? false) : fieldR.disabled,\n disabledReason: fieldR == null ? prevState?.disabledReason : fieldR.message,\n suggestionsDisabled:\n sugR == null ? (prevState?.suggestionsDisabled ?? false) : sugR.disabled,\n suggestionsDisabledReason:\n sugR == null ? prevState?.suggestionsDisabledReason : sugR.message,\n };\n }\n\n setFieldLoadStates(nextLoadStates);\n prevResultsRef.current = slotResults;\n\n return () => {\n cancelled = true;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [slotResultsSig, slots, pipeOrSearchId]);\n\n // --- Sections & fields ---\n const isSubmitted = form.formState.isSubmitted;\n const formErrors = form.formState.errors;\n\n // `watchedValues` and `formErrors` must be in the dep array: field handles\n // bake `form.getValues(path)` snapshots into `field.value` / textareaProps /\n // selectedValue, and adapters render those as controlled inputs. Without\n // these deps, the memo never refreshes on keystrokes and the controlled\n // inputs snap back to their stale snapshot — typing/selecting appears to\n // do nothing. See FieldRenderer's memo comment for the intended contract.\n const sections = useMemo(\n () =>\n buildSectionHandles(formConfig, form as any, publicKey, {\n fieldLoadStates,\n searchSecrets,\n searchConstants,\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n formConfig,\n form,\n publicKey,\n fieldLoadStates,\n isSubmitted,\n searchSecrets,\n searchConstants,\n watchedValues,\n formErrors,\n ],\n );\n\n const fields = useMemo(\n () => sections.flatMap((s) => s.groups.flatMap((g) => g.fields)),\n [sections],\n );\n\n const { fieldLoaderErrors, loadingFieldLoaders, hasFieldLoaderError, isFieldLoaderLoading } =\n useMemo(() => {\n const errors: Record<string, FieldLoadState> = {};\n const loading: Record<string, FieldLoadState> = {};\n for (const [path, state] of Object.entries(fieldLoadStates)) {\n if (state.status === \"error\") errors[path] = state;\n else if (state.status === \"loading\") loading[path] = state;\n }\n return {\n fieldLoaderErrors: errors,\n loadingFieldLoaders: loading,\n hasFieldLoaderError: Object.keys(errors).length > 0,\n isFieldLoaderLoading: Object.keys(loading).length > 0,\n };\n }, [fieldLoadStates]);\n\n return {\n connectionsStatus,\n fieldLoadStates,\n fieldLoaderErrors,\n loadingFieldLoaders,\n hasFieldLoaderError,\n isFieldLoaderLoading,\n form,\n sections,\n fields,\n reset: form.reset,\n };\n}\n"],"mappings":";;;;;;;;AAwGA,SAAS,oBAAoB,YAA0C;CACrE,MAAM,MAAqB,EAAE;AAC7B,MAAK,MAAM,WAAW,WACpB,MAAK,MAAM,SAAS,QAAQ,OAC1B,MAAK,MAAM,SAAS,MAAM,QAAgC;AACxD,MAAI,MAAM,UACR,KAAI,KAAK;GACP,WAAW,MAAM;GACjB,QAAQ;GACR,WAAW,MAAM;GAClB,CAAC;AAIJ,OADE,MAAM,SAAS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AC,SAAS;GACrD;IACA,CAAC,gBAAgB,CAAC;AAEvB,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO,KAAK;EACb"}
@@ -32,14 +32,14 @@ declare function usePipeCatalogTable(config?: {
32
32
  removeColumnFilter: (id: "inputFields" | "outputFields" | "tags" | "providers") => void;
33
33
  resetFilters: () => void;
34
34
  getColumnFilterValue: (id: "inputFields" | "outputFields" | "tags" | "providers") => string;
35
- sortedInputFieldEntries: [string, ("prompt:run@1" | "agent:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]][];
36
- sortedOutputFieldEntries: [string, ("prompt:run@1" | "agent:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]][];
37
- sortedTagEntries: [string, ("prompt:run@1" | "agent:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]][];
38
- sortedProviderEntries: [string, ("prompt:run@1" | "agent:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]][];
39
- pipeIdsByInputField: Record<string, ("prompt:run@1" | "agent:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]>;
40
- pipeIdsByOutputField: Record<string, ("prompt:run@1" | "agent:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]>;
41
- pipeIdsByProvider: Record<string, ("prompt:run@1" | "agent:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]>;
42
- pipeIdsByTag: Record<string, ("prompt:run@1" | "agent:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]>;
35
+ sortedInputFieldEntries: [string, ("prompt:run@1" | "agent:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "bucket:claim@1" | "bucket:count@1" | "bucket:check@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]][];
36
+ sortedOutputFieldEntries: [string, ("prompt:run@1" | "agent:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "bucket:claim@1" | "bucket:count@1" | "bucket:check@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]][];
37
+ sortedTagEntries: [string, ("prompt:run@1" | "agent:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "bucket:claim@1" | "bucket:count@1" | "bucket:check@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]][];
38
+ sortedProviderEntries: [string, ("prompt:run@1" | "agent:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "bucket:claim@1" | "bucket:count@1" | "bucket:check@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]][];
39
+ pipeIdsByInputField: Record<string, ("prompt:run@1" | "agent:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "bucket:claim@1" | "bucket:count@1" | "bucket:check@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]>;
40
+ pipeIdsByOutputField: Record<string, ("prompt:run@1" | "agent:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "bucket:claim@1" | "bucket:count@1" | "bucket:check@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]>;
41
+ pipeIdsByProvider: Record<string, ("prompt:run@1" | "agent:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "bucket:claim@1" | "bucket:count@1" | "bucket:check@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]>;
42
+ pipeIdsByTag: Record<string, ("prompt:run@1" | "agent:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "bucket:claim@1" | "bucket:count@1" | "bucket:check@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]>;
43
43
  };
44
44
  type UsePipeCatalogTableReturn = ReturnType<typeof usePipeCatalogTable>;
45
45
  //#endregion
@@ -27,12 +27,12 @@ declare function useSearchCatalogTable(config?: {
27
27
  removeColumnFilter: (id: "inputFields" | "outputFields" | "tags" | "providers") => void;
28
28
  resetFilters: () => void;
29
29
  getColumnFilterValue: (id: "inputFields" | "outputFields" | "tags" | "providers") => string;
30
- sortedOutputFieldEntries: [string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:crustdata@3" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "query:postgres@1" | "query:databricks@1" | "posts:content:crustdata@1")[]][];
31
- sortedTagEntries: [string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:crustdata@3" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "query:postgres@1" | "query:databricks@1" | "posts:content:crustdata@1")[]][];
32
- sortedProviderEntries: [string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:crustdata@3" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "query:postgres@1" | "query:databricks@1" | "posts:content:crustdata@1")[]][];
33
- searchIdsByOutputField: Record<string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:crustdata@3" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "query:postgres@1" | "query:databricks@1" | "posts:content:crustdata@1")[]>;
34
- searchIdsByProvider: Record<string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:crustdata@3" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "query:postgres@1" | "query:databricks@1" | "posts:content:crustdata@1")[]>;
35
- searchIdsByTag: Record<string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:crustdata@3" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "query:postgres@1" | "query:databricks@1" | "posts:content:crustdata@1")[]>;
30
+ sortedOutputFieldEntries: [string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:crustdata@3" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "bucket:entries@1" | "query:postgres@1" | "query:databricks@1" | "posts:content:crustdata@1")[]][];
31
+ sortedTagEntries: [string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:crustdata@3" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "bucket:entries@1" | "query:postgres@1" | "query:databricks@1" | "posts:content:crustdata@1")[]][];
32
+ sortedProviderEntries: [string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:crustdata@3" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "bucket:entries@1" | "query:postgres@1" | "query:databricks@1" | "posts:content:crustdata@1")[]][];
33
+ searchIdsByOutputField: Record<string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:crustdata@3" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "bucket:entries@1" | "query:postgres@1" | "query:databricks@1" | "posts:content:crustdata@1")[]>;
34
+ searchIdsByProvider: Record<string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:crustdata@3" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "bucket:entries@1" | "query:postgres@1" | "query:databricks@1" | "posts:content:crustdata@1")[]>;
35
+ searchIdsByTag: Record<string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:crustdata@3" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "bucket:entries@1" | "query:postgres@1" | "query:databricks@1" | "posts:content:crustdata@1")[]>;
36
36
  };
37
37
  type UseSearchCatalogTableReturn = ReturnType<typeof useSearchCatalogTable>;
38
38
  //#endregion
@@ -148,7 +148,8 @@ interface FieldExtras {
148
148
  options: Array<{
149
149
  value: string;
150
150
  label: string;
151
- widgets?: _$_pipe0_base0.WidgetsByKind;
151
+ widgets?: _$_pipe0_base0.WidgetsByKind; /** Opaque per-option payload (e.g. a bucket's contract) for compound adapters. */
152
+ data?: Record<string, string>;
152
153
  }>;
153
154
  selectedValue: string;
154
155
  onSelect: (v: string) => void; /** True while this field's options are being fetched. */
@@ -1 +1 @@
1
- {"version":3,"file":"field-props.d.mts","names":[],"sources":["../../src/types/field-props.ts"],"mappings":";;;;;;;AA0BA;;;;;;;;;;;;;KAAY,SAAA,WAAoB,sBAAA,IAA0B,qBAAA,CAAsB,CAAA;AAAA,UAM/D,cAAA,WAAyB,sBAAA;EACxC,IAAA,EAAM,CAAA;EACN,IAAA,EAAM,qBAAA,CAAsB,CAAA;EAC5B,IAAA,EAAM,UAAA;EACN,IAAA;EACA,EAAA;EAH4B;;;;EAQ5B,KAAA;EAe4B;;;;EAV5B,WAAA;EAdA;;;;EAmBA,IA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,aAAA;IAAA,IA5IpC;IA+IE,OAAA,WA9Ic;IAgJd,mBAAA;IACA,yBAAA;IA/II;;;;IAoJJ,aAAA,IAAiB,KAAA,aAAkB,OAAA,CAAQ,gBAAA;IA9I3C;;;;IAmJA,eAAA,IAAmB,KAAA,aAAkB,OAAA,CAAQ,kBAAA;EAAA;EAE/C,qBAAA;EACA,kBAAA;EA3IA;;;;;EAiJA,qBAAA;IACE,aAAA,IAAiB,KAAA,aAAkB,OAAA,CAAQ,gBAAA;IAC3C,eAAA,IAAmB,KAAA,aAAkB,OAAA,CAAQ,kBAAA;EAAA;EAE/C,eAAA;EACA,mBAAA;EACA,iBAAA;EACA,0BAAA;EA7IkC;;;;;;EAoJlC,oBAAA;AAAA;AAAA,KAYU,mBAAA,WAA8B,sBAAA,IAA0B,cAAA,CAAe,CAAA,IACjF,WAAA,CAAY,CAAA;;KAGF,aAAA,WACJ,sBAAA,GAAyB,mBAAA,CAAoB,CAAA,IACnD,sBAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipe0/react",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "React component library for building forms and catalogs powered by pipe0 pipes and searches.",
5
5
  "license": "MIT",
6
6
  "author": "pipe0",
@@ -84,7 +84,7 @@
84
84
  "react-hook-form": "^7.62.0",
85
85
  "swr": "^2.4.1",
86
86
  "tailwind-merge": "^3.3.1",
87
- "@pipe0/base": "0.5.3"
87
+ "@pipe0/base": "0.5.5"
88
88
  },
89
89
  "devDependencies": {
90
90
  "@base-ui/react": "^1.3.0",