dishui 0.0.49 → 0.0.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/components/pro/Flow/Flow.js +419 -407
  2. package/dist/components/pro/Flow/Flow.js.map +1 -1
  3. package/dist/components/pro/Flow/archify/build.d.ts +74 -0
  4. package/dist/components/pro/Flow/archify/build.js +103 -0
  5. package/dist/components/pro/Flow/archify/build.js.map +1 -0
  6. package/dist/components/pro/Flow/archify/convert.d.ts +14 -0
  7. package/dist/components/pro/Flow/archify/convert.js +534 -0
  8. package/dist/components/pro/Flow/archify/convert.js.map +1 -0
  9. package/dist/components/pro/Flow/archify/index.d.ts +12 -0
  10. package/dist/components/pro/Flow/archify/palette.d.ts +64 -0
  11. package/dist/components/pro/Flow/archify/palette.js +112 -0
  12. package/dist/components/pro/Flow/archify/palette.js.map +1 -0
  13. package/dist/components/pro/Flow/archify/presets.d.ts +26 -0
  14. package/dist/components/pro/Flow/archify/presets.js +43 -0
  15. package/dist/components/pro/Flow/archify/presets.js.map +1 -0
  16. package/dist/components/pro/Flow/archify/spec.d.ts +283 -0
  17. package/dist/components/pro/Flow/archify/spec.js +10 -0
  18. package/dist/components/pro/Flow/archify/spec.js.map +1 -0
  19. package/dist/components/pro/Flow/constants.js +14 -0
  20. package/dist/components/pro/Flow/constants.js.map +1 -1
  21. package/dist/components/pro/Flow/hooks/useClipboard.d.ts +5 -0
  22. package/dist/components/pro/Flow/hooks/useClipboard.js +129 -73
  23. package/dist/components/pro/Flow/hooks/useClipboard.js.map +1 -1
  24. package/dist/components/pro/Flow/hooks/useFlowImportExport.d.ts +1 -0
  25. package/dist/components/pro/Flow/hooks/useFlowImportExport.js +108 -93
  26. package/dist/components/pro/Flow/hooks/useFlowImportExport.js.map +1 -1
  27. package/dist/components/pro/Flow/hooks/useKeyboardShortcuts.d.ts +1 -0
  28. package/dist/components/pro/Flow/hooks/useKeyboardShortcuts.js +7 -7
  29. package/dist/components/pro/Flow/hooks/useKeyboardShortcuts.js.map +1 -1
  30. package/dist/components/pro/Flow/index.d.ts +2 -0
  31. package/dist/components/pro/Flow/nodes/DataNodeView.d.ts +4 -1
  32. package/dist/components/pro/Flow/nodes/DataNodeView.js +127 -115
  33. package/dist/components/pro/Flow/nodes/DataNodeView.js.map +1 -1
  34. package/dist/components/pro/Flow/nodes/MediaContent.js +72 -67
  35. package/dist/components/pro/Flow/nodes/MediaContent.js.map +1 -1
  36. package/dist/components/pro/Flow/nodes/NodeRenderer.d.ts +5 -0
  37. package/dist/components/pro/Flow/nodes/NodeRenderer.js +216 -115
  38. package/dist/components/pro/Flow/nodes/NodeRenderer.js.map +1 -1
  39. package/dist/components/pro/Flow/panels/FlowToolbar.js +208 -169
  40. package/dist/components/pro/Flow/panels/FlowToolbar.js.map +1 -1
  41. package/dist/components/pro/Flow/panels/InspectorPanel.js +602 -369
  42. package/dist/components/pro/Flow/panels/InspectorPanel.js.map +1 -1
  43. package/dist/components/pro/Flow/panels/ShapePalette.js +50 -39
  44. package/dist/components/pro/Flow/panels/ShapePalette.js.map +1 -1
  45. package/dist/components/pro/Flow/panels/toolbarIcons.d.ts +1 -0
  46. package/dist/components/pro/Flow/panels/toolbarIcons.js +36 -8
  47. package/dist/components/pro/Flow/panels/toolbarIcons.js.map +1 -1
  48. package/dist/components/pro/Flow/types.d.ts +30 -0
  49. package/dist/components/pro/Flow/types.js.map +1 -1
  50. package/dist/dishui.css +1 -1
  51. package/dist/flow.js +73 -56
  52. package/package.json +18 -17
@@ -121,6 +121,14 @@ export type GradientDirection = 'to-r' | 'to-l' | 'to-b' | 'to-t' | 'to-br' | 't
121
121
  /** Group label placement */
