@particle-academy/fancy-flow 0.64.0 → 0.65.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -5,14 +5,14 @@ import { ConnectionValidatorOptions } from './registry/index.cjs';
5
5
  export { ANY_PORT_TYPE, BUILTIN_KINDS, PortCompatibility, RegistryNode, RichInputAdapter, RichInputPreview, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, getRichInputAdapter, isRichInputEnabled, onRichInputAdapterChanged, registerBuiltinKinds, registerRichInputAdapter, resolveNodePorts, resolvePortSpec } from './registry/index.cjs';
6
6
  import { a as FlowNode, F as FlowGraph, g as NodeRunStatus, E as ExecutorRegistry } from './types-JFYjPJAG.cjs';
7
7
  export { A as ActionNodeData, B as BaseNodeData, D as DecisionNodeData, d as FlowEdge, e as FlowNodeData, f as FlowNodeKind, N as NodeExecutor, h as NoteNodeData, O as OutputNodeData, P as PortDescriptor, R as RunEvent, S as SubgraphNodeData, T as TriggerNodeData } from './types-JFYjPJAG.cjs';
8
+ import { N as NodeKindDefinition, C as ConfigField, a as NodeCategory } from './types-D71SKA5A.cjs';
9
+ export { A as AvailableVariable, D as DocumentConfigField, E as EmitsRelation, t as ExpressionForm, u as ExpressionGrammarHelp, K as KeyValueConfigField, O as OutputField, h as OutputShape, P as PortSpec, R as RenderBodyContext, n as RepeaterConfigField, o as RepeaterRowField, w as availableVariables, x as baseVariables, y as describeExpressionGrammar, z as outputFieldsFor } from './types-D71SKA5A.cjs';
8
10
  import { C as ConfigFieldRenderFn, H as HumanFieldRenderers } from './HumanPrompt-Bpp3JiVH.cjs';
9
11
  export { a as ConfigFieldRenderContext, b as ConfigFieldRenderer, c as ConfigFieldRendererProps } from './HumanPrompt-Bpp3JiVH.cjs';
10
12
  import { WorkflowSchema, WorkflowMetadata } from './schema/index.cjs';
