pict-section-flow 0.0.17 → 0.0.19

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 (90) hide show
  1. package/README.md +18 -18
  2. package/docs/Architecture.md +1 -1
  3. package/docs/Data_Model.md +2 -2
  4. package/docs/Getting_Started.md +5 -5
  5. package/docs/Implementation_Reference.md +6 -6
  6. package/docs/Layout_Persistence.md +3 -3
  7. package/docs/README.md +12 -12
  8. package/docs/Theme_Integration.md +150 -0
  9. package/docs/_cover.md +1 -1
  10. package/docs/_sidebar.md +7 -6
  11. package/docs/_version.json +7 -0
  12. package/docs/api/PictFlowCard.md +6 -6
  13. package/docs/api/PictFlowCardPropertiesPanel.md +2 -2
  14. package/docs/api/addConnection.md +4 -4
  15. package/docs/api/addNode.md +6 -6
  16. package/docs/api/autoLayout.md +2 -2
  17. package/docs/api/getFlowData.md +5 -5
  18. package/docs/api/marshalToView.md +3 -3
  19. package/docs/api/openPanel.md +2 -2
  20. package/docs/api/registerHandler.md +3 -3
  21. package/docs/api/registerNodeType.md +3 -3
  22. package/docs/api/removeConnection.md +5 -5
  23. package/docs/api/removeNode.md +6 -6
  24. package/docs/api/saveLayout.md +2 -2
  25. package/docs/api/screenToSVGCoords.md +2 -2
  26. package/docs/api/selectNode.md +3 -3
  27. package/docs/api/setTheme.md +2 -2
  28. package/docs/api/setZoom.md +3 -3
  29. package/docs/api/toggleFullscreen.md +2 -2
  30. package/docs/card-help/EACH.md +3 -3
  31. package/docs/card-help/FREAD.md +5 -5
  32. package/docs/card-help/FWRITE.md +5 -5
  33. package/docs/card-help/GET.md +2 -2
  34. package/docs/card-help/ITE.md +3 -3
  35. package/docs/card-help/LOG.md +4 -4
  36. package/docs/card-help/NOTE.md +1 -1
  37. package/docs/card-help/PREV.md +2 -2
  38. package/docs/card-help/SET.md +5 -5
  39. package/docs/card-help/SPKL.md +2 -2
  40. package/docs/card-help/STAT.md +3 -3
  41. package/docs/card-help/SW.md +4 -4
  42. package/docs/css/docuserve.css +277 -23
  43. package/docs/index.html +2 -2
  44. package/docs/retold-catalog.json +1 -1
  45. package/docs/retold-keyword-index.json +1 -1
  46. package/example_applications/simple_cards/css/flowexample.css +2 -2
  47. package/example_applications/simple_cards/source/card-help-content.js +12 -12
  48. package/example_applications/simple_cards/source/cards/FlowCard-DataPreview.js +1 -1
  49. package/example_applications/simple_cards/source/sample-flows.js +410 -0
  50. package/example_applications/simple_cards/source/views/PictView-FlowExample-About.js +5 -5
  51. package/example_applications/simple_cards/source/views/PictView-FlowExample-Documentation.js +5 -5
  52. package/example_applications/simple_cards/source/views/PictView-FlowExample-FileWriteInfo.js +4 -4
  53. package/example_applications/simple_cards/source/views/PictView-FlowExample-MainWorkspace.js +141 -8
  54. package/example_applications/simple_cards/source/views/PictView-FlowExample-TopBar.js +2 -2
  55. package/package.json +8 -7
  56. package/source/Pict-Section-Flow.js +26 -0
  57. package/source/providers/PictProvider-Flow-CSS.js +435 -61
  58. package/source/providers/PictProvider-Flow-ConnectorShapes.js +9 -5
  59. package/source/providers/PictProvider-Flow-NodeTypes.js +10 -0
  60. package/source/providers/PictProvider-Flow-PanelChrome.js +7 -17
  61. package/source/providers/PictProvider-Flow-Theme.js +7 -7
  62. package/source/providers/edges/Edge-Bezier.js +41 -0
  63. package/source/providers/edges/Edge-Orthogonal.js +37 -0
  64. package/source/providers/edges/Edge-OrthogonalSnap.js +72 -0
  65. package/source/providers/edges/Edge-Perimeter-Linear.js +31 -0
  66. package/source/providers/edges/Edge-Perimeter-Orthogonal.js +39 -0
  67. package/source/providers/edges/Edge-Perimeter.js +48 -0
  68. package/source/providers/edges/Edge-PerimeterMath.js +92 -0
  69. package/source/providers/edges/Edge-Straight.js +24 -0
  70. package/source/providers/layouts/Layout-Circular.js +203 -0
  71. package/source/providers/layouts/Layout-Coerce.js +40 -0
  72. package/source/providers/layouts/Layout-Columnar.js +134 -0
  73. package/source/providers/layouts/Layout-Custom.js +27 -0
  74. package/source/providers/layouts/Layout-ForcedFromCenter.js +256 -0
  75. package/source/providers/layouts/Layout-Grid.js +134 -0
  76. package/source/providers/layouts/Layout-Layered.js +209 -0
  77. package/source/providers/layouts/Layout-Tabular.js +94 -0
  78. package/source/services/PictService-Flow-ConnectionRenderer.js +532 -28
  79. package/source/services/PictService-Flow-DataManager.js +12 -1
  80. package/source/services/PictService-Flow-InteractionManager.js +39 -42
  81. package/source/services/PictService-Flow-Layout.js +305 -121
  82. package/source/services/PictService-Flow-PortRenderer.js +108 -26
  83. package/source/services/PictService-Flow-RenderManager.js +41 -11
  84. package/source/views/PictView-Flow-FloatingToolbar.js +69 -61
  85. package/source/views/PictView-Flow-Node.js +47 -6
  86. package/source/views/PictView-Flow-PropertiesPanel.js +46 -53
  87. package/source/views/PictView-Flow-Toolbar.js +1065 -485
  88. package/source/views/PictView-Flow.js +455 -7
  89. package/test/Layout_tests.js +1400 -0
  90. package/test/PortRenderer_tests.js +11 -2
