pict-section-flow 1.3.0 → 2.0.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.
Files changed (162) hide show
  1. package/package.json +7 -2
  2. package/source/Pict-Section-Flow.js +20 -14
  3. package/source/providers/PictProvider-Flow-Background.js +303 -0
  4. package/source/providers/PictProvider-Flow-CSS.js +99 -7
  5. package/source/providers/PictProvider-Flow-ConnectorShapes.js +8 -0
  6. package/source/providers/PictProvider-Flow-Geometry.js +11 -421
  7. package/source/providers/PictProvider-Flow-Icons.js +20 -0
  8. package/source/providers/PictProvider-Flow-Layouts.js +107 -0
  9. package/source/services/PictService-Flow-ConnectionRenderer.js +77 -5
  10. package/source/services/PictService-Flow-CursorManager.js +113 -0
  11. package/source/services/PictService-Flow-InteractionManager.js +443 -61
  12. package/source/services/PictService-Flow-Layout.js +21 -16
  13. package/source/services/PictService-Flow-PathGenerator.js +30 -417
  14. package/source/services/PictService-Flow-RenderManager.js +9 -1
  15. package/source/services/PictService-Flow-ViewportManager.js +102 -0
  16. package/source/views/PictView-Flow-FloatingToolbar.js +57 -0
  17. package/source/views/PictView-Flow-Node.js +36 -0
  18. package/source/views/PictView-Flow-PropertiesPanel.js +27 -5
  19. package/source/views/PictView-Flow-Toolbar.js +148 -13
  20. package/source/views/PictView-Flow.js +628 -3
  21. package/.claude/launch.json +0 -11
  22. package/docs/.nojekyll +0 -0
  23. package/docs/Architecture.md +0 -163
  24. package/docs/Custom-Styling.md +0 -275
  25. package/docs/Data_Model.md +0 -149
  26. package/docs/Event_System.md +0 -156
  27. package/docs/Getting_Started.md +0 -237
  28. package/docs/Implementation_Reference.md +0 -528
  29. package/docs/Layout_Persistence.md +0 -117
  30. package/docs/README.md +0 -103
  31. package/docs/Theme_Integration.md +0 -150
  32. package/docs/_brand.json +0 -18
  33. package/docs/_cover.md +0 -17
  34. package/docs/_playground.json +0 -24
  35. package/docs/_sidebar.md +0 -57
  36. package/docs/_topbar.md +0 -8
  37. package/docs/_version.json +0 -7
  38. package/docs/api/PictFlowCard.md +0 -216
  39. package/docs/api/PictFlowCardPropertiesPanel.md +0 -235
  40. package/docs/api/addConnection.md +0 -101
  41. package/docs/api/addNode.md +0 -137
  42. package/docs/api/autoLayout.md +0 -77
  43. package/docs/api/getFlowData.md +0 -112
  44. package/docs/api/marshalToView.md +0 -95
  45. package/docs/api/openPanel.md +0 -128
  46. package/docs/api/registerHandler.md +0 -174
  47. package/docs/api/registerNodeType.md +0 -142
  48. package/docs/api/removeConnection.md +0 -57
  49. package/docs/api/removeNode.md +0 -80
  50. package/docs/api/saveLayout.md +0 -152
  51. package/docs/api/screenToSVGCoords.md +0 -68
  52. package/docs/api/selectNode.md +0 -116
  53. package/docs/api/setTheme.md +0 -168
  54. package/docs/api/setZoom.md +0 -97
  55. package/docs/api/toggleFullscreen.md +0 -68
  56. package/docs/card-help/EACH.md +0 -19
  57. package/docs/card-help/FREAD.md +0 -24
  58. package/docs/card-help/FWRITE.md +0 -24
  59. package/docs/card-help/GET.md +0 -22
  60. package/docs/card-help/ITE.md +0 -23
  61. package/docs/card-help/LOG.md +0 -23
  62. package/docs/card-help/NOTE.md +0 -17
  63. package/docs/card-help/PREV.md +0 -18
  64. package/docs/card-help/SET.md +0 -27
  65. package/docs/card-help/SPKL.md +0 -22
  66. package/docs/card-help/STAT.md +0 -23
  67. package/docs/card-help/SW.md +0 -25
  68. package/docs/diagrams/architecture-at-a-glance.excalidraw +0 -4270
  69. package/docs/diagrams/architecture-at-a-glance.mmd +0 -30
  70. package/docs/diagrams/architecture-at-a-glance.svg +0 -2
  71. package/docs/diagrams/data-flow.excalidraw +0 -1451
  72. package/docs/diagrams/data-flow.mmd +0 -17
  73. package/docs/diagrams/data-flow.svg +0 -2
  74. package/docs/diagrams/high-level-design.excalidraw +0 -5767
  75. package/docs/diagrams/high-level-design.mmd +0 -86
  76. package/docs/diagrams/high-level-design.svg +0 -2
  77. package/docs/diagrams/relationships.excalidraw +0 -3852
  78. package/docs/diagrams/relationships.mmd +0 -9
  79. package/docs/diagrams/relationships.svg +0 -2
  80. package/docs/diagrams/service-initialization-sequence.excalidraw +0 -1466
  81. package/docs/diagrams/service-initialization-sequence.mmd +0 -19
  82. package/docs/diagrams/service-initialization-sequence.svg +0 -2
  83. package/docs/diagrams/svg-layer-structure.excalidraw +0 -1060
  84. package/docs/diagrams/svg-layer-structure.mmd +0 -18
  85. package/docs/diagrams/svg-layer-structure.svg +0 -2
  86. package/docs/examples/README.md +0 -9
  87. package/docs/examples/simple_cards/README.md +0 -677
  88. package/docs/examples/simple_cards/css/flowexample.css +0 -65
  89. package/docs/examples/simple_cards/index.html +0 -32
  90. package/docs/examples/simple_cards/js/pict.min.js +0 -12
  91. package/docs/examples/simple_cards/pict-section-flow-example-simple-cards.compatible.min.js +0 -1
  92. package/docs/index.html +0 -38
  93. package/docs/playground/app.json +0 -6
  94. package/docs/playground/appdata.json +0 -85
  95. package/docs/playground/application.js +0 -23
  96. package/docs/playground/pict.json +0 -17
  97. package/docs/playground/runtime/pict-application.min.js +0 -2
  98. package/docs/playground/runtime/pict-section-flow.min.js +0 -2
  99. package/docs/playground/runtime/pict-section-modal.min.js +0 -2
  100. package/docs/playground/runtime/pict.min.js +0 -12
  101. package/docs/retold-catalog.json +0 -244
  102. package/docs/retold-keyword-index.json +0 -26028
  103. package/example_applications/simple_cards/css/flowexample.css +0 -65
  104. package/example_applications/simple_cards/html/index.html +0 -32
  105. package/example_applications/simple_cards/package.json +0 -52
  106. package/example_applications/simple_cards/source/Pict-Application-FlowExample-Configuration.json +0 -15
  107. package/example_applications/simple_cards/source/Pict-Application-FlowExample.js +0 -539
  108. package/example_applications/simple_cards/source/card-help-content.js +0 -16
  109. package/example_applications/simple_cards/source/cards/FlowCard-Comment.js +0 -38
  110. package/example_applications/simple_cards/source/cards/FlowCard-DataPreview.js +0 -44
  111. package/example_applications/simple_cards/source/cards/FlowCard-Each.js +0 -38
  112. package/example_applications/simple_cards/source/cards/FlowCard-FileRead.js +0 -56
  113. package/example_applications/simple_cards/source/cards/FlowCard-FileWrite.js +0 -50
  114. package/example_applications/simple_cards/source/cards/FlowCard-GetValue.js +0 -37
  115. package/example_applications/simple_cards/source/cards/FlowCard-IfThenElse.js +0 -49
  116. package/example_applications/simple_cards/source/cards/FlowCard-LogValues.js +0 -55
  117. package/example_applications/simple_cards/source/cards/FlowCard-SetValue.js +0 -97
  118. package/example_applications/simple_cards/source/cards/FlowCard-Sparkline.js +0 -100
  119. package/example_applications/simple_cards/source/cards/FlowCard-StatusMonitor.js +0 -46
  120. package/example_applications/simple_cards/source/cards/FlowCard-Switch.js +0 -39
  121. package/example_applications/simple_cards/source/providers/PictRouter-FlowExample-Configuration.json +0 -22
  122. package/example_applications/simple_cards/source/sample-flows.js +0 -410
  123. package/example_applications/simple_cards/source/views/PictView-FlowExample-About.js +0 -184
  124. package/example_applications/simple_cards/source/views/PictView-FlowExample-BottomBar.js +0 -77
  125. package/example_applications/simple_cards/source/views/PictView-FlowExample-Documentation.js +0 -325
  126. package/example_applications/simple_cards/source/views/PictView-FlowExample-FileWriteInfo.js +0 -59
  127. package/example_applications/simple_cards/source/views/PictView-FlowExample-Layout.js +0 -90
  128. package/example_applications/simple_cards/source/views/PictView-FlowExample-MainWorkspace.js +0 -453
  129. package/example_applications/simple_cards/source/views/PictView-FlowExample-TopBar.js +0 -95
  130. package/scripts/generate-card-help.js +0 -214
  131. package/source/providers/edges/Edge-Bezier.js +0 -41
  132. package/source/providers/edges/Edge-Orthogonal.js +0 -37
  133. package/source/providers/edges/Edge-OrthogonalSnap.js +0 -72
  134. package/source/providers/edges/Edge-Perimeter-Linear.js +0 -31
  135. package/source/providers/edges/Edge-Perimeter-Orthogonal.js +0 -39
  136. package/source/providers/edges/Edge-Perimeter.js +0 -48
  137. package/source/providers/edges/Edge-PerimeterMath.js +0 -92
  138. package/source/providers/edges/Edge-Straight.js +0 -24
  139. package/source/providers/layouts/Layout-Circular.js +0 -203
  140. package/source/providers/layouts/Layout-Coerce.js +0 -40
  141. package/source/providers/layouts/Layout-Columnar.js +0 -134
  142. package/source/providers/layouts/Layout-Custom.js +0 -27
  143. package/source/providers/layouts/Layout-ForcedFromCenter.js +0 -256
  144. package/source/providers/layouts/Layout-Grid.js +0 -134
  145. package/source/providers/layouts/Layout-Layered.js +0 -155
  146. package/source/providers/layouts/Layout-Rank.js +0 -141
  147. package/source/providers/layouts/Layout-Staggered.js +0 -131
  148. package/source/providers/layouts/Layout-Tabular.js +0 -94
  149. package/test/ConnectionHandleManager_tests.js +0 -717
  150. package/test/ConnectionRenderer_tests.js +0 -591
  151. package/test/DataManager_tests.js +0 -859
  152. package/test/Geometry_tests.js +0 -767
  153. package/test/InteractionManager_tests.js +0 -279
  154. package/test/Layout_tests.js +0 -1604
  155. package/test/NodeView_tests.js +0 -66
  156. package/test/PanelManager_tests.js +0 -172
  157. package/test/PathGenerator_tests.js +0 -978
  158. package/test/PortRenderer_tests.js +0 -376
  159. package/test/RenderManager_tests.js +0 -756
  160. package/test/Renderer_tests.js +0 -133
  161. package/test/SelectionManager_tests.js +0 -185
  162. package/test/StylePresets_tests.js +0 -153
