@pipe0/react 1.0.18 → 1.0.20

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.
@@ -0,0 +1,91 @@
1
+ import { asFormHandle } from "../utils/internal-form.mjs";
2
+ import { useFormCore } from "./use-form-core.mjs";
3
+ import { useMemo, useState } from "react";
4
+ import { getPlaybookConfigFormConfig, getPlaybookEntry } from "@pipe0/base";
5
+
6
+ //#region src/hooks/use-playbook-form.ts
7
+ /**
8
+ * Playbook analog of `useSheetEffectForm` — drives the form that collects a
9
+ * playbook's config before its prompt is inserted into the composer.
10
+ *
11
+ * Deliberately thinner than the pipe/search/effect hooks: a playbook config
12
+ * carries no connector, no dynamic options and no upstream sheet, so there is
13
+ * no `FormResolvers`, no `ValidationContext` and nothing to fetch. The store
14
+ * stays empty for the whole life of the form — it exists only because
15
+ * `useFormCore` takes one.
16
+ *
17
+ * Returns a `PipeFormContext`-shaped object so the existing `<PipeForm>`
18
+ * compound components render it unchanged; the context interface is
19
+ * structural, and only the id/payload generics differ.
20
+ */
21
+ function usePlaybookForm(options) {
22
+ const { playbookId, publicKey, defaultValues, sectionMap, groupMap, pathMap } = options;
23
+ const def = useMemo(() => {
24
+ const entry = getPlaybookEntry(playbookId);
25
+ if (!entry) throw new Error(`Unknown playbook_id: "${playbookId}"`);
26
+ return entry;
27
+ }, [playbookId]);
28
+ const [store, setStore] = useState({ field_options: {} });
29
+ const formConfig = useMemo(() => getPlaybookConfigFormConfig({
30
+ playbookId,
31
+ customization: {
32
+ sectionMap,
33
+ groupMap,
34
+ pathMap
35
+ }
36
+ }), [playbookId, JSON.stringify({
37
+ sectionMap,
38
+ groupMap,
39
+ pathMap
40
+ })]);
41
+ const seedValues = useMemo(() => defaultValues ?? def.defaultConfig, [defaultValues, def]);
42
+ const core = useFormCore({
43
+ pipeOrSearchId: playbookId,
44
+ kind: "playbook",
45
+ schema: def.configSchema,
46
+ publicKey,
47
+ defaultValues: seedValues,
48
+ store,
49
+ setStore,
50
+ formConfig
51
+ });
52
+ const sections = core.sections;
53
+ const fields = useMemo(() => sections.flatMap((s) => s.groups.flatMap((g) => g.fields)), [sections]);
54
+ const fieldPaths = useMemo(() => new Set(sections.flatMap((s) => s.groups.flatMap((g) => g.fields.map((f) => f.path)))), [sections]);
55
+ return useMemo(() => ({
56
+ id: playbookId,
57
+ publicKey,
58
+ form: asFormHandle(core.form),
59
+ sections,
60
+ fields,
61
+ fieldPaths,
62
+ connectionsStatus: core.connectionsStatus,
63
+ fieldLoadStates: core.fieldLoadStates,
64
+ fieldLoaderErrors: core.fieldLoaderErrors,
65
+ loadingFieldLoaders: core.loadingFieldLoaders,
66
+ hasFieldLoaderError: core.hasFieldLoaderError,
67
+ isFieldLoaderLoading: core.isFieldLoaderLoading,
68
+ resolvers: void 0,
69
+ store,
70
+ reset: core.reset
71
+ }), [
72
+ playbookId,
73
+ publicKey,
74
+ core.form,
75
+ sections,
76
+ fields,
77
+ fieldPaths,
78
+ core.connectionsStatus,
79
+ core.fieldLoadStates,
80
+ core.fieldLoaderErrors,
81
+ core.loadingFieldLoaders,
82
+ core.hasFieldLoaderError,
83
+ core.isFieldLoaderLoading,
84
+ store,
85
+ core.reset
86
+ ]);
87
+ }
88
+
89
+ //#endregion
90
+ export { usePlaybookForm };
91
+ //# sourceMappingURL=use-playbook-form.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-playbook-form.mjs","names":[],"sources":["../../src/hooks/use-playbook-form.ts"],"sourcesContent":["import {\n type AnyPlaybookDef,\n type FormStore,\n getPlaybookConfigFormConfig,\n getPlaybookEntry,\n} from \"@pipe0/base\";\nimport { useMemo, useState } from \"react\";\nimport type { PipeFormContext } from \"../context/pipe-form-context.js\";\nimport type { GroupMap, PathMap, SectionMap } from \"../types/form-customization.js\";\nimport { asFormHandle } from \"../utils/internal-form.js\";\nimport { useFormCore } from \"./use-form-core.js\";\n\nexport interface UsePlaybookFormOptions {\n playbookId: string;\n publicKey: string;\n /** Seeded from the entry's `defaultConfig` when omitted. */\n defaultValues?: Record<string, unknown>;\n /** Hide / relabel / reorder sections by section key. `null` hides a section. */\n sectionMap?: SectionMap;\n /** Hide / relabel / reorder groups by group path. `null` hides a group. */\n groupMap?: GroupMap;\n /** Hide / relabel fields by field path. `null` hides a field. */\n pathMap?: PathMap;\n}\n\n/**\n * Playbook analog of `useSheetEffectForm` — drives the form that collects a\n * playbook's config before its prompt is inserted into the composer.\n *\n * Deliberately thinner than the pipe/search/effect hooks: a playbook config\n * carries no connector, no dynamic options and no upstream sheet, so there is\n * no `FormResolvers`, no `ValidationContext` and nothing to fetch. The store\n * stays empty for the whole life of the form — it exists only because\n * `useFormCore` takes one.\n *\n * Returns a `PipeFormContext`-shaped object so the existing `<PipeForm>`\n * compound components render it unchanged; the context interface is\n * structural, and only the id/payload generics differ.\n */\nexport function usePlaybookForm(options: UsePlaybookFormOptions): PipeFormContext {\n const { playbookId, publicKey, defaultValues, sectionMap, groupMap, pathMap } = options;\n\n const def = useMemo(() => {\n const entry = getPlaybookEntry(playbookId);\n if (!entry) throw new Error(`Unknown playbook_id: \"${playbookId}\"`);\n return entry as AnyPlaybookDef;\n }, [playbookId]);\n\n const [store, setStore] = useState<FormStore>({ field_options: {} });\n\n const customizationKey = JSON.stringify({ sectionMap, groupMap, pathMap });\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: customization inputs are tracked by value via `customizationKey` to keep the config stable across inline-object renders.\n const formConfig = useMemo(\n () =>\n getPlaybookConfigFormConfig({\n playbookId,\n customization: { sectionMap, groupMap, pathMap },\n }),\n [playbookId, customizationKey],\n );\n\n const seedValues = useMemo(\n () => (defaultValues ?? def.defaultConfig) as Record<string, unknown>,\n [defaultValues, def],\n );\n\n const core = useFormCore<Record<string, unknown>>({\n pipeOrSearchId: playbookId,\n kind: \"playbook\",\n schema: def.configSchema,\n publicKey,\n defaultValues: seedValues,\n store,\n setStore,\n formConfig,\n });\n\n const sections = core.sections;\n\n const fields = useMemo(\n () => sections.flatMap((s) => s.groups.flatMap((g) => g.fields)),\n [sections],\n );\n\n const fieldPaths = useMemo(\n () => new Set(sections.flatMap((s) => s.groups.flatMap((g) => g.fields.map((f) => f.path)))),\n [sections],\n );\n\n return useMemo<PipeFormContext>(\n () => ({\n // Structural reuse of PipeFormContext — see the function docblock.\n id: playbookId as unknown as PipeFormContext[\"id\"],\n publicKey,\n form: asFormHandle(core.form) as unknown as PipeFormContext[\"form\"],\n sections,\n fields,\n fieldPaths,\n connectionsStatus: core.connectionsStatus,\n fieldLoadStates: core.fieldLoadStates,\n fieldLoaderErrors: core.fieldLoaderErrors,\n loadingFieldLoaders: core.loadingFieldLoaders,\n hasFieldLoaderError: core.hasFieldLoaderError,\n isFieldLoaderLoading: core.isFieldLoaderLoading,\n resolvers: undefined,\n store,\n reset: core.reset as unknown as PipeFormContext[\"reset\"],\n }),\n [\n playbookId,\n publicKey,\n core.form,\n sections,\n fields,\n fieldPaths,\n core.connectionsStatus,\n core.fieldLoadStates,\n core.fieldLoaderErrors,\n core.loadingFieldLoaders,\n core.hasFieldLoaderError,\n core.isFieldLoaderLoading,\n store,\n core.reset,\n ],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuCA,SAAgB,gBAAgB,SAAkD;CAChF,MAAM,EAAE,YAAY,WAAW,eAAe,YAAY,UAAU,YAAY;CAEhF,MAAM,MAAM,cAAc;EACxB,MAAM,QAAQ,iBAAiB,WAAW;AAC1C,MAAI,CAAC,MAAO,OAAM,IAAI,MAAM,yBAAyB,WAAW,GAAG;AACnE,SAAO;IACN,CAAC,WAAW,CAAC;CAEhB,MAAM,CAAC,OAAO,YAAY,SAAoB,EAAE,eAAe,EAAE,EAAE,CAAC;CAKpE,MAAM,aAAa,cAEf,4BAA4B;EAC1B;EACA,eAAe;GAAE;GAAY;GAAU;GAAS;EACjD,CAAC,EACJ,CAAC,YATsB,KAAK,UAAU;EAAE;EAAY;EAAU;EAAS,CAAC,CAS1C,CAC/B;CAED,MAAM,aAAa,cACV,iBAAiB,IAAI,eAC5B,CAAC,eAAe,IAAI,CACrB;CAED,MAAM,OAAO,YAAqC;EAChD,gBAAgB;EAChB,MAAM;EACN,QAAQ,IAAI;EACZ;EACA,eAAe;EACf;EACA;EACA;EACD,CAAC;CAEF,MAAM,WAAW,KAAK;CAEtB,MAAM,SAAS,cACP,SAAS,SAAS,MAAM,EAAE,OAAO,SAAS,MAAM,EAAE,OAAO,CAAC,EAChE,CAAC,SAAS,CACX;CAED,MAAM,aAAa,cACX,IAAI,IAAI,SAAS,SAAS,MAAM,EAAE,OAAO,SAAS,MAAM,EAAE,OAAO,KAAK,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAC5F,CAAC,SAAS,CACX;AAED,QAAO,eACE;EAEL,IAAI;EACJ;EACA,MAAM,aAAa,KAAK,KAAK;EAC7B;EACA;EACA;EACA,mBAAmB,KAAK;EACxB,iBAAiB,KAAK;EACtB,mBAAmB,KAAK;EACxB,qBAAqB,KAAK;EAC1B,qBAAqB,KAAK;EAC1B,sBAAsB,KAAK;EAC3B,WAAW;EACX;EACA,OAAO,KAAK;EACb,GACD;EACE;EACA;EACA,KAAK;EACL;EACA;EACA;EACA,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL;EACA,KAAK;EACN,CACF"}
@@ -0,0 +1,30 @@
1
+ import { PipeFormContext } from "../context/pipe-form-context.mjs";
2
+ import { GroupMap, PathMap, SectionMap } from "../types/form-customization.mjs";
3
+ import { StreamId, StreamPayload } from "@pipe0/base";
4
+
5
+ //#region src/hooks/use-stream-form.d.ts
6
+ interface UseStreamFormOptions {
7
+ streamId: StreamId;
8
+ publicKey: string;
9
+ /** Seeded from the entry's `defaultPayload` when omitted. */
10
+ defaultValues?: StreamPayload;
11
+ sectionMap?: SectionMap;
12
+ groupMap?: GroupMap;
13
+ pathMap?: PathMap;
14
+ }
15
+ /**
16
+ * Drives the form that configures a stream before it is created.
17
+ *
18
+ * Closer to `usePlaybookForm` than to `usePipeForm`, and for the same reason it
19
+ * is thinner: a stream is configured against a SOURCE, not against a sheet, so
20
+ * there is no `ValidationContext` and no field references to resolve. It does
21
+ * keep the connector — several sources need a credential — which is why the
22
+ * store is real rather than permanently empty.
23
+ *
24
+ * Returns a `PipeFormContext`-shaped object so the existing `<PipeForm>`
25
+ * compound components render it unchanged.
26
+ */
27
+ declare function useStreamForm(options: UseStreamFormOptions): PipeFormContext;
28
+ //#endregion
29
+ export { UseStreamFormOptions, useStreamForm };
30
+ //# sourceMappingURL=use-stream-form.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-stream-form.d.mts","names":[],"sources":["../../src/hooks/use-stream-form.ts"],"mappings":";;;;;UAeiB,oBAAA;EACf,QAAA,EAAU,QAAA;EACV,SAAA;EAFmC;EAInC,aAAA,GAAgB,aAAA;EAChB,UAAA,GAAa,UAAA;EACb,QAAA,GAAW,QAAA;EACX,OAAA,GAAU,OAAA;AAAA;;;;;;;;;;;;;iBAeI,aAAA,CAAc,OAAA,EAAS,oBAAA,GAAuB,eAAA"}
@@ -0,0 +1,90 @@
1
+ import { asFormHandle } from "../utils/internal-form.mjs";
2
+ import { useFormCore } from "./use-form-core.mjs";
3
+ import { useMemo, useState } from "react";
4
+ import { getStreamDefaultPayload, getStreamEntry, getStreamPayloadFormConfig, getStreamPayloadSchema } from "@pipe0/base";
5
+
6
+ //#region src/hooks/use-stream-form.ts
7
+ /**
8
+ * Drives the form that configures a stream before it is created.
9
+ *
10
+ * Closer to `usePlaybookForm` than to `usePipeForm`, and for the same reason it
11
+ * is thinner: a stream is configured against a SOURCE, not against a sheet, so
12
+ * there is no `ValidationContext` and no field references to resolve. It does
13
+ * keep the connector — several sources need a credential — which is why the
14
+ * store is real rather than permanently empty.
15
+ *
16
+ * Returns a `PipeFormContext`-shaped object so the existing `<PipeForm>`
17
+ * compound components render it unchanged.
18
+ */
19
+ function useStreamForm(options) {
20
+ const { streamId, publicKey, defaultValues, sectionMap, groupMap, pathMap } = options;
21
+ useMemo(() => getStreamEntry(streamId), [streamId]);
22
+ const [store, setStore] = useState({ field_options: {} });
23
+ const seedValues = useMemo(() => defaultValues ?? getStreamDefaultPayload(streamId), [defaultValues, streamId]);
24
+ const formConfig = useMemo(() => getStreamPayloadFormConfig({
25
+ streamPayload: seedValues,
26
+ store,
27
+ customization: {
28
+ sectionMap,
29
+ groupMap,
30
+ pathMap
31
+ }
32
+ }), [
33
+ seedValues,
34
+ store,
35
+ JSON.stringify({
36
+ sectionMap,
37
+ groupMap,
38
+ pathMap
39
+ })
40
+ ]);
41
+ const core = useFormCore({
42
+ pipeOrSearchId: streamId,
43
+ kind: "stream",
44
+ schema: getStreamPayloadSchema(streamId),
45
+ publicKey,
46
+ defaultValues: seedValues,
47
+ store,
48
+ setStore,
49
+ formConfig
50
+ });
51
+ const sections = core.sections;
52
+ const fields = useMemo(() => sections.flatMap((s) => s.groups.flatMap((g) => g.fields)), [sections]);
53
+ const fieldPaths = useMemo(() => new Set(sections.flatMap((s) => s.groups.flatMap((g) => g.fields.map((f) => f.path)))), [sections]);
54
+ return useMemo(() => ({
55
+ id: streamId,
56
+ publicKey,
57
+ form: asFormHandle(core.form),
58
+ sections,
59
+ fields,
60
+ fieldPaths,
61
+ connectionsStatus: core.connectionsStatus,
62
+ fieldLoadStates: core.fieldLoadStates,
63
+ fieldLoaderErrors: core.fieldLoaderErrors,
64
+ loadingFieldLoaders: core.loadingFieldLoaders,
65
+ hasFieldLoaderError: core.hasFieldLoaderError,
66
+ isFieldLoaderLoading: core.isFieldLoaderLoading,
67
+ resolvers: void 0,
68
+ store,
69
+ reset: core.reset
70
+ }), [
71
+ streamId,
72
+ publicKey,
73
+ core.form,
74
+ sections,
75
+ fields,
76
+ fieldPaths,
77
+ core.connectionsStatus,
78
+ core.fieldLoadStates,
79
+ core.fieldLoaderErrors,
80
+ core.loadingFieldLoaders,
81
+ core.hasFieldLoaderError,
82
+ core.isFieldLoaderLoading,
83
+ store,
84
+ core.reset
85
+ ]);
86
+ }
87
+
88
+ //#endregion
89
+ export { useStreamForm };
90
+ //# sourceMappingURL=use-stream-form.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-stream-form.mjs","names":[],"sources":["../../src/hooks/use-stream-form.ts"],"sourcesContent":["import {\n type FormStore,\n getStreamDefaultPayload,\n getStreamEntry,\n getStreamPayloadFormConfig,\n getStreamPayloadSchema,\n type StreamId,\n type StreamPayload,\n} from \"@pipe0/base\";\nimport { useMemo, useState } from \"react\";\nimport type { PipeFormContext } from \"../context/pipe-form-context.js\";\nimport type { GroupMap, PathMap, SectionMap } from \"../types/form-customization.js\";\nimport { asFormHandle } from \"../utils/internal-form.js\";\nimport { useFormCore } from \"./use-form-core.js\";\n\nexport interface UseStreamFormOptions {\n streamId: StreamId;\n publicKey: string;\n /** Seeded from the entry's `defaultPayload` when omitted. */\n defaultValues?: StreamPayload;\n sectionMap?: SectionMap;\n groupMap?: GroupMap;\n pathMap?: PathMap;\n}\n\n/**\n * Drives the form that configures a stream before it is created.\n *\n * Closer to `usePlaybookForm` than to `usePipeForm`, and for the same reason it\n * is thinner: a stream is configured against a SOURCE, not against a sheet, so\n * there is no `ValidationContext` and no field references to resolve. It does\n * keep the connector — several sources need a credential — which is why the\n * store is real rather than permanently empty.\n *\n * Returns a `PipeFormContext`-shaped object so the existing `<PipeForm>`\n * compound components render it unchanged.\n */\nexport function useStreamForm(options: UseStreamFormOptions): PipeFormContext {\n const { streamId, publicKey, defaultValues, sectionMap, groupMap, pathMap } = options;\n\n // Resolved eagerly so an unknown id fails here with a legible message rather\n // than deep inside the form builder.\n useMemo(() => getStreamEntry(streamId), [streamId]);\n\n const [store, setStore] = useState<FormStore>({ field_options: {} });\n\n const seedValues = useMemo(\n () => (defaultValues ?? getStreamDefaultPayload(streamId)) as StreamPayload,\n [defaultValues, streamId],\n );\n\n const customizationKey = JSON.stringify({ sectionMap, groupMap, pathMap });\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: customization inputs are tracked by value via `customizationKey` to keep the config stable across inline-object renders.\n const formConfig = useMemo(\n () =>\n getStreamPayloadFormConfig({\n streamPayload: seedValues,\n store,\n customization: { sectionMap, groupMap, pathMap },\n }),\n [seedValues, store, customizationKey],\n );\n\n const core = useFormCore<Record<string, unknown>>({\n pipeOrSearchId: streamId,\n kind: \"stream\",\n schema: getStreamPayloadSchema(streamId),\n publicKey,\n defaultValues: seedValues as unknown as Record<string, unknown>,\n store,\n setStore,\n formConfig,\n });\n\n const sections = core.sections;\n\n const fields = useMemo(\n () => sections.flatMap((s) => s.groups.flatMap((g) => g.fields)),\n [sections],\n );\n\n const fieldPaths = useMemo(\n () => new Set(sections.flatMap((s) => s.groups.flatMap((g) => g.fields.map((f) => f.path)))),\n [sections],\n );\n\n return useMemo<PipeFormContext>(\n () => ({\n // Structural reuse of PipeFormContext — see the function docblock.\n id: streamId as unknown as PipeFormContext[\"id\"],\n publicKey,\n form: asFormHandle(core.form) as unknown as PipeFormContext[\"form\"],\n sections,\n fields,\n fieldPaths,\n connectionsStatus: core.connectionsStatus,\n fieldLoadStates: core.fieldLoadStates,\n fieldLoaderErrors: core.fieldLoaderErrors,\n loadingFieldLoaders: core.loadingFieldLoaders,\n hasFieldLoaderError: core.hasFieldLoaderError,\n isFieldLoaderLoading: core.isFieldLoaderLoading,\n resolvers: undefined,\n store,\n reset: core.reset as unknown as PipeFormContext[\"reset\"],\n }),\n [\n streamId,\n publicKey,\n core.form,\n sections,\n fields,\n fieldPaths,\n core.connectionsStatus,\n core.fieldLoadStates,\n core.fieldLoaderErrors,\n core.loadingFieldLoaders,\n core.hasFieldLoaderError,\n core.isFieldLoaderLoading,\n store,\n core.reset,\n ],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqCA,SAAgB,cAAc,SAAgD;CAC5E,MAAM,EAAE,UAAU,WAAW,eAAe,YAAY,UAAU,YAAY;AAI9E,eAAc,eAAe,SAAS,EAAE,CAAC,SAAS,CAAC;CAEnD,MAAM,CAAC,OAAO,YAAY,SAAoB,EAAE,eAAe,EAAE,EAAE,CAAC;CAEpE,MAAM,aAAa,cACV,iBAAiB,wBAAwB,SAAS,EACzD,CAAC,eAAe,SAAS,CAC1B;CAKD,MAAM,aAAa,cAEf,2BAA2B;EACzB,eAAe;EACf;EACA,eAAe;GAAE;GAAY;GAAU;GAAS;EACjD,CAAC,EACJ;EAAC;EAAY;EAVU,KAAK,UAAU;GAAE;GAAY;GAAU;GAAS,CAAC;EAUnC,CACtC;CAED,MAAM,OAAO,YAAqC;EAChD,gBAAgB;EAChB,MAAM;EACN,QAAQ,uBAAuB,SAAS;EACxC;EACA,eAAe;EACf;EACA;EACA;EACD,CAAC;CAEF,MAAM,WAAW,KAAK;CAEtB,MAAM,SAAS,cACP,SAAS,SAAS,MAAM,EAAE,OAAO,SAAS,MAAM,EAAE,OAAO,CAAC,EAChE,CAAC,SAAS,CACX;CAED,MAAM,aAAa,cACX,IAAI,IAAI,SAAS,SAAS,MAAM,EAAE,OAAO,SAAS,MAAM,EAAE,OAAO,KAAK,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAC5F,CAAC,SAAS,CACX;AAED,QAAO,eACE;EAEL,IAAI;EACJ;EACA,MAAM,aAAa,KAAK,KAAK;EAC7B;EACA;EACA;EACA,mBAAmB,KAAK;EACxB,iBAAiB,KAAK;EACtB,mBAAmB,KAAK;EACxB,qBAAqB,KAAK;EAC1B,qBAAqB,KAAK;EAC1B,sBAAsB,KAAK;EAC3B,WAAW;EACX;EACA,OAAO,KAAK;EACb,GACD;EACE;EACA;EACA,KAAK;EACL;EACA;EACA;EACA,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL;EACA,KAAK;EACN,CACF"}
package/dist/index.d.mts CHANGED
@@ -95,8 +95,10 @@ import { SearchesCatalogCardContext, SearchesCatalogCardContextValue, useSearche
95
95
  import { SearchesCatalogContext, SearchesCatalogContextValue, useSearchesCatalogContext } from "./context/searches-catalog-context.mjs";
96
96
  import { useFieldError } from "./hooks/use-field-error.mjs";
97
97
  import { UsePipeFormOptions, usePipeForm } from "./hooks/use-pipe-form.mjs";
98
+ import { UsePlaybookFormOptions, usePlaybookForm } from "./hooks/use-playbook-form.mjs";
98
99
  import { UseSearchFormOptions, useSearchForm } from "./hooks/use-search-form.mjs";
99
100
  import { UseSheetEffectFormOptions, useSheetEffectForm } from "./hooks/use-sheet-effect-form.mjs";
101
+ import { UseStreamFormOptions, useStreamForm } from "./hooks/use-stream-form.mjs";
100
102
  import { fuzzyFilter, getFieldStatusIcon, getFieldTypeIcon } from "./utils/catalog-helpers.mjs";
101
103
  import { EmojiGlyph } from "./widgets/emoji-glyph.mjs";
102
104
  import { FieldTypeBadge } from "./widgets/field-type-badge.mjs";
@@ -106,4 +108,4 @@ import { PricingBadge } from "./widgets/pricing-badge.mjs";
106
108
  import { ProviderLogo } from "./widgets/provider-logo.mjs";
107
109
  import { WidgetStrip } from "./widgets/widget-strip.mjs";
108
110
  import { WidgetView } from "./widgets/widget-view.mjs";
109
- export { Alert, AlertDescription, type AlertProps, AlertTitle, type AlertVariant, type AnyFieldProps as AnyFieldHandle, AvatarGroup, type AvatarGroupProps, type AvatarGroupState, CatalogCard, CatalogCardBadge, type CatalogCardBadgeProps, CatalogCardBadges, type CatalogCardBadgesProps, CatalogCardDescription, type CatalogCardDescriptionProps, CatalogCardHeader, type CatalogCardHeaderProps, type CatalogCardProps, CatalogCardTitle, type CatalogCardTitleProps, CatalogCategorySection, type CatalogCategorySectionProps, type CatalogClassNames, type CatalogComponentOverrides, type CatalogConfig, CatalogCopyId, type CatalogCopyIdProps, CatalogCreditBadge, type CatalogCreditBadgeProps, CatalogDocsBadge, type CatalogDocsBadgeProps, CatalogFieldBadge, type CatalogFieldBadgeProps, type CatalogFieldBadgeState, CatalogProvider, CatalogProviderAvatars, type CatalogProviderAvatarsProps, type CatalogProviderProps, CatalogRoot, type CostMode, type EffectCardData, EffectCatalog, EffectCatalogCard, EffectCatalogCardContext, type EffectCatalogCardContextValue, type EffectCatalogCardProps, type EffectCatalogCardState, EffectCatalogCategoryFilter, type EffectCatalogCategoryFilterProps, type EffectCatalogCategoryFilterState, EffectCatalogContext, type EffectCatalogContextValue, EffectCatalogEmpty, type EffectCatalogEmptyProps, type EffectCatalogEmptyState, type EffectCatalogInstanceProps, EffectCatalogList, type EffectCatalogListProps, type EffectCatalogListState, type EffectCatalogProps, EffectCatalogSearchFilter, type EffectCatalogSearchFilterProps, type EffectCatalogSearchFilterState, type EffectCatalogZeroConfigProps, EmojiGlyph, type FieldAdapterMap, type GeneratedFieldProps as FieldHandle, type FieldKind, type FieldMeta, FieldRenderer, FieldTypeBadge, type FormClassNames, type FormComponents, type FormConfig, type FormErrorEntry, type FormErrors, type FormFieldState, type FormHandle, FormProvider, type FormResetFieldOptions, type FormResetOptions, FormRoot, type FormSetValueOptions, type FormStateSnapshot, type GroupMap, type GroupOverride, IconGlyph, type InputFieldEntries, LogoUrl, type OutputFieldEntries, type PathMap, type PathOverride, type ActiveFilter as PipeActiveFilter, type PipeCardData, PipeCatalog, PipeCatalogActiveFilters, type PipeCatalogActiveFiltersProps, type PipeCatalogActiveFiltersState, PipeCatalogCard, PipeCatalogCardContext, type PipeCatalogCardContextValue, type PipeCatalogCardProps, PipeCatalogCategoryFilter, type PipeCatalogCategoryFilterProps, type PipeCatalogCategoryFilterState, PipeCatalogColumnFilter, type PipeCatalogColumnFilterProps, PipeCatalogColumnFilters, type PipeCatalogColumnFiltersProps, PipeCatalogContext, type PipeCatalogContextValue, PipeCatalogEmpty, type PipeCatalogEmptyProps, type PipeCatalogEmptyState, PipeCatalogInputFieldFilter, type PipeCatalogInputFieldFilterProps, type PipeCatalogInstanceProps, PipeCatalogList, type PipeCatalogListProps, type PipeCatalogListState, PipeCatalogOutputFieldFilter, type PipeCatalogOutputFieldFilterProps, type PipeCatalogProps, PipeCatalogProviderFilter, type PipeCatalogProviderFilterProps, PipeCatalogSearchFilter, type PipeCatalogSearchFilterProps, type PipeCatalogSearchFilterState, PipeCatalogTagFilter, type PipeCatalogTagFilterProps, type PipeCatalogZeroConfigProps, type PipeColumnFilterId, type ColumnFilterState as PipeColumnFilterState, PipeForm, PipeFormContent, PipeFormContext, PipeFormErrors, PipeFormField, PipeFormFooter, PipeFormGroup, PipeFormHeader, type PipeFormInstanceProps, type PipeFormProps, PipeFormSection, PipeFormSubmitButton, PipeFormTitle, type PipeFormZeroConfigProps, PricingBadge, ProviderLogo, type ActiveFilter$1 as SearchActiveFilter, type SearchCardData, SearchCatalog, SearchCatalogActiveFilters, type SearchCatalogActiveFiltersProps, type SearchCatalogActiveFiltersState, SearchCatalogCard, SearchCatalogCardContext, type SearchCatalogCardContextValue, type SearchCatalogCardProps, SearchCatalogCategoryFilter, type SearchCatalogCategoryFilterProps, type SearchCatalogCategoryFilterState, SearchCatalogColumnFilter, type SearchCatalogColumnFilterProps, SearchCatalogColumnFilters, type SearchCatalogColumnFiltersProps, SearchCatalogContext, type SearchCatalogContextValue, SearchCatalogEmpty, type SearchCatalogEmptyProps, type SearchCatalogEmptyState, type SearchCatalogInstanceProps, SearchCatalogList, type SearchCatalogListProps, type SearchCatalogListState, SearchCatalogOutputFieldFilter, type SearchCatalogOutputFieldFilterProps, type SearchCatalogProps, SearchCatalogProviderFilter, type SearchCatalogProviderFilterProps, SearchCatalogSearchFilter, type SearchCatalogSearchFilterProps, type SearchCatalogSearchFilterState, SearchCatalogTagFilter, type SearchCatalogTagFilterProps, type SearchCatalogZeroConfigProps, type SearchColumnFilterId, type ColumnFilterState$1 as SearchColumnFilterState, SearchForm, SearchFormContent, SearchFormContext, SearchFormErrors, SearchFormField, SearchFormFooter, SearchFormGroup, SearchFormHeader, type SearchFormInstanceProps, type SearchFormProps, SearchFormSection, SearchFormSubmitButton, SearchFormTitle, type SearchFormZeroConfigProps, type SearchOutputFieldEntries, type ActiveFilter$2 as SearchesActiveFilter, type SearchesCardData, SearchesCatalog, SearchesCatalogActiveFilters, type SearchesCatalogActiveFiltersProps, type SearchesCatalogActiveFiltersState, SearchesCatalogCard, SearchesCatalogCardContext, type SearchesCatalogCardContextValue, type SearchesCatalogCardProps, SearchesCatalogCategoryFilter, type SearchesCatalogCategoryFilterProps, type SearchesCatalogCategoryFilterState, SearchesCatalogColumnFilter, type SearchesCatalogColumnFilterProps, SearchesCatalogColumnFilters, type SearchesCatalogColumnFiltersProps, SearchesCatalogContext, type SearchesCatalogContextValue, SearchesCatalogEmpty, type SearchesCatalogEmptyProps, type SearchesCatalogEmptyState, type SearchesCatalogInstanceProps, SearchesCatalogList, type SearchesCatalogListProps, type SearchesCatalogListState, SearchesCatalogOutputFieldFilter, type SearchesCatalogOutputFieldFilterProps, type SearchesCatalogProps, SearchesCatalogProviderFilter, type SearchesCatalogProviderFilterProps, SearchesCatalogSearchFilter, type SearchesCatalogSearchFilterProps, type SearchesCatalogSearchFilterState, SearchesCatalogTagFilter, type SearchesCatalogTagFilterProps, type SearchesCatalogZeroConfigProps, type SearchesColumnFilterId, type ColumnFilterState$2 as SearchesColumnFilterState, type SearchesOutputFieldEntries, type SectionMap, type SectionOverride, type UseEffectCatalogTableReturn, type UsePipeCatalogTableReturn, type UsePipeFormOptions, type UseSearchCatalogTableReturn, type UseSearchFormOptions, type UseSearchesCatalogTableReturn, type UseSheetEffectFormOptions, WidgetStrip, WidgetView, alertVariants, defaultAdapters, fuzzyFilter, getFieldStatusIcon, getFieldTypeIcon, useCatalogConfig, useEffectCatalogCard, useEffectCatalogContext, useEffectCatalogTable, useFieldError, useFormAlert, useFormConfig, usePipeCatalogCard, usePipeCatalogContext, usePipeCatalogTable, usePipeForm, usePipeFormContext, usePortalContainer, useSearchCatalogCard, useSearchCatalogContext, useSearchCatalogTable, useSearchForm, useSearchFormContext, useSearchesCatalogCard, useSearchesCatalogContext, useSearchesCatalogTable, useSheetEffectForm };
111
+ export { Alert, AlertDescription, type AlertProps, AlertTitle, type AlertVariant, type AnyFieldProps as AnyFieldHandle, AvatarGroup, type AvatarGroupProps, type AvatarGroupState, CatalogCard, CatalogCardBadge, type CatalogCardBadgeProps, CatalogCardBadges, type CatalogCardBadgesProps, CatalogCardDescription, type CatalogCardDescriptionProps, CatalogCardHeader, type CatalogCardHeaderProps, type CatalogCardProps, CatalogCardTitle, type CatalogCardTitleProps, CatalogCategorySection, type CatalogCategorySectionProps, type CatalogClassNames, type CatalogComponentOverrides, type CatalogConfig, CatalogCopyId, type CatalogCopyIdProps, CatalogCreditBadge, type CatalogCreditBadgeProps, CatalogDocsBadge, type CatalogDocsBadgeProps, CatalogFieldBadge, type CatalogFieldBadgeProps, type CatalogFieldBadgeState, CatalogProvider, CatalogProviderAvatars, type CatalogProviderAvatarsProps, type CatalogProviderProps, CatalogRoot, type CostMode, type EffectCardData, EffectCatalog, EffectCatalogCard, EffectCatalogCardContext, type EffectCatalogCardContextValue, type EffectCatalogCardProps, type EffectCatalogCardState, EffectCatalogCategoryFilter, type EffectCatalogCategoryFilterProps, type EffectCatalogCategoryFilterState, EffectCatalogContext, type EffectCatalogContextValue, EffectCatalogEmpty, type EffectCatalogEmptyProps, type EffectCatalogEmptyState, type EffectCatalogInstanceProps, EffectCatalogList, type EffectCatalogListProps, type EffectCatalogListState, type EffectCatalogProps, EffectCatalogSearchFilter, type EffectCatalogSearchFilterProps, type EffectCatalogSearchFilterState, type EffectCatalogZeroConfigProps, EmojiGlyph, type FieldAdapterMap, type GeneratedFieldProps as FieldHandle, type FieldKind, type FieldMeta, FieldRenderer, FieldTypeBadge, type FormClassNames, type FormComponents, type FormConfig, type FormErrorEntry, type FormErrors, type FormFieldState, type FormHandle, FormProvider, type FormResetFieldOptions, type FormResetOptions, FormRoot, type FormSetValueOptions, type FormStateSnapshot, type GroupMap, type GroupOverride, IconGlyph, type InputFieldEntries, LogoUrl, type OutputFieldEntries, type PathMap, type PathOverride, type ActiveFilter as PipeActiveFilter, type PipeCardData, PipeCatalog, PipeCatalogActiveFilters, type PipeCatalogActiveFiltersProps, type PipeCatalogActiveFiltersState, PipeCatalogCard, PipeCatalogCardContext, type PipeCatalogCardContextValue, type PipeCatalogCardProps, PipeCatalogCategoryFilter, type PipeCatalogCategoryFilterProps, type PipeCatalogCategoryFilterState, PipeCatalogColumnFilter, type PipeCatalogColumnFilterProps, PipeCatalogColumnFilters, type PipeCatalogColumnFiltersProps, PipeCatalogContext, type PipeCatalogContextValue, PipeCatalogEmpty, type PipeCatalogEmptyProps, type PipeCatalogEmptyState, PipeCatalogInputFieldFilter, type PipeCatalogInputFieldFilterProps, type PipeCatalogInstanceProps, PipeCatalogList, type PipeCatalogListProps, type PipeCatalogListState, PipeCatalogOutputFieldFilter, type PipeCatalogOutputFieldFilterProps, type PipeCatalogProps, PipeCatalogProviderFilter, type PipeCatalogProviderFilterProps, PipeCatalogSearchFilter, type PipeCatalogSearchFilterProps, type PipeCatalogSearchFilterState, PipeCatalogTagFilter, type PipeCatalogTagFilterProps, type PipeCatalogZeroConfigProps, type PipeColumnFilterId, type ColumnFilterState as PipeColumnFilterState, PipeForm, PipeFormContent, PipeFormContext, PipeFormErrors, PipeFormField, PipeFormFooter, PipeFormGroup, PipeFormHeader, type PipeFormInstanceProps, type PipeFormProps, PipeFormSection, PipeFormSubmitButton, PipeFormTitle, type PipeFormZeroConfigProps, PricingBadge, ProviderLogo, type ActiveFilter$1 as SearchActiveFilter, type SearchCardData, SearchCatalog, SearchCatalogActiveFilters, type SearchCatalogActiveFiltersProps, type SearchCatalogActiveFiltersState, SearchCatalogCard, SearchCatalogCardContext, type SearchCatalogCardContextValue, type SearchCatalogCardProps, SearchCatalogCategoryFilter, type SearchCatalogCategoryFilterProps, type SearchCatalogCategoryFilterState, SearchCatalogColumnFilter, type SearchCatalogColumnFilterProps, SearchCatalogColumnFilters, type SearchCatalogColumnFiltersProps, SearchCatalogContext, type SearchCatalogContextValue, SearchCatalogEmpty, type SearchCatalogEmptyProps, type SearchCatalogEmptyState, type SearchCatalogInstanceProps, SearchCatalogList, type SearchCatalogListProps, type SearchCatalogListState, SearchCatalogOutputFieldFilter, type SearchCatalogOutputFieldFilterProps, type SearchCatalogProps, SearchCatalogProviderFilter, type SearchCatalogProviderFilterProps, SearchCatalogSearchFilter, type SearchCatalogSearchFilterProps, type SearchCatalogSearchFilterState, SearchCatalogTagFilter, type SearchCatalogTagFilterProps, type SearchCatalogZeroConfigProps, type SearchColumnFilterId, type ColumnFilterState$1 as SearchColumnFilterState, SearchForm, SearchFormContent, SearchFormContext, SearchFormErrors, SearchFormField, SearchFormFooter, SearchFormGroup, SearchFormHeader, type SearchFormInstanceProps, type SearchFormProps, SearchFormSection, SearchFormSubmitButton, SearchFormTitle, type SearchFormZeroConfigProps, type SearchOutputFieldEntries, type ActiveFilter$2 as SearchesActiveFilter, type SearchesCardData, SearchesCatalog, SearchesCatalogActiveFilters, type SearchesCatalogActiveFiltersProps, type SearchesCatalogActiveFiltersState, SearchesCatalogCard, SearchesCatalogCardContext, type SearchesCatalogCardContextValue, type SearchesCatalogCardProps, SearchesCatalogCategoryFilter, type SearchesCatalogCategoryFilterProps, type SearchesCatalogCategoryFilterState, SearchesCatalogColumnFilter, type SearchesCatalogColumnFilterProps, SearchesCatalogColumnFilters, type SearchesCatalogColumnFiltersProps, SearchesCatalogContext, type SearchesCatalogContextValue, SearchesCatalogEmpty, type SearchesCatalogEmptyProps, type SearchesCatalogEmptyState, type SearchesCatalogInstanceProps, SearchesCatalogList, type SearchesCatalogListProps, type SearchesCatalogListState, SearchesCatalogOutputFieldFilter, type SearchesCatalogOutputFieldFilterProps, type SearchesCatalogProps, SearchesCatalogProviderFilter, type SearchesCatalogProviderFilterProps, SearchesCatalogSearchFilter, type SearchesCatalogSearchFilterProps, type SearchesCatalogSearchFilterState, SearchesCatalogTagFilter, type SearchesCatalogTagFilterProps, type SearchesCatalogZeroConfigProps, type SearchesColumnFilterId, type ColumnFilterState$2 as SearchesColumnFilterState, type SearchesOutputFieldEntries, type SectionMap, type SectionOverride, type UseEffectCatalogTableReturn, type UsePipeCatalogTableReturn, type UsePipeFormOptions, type UsePlaybookFormOptions, type UseSearchCatalogTableReturn, type UseSearchFormOptions, type UseSearchesCatalogTableReturn, type UseSheetEffectFormOptions, type UseStreamFormOptions, WidgetStrip, WidgetView, alertVariants, defaultAdapters, fuzzyFilter, getFieldStatusIcon, getFieldTypeIcon, useCatalogConfig, useEffectCatalogCard, useEffectCatalogContext, useEffectCatalogTable, useFieldError, useFormAlert, useFormConfig, usePipeCatalogCard, usePipeCatalogContext, usePipeCatalogTable, usePipeForm, usePipeFormContext, usePlaybookForm, usePortalContainer, useSearchCatalogCard, useSearchCatalogContext, useSearchCatalogTable, useSearchForm, useSearchFormContext, useSearchesCatalogCard, useSearchesCatalogContext, useSearchesCatalogTable, useSheetEffectForm, useStreamForm };
package/dist/index.mjs CHANGED
@@ -99,6 +99,8 @@ import { SearchesCatalogTagFilter } from "./components/compound/searches-catalog
99
99
  import { CatalogCopyId, CatalogCreditBadge, CatalogDocsBadge, CatalogFieldBadge } from "./components/defaults/catalog/card-derived.mjs";
100
100
  import { CatalogCategorySection } from "./components/defaults/catalog/category-section.mjs";
101
101
  import { CatalogProviderAvatars } from "./components/defaults/catalog/provider-avatars.mjs";
102
+ import { usePlaybookForm } from "./hooks/use-playbook-form.mjs";
102
103
  import { useSheetEffectForm } from "./hooks/use-sheet-effect-form.mjs";
104
+ import { useStreamForm } from "./hooks/use-stream-form.mjs";
103
105
 
104
- export { Alert, AlertDescription, AlertTitle, AvatarGroup, CatalogCard, CatalogCardBadge, CatalogCardBadges, CatalogCardDescription, CatalogCardHeader, CatalogCardTitle, CatalogCategorySection, CatalogCopyId, CatalogCreditBadge, CatalogDocsBadge, CatalogFieldBadge, CatalogProvider, CatalogProviderAvatars, CatalogRoot, EffectCatalog, EffectCatalogCard, EffectCatalogCardContext, EffectCatalogCategoryFilter, EffectCatalogContext, EffectCatalogEmpty, EffectCatalogList, EffectCatalogSearchFilter, EmojiGlyph, FieldRenderer, FieldTypeBadge, FormProvider, FormRoot, IconGlyph, LogoUrl, PipeCatalog, PipeCatalogActiveFilters, PipeCatalogCard, PipeCatalogCardContext, PipeCatalogCategoryFilter, PipeCatalogColumnFilter, PipeCatalogColumnFilters, PipeCatalogContext, PipeCatalogEmpty, PipeCatalogInputFieldFilter, PipeCatalogList, PipeCatalogOutputFieldFilter, PipeCatalogProviderFilter, PipeCatalogSearchFilter, PipeCatalogTagFilter, PipeForm, PipeFormContent, PipeFormContext, PipeFormErrors, PipeFormField, PipeFormFooter, PipeFormGroup, PipeFormHeader, PipeFormSection, PipeFormSubmitButton, PipeFormTitle, PricingBadge, ProviderLogo, SearchCatalog, SearchCatalogActiveFilters, SearchCatalogCard, SearchCatalogCardContext, SearchCatalogCategoryFilter, SearchCatalogColumnFilter, SearchCatalogColumnFilters, SearchCatalogContext, SearchCatalogEmpty, SearchCatalogList, SearchCatalogOutputFieldFilter, SearchCatalogProviderFilter, SearchCatalogSearchFilter, SearchCatalogTagFilter, SearchForm, SearchFormContent, SearchFormContext, SearchFormErrors, SearchFormField, SearchFormFooter, SearchFormGroup, SearchFormHeader, SearchFormSection, SearchFormSubmitButton, SearchFormTitle, SearchesCatalog, SearchesCatalogActiveFilters, SearchesCatalogCard, SearchesCatalogCardContext, SearchesCatalogCategoryFilter, SearchesCatalogColumnFilter, SearchesCatalogColumnFilters, SearchesCatalogContext, SearchesCatalogEmpty, SearchesCatalogList, SearchesCatalogOutputFieldFilter, SearchesCatalogProviderFilter, SearchesCatalogSearchFilter, SearchesCatalogTagFilter, WidgetStrip, WidgetView, alertVariants, defaultAdapters, fuzzyFilter, getFieldStatusIcon, getFieldTypeIcon, useCatalogConfig, useEffectCatalogCard, useEffectCatalogContext, useEffectCatalogTable, useFieldError, useFormAlert, useFormConfig, usePipeCatalogCard, usePipeCatalogContext, usePipeCatalogTable, usePipeForm, usePipeFormContext, usePortalContainer, useSearchCatalogCard, useSearchCatalogContext, useSearchCatalogTable, useSearchForm, useSearchFormContext, useSearchesCatalogCard, useSearchesCatalogContext, useSearchesCatalogTable, useSheetEffectForm };
106
+ export { Alert, AlertDescription, AlertTitle, AvatarGroup, CatalogCard, CatalogCardBadge, CatalogCardBadges, CatalogCardDescription, CatalogCardHeader, CatalogCardTitle, CatalogCategorySection, CatalogCopyId, CatalogCreditBadge, CatalogDocsBadge, CatalogFieldBadge, CatalogProvider, CatalogProviderAvatars, CatalogRoot, EffectCatalog, EffectCatalogCard, EffectCatalogCardContext, EffectCatalogCategoryFilter, EffectCatalogContext, EffectCatalogEmpty, EffectCatalogList, EffectCatalogSearchFilter, EmojiGlyph, FieldRenderer, FieldTypeBadge, FormProvider, FormRoot, IconGlyph, LogoUrl, PipeCatalog, PipeCatalogActiveFilters, PipeCatalogCard, PipeCatalogCardContext, PipeCatalogCategoryFilter, PipeCatalogColumnFilter, PipeCatalogColumnFilters, PipeCatalogContext, PipeCatalogEmpty, PipeCatalogInputFieldFilter, PipeCatalogList, PipeCatalogOutputFieldFilter, PipeCatalogProviderFilter, PipeCatalogSearchFilter, PipeCatalogTagFilter, PipeForm, PipeFormContent, PipeFormContext, PipeFormErrors, PipeFormField, PipeFormFooter, PipeFormGroup, PipeFormHeader, PipeFormSection, PipeFormSubmitButton, PipeFormTitle, PricingBadge, ProviderLogo, SearchCatalog, SearchCatalogActiveFilters, SearchCatalogCard, SearchCatalogCardContext, SearchCatalogCategoryFilter, SearchCatalogColumnFilter, SearchCatalogColumnFilters, SearchCatalogContext, SearchCatalogEmpty, SearchCatalogList, SearchCatalogOutputFieldFilter, SearchCatalogProviderFilter, SearchCatalogSearchFilter, SearchCatalogTagFilter, SearchForm, SearchFormContent, SearchFormContext, SearchFormErrors, SearchFormField, SearchFormFooter, SearchFormGroup, SearchFormHeader, SearchFormSection, SearchFormSubmitButton, SearchFormTitle, SearchesCatalog, SearchesCatalogActiveFilters, SearchesCatalogCard, SearchesCatalogCardContext, SearchesCatalogCategoryFilter, SearchesCatalogColumnFilter, SearchesCatalogColumnFilters, SearchesCatalogContext, SearchesCatalogEmpty, SearchesCatalogList, SearchesCatalogOutputFieldFilter, SearchesCatalogProviderFilter, SearchesCatalogSearchFilter, SearchesCatalogTagFilter, WidgetStrip, WidgetView, alertVariants, defaultAdapters, fuzzyFilter, getFieldStatusIcon, getFieldTypeIcon, useCatalogConfig, useEffectCatalogCard, useEffectCatalogContext, useEffectCatalogTable, useFieldError, useFormAlert, useFormConfig, usePipeCatalogCard, usePipeCatalogContext, usePipeCatalogTable, usePipeForm, usePipeFormContext, usePlaybookForm, usePortalContainer, useSearchCatalogCard, useSearchCatalogContext, useSearchCatalogTable, useSearchForm, useSearchFormContext, useSearchesCatalogCard, useSearchesCatalogContext, useSearchesCatalogTable, useSheetEffectForm, useStreamForm };
@@ -172,6 +172,7 @@ interface FieldExtras {
172
172
  options: Array<{
173
173
  value: string;
174
174
  label: string;
175
+ widgets?: _$_pipe0_base0.WidgetsByKind;
175
176
  }>;
176
177
  selected: string[];
177
178
  onToggle: (v: string) => void;
@@ -213,6 +214,12 @@ interface FieldExtras {
213
214
  exact_range_input: RangeOperatorExtras;
214
215
  min_max_int_input: RangeFieldPair<number | null>;
215
216
  multi_create_input: ListExtras;
217
+ /**
218
+ * One free-text value with suggestions. Only the suggestion half of
219
+ * `ListExtras` — there is no list to add to or remove from, so exposing
220
+ * `items`/`add`/`remove` would be three affordances that cannot be used.
221
+ */
222
+ single_create_input: Pick<ListExtras, "options" | "loadOptions">;
216
223
  /**
217
224
  * Property list — stored as `{ property }[]` (extensible entries) but edited
218
225
  * as a plain tag list; the handler maps between the two shapes. When the
@@ -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,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AAA;IACE,aAAA,IAAiB,KAAA,aAAkB,OAAA,CAAQ,gBAAA;IAC3C,eAAA,IAAmB,KAAA,aAAkB,OAAA,CAAQ,kBAAA,KApJ/C;IAsJE,OAAA;EAAA;EAEF,eAAA;EACA,mBAAA;EACA,yBAAA;EAvJA;;;;;;EA8JA,kBAAA;IACE,OAAA,EAAS,KAAA;MACP,KAAA;MACA,KAAA;MACA,OAAA,GAjB0C,cAAA,CAiBV,aAAA,EA9IlC;MAgJE,IAAA,GAAO,MAAA;IAAA,IA7IiB;IAgJ1B,OAAA,WA/IU;IAiJV,mBAAA;IACA,yBAAA;EAAA;EAEF,iBAAA;EACA,0BAAA;EAxIE;;;;;;EA+IF,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"}
@@ -301,14 +301,10 @@ function buildExtras(meta, base, publicKey, loadingCtx) {
301
301
  next.splice(to, 0, moved);
302
302
  base.setValue(next);
303
303
  };
304
- const m = meta;
305
- if (m.suggestionsDef?.options) if (typeof m.suggestionsDef.options === "function") result.loadOptions = async (query) => withMergedWidgets(await m.suggestionsDef.options({
306
- query,
307
- token: publicKey
308
- }), m.suggestionsDef.widgets);
309
- else result.options = withMergedWidgets(m.suggestionsDef.options, m.suggestionsDef.widgets);
304
+ Object.assign(result, suggestionExtras(meta, publicKey));
310
305
  return result;
311
306
  }
307
+ if (inputGuards.single_create_input(meta)) return suggestionExtras(meta, publicKey);
312
308
  if (inputGuards.property_list_input(meta)) {
313
309
  const value = base.value ?? [];
314
310
  const result = {
@@ -377,6 +373,22 @@ function buildExtras(meta, base, publicKey, loadingCtx) {
377
373
  }
378
374
  return {};
379
375
  }
376
+ /**
377
+ * Turn a `suggestionsDef` into the options a combobox can render.
378
+ *
379
+ * Shared by the list and single create inputs. Kept in one place because the
380
+ * static/async split is easy to get subtly different in a second copy, and the
381
+ * difference would only show on the async branch.
382
+ */
383
+ function suggestionExtras(meta, publicKey) {
384
+ const m = meta;
385
+ if (!m.suggestionsDef?.options) return {};
386
+ if (typeof m.suggestionsDef.options === "function") return { loadOptions: async (query) => withMergedWidgets(await m.suggestionsDef.options({
387
+ query,
388
+ token: publicKey
389
+ }), m.suggestionsDef.widgets) };
390
+ return { options: withMergedWidgets(m.suggestionsDef.options, m.suggestionsDef.widgets) };
391
+ }
380
392
  function isEmptyValue(value) {
381
393
  if (value === null || typeof value === "undefined") return true;
382
394
  if (typeof value === "string") return value === "";
@@ -1 +1 @@
1
- {"version":3,"file":"build-section-handlers.mjs","names":[],"sources":["../../src/utils/build-section-handlers.ts"],"sourcesContent":["import type { FormSection, GeneratedInputMeta, SecretSuggestion, StoreOption } from \"@pipe0/base\";\nimport { inputGuards } from \"@pipe0/base\";\nimport type { UseFormReturn } from \"react-hook-form\";\nimport type { FieldLoadState } from \"../hooks/use-form-core.js\";\nimport type {\n AnyFieldProps,\n ConstantSuggestion,\n GeneratedFieldProps,\n} from \"../types/field-props.js\";\nimport type { FormGroupHandle, FormSectionHandle } from \"../types/form-handle.js\";\n\nexport interface FieldLoadingContext {\n /** Per-field load states for dynamic context_select_input fields, keyed by path. */\n fieldLoadStates: Record<string, FieldLoadState>;\n /**\n * Curried per-keystroke secrets searcher. Bundles the form-level\n * `environment` / `scopes` / `teamId` so adapters only need to pass the\n * user's typed query. Returns `[]` when no `getSecrets` resolver is wired.\n */\n searchSecrets?: (query: string) => Promise<SecretSuggestion[]>;\n /**\n * Curried per-keystroke constants searcher. Mirrors `searchSecrets`.\n * Returns `[]` when no `getConstants` resolver is wired.\n */\n searchConstants?: (query: string) => Promise<ConstantSuggestion[]>;\n /**\n * Curried per-keystroke field-context searcher: server-side option search\n * for ONE optionsDef-capable field (bundles the live payload). Returns the\n * options directly — never merged into the shared form store. Absent when\n * no `getFieldContext` resolver is wired.\n */\n searchFieldContext?: (fieldPath: string, query: string) => Promise<StoreOption[]>;\n}\n\n/**\n * Builds a fully-typed `GeneratedFieldProps` from raw metadata + form state.\n *\n * The returned object includes:\n * - Base props (kind, meta, value, setValue, error, etc.)\n * - Kind-specific extras (inputProps, options, toggle, etc.)\n */\nexport function buildFieldProps<Meta extends GeneratedInputMeta>(\n meta: Meta,\n form: UseFormReturn<Record<string, unknown>>,\n publicKey: string,\n loadingCtx?: FieldLoadingContext,\n): GeneratedFieldProps<Meta[\"type\"]> {\n const path = meta.path;\n const fieldState = form.getFieldState(path as any);\n const value = form.getValues(path as any);\n const id = `p0-field-${path.replace(/\\./g, \"-\")}`;\n\n const setValue = (v: unknown) =>\n form.setValue(path as any, v, {\n shouldDirty: true,\n shouldTouch: true,\n shouldValidate: true,\n });\n\n // Match the submit-gated behavior used everywhere else (group errorCount,\n // `useFieldError`): don't surface the field's error until the user has\n // attempted a submit. Otherwise `setValue`-triggered validation would\n // flash errors the moment the form is interacted with.\n const hasSubmitted = form.formState.isSubmitted;\n\n const loadState = loadingCtx?.fieldLoadStates?.[path];\n\n const base = {\n kind: meta.type,\n meta,\n form,\n path,\n label: meta.label ?? \"\",\n description: meta.description,\n info: meta.info,\n error: hasSubmitted ? fieldState.error?.message : undefined,\n touched: fieldState.isTouched,\n dirty: fieldState.isDirty,\n id,\n value,\n setValue,\n reset: () => form.resetField(path as any),\n disabled: loadState?.disabled ?? false,\n disabledReason: loadState?.disabledReason,\n };\n\n const extras = buildExtras(meta, { path, id, value, setValue }, publicKey, loadingCtx);\n\n return { ...base, ...extras } as unknown as GeneratedFieldProps<Meta[\"type\"]>;\n}\n\n// Re-export under old name for backward compat\nexport { buildFieldProps as buildFieldHandle };\n\ntype OptionLike = {\n value: string;\n label: string;\n widgets?: Record<string, Record<string, unknown>>;\n};\n\nfunction withMergedWidgets<T extends OptionLike>(\n options: T[],\n staticWidgets: Record<string, Record<string, unknown>> | undefined,\n): T[] {\n if (!staticWidgets) return options;\n return options.map((o) => ({\n ...o,\n widgets: { ...staticWidgets, ...(o.widgets ?? {}) },\n }));\n}\n\nfunction buildExtras(\n meta: GeneratedInputMeta,\n base: {\n path: string;\n id: string;\n value: unknown;\n setValue: (v: unknown) => void;\n },\n publicKey: string,\n loadingCtx?: FieldLoadingContext,\n): Record<string, unknown> {\n if (\n inputGuards.text_input(meta) ||\n inputGuards.int_input(meta) ||\n inputGuards.number_input(meta)\n ) {\n const isNumber = inputGuards.int_input(meta) || inputGuards.number_input(meta);\n return {\n inputProps: {\n type: isNumber ? \"number\" : (meta as any).inputType || \"text\",\n name: base.path,\n id: base.id,\n value: base.value != null ? String(base.value) : \"\",\n onChange: (e: React.ChangeEvent<HTMLInputElement>) => {\n const v = e.target.value;\n base.setValue(isNumber ? (v === \"\" ? null : Number(v)) : v);\n },\n placeholder: meta.placeholder,\n step: inputGuards.number_input(meta) ? \"0.001\" : undefined,\n },\n };\n }\n\n if (inputGuards.textarea_input(meta)) {\n return {\n textareaProps: {\n name: base.path,\n id: base.id,\n value: (base.value as string) ?? \"\",\n onChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => base.setValue(e.target.value),\n placeholder: meta.placeholder,\n rows: meta.rows,\n },\n };\n }\n\n if (inputGuards.select_input(meta)) {\n return {\n options: meta.options ?? [],\n selectedValue: (base.value as string) ?? \"\",\n onSelect: (v: string) => base.setValue(v),\n };\n }\n\n if (inputGuards.context_select_input(meta)) {\n const loadState = loadingCtx?.fieldLoadStates?.[meta.path];\n const searchFieldContext = loadingCtx?.searchFieldContext;\n return {\n options: meta.options ?? [],\n selectedValue: (base.value as string) ?? \"\",\n onSelect: (v: string) => base.setValue(v),\n pending: loadState?.status === \"loading\",\n suggestionsDisabled: loadState?.suggestionsDisabled ?? false,\n suggestionsDisabledReason: loadState?.suggestionsDisabledReason,\n // Per-keystroke server-side search through the field-context channel.\n // Static widgets merge exactly as `resolveField` does for store options.\n loadOptions: searchFieldContext\n ? async (query: string) =>\n withMergedWidgets(await searchFieldContext(meta.path, query), meta.optionsDef?.widgets)\n : undefined,\n };\n }\n\n if (inputGuards.tagged_text_input(meta)) {\n const loadState = loadingCtx?.fieldLoadStates?.[meta.path];\n return {\n options: meta.options ?? [],\n pending: loadState?.status === \"loading\",\n suggestionsDisabled: loadState?.suggestionsDisabled ?? false,\n suggestionsDisabledReason: loadState?.suggestionsDisabledReason,\n searchSecrets: loadingCtx?.searchSecrets,\n searchConstants: loadingCtx?.searchConstants,\n };\n }\n\n if (inputGuards.providers_input(meta)) {\n return {\n options: meta.options ?? [],\n };\n }\n\n if (inputGuards.multi_select_input(meta)) {\n const selected = (base.value as string[]) ?? [];\n return {\n options: meta.options ?? [],\n selected,\n onToggle: (v: string) =>\n base.setValue(selected.includes(v) ? selected.filter((s) => s !== v) : [...selected, v]),\n onClear: () => base.setValue([]),\n };\n }\n\n if (inputGuards.async_multi_select_input(meta)) {\n const selected = (base.value as string[]) ?? [];\n return {\n loadOptions: async (query: string) =>\n withMergedWidgets(\n await meta.optionsDef.options({ query, token: publicKey }),\n meta.optionsDef.widgets,\n ),\n selected,\n onToggle: (v: string) =>\n base.setValue(selected.includes(v) ? selected.filter((s) => s !== v) : [...selected, v]),\n onClear: () => base.setValue([]),\n };\n }\n\n if (inputGuards.boolean_input(meta) || inputGuards.nullable_boolean_input(meta)) {\n return {\n checked: base.value === true,\n isNull: base.value === null || base.value === undefined,\n toggle: () => base.setValue(base.value === true ? false : true),\n clear: () => base.setValue(null),\n };\n }\n\n if (\n inputGuards.include_exclude_input(meta) ||\n inputGuards.include_exclude_select_input(meta) ||\n inputGuards.async_include_exclude_select_input(meta)\n ) {\n const current = (base.value as {\n include: string[];\n exclude: string[];\n }) ?? { include: [], exclude: [] };\n const result: Record<string, unknown> = {\n include: {\n value: current.include,\n add: (v: string) => base.setValue({ ...current, include: [...current.include, v] }),\n remove: (v: string) =>\n base.setValue({\n ...current,\n include: current.include.filter((i) => i !== v),\n }),\n },\n exclude: {\n value: current.exclude,\n add: (v: string) => base.setValue({ ...current, exclude: [...current.exclude, v] }),\n remove: (v: string) =>\n base.setValue({\n ...current,\n exclude: current.exclude.filter((i) => i !== v),\n }),\n },\n };\n const m = meta as any;\n if (m.optionsDef?.options && typeof m.optionsDef.options === \"function\") {\n result.loadOptions = async (query: string) =>\n withMergedWidgets(\n await m.optionsDef.options({ query, token: publicKey }),\n m.optionsDef.widgets,\n );\n } else if (m.optionsDef?.options) {\n result.options = withMergedWidgets(m.optionsDef.options, m.optionsDef.widgets);\n }\n if (m.suggestionsDef?.options) {\n if (typeof m.suggestionsDef.options === \"function\") {\n result.loadOptions = async (query: string) =>\n withMergedWidgets(\n await m.suggestionsDef.options({ query, token: publicKey }),\n m.suggestionsDef.widgets,\n );\n } else {\n result.options = withMergedWidgets(m.suggestionsDef.options, m.suggestionsDef.widgets);\n }\n }\n return result;\n }\n\n if (inputGuards.range_input(meta)) {\n const current = (base.value as {\n from: number | null;\n to: number | null;\n }) ?? { from: null, to: null };\n return {\n from: {\n value: current.from,\n set: (v: number | null) => base.setValue({ ...current, from: v }),\n },\n to: {\n value: current.to,\n set: (v: number | null) => base.setValue({ ...current, to: v }),\n },\n };\n }\n\n if (inputGuards.date_range_input(meta)) {\n const current = (base.value as Record<string, string>) ?? {};\n return {\n from: {\n value: current.gte ?? current.gt ?? \"\",\n set: (v: string) => base.setValue({ ...current, gte: v }),\n },\n to: {\n value: current.lte ?? current.lt ?? \"\",\n set: (v: string) => base.setValue({ ...current, lte: v }),\n },\n };\n }\n\n if (inputGuards.exact_range_input(meta)) {\n const current = (base.value as Record<string, number | null>) ?? {};\n return {\n greaterThan: {\n operator: current.gt != null ? \"gt\" : \"gte\",\n value: current.gt ?? current.gte ?? null,\n setOperator: (op: string) => {\n const otherOp = op === \"gt\" ? \"gte\" : \"gt\";\n const val = current[otherOp] ?? current[op];\n const updated = { ...current };\n delete updated[otherOp];\n if (val != null) updated[op] = val;\n base.setValue(updated);\n },\n setValue: (v: number | null) => {\n const op = current.gt != null ? \"gt\" : \"gte\";\n const updated = { ...current };\n if (v != null) updated[op] = v;\n else delete updated[op];\n base.setValue(updated);\n },\n },\n lessThan: {\n operator: current.lt != null ? \"lt\" : \"lte\",\n value: current.lt ?? current.lte ?? null,\n setOperator: (op: string) => {\n const otherOp = op === \"lt\" ? \"lte\" : \"lt\";\n const val = current[otherOp] ?? current[op];\n const updated = { ...current };\n delete updated[otherOp];\n if (val != null) updated[op] = val;\n base.setValue(updated);\n },\n setValue: (v: number | null) => {\n const op = current.lt != null ? \"lt\" : \"lte\";\n const updated = { ...current };\n if (v != null) updated[op] = v;\n else delete updated[op];\n base.setValue(updated);\n },\n },\n };\n }\n\n if (inputGuards.min_max_int_input(meta)) {\n const current = (base.value as {\n min: number | null;\n max: number | null;\n }) ?? { min: null, max: null };\n return {\n from: {\n value: current.min,\n set: (v: number | null) => base.setValue({ ...current, min: v }),\n },\n to: {\n value: current.max,\n set: (v: number | null) => base.setValue({ ...current, max: v }),\n },\n };\n }\n\n if (inputGuards.multi_create_input(meta) || inputGuards.ordered_multi_create_input(meta)) {\n const items = (base.value as string[]) ?? [];\n const result: Record<string, unknown> = {\n items,\n add: (v: string) => base.setValue([...items, v]),\n remove: (v: string) => base.setValue(items.filter((i) => i !== v)),\n };\n if (inputGuards.ordered_multi_create_input(meta)) {\n result.reorder = (from: number, to: number) => {\n const next = [...items];\n const [moved] = next.splice(from, 1);\n next.splice(to, 0, moved);\n base.setValue(next);\n };\n }\n const m = meta as any;\n if (m.suggestionsDef?.options) {\n if (typeof m.suggestionsDef.options === \"function\") {\n result.loadOptions = async (query: string) =>\n withMergedWidgets(\n await m.suggestionsDef.options({ query, token: publicKey }),\n m.suggestionsDef.widgets,\n );\n } else {\n result.options = withMergedWidgets(m.suggestionsDef.options, m.suggestionsDef.widgets);\n }\n }\n return result;\n }\n\n if (inputGuards.property_list_input(meta)) {\n // Stored shape is `{ property }[]` (extensible entries); the tag editor\n // works on plain strings, so map between the two here.\n const value = (base.value as { property: string }[]) ?? [];\n const result: Record<string, unknown> = {\n items: value.map((entry) => entry.property),\n add: (v: string) => base.setValue([...value, { property: v }]),\n remove: (v: string) => base.setValue(value.filter((entry) => entry.property !== v)),\n };\n const m = meta as any;\n if (m.suggestionsDef?.options) {\n if (typeof m.suggestionsDef.options === \"function\") {\n result.loadOptions = async (query: string) =>\n withMergedWidgets(\n await m.suggestionsDef.options({ query, token: publicKey }),\n m.suggestionsDef.widgets,\n );\n } else {\n result.options = withMergedWidgets(m.suggestionsDef.options, m.suggestionsDef.widgets);\n }\n }\n if (m.optionsDef) {\n // Connection-scoped suggestions (same channel as `context_select_input`):\n // per-keystroke server-side fetch with the user's connection secret.\n // Suggestion-only — the field lists the provider's actual attributes,\n // so free-form entries are disallowed.\n const loadState = loadingCtx?.fieldLoadStates?.[meta.path];\n const searchFieldContext = loadingCtx?.searchFieldContext;\n result.options = (meta as { options?: unknown }).options ?? [];\n result.pending = loadState?.status === \"loading\";\n result.suggestionsDisabled = loadState?.suggestionsDisabled ?? false;\n result.suggestionsDisabledReason = loadState?.suggestionsDisabledReason;\n result.allowCreate = false;\n if (searchFieldContext) {\n result.loadOptions = async (query: string) =>\n withMergedWidgets(await searchFieldContext(meta.path, query), m.optionsDef.widgets);\n }\n }\n return result;\n }\n\n if (inputGuards.tagged_ordered_multi_create_input(meta)) {\n const items = (base.value as string[]) ?? [];\n const result: Record<string, unknown> = {\n items,\n setItems: (next: string[]) => base.setValue(next),\n inputFields: meta.inputFields ?? [],\n };\n const m = meta as any;\n if (m.suggestionsDef?.options) {\n if (typeof m.suggestionsDef.options === \"function\") {\n result.loadOptions = async (query: string) =>\n withMergedWidgets(\n await m.suggestionsDef.options({ query, token: publicKey }),\n m.suggestionsDef.widgets,\n );\n } else {\n result.options = withMergedWidgets(m.suggestionsDef.options, m.suggestionsDef.widgets);\n }\n }\n return result;\n }\n\n if (inputGuards.loose_object_input(meta)) {\n const value = (base.value as Record<string, string>) ?? {};\n return {\n value,\n setObject: (next: Record<string, string>) => base.setValue(next),\n searchSecrets: loadingCtx?.searchSecrets,\n searchConstants: loadingCtx?.searchConstants,\n };\n }\n\n if (inputGuards.prompt_input(meta) || inputGuards.template_input(meta)) {\n return {\n searchSecrets: loadingCtx?.searchSecrets,\n searchConstants: loadingCtx?.searchConstants,\n };\n }\n\n if (inputGuards.condition_block_input(meta)) {\n const loadState = loadingCtx?.fieldLoadStates?.[meta.path];\n return {\n searchSecrets: loadingCtx?.searchSecrets,\n searchConstants: loadingCtx?.searchConstants,\n // Field-name suggestions themselves ride on `meta.options` (merged from\n // the form store by `resolveField`); only the load state comes through.\n pending: loadState?.status === \"loading\",\n };\n }\n\n if (inputGuards.field_select_input(meta)) {\n const loadState = loadingCtx?.fieldLoadStates?.[meta.path];\n return {\n options: meta.options ?? [],\n pending: loadState?.status === \"loading\",\n suggestionsDisabled: loadState?.suggestionsDisabled ?? false,\n suggestionsDisabledReason: loadState?.suggestionsDisabledReason,\n };\n }\n\n // Remaining types need no extras beyond base\n return {};\n}\n\nfunction isEmptyValue(value: unknown): boolean {\n if (value === null || typeof value === \"undefined\") return true;\n if (typeof value === \"string\") return value === \"\";\n if (Array.isArray(value)) return value.length === 0;\n if (typeof value === \"object\") {\n const keys = Object.keys(value);\n if (keys.length === 0) return true;\n return keys.every((k) => isEmptyValue((value as Record<string, unknown>)[k]));\n }\n return false;\n}\n\nexport function buildSectionHandles(\n formConfig: FormSection[],\n form: UseFormReturn<Record<string, unknown>>,\n publicKey: string,\n loadingCtx?: FieldLoadingContext,\n): FormSectionHandle[] {\n // In onSubmit validation mode, don't flag groups as invalid until the\n // user has actually attempted a submit. This matches RHF's own field-level\n // behavior where `formState.errors` is only populated after the first\n // submit (and updated reactively thereafter per `reValidateMode`).\n const hasSubmitted = form.formState.isSubmitted;\n\n return formConfig\n .map((section) => {\n const groups: FormGroupHandle[] = section.groups\n .map((group) => {\n // Drop a connector field whose mode is \"disabled\" (custom connections\n // unsupported) — there's nothing to configure, so we hide the whole\n // group/section rather than render a \"not supported\" placeholder.\n const fields = group.fields\n .filter(\n (meta) => !(inputGuards.connector_input(meta) && meta.connectorMode === \"disabled\"),\n )\n .map((meta) => buildFieldProps(meta, form, publicKey, loadingCtx)) as AnyFieldProps[];\n\n const groupPathError = form.getFieldState(group.groupPath as any).error;\n const errorCount = hasSubmitted\n ? fields.filter((f) => f.error != null).length + (groupPathError ? 1 : 0)\n : 0;\n const setCount = fields.filter((f) => !isEmptyValue(f.value)).length;\n const dirtyCount = fields.filter((f) => f.dirty).length;\n\n return {\n key: group.groupPath,\n label: group.label,\n description: group.description,\n iconKey: group.iconKey,\n defaultExpand: group.defaultExpand ?? false,\n fields,\n errorCount,\n setCount,\n dirtyCount,\n };\n })\n .filter((group) => group.fields.length > 0);\n\n return {\n key: section.metadata.path,\n label: section.metadata.label,\n description: section.metadata.description,\n groups,\n };\n })\n .filter((section) => section.groups.length > 0);\n}\n"],"mappings":";;;;;;;;;;AAyCA,SAAgB,gBACd,MACA,MACA,WACA,YACmC;CACnC,MAAM,OAAO,KAAK;CAClB,MAAM,aAAa,KAAK,cAAc,KAAY;CAClD,MAAM,QAAQ,KAAK,UAAU,KAAY;CACzC,MAAM,KAAK,YAAY,KAAK,QAAQ,OAAO,IAAI;CAE/C,MAAM,YAAY,MAChB,KAAK,SAAS,MAAa,GAAG;EAC5B,aAAa;EACb,aAAa;EACb,gBAAgB;EACjB,CAAC;CAMJ,MAAM,eAAe,KAAK,UAAU;CAEpC,MAAM,YAAY,YAAY,kBAAkB;CAEhD,MAAM,OAAO;EACX,MAAM,KAAK;EACX;EACA;EACA;EACA,OAAO,KAAK,SAAS;EACrB,aAAa,KAAK;EAClB,MAAM,KAAK;EACX,OAAO,eAAe,WAAW,OAAO,UAAU;EAClD,SAAS,WAAW;EACpB,OAAO,WAAW;EAClB;EACA;EACA;EACA,aAAa,KAAK,WAAW,KAAY;EACzC,UAAU,WAAW,YAAY;EACjC,gBAAgB,WAAW;EAC5B;CAED,MAAM,SAAS,YAAY,MAAM;EAAE;EAAM;EAAI;EAAO;EAAU,EAA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GACtB,OAAO,QAAQ,SAAS;GACxB,aAAa,QAAQ,SAAS;GAC9B;GACD;GACD,CACD,QAAQ,YAAY,QAAQ,OAAO,SAAS,EAAE"}
1
+ {"version":3,"file":"build-section-handlers.mjs","names":[],"sources":["../../src/utils/build-section-handlers.ts"],"sourcesContent":["import type { FormSection, GeneratedInputMeta, SecretSuggestion, StoreOption } from \"@pipe0/base\";\nimport { inputGuards } from \"@pipe0/base\";\nimport type { UseFormReturn } from \"react-hook-form\";\nimport type { FieldLoadState } from \"../hooks/use-form-core.js\";\nimport type {\n AnyFieldProps,\n ConstantSuggestion,\n GeneratedFieldProps,\n} from \"../types/field-props.js\";\nimport type { FormGroupHandle, FormSectionHandle } from \"../types/form-handle.js\";\n\nexport interface FieldLoadingContext {\n /** Per-field load states for dynamic context_select_input fields, keyed by path. */\n fieldLoadStates: Record<string, FieldLoadState>;\n /**\n * Curried per-keystroke secrets searcher. Bundles the form-level\n * `environment` / `scopes` / `teamId` so adapters only need to pass the\n * user's typed query. Returns `[]` when no `getSecrets` resolver is wired.\n */\n searchSecrets?: (query: string) => Promise<SecretSuggestion[]>;\n /**\n * Curried per-keystroke constants searcher. Mirrors `searchSecrets`.\n * Returns `[]` when no `getConstants` resolver is wired.\n */\n searchConstants?: (query: string) => Promise<ConstantSuggestion[]>;\n /**\n * Curried per-keystroke field-context searcher: server-side option search\n * for ONE optionsDef-capable field (bundles the live payload). Returns the\n * options directly — never merged into the shared form store. Absent when\n * no `getFieldContext` resolver is wired.\n */\n searchFieldContext?: (fieldPath: string, query: string) => Promise<StoreOption[]>;\n}\n\n/**\n * Builds a fully-typed `GeneratedFieldProps` from raw metadata + form state.\n *\n * The returned object includes:\n * - Base props (kind, meta, value, setValue, error, etc.)\n * - Kind-specific extras (inputProps, options, toggle, etc.)\n */\nexport function buildFieldProps<Meta extends GeneratedInputMeta>(\n meta: Meta,\n form: UseFormReturn<Record<string, unknown>>,\n publicKey: string,\n loadingCtx?: FieldLoadingContext,\n): GeneratedFieldProps<Meta[\"type\"]> {\n const path = meta.path;\n const fieldState = form.getFieldState(path as any);\n const value = form.getValues(path as any);\n const id = `p0-field-${path.replace(/\\./g, \"-\")}`;\n\n const setValue = (v: unknown) =>\n form.setValue(path as any, v, {\n shouldDirty: true,\n shouldTouch: true,\n shouldValidate: true,\n });\n\n // Match the submit-gated behavior used everywhere else (group errorCount,\n // `useFieldError`): don't surface the field's error until the user has\n // attempted a submit. Otherwise `setValue`-triggered validation would\n // flash errors the moment the form is interacted with.\n const hasSubmitted = form.formState.isSubmitted;\n\n const loadState = loadingCtx?.fieldLoadStates?.[path];\n\n const base = {\n kind: meta.type,\n meta,\n form,\n path,\n label: meta.label ?? \"\",\n description: meta.description,\n info: meta.info,\n error: hasSubmitted ? fieldState.error?.message : undefined,\n touched: fieldState.isTouched,\n dirty: fieldState.isDirty,\n id,\n value,\n setValue,\n reset: () => form.resetField(path as any),\n disabled: loadState?.disabled ?? false,\n disabledReason: loadState?.disabledReason,\n };\n\n const extras = buildExtras(meta, { path, id, value, setValue }, publicKey, loadingCtx);\n\n return { ...base, ...extras } as unknown as GeneratedFieldProps<Meta[\"type\"]>;\n}\n\n// Re-export under old name for backward compat\nexport { buildFieldProps as buildFieldHandle };\n\ntype OptionLike = {\n value: string;\n label: string;\n widgets?: Record<string, Record<string, unknown>>;\n};\n\nfunction withMergedWidgets<T extends OptionLike>(\n options: T[],\n staticWidgets: Record<string, Record<string, unknown>> | undefined,\n): T[] {\n if (!staticWidgets) return options;\n return options.map((o) => ({\n ...o,\n widgets: { ...staticWidgets, ...(o.widgets ?? {}) },\n }));\n}\n\nfunction buildExtras(\n meta: GeneratedInputMeta,\n base: {\n path: string;\n id: string;\n value: unknown;\n setValue: (v: unknown) => void;\n },\n publicKey: string,\n loadingCtx?: FieldLoadingContext,\n): Record<string, unknown> {\n if (\n inputGuards.text_input(meta) ||\n inputGuards.int_input(meta) ||\n inputGuards.number_input(meta)\n ) {\n const isNumber = inputGuards.int_input(meta) || inputGuards.number_input(meta);\n return {\n inputProps: {\n type: isNumber ? \"number\" : (meta as any).inputType || \"text\",\n name: base.path,\n id: base.id,\n value: base.value != null ? String(base.value) : \"\",\n onChange: (e: React.ChangeEvent<HTMLInputElement>) => {\n const v = e.target.value;\n base.setValue(isNumber ? (v === \"\" ? null : Number(v)) : v);\n },\n placeholder: meta.placeholder,\n step: inputGuards.number_input(meta) ? \"0.001\" : undefined,\n },\n };\n }\n\n if (inputGuards.textarea_input(meta)) {\n return {\n textareaProps: {\n name: base.path,\n id: base.id,\n value: (base.value as string) ?? \"\",\n onChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => base.setValue(e.target.value),\n placeholder: meta.placeholder,\n rows: meta.rows,\n },\n };\n }\n\n if (inputGuards.select_input(meta)) {\n return {\n options: meta.options ?? [],\n selectedValue: (base.value as string) ?? \"\",\n onSelect: (v: string) => base.setValue(v),\n };\n }\n\n if (inputGuards.context_select_input(meta)) {\n const loadState = loadingCtx?.fieldLoadStates?.[meta.path];\n const searchFieldContext = loadingCtx?.searchFieldContext;\n return {\n options: meta.options ?? [],\n selectedValue: (base.value as string) ?? \"\",\n onSelect: (v: string) => base.setValue(v),\n pending: loadState?.status === \"loading\",\n suggestionsDisabled: loadState?.suggestionsDisabled ?? false,\n suggestionsDisabledReason: loadState?.suggestionsDisabledReason,\n // Per-keystroke server-side search through the field-context channel.\n // Static widgets merge exactly as `resolveField` does for store options.\n loadOptions: searchFieldContext\n ? async (query: string) =>\n withMergedWidgets(await searchFieldContext(meta.path, query), meta.optionsDef?.widgets)\n : undefined,\n };\n }\n\n if (inputGuards.tagged_text_input(meta)) {\n const loadState = loadingCtx?.fieldLoadStates?.[meta.path];\n return {\n options: meta.options ?? [],\n pending: loadState?.status === \"loading\",\n suggestionsDisabled: loadState?.suggestionsDisabled ?? false,\n suggestionsDisabledReason: loadState?.suggestionsDisabledReason,\n searchSecrets: loadingCtx?.searchSecrets,\n searchConstants: loadingCtx?.searchConstants,\n };\n }\n\n if (inputGuards.providers_input(meta)) {\n return {\n options: meta.options ?? [],\n };\n }\n\n if (inputGuards.multi_select_input(meta)) {\n const selected = (base.value as string[]) ?? [];\n return {\n options: meta.options ?? [],\n selected,\n onToggle: (v: string) =>\n base.setValue(selected.includes(v) ? selected.filter((s) => s !== v) : [...selected, v]),\n onClear: () => base.setValue([]),\n };\n }\n\n if (inputGuards.async_multi_select_input(meta)) {\n const selected = (base.value as string[]) ?? [];\n return {\n loadOptions: async (query: string) =>\n withMergedWidgets(\n await meta.optionsDef.options({ query, token: publicKey }),\n meta.optionsDef.widgets,\n ),\n selected,\n onToggle: (v: string) =>\n base.setValue(selected.includes(v) ? selected.filter((s) => s !== v) : [...selected, v]),\n onClear: () => base.setValue([]),\n };\n }\n\n if (inputGuards.boolean_input(meta) || inputGuards.nullable_boolean_input(meta)) {\n return {\n checked: base.value === true,\n isNull: base.value === null || base.value === undefined,\n toggle: () => base.setValue(base.value === true ? false : true),\n clear: () => base.setValue(null),\n };\n }\n\n if (\n inputGuards.include_exclude_input(meta) ||\n inputGuards.include_exclude_select_input(meta) ||\n inputGuards.async_include_exclude_select_input(meta)\n ) {\n const current = (base.value as {\n include: string[];\n exclude: string[];\n }) ?? { include: [], exclude: [] };\n const result: Record<string, unknown> = {\n include: {\n value: current.include,\n add: (v: string) => base.setValue({ ...current, include: [...current.include, v] }),\n remove: (v: string) =>\n base.setValue({\n ...current,\n include: current.include.filter((i) => i !== v),\n }),\n },\n exclude: {\n value: current.exclude,\n add: (v: string) => base.setValue({ ...current, exclude: [...current.exclude, v] }),\n remove: (v: string) =>\n base.setValue({\n ...current,\n exclude: current.exclude.filter((i) => i !== v),\n }),\n },\n };\n const m = meta as any;\n if (m.optionsDef?.options && typeof m.optionsDef.options === \"function\") {\n result.loadOptions = async (query: string) =>\n withMergedWidgets(\n await m.optionsDef.options({ query, token: publicKey }),\n m.optionsDef.widgets,\n );\n } else if (m.optionsDef?.options) {\n result.options = withMergedWidgets(m.optionsDef.options, m.optionsDef.widgets);\n }\n if (m.suggestionsDef?.options) {\n if (typeof m.suggestionsDef.options === \"function\") {\n result.loadOptions = async (query: string) =>\n withMergedWidgets(\n await m.suggestionsDef.options({ query, token: publicKey }),\n m.suggestionsDef.widgets,\n );\n } else {\n result.options = withMergedWidgets(m.suggestionsDef.options, m.suggestionsDef.widgets);\n }\n }\n return result;\n }\n\n if (inputGuards.range_input(meta)) {\n const current = (base.value as {\n from: number | null;\n to: number | null;\n }) ?? { from: null, to: null };\n return {\n from: {\n value: current.from,\n set: (v: number | null) => base.setValue({ ...current, from: v }),\n },\n to: {\n value: current.to,\n set: (v: number | null) => base.setValue({ ...current, to: v }),\n },\n };\n }\n\n if (inputGuards.date_range_input(meta)) {\n const current = (base.value as Record<string, string>) ?? {};\n return {\n from: {\n value: current.gte ?? current.gt ?? \"\",\n set: (v: string) => base.setValue({ ...current, gte: v }),\n },\n to: {\n value: current.lte ?? current.lt ?? \"\",\n set: (v: string) => base.setValue({ ...current, lte: v }),\n },\n };\n }\n\n if (inputGuards.exact_range_input(meta)) {\n const current = (base.value as Record<string, number | null>) ?? {};\n return {\n greaterThan: {\n operator: current.gt != null ? \"gt\" : \"gte\",\n value: current.gt ?? current.gte ?? null,\n setOperator: (op: string) => {\n const otherOp = op === \"gt\" ? \"gte\" : \"gt\";\n const val = current[otherOp] ?? current[op];\n const updated = { ...current };\n delete updated[otherOp];\n if (val != null) updated[op] = val;\n base.setValue(updated);\n },\n setValue: (v: number | null) => {\n const op = current.gt != null ? \"gt\" : \"gte\";\n const updated = { ...current };\n if (v != null) updated[op] = v;\n else delete updated[op];\n base.setValue(updated);\n },\n },\n lessThan: {\n operator: current.lt != null ? \"lt\" : \"lte\",\n value: current.lt ?? current.lte ?? null,\n setOperator: (op: string) => {\n const otherOp = op === \"lt\" ? \"lte\" : \"lt\";\n const val = current[otherOp] ?? current[op];\n const updated = { ...current };\n delete updated[otherOp];\n if (val != null) updated[op] = val;\n base.setValue(updated);\n },\n setValue: (v: number | null) => {\n const op = current.lt != null ? \"lt\" : \"lte\";\n const updated = { ...current };\n if (v != null) updated[op] = v;\n else delete updated[op];\n base.setValue(updated);\n },\n },\n };\n }\n\n if (inputGuards.min_max_int_input(meta)) {\n const current = (base.value as {\n min: number | null;\n max: number | null;\n }) ?? { min: null, max: null };\n return {\n from: {\n value: current.min,\n set: (v: number | null) => base.setValue({ ...current, min: v }),\n },\n to: {\n value: current.max,\n set: (v: number | null) => base.setValue({ ...current, max: v }),\n },\n };\n }\n\n if (inputGuards.multi_create_input(meta) || inputGuards.ordered_multi_create_input(meta)) {\n const items = (base.value as string[]) ?? [];\n const result: Record<string, unknown> = {\n items,\n add: (v: string) => base.setValue([...items, v]),\n remove: (v: string) => base.setValue(items.filter((i) => i !== v)),\n };\n if (inputGuards.ordered_multi_create_input(meta)) {\n result.reorder = (from: number, to: number) => {\n const next = [...items];\n const [moved] = next.splice(from, 1);\n next.splice(to, 0, moved);\n base.setValue(next);\n };\n }\n Object.assign(result, suggestionExtras(meta, publicKey));\n return result;\n }\n\n if (inputGuards.single_create_input(meta)) {\n // Suggestions only. The value is a plain string on `base`, so the adapter\n // reads and writes it directly rather than through list helpers.\n return suggestionExtras(meta, publicKey);\n }\n\n if (inputGuards.property_list_input(meta)) {\n // Stored shape is `{ property }[]` (extensible entries); the tag editor\n // works on plain strings, so map between the two here.\n const value = (base.value as { property: string }[]) ?? [];\n const result: Record<string, unknown> = {\n items: value.map((entry) => entry.property),\n add: (v: string) => base.setValue([...value, { property: v }]),\n remove: (v: string) => base.setValue(value.filter((entry) => entry.property !== v)),\n };\n const m = meta as any;\n if (m.suggestionsDef?.options) {\n if (typeof m.suggestionsDef.options === \"function\") {\n result.loadOptions = async (query: string) =>\n withMergedWidgets(\n await m.suggestionsDef.options({ query, token: publicKey }),\n m.suggestionsDef.widgets,\n );\n } else {\n result.options = withMergedWidgets(m.suggestionsDef.options, m.suggestionsDef.widgets);\n }\n }\n if (m.optionsDef) {\n // Connection-scoped suggestions (same channel as `context_select_input`):\n // per-keystroke server-side fetch with the user's connection secret.\n // Suggestion-only — the field lists the provider's actual attributes,\n // so free-form entries are disallowed.\n const loadState = loadingCtx?.fieldLoadStates?.[meta.path];\n const searchFieldContext = loadingCtx?.searchFieldContext;\n result.options = (meta as { options?: unknown }).options ?? [];\n result.pending = loadState?.status === \"loading\";\n result.suggestionsDisabled = loadState?.suggestionsDisabled ?? false;\n result.suggestionsDisabledReason = loadState?.suggestionsDisabledReason;\n result.allowCreate = false;\n if (searchFieldContext) {\n result.loadOptions = async (query: string) =>\n withMergedWidgets(await searchFieldContext(meta.path, query), m.optionsDef.widgets);\n }\n }\n return result;\n }\n\n if (inputGuards.tagged_ordered_multi_create_input(meta)) {\n const items = (base.value as string[]) ?? [];\n const result: Record<string, unknown> = {\n items,\n setItems: (next: string[]) => base.setValue(next),\n inputFields: meta.inputFields ?? [],\n };\n const m = meta as any;\n if (m.suggestionsDef?.options) {\n if (typeof m.suggestionsDef.options === \"function\") {\n result.loadOptions = async (query: string) =>\n withMergedWidgets(\n await m.suggestionsDef.options({ query, token: publicKey }),\n m.suggestionsDef.widgets,\n );\n } else {\n result.options = withMergedWidgets(m.suggestionsDef.options, m.suggestionsDef.widgets);\n }\n }\n return result;\n }\n\n if (inputGuards.loose_object_input(meta)) {\n const value = (base.value as Record<string, string>) ?? {};\n return {\n value,\n setObject: (next: Record<string, string>) => base.setValue(next),\n searchSecrets: loadingCtx?.searchSecrets,\n searchConstants: loadingCtx?.searchConstants,\n };\n }\n\n if (inputGuards.prompt_input(meta) || inputGuards.template_input(meta)) {\n return {\n searchSecrets: loadingCtx?.searchSecrets,\n searchConstants: loadingCtx?.searchConstants,\n };\n }\n\n if (inputGuards.condition_block_input(meta)) {\n const loadState = loadingCtx?.fieldLoadStates?.[meta.path];\n return {\n searchSecrets: loadingCtx?.searchSecrets,\n searchConstants: loadingCtx?.searchConstants,\n // Field-name suggestions themselves ride on `meta.options` (merged from\n // the form store by `resolveField`); only the load state comes through.\n pending: loadState?.status === \"loading\",\n };\n }\n\n if (inputGuards.field_select_input(meta)) {\n const loadState = loadingCtx?.fieldLoadStates?.[meta.path];\n return {\n options: meta.options ?? [],\n pending: loadState?.status === \"loading\",\n suggestionsDisabled: loadState?.suggestionsDisabled ?? false,\n suggestionsDisabledReason: loadState?.suggestionsDisabledReason,\n };\n }\n\n // Remaining types need no extras beyond base\n return {};\n}\n\n/**\n * Turn a `suggestionsDef` into the options a combobox can render.\n *\n * Shared by the list and single create inputs. Kept in one place because the\n * static/async split is easy to get subtly different in a second copy, and the\n * difference would only show on the async branch.\n */\nfunction suggestionExtras(meta: unknown, publicKey: string | undefined) {\n const m = meta as any;\n if (!m.suggestionsDef?.options) return {};\n if (typeof m.suggestionsDef.options === \"function\") {\n return {\n loadOptions: async (query: string) =>\n withMergedWidgets(\n await m.suggestionsDef.options({ query, token: publicKey }),\n m.suggestionsDef.widgets,\n ),\n };\n }\n return { options: withMergedWidgets(m.suggestionsDef.options, m.suggestionsDef.widgets) };\n}\n\nfunction isEmptyValue(value: unknown): boolean {\n if (value === null || typeof value === \"undefined\") return true;\n if (typeof value === \"string\") return value === \"\";\n if (Array.isArray(value)) return value.length === 0;\n if (typeof value === \"object\") {\n const keys = Object.keys(value);\n if (keys.length === 0) return true;\n return keys.every((k) => isEmptyValue((value as Record<string, unknown>)[k]));\n }\n return false;\n}\n\nexport function buildSectionHandles(\n formConfig: FormSection[],\n form: UseFormReturn<Record<string, unknown>>,\n publicKey: string,\n loadingCtx?: FieldLoadingContext,\n): FormSectionHandle[] {\n // In onSubmit validation mode, don't flag groups as invalid until the\n // user has actually attempted a submit. This matches RHF's own field-level\n // behavior where `formState.errors` is only populated after the first\n // submit (and updated reactively thereafter per `reValidateMode`).\n const hasSubmitted = form.formState.isSubmitted;\n\n return formConfig\n .map((section) => {\n const groups: FormGroupHandle[] = section.groups\n .map((group) => {\n // Drop a connector field whose mode is \"disabled\" (custom connections\n // unsupported) — there's nothing to configure, so we hide the whole\n // group/section rather than render a \"not supported\" placeholder.\n const fields = group.fields\n .filter(\n (meta) => !(inputGuards.connector_input(meta) && meta.connectorMode === \"disabled\"),\n )\n .map((meta) => buildFieldProps(meta, form, publicKey, loadingCtx)) as AnyFieldProps[];\n\n const groupPathError = form.getFieldState(group.groupPath as any).error;\n const errorCount = hasSubmitted\n ? fields.filter((f) => f.error != null).length + (groupPathError ? 1 : 0)\n : 0;\n const setCount = fields.filter((f) => !isEmptyValue(f.value)).length;\n const dirtyCount = fields.filter((f) => f.dirty).length;\n\n return {\n key: group.groupPath,\n label: group.label,\n description: group.description,\n iconKey: group.iconKey,\n defaultExpand: group.defaultExpand ?? false,\n fields,\n errorCount,\n setCount,\n dirtyCount,\n };\n })\n .filter((group) => group.fields.length > 0);\n\n return {\n key: section.metadata.path,\n label: section.metadata.label,\n description: section.metadata.description,\n groups,\n };\n })\n .filter((section) => section.groups.length > 0);\n}\n"],"mappings":";;;;;;;;;;AAyCA,SAAgB,gBACd,MACA,MACA,WACA,YACmC;CACnC,MAAM,OAAO,KAAK;CAClB,MAAM,aAAa,KAAK,cAAc,KAAY;CAClD,MAAM,QAAQ,KAAK,UAAU,KAAY;CACzC,MAAM,KAAK,YAAY,KAAK,QAAQ,OAAO,IAAI;CAE/C,MAAM,YAAY,MAChB,KAAK,SAAS,MAAa,GAAG;EAC5B,aAAa;EACb,aAAa;EACb,gBAAgB;EACjB,CAAC;CAMJ,MAAM,eAAe,KAAK,UAAU;CAEpC,MAAM,YAAY,YAAY,kBAAkB;CAEhD,MAAM,OAAO;EACX,MAAM,KAAK;EACX;EACA;EACA;EACA,OAAO,KAAK,SAAS;EACrB,aAAa,KAAK;EAClB,MAAM,KAAK;EACX,OAAO,eAAe,WAAW,OAAO,UAAU;EAClD,SAAS,WAAW;EACpB,OAAO,WAAW;EAClB;EACA;EACA;EACA,aAAa,KAAK,WAAW,KAAY;EACzC,UAAU,WAAW,YAAY;EACjC,gBAAgB,WAAW;EAC5B;CAED,MAAM,SAAS,YAAY,MAAM;EAAE;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,EAAE,MAAM,CAAC;AAEjD,UAAO;IACL,KAAK,MAAM;IACX,OAAO,MAAM;IACb,aAAa,MAAM;IACnB,SAAS,MAAM;IACf,eAAe,MAAM,iBAAiB;IACtC;IACA;IACA;IACA;IACD;IACD,CACD,QAAQ,UAAU,MAAM,OAAO,SAAS,EAAE;AAE7C,SAAO;GACL,KAAK,QAAQ,SAAS;GACtB,OAAO,QAAQ,SAAS;GACxB,aAAa,QAAQ,SAAS;GAC9B;GACD;GACD,CACD,QAAQ,YAAY,QAAQ,OAAO,SAAS,EAAE"}
@@ -0,0 +1,32 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+
3
+ //#region src/widgets/glyphs/linkedin.tsx
4
+ /**
5
+ * The LinkedIn mark.
6
+ *
7
+ * Carried here because lucide REMOVED every brand icon in v1 — they are
8
+ * trademarks, and lucide chose not to ship them rather than police their use.
9
+ * The dash gets this from `@phosphor-icons/react`, which still does; this
10
+ * package has no icon dependency beyond lucide, so adding one for a single
11
+ * glyph would cost more than the glyph.
12
+ *
13
+ * Sized and stroked like the lucide icons around it in `iconGlyphs`, so it does
14
+ * not stand out as the one that came from somewhere else. Filled rather than
15
+ * stroked because that is how the mark is drawn.
16
+ */
17
+ function LinkedinGlyph({ size = 24, ...props }) {
18
+ return /* @__PURE__ */ jsx("svg", {
19
+ xmlns: "http://www.w3.org/2000/svg",
20
+ width: size,
21
+ height: size,
22
+ viewBox: "0 0 24 24",
23
+ fill: "currentColor",
24
+ "aria-hidden": "true",
25
+ ...props,
26
+ children: /* @__PURE__ */ jsx("path", { d: "M20.45 20.45h-3.56v-5.57c0-1.33-.02-3.04-1.85-3.04-1.85 0-2.13 1.45-2.13 2.94v5.67H9.35V9h3.41v1.56h.05a3.74 3.74 0 0 1 3.37-1.85c3.6 0 4.27 2.37 4.27 5.46v6.28zM5.34 7.43a2.06 2.06 0 1 1 0-4.13 2.06 2.06 0 0 1 0 4.13zm1.78 13.02H3.55V9h3.57v11.45zM22.22 0H1.77C.79 0 0 .77 0 1.72v20.56C0 23.23.79 24 1.77 24h20.45c.98 0 1.78-.77 1.78-1.72V1.72C24 .77 23.2 0 22.22 0z" })
27
+ });
28
+ }
29
+
30
+ //#endregion
31
+ export { LinkedinGlyph };
32
+ //# sourceMappingURL=linkedin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linkedin.mjs","names":[],"sources":["../../../src/widgets/glyphs/linkedin.tsx"],"sourcesContent":["import type { SVGProps } from \"react\";\n\n/**\n * The LinkedIn mark.\n *\n * Carried here because lucide REMOVED every brand icon in v1 — they are\n * trademarks, and lucide chose not to ship them rather than police their use.\n * The dash gets this from `@phosphor-icons/react`, which still does; this\n * package has no icon dependency beyond lucide, so adding one for a single\n * glyph would cost more than the glyph.\n *\n * Sized and stroked like the lucide icons around it in `iconGlyphs`, so it does\n * not stand out as the one that came from somewhere else. Filled rather than\n * stroked because that is how the mark is drawn.\n */\nexport function LinkedinGlyph({\n size = 24,\n ...props\n}: SVGProps<SVGSVGElement> & { size?: number | string }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n {...props}\n >\n <path d=\"M20.45 20.45h-3.56v-5.57c0-1.33-.02-3.04-1.85-3.04-1.85 0-2.13 1.45-2.13 2.94v5.67H9.35V9h3.41v1.56h.05a3.74 3.74 0 0 1 3.37-1.85c3.6 0 4.27 2.37 4.27 5.46v6.28zM5.34 7.43a2.06 2.06 0 1 1 0-4.13 2.06 2.06 0 0 1 0 4.13zm1.78 13.02H3.55V9h3.57v11.45zM22.22 0H1.77C.79 0 0 .77 0 1.72v20.56C0 23.23.79 24 1.77 24h20.45c.98 0 1.78-.77 1.78-1.72V1.72C24 .77 23.2 0 22.22 0z\" />\n </svg>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,SAAgB,cAAc,EAC5B,OAAO,IACP,GAAG,SACoD;AACvD,QACE,oBAAC,OAAD;EACE,OAAM;EACN,OAAO;EACP,QAAQ;EACR,SAAQ;EACR,MAAK;EACL,eAAY;EACZ,GAAI;YAEJ,oBAAC,QAAD,EAAM,GAAE,mXAAoX;EACxX"}
@@ -1,5 +1,6 @@
1
+ import { LinkedinGlyph } from "./glyphs/linkedin.mjs";
1
2
  import { jsx } from "react/jsx-runtime";
2
- import { Activity, Award, Banknote, BarChart3, BookOpen, Boxes, Braces, Brain, Briefcase, BriefcaseBusiness, Building2, Calendar, Code2, Compass, Contact, Download, Factory, Filter, GraduationCap, Handshake, History, Languages, LetterText, Library, Linkedin, List, Mail, MapPin, Medal, Plug, Search, Shuffle, Sigma, SlidersHorizontal, Sparkles, Star, Swords, Tags, Type, Upload, User, Workflow, Zap } from "lucide-react";
3
+ import { Activity, Award, Banknote, BarChart3, BookOpen, Boxes, Braces, Brain, Briefcase, BriefcaseBusiness, Building2, Calendar, Code2, Compass, Contact, Download, Factory, Filter, GraduationCap, Handshake, History, Languages, LetterText, Library, List, Mail, MapPin, Medal, Plug, Search, Shuffle, Sigma, SlidersHorizontal, Sparkles, Star, Swords, Tags, Type, Upload, User, Workflow, Zap } from "lucide-react";
3
4
 
4
5
  //#region src/widgets/icon-glyph.tsx
5
6
  const iconMap = {
@@ -17,7 +18,7 @@ const iconMap = {
17
18
  plug: Plug,
18
19
  mix: Shuffle,
19
20
  job: BriefcaseBusiness,
20
- linkedin: Linkedin,
21
+ linkedin: LinkedinGlyph,
21
22
  text: Type,
22
23
  workflow: Workflow,
23
24
  letter: LetterText,
@@ -25,7 +26,7 @@ const iconMap = {
25
26
  web: Compass,
26
27
  activity: Activity,
27
28
  boxes: Boxes,
28
- cometition: Swords,
29
+ competition: Swords,
29
30
  bill: Banknote,
30
31
  bolt: Zap,
31
32
  star: Star,