package/README.md CHANGED
@@ -5,17 +5,17 @@
5
5
 
6
6
  An interactive flow diagram section view for the Pict application framework. Build node-based visual editors, workflow designers, and data pipeline tools with a declarative, configuration-driven API.
7
7
 
8
- Pict-Section-Flow provides a complete graph editing experience nodes, ports, connections, properties panels, theming, and layout persistence all composable through the Fable service provider pattern.
8
+ Pict-Section-Flow provides a complete graph editing experience -- nodes, ports, connections, properties panels, theming, and layout persistence -- all composable through the Fable service provider pattern.
9
9
 
10
10
  ## Features
11
11
 
12
- - **Node-Based Graph Editor** Drag-and-drop nodes with typed input/output ports and bezier or orthogonal connections
13
- - **Custom Card Types** Define reusable node types with the `PictFlowCard` base class; register categories, icons, port constraints, and body content
14
- - **Properties Panels** On-graph panels with four built-in types: Template, Markdown, Form, and View
15
- - **Theming** Six built-in themes plus a CSS custom properties API with 70+ design tokens
16
- - **Layout Persistence** Save and restore spatial arrangements to localStorage or any backend
17
- - **Event System** Hook into 20+ lifecycle events for custom behavior without modifying core code
18
- - **Viewport Controls** Pan, zoom, fullscreen, grid snap, zoom-to-fit, and auto-layout
12
+ - **Node-Based Graph Editor** -- Drag-and-drop nodes with typed input/output ports and bezier or orthogonal connections
13
+ - **Custom Card Types** -- Define reusable node types with the `PictFlowCard` base class; register categories, icons, port constraints, and body content
14
+ - **Properties Panels** -- On-graph panels with four built-in types: Template, Markdown, Form, and View
15
+ - **Theming** -- Six built-in themes plus a CSS custom properties API with 70+ design tokens
16
+ - **Layout Persistence** -- Save and restore spatial arrangements to localStorage or any backend
17
+ - **Event System** -- Hook into 20+ lifecycle events for custom behavior without modifying core code
18
+ - **Viewport Controls** -- Pan, zoom, fullscreen, grid snap, zoom-to-fit, and auto-layout
19
19
 
20
20
  ## Installation
21
21
 
@@ -128,11 +128,11 @@ The `|| false` fallback ensures the build never fails if a markdown file is miss
128
128
 
