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,376 +0,0 @@
1
- const libFable = require('fable');
2
- const libChai = require('chai');
3
- const libExpect = libChai.expect;
4
-
5
- const libPortRenderer = require('../source/services/PictService-Flow-PortRenderer.js');
6
- const libGeometry = require('../source/providers/PictProvider-Flow-Geometry.js');
7
-
8
- suite
9
- (
10
- 'PictService-Flow-PortRenderer',
11
- function ()
12
- {
13
- let _Fable;
14
- let _PortRenderer;
15
- let _GeometryProvider;
16
- let _MockFlowView;
17
-
18
- // Simple mock SVG element for testing
19
- function createMockSVGElement()
20
- {
21
- let tmpSelf =
22
- {
23
- _tag: '',
24
- _attrs: {},
25
- _children: [],
26
- textContent: '',
27
- setAttribute: function (pKey, pVal)
28
- {
29
- tmpSelf._attrs[pKey] = pVal;
30
- },
31
- getAttribute: function (pKey)
32
- {
33
- return tmpSelf._attrs[pKey] || null;
34
- },
35
- appendChild: function (pChild)
36
- {
37
- tmpSelf._children.push(pChild);
38
- }
39
- };
40
- return tmpSelf;
41
- }
42
-
43
- setup
44
- (
45
- function ()
46
- {
47
- _Fable = new libFable({});
48
-
49
- _GeometryProvider = new libGeometry(_Fable, {}, 'Geometry-Test');
50
-
51
- _MockFlowView =
52
- {
53
- _GeometryProvider: _GeometryProvider,
54
- _ConnectorShapesProvider: null,
55
- _SVGHelperProvider:
56
- {
57
- createSVGElement: function (pTag)
58
- {
59
- let tmpEl = createMockSVGElement();
60
- tmpEl._tag = pTag;
61
- return tmpEl;
62
- }
63
- }
64
- };
65
-
66
- _PortRenderer = new libPortRenderer(
67
- _Fable, { FlowView: _MockFlowView }, 'PortRend-Test');
68
- }
69
- );
70
-
71
- // ---- Constructor ----
72
-
73
- suite
74
- (
75
- 'Constructor',
76
- function ()
77
- {
78
- test
79
- (
80
- 'should instantiate with correct serviceType',
81
- function (fDone)
82
- {
83
- libExpect(_PortRenderer.serviceType).to.equal('PictServiceFlowPortRenderer');
84
- fDone();
85
- }
86
- );
87
-
88
- test
89
- (
90
- 'should store FlowView reference',
91
- function (fDone)
92
- {
93
- libExpect(_PortRenderer._FlowView).to.equal(_MockFlowView);
94
- fDone();
95
- }
96
- );
97
-
98
- test
99
- (
100
- 'should handle missing FlowView',
101
- function (fDone)
102
- {
103
- let tmpRenderer = new libPortRenderer(_Fable, {}, 'NoView');
104
- libExpect(tmpRenderer._FlowView).to.be.null;
105
- fDone();
106
- }
107
- );
108
- }
109
- );
110
-
111
- // ---- renderPorts ----
112
-
113
- suite
114
- (
115
- 'renderPorts',
116
- function ()
117
- {
118
- test
119
- (
120
- 'should render port circles into the group',
121
- function (fDone)
122
- {
123
- let tmpGroup = createMockSVGElement();
124
- let tmpNodeData =
125
- {
126
- Hash: 'node-1',
127
- Ports:
128
- [
129
- { Hash: 'p1', Direction: 'input', Label: null },
130
- { Hash: 'p2', Direction: 'output', Label: null }
131
- ]
132
- };
133
-
134
- _PortRenderer.renderPorts(tmpNodeData, tmpGroup, 180, 80, null, 22);
135
-
136
- // Should have appended port circle elements
137
- libExpect(tmpGroup._children.length).to.be.at.least(2);
138
-
139
- // Verify at least one circle element was created
140
- let tmpCircles = tmpGroup._children.filter(function (pChild)
141
- {
142
- return pChild._tag === 'circle';
143
- });
144
- libExpect(tmpCircles.length).to.equal(2);
145
- fDone();
146
- }
147
- );
148
-
149
- test
150
- (
151
- 'should render port labels when Label is set',
152
- function (fDone)
153
- {
154
- let tmpGroup = createMockSVGElement();
155
- let tmpNodeData =
156
- {
157
- Hash: 'node-2',
158
- Ports:
159
- [
160
- { Hash: 'p1', Direction: 'input', Label: 'Trigger' }
161
- ]
162
- };
163
-
164
- _PortRenderer.renderPorts(tmpNodeData, tmpGroup, 180, 80, null, 22);
165
-
166
- // Direct children: badge wrapper <g> (containing bg + border + stripe),
167
- // port circle, text label = 3 elements.
168
- libExpect(tmpGroup._children.length).to.equal(3);
169
-
170
- // The badge wrapper itself contains the 3 sub-elements.
171
- let tmpBadgeGroups = tmpGroup._children.filter(function (pChild)
172
- {
173
- return pChild._tag === 'g';
174
- });
175
- libExpect(tmpBadgeGroups.length).to.equal(1);
176
- libExpect(tmpBadgeGroups[0]._children.length).to.equal(3);
177
-
178
- // Verify text element exists with correct content
179
- let tmpTextEls = tmpGroup._children.filter(function (pChild)
180
- {
181
- return pChild._tag === 'text';
182
- });
183
- libExpect(tmpTextEls.length).to.equal(1);
184
- libExpect(tmpTextEls[0].textContent).to.equal('Trigger');
185
- fDone();
186
- }
187
- );
188
-
189
- test
190
- (
191
- 'should do nothing for empty ports array',
192
- function (fDone)
193
- {
194
- let tmpGroup = createMockSVGElement();
195
- let tmpNodeData = { Hash: 'node-3', Ports: [] };
196
-
197
- _PortRenderer.renderPorts(tmpNodeData, tmpGroup, 180, 80, null, 22);
198
-
199
- libExpect(tmpGroup._children.length).to.equal(0);
200
- fDone();
201
- }
202
- );
203
-
204
- test
205
- (
206
- 'should do nothing when Ports is missing',
207
- function (fDone)
208
- {
209
- let tmpGroup = createMockSVGElement();
210
- let tmpNodeData = { Hash: 'node-4' };
211
-
212
- _PortRenderer.renderPorts(tmpNodeData, tmpGroup, 180, 80, null, 22);
213
-
214
- libExpect(tmpGroup._children.length).to.equal(0);
215
- fDone();
216
- }
217
- );
218
-
219
- test
220
- (
221
- 'should do nothing when no FlowView',
222
- function (fDone)
223
- {
224
- let tmpRenderer = new libPortRenderer(_Fable, {}, 'NoView');
225
- let tmpGroup = createMockSVGElement();
226
- let tmpNodeData =
227
- {
228
- Hash: 'node-5',
229
- Ports: [{ Hash: 'p1', Direction: 'input' }]
230
- };
231
-
232
- tmpRenderer.renderPorts(tmpNodeData, tmpGroup, 180, 80, null, 22);
233
- libExpect(tmpGroup._children.length).to.equal(0);
234
- fDone();
235
- }
236
- );
237
-
238
- test
239
- (
240
- 'should use ConnectorShapesProvider when available',
241
- function (fDone)
242
- {
243
- let tmpCreatePortCalled = false;
244
- _MockFlowView._ConnectorShapesProvider =
245
- {
246
- createPortElement: function (pPort, pPos, pNodeHash)
247
- {
248
- tmpCreatePortCalled = true;
249
- let tmpEl = createMockSVGElement();
250
- tmpEl._tag = 'circle';
251
- return tmpEl;
252
- }
253
- };
254
-
255
- let tmpGroup = createMockSVGElement();
256
- let tmpNodeData =
257
- {
258
- Hash: 'node-6',
259
- Ports: [{ Hash: 'p1', Direction: 'input' }]
260
- };
261
-
262
- _PortRenderer.renderPorts(tmpNodeData, tmpGroup, 180, 80, null, 22);
263
- libExpect(tmpCreatePortCalled).to.be.true;
264
-
265
- // Clean up
266
- _MockFlowView._ConnectorShapesProvider = null;
267
- fDone();
268
- }
269
- );
270
-
271
- test
272
- (
273
- 'should set port-type data attribute when PortType is set',
274
- function (fDone)
275
- {
276
- let tmpGroup = createMockSVGElement();
277
- let tmpNodeData =
278
- {
279
- Hash: 'node-7',
280
- Ports:
281
- [
282
- { Hash: 'p1', Direction: 'input', PortType: 'event-in' }
283
- ]
284
- };
285
-
286
- _PortRenderer.renderPorts(tmpNodeData, tmpGroup, 180, 80, null, 22);
287
-
288
- let tmpCircles = tmpGroup._children.filter(function (pChild)
289
- {
290
- return pChild._tag === 'circle';
291
- });
292
- libExpect(tmpCircles.length).to.equal(1);
293
- libExpect(tmpCircles[0]._attrs['data-port-type']).to.equal('event-in');
294
- fDone();
295
- }
296
- );
297
-
298
- test
299
- (
300
- 'should group ports by Side value',
301
- function (fDone)
302
- {
303
- let tmpGroup = createMockSVGElement();
304
- let tmpNodeData =
305
- {
306
- Hash: 'node-8',
307
- Ports:
308
- [
309
- { Hash: 'p1', Direction: 'input', Side: 'left' },
310
- { Hash: 'p2', Direction: 'input', Side: 'left' },
311
- { Hash: 'p3', Direction: 'output', Side: 'right' },
312
- { Hash: 'p4', Direction: 'output', Side: 'bottom' }
313
- ]
314
- };
315
-
316
- _PortRenderer.renderPorts(tmpNodeData, tmpGroup, 180, 80, null, 22);
317
-
318
- let tmpCircles = tmpGroup._children.filter(function (pChild)
319
- {
320
- return pChild._tag === 'circle';
321
- });
322
- libExpect(tmpCircles.length).to.equal(4);
323
- fDone();
324
- }
325
- );
326
- }
327
- );
328
-
329
- // ---- getPortLocalPosition ----
330
-
331
- suite
332
- (
333
- 'getPortLocalPosition',
334
- function ()
335
- {
336
- test
337
- (
338
- 'should delegate to GeometryProvider',
339
- function (fDone)
340
- {
341
- let tmpPos = _PortRenderer.getPortLocalPosition('left', 0, 1, 180, 80, 22, {});
342
-
343
- libExpect(tmpPos).to.have.property('x');
344
- libExpect(tmpPos).to.have.property('y');
345
- libExpect(tmpPos.x).to.equal(0); // left edge
346
- fDone();
347
- }
348
- );
349
-
350
- test
351
- (
352
- 'should return right edge position',
353
- function (fDone)
354
- {
355
- let tmpPos = _PortRenderer.getPortLocalPosition('right', 0, 1, 180, 80, 22, {});
356
-
357
- libExpect(tmpPos.x).to.equal(180); // right edge
358
- fDone();
359
- }
360
- );
361
-
362
- test
363
- (
364
- 'should pass title bar height correctly',
365
- function (fDone)
366
- {
367
- // Port should be below the title bar
368
- let tmpPos = _PortRenderer.getPortLocalPosition('left', 0, 1, 180, 80, 22, {});
369
- libExpect(tmpPos.y).to.be.greaterThan(22);
370
- fDone();
371
- }
372
- );
373
- }
374
- );
375
- }
376
- );