pict-section-flow 1.0.1 → 1.1.0
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/README.md +44 -13
- package/docs/Architecture.md +8 -148
- package/docs/Data_Model.md +2 -11
- package/docs/README.md +8 -38
- package/docs/Theme_Integration.md +11 -11
- package/docs/_cover.md +7 -1
- package/docs/_playground.json +24 -0
- package/docs/_sidebar.md +4 -0
- package/docs/_topbar.md +1 -1
- package/docs/_version.json +3 -3
- package/docs/card-help/FREAD.md +1 -1
- package/docs/diagrams/architecture-at-a-glance.excalidraw +4270 -0
- package/docs/diagrams/architecture-at-a-glance.mmd +30 -0
- package/docs/diagrams/architecture-at-a-glance.svg +2 -0
- package/docs/diagrams/data-flow.excalidraw +1451 -0
- package/docs/diagrams/data-flow.mmd +17 -0
- package/docs/diagrams/data-flow.svg +2 -0
- package/docs/diagrams/high-level-design.excalidraw +5767 -0
- package/docs/diagrams/high-level-design.mmd +86 -0
- package/docs/diagrams/high-level-design.svg +2 -0
- package/docs/diagrams/relationships.excalidraw +3852 -0
- package/docs/diagrams/relationships.mmd +9 -0
- package/docs/diagrams/relationships.svg +2 -0
- package/docs/diagrams/service-initialization-sequence.excalidraw +1466 -0
- package/docs/diagrams/service-initialization-sequence.mmd +19 -0
- package/docs/diagrams/service-initialization-sequence.svg +2 -0
- package/docs/diagrams/svg-layer-structure.excalidraw +1060 -0
- package/docs/diagrams/svg-layer-structure.mmd +18 -0
- package/docs/diagrams/svg-layer-structure.svg +2 -0
- package/docs/examples/README.md +9 -0
- package/docs/examples/simple_cards/README.md +677 -0
- package/docs/examples/simple_cards/css/flowexample.css +65 -0
- package/docs/examples/simple_cards/index.html +32 -0
- package/docs/examples/simple_cards/js/pict.min.js +12 -0
- package/docs/examples/simple_cards/pict-section-flow-example-simple-cards.compatible.min.js +1 -0
- package/docs/index.html +6 -5
- package/docs/playground/app.json +6 -0
- package/docs/playground/appdata.json +85 -0
- package/docs/playground/application.js +23 -0
- package/docs/playground/pict.json +17 -0
- package/docs/playground/runtime/pict-application.min.js +2 -0
- package/docs/playground/runtime/pict-section-flow.min.js +2 -0
- package/docs/playground/runtime/pict-section-modal.min.js +2 -0
- package/docs/playground/runtime/pict.min.js +12 -0
- package/docs/retold-catalog.json +241 -166
- package/docs/retold-keyword-index.json +19312 -7226
- package/example_applications/simple_cards/package.json +9 -1
- package/example_applications/simple_cards/source/views/PictView-FlowExample-BottomBar.js +2 -2
- package/package.json +5 -5
- package/source/providers/PictProvider-Flow-PanelChrome.js +2 -1
- package/source/services/PictService-Flow-DataManager.js +6 -0
- package/source/services/PictService-Flow-InteractionManager.js +10 -1
- package/source/services/PictService-Flow-PanelManager.js +106 -2
- package/source/views/PictView-Flow-PropertiesPanel.js +70 -3
- package/source/views/PictView-Flow.js +53 -0
- package/test/PanelManager_tests.js +172 -0
package/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# Pict-Section-Flow
|
|
2
2
|
|
|
3
|
-
[
|
|
4
|
-
|
|
3
|
+
> **[Read the Pict-Section-Flow Documentation](https://fable-retold.github.io/pict-section-flow/)**
|
|
4
|
+
|
|
5
|
+
[pict-section-flow on npm](https://www.npmjs.com/package/pict-section-flow) | [MIT License](LICENSE)
|
|
5
6
|
|
|
6
7
|
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
8
|
|
|
@@ -112,6 +113,36 @@ The `|| false` fallback ensures the build never fails if a markdown file is miss
|
|
|
112
113
|
| `MinZoom` | number | `0.1` | Minimum zoom level |
|
|
113
114
|
| `MaxZoom` | number | `5.0` | Maximum zoom level |
|
|
114
115
|
| `Theme` | string | `'default'` | Active theme key |
|
|
116
|
+
| `ConnectionPropertiesPanel` | object/false | `false` | Properties panel config for connections (edges). When set, double-clicking a connection opens an on-graph panel for it. |
|
|
117
|
+
|
|
118
|
+
## Connection (edge) panels
|
|
119
|
+
|
|
120
|
+
Nodes carry a `PropertiesPanel` on their card type; connections are not typed, so a single
|
|
121
|
+
`ConnectionPropertiesPanel` on the view config serves them all. Its shape matches a card's
|
|
122
|
+
properties panel (`PanelType`, `DefaultWidth`, `DefaultHeight`, `Title`, `Configuration`) and any
|
|
123
|
+
panel type works — a `Form` panel binds to the connection (editing `Record.Data.*`), a `Template`
|
|
124
|
+
panel renders against it. When it is set, double-clicking a connection opens the panel near the
|
|
125
|
+
edge midpoint and tethers to it; when it is not set, double-clicking a connection adds a bezier
|
|
126
|
+
handle as before, so existing apps are unaffected.
|
|
127
|
+
|
|
128
|
+
```javascript
|
|
129
|
+
_Pict.addView('MyFlow',
|
|
130
|
+
{
|
|
131
|
+
ConnectionPropertiesPanel:
|
|
132
|
+
{
|
|
133
|
+
PanelType: 'Form',
|
|
134
|
+
Title: 'Connection',
|
|
135
|
+
DefaultWidth: 320,
|
|
136
|
+
Configuration: { Manifest: { /* sections + descriptors over Record.Data.* */ } }
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
libPictSectionFlow);
|
|
140
|
+
|
|
141
|
+
// Programmatic control mirrors the node-panel API:
|
|
142
|
+
tmpFlowView.openConnectionPanel(connectionHash);
|
|
143
|
+
tmpFlowView.toggleConnectionPanel(connectionHash);
|
|
144
|
+
tmpFlowView.closePanelForConnection(connectionHash);
|
|
145
|
+
```
|
|
115
146
|
|
|
116
147
|
## Built-in Themes
|
|
117
148
|
|
|
@@ -126,13 +157,13 @@ The `|| false` fallback ensures the build never fails if a markdown file is miss
|
|
|
126
157
|
|
|
127
158
|
## Documentation
|
|
128
159
|
|
|
129
|
-
Full documentation is available at [https://
|
|
160
|
+
Full documentation is available at [https://fable-retold.github.io/pict-section-flow/](https://fable-retold.github.io/pict-section-flow/)
|
|
130
161
|
|
|
131
|
-
- [Getting Started](https://
|
|
132
|
-
- [Architecture](https://
|
|
133
|
-
- [Implementation Reference](https://
|
|
134
|
-
- [Custom Styling](https://
|
|
135
|
-
- [Layout Persistence](https://
|
|
162
|
+
- [Getting Started](https://fable-retold.github.io/pict-section-flow/#/Getting_Started) -- First flow diagram in five minutes
|
|
163
|
+
- [Architecture](https://fable-retold.github.io/pict-section-flow/#/Architecture) -- Service/provider design and data flow
|
|
164
|
+
- [Implementation Reference](https://fable-retold.github.io/pict-section-flow/#/Implementation_Reference) -- Complete API surface
|
|
165
|
+
- [Custom Styling](https://fable-retold.github.io/pict-section-flow/#/Custom-Styling) -- CSS custom properties and theme API
|
|
166
|
+
- [Layout Persistence](https://fable-retold.github.io/pict-section-flow/#/Layout_Persistence) -- Save/restore with localStorage or REST
|
|
136
167
|
|
|
137
168
|
## API Reference (Function Docs)
|
|
138
169
|
|
|
@@ -161,11 +192,11 @@ Detailed per-function documentation with code snippets:
|
|
|
161
192
|
|
|
162
193
|
## Related Packages
|
|
163
194
|
|
|
164
|
-
- [pict](https://github.com/
|
|
165
|
-
- [pict-view](https://github.com/
|
|
166
|
-
- [pict-provider](https://github.com/
|
|
167
|
-
- [pict-section-form](https://github.com/
|
|
168
|
-
- [fable](https://github.com/
|
|
195
|
+
- [pict](https://github.com/fable-retold/pict) -- MVC application framework
|
|
196
|
+
- [pict-view](https://github.com/fable-retold/pict-view) -- View base class
|
|
197
|
+
- [pict-provider](https://github.com/fable-retold/pict-provider) -- Provider base class
|
|
198
|
+
- [pict-section-form](https://github.com/fable-retold/pict-section-form) -- Form sections (used for Form panels)
|
|
199
|
+
- [fable](https://github.com/fable-retold/fable) -- Service infrastructure
|
|
169
200
|
|
|
170
201
|
## License
|
|
171
202
|
|
package/docs/Architecture.md
CHANGED
|
@@ -4,143 +4,22 @@ Pict-Section-Flow follows the standard Pict layered architecture -- Views for re
|
|
|
4
4
|
|
|
5
5
|
## High-Level Design
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
subgraph Application["Your Application"]
|
|
10
|
-
AppCode[Application Code]
|
|
11
|
-
AppData[Pict AppData Store]
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
subgraph FlowView["PictViewFlow (Main Entry Point)"]
|
|
15
|
-
direction TB
|
|
16
|
-
FV[PictViewFlow]
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
subgraph Views["Views (Rendering)"]
|
|
20
|
-
NodeView[Flow Node View]
|
|
21
|
-
ToolbarView[Toolbar View]
|
|
22
|
-
FloatingToolbar[Floating Toolbar View]
|
|
23
|
-
PanelView[Properties Panel View]
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
subgraph Services["Services (Business Logic)"]
|
|
27
|
-
DM[DataManager]
|
|
28
|
-
RM[RenderManager]
|
|
29
|
-
SM[SelectionManager]
|
|
30
|
-
VM[ViewportManager]
|
|
31
|
-
PM[PanelManager]
|
|
32
|
-
IM[InteractionManager]
|
|
33
|
-
LS[Layout Service]
|
|
34
|
-
CR[ConnectionRenderer]
|
|
35
|
-
PG[PathGenerator]
|
|
36
|
-
PR[PortRenderer]
|
|
37
|
-
CHM[ConnectionHandleManager]
|
|
38
|
-
TM[Tether Service]
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
subgraph Providers["Providers (Configuration)"]
|
|
42
|
-
NTP[NodeTypes Provider]
|
|
43
|
-
EHP[EventHandler Provider]
|
|
44
|
-
LP[Layouts Provider]
|
|
45
|
-
TP[Theme Provider]
|
|
46
|
-
CP[CSS Provider]
|
|
47
|
-
GP[Geometry Provider]
|
|
48
|
-
NP[Noise Provider]
|
|
49
|
-
SVG[SVGHelpers Provider]
|
|
50
|
-
CSP[ConnectorShapes Provider]
|
|
51
|
-
IP[Icons Provider]
|
|
52
|
-
PCP[PanelChrome Provider]
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
subgraph Extension["Extension Points"]
|
|
56
|
-
FC[PictFlowCard]
|
|
57
|
-
FCP[PictFlowCardPropertiesPanel]
|
|
58
|
-
PT[Panel: Template]
|
|
59
|
-
PMD[Panel: Markdown]
|
|
60
|
-
PF[Panel: Form]
|
|
61
|
-
PVW[Panel: View]
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
AppCode --> FV
|
|
65
|
-
FV <--> AppData
|
|
66
|
-
FV --> Views
|
|
67
|
-
FV --> Services
|
|
68
|
-
FV --> Providers
|
|
69
|
-
|
|
70
|
-
DM <--> AppData
|
|
71
|
-
RM --> NodeView
|
|
72
|
-
RM --> CR
|
|
73
|
-
PM --> PanelView
|
|
74
|
-
IM --> SM
|
|
75
|
-
IM --> VM
|
|
76
|
-
CR --> PG
|
|
77
|
-
CR --> PR
|
|
78
|
-
|
|
79
|
-
FC --> NTP
|
|
80
|
-
FCP --> PM
|
|
81
|
-
PT --> PanelView
|
|
82
|
-
PMD --> PanelView
|
|
83
|
-
PF --> PanelView
|
|
84
|
-
PVW --> PanelView
|
|
85
|
-
|
|
86
|
-
EHP --> AppCode
|
|
87
|
-
|
|
88
|
-
style Application fill:#e8f5e9,stroke:#42b983,color:#333
|
|
89
|
-
style FlowView fill:#e3f2fd,stroke:#42a5f5,color:#333
|
|
90
|
-
style Views fill:#fce4ec,stroke:#ef5350,color:#333
|
|
91
|
-
style Services fill:#fff3e0,stroke:#ffa726,color:#333
|
|
92
|
-
style Providers fill:#f3e5f5,stroke:#ab47bc,color:#333
|
|
93
|
-
style Extension fill:#e0f2f1,stroke:#26a69a,color:#333
|
|
94
|
-
```
|
|
7
|
+
<!-- bespoke diagram: edit diagrams/high-level-design.mmd or .hints.json, then: npx pict-renderer-graph build modules/pict/pict-section-flow/docs -->
|
|
8
|
+

|
|
95
9
|
|
|
96
10
|
## Data Flow
|
|
97
11
|
|
|
98
12
|
All mutations flow through a predictable pipeline:
|
|
99
13
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
participant App as Application
|
|
103
|
-
participant FV as PictViewFlow
|
|
104
|
-
participant DM as DataManager
|
|
105
|
-
participant EH as EventHandler
|
|
106
|
-
participant RM as RenderManager
|
|
107
|
-
|
|
108
|
-
App->>FV: addNode('start', 50, 100, 'Begin')
|
|
109
|
-
FV->>DM: addNode(pType, pX, pY, pTitle, pData)
|
|
110
|
-
DM->>DM: Create node object with UUID hash
|
|
111
|
-
DM->>DM: Merge default ports from NodeType
|
|
112
|
-
DM->>EH: fireEvent('onNodeAdded', node)
|
|
113
|
-
DM->>EH: fireEvent('onFlowChanged', flowData)
|
|
114
|
-
DM->>RM: renderFlow()
|
|
115
|
-
RM->>RM: Render SVG nodes, connections, tethers, panels
|
|
116
|
-
DM-->>FV: Return node object
|
|
117
|
-
FV-->>App: Return node object
|
|
118
|
-
```
|
|
14
|
+
<!-- bespoke diagram: edit diagrams/data-flow.mmd or .hints.json, then: npx pict-renderer-graph build modules/pict/pict-section-flow/docs -->
|
|
15
|
+

|
|
119
16
|
|
|
120
17
|
## SVG Layer Structure
|
|
121
18
|
|
|
122
19
|
The rendering system uses SVG group elements in a specific z-order:
|
|
123
20
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
subgraph SVG["SVG Canvas"]
|
|
127
|
-
Grid["Grid Background (pattern)"]
|
|
128
|
-
subgraph Viewport["Viewport Group (pan/zoom transform)"]
|
|
129
|
-
Connections["Connections Layer (bezier/orthogonal paths)"]
|
|
130
|
-
Nodes["Nodes Layer (rect + ports + labels)"]
|
|
131
|
-
Tethers["Tethers Layer (panel-to-node lines)"]
|
|
132
|
-
Panels["Panels Layer (foreignObject panels)"]
|
|
133
|
-
end
|
|
134
|
-
end
|
|
135
|
-
|
|
136
|
-
Grid --> Viewport
|
|
137
|
-
Connections --> Nodes
|
|
138
|
-
Nodes --> Tethers
|
|
139
|
-
Tethers --> Panels
|
|
140
|
-
|
|
141
|
-
style SVG fill:#f5f5f5,stroke:#bdbdbd,color:#333
|
|
142
|
-
style Viewport fill:#e3f2fd,stroke:#42a5f5,color:#333
|
|
143
|
-
```
|
|
21
|
+
<!-- bespoke diagram: edit diagrams/svg-layer-structure.mmd or .hints.json, then: npx pict-renderer-graph build modules/pict/pict-section-flow/docs -->
|
|
22
|
+

|
|
144
23
|
|
|
145
24
|
Connections render behind nodes so lines do not obscure node bodies. Tethers render above nodes so the connecting line from a panel to its node is always visible. Panels render last so they float above everything.
|
|
146
25
|
|
|
@@ -262,27 +141,8 @@ The canonical flow state is a plain JavaScript object:
|
|
|
262
141
|
|
|
263
142
|
When PictViewFlow initializes, it follows a declarative registry to instantiate all components:
|
|
264
143
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
participant App as Application
|
|
268
|
-
participant FV as PictViewFlow
|
|
269
|
-
participant PR as Providers
|
|
270
|
-
participant SV as Services
|
|
271
|
-
participant VW as Child Views
|
|
272
|
-
|
|
273
|
-
App->>FV: new PictViewFlow(fable, options)
|
|
274
|
-
FV->>PR: Register & instantiate providers
|
|
275
|
-
Note over PR: SVGHelpers, Geometry, Noise (no FlowView ref)
|
|
276
|
-
Note over PR: Theme, CSS, Icons, NodeTypes, EventHandler, Layouts (with FlowView ref)
|
|
277
|
-
FV->>SV: Register & instantiate services
|
|
278
|
-
Note over SV: DataManager, RenderManager, SelectionManager, etc.
|
|
279
|
-
FV->>VW: Register & instantiate child views
|
|
280
|
-
Note over VW: Node, Toolbar, FloatingToolbar, PropertiesPanel
|
|
281
|
-
|
|
282
|
-
App->>FV: render()
|
|
283
|
-
FV->>SV: DataManager.marshalToView()
|
|
284
|
-
FV->>SV: RenderManager.renderFlow()
|
|
285
|
-
```
|
|
144
|
+
<!-- bespoke diagram: edit diagrams/service-initialization-sequence.mmd or .hints.json, then: npx pict-renderer-graph build modules/pict/pict-section-flow/docs -->
|
|
145
|
+

|
|
286
146
|
|
|
287
147
|
## Design Patterns
|
|
288
148
|
|
package/docs/Data_Model.md
CHANGED
|
@@ -145,14 +145,5 @@ Viewport and selection state, persisted with the flow data.
|
|
|
145
145
|
|
|
146
146
|
## Relationships
|
|
147
147
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
FlowData ||--o{ Node : contains
|
|
151
|
-
FlowData ||--o{ Connection : contains
|
|
152
|
-
FlowData ||--o{ Panel : contains
|
|
153
|
-
FlowData ||--|| ViewState : has
|
|
154
|
-
Node ||--o{ Port : has
|
|
155
|
-
Connection }o--|| Port : "source port"
|
|
156
|
-
Connection }o--|| Port : "target port"
|
|
157
|
-
Panel }o--|| Node : "attached to"
|
|
158
|
-
```
|
|
148
|
+
<!-- bespoke diagram: edit diagrams/relationships.mmd or .hints.json, then: npx pict-renderer-graph build modules/pict/pict-section-flow/docs -->
|
|
149
|
+

|
package/docs/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Pict-Section-Flow
|
|
2
2
|
|
|
3
|
-
An interactive flow diagram section view for the [Pict](https://github.
|
|
3
|
+
An interactive flow diagram section view for the [Pict](https://fable-retold.github.io/pict/) application framework. Build node-based visual editors, workflow designers, and data pipeline tools with a declarative, configuration-driven API.
|
|
4
4
|
|
|
5
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
|
|
|
@@ -19,38 +19,8 @@ All interaction is driven by a JSON data structure that represents the flow grap
|
|
|
19
19
|
|
|
20
20
|
## Architecture at a Glance
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
A[Your Application] --> B[PictViewFlow]
|
|
25
|
-
B --> C[Services]
|
|
26
|
-
B --> D[Providers]
|
|
27
|
-
B --> E[Views]
|
|
28
|
-
|
|
29
|
-
C --> C1[DataManager]
|
|
30
|
-
C --> C2[RenderManager]
|
|
31
|
-
C --> C3[SelectionManager]
|
|
32
|
-
C --> C4[ViewportManager]
|
|
33
|
-
C --> C5[PanelManager]
|
|
34
|
-
C --> C6[InteractionManager]
|
|
35
|
-
C --> C7[Layout Service]
|
|
36
|
-
|
|
37
|
-
D --> D1[NodeTypes]
|
|
38
|
-
D --> D2[EventHandler]
|
|
39
|
-
D --> D3[Layouts]
|
|
40
|
-
D --> D4[Theme]
|
|
41
|
-
D --> D5[CSS]
|
|
42
|
-
D --> D6[Geometry]
|
|
43
|
-
|
|
44
|
-
E --> E1[Flow Node View]
|
|
45
|
-
E --> E2[Toolbar View]
|
|
46
|
-
E --> E3[Properties Panel View]
|
|
47
|
-
|
|
48
|
-
style A fill:#e8f5e9,stroke:#42b983,color:#333
|
|
49
|
-
style B fill:#e3f2fd,stroke:#42a5f5,color:#333
|
|
50
|
-
style C fill:#fff3e0,stroke:#ffa726,color:#333
|
|
51
|
-
style D fill:#f3e5f5,stroke:#ab47bc,color:#333
|
|
52
|
-
style E fill:#fce4ec,stroke:#ef5350,color:#333
|
|
53
|
-
```
|
|
22
|
+
<!-- bespoke diagram: edit diagrams/architecture-at-a-glance.mmd or .hints.json, then: npx pict-renderer-graph build modules/pict/pict-section-flow/docs -->
|
|
23
|
+

|
|
54
24
|
|
|
55
25
|
The module follows the standard Pict layered architecture:
|
|
56
26
|
|
|
@@ -122,11 +92,11 @@ tmpFlow._EventHandlerProvider.registerHandler('onFlowChanged',
|
|
|
122
92
|
|
|
123
93
|
Pict-Section-Flow is part of the [Retold](https://github.com/stevenvelozo/retold) module suite:
|
|
124
94
|
|
|
125
|
-
- [pict](https://github.
|
|
126
|
-
- [pict-view](https://github.
|
|
127
|
-
- [pict-provider](https://github.
|
|
128
|
-
- [pict-section-form](https://github.
|
|
129
|
-
- [fable](https://github.
|
|
95
|
+
- [pict](https://fable-retold.github.io/pict/) -- Core MVC application framework
|
|
96
|
+
- [pict-view](https://fable-retold.github.io/pict-view/) -- View base class
|
|
97
|
+
- [pict-provider](https://fable-retold.github.io/pict-provider/) -- Provider base class
|
|
98
|
+
- [pict-section-form](https://fable-retold.github.io/pict-section-form/) -- Form sections (used for Form panel type)
|
|
99
|
+
- [fable](https://fable-retold.github.io/fable/) -- Service infrastructure and dependency injection
|
|
130
100
|
|
|
131
101
|
## License
|
|
132
102
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
`pict-section-flow` participates in the host application's theme system in two layers:
|
|
4
4
|
|
|
5
|
-
1. **Host theme (light/dark/palette)**
|
|
6
|
-
2. **Flow visual theme (sketch, blueprint, mono, retro-80s, retro-90s, whiteboard, default)**
|
|
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
7
|
|
|
8
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
9
|
|
|
@@ -18,7 +18,7 @@ pict.providers.Theme.registerTheme(require('pict-provider-theme/source/themes/pi
|
|
|
18
18
|
pict.providers.Theme.applyTheme('pict-default', 'system');
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
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
22
|
|
|
23
23
|
- Re-runs `_CSSProvider.registerCSS()` so CSS layered on top by the active flow visual theme stays in the cascade.
|
|
24
24
|
- Calls `_reinjectMarkerDefs()` so SVG `<marker>` arrowhead polygons rebuild with the new fills.
|
|
@@ -28,7 +28,7 @@ No code changes are required in host apps beyond installing and applying `pict-p
|
|
|
28
28
|
|
|
29
29
|
## Token mapping
|
|
30
30
|
|
|
31
|
-
| Flow token (`--pf
|
|
31
|
+
| Flow token (`--pf-...`) | Host token (`--theme-color-...`) | Hardcoded fallback |
|
|
32
32
|
|---|---|---|
|
|
33
33
|
| `--pf-text-primary` | `text-primary` | `#2c3e50` |
|
|
34
34
|
| `--pf-text-secondary` | `text-secondary` | `#7f8c8d` |
|
|
@@ -83,7 +83,7 @@ The five default node types ship with roles wired up:
|
|
|
83
83
|
| `halt` | `error` |
|
|
84
84
|
| `decision` | `warning` |
|
|
85
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
|
|
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
87
|
|
|
88
88
|
### Custom card types
|
|
89
89
|
|
|
@@ -91,7 +91,7 @@ Their hex `TitleBarColor` / `BodyStyle` fields remain as fallbacks for code path
|
|
|
91
91
|
flowView._NodeTypeProvider.registerNodeType('my-card-type', {
|
|
92
92
|
Hash: 'my-card-type',
|
|
93
93
|
Label: 'My Card',
|
|
94
|
-
DefaultPorts: [ /*
|
|
94
|
+
DefaultPorts: [ /* ... */ ],
|
|
95
95
|
ColorRole: 'info', // theme-aware
|
|
96
96
|
TitleBarColor: '#3498db', // optional fallback
|
|
97
97
|
BodyStyle: { fill: '#ebf5fb' } // optional fallback
|
|
@@ -109,7 +109,7 @@ flowData.Nodes.push({
|
|
|
109
109
|
Hash: 'node-special',
|
|
110
110
|
Type: 'my-card-type',
|
|
111
111
|
ColorRole: 'warning', // override the type's role
|
|
112
|
-
//
|
|
112
|
+
// ...
|
|
113
113
|
});
|
|
114
114
|
```
|
|
115
115
|
|
|
@@ -137,14 +137,14 @@ To define new roles, add `--pf-color-<role>` / `--pf-color-<role>-soft` tokens a
|
|
|
137
137
|
|
|
138
138
|
## Arrowhead markers
|
|
139
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`,
|
|
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
141
|
|
|
142
142
|
## Flow visual themes
|
|
143
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 {
|
|
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
145
|
|
|
146
|
-
The `default` flow theme intentionally sets no overrides
|
|
146
|
+
The `default` flow theme intentionally sets no overrides - it lets the host theme drive the look.
|
|
147
147
|
|
|
148
148
|
## Disabling host integration
|
|
149
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
|
|
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
|
@@ -7,5 +7,11 @@
|
|
|
7
7
|
- Six built-in themes with 70+ CSS design tokens
|
|
8
8
|
- Layout persistence to localStorage or any backend
|
|
9
9
|
|
|
10
|
-
[GitHub](https://github.com/
|
|
10
|
+
[GitHub](https://github.com/fable-retold/pict-section-flow)
|
|
11
11
|
[Get Started](#pict-section-flow)
|
|
12
|
+
|
|
13
|
+
<!-- docuserve:examples:start -->
|
|
14
|
+
| Example | Complexity | Launch |
|
|
15
|
+
|---------|------------|--------|
|
|
16
|
+
| [Simple Cards](examples/simple%5Fcards/README.md) | Basic | [Launch](examples/simple%5Fcards/index.html) |
|
|
17
|
+
<!-- docuserve:examples:end -->
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Kind": "section",
|
|
3
|
+
"WrapperKind": "view",
|
|
4
|
+
"SectionType": "pict-section-flow",
|
|
5
|
+
"ApplicationModule": "PictSectionFlow",
|
|
6
|
+
"ApplicationGlobal": "PictSectionFlow",
|
|
7
|
+
"ViewName": "Flow",
|
|
8
|
+
"ViewConfigKey": "FlowViewConfig",
|
|
9
|
+
"ManifestKey": "DefaultFlowManifest",
|
|
10
|
+
"Editors":
|
|
11
|
+
[
|
|
12
|
+
{ "Hash": "pictConfig", "Label": "Pict Config", "Language": "json", "DefaultPath": "playground/pict.json" },
|
|
13
|
+
{ "Hash": "appConfig", "Label": "App Config", "Language": "json", "DefaultPath": "playground/app.json" },
|
|
14
|
+
{ "Hash": "appData", "Label": "Initial AppData", "Language": "json", "DefaultPath": "playground/appdata.json" },
|
|
15
|
+
{ "Hash": "application", "Label": "Application Code", "Language": "javascript", "DefaultPath": "playground/application.js" }
|
|
16
|
+
],
|
|
17
|
+
"Imports":
|
|
18
|
+
[
|
|
19
|
+
{ "Name": "pict", "Source": "local", "Path": "playground/runtime/pict.min.js" },
|
|
20
|
+
{ "Name": "pict-application", "Source": "local", "Path": "playground/runtime/pict-application.min.js" },
|
|
21
|
+
{ "Name": "pict-section-modal", "Source": "local", "Path": "playground/runtime/pict-section-modal.min.js" },
|
|
22
|
+
{ "Name": "pict-section-flow", "Source": "local", "Path": "playground/runtime/pict-section-flow.min.js" }
|
|
23
|
+
]
|
|
24
|
+
}
|
package/docs/_sidebar.md
CHANGED
package/docs/_topbar.md
CHANGED
package/docs/_version.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"Name": "pict-section-flow",
|
|
3
|
-
"Version": "
|
|
3
|
+
"Version": "1.0.1",
|
|
4
4
|
"Description": "Pict Section Flow Diagram",
|
|
5
|
-
"GeneratedAt": "2026-
|
|
6
|
-
"GitCommit": "
|
|
5
|
+
"GeneratedAt": "2026-05-26T21:13:23.849Z",
|
|
6
|
+
"GitCommit": "2356616"
|
|
7
7
|
}
|
package/docs/card-help/FREAD.md
CHANGED
|
@@ -21,4 +21,4 @@ When triggered, the node reads the file at the configured path. On success, the
|
|
|
21
21
|
|
|
22
22
|
- Use a Get Value node upstream to dynamically set the file path
|
|
23
23
|
- Pair with a Data Preview node to inspect the file contents
|
|
24
|
-
- Connect the **Error** output to logging or notification nodes for
|
|
24
|
+
- Connect the **Error** output to logging or notification nodes for reliable error handling
|