11
13
  export { ImportIssue, ImportOptions, ImportResult, WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, WorkflowSchemaEdge, WorkflowSchemaNode, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './schema/index.cjs';
12
14
  import { AutoLayoutOptions } from './layout/index.cjs';
13
15
  export { AutoLayoutDirection } from './layout/index.cjs';
14
- import { a as NodeCategory, N as NodeKindDefinition } from './types-D71SKA5A.cjs';
15
- export { A as AvailableVariable, C as ConfigField, D as DocumentConfigField, E as EmitsRelation, t as ExpressionForm, u as ExpressionGrammarHelp, K as KeyValueConfigField, O as OutputField, h as OutputShape, P as PortSpec, R as RenderBodyContext, n as RepeaterConfigField, o as RepeaterRowField, w as availableVariables, x as baseVariables, y as describeExpressionGrammar, z as outputFieldsFor } from './types-D71SKA5A.cjs';
16
16
  export { F as FlowNodeStatus, a as FlowViewer, b as FlowViewerClassNames, c as FlowViewerProps } from './FlowViewer-DABx-6A-.cjs';
17
17
  import { FlowRunFeedEntry } from './runtime/index.cjs';
18
18
  export { HistoryController, UseFlowHistoryReturn, UseFlowRunOptions, UseFlowRunReturn, UseFlowStateReturn, applyOutputsToNodes, applyStatusesToNodes, createHistory, useFlowHistory, useFlowRun, useFlowState } from './runtime/index.cjs';
@@ -101,6 +101,16 @@ type NodeConfigPanelProps = {
101
101
  */
102
102
  /** Host renderers keyed by field `type`. See {@link ConfigFieldRenderer}. */
103
103
  fieldRenderers?: Record<string, ConfigFieldRenderFn>;
104
+ /**
105
+ * Presentation-only visibility policy for schema fields. Returning `false`
106
+ * omits the complete field wrapper (label, description, and control) while
107
+ * leaving the registered kind and its runtime schema untouched.
108
+ */
109
+ fieldFilter?: (context: {
110
+ node: FlowNode;
111
+ kind: NodeKindDefinition;
112
+ field: ConfigField;
113
+ }) => boolean;
104
114
  /**
105
115
  * The graph the node lives in. Supplying it is what makes the `{{ }}` variable
106
116
  * picker context-aware — it reads the UPSTREAM node's declared `outputShape`
@@ -120,7 +130,7 @@ type NodeConfigPanelProps = {
120
130
  * NodeConfigPanel — schema-driven form for the selected node. Defers to
121
131
  * `kind.renderPanel` if the kind opts out of the auto-form.
122
132
  */
123
- declare function NodeConfigPanel({ node, onChange, onDelete, deleteLabel, header, renderCredentialField, renderDocumentField, fieldRenderers, graph, className, style, }: NodeConfigPanelProps): react.JSX.Element;
133
+ declare function NodeConfigPanel({ node, onChange, onDelete, deleteLabel, header, renderCredentialField, renderDocumentField, fieldRenderers, fieldFilter, graph, className, style, }: NodeConfigPanelProps): react.JSX.Element;
124
134
 
125
135
  /**
126
136
  * Clone a set of nodes AND the edges internal to that set, remapping every id.
@@ -353,6 +363,8 @@ type FlowEditorProps = {
353
363
  * editor and composing one by hand.
354
364
  */
355
365
  fieldRenderers?: ComponentProps<typeof NodeConfigPanel>["fieldRenderers"];
366
+ /** Presentation-only config-field filter, forwarded to `NodeConfigPanel`. */
367
+ fieldFilter?: ComponentProps<typeof NodeConfigPanel>["fieldFilter"];
356
368
  /** Show run feed below the canvas. Default true. */
357
369
  showFeed?: boolean;
358
370
  /** Total editor height. Default 720. */
@@ -675,4 +687,4 @@ type ExpressionFieldProps = {
675
687
  */
676
688
  declare function ExpressionField({ value, onChange, placeholder, rows, handle, graph, nodeId, }: ExpressionFieldProps): react.JSX.Element;
677
689
 
678
- export { ActionNode, type AlignEdge, AutoLayoutOptions, ConfigFieldRenderFn, ConnectionValidatorOptions, DecisionNode, ExecutorRegistry, ExpressionField, type ExpressionFieldProps, FlowCanvas, type FlowCanvasProps, FlowEditor, type FlowEditorAction, type FlowEditorApi, type FlowEditorBuiltins, type FlowEditorProps, type FlowEditorSlots, FlowGraph, FlowNode, type FlowNodeRenderProps, FlowRunControls, type FlowRunControlsProps, FlowRunFeed, FlowRunFeedEntry, type FlowRunFeedProps, LaneNode, NodeCategory, NodeConfigPanel, type NodeConfigPanelProps, NodeKindDefinition, NodePalette, type NodePaletteProps, NodePort, type NodePortProps, type NodePortSide, type NodePortType, NodeRunStatus, NodeShell, type NodeShellProps, NoteNode, OutputNode, SubgraphNode, TriggerNode, WorkflowMetadata, WorkflowSchema, alignNodes, cloneSubgraph, defaultNodeTypes, defineNode, distributeNodes, flowKeys, flowLive, paletteDropHandlers, reconnectEdge, useFlowEditor, useFlowEditorOptional };
690
+ export { ActionNode, type AlignEdge, AutoLayoutOptions, ConfigField, ConfigFieldRenderFn, ConnectionValidatorOptions, DecisionNode, ExecutorRegistry, ExpressionField, type ExpressionFieldProps, FlowCanvas, type FlowCanvasProps, FlowEditor, type FlowEditorAction, type FlowEditorApi, type FlowEditorBuiltins, type FlowEditorProps, type FlowEditorSlots, FlowGraph, FlowNode, type FlowNodeRenderProps, FlowRunControls, type FlowRunControlsProps, FlowRunFeed, FlowRunFeedEntry, type FlowRunFeedProps, LaneNode, NodeCategory, NodeConfigPanel, type NodeConfigPanelProps, NodeKindDefinition, NodePalette, type NodePaletteProps, NodePort, type NodePortProps, type NodePortSide, type NodePortType, NodeRunStatus, NodeShell, type NodeShellProps, NoteNode, OutputNode, SubgraphNode, TriggerNode, WorkflowMetadata, WorkflowSchema, alignNodes, cloneSubgraph, defaultNodeTypes, defineNode, distributeNodes, flowKeys, flowLive, paletteDropHandlers, reconnectEdge, useFlowEditor, useFlowEditorOptional };
package/dist/index.d.ts CHANGED
@@ -5,14 +5,14 @@ import { ConnectionValidatorOptions } from './registry/index.js';
5
5
  export { ANY_PORT_TYPE, BUILTIN_KINDS, PortCompatibility, RegistryNode, RichInputAdapter, RichInputPreview, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, getRichInputAdapter, isRichInputEnabled, onRichInputAdapterChanged, registerBuiltinKinds, registerRichInputAdapter, resolveNodePorts, resolvePortSpec } from './registry/index.js';
6
6
  import { a as FlowNode, F as FlowGraph, g as NodeRunStatus, E as ExecutorRegistry } from './types-JFYjPJAG.js';
7
7
  export { A as ActionNodeData, B as BaseNodeData, D as DecisionNodeData, d as FlowEdge, e as FlowNodeData, f as FlowNodeKind, N as NodeExecutor, h as NoteNodeData, O as OutputNodeData, P as PortDescriptor, R as RunEvent, S as SubgraphNodeData, T as TriggerNodeData } from './types-JFYjPJAG.js';
8
+ import { N as NodeKindDefinition, C as ConfigField, a as NodeCategory } from './types-Ckhz-YwC.js';
9
+ export { A as AvailableVariable, D as DocumentConfigField, E as EmitsRelation, t as ExpressionForm, u as ExpressionGrammarHelp, K as KeyValueConfigField, O as OutputField, h as OutputShape, P as PortSpec, R as RenderBodyContext, n as RepeaterConfigField, o as RepeaterRowField, w as availableVariables, x as baseVariables, y as describeExpressionGrammar, z as outputFieldsFor } from './types-Ckhz-YwC.js';
8
10
  import { C as ConfigFieldRenderFn, H as HumanFieldRenderers } from './HumanPrompt-BKThiyjB.js';
9
11
  export { a as ConfigFieldRenderContext, b as ConfigFieldRenderer, c as ConfigFieldRendererProps } from './HumanPrompt-BKThiyjB.js';
10
12
  import { WorkflowSchema, WorkflowMetadata } from './schema/index.js';
11
13
  export { ImportIssue, ImportOptions, ImportResult, WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, WorkflowSchemaEdge, WorkflowSchemaNode, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './schema/index.js';
12
14
  import { AutoLayoutOptions } from './layout/index.js';
13
15
  export { AutoLayoutDirection } from './layout/index.js';
14
- import { a as NodeCategory, N as NodeKindDefinition } from './types-Ckhz-YwC.js';
15
- export { A as AvailableVariable, C as ConfigField, D as DocumentConfigField, E as EmitsRelation, t as ExpressionForm, u as ExpressionGrammarHelp, K as KeyValueConfigField, O as OutputField, h as OutputShape, P as PortSpec, R as RenderBodyContext, n as RepeaterConfigField, o as RepeaterRowField, w as availableVariables, x as baseVariables, y as describeExpressionGrammar, z as outputFieldsFor } from './types-Ckhz-YwC.js';
16
16
  export { F as FlowNodeStatus, a as FlowViewer, b as FlowViewerClassNames, c as FlowViewerProps } from './FlowViewer-BI_AyyvU.js';
17
17
  import { FlowRunFeedEntry } from './runtime/index.js';
18
18
  export { HistoryController, UseFlowHistoryReturn, UseFlowRunOptions, UseFlowRunReturn, UseFlowStateReturn, applyOutputsToNodes, applyStatusesToNodes, createHistory, useFlowHistory, useFlowRun, useFlowState } from './runtime/index.js';
@@ -101,6 +101,16 @@ type NodeConfigPanelProps = {
101
101
  */
102
102
  /** Host renderers keyed by field `type`. See {@link ConfigFieldRenderer}. */
103
103
  fieldRenderers?: Record<string, ConfigFieldRenderFn>;
104
+ /**
105
+ * Presentation-only visibility policy for schema fields. Returning `false`
106
+ * omits the complete field wrapper (label, description, and control) while
107
+ * leaving the registered kind and its runtime schema untouched.
108
+ */
109
+ fieldFilter?: (context: {
110
+ node: FlowNode;
111
+ kind: NodeKindDefinition;
112
+ field: ConfigField;
113
+ }) => boolean;
104
114
  /**
105
115
  * The graph the node lives in. Supplying it is what makes the `{{ }}` variable
106
116
  * picker context-aware — it reads the UPSTREAM node's declared `outputShape`
@@ -120,7 +130,7 @@ type NodeConfigPanelProps = {
120
130
  * NodeConfigPanel — schema-driven form for the selected node. Defers to
121
131
  * `kind.renderPanel` if the kind opts out of the auto-form.
122
132
  */
123
- declare function NodeConfigPanel({ node, onChange, onDelete, deleteLabel, header, renderCredentialField, renderDocumentField, fieldRenderers, graph, className, style, }: NodeConfigPanelProps): react.JSX.Element;
133
+ declare function NodeConfigPanel({ node, onChange, onDelete, deleteLabel, header, renderCredentialField, renderDocumentField, fieldRenderers, fieldFilter, graph, className, style, }: NodeConfigPanelProps): react.JSX.Element;
124
134
 
125
135
  /**
126
136
  * Clone a set of nodes AND the edges internal to that set, remapping every id.
@@ -353,6 +363,8 @@ type FlowEditorProps = {
353
363
  * editor and composing one by hand.
354
364
  */
355
365
  fieldRenderers?: ComponentProps<typeof NodeConfigPanel>["fieldRenderers"];
366
+ /** Presentation-only config-field filter, forwarded to `NodeConfigPanel`. */
367
+ fieldFilter?: ComponentProps<typeof NodeConfigPanel>["fieldFilter"];
356
368
  /** Show run feed below the canvas. Default true. */
357
369
  showFeed?: boolean;
358
370
  /** Total editor height. Default 720. */
@@ -675,4 +687,4 @@ type ExpressionFieldProps = {
675
687
  */
676
688
  declare function ExpressionField({ value, onChange, placeholder, rows, handle, graph, nodeId, }: ExpressionFieldProps): react.JSX.Element;
677
689
 
678
- export { ActionNode, type AlignEdge, AutoLayoutOptions, ConfigFieldRenderFn, ConnectionValidatorOptions, DecisionNode, ExecutorRegistry, ExpressionField, type ExpressionFieldProps, FlowCanvas, type FlowCanvasProps, FlowEditor, type FlowEditorAction, type FlowEditorApi, type FlowEditorBuiltins, type FlowEditorProps, type FlowEditorSlots, FlowGraph, FlowNode, type FlowNodeRenderProps, FlowRunControls, type FlowRunControlsProps, FlowRunFeed, FlowRunFeedEntry, type FlowRunFeedProps, LaneNode, NodeCategory, NodeConfigPanel, type NodeConfigPanelProps, NodeKindDefinition, NodePalette, type NodePaletteProps, NodePort, type NodePortProps, type NodePortSide, type NodePortType, NodeRunStatus, NodeShell, type NodeShellProps, NoteNode, OutputNode, SubgraphNode, TriggerNode, WorkflowMetadata, WorkflowSchema, alignNodes, cloneSubgraph, defaultNodeTypes, defineNode, distributeNodes, flowKeys, flowLive, paletteDropHandlers, reconnectEdge, useFlowEditor, useFlowEditorOptional };
690
+ export { ActionNode, type AlignEdge, AutoLayoutOptions, ConfigField, ConfigFieldRenderFn, ConnectionValidatorOptions, DecisionNode, ExecutorRegistry, ExpressionField, type ExpressionFieldProps, FlowCanvas, type FlowCanvasProps, FlowEditor, type FlowEditorAction, type FlowEditorApi, type FlowEditorBuiltins, type FlowEditorProps, type FlowEditorSlots, FlowGraph, FlowNode, type FlowNodeRenderProps, FlowRunControls, type FlowRunControlsProps, FlowRunFeed, FlowRunFeedEntry, type FlowRunFeedProps, LaneNode, NodeCategory, NodeConfigPanel, type NodeConfigPanelProps, NodeKindDefinition, NodePalette, type NodePaletteProps, NodePort, type NodePortProps, type NodePortSide, type NodePortType, NodeRunStatus, NodeShell, type NodeShellProps, NoteNode, OutputNode, SubgraphNode, TriggerNode, WorkflowMetadata, WorkflowSchema, alignNodes, cloneSubgraph, defaultNodeTypes, defineNode, distributeNodes, flowKeys, flowLive, paletteDropHandlers, reconnectEdge, useFlowEditor, useFlowEditorOptional };
package/dist/index.js CHANGED
@@ -777,6 +777,7 @@ function NodeConfigPanel({
777
777
  renderCredentialField,
778
778
  renderDocumentField,
779
779
  fieldRenderers,
780
+ fieldFilter,
780
781
  graph,
781
782
  className,
782
783
  style
@@ -822,7 +823,11 @@ function NodeConfigPanel({
822
823
  const setDescription = (description) => onChange({ ...node, data: { ...node.data, description } });
823
824
  const setStatusMsg = (key, value) => onChange({ ...node, data: { ...node.data, [key]: value } });
824
825
  const setConfigValue = (key, value) => onChange({ ...node, data: { ...node.data, config: { ...config, [key]: value } } });
825
- const issues = validateConfig(kind, config);
826
+ const configFields = (kind.configSchema ?? []).filter(
827
+ (field) => fieldFilter ? fieldFilter({ node, kind, field }) : true
828
+ );
829
+ const visibleFieldKeys = new Set(configFields.map((field) => field.key));
830
+ const issues = validateConfig(kind, config).filter((issue) => visibleFieldKeys.has(issue.key));
826
831
  const adapter = getRichInputAdapter();
827
832
  const documentField = renderDocumentField ?? (adapter?.renderEditor ? ({ value, onChange: set }) => adapter.renderEditor({ value, onChange: set }) : void 0);
828
833
  return /* @__PURE__ */ jsxs("aside", { className: ["ff-panel", className ?? ""].filter(Boolean).join(" "), style, children: [
@@ -898,8 +903,8 @@ function NodeConfigPanel({
898
903
  onChange: (next) => onChange({ ...node, data: { ...node.data, config: next } }),
899
904
  nodeId: node.id
900
905
  }) : /* @__PURE__ */ jsxs(Fragment, { children: [
901
- (kind.configSchema ?? []).length > 0 && /* @__PURE__ */ jsx("hr", { className: "ff-panel__divider" }),
902
- (kind.configSchema ?? []).map((field) => /* @__PURE__ */ jsxs("div", { className: "ff-panel__field", children: [
906
+ configFields.length > 0 && /* @__PURE__ */ jsx("hr", { className: "ff-panel__divider" }),
907
+ configFields.map((field) => /* @__PURE__ */ jsxs("div", { className: "ff-panel__field", children: [
903
908
  /* @__PURE__ */ jsxs("label", { className: "ff-panel__label", htmlFor: fieldId(field.key), children: [
904
909
  field.label,
905
910
  field.required && /* @__PURE__ */ jsx("span", { className: "ff-panel__required", "aria-hidden": true, children: " *" })
@@ -1170,6 +1175,7 @@ function FlowEditorInner({
1170
1175
  showPalette = true,
1171
1176
  showPanel = true,
1172
1177
  fieldRenderers,
1178
+ fieldFilter,
1173
1179
  showFeed = true,
1174
1180
  extraToolbar,
1175
1181
  actions = [],
@@ -1738,6 +1744,7 @@ function FlowEditorInner({
1738
1744
  node: api.selected,
1739
1745
  onChange: api.updateNode,
1740
1746
  fieldRenderers,
1747
+ fieldFilter,
1741
1748
  graph: flow,
1742
1749
  onDelete: builtins.delete === false ? void 0 : (n) => api.deleteNodes([n.id])
1743
1750
  }