122
122
  export type FlowGroupLabelPlacement = 'top' | 'bottom' | 'left' | 'right';
123
123
  export type FlowGroupLabelAlign = 'start' | 'center' | 'end';
124
+ /** Corner placement for a node's tag pill. */
125
+ export type FlowTagPlacement = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
126
+ /**
127
+ * Label placement for ordinary shape nodes: the center plus the eight compass
128
+ * positions around it. Non-center placements sit just outside / against the
129
+ * corresponding edge or corner and can be nudged with `labelOffsetX/Y`.
130
+ */
131
+ export type FlowTextPlacement = 'center' | 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
124
132
  export declare const FLOW_NODE_TYPES: readonly ['shapeRect', 'shapeRoundRect', 'shapeEllipse', 'shapeDiamond', 'shapeDocument', 'shapeParallelogram', 'shapeTriangle', 'shapeTrapezoid', 'shapePentagon', 'shapeHexagon', 'shapeStar', 'shapeHexagram', 'shapeRightTriangle', 'shapeCorner', 'textLabel', 'flowGroup', 'geometryGroup', 'dividerNode', 'arrowNode', 'polylineNode', 'shapeSvg', 'mediaNode', 'animAnchor'];
125
133
  export type FlowShapeType = (typeof FLOW_NODE_TYPES)[number];
126
134
  /** Custom key-value attribute on a node */
@@ -136,11 +144,33 @@ export interface FlowNodeData {
136
144
  strokeWidth: number;
137
145
  color: string;
138
146
  fontSize: number;
147
+ /**
148
+ * Optional secondary line rendered under the bold title, in a muted color.
149
+ * Used by imported Archify diagrams to reproduce the two-line card look
150
+ * (e.g. "API Gateway" / "public :443").
151
+ */
152
+ sublabel?: string;
153
+ /** Muted color for `sublabel`; falls back to a dimmed label color. */
154
+ sublabelColor?: string;
155
+ /**
156
+ * Optional short pill rendered in a corner of the node (e.g. a tag such as
157
+ * "SEV-1/2" or a lifecycle step number). Cosmetic only.
158
+ */
159
+ tag?: string;
160
+ /** Tag pill text/border color. Falls back to the node stroke color. */
161
+ tagColor?: string;
162
+ /** Which corner the tag pill sits in. Defaults to `top-right`. */
163
+ tagPlacement?: FlowTagPlacement;
139
164
  /**
140
165
  * Label/font color. When unset, falls back to `color` (legacy behavior where
141
166
  * a single color drove both the label and the SVG icon tint).
142
167
  */
143
168
  labelColor?: string;
169
+ /**
170
+ * Label placement for ordinary shape nodes (9-way). When unset the label is
171
+ * centered. Fine-tune with `labelOffsetX` / `labelOffsetY`.
172
+ */
173
+ textPlacement?: FlowTextPlacement;
144
174
  borderStyle?: FlowBorderStyle;
145
175
  rotation?: number;
146
176
  flipX?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../src/components/pro/Flow/types.ts"],"sourcesContent":["/** Arrow marker type for edges and lines */\nexport type FlowEdgeMarkerKind = 'none' | 'arrow' | 'arrowclosed';\n\n/** Label placement for SVG icon stamps. */\nexport type FlowIconLabelPlacement = 'top' | 'middle' | 'bottom' | 'left' | 'right';\n\n/** Media stamp kinds rendered via DOM overlay. */\nexport type FlowMediaKind = 'markdown' | 'html' | 'mermaid' | 'math' | 'image' | 'model3d' | 'ai' | 'data';\n\nexport type FlowModelFormat = 'stl' | 'obj' | '3mf';\n\n/** Logical type of a Data-node column, driving parsing/aggregation/axis scales. */\nexport type FlowDataColumnType = 'string' | 'number' | 'date' | 'boolean';\n\n/** A single column definition for a Data node. */\nexport interface FlowDataColumn {\n /** Object key used in each row record. */\n key: string;\n /** Display label; falls back to `key` when unset. */\n label?: string;\n /** Value type; numeric columns can be aggregated and used as chart measures. */\n type: FlowDataColumnType;\n}\n\n/** Which surface the Data node renders: a (pivotable) table or a chart. */\nexport type FlowDataView = 'table' | 'chart';\n\n/** Supported chart renderings for a Data node. */\nexport type FlowDataChartType =\n | 'bar'\n | 'barHorizontal'\n | 'line'\n | 'area'\n | 'scatter'\n | 'pie';\n\n/** Chart-view configuration for a Data node. */\nexport interface FlowDataChartConfig {\n type: FlowDataChartType;\n /** Category / X axis field (dimension). */\n xField?: string;\n /** One or more numeric measure fields drawn as series. */\n yFields?: string[];\n /** Per-series color overrides, keyed by measure field key (cartesian charts). */\n seriesColors?: Record<string, string>;\n /** Slice color palette for pie charts. Defaults to the built-in palette. */\n palette?: string[];\n}\n\n/** Aggregation used by the pivot table view. */\nexport type FlowDataAggFn = 'sum' | 'avg' | 'count' | 'min' | 'max';\n\n/** Pivot configuration panel placement. */\nexport type FlowDataPivotPanelPlacement = 'top' | 'bottom' | 'left' | 'right';\n\n/** Pivot-view configuration for a Data node table. */\nexport interface FlowDataPivotConfig {\n enabled: boolean;\n rowFields: string[];\n colFields: string[];\n values: Array<{ field: string; aggFn: FlowDataAggFn }>;\n /** Where the pivot config panel renders. Defaults to 'top'. */\n panelPlacement?: FlowDataPivotPanelPlacement;\n}\n\n/**\n * Persisted state for a Data node (`mediaKind: 'data'`). Holds the parsed\n * columns/rows plus how they should be visualized. Serialized with the document.\n */\nexport interface FlowDataConfig {\n columns: FlowDataColumn[];\n rows: Array<Record<string, unknown>>;\n /** Active rendering surface. Defaults to 'table'. */\n view: FlowDataView;\n /** Chart configuration (used when `view === 'chart'`). */\n chart?: FlowDataChartConfig;\n /** Pivot configuration (used when `view === 'table'`). */\n pivot?: FlowDataPivotConfig;\n /** Original uploaded file name, when imported. */\n sourceName?: string;\n}\n\n/** AI media node configuration (persisted subset). */\nexport interface FlowAIConfig {\n /** API endpoint (OpenAI-compatible chat completions or Anthropic messages). */\n gateway: string;\n protocol: 'openai' | 'anthropic';\n model: string;\n /** API key. Persisted in the document; treat exported JSON as sensitive. */\n apiKey?: string;\n systemPrompt?: string;\n /** Extra request headers. */\n headers?: Record<string, string>;\n}\n\n/** Line style */\nexport type FlowEdgeLineStyle = 'solid' | 'dashed' | 'dotted' | 'dynamic';\n\n/** Dash density for dashed/dotted lines */\nexport type FlowEdgeDashDensity = 'sparse' | 'medium' | 'dense';\n\n/** Bezier control points for simplebezier edge segments (canvas coordinates) */\nexport interface FlowBezierControl {\n c1x: number;\n c1y: number;\n c2x: number;\n c2y: number;\n}\n\n/** Persisted edge styling on edge.data */\nexport interface FlowEdgeData {\n strokeColor?: string;\n strokeWidth?: number;\n lineStyle?: FlowEdgeLineStyle;\n dashDensity?: FlowEdgeDashDensity;\n markerStart?: FlowEdgeMarkerKind;\n markerEnd?: FlowEdgeMarkerKind;\n labelText?: string;\n labelFontSize?: number;\n labelFontFamily?: string;\n /** Play a source-to-target traveling gradient while in presentation mode. */\n animated?: boolean;\n /** Waypoints; absolute canvas coords unless waypointGroupId set */\n waypoints?: Array<{ x: number; y: number }>;\n waypointGroupId?: string;\n /**\n * Per-segment bezier controls for simplebezier type;\n * null entries use default computed controls.\n */\n bezierControls?: Array<FlowBezierControl | null> | null;\n}\n\n/** Edge type names */\nexport type FlowEdgeTypeName =\n | 'smoothstep'\n | 'step'\n | 'straight'\n | 'simplebezier';\n\n/** Border line style */\nexport type FlowBorderStyle = 'none' | 'solid' | 'dashed' | 'dotted' | 'dynamic';\n\n/** Gradient direction */\nexport type GradientDirection =\n | 'to-r'\n | 'to-l'\n | 'to-b'\n | 'to-t'\n | 'to-br'\n | 'to-tl'\n | 'to-tr'\n | 'to-bl';\n\n/** Group label placement */\nexport type FlowGroupLabelPlacement = 'top' | 'bottom' | 'left' | 'right';\nexport type FlowGroupLabelAlign = 'start' | 'center' | 'end';\n\nexport const FLOW_NODE_TYPES = [\n 'shapeRect',\n 'shapeRoundRect',\n 'shapeEllipse',\n 'shapeDiamond',\n 'shapeDocument',\n 'shapeParallelogram',\n 'shapeTriangle',\n 'shapeTrapezoid',\n 'shapePentagon',\n 'shapeHexagon',\n 'shapeStar',\n 'shapeHexagram',\n 'shapeRightTriangle',\n 'shapeCorner',\n 'textLabel',\n 'flowGroup',\n 'geometryGroup',\n 'dividerNode',\n 'arrowNode',\n 'polylineNode',\n 'shapeSvg',\n 'mediaNode',\n 'animAnchor',\n] as const;\n\nexport type FlowShapeType = (typeof FLOW_NODE_TYPES)[number];\n\n/** Custom key-value attribute on a node */\nexport interface FlowNodeAttribute {\n key: string;\n value: string;\n}\n\n/** Data stored on each flow node */\nexport interface FlowNodeData {\n label: string;\n fill: string;\n stroke: string;\n strokeWidth: number;\n color: string;\n fontSize: number;\n /**\n * Label/font color. When unset, falls back to `color` (legacy behavior where\n * a single color drove both the label and the SVG icon tint).\n */\n labelColor?: string;\n borderStyle?: FlowBorderStyle;\n rotation?: number;\n flipX?: boolean;\n flipY?: boolean;\n fillGradientTo?: string;\n fillGradientDirection?: GradientDirection;\n attributes?: FlowNodeAttribute[];\n childCanvasId?: string;\n isGroup?: boolean;\n groupBorderStyle?: FlowBorderStyle;\n groupLabelPlacement?: FlowGroupLabelPlacement;\n groupLabelAlign?: FlowGroupLabelAlign;\n groupLabelFill?: string;\n groupLabelRotation?: 0 | 90 | 180 | 270;\n groupLabelBgMode?: 'text' | 'full';\n dividerOrientation?: 'horizontal' | 'vertical';\n arrowDouble?: boolean;\n arrowBent?: boolean;\n arrowBendX?: number;\n arrowBendY?: number;\n polylineWaypoints?: Array<{ x: number; y: number }>;\n /** SVG stamp icon id (for type 'shapeSvg'). */\n svgId?: string;\n /** Whether the SVG stamp draws a bordered box around the icon. */\n iconBox?: boolean;\n /** Label placement for SVG stamps. Left/right use top-to-bottom vertical text. */\n labelPlacement?: FlowIconLabelPlacement;\n /** Horizontal offset from the resolved icon label position, in canvas units. */\n labelOffsetX?: number;\n /** Vertical offset from the resolved icon label position, in canvas units. */\n labelOffsetY?: number;\n /** Media node kind (for type 'mediaNode'). */\n mediaKind?: FlowMediaKind;\n /** Source content or URL for the media node. */\n mediaContent?: string;\n /** Explicit model format for 3D media nodes. */\n modelFormat?: FlowModelFormat;\n /** AI media node configuration (serializable subset; secrets are runtime-only). */\n aiConfig?: FlowAIConfig;\n /** Data node configuration (for type 'mediaNode' with mediaKind 'data'). */\n dataConfig?: FlowDataConfig;\n /**\n * Stable creation index for `animAnchor` nodes, used to order slides. The\n * displayed sequence badge is derived from this ordering, so deleting an\n * anchor renumbers the rest automatically.\n */\n animIndex?: number;\n /** Marks nodes managed by Mindmap mode. */\n isMindMapNode?: boolean;\n /** Logical parent used by Mindmap auto-layout (separate from visual groups). */\n mindMapParentId?: string;\n}\n\n/** A flow node */\nexport interface FlowNode {\n id: string;\n type: FlowShapeType;\n position: { x: number; y: number };\n width: number;\n height: number;\n data: FlowNodeData;\n parentId?: string;\n zIndex?: number;\n}\n\n/** A flow edge (connection between nodes) */\nexport interface FlowEdge {\n id: string;\n source: string;\n target: string;\n sourceHandle?: string;\n targetHandle?: string;\n type: FlowEdgeTypeName;\n data: FlowEdgeData;\n}\n\n/** Independent line types */\nexport type FlowLineType = 'freehand' | 'straight' | 'polyline' | 'arrow';\n\n/** An independent line not attached to nodes */\nexport interface FlowLine {\n id: string;\n type: FlowLineType;\n points: Array<{ x: number; y: number }>;\n strokeColor: string;\n strokeWidth: number;\n lineStyle: FlowEdgeLineStyle;\n dashDensity?: FlowEdgeDashDensity;\n markerStart?: FlowEdgeMarkerKind;\n markerEnd?: FlowEdgeMarkerKind;\n closed?: boolean;\n zIndex?: number;\n parentId?: string;\n}\n\n/** Single canvas layer data */\nexport interface FlowCanvasData {\n nodes: FlowNode[];\n edges: FlowEdge[];\n lines: FlowLine[];\n}\n\n/** Multi-canvas document; root canvas id is 'root' */\nexport interface FlowDocument {\n canvases: Record<string, FlowCanvasData>;\n stack: string[];\n /** Project title, shown in the editable title bar and used as export filename. */\n title?: string;\n}\n\n/** Active tool modes */\nexport type FlowToolMode =\n | 'select'\n | 'pan'\n | 'connect'\n | 'freehand'\n | 'line'\n | 'polyline'\n | 'arrow';\n\n/** Viewport transform state */\nexport interface ViewportState {\n x: number;\n y: number;\n zoom: number;\n}\n\n/** Selection state */\nexport interface SelectionState {\n nodeIds: Set<string>;\n edgeIds: Set<string>;\n lineIds: Set<string>;\n}\n\n/** Props for the Flow component */\nexport interface FlowProps {\n /** Initial document; if not provided, starts with empty doc */\n initialDocument?: FlowDocument;\n /** Callback when document changes */\n onChange?: (doc: FlowDocument) => void;\n /** Width of the component (defaults to 100%) */\n width?: number | string;\n /** Height of the component (defaults to 100%) */\n height?: number | string;\n /** Whether the flow is read-only */\n readOnly?: boolean;\n /** Leave the current document from the built-in toolbar. */\n onBack?: () => void;\n /** Export the current canvas as PNG from the built-in toolbar. */\n onExportPNG?: () => void | Promise<void>;\n /** Publish or configure sharing from the built-in toolbar. */\n onPublish?: () => void;\n /** Show minimap */\n showMiniMap?: boolean;\n /** Show grid */\n showGrid?: boolean;\n /** Grid size in pixels */\n gridSize?: number;\n /** CSS class for outer container */\n className?: string;\n /**\n * Show the AI assistant panel (right side) that turns a text description or\n * an uploaded image into a flow document. Defaults to true.\n */\n showAI?: boolean;\n /**\n * Show the AI model configuration form inside the AI panel (gateway /\n * protocol / model / api key). When false, the config is hidden and the\n * caller is expected to supply `aiConfig`. Defaults to true.\n */\n showAIConfig?: boolean;\n /** Initial / preset AI model configuration for the AI panel. */\n aiConfig?: FlowAIConfig;\n}\n"],"mappings":"AA6JA,IAAa,IAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../src/components/pro/Flow/types.ts"],"sourcesContent":["/** Arrow marker type for edges and lines */\nexport type FlowEdgeMarkerKind = 'none' | 'arrow' | 'arrowclosed';\n\n/** Label placement for SVG icon stamps. */\nexport type FlowIconLabelPlacement = 'top' | 'middle' | 'bottom' | 'left' | 'right';\n\n/** Media stamp kinds rendered via DOM overlay. */\nexport type FlowMediaKind = 'markdown' | 'html' | 'mermaid' | 'math' | 'image' | 'model3d' | 'ai' | 'data';\n\nexport type FlowModelFormat = 'stl' | 'obj' | '3mf';\n\n/** Logical type of a Data-node column, driving parsing/aggregation/axis scales. */\nexport type FlowDataColumnType = 'string' | 'number' | 'date' | 'boolean';\n\n/** A single column definition for a Data node. */\nexport interface FlowDataColumn {\n /** Object key used in each row record. */\n key: string;\n /** Display label; falls back to `key` when unset. */\n label?: string;\n /** Value type; numeric columns can be aggregated and used as chart measures. */\n type: FlowDataColumnType;\n}\n\n/** Which surface the Data node renders: a (pivotable) table or a chart. */\nexport type FlowDataView = 'table' | 'chart';\n\n/** Supported chart renderings for a Data node. */\nexport type FlowDataChartType =\n | 'bar'\n | 'barHorizontal'\n | 'line'\n | 'area'\n | 'scatter'\n | 'pie';\n\n/** Chart-view configuration for a Data node. */\nexport interface FlowDataChartConfig {\n type: FlowDataChartType;\n /** Category / X axis field (dimension). */\n xField?: string;\n /** One or more numeric measure fields drawn as series. */\n yFields?: string[];\n /** Per-series color overrides, keyed by measure field key (cartesian charts). */\n seriesColors?: Record<string, string>;\n /** Slice color palette for pie charts. Defaults to the built-in palette. */\n palette?: string[];\n}\n\n/** Aggregation used by the pivot table view. */\nexport type FlowDataAggFn = 'sum' | 'avg' | 'count' | 'min' | 'max';\n\n/** Pivot configuration panel placement. */\nexport type FlowDataPivotPanelPlacement = 'top' | 'bottom' | 'left' | 'right';\n\n/** Pivot-view configuration for a Data node table. */\nexport interface FlowDataPivotConfig {\n enabled: boolean;\n rowFields: string[];\n colFields: string[];\n values: Array<{ field: string; aggFn: FlowDataAggFn }>;\n /** Where the pivot config panel renders. Defaults to 'top'. */\n panelPlacement?: FlowDataPivotPanelPlacement;\n}\n\n/**\n * Persisted state for a Data node (`mediaKind: 'data'`). Holds the parsed\n * columns/rows plus how they should be visualized. Serialized with the document.\n */\nexport interface FlowDataConfig {\n columns: FlowDataColumn[];\n rows: Array<Record<string, unknown>>;\n /** Active rendering surface. Defaults to 'table'. */\n view: FlowDataView;\n /** Chart configuration (used when `view === 'chart'`). */\n chart?: FlowDataChartConfig;\n /** Pivot configuration (used when `view === 'table'`). */\n pivot?: FlowDataPivotConfig;\n /** Original uploaded file name, when imported. */\n sourceName?: string;\n}\n\n/** AI media node configuration (persisted subset). */\nexport interface FlowAIConfig {\n /** API endpoint (OpenAI-compatible chat completions or Anthropic messages). */\n gateway: string;\n protocol: 'openai' | 'anthropic';\n model: string;\n /** API key. Persisted in the document; treat exported JSON as sensitive. */\n apiKey?: string;\n systemPrompt?: string;\n /** Extra request headers. */\n headers?: Record<string, string>;\n}\n\n/** Line style */\nexport type FlowEdgeLineStyle = 'solid' | 'dashed' | 'dotted' | 'dynamic';\n\n/** Dash density for dashed/dotted lines */\nexport type FlowEdgeDashDensity = 'sparse' | 'medium' | 'dense';\n\n/** Bezier control points for simplebezier edge segments (canvas coordinates) */\nexport interface FlowBezierControl {\n c1x: number;\n c1y: number;\n c2x: number;\n c2y: number;\n}\n\n/** Persisted edge styling on edge.data */\nexport interface FlowEdgeData {\n strokeColor?: string;\n strokeWidth?: number;\n lineStyle?: FlowEdgeLineStyle;\n dashDensity?: FlowEdgeDashDensity;\n markerStart?: FlowEdgeMarkerKind;\n markerEnd?: FlowEdgeMarkerKind;\n labelText?: string;\n labelFontSize?: number;\n labelFontFamily?: string;\n /** Play a source-to-target traveling gradient while in presentation mode. */\n animated?: boolean;\n /** Waypoints; absolute canvas coords unless waypointGroupId set */\n waypoints?: Array<{ x: number; y: number }>;\n waypointGroupId?: string;\n /**\n * Per-segment bezier controls for simplebezier type;\n * null entries use default computed controls.\n */\n bezierControls?: Array<FlowBezierControl | null> | null;\n}\n\n/** Edge type names */\nexport type FlowEdgeTypeName =\n | 'smoothstep'\n | 'step'\n | 'straight'\n | 'simplebezier';\n\n/** Border line style */\nexport type FlowBorderStyle = 'none' | 'solid' | 'dashed' | 'dotted' | 'dynamic';\n\n/** Gradient direction */\nexport type GradientDirection =\n | 'to-r'\n | 'to-l'\n | 'to-b'\n | 'to-t'\n | 'to-br'\n | 'to-tl'\n | 'to-tr'\n | 'to-bl';\n\n/** Group label placement */\nexport type FlowGroupLabelPlacement = 'top' | 'bottom' | 'left' | 'right';\nexport type FlowGroupLabelAlign = 'start' | 'center' | 'end';\n\n/** Corner placement for a node's tag pill. */\nexport type FlowTagPlacement = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';\n\n/**\n * Label placement for ordinary shape nodes: the center plus the eight compass\n * positions around it. Non-center placements sit just outside / against the\n * corresponding edge or corner and can be nudged with `labelOffsetX/Y`.\n */\nexport type FlowTextPlacement =\n | 'center'\n | 'top'\n | 'bottom'\n | 'left'\n | 'right'\n | 'top-left'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-right';\n\nexport const FLOW_NODE_TYPES = [\n 'shapeRect',\n 'shapeRoundRect',\n 'shapeEllipse',\n 'shapeDiamond',\n 'shapeDocument',\n 'shapeParallelogram',\n 'shapeTriangle',\n 'shapeTrapezoid',\n 'shapePentagon',\n 'shapeHexagon',\n 'shapeStar',\n 'shapeHexagram',\n 'shapeRightTriangle',\n 'shapeCorner',\n 'textLabel',\n 'flowGroup',\n 'geometryGroup',\n 'dividerNode',\n 'arrowNode',\n 'polylineNode',\n 'shapeSvg',\n 'mediaNode',\n 'animAnchor',\n] as const;\n\nexport type FlowShapeType = (typeof FLOW_NODE_TYPES)[number];\n\n/** Custom key-value attribute on a node */\nexport interface FlowNodeAttribute {\n key: string;\n value: string;\n}\n\n/** Data stored on each flow node */\nexport interface FlowNodeData {\n label: string;\n fill: string;\n stroke: string;\n strokeWidth: number;\n color: string;\n fontSize: number;\n /**\n * Optional secondary line rendered under the bold title, in a muted color.\n * Used by imported Archify diagrams to reproduce the two-line card look\n * (e.g. \"API Gateway\" / \"public :443\").\n */\n sublabel?: string;\n /** Muted color for `sublabel`; falls back to a dimmed label color. */\n sublabelColor?: string;\n /**\n * Optional short pill rendered in a corner of the node (e.g. a tag such as\n * \"SEV-1/2\" or a lifecycle step number). Cosmetic only.\n */\n tag?: string;\n /** Tag pill text/border color. Falls back to the node stroke color. */\n tagColor?: string;\n /** Which corner the tag pill sits in. Defaults to `top-right`. */\n tagPlacement?: FlowTagPlacement;\n /**\n * Label/font color. When unset, falls back to `color` (legacy behavior where\n * a single color drove both the label and the SVG icon tint).\n */\n labelColor?: string;\n /**\n * Label placement for ordinary shape nodes (9-way). When unset the label is\n * centered. Fine-tune with `labelOffsetX` / `labelOffsetY`.\n */\n textPlacement?: FlowTextPlacement;\n borderStyle?: FlowBorderStyle;\n rotation?: number;\n flipX?: boolean;\n flipY?: boolean;\n fillGradientTo?: string;\n fillGradientDirection?: GradientDirection;\n attributes?: FlowNodeAttribute[];\n childCanvasId?: string;\n isGroup?: boolean;\n groupBorderStyle?: FlowBorderStyle;\n groupLabelPlacement?: FlowGroupLabelPlacement;\n groupLabelAlign?: FlowGroupLabelAlign;\n groupLabelFill?: string;\n groupLabelRotation?: 0 | 90 | 180 | 270;\n groupLabelBgMode?: 'text' | 'full';\n dividerOrientation?: 'horizontal' | 'vertical';\n arrowDouble?: boolean;\n arrowBent?: boolean;\n arrowBendX?: number;\n arrowBendY?: number;\n polylineWaypoints?: Array<{ x: number; y: number }>;\n /** SVG stamp icon id (for type 'shapeSvg'). */\n svgId?: string;\n /** Whether the SVG stamp draws a bordered box around the icon. */\n iconBox?: boolean;\n /** Label placement for SVG stamps. Left/right use top-to-bottom vertical text. */\n labelPlacement?: FlowIconLabelPlacement;\n /** Horizontal offset from the resolved icon label position, in canvas units. */\n labelOffsetX?: number;\n /** Vertical offset from the resolved icon label position, in canvas units. */\n labelOffsetY?: number;\n /** Media node kind (for type 'mediaNode'). */\n mediaKind?: FlowMediaKind;\n /** Source content or URL for the media node. */\n mediaContent?: string;\n /** Explicit model format for 3D media nodes. */\n modelFormat?: FlowModelFormat;\n /** AI media node configuration (serializable subset; secrets are runtime-only). */\n aiConfig?: FlowAIConfig;\n /** Data node configuration (for type 'mediaNode' with mediaKind 'data'). */\n dataConfig?: FlowDataConfig;\n /**\n * Stable creation index for `animAnchor` nodes, used to order slides. The\n * displayed sequence badge is derived from this ordering, so deleting an\n * anchor renumbers the rest automatically.\n */\n animIndex?: number;\n /** Marks nodes managed by Mindmap mode. */\n isMindMapNode?: boolean;\n /** Logical parent used by Mindmap auto-layout (separate from visual groups). */\n mindMapParentId?: string;\n}\n\n/** A flow node */\nexport interface FlowNode {\n id: string;\n type: FlowShapeType;\n position: { x: number; y: number };\n width: number;\n height: number;\n data: FlowNodeData;\n parentId?: string;\n zIndex?: number;\n}\n\n/** A flow edge (connection between nodes) */\nexport interface FlowEdge {\n id: string;\n source: string;\n target: string;\n sourceHandle?: string;\n targetHandle?: string;\n type: FlowEdgeTypeName;\n data: FlowEdgeData;\n}\n\n/** Independent line types */\nexport type FlowLineType = 'freehand' | 'straight' | 'polyline' | 'arrow';\n\n/** An independent line not attached to nodes */\nexport interface FlowLine {\n id: string;\n type: FlowLineType;\n points: Array<{ x: number; y: number }>;\n strokeColor: string;\n strokeWidth: number;\n lineStyle: FlowEdgeLineStyle;\n dashDensity?: FlowEdgeDashDensity;\n markerStart?: FlowEdgeMarkerKind;\n markerEnd?: FlowEdgeMarkerKind;\n closed?: boolean;\n zIndex?: number;\n parentId?: string;\n}\n\n/** Single canvas layer data */\nexport interface FlowCanvasData {\n nodes: FlowNode[];\n edges: FlowEdge[];\n lines: FlowLine[];\n}\n\n/** Multi-canvas document; root canvas id is 'root' */\nexport interface FlowDocument {\n canvases: Record<string, FlowCanvasData>;\n stack: string[];\n /** Project title, shown in the editable title bar and used as export filename. */\n title?: string;\n}\n\n/** Active tool modes */\nexport type FlowToolMode =\n | 'select'\n | 'pan'\n | 'connect'\n | 'freehand'\n | 'line'\n | 'polyline'\n | 'arrow';\n\n/** Viewport transform state */\nexport interface ViewportState {\n x: number;\n y: number;\n zoom: number;\n}\n\n/** Selection state */\nexport interface SelectionState {\n nodeIds: Set<string>;\n edgeIds: Set<string>;\n lineIds: Set<string>;\n}\n\n/** Props for the Flow component */\nexport interface FlowProps {\n /** Initial document; if not provided, starts with empty doc */\n initialDocument?: FlowDocument;\n /** Callback when document changes */\n onChange?: (doc: FlowDocument) => void;\n /** Width of the component (defaults to 100%) */\n width?: number | string;\n /** Height of the component (defaults to 100%) */\n height?: number | string;\n /** Whether the flow is read-only */\n readOnly?: boolean;\n /** Leave the current document from the built-in toolbar. */\n onBack?: () => void;\n /** Export the current canvas as PNG from the built-in toolbar. */\n onExportPNG?: () => void | Promise<void>;\n /** Publish or configure sharing from the built-in toolbar. */\n onPublish?: () => void;\n /** Show minimap */\n showMiniMap?: boolean;\n /** Show grid */\n showGrid?: boolean;\n /** Grid size in pixels */\n gridSize?: number;\n /** CSS class for outer container */\n className?: string;\n /**\n * Show the AI assistant panel (right side) that turns a text description or\n * an uploaded image into a flow document. Defaults to true.\n */\n showAI?: boolean;\n /**\n * Show the AI model configuration form inside the AI panel (gateway /\n * protocol / model / api key). When false, the config is hidden and the\n * caller is expected to supply `aiConfig`. Defaults to true.\n */\n showAIConfig?: boolean;\n /** Initial / preset AI model configuration for the AI panel. */\n aiConfig?: FlowAIConfig;\n}\n"],"mappings":"AAgLA,IAAa,IAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF"}