@@ -1,77 +0,0 @@
1
- const libPictView = require('pict-view');
2
-
3
- const _ViewConfiguration =
4
- {
5
- ViewIdentifier: "FlowExample-BottomBar",
6
-
7
- DefaultRenderable: "FlowExample-BottomBar-Content",
8
- DefaultDestinationAddress: "#FlowExample-BottomBar-Container",
9
-
10
- AutoRender: false,
11
-
12
- CSS: /*css*/`
13
- .flowexample-bottombar {
14
- display: flex;
15
- align-items: center;
16
- justify-content: space-between;
17
- background-color: #2c3e50;
18
- color: #7f8c8d;
19
- padding: 0.75em 1.5em;
20
- font-size: 0.8em;
21
- border-top: 1px solid #34495e;
22
- }
23
- .flowexample-bottombar a {
24
- color: #95a5a6;
25
- text-decoration: none;
26
- margin-left: 1em;
27
- transition: color 0.15s;
28
- }
29
- .flowexample-bottombar a:hover {
30
- color: #ecf0f1;
31
- }
32
- .flowexample-bottombar-links {
33
- display: flex;
34
- align-items: center;
35
- gap: 0.5em;
36
- }
37
- `,
38
-
39
- Templates:
40
- [
41
- {
42
- Hash: "FlowExample-BottomBar-Template",
43
- Template: /*html*/`
44
- <div class="flowexample-bottombar">
45
- <span>Pict Section Flow Example &copy; 2025</span>
46
- <div class="flowexample-bottombar-links">
47
- <a href="https://github.com/fable-retold/pict" target="_blank">Pict</a>
48
- <a href="https://github.com/fable-retold/fable" target="_blank">Fable</a>
49
- <a onclick="{~P~}.PictApplication.navigateTo('/About')">About</a>
50
- </div>
51
- </div>
52
- `
53
- }
54
- ],
55
-
56
- Renderables:
57
- [
58
- {
59
- RenderableHash: "FlowExample-BottomBar-Content",
60
- TemplateHash: "FlowExample-BottomBar-Template",
61
- DestinationAddress: "#FlowExample-BottomBar-Container",
62
- RenderMethod: "replace"
63
- }
64
- ]
65
- };
66
-
67
- class FlowExampleBottomBarView extends libPictView
68
- {
69
- constructor(pFable, pOptions, pServiceHash)
70
- {
71
- super(pFable, pOptions, pServiceHash);
72
- }
73
- }
74
-
75
- module.exports = FlowExampleBottomBarView;
76
-
77
- module.exports.default_configuration = _ViewConfiguration;
@@ -1,325 +0,0 @@
1
- const libPictView = require('pict-view');
2
-
3
- const _ViewConfiguration =
4
- {
5
- ViewIdentifier: "FlowExample-Documentation",
6
-
7
- DefaultRenderable: "FlowExample-Documentation-Content",
8
- DefaultDestinationAddress: "#FlowExample-Content-Container",
9
-
10
- AutoRender: false,
11
-
12
- CSS: /*css*/`
13
- .flowexample-docs {
14
- padding: 2em;
15
- max-width: 800px;
16
- margin: 0 auto;
17
- }
18
- .flowexample-docs-header {
19
- text-align: center;
20
- padding-bottom: 1.5em;
21
- border-bottom: 1px solid var(--theme-color-border-light, #eee);
22
- margin-bottom: 2em;
23
- }
24
- .flowexample-docs-header h1 {
25
- margin: 0 0 0.25em 0;
26
- font-size: 2em;
27
- font-weight: 300;
28
- color: #2c3e50;
29
- }
30
- .flowexample-docs-header p {
31
- margin: 0;
32
- color: #7f8c8d;
33
- font-size: 1.1em;
34
- }
35
- .flowexample-docs h2 {
36
- margin: 1.75em 0 0.5em 0;
37
- font-weight: 400;
38
- color: #2c3e50;
39
- font-size: 1.3em;
40
- border-bottom: 1px solid var(--theme-color-border-light, #eee);
41
- padding-bottom: 0.35em;
42
- }
43
- .flowexample-docs h3 {
44
- margin: 1.25em 0 0.35em 0;
45
- font-weight: 600;
46
- color: #34495e;
47
- font-size: 1.05em;
48
- }
49
- .flowexample-docs p {
50
- color: var(--theme-color-text-secondary, #555);
51
- line-height: 1.7;
52
- }
53
- .flowexample-docs code {
54
- background: #f4f4f5;
55
- padding: 0.15em 0.4em;
56
- border-radius: 3px;
57
- font-size: 0.9em;
58
- color: var(--theme-color-status-error, #e74c3c);
59
- }
60
- .flowexample-docs pre {
61
- background: #2c3e50;
62
- color: #ecf0f1;
63
- padding: 1.25em;
64
- border-radius: 6px;
65
- overflow-x: auto;
66
- line-height: 1.5;
67
- font-size: 0.9em;
68
- }
69
- .flowexample-docs pre code {
70
- background: none;
71
- padding: 0;
72
- color: #ecf0f1;
73
- }
74
- .flowexample-docs ul {
75
- color: var(--theme-color-text-secondary, #555);
76
- line-height: 1.8;
77
- padding-left: 1.5em;
78
- }
79
- .flowexample-docs-toc {
80
- background: #f8f9fa;
81
- border: 1px solid #e9ecef;
82
- border-radius: 6px;
83
- padding: 1.25em 1.5em;
84
- margin-bottom: 2em;
85
- }
86
- .flowexample-docs-toc h3 {
87
- margin: 0 0 0.5em 0;
88
- font-size: 0.95em;
89
- color: #2c3e50;
90
- }
91
- .flowexample-docs-toc ul {
92
- margin: 0;
93
- padding-left: 1.25em;
94
- line-height: 1.8;
95
- }
96
- .flowexample-docs-toc a {
97
- color: #3498db;
98
- text-decoration: none;
99
- }
100
- .flowexample-docs-toc a:hover {
101
- text-decoration: underline;
102
- }
103
- `,
104
-
105
- Templates:
106
- [
107
- {
108
- Hash: "FlowExample-Documentation-Template",
109
- Template: /*html*/`
110
- <div class="flowexample-docs">
111
- <div class="flowexample-docs-header">
112
- <h1>Documentation</h1>
113
- <p>How to use and extend the Pict Section Flow component</p>
114
- </div>
115
-
116
- <div class="flowexample-docs-toc">
117
- <h3>Contents</h3>
118
- <ul>
119
- <li><a href="#getting-started">Getting Started</a></li>
120
- <li><a href="#data-model">Data Model</a></li>
121
- <li><a href="#configuration">Configuration</a></li>
122
- <li><a href="#api-reference">API Reference</a></li>
123
- <li><a href="#node-types">Node Types</a></li>
124
- <li><a href="#event-hooks">Event Hooks</a></li>
125
- </ul>
126
- </div>
127
-
128
- <h2 id="getting-started">Getting Started</h2>
129
- <p>Pict Section Flow is a pict-view class that renders an interactive SVG flow diagram. Install it via npm and add it as a view in your Pict application.</p>
130
-
131
- <h3>Installation</h3>
132
- <pre><code>npm install pict-section-flow</code></pre>
133
-
134
- <h3>Basic Usage</h3>
135
- <pre><code>const libPictSectionFlow = require('pict-section-flow');
136
-
137
- // In your Pict application constructor:
138
- this.pict.addView('MyFlowDiagram',
139
- {
140
- ViewIdentifier: 'MyFlowDiagram',
141
- DefaultRenderable: 'Flow-Container',
142
- DefaultDestinationAddress: '#my-flow-container',
143
- FlowDataAddress: 'AppData.MyApp.FlowData',
144
- EnableToolbar: true
145
- },
146
- libPictSectionFlow
147
- );</code></pre>
148
-
149
- <p>The view reads its initial data from <code>FlowDataAddress</code> in AppData, and writes changes back via <code>marshalFromView()</code>.</p>
150
-
151
- <h2 id="data-model">Data Model</h2>
152
- <p>The flow data is a plain JSON object with three top-level properties:</p>
153
-
154
- <h3>Nodes</h3>
155
- <pre><code>{
156
- "Hash": "node-1",
157
- "Type": "default",
158
- "X": 100, "Y": 200,
159
- "Width": 180, "Height": 80,
160
- "Title": "My Node",
161
- "Ports": [
162
- { "Hash": "port-in-1", "Direction": "input",
163
- "Side": "left", "Label": "In" },
164
- { "Hash": "port-out-1", "Direction": "output",
165
- "Side": "right", "Label": "Out" }
166
- ],
167
- "Data": {}
168
- }</code></pre>
169
-
170
- <h3>Connections</h3>
171
- <pre><code>{
172
- "Hash": "conn-1",
173
- "SourceNodeHash": "node-1",
174
- "SourcePortHash": "port-out-1",
175
- "TargetNodeHash": "node-2",
176
- "TargetPortHash": "port-in-1",
177
- "Data": {}
178
- }</code></pre>
179
-
180
- <h3>ViewState</h3>
181
- <pre><code>{
182
- "PanX": 0, "PanY": 0,
183
- "Zoom": 1,
184
- "SelectedNodeHash": null,
185
- "SelectedConnectionHash": null
186
- }</code></pre>
187
-
188
- <h2 id="configuration">Configuration</h2>
189
- <p>These options can be passed when adding the view:</p>
190
- <ul>
191
- <li><code>FlowDataAddress</code> &mdash; Manifest address for flow data in AppData</li>
192
- <li><code>EnableToolbar</code> &mdash; Show the toolbar (default: <code>true</code>)</li>
193
- <li><code>EnablePanning</code> &mdash; Allow background pan (default: <code>true</code>)</li>
194
- <li><code>EnableZooming</code> &mdash; Allow mouse wheel zoom (default: <code>true</code>)</li>
195
- <li><code>EnableNodeDragging</code> &mdash; Allow node drag-and-drop (default: <code>true</code>)</li>
196
- <li><code>EnableConnectionCreation</code> &mdash; Allow port-to-port connection creation (default: <code>true</code>)</li>
197
- <li><code>EnableGridSnap</code> &mdash; Snap node positions to grid (default: <code>false</code>)</li>
198
- <li><code>GridSnapSize</code> &mdash; Grid size in pixels (default: <code>20</code>)</li>
199
- <li><code>MinZoom</code> / <code>MaxZoom</code> &mdash; Zoom limits (default: <code>0.1</code> / <code>5.0</code>)</li>
200
- <li><code>ZoomStep</code> &mdash; Zoom increment per wheel tick (default: <code>0.1</code>)</li>
201
- </ul>
202
-
203
- <h2 id="api-reference">API Reference</h2>
204
-
205
- <h3>Node Operations</h3>
206
- <ul>
207
- <li><code>addNode(type, x, y, title, data)</code> &mdash; Add a new node</li>
208
- <li><code>removeNode(hash)</code> &mdash; Remove a node and its connections</li>
209
- <li><code>getNode(hash)</code> &mdash; Get a node by hash</li>
210
- <li><code>selectNode(hash)</code> &mdash; Select a node</li>
211
- </ul>
212
-
213
- <h3>Connection Operations</h3>
214
- <ul>
215
- <li><code>addConnection(srcNode, srcPort, tgtNode, tgtPort)</code> &mdash; Add a connection</li>
216
- <li><code>removeConnection(hash)</code> &mdash; Remove a connection</li>
217
- <li><code>getConnection(hash)</code> &mdash; Get a connection by hash</li>
218
- <li><code>selectConnection(hash)</code> &mdash; Select a connection</li>
219
- </ul>
220
-
221
- <h3>View Operations</h3>
222
- <ul>
223
- <li><code>renderFlow()</code> &mdash; Re-render the entire diagram</li>
224
- <li><code>setFlowData(data)</code> &mdash; Replace flow data and re-render</li>
225
- <li><code>getFlowData()</code> &mdash; Get a deep copy of the flow data</li>
226
- <li><code>marshalToView()</code> &mdash; Load data from AppData into the view</li>
227
- <li><code>marshalFromView()</code> &mdash; Write view data back to AppData</li>
228
- <li><code>deselectAll()</code> &mdash; Clear all selections</li>
229
- <li><code>deleteSelected()</code> &mdash; Delete the selected node or connection</li>
230
- </ul>
231
-
232
- <h3>Viewport Operations</h3>
233
- <ul>
234
- <li><code>setZoom(level, focusX, focusY)</code> &mdash; Set zoom level</li>
235
- <li><code>zoomToFit()</code> &mdash; Fit all nodes in view</li>
236
- <li><code>autoLayout()</code> &mdash; Auto-arrange nodes left to right</li>
237
- <li><code>screenToSVGCoords(x, y)</code> &mdash; Convert screen to SVG coordinates</li>
238
- </ul>
239
-
240
- <h2 id="node-types">Node Types</h2>
241
- <p>Four built-in node types are provided:</p>
242
- <ul>
243
- <li><code>default</code> &mdash; Standard rectangular node with input and output ports</li>
244
- <li><code>start</code> &mdash; Rounded green node with output port only</li>
245
- <li><code>end</code> &mdash; Rounded red node with input port only</li>
246
- <li><code>decision</code> &mdash; Yellow node with one input and two outputs (Yes/No)</li>
247
- </ul>
248
-
249
- <h3>Registering Custom Types</h3>
250
- <pre><code>// After the flow view is rendered:
251
- flowView._NodeTypeProvider.registerNodeType({
252
- Hash: 'custom-process',
253
- Label: 'Custom Process',
254
- DefaultWidth: 200,
255
- DefaultHeight: 100,
256
- DefaultPorts: [
257
- { Direction: 'input', Side: 'left', Label: 'In' },
258
- { Direction: 'output', Side: 'right', Label: 'Out' },
259
- { Direction: 'output', Side: 'bottom', Label: 'Error' }
260
- ],
261
- TitleBarColor: '#8e44ad',
262
- BodyStyle: {
263
- fill: '#f5eef8',
264
- stroke: '#8e44ad'
265
- }
266
- });</code></pre>
267
-
268
- <h2 id="event-hooks">Event Hooks</h2>
269
- <p>Register handlers for flow events through the Event Handler Provider:</p>
270
- <pre><code>flowView._EventHandlerProvider.registerHandler(
271
- 'onNodeMoved',
272
- (node, flowView) => {
273
- console.log('Node moved:', node.Title,
274
- 'to', node.X, node.Y);
275
- }
276
- );
277
-
278
- // Available events:
279
- // onNodeSelected, onNodeAdded, onNodeRemoved,
280
- // onNodeMoved, onConnectionSelected,
281
- // onConnectionCreated, onConnectionRemoved,
282
- // onFlowChanged</code></pre>
283
-
284
- <h2>Project Structure</h2>
285
- <pre><code>pict-section-flow/
286
- source/
287
- Pict-Section-Flow.js # Module entry
288
- views/
289
- PictView-Flow.js # Main SVG view
290
- PictView-Flow-Node.js # Node rendering
291
- PictView-Flow-Toolbar.js # Toolbar controls
292
- services/
293
- ...InteractionManager.js # Pointer events
294
- ...ConnectionRenderer.js # Bezier paths
295
- ...Layout.js # Auto-layout
296
- providers/
297
- ...NodeTypes.js # Node type registry
298
- ...EventHandler.js # Event hooks</code></pre>
299
- </div>
300
- `
301
- }
302
- ],
303
-
304
- Renderables:
305
- [
306
- {
307
- RenderableHash: "FlowExample-Documentation-Content",
308
- TemplateHash: "FlowExample-Documentation-Template",
309
- DestinationAddress: "#FlowExample-Content-Container",
310
- RenderMethod: "replace"
311
- }
312
- ]
313
- };
314
-
315
- class FlowExampleDocumentationView extends libPictView
316
- {
317
- constructor(pFable, pOptions, pServiceHash)
318
- {
319
- super(pFable, pOptions, pServiceHash);
320
- }
321
- }
322
-
323
- module.exports = FlowExampleDocumentationView;
324
-
325
- module.exports.default_configuration = _ViewConfiguration;
@@ -1,59 +0,0 @@
1
- const libPictView = require('pict-view');
2
-
3
- const _ViewConfiguration =
4
- {
5
- ViewIdentifier: "FlowExample-FileWriteInfo",
6
-
7
- DefaultRenderable: "FileWriteInfo-Content",
8
- DefaultDestinationAddress: "#FileWriteInfo-Container",
9
-
10
- AutoRender: false,
11
-
12
- Templates:
13
- [
14
- {
15
- Hash: "FileWriteInfo-Template",
16
- Template: /*html*/`
17
- <div style="padding:6px;font-size:12px;line-height:1.6;color:#2c3e50">
18
- <div style="margin-bottom:8px">
19
- <label style="font-weight:600;font-size:11px;color:#7f8c8d;text-transform:uppercase;letter-spacing:0.5px">Output Path</label>
20
- <div style="padding:4px 6px;background:#f8f9fa;border:1px solid var(--theme-color-border-default, #e0e0e0);border-radius:3px;margin-top:2px;font-family:monospace;font-size:11px">{~D:Record.Data.OutputPath~}</div>
21
- </div>
22
- <div style="margin-bottom:8px">
23
- <label style="font-weight:600;font-size:11px;color:#7f8c8d;text-transform:uppercase;letter-spacing:0.5px">Write Mode</label>
24
- <div style="padding:4px 6px;background:#f8f9fa;border:1px solid var(--theme-color-border-default, #e0e0e0);border-radius:3px;margin-top:2px">{~D:Record.Data.WriteMode~}</div>
25
- </div>
26
- <div style="margin-bottom:8px">
27
- <label style="font-weight:600;font-size:11px;color:#7f8c8d;text-transform:uppercase;letter-spacing:0.5px">Encoding</label>
28
- <div style="padding:4px 6px;background:#f8f9fa;border:1px solid var(--theme-color-border-default, #e0e0e0);border-radius:3px;margin-top:2px">{~D:Record.Data.Encoding~}</div>
29
- </div>
30
- <div style="padding:6px;background:#eafaf1;border:1px solid var(--theme-color-status-success, #27ae60);border-radius:3px;font-size:11px;color:var(--theme-color-status-success, #27ae60)">
31
- This panel is rendered by a registered pict-view (View panel type).
32
- </div>
33
- </div>
34
- `
35
- }
36
- ],
37
-
38
- Renderables:
39
- [
40
- {
41
- RenderableHash: "FileWriteInfo-Content",
42
- TemplateHash: "FileWriteInfo-Template",
43
- DestinationAddress: "#FileWriteInfo-Container",
44
- RenderMethod: "replace"
45
- }
46
- ]
47
- };
48
-
49
- class FlowExampleFileWriteInfoView extends libPictView
50
- {
51
- constructor(pFable, pOptions, pServiceHash)
52
- {
53
- super(pFable, pOptions, pServiceHash);
54
- }
55
- }
56
-
57
- module.exports = FlowExampleFileWriteInfoView;
58
-
59
- module.exports.default_configuration = _ViewConfiguration;
@@ -1,90 +0,0 @@
1
- const libPictView = require('pict-view');
2
-
3
- const _ViewConfiguration =
4
- {
5
- ViewIdentifier: "FlowExample-Layout",
6
-
7
- DefaultRenderable: "FlowExample-Layout-Shell",
8
- DefaultDestinationAddress: "#FlowExample-Application-Container",
9
-
10
- AutoRender: false,
11
-
12
- CSS: /*css*/`
13
- #FlowExample-Application-Container {
14
- display: flex;
15
- flex-direction: column;
16
- height: 100vh;
17
- overflow: hidden;
18
- }
19
- #FlowExample-TopBar-Container {
20
- flex-shrink: 0;
21
- }
22
- #FlowExample-Content-Container {
23
- flex: 1;
24
- display: flex;
25
- flex-direction: column;
26
- min-height: 0;
27
- }
28
- #FlowExample-BottomBar-Container {
29
- flex-shrink: 0;
30
- }
31
- `,
32
-
33
- Templates:
34
- [
35
- {
36
- Hash: "FlowExample-Layout-Shell-Template",
37
- Template: /*html*/`
38
- <div id="FlowExample-TopBar-Container"></div>
39
- <div id="FlowExample-Content-Container"></div>
40
- <div id="FlowExample-BottomBar-Container"></div>
41
- `
42
- }
43
- ],
44
-
45
- Renderables:
46
- [
47
- {
48
- RenderableHash: "FlowExample-Layout-Shell",
49
- TemplateHash: "FlowExample-Layout-Shell-Template",
50
- DestinationAddress: "#FlowExample-Application-Container",
51
- RenderMethod: "replace"
52
- }
53
- ]
54
- };
55
-
56
- class FlowExampleLayoutView extends libPictView
57
- {
58
- constructor(pFable, pOptions, pServiceHash)
59
- {
60
- super(pFable, pOptions, pServiceHash);
61
- }
62
-
63
- onAfterRender(pRenderable, pRenderDestinationAddress, pRecord, pContent)
64
- {
65
- // After the layout shell is rendered, render the child views into their containers
66
- this.pict.views['FlowExample-TopBar'].render();
67
- this.pict.views['FlowExample-BottomBar'].render();
68
-
69
- // Render initial content -- the main workspace by default
70
- this.pict.views['FlowExample-MainWorkspace'].render();
71
-
72
- // Inject all view CSS into the PICT-CSS style element.
73
- // This must be called after ALL views are rendered (including the flow view
74
- // which is created inside MainWorkspace's onAfterRender) so that all CSS
75
- // registered via addCSS() during view construction is included.
76
- this.pict.CSSMap.injectCSS();
77
-
78
- // Now resolve the router so it picks up the current hash URL
79
- if (this.pict.providers.PictRouter)
80
- {
81
- this.pict.providers.PictRouter.resolve();
82
- }
83
-
84
- return super.onAfterRender(pRenderable, pRenderDestinationAddress, pRecord, pContent);
85
- }
86
- }
87
-
88
- module.exports = FlowExampleLayoutView;
89
-
90
- module.exports.default_configuration = _ViewConfiguration;