129
129
  Full documentation is available at [https://stevenvelozo.github.io/pict-section-flow/](https://stevenvelozo.github.io/pict-section-flow/)
130
130
 
131
- - [Getting Started](https://stevenvelozo.github.io/pict-section-flow/#/Getting_Started) First flow diagram in five minutes
132
- - [Architecture](https://stevenvelozo.github.io/pict-section-flow/#/Architecture) Service/provider design and data flow
133
- - [Implementation Reference](https://stevenvelozo.github.io/pict-section-flow/#/Implementation_Reference) Complete API surface
134
- - [Custom Styling](https://stevenvelozo.github.io/pict-section-flow/#/Custom-Styling) CSS custom properties and theme API
135
- - [Layout Persistence](https://stevenvelozo.github.io/pict-section-flow/#/Layout_Persistence) Save/restore with localStorage or REST
131
+ - [Getting Started](https://stevenvelozo.github.io/pict-section-flow/#/Getting_Started) -- First flow diagram in five minutes
132
+ - [Architecture](https://stevenvelozo.github.io/pict-section-flow/#/Architecture) -- Service/provider design and data flow
133
+ - [Implementation Reference](https://stevenvelozo.github.io/pict-section-flow/#/Implementation_Reference) -- Complete API surface
134
+ - [Custom Styling](https://stevenvelozo.github.io/pict-section-flow/#/Custom-Styling) -- CSS custom properties and theme API
135
+ - [Layout Persistence](https://stevenvelozo.github.io/pict-section-flow/#/Layout_Persistence) -- Save/restore with localStorage or REST
136
136
 
137
137
  ## API Reference (Function Docs)
138
138
 
@@ -161,11 +161,11 @@ Detailed per-function documentation with code snippets:
161
161
 
162
162
  ## Related Packages
163
163
 
164
- - [pict](https://github.com/stevenvelozo/pict) MVC application framework
165
- - [pict-view](https://github.com/stevenvelozo/pict-view) View base class
166
- - [pict-provider](https://github.com/stevenvelozo/pict-provider) Provider base class
167
- - [pict-section-form](https://github.com/stevenvelozo/pict-section-form) Form sections (used for Form panels)
168
- - [fable](https://github.com/stevenvelozo/fable) Service infrastructure
164
+ - [pict](https://github.com/stevenvelozo/pict) -- MVC application framework
165
+ - [pict-view](https://github.com/stevenvelozo/pict-view) -- View base class
166
+ - [pict-provider](https://github.com/stevenvelozo/pict-provider) -- Provider base class
167
+ - [pict-section-form](https://github.com/stevenvelozo/pict-section-form) -- Form sections (used for Form panels)
168
+ - [fable](https://github.com/stevenvelozo/fable) -- Service infrastructure
169
169
 
170
170
  ## License
171
171
 
@@ -1,6 +1,6 @@
1
1
  # Architecture
2
2
 
3
- Pict-Section-Flow follows the standard Pict layered architecture Views for rendering, Services for business logic, and Providers for configuration and stateless utilities. All components register with a Fable instance through the service provider pattern.
3
+ Pict-Section-Flow follows the standard Pict layered architecture -- Views for rendering, Services for business logic, and Providers for configuration and stateless utilities. All components register with a Fable instance through the service provider pattern.
4
4
 
5
5
  ## High-Level Design
6
6
 
@@ -106,8 +106,8 @@ A connection links an output port on one node to an input port on another.
106
106
 
107
107
  Connections support two path modes:
108
108
 
109
- - **Bezier** (default) Smooth curves with one or more control handles. Right-click a connection to add a handle; drag handles to reshape the curve.
110
- - **Orthogonal** Right-angle paths with two corner points. Double-click a connection handle to toggle between bezier and orthogonal modes.
109
+ - **Bezier** (default) -- Smooth curves with one or more control handles. Right-click a connection to add a handle; drag handles to reshape the curve.
110
+ - **Orthogonal** -- Right-angle paths with two corner points. Double-click a connection handle to toggle between bezier and orthogonal modes.
111
111
 
112
112
  ## Panel
113
113
 
@@ -1,6 +1,6 @@
1
1
  # Getting Started
2
2
 
3
- This guide walks you through creating a flow diagram from scratch installing the package, registering a view, adding nodes and connections, and wiring up custom card types.
3
+ This guide walks you through creating a flow diagram from scratch -- installing the package, registering a view, adding nodes and connections, and wiring up custom card types.
4
4
 
5
5
  ## Prerequisites
6
6
 
@@ -231,7 +231,7 @@ This produces a browser bundle in `dist/` that includes pict-section-flow and al
231
231
 
232
232
  ## Next Steps
233
233
 
234
- - **[Architecture](Architecture.md)** Understand the service/provider design
235
- - **[Implementation Reference](Implementation_Reference.md)** Full API for every method
236
- - **[Custom Styling](Custom-Styling.md)** CSS variables and theme configuration
237
- - **[Layout Persistence](Layout_Persistence.md)** Save layouts to localStorage or a REST API
234
+ - **[Architecture](Architecture.md)** -- Understand the service/provider design
235
+ - **[Implementation Reference](Implementation_Reference.md)** -- Full API for every method
236
+ - **[Custom Styling](Custom-Styling.md)** -- CSS variables and theme configuration
237
+ - **[Layout Persistence](Layout_Persistence.md)** -- Save layouts to localStorage or a REST API
@@ -2,7 +2,7 @@
2
2
 
3
3
  Complete API reference for Pict-Section-Flow. This document covers every public method on the main `PictViewFlow` class and the key internal services and providers developers interact with.
4
4
 
5
- ## PictViewFlow Main View API
5
+ ## PictViewFlow -- Main View API
6
6
 
7
7
  The primary class exported by `pict-section-flow`. Extends `pict-view`.
8
8
 
@@ -84,7 +84,7 @@ Delete a node and all its connections.
84
84
  |-----------|------|-------------|
85
85
  | `pNodeHash` | string | Hash of the node to remove |
86
86
 
87
- **Returns:** `boolean` `true` if the node was found and removed.
87
+ **Returns:** `boolean` -- `true` if the node was found and removed.
88
88
 
89
89
  ### addConnection(pSourceNode, pSourcePort, pTargetNode, pTargetPort, pData)
90
90
 
@@ -108,7 +108,7 @@ Delete a connection.
108
108
  |-----------|------|-------------|
109
109
  | `pConnectionHash` | string | Hash of the connection to remove |
110
110
 
111
- **Returns:** `boolean` `true` if the connection was found and removed.
111
+ **Returns:** `boolean` -- `true` if the connection was found and removed.
112
112
 
113
113
  ### getFlowData()
114
114
 
@@ -168,7 +168,7 @@ Clear all selections (node, connection, and tether).
168
168
 
169
169
  Delete the currently selected node or connection.
170
170
 
171
- **Returns:** `boolean` `true` if something was deleted.
171
+ **Returns:** `boolean` -- `true` if something was deleted.
172
172
 
173
173
  ---
174
174
 
@@ -196,7 +196,7 @@ Apply the current pan/zoom state to the SVG viewport group. Called automatically
196
196
 
197
197
  Toggle fullscreen overlay mode.
198
198
 
199
- **Returns:** `boolean` the new fullscreen state.
199
+ **Returns:** `boolean` -- the new fullscreen state.
200
200
 
201
201
  ### exitFullscreen()
202
202
 
@@ -466,7 +466,7 @@ Register a named theme.
466
466
 
467
467
  Activate a registered theme and re-render.
468
468
 
469
- **Returns:** `boolean` `true` if the theme was found and activated.
469
+ **Returns:** `boolean` -- `true` if the theme was found and activated.
470
470
 
471
471
  ### getActiveTheme()
472
472
 
@@ -4,7 +4,7 @@ Pict-Section-Flow can save and restore spatial arrangements of nodes and panels
4
4
 
5
5
  ## How It Works
6
6
 
7
- A **layout** captures the position, size, and viewport state of a flow diagram at a point in time. It does not store the flow's logical content (nodes, connections, data) only where things are on screen.
7
+ A **layout** captures the position, size, and viewport state of a flow diagram at a point in time. It does not store the flow's logical content (nodes, connections, data) -- only where things are on screen.
8
8
 
9
9
  Each saved layout contains:
10
10
 
@@ -79,8 +79,8 @@ layoutProvider.loadPersistedLayouts();
79
79
 
80
80
  ## Configuration Options
81
81
 
82
- - **`StorageKey`** (string) Override the localStorage key. Passed via options when instantiating the provider.
83
- - **`StorageKey: false`** Disable localStorage persistence entirely (useful when using only a remote backend).
82
+ - **`StorageKey`** (string) -- Override the localStorage key. Passed via options when instantiating the provider.
83
+ - **`StorageKey: false`** -- Disable localStorage persistence entirely (useful when using only a remote backend).
84
84
 
85
85
  ## Events
86
86
 
package/docs/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  An interactive flow diagram section view for the [Pict](https://github.com/stevenvelozo/pict) application framework. Build node-based visual editors, workflow designers, and data pipeline tools with a declarative, configuration-driven API.
4
4
 
5
- Pict-Section-Flow provides a complete graph editing experience nodes, ports, connections, properties panels, theming, and layout persistence all composable through the Fable service provider pattern.
5
+ Pict-Section-Flow provides a complete graph editing experience -- nodes, ports, connections, properties panels, theming, and layout persistence -- all composable through the Fable service provider pattern.
6
6
 
7
7
  ## What It Does
8
8
 
@@ -70,7 +70,7 @@ Developers define reusable node types by extending `PictFlowCard`. Each card dec
70
70
 
71
71
  ### Properties Panels
72
72
 
73
- Nodes can open floating panels tethered to them by a line. Four built-in panel types cover common needs Template, Markdown, Form, and View or you can create custom panel types by extending `PictFlowCardPropertiesPanel`.
73
+ Nodes can open floating panels tethered to them by a line. Four built-in panel types cover common needs -- Template, Markdown, Form, and View -- or you can create custom panel types by extending `PictFlowCardPropertiesPanel`.
74
74
 
75
75
  ### Theming
76
76
 
@@ -112,21 +112,21 @@ tmpFlow._EventHandlerProvider.registerHandler('onFlowChanged',
112
112
 
113
113
  ## Learn More
114
114
 
115
- - **[Getting Started](Getting_Started.md)** Build your first flow diagram in five minutes
116
- - **[Architecture](Architecture.md)** Detailed service/provider design with data flow diagrams
117
- - **[Implementation Reference](Implementation_Reference.md)** Complete API surface for every service and provider
118
- - **[Custom Styling](Custom-Styling.md)** CSS custom properties reference and theme API
119
- - **[Layout Persistence](Layout_Persistence.md)** Save and restore layouts with localStorage or REST
115
+ - **[Getting Started](Getting_Started.md)** -- Build your first flow diagram in five minutes
116
+ - **[Architecture](Architecture.md)** -- Detailed service/provider design with data flow diagrams
117
+ - **[Implementation Reference](Implementation_Reference.md)** -- Complete API surface for every service and provider
118
+ - **[Custom Styling](Custom-Styling.md)** -- CSS custom properties reference and theme API
119
+ - **[Layout Persistence](Layout_Persistence.md)** -- Save and restore layouts with localStorage or REST
120
120
 
121
121
  ## Ecosystem
122
122
 
123
123
  Pict-Section-Flow is part of the [Retold](https://github.com/stevenvelozo/retold) module suite:
124
124
 
125
- - [pict](https://github.com/stevenvelozo/pict) Core MVC application framework
126
- - [pict-view](https://github.com/stevenvelozo/pict-view) View base class
127
- - [pict-provider](https://github.com/stevenvelozo/pict-provider) Provider base class
128
- - [pict-section-form](https://github.com/stevenvelozo/pict-section-form) Form sections (used for Form panel type)
129
- - [fable](https://github.com/stevenvelozo/fable) Service infrastructure and dependency injection
125
+ - [pict](https://github.com/stevenvelozo/pict) -- Core MVC application framework
126
+ - [pict-view](https://github.com/stevenvelozo/pict-view) -- View base class
127
+ - [pict-provider](https://github.com/stevenvelozo/pict-provider) -- Provider base class
128
+ - [pict-section-form](https://github.com/stevenvelozo/pict-section-form) -- Form sections (used for Form panel type)
129
+ - [fable](https://github.com/stevenvelozo/fable) -- Service infrastructure and dependency injection
130
130
 
131
131
  ## License
132
132
 
@@ -0,0 +1,150 @@
1
+ # Theme integration
2
+
3
+ `pict-section-flow` participates in the host application's theme system in two layers:
4
+
5
+ 1. **Host theme (light/dark/palette)** — provided by `pict-provider-theme` via `--theme-color-*` CSS custom properties on `:root` and a `theme-light` / `theme-dark` class on `<html>`.
6
+ 2. **Flow visual theme (sketch, blueprint, mono, retro-80s, retro-90s, whiteboard, default)** — provided by the editor's own `PictProvider-Flow-Theme` and applied as scope-local overrides on `.pict-flow-container`.
7
+
8
+ Both layers cooperate. The flow editor's `--pf-*` tokens default to the matching `--theme-color-*` token, so when the host swaps light/dark or palette, all neutral flow chrome (panels, toolbars, text, connections, grid) updates with no JS work. Visual themes that intentionally diverge from the host palette (e.g. blueprint's deep blue canvas, retro-80s neon) override the relevant `--pf-*` tokens explicitly.
9
+
10
+ ## Host wiring
11
+
12
+ When a host application registers `pict-provider-theme`:
13
+
14
+ ```javascript
15
+ const libPictProviderTheme = require('pict-provider-theme');
16
+ pict.addProvider('Theme', libPictProviderTheme.default_configuration, libPictProviderTheme);
17
+ pict.providers.Theme.registerTheme(require('pict-provider-theme/source/themes/retold-default.json'));
18
+ pict.providers.Theme.applyTheme('retold-default', 'system');
19
+ ```
20
+
21
+ …the flow editor automatically detects it during `onBeforeInitialize` (duck-typed via `applyTheme`/`onApply`/`listThemes`) and subscribes to its `onApply` hook. On every host theme change the editor:
22
+
23
+ - Re-runs `_CSSProvider.registerCSS()` so CSS layered on top by the active flow visual theme stays in the cascade.
24
+ - Calls `_reinjectMarkerDefs()` so SVG `<marker>` arrowhead polygons rebuild with the new fills.
25
+ - Calls `renderFlow()` to repaint nodes/connections (so any inline-rendered colors refresh).
26
+
27
+ No code changes are required in host apps beyond installing and applying `pict-provider-theme` as you would for any other consumer.
28
+
29
+ ## Token mapping
30
+
31
+ | Flow token (`--pf-…`) | Host token (`--theme-color-…`) | Hardcoded fallback |
32
+ |---|---|---|
33
+ | `--pf-text-primary` | `text-primary` | `#2c3e50` |
34
+ | `--pf-text-secondary` | `text-secondary` | `#7f8c8d` |
35
+ | `--pf-text-tertiary` | `text-muted` | `#8e99a4` |
36
+ | `--pf-node-body-fill` | `background-panel` | `#ffffff` |
37
+ | `--pf-node-body-stroke` | `border-default` | `#d0d4d8` |
38
+ | `--pf-node-body-stroke-hover` | `border-strong` | `#b0b8c0` |
39
+ | `--pf-node-selected-stroke` | `brand-primary` | `#3498db` |
40
+ | `--pf-node-shadow` (and hover/dragging) | `shadow-color` | `rgba(0,0,0,0.10)` |
41
+ | `--pf-port-input-fill` | `status-info` | `#3498db` |
42
+ | `--pf-port-output-fill` | `status-success` | `#2ecc71` |
43
+ | `--pf-port-error-fill` | `status-error` | `#e74c3c` |
44
+ | `--pf-connection-stroke` | `border-strong` | `#95a5a6` |
45
+ | `--pf-connection-selected-stroke` | `brand-primary` | `#3498db` |
46
+ | `--pf-panel-bg` | `background-panel` | `#ffffff` |
47
+ | `--pf-panel-titlebar-bg` | `background-secondary` | `#f7f8fa` |
48
+ | `--pf-toolbar-bg` | `background-panel` | `#ffffff` |
49
+ | `--pf-toolbar-border` | `border-default` | `#e0e0e0` |
50
+ | `--pf-canvas-bg` | `background-secondary` | `#fafafa` |
51
+ | `--pf-grid-stroke` | `border-light` | `#e8e8e8` |
52
+ | `--pf-input-border` | `border-default` | `#d5d8dc` |
53
+ | `--pf-input-border-focus` | `focus-outline` | `#3498db` |
54
+
55
+ Tokens not in this list (e.g. node-variant fills, Chart.js-style category colors) keep hardcoded values because they aren't conventionally part of host palettes.
56
+
57
+ ## Card color roles
58
+
59
+ Card types and individual nodes can opt into a **color role** that tracks the host theme automatically. Roles are class-driven, so changing the host theme repaints every card using that role with no JS work.
60
+
61
+ ### Available roles
62
+
63
+ | Role | Tracks | Typical use |
64
+ |---|---|---|
65
+ | `success` | `--theme-color-status-success` | Start, success, complete |
66
+ | `warning` | `--theme-color-status-warning` | Decision, caution, conditional |
67
+ | `error` | `--theme-color-status-error` | Halt, error, abort |
68
+ | `info` | `--theme-color-status-info` | Informational, log, debug |
69
+ | `accent` | `--theme-color-brand-accent` | End, brand-flavored highlights |
70
+ | `neutral` | `--theme-color-text-primary` + `--theme-color-background-panel` | Default, generic |
71
+
72
+ Each role exposes `--pf-color-<role>` (the strong/title-bar color) and `--pf-color-<role>-soft` (a tinted body fill computed via `color-mix(...)` against the strong color). Hosts can override either token at any scope to retint a role globally.
73
+
74
+ ### Built-in node types
75
+
76
+ The five default node types ship with roles wired up:
77
+
78
+ | Type | Role |
79
+ |---|---|
80
+ | `default` | `neutral` |
81
+ | `start` | `success` |
82
+ | `end` | `accent` |
83
+ | `halt` | `error` |
84
+ | `decision` | `warning` |
85
+
86
+ Their hex `TitleBarColor` / `BodyStyle` fields remain as fallbacks for code paths that bypass CSS (legacy consumers, exports). When the role's CSS class is in effect, those hex presentation attributes are overridden by the role rules — host themes propagate, but the hex values keep the editor presentable in unstyled contexts.
87
+
88
+ ### Custom card types
89
+
90
+ ```javascript
91
+ flowView._NodeTypeProvider.registerNodeType('my-card-type', {
92
+ Hash: 'my-card-type',
93
+ Label: 'My Card',
94
+ DefaultPorts: [ /* … */ ],
95
+ ColorRole: 'info', // theme-aware
96
+ TitleBarColor: '#3498db', // optional fallback
97
+ BodyStyle: { fill: '#ebf5fb' } // optional fallback
98
+ });
99
+ ```
100
+
101
+ The renderer adds `pict-flow-node-color-info` to the node group; CSS handles the rest.
102
+
103
+ ### Per-node overrides
104
+
105
+ A specific card can override the role its type defines:
106
+
107
+ ```javascript
108
+ flowData.Nodes.push({
109
+ Hash: 'node-special',
110
+ Type: 'my-card-type',
111
+ ColorRole: 'warning', // override the type's role
112
+ // …
113
+ });
114
+ ```
115
+
116
+ Set `ColorRole: 'none'` on a specific node to opt out of role styling entirely (useful when keeping a custom hex via `Style.BodyFill` etc.).
117
+
118
+ ### Custom roles
119
+
120
+ To define new roles, add `--pf-color-<role>` / `--pf-color-<role>-soft` tokens at `.pict-flow-container` scope and matching `.pict-flow-node-color-<role>` CSS rules in your host stylesheet:
121
+
122
+ ```css
123
+ .pict-flow-container {
124
+ --pf-color-experimental: var(--theme-color-brand-primary, #6b8eff);
125
+ --pf-color-experimental-soft: color-mix(in srgb, var(--pf-color-experimental) 14%, transparent);
126
+ }
127
+ .pict-flow-node-color-experimental .pict-flow-node-body {
128
+ fill: var(--pf-color-experimental-soft);
129
+ stroke: var(--pf-color-experimental);
130
+ stroke-width: 1.5;
131
+ }
132
+ .pict-flow-node-color-experimental .pict-flow-node-title-bar,
133
+ .pict-flow-node-color-experimental .pict-flow-node-title-bar-bottom {
134
+ fill: var(--pf-color-experimental);
135
+ }
136
+ ```
137
+
138
+ ## Arrowhead markers
139
+
140
+ `<marker>` elements live inside `<defs>` and don't pick up the same CSS variable cascade as regular SVG content in every browser. To make them theme-tracking, each generated polygon now carries a class (`pict-flow-arrowhead-default`, `pict-flow-arrowhead-selected`, `pict-flow-arrowhead-event-in`, …) and the corresponding CSS rule sets `fill` to the matching `--pf-…` token. The `fill="…"` attribute remains on the polygon as a graceful fallback when CSS can't reach it.
141
+
142
+ ## Flow visual themes
143
+
144
+ The seven flow themes (`default`, `sketch`, `blueprint`, `mono`, `retro-80s`, `retro-90s`, `whiteboard`) ship with explicit `CSSVariables` and `AdditionalCSS` blocks. They layer on top of the host theme by emitting their overrides into `.pict-flow-container { … }`. Because `:root`-scoped host tokens have lower specificity than `.pict-flow-container`-scoped flow tokens, the visual theme always wins where it sets a value, and the host theme controls everything it doesn't.
145
+
146
+ The `default` flow theme intentionally sets no overrides — it lets the host theme drive the look.
147
+
148
+ ## Disabling host integration
149
+
150
+ If a host wants the flow editor to ignore the host theme (e.g. to keep a fixed Sketch-style appearance regardless of the surrounding page), don't apply a host theme provider — or unsubscribe after construction by calling the dispose function returned via `flowView._HostThemeUnsubscribe`. This is rarely needed; flow visual themes already win where they care.
package/docs/_cover.md CHANGED
@@ -1,4 +1,4 @@
1
- # Pict-Section-Flow <small>0</small>
1
+ # Pict-Section-Flow
2
2
 
3
3
  > Interactive flow diagram section view for the Pict application framework
4
4
 
package/docs/_sidebar.md CHANGED
@@ -3,6 +3,7 @@
3
3
  - [Overview](/)
4
4
  - [Quick Start](Getting_Started.md)
5
5
  - [Custom Styling](Custom-Styling.md)
6
+ - [Theme Integration](Theme_Integration.md)
6
7
 
7
8
  - Architecture
8
9
 
@@ -15,7 +16,7 @@
15
16
  - [Implementation Reference](Implementation_Reference.md)
16
17
  - [Layout Persistence](Layout_Persistence.md)
17
18
 
18
- - API Data Management
19
+ - API -- Data Management
19
20
 
20
21
  - [addNode](api/addNode.md)
21
22
  - [removeNode](api/removeNode.md)
@@ -24,7 +25,7 @@
24
25
  - [getFlowData / setFlowData](api/getFlowData.md)
25
26
  - [marshalToView / marshalFromView](api/marshalToView.md)
26
27
 
27
- - API Selection & Viewport
28
+ - API -- Selection & Viewport
28
29
 
29
30
  - [selectNode / deselectAll](api/selectNode.md)
30
31
  - [setZoom / zoomToFit](api/setZoom.md)
@@ -32,20 +33,20 @@
32
33
  - [screenToSVGCoords](api/screenToSVGCoords.md)
33
34
  - [toggleFullscreen](api/toggleFullscreen.md)
34
35
 
35
- - API Panels
36
+ - API -- Panels
36
37
 
37
38
  - [openPanel / closePanel / togglePanel](api/openPanel.md)
38
39
 
39
- - API Theming & Events
40
+ - API -- Theming & Events
40
41
 
41
42
  - [setTheme / registerTheme](api/setTheme.md)
42
43
  - [registerHandler / fireEvent](api/registerHandler.md)
43
44
 
44
- - API Layout Persistence
45
+ - API -- Layout Persistence
45
46
 
46
47
  - [saveLayout / restoreLayout](api/saveLayout.md)
47
48
 
48
- - API Extension Points
49
+ - API -- Extension Points
49
50
 
50
51
  - [PictFlowCard](api/PictFlowCard.md)
51
52
  - [PictFlowCardPropertiesPanel](api/PictFlowCardPropertiesPanel.md)
@@ -0,0 +1,7 @@
1
+ {
2
+ "Name": "pict-section-flow",
3
+ "Version": "0.0.17",
4
+ "Description": "Pict Section Flow Diagram",
5
+ "GeneratedAt": "2026-04-10T17:25:15.954Z",
6
+ "GitCommit": "90d4cd2"
7
+ }
@@ -60,8 +60,8 @@ Each port object:
60
60
  | `Side` | string | `'left'`/`'right'` | Port side: `'left'`, `'right'`, `'top'`, `'bottom'` |
61
61
  | `MinimumInputCount` | number | `0` | Minimum required connections (inputs only) |
62
62
  | `MaximumInputCount` | number | `-1` | Maximum allowed connections (-1 = unlimited, inputs only) |
63
- | `PortType` | string | | Type for styling: `'event'`, `'setting'`, `'value'`, `'error'` |
64
- | `DataType` | string | | Semantic data type (for validation/display) |
63
+ | `PortType` | string | -- | Type for styling: `'event'`, `'setting'`, `'value'`, `'error'` |
64
+ | `DataType` | string | -- | Semantic data type (for validation/display) |
65
65
 
66
66
  ### Label Display Options
67
67
 
@@ -111,7 +111,7 @@ Register this card with a flow view's node type provider.
111
111
  |-----------|------|-------------|
112
112
  | `pFlowView` | PictViewFlow | The flow view instance |
113
113
 
114
- **Returns:** `boolean` whether registration succeeded.
114
+ **Returns:** `boolean` -- whether registration succeeded.
115
115
 
116
116
  ## Examples
117
117
 
@@ -211,6 +211,6 @@ tmpCard.registerWithFlowView(flowView);
211
211
 
212
212
  ## See Also
213
213
 
214
- - [registerNodeType](registerNodeType.md) Register types directly without PictFlowCard
215
- - [PictFlowCardPropertiesPanel](PictFlowCardPropertiesPanel.md) Custom panel types
216
- - [addNode](addNode.md) Create nodes from registered types
214
+ - [registerNodeType](registerNodeType.md) -- Register types directly without PictFlowCard
215
+ - [PictFlowCardPropertiesPanel](PictFlowCardPropertiesPanel.md) -- Custom panel types
216
+ - [addNode](addNode.md) -- Create nodes from registered types
@@ -231,5 +231,5 @@ class DataPreviewCard extends libPictFlowCard
231
231
 
232
232
  ## See Also
233
233
 
234
- - [PictFlowCard](PictFlowCard.md) Define cards that use panels
235
- - [openPanel / closePanel](openPanel.md) Panel lifecycle methods
234
+ - [PictFlowCard](PictFlowCard.md) -- Define cards that use panels
235
+ - [openPanel / closePanel](openPanel.md) -- Panel lifecycle methods
@@ -45,8 +45,8 @@ The connection object on success, or `false` if validation failed (e.g. duplicat
45
45
 
46
46
  ## Events Fired
47
47
 
48
- - `onConnectionCreated` with the new connection object
49
- - `onFlowChanged` with the complete flow data
48
+ - `onConnectionCreated` -- with the new connection object
49
+ - `onFlowChanged` -- with the complete flow data
50
50
 
51
51
  ## Examples
52
52
 
@@ -97,5 +97,5 @@ flowView.addConnection(tmpDecision.Hash, tmpNoPort.Hash, tmpFailure.Hash, tmpFai
97
97
 
98
98
  ## See Also
99
99
 
100
- - [removeConnection](removeConnection.md) Delete a connection
101
- - [addNode](addNode.md) Create nodes to connect
100
+ - [removeConnection](removeConnection.md) -- Delete a connection
101
+ - [addNode](addNode.md) -- Create nodes to connect
@@ -46,8 +46,8 @@ The newly created node object:
46
46
 
47
47
  ## Events Fired
48
48
 
49
- - `onNodeAdded` with the new node object
50
- - `onFlowChanged` with the complete flow data
49
+ - `onNodeAdded` -- with the new node object
50
+ - `onFlowChanged` -- with the complete flow data
51
51
 
52
52
  ## Examples
53
53
 
@@ -131,7 +131,7 @@ buildPipeline(flowView,
131
131
 
132
132
  ## See Also
133
133
 
134
- - [removeNode](removeNode.md) Delete a node
135
- - [getFlowData](getFlowData.md) Retrieve the full flow state
136
- - [PictFlowCard](PictFlowCard.md) Define custom node types
137
- - [registerNodeType](registerNodeType.md) Register node types directly
134
+ - [removeNode](removeNode.md) -- Delete a node
135
+ - [getFlowData](getFlowData.md) -- Retrieve the full flow state
136
+ - [PictFlowCard](PictFlowCard.md) -- Define custom node types
137
+ - [registerNodeType](registerNodeType.md) -- Register node types directly
@@ -73,5 +73,5 @@ flowView.autoLayout();
73
73
 
74
74
  ## See Also
75
75
 
76
- - [setZoom / zoomToFit](setZoom.md) Fit the result in the viewport
77
- - [saveLayout / restoreLayout](saveLayout.md) Persist spatial arrangements
76
+ - [setZoom / zoomToFit](setZoom.md) -- Fit the result in the viewport
77
+ - [saveLayout / restoreLayout](saveLayout.md) -- Persist spatial arrangements
@@ -47,7 +47,7 @@ A deep clone of the complete flow state:
47
47
 
48
48
  ### Events Fired
49
49
 
50
- - `onFlowChanged` with the new flow data
50
+ - `onFlowChanged` -- with the new flow data
51
51
 
52
52
  ## Examples
53
53
 
@@ -103,10 +103,10 @@ console.log('Zoom:', tmpData.ViewState.Zoom);
103
103
 
104
104
  ## Related Methods
105
105
 
106
- - `getNode(pNodeHash)` Retrieve a single node by hash
107
- - `getConnection(pConnectionHash)` Retrieve a single connection by hash
106
+ - `getNode(pNodeHash)` -- Retrieve a single node by hash
107
+ - `getConnection(pConnectionHash)` -- Retrieve a single connection by hash
108
108
 
109
109
  ## See Also
110
110
 
111
- - [marshalToView / marshalFromView](marshalToView.md) AppData two-way binding
112
- - [addNode](addNode.md) Add individual nodes
111
+ - [marshalToView / marshalFromView](marshalToView.md) -- AppData two-way binding
112
+ - [addNode](addNode.md) -- Add individual nodes
@@ -13,13 +13,13 @@ flowView.marshalFromView();
13
13
 
14
14
  Load flow data from the AppData address specified in `FlowDataAddress` into the view and render it.
15
15
 
16
- This is the "pull" direction: AppData Flow View.
16
+ This is the "pull" direction: AppData -> Flow View.
17
17
 
18
18
  ## marshalFromView
19
19
 
20
20
  Write the current flow data back to the AppData address specified in `FlowDataAddress`.
21
21
 
22
- This is the "push" direction: Flow View AppData.
22
+ This is the "push" direction: Flow View -> AppData.
23
23
 
24
24
  ## Configuration
25
25
 
@@ -92,4 +92,4 @@ tmpFlowView._EventHandlerProvider.registerHandler('onFlowChanged',
92
92
 
93
93
  ## See Also
94
94
 
95
- - [getFlowData / setFlowData](getFlowData.md) Direct get/set without AppData
95
+ - [getFlowData / setFlowData](getFlowData.md) -- Direct get/set without AppData
@@ -124,5 +124,5 @@ flowView._EventHandlerProvider.registerHandler('onPanelClosed',
124
124
 
125
125
  ## See Also
126
126
 
127
- - [PictFlowCard](PictFlowCard.md) Define PropertiesPanel configuration on card types
128
- - [PictFlowCardPropertiesPanel](PictFlowCardPropertiesPanel.md) Custom panel base class
127
+ - [PictFlowCard](PictFlowCard.md) -- Define PropertiesPanel configuration on card types
128
+ - [PictFlowCardPropertiesPanel](PictFlowCardPropertiesPanel.md) -- Custom panel base class
@@ -169,6 +169,6 @@ flowView._EventHandlerProvider.registerHandler('onNodeAdded',
169
169
 
170
170
  ## See Also
171
171
 
172
- - [addNode](addNode.md) Triggers `onNodeAdded` and `onFlowChanged`
173
- - [selectNode](selectNode.md) Triggers `onNodeSelected`
174
- - [setTheme](setTheme.md) Triggers `onThemeChanged`
172
+ - [addNode](addNode.md) -- Triggers `onNodeAdded` and `onFlowChanged`
173
+ - [selectNode](selectNode.md) -- Triggers `onNodeSelected`
174
+ - [setTheme](setTheme.md) -- Triggers `onThemeChanged`
@@ -64,7 +64,7 @@ Retrieve a node type configuration by hash. Returns the default type if the hash
64
64
 
65
65
  ## getNodeTypes
66
66
 
67
- **Returns:** Map of all registered node types (hash config).
67
+ **Returns:** Map of all registered node types (hash -> config).
68
68
 
69
69
  ## getNodeTypeList
70
70
 
@@ -138,5 +138,5 @@ flowView._NodeTypeProvider.removeNodeType('FREAD');
138
138
 
139
139
  ## See Also
140
140
 
141
- - [PictFlowCard](PictFlowCard.md) Higher-level card class (recommended approach)
142
- - [addNode](addNode.md) Create nodes from registered types
141
+ - [PictFlowCard](PictFlowCard.md) -- Higher-level card class (recommended approach)
142
+ - [addNode](addNode.md) -- Create nodes from registered types