pict-section-flow 1.4.0 → 2.0.1

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 (164) 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 +73 -7
  5. package/source/providers/PictProvider-Flow-Geometry.js +11 -421
  6. package/source/providers/PictProvider-Flow-Icons.js +12 -0
  7. package/source/providers/PictProvider-Flow-Layouts.js +107 -0
  8. package/source/services/PictService-Flow-ConnectionRenderer.js +1 -1
  9. package/source/services/PictService-Flow-CursorManager.js +113 -0
  10. package/source/services/PictService-Flow-InteractionManager.js +439 -59
  11. package/source/services/PictService-Flow-Layout.js +21 -16
  12. package/source/services/PictService-Flow-PathGenerator.js +30 -417
  13. package/source/services/PictService-Flow-RenderManager.js +23 -3
  14. package/source/services/PictService-Flow-ViewportManager.js +102 -0
  15. package/source/views/PictView-Flow-FloatingToolbar.js +5 -1
  16. package/source/views/PictView-Flow-Node.js +29 -0
  17. package/source/views/PictView-Flow-Toolbar.js +50 -3
  18. package/source/views/PictView-Flow.js +591 -2
  19. package/.claude/launch.json +0 -11
  20. package/docs/.nojekyll +0 -0
  21. package/docs/Architecture.md +0 -163
  22. package/docs/Custom-Styling.md +0 -275
  23. package/docs/Data_Model.md +0 -149
  24. package/docs/Event_System.md +0 -156
  25. package/docs/Getting_Started.md +0 -237
  26. package/docs/Implementation_Reference.md +0 -528
  27. package/docs/Layout_Persistence.md +0 -117
  28. package/docs/README.md +0 -103
  29. package/docs/Theme_Integration.md +0 -150
  30. package/docs/_brand.json +0 -18
  31. package/docs/_cover.md +0 -17
  32. package/docs/_playground.json +0 -24
  33. package/docs/_sidebar.md +0 -57
  34. package/docs/_topbar.md +0 -8
  35. package/docs/_version.json +0 -7
  36. package/docs/api/PictFlowCard.md +0 -216
  37. package/docs/api/PictFlowCardPropertiesPanel.md +0 -235
  38. package/docs/api/addConnection.md +0 -101
  39. package/docs/api/addNode.md +0 -137
  40. package/docs/api/autoLayout.md +0 -77
  41. package/docs/api/getFlowData.md +0 -112
  42. package/docs/api/marshalToView.md +0 -95
  43. package/docs/api/openPanel.md +0 -128
  44. package/docs/api/registerHandler.md +0 -174
  45. package/docs/api/registerNodeType.md +0 -142
  46. package/docs/api/removeConnection.md +0 -57
  47. package/docs/api/removeNode.md +0 -80
  48. package/docs/api/saveLayout.md +0 -152
  49. package/docs/api/screenToSVGCoords.md +0 -68
  50. package/docs/api/selectNode.md +0 -116
  51. package/docs/api/setTheme.md +0 -168
  52. package/docs/api/setZoom.md +0 -97
  53. package/docs/api/toggleFullscreen.md +0 -68
  54. package/docs/card-help/EACH.md +0 -19
  55. package/docs/card-help/FREAD.md +0 -24
  56. package/docs/card-help/FWRITE.md +0 -24
  57. package/docs/card-help/GET.md +0 -22
  58. package/docs/card-help/ITE.md +0 -23
  59. package/docs/card-help/LOG.md +0 -23
  60. package/docs/card-help/NOTE.md +0 -17
  61. package/docs/card-help/PREV.md +0 -18
  62. package/docs/card-help/SET.md +0 -27
  63. package/docs/card-help/SPKL.md +0 -22
  64. package/docs/card-help/STAT.md +0 -23
  65. package/docs/card-help/SW.md +0 -25
  66. package/docs/diagrams/architecture-at-a-glance.excalidraw +0 -4270
  67. package/docs/diagrams/architecture-at-a-glance.mmd +0 -30
  68. package/docs/diagrams/architecture-at-a-glance.svg +0 -2
  69. package/docs/diagrams/data-flow.excalidraw +0 -1451
  70. package/docs/diagrams/data-flow.mmd +0 -17
  71. package/docs/diagrams/data-flow.svg +0 -2
  72. package/docs/diagrams/high-level-design.excalidraw +0 -5767
  73. package/docs/diagrams/high-level-design.mmd +0 -86
  74. package/docs/diagrams/high-level-design.svg +0 -2
  75. package/docs/diagrams/relationships.excalidraw +0 -3852
  76. package/docs/diagrams/relationships.mmd +0 -9
  77. package/docs/diagrams/relationships.svg +0 -2
  78. package/docs/diagrams/service-initialization-sequence.excalidraw +0 -1466
  79. package/docs/diagrams/service-initialization-sequence.mmd +0 -19
  80. package/docs/diagrams/service-initialization-sequence.svg +0 -2
  81. package/docs/diagrams/svg-layer-structure.excalidraw +0 -1060
  82. package/docs/diagrams/svg-layer-structure.mmd +0 -18
  83. package/docs/diagrams/svg-layer-structure.svg +0 -2
  84. package/docs/examples/README.md +0 -9
  85. package/docs/examples/simple_cards/README.md +0 -677
  86. package/docs/examples/simple_cards/css/flowexample.css +0 -65
  87. package/docs/examples/simple_cards/index.html +0 -32
  88. package/docs/examples/simple_cards/js/pict.min.js +0 -12
  89. package/docs/examples/simple_cards/pict-section-flow-example-simple-cards.compatible.min.js +0 -1
  90. package/docs/index.html +0 -38
  91. package/docs/playground/app.json +0 -6
  92. package/docs/playground/appdata.json +0 -85
  93. package/docs/playground/application.js +0 -23
  94. package/docs/playground/pict.json +0 -17
  95. package/docs/playground/runtime/pict-application.min.js +0 -2
  96. package/docs/playground/runtime/pict-section-flow.min.js +0 -2
  97. package/docs/playground/runtime/pict-section-modal.min.js +0 -2
  98. package/docs/playground/runtime/pict.min.js +0 -12
  99. package/docs/retold-catalog.json +0 -244
  100. package/docs/retold-keyword-index.json +0 -26028
  101. package/example_applications/simple_cards/css/flowexample.css +0 -65
  102. package/example_applications/simple_cards/html/index.html +0 -32
  103. package/example_applications/simple_cards/package.json +0 -52
  104. package/example_applications/simple_cards/source/Pict-Application-FlowExample-Configuration.json +0 -15
  105. package/example_applications/simple_cards/source/Pict-Application-FlowExample.js +0 -539
  106. package/example_applications/simple_cards/source/card-help-content.js +0 -16
  107. package/example_applications/simple_cards/source/cards/FlowCard-Comment.js +0 -38
  108. package/example_applications/simple_cards/source/cards/FlowCard-DataPreview.js +0 -44
  109. package/example_applications/simple_cards/source/cards/FlowCard-Each.js +0 -38
  110. package/example_applications/simple_cards/source/cards/FlowCard-FileRead.js +0 -56
  111. package/example_applications/simple_cards/source/cards/FlowCard-FileWrite.js +0 -50
  112. package/example_applications/simple_cards/source/cards/FlowCard-GetValue.js +0 -37
  113. package/example_applications/simple_cards/source/cards/FlowCard-IfThenElse.js +0 -49
  114. package/example_applications/simple_cards/source/cards/FlowCard-LogValues.js +0 -55
  115. package/example_applications/simple_cards/source/cards/FlowCard-SetValue.js +0 -97
  116. package/example_applications/simple_cards/source/cards/FlowCard-Sparkline.js +0 -100
  117. package/example_applications/simple_cards/source/cards/FlowCard-StatusMonitor.js +0 -46
  118. package/example_applications/simple_cards/source/cards/FlowCard-Switch.js +0 -39
  119. package/example_applications/simple_cards/source/providers/PictRouter-FlowExample-Configuration.json +0 -22
  120. package/example_applications/simple_cards/source/sample-flows.js +0 -410
  121. package/example_applications/simple_cards/source/views/PictView-FlowExample-About.js +0 -184
  122. package/example_applications/simple_cards/source/views/PictView-FlowExample-BottomBar.js +0 -77
  123. package/example_applications/simple_cards/source/views/PictView-FlowExample-Documentation.js +0 -325
  124. package/example_applications/simple_cards/source/views/PictView-FlowExample-FileWriteInfo.js +0 -59
  125. package/example_applications/simple_cards/source/views/PictView-FlowExample-Layout.js +0 -90
  126. package/example_applications/simple_cards/source/views/PictView-FlowExample-MainWorkspace.js +0 -453
  127. package/example_applications/simple_cards/source/views/PictView-FlowExample-TopBar.js +0 -95
  128. package/scripts/generate-card-help.js +0 -214
  129. package/source/providers/edges/Edge-Bezier.js +0 -41
  130. package/source/providers/edges/Edge-Orthogonal.js +0 -37
  131. package/source/providers/edges/Edge-OrthogonalSnap.js +0 -72
  132. package/source/providers/edges/Edge-Perimeter-Linear.js +0 -31
  133. package/source/providers/edges/Edge-Perimeter-Orthogonal.js +0 -39
  134. package/source/providers/edges/Edge-Perimeter.js +0 -48
  135. package/source/providers/edges/Edge-PerimeterMath.js +0 -92
  136. package/source/providers/edges/Edge-Straight.js +0 -24
  137. package/source/providers/layouts/Layout-Circular.js +0 -203
  138. package/source/providers/layouts/Layout-Coerce.js +0 -40
  139. package/source/providers/layouts/Layout-Columnar.js +0 -134
  140. package/source/providers/layouts/Layout-Custom.js +0 -27
  141. package/source/providers/layouts/Layout-ForcedFromCenter.js +0 -256
  142. package/source/providers/layouts/Layout-Grid.js +0 -134
  143. package/source/providers/layouts/Layout-Layered.js +0 -155
  144. package/source/providers/layouts/Layout-Rank.js +0 -141
  145. package/source/providers/layouts/Layout-Staggered.js +0 -131
  146. package/source/providers/layouts/Layout-Tabular.js +0 -94
  147. package/test/CardPalette_tests.js +0 -43
  148. package/test/ConnectionHandleManager_tests.js +0 -717
  149. package/test/ConnectionRenderer_tests.js +0 -591
  150. package/test/ConnectionStyle_tests.js +0 -90
  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
  163. package/test/ToolbarExtraButtons_tests.js +0 -138
  164. package/test/UndirectedConnections_tests.js +0 -70
@@ -1,66 +0,0 @@
1
- const libChai = require('chai');
2
- const libExpect = libChai.expect;
3
-
4
- const libPictViewFlowNode = require('../source/views/PictView-Flow-Node.js');
5
-
6
- suite('PictView-Flow-Node',
7
- function ()
8
- {
9
- // The title-bar bottom strip squares off the title bar's lower corners. The regression it guards
10
- // against: a corner radius larger than the title bar made the strip taller than the whole title
11
- // bar, so it painted over the rounded TOP corners and the card read as square on top (only the
12
- // bottom rounded). See titleBarBottomStripHeight.
13
- suite('titleBarBottomStripHeight',
14
- function ()
15
- {
16
- test('never exceeds half the title bar height, even for a capsule radius',
17
- function ()
18
- {
19
- // radius 24 on a 22px title bar must not produce a 24px strip (which would cover the top)
20
- libExpect(libPictViewFlowNode.titleBarBottomStripHeight(24, 22)).to.equal(11);
21
- libExpect(libPictViewFlowNode.titleBarBottomStripHeight(100, 30)).to.equal(15);
22
- });
23
-
24
- test('covers small radii with the 8px floor',
25
- function ()
26
- {
27
- libExpect(libPictViewFlowNode.titleBarBottomStripHeight(5, 22)).to.equal(8);
28
- libExpect(libPictViewFlowNode.titleBarBottomStripHeight(0, 22)).to.equal(8);
29
- });
30
-
31
- test('treats a null/absent radius as no override (8px floor)',
32
- function ()
33
- {
34
- libExpect(libPictViewFlowNode.titleBarBottomStripHeight(null, 22)).to.equal(8);
35
- libExpect(libPictViewFlowNode.titleBarBottomStripHeight(undefined, 22)).to.equal(8);
36
- });
37
-
38
- test('the strip is always at most the title bar height for any radius',
39
- function ()
40
- {
41
- let tmpTitleBarHeight = 22;
42
- for (let tmpRadius = 0; tmpRadius <= 60; tmpRadius++)
43
- {
44
- let tmpStrip = libPictViewFlowNode.titleBarBottomStripHeight(tmpRadius, tmpTitleBarHeight);
45
- libExpect(tmpStrip).to.be.at.most(Math.floor(tmpTitleBarHeight / 2));
46
- }
47
- });
48
- });
49
-
50
- suite('nodeTransform',
51
- function ()
52
- {
53
- test('a zero / absent rotation is a plain position translate',
54
- function ()
55
- {
56
- libExpect(libPictViewFlowNode.nodeTransform(40, 60, 0, 100, 80)).to.equal('translate(40, 60)');
57
- libExpect(libPictViewFlowNode.nodeTransform(40, 60, null, 100, 80)).to.equal('translate(40, 60)');
58
- });
59
-
60
- test('a non-zero rotation rotates about the node center',
61
- function ()
62
- {
63
- libExpect(libPictViewFlowNode.nodeTransform(40, 60, 15, 100, 80)).to.equal('translate(40, 60) rotate(15 50 40)');
64
- });
65
- });
66
- });
@@ -1,172 +0,0 @@
1
- const libFable = require('fable');
2
- const libChai = require('chai');
3
- const libExpect = libChai.expect;
4
-
5
- const libPanelManager = require('../source/services/PictService-Flow-PanelManager.js');
6
-
7
- /**
8
- * Connection (edge) properties panels. The node-panel path is well covered through the view; these
9
- * focus on the connection additions: gating on ConnectionPropertiesPanel, placement near the edge
10
- * midpoint, the open/toggle/close lifecycle, and that node panels are not disturbed.
11
- */
12
- suite
13
- (
14
- 'PictService-Flow-PanelManager (connection panels)',
15
- function ()
16
- {
17
- let _Fable;
18
- let _PanelManager;
19
- let _MockFlowView;
20
-
21
- setup
22
- (
23
- function ()
24
- {
25
- _Fable = new libFable({});
26
-
27
- _MockFlowView =
28
- {
29
- fable: _Fable,
30
- log: _Fable.log,
31
- options:
32
- {
33
- ViewIdentifier: 'Test-Flow',
34
- ConnectionPropertiesPanel: false
35
- },
36
- _FlowData:
37
- {
38
- Nodes:
39
- [
40
- { Hash: 'n1', Type: 'state', X: 0, Y: 0, Width: 100, Height: 60, Ports: [ { Hash: 'n1-out', Direction: 'output' } ] },
41
- { Hash: 'n2', Type: 'state', X: 300, Y: 0, Width: 100, Height: 60, Ports: [ { Hash: 'n2-in', Direction: 'input' } ] }
42
- ],
43
- Connections:
44
- [
45
- { Hash: 'c1', SourceNodeHash: 'n1', SourcePortHash: 'n1-out', TargetNodeHash: 'n2', TargetPortHash: 'n2-in', Data: {} }
46
- ],
47
- OpenPanels: [],
48
- ViewState: { SelectedTetherHash: null }
49
- },
50
- getConnection: function (pHash) { return this._FlowData.Connections.find((pConn) => pConn.Hash === pHash) || null; },
51
- getNode: function (pHash) { return this._FlowData.Nodes.find((pNode) => pNode.Hash === pHash) || null; },
52
- getConnectionMidpoint: function (pHash) { return this.getConnection(pHash) ? { x: 200, y: 30 } : null; },
53
- _NodeTypeProvider:
54
- {
55
- getNodeType: function () { return { Label: 'State', PropertiesPanel: { PanelType: 'Form', DefaultWidth: 300, DefaultHeight: 220, Title: 'State' } }; }
56
- },
57
- renderFlow: function () {},
58
- marshalFromView: function () {},
59
- _PropertiesPanelView: { destroyPanel: function () {} },
60
- _EventHandlerProvider: { fireEvent: function () {} }
61
- };
62
-
63
- _PanelManager = new libPanelManager(_Fable, { FlowView: _MockFlowView }, 'PM-Test');
64
- }
65
- );
66
-
67
- test
68
- (
69
- 'openConnectionPanel returns false when no ConnectionPropertiesPanel is configured',
70
- function ()
71
- {
72
- let tmpResult = _PanelManager.openConnectionPanel('c1');
73
- libExpect(tmpResult).to.equal(false);
74
- libExpect(_MockFlowView._FlowData.OpenPanels.length).to.equal(0);
75
- }
76
- );
77
-
78
- test
79
- (
80
- 'openConnectionPanel returns false for an unknown connection',
81
- function ()
82
- {
83
- _MockFlowView.options.ConnectionPropertiesPanel = { PanelType: 'Form' };
84
- let tmpResult = _PanelManager.openConnectionPanel('no-such-connection');
85
- libExpect(tmpResult).to.equal(false);
86
- }
87
- );
88
-
89
- test
90
- (
91
- 'openConnectionPanel opens a panel carrying the ConnectionHash, placed near the midpoint',
92
- function ()
93
- {
94
- _MockFlowView.options.ConnectionPropertiesPanel = { PanelType: 'Form', DefaultWidth: 320, DefaultHeight: 240, Title: 'Transition' };
95
- let tmpPanel = _PanelManager.openConnectionPanel('c1');
96
-
97
- libExpect(tmpPanel).to.be.an('object');
98
- libExpect(tmpPanel.ConnectionHash).to.equal('c1');
99
- libExpect(tmpPanel.NodeHash).to.equal(null);
100
- libExpect(tmpPanel.Title).to.equal('Transition');
101
- libExpect(tmpPanel.Width).to.equal(320);
102
- libExpect(tmpPanel.Height).to.equal(240);
103
- // Midpoint is (200, 30); the panel is offset from it.
104
- libExpect(tmpPanel.X).to.equal(240);
105
- libExpect(tmpPanel.Y).to.equal(50);
106
- libExpect(_MockFlowView._FlowData.OpenPanels.length).to.equal(1);
107
- }
108
- );
109
-
110
- test
111
- (
112
- 'openConnectionPanel is idempotent: a second open returns the same panel',
113
- function ()
114
- {
115
- _MockFlowView.options.ConnectionPropertiesPanel = { PanelType: 'Form' };
116
- let tmpFirst = _PanelManager.openConnectionPanel('c1');
117
- let tmpSecond = _PanelManager.openConnectionPanel('c1');
118
- libExpect(tmpSecond.Hash).to.equal(tmpFirst.Hash);
119
- libExpect(_MockFlowView._FlowData.OpenPanels.length).to.equal(1);
120
- }
121
- );
122
-
123
- test
124
- (
125
- 'toggleConnectionPanel opens then closes',
126
- function ()
127
- {
128
- _MockFlowView.options.ConnectionPropertiesPanel = { PanelType: 'Form' };
129
- let tmpOpened = _PanelManager.toggleConnectionPanel('c1');
130
- libExpect(tmpOpened).to.be.an('object');
131
- libExpect(_MockFlowView._FlowData.OpenPanels.length).to.equal(1);
132
-
133
- let tmpClosed = _PanelManager.toggleConnectionPanel('c1');
134
- libExpect(tmpClosed).to.equal(false);
135
- libExpect(_MockFlowView._FlowData.OpenPanels.length).to.equal(0);
136
- }
137
- );
138
-
139
- test
140
- (
141
- 'closePanelForConnection removes the connection panel',
142
- function ()
143
- {
144
- _MockFlowView.options.ConnectionPropertiesPanel = { PanelType: 'Form' };
145
- _PanelManager.openConnectionPanel('c1');
146
- let tmpRemoved = _PanelManager.closePanelForConnection('c1');
147
- libExpect(tmpRemoved).to.equal(true);
148
- libExpect(_MockFlowView._FlowData.OpenPanels.length).to.equal(0);
149
- }
150
- );
151
-
152
- test
153
- (
154
- 'node panels still open alongside connection panels, keyed separately',
155
- function ()
156
- {
157
- _MockFlowView.options.ConnectionPropertiesPanel = { PanelType: 'Form' };
158
- let tmpNodePanel = _PanelManager.openPanel('n1');
159
- let tmpConnPanel = _PanelManager.openConnectionPanel('c1');
160
-
161
- libExpect(tmpNodePanel.NodeHash).to.equal('n1');
162
- libExpect(tmpConnPanel.ConnectionHash).to.equal('c1');
163
- libExpect(_MockFlowView._FlowData.OpenPanels.length).to.equal(2);
164
-
165
- // Closing the connection panel leaves the node panel intact.
166
- _PanelManager.closePanelForConnection('c1');
167
- libExpect(_MockFlowView._FlowData.OpenPanels.length).to.equal(1);
168
- libExpect(_MockFlowView._FlowData.OpenPanels[0].NodeHash).to.equal('n1');
169
- }
170
- );
171
- }
172
- );