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,453 +0,0 @@
1
- const libPictView = require('pict-view');
2
- const libPictSectionFlow = require('pict-section-flow');
3
- const libSampleFlows = require('../sample-flows.js');
4
-
5
- // FlowCard definitions
6
- const libFlowCardIfThenElse = require('../cards/FlowCard-IfThenElse.js');
7
- const libFlowCardSwitch = require('../cards/FlowCard-Switch.js');
8
- const libFlowCardEach = require('../cards/FlowCard-Each.js');
9
- const libFlowCardFileRead = require('../cards/FlowCard-FileRead.js');
10
- const libFlowCardFileWrite = require('../cards/FlowCard-FileWrite.js');
11
- const libFlowCardLogValues = require('../cards/FlowCard-LogValues.js');
12
- const libFlowCardSetValue = require('../cards/FlowCard-SetValue.js');
13
- const libFlowCardGetValue = require('../cards/FlowCard-GetValue.js');
14
- const libFlowCardStatusMonitor = require('../cards/FlowCard-StatusMonitor.js');
15
- const libFlowCardDataPreview = require('../cards/FlowCard-DataPreview.js');
16
- const libFlowCardSparkline = require('../cards/FlowCard-Sparkline.js');
17
- const libFlowCardComment = require('../cards/FlowCard-Comment.js');
18
-
19
- const _ViewConfiguration =
20
- {
21
- ViewIdentifier: "FlowExample-MainWorkspace",
22
-
23
- DefaultRenderable: "FlowExample-MainWorkspace-Content",
24
- DefaultDestinationAddress: "#FlowExample-Content-Container",
25
-
26
- AutoRender: false,
27
-
28
- CSS: /*css*/`
29
- .flowexample-workspace {
30
- padding: 0.75em;
31
- display: flex;
32
- flex-direction: column;
33
- flex: 1;
34
- min-height: 0;
35
- }
36
- .flowexample-workspace-header {
37
- flex-shrink: 0;
38
- margin: 0 0 0.75em 0;
39
- padding-bottom: 0.75em;
40
- border-bottom: 1px solid var(--theme-color-border-light, #eee);
41
- display: flex;
42
- align-items: flex-start;
43
- justify-content: space-between;
44
- }
45
- .flowexample-workspace-header h1 {
46
- margin: 0 0 0.25em 0;
47
- font-size: 2em;
48
- font-weight: 300;
49
- color: #2c3e50;
50
- }
51
- .flowexample-workspace-header p {
52
- margin: 0;
53
- color: #7f8c8d;
54
- font-size: 1.1em;
55
- }
56
- .flowexample-help-toggle {
57
- flex-shrink: 0;
58
- margin-left: 1em;
59
- width: 36px;
60
- height: 36px;
61
- border-radius: 50%;
62
- border: 2px solid #3498db;
63
- background: var(--theme-color-background-panel, #fff);
64
- color: #3498db;
65
- font-size: 1.2em;
66
- font-weight: 700;
67
- cursor: pointer;
68
- display: flex;
69
- align-items: center;
70
- justify-content: center;
71
- transition: background 0.15s, color 0.15s;
72
- }
73
- .flowexample-help-toggle:hover {
74
- background: #3498db;
75
- color: var(--theme-color-background-panel, #fff);
76
- }
77
- .flowexample-help-toggle.active {
78
- background: #3498db;
79
- color: var(--theme-color-background-panel, #fff);
80
- }
81
- #FlowExample-Flow-Container {
82
- flex: 1;
83
- min-height: 0;
84
- }
85
- .flowexample-sample-bar {
86
- flex-shrink: 0;
87
- margin: 0 0 0.75em 0;
88
- padding: 0.6em 0.75em;
89
- background: var(--theme-color-background-panel, #fff);
90
- border: 1px solid var(--theme-color-border-light, #dee2e6);
91
- border-radius: 6px;
92
- display: flex;
93
- align-items: center;
94
- gap: 0.6em;
95
- flex-wrap: wrap;
96
- }
97
- .flowexample-sample-bar label {
98
- font-weight: 600;
99
- color: #2c3e50;
100
- font-size: 0.9em;
101
- }
102
- .flowexample-sample-bar select {
103
- padding: 0.35em 0.55em;
104
- border: 1px solid #ced4da;
105
- border-radius: 4px;
106
- background: #fff;
107
- font-size: 0.95em;
108
- min-width: 220px;
109
- }
110
- .flowexample-sample-description {
111
- flex: 1;
112
- min-width: 280px;
113
- color: #5a6470;
114
- font-size: 0.85em;
115
- line-height: 1.4;
116
- }
117
- .flowexample-sample-recommended {
118
- padding: 0.2em 0.55em;
119
- background: #eaf6ee;
120
- color: #1f7a3f;
121
- border-radius: 4px;
122
- font-size: 0.8em;
123
- font-weight: 600;
124
- white-space: nowrap;
125
- }
126
- .flowexample-help-panel {
127
- flex-shrink: 0;
128
- display: none;
129
- margin-bottom: 0.75em;
130
- padding: 1.5em;
131
- background: #f8f9fa;
132
- border: 1px solid #dee2e6;
133
- border-radius: 8px;
134
- }
135
- .flowexample-help-panel.visible {
136
- display: block;
137
- }
138
- .flowexample-help-panel h3 {
139
- margin: 0 0 1em 0;
140
- font-size: 1.1em;
141
- font-weight: 600;
142
- color: #2c3e50;
143
- }
144
- .flowexample-hints {
145
- display: grid;
146
- grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
147
- gap: 1em;
148
- }
149
- .flowexample-hint {
150
- background: var(--theme-color-background-panel, #fff);
151
- border: 1px solid var(--theme-color-border-default, #e0e0e0);
152
- border-radius: 6px;
153
- padding: 1em 1.25em;
154
- }
155
- .flowexample-hint h4 {
156
- margin: 0 0 0.35em 0;
157
- font-size: 0.95em;
158
- color: #2c3e50;
159
- }
160
- .flowexample-hint p {
161
- margin: 0;
162
- color: var(--theme-color-text-secondary, #666);
163
- font-size: 0.85em;
164
- line-height: 1.5;
165
- }
166
- .flowexample-hint code {
167
- background: #f4f4f5;
168
- padding: 0.1em 0.3em;
169
- border-radius: 3px;
170
- font-size: 0.9em;
171
- color: var(--theme-color-status-error, #e74c3c);
172
- }
173
- `,
174
-
175
- Templates:
176
- [
177
- {
178
- Hash: "FlowExample-MainWorkspace-Template",
179
- Template: /*html*/`
180
- <div class="flowexample-workspace">
181
- <div class="flowexample-workspace-header">
182
- <div>
183
- <h1>Flow Diagram</h1>
184
- <p>Build flow diagrams from cards. Open the Card Palette to browse available cards, or select a node type from the dropdown and click + Add Node.</p>
185
- </div>
186
- <button class="flowexample-help-toggle" id="FlowExample-HelpToggle" title="Toggle help">?</button>
187
- </div>
188
- <div class="flowexample-help-panel" id="FlowExample-HelpPanel">
189
- <h3>Quick Reference</h3>
190
- <div class="flowexample-hints">
191
- <div class="flowexample-hint">
192
- <h4>Add Nodes</h4>
193
- <p>Select a node type from the dropdown and click <code>+ Add Node</code> in the toolbar.</p>
194
- </div>
195
- <div class="flowexample-hint">
196
- <h4>Connect Nodes</h4>
197
- <p>Drag from a green output port to a blue input port to create a connection.</p>
198
- </div>
199
- <div class="flowexample-hint">
200
- <h4>Move Nodes</h4>
201
- <p>Click and drag any node to reposition it. Connections update automatically.</p>
202
- </div>
203
- <div class="flowexample-hint">
204
- <h4>Pan &amp; Zoom</h4>
205
- <p>Click and drag the background to pan. Use the mouse wheel to zoom in and out.</p>
206
- </div>
207
- <div class="flowexample-hint">
208
- <h4>Delete</h4>
209
- <p>Select a node or connection and press <code>Delete</code> or click the Delete button.</p>
210
- </div>
211
- <div class="flowexample-hint">
212
- <h4>Auto Layout</h4>
213
- <p>Click <code>Auto Layout</code> in the toolbar to automatically arrange nodes left to right.</p>
214
- </div>
215
- <div class="flowexample-hint">
216
- <h4>Properties Panel</h4>
217
- <p>Double-click a node to open its properties panel (if the card type defines one).</p>
218
- </div>
219
- <div class="flowexample-hint">
220
- <h4>Save Layouts</h4>
221
- <p>Use the Layouts toolbar to save, restore, and delete named arrangement snapshots.</p>
222
- </div>
223
- </div>
224
- </div>
225
- <div class="flowexample-sample-bar">
226
- <label for="FlowExample-SampleSelect">Sample graph:</label>
227
- <select id="FlowExample-SampleSelect"></select>
228
- <span class="flowexample-sample-recommended" id="FlowExample-SampleRecommended"></span>
229
- <span class="flowexample-sample-description" id="FlowExample-SampleDescription">Pick a sample, then open the <strong>Algorithm</strong> popup in the toolbar to compare layouts.</span>
230
- </div>
231
- <div id="FlowExample-Flow-Container"></div>
232
- </div>
233
- `
234
- }
235
- ],
236
-
237
- Renderables:
238
- [
239
- {
240
- RenderableHash: "FlowExample-MainWorkspace-Content",
241
- TemplateHash: "FlowExample-MainWorkspace-Template",
242
- DestinationAddress: "#FlowExample-Content-Container",
243
- RenderMethod: "replace"
244
- }
245
- ]
246
- };
247
-
248
- class FlowExampleMainWorkspaceView extends libPictView
249
- {
250
- constructor(pFable, pOptions, pServiceHash)
251
- {
252
- super(pFable, pOptions, pServiceHash);
253
-
254
- this._FlowView = null;
255
- }
256
-
257
- /**
258
- * Build a map of FlowCard node type configurations keyed by hash.
259
- * These are passed as NodeTypes in the FlowView options so they
260
- * are available from the moment the NodeTypeProvider is created,
261
- * before the toolbar renders.
262
- */
263
- _buildFlowCardNodeTypes()
264
- {
265
- let tmpCardClasses =
266
- [
267
- libFlowCardIfThenElse,
268
- libFlowCardSwitch,
269
- libFlowCardEach,
270
- libFlowCardFileRead,
271
- libFlowCardFileWrite,
272
- libFlowCardLogValues,
273
- libFlowCardSetValue,
274
- libFlowCardGetValue,
275
- libFlowCardStatusMonitor,
276
- libFlowCardDataPreview,
277
- libFlowCardSparkline,
278
- libFlowCardComment
279
- ];
280
-
281
- let tmpNodeTypes = {};
282
-
283
- for (let i = 0; i < tmpCardClasses.length; i++)
284
- {
285
- let tmpCard = new tmpCardClasses[i](this.fable, {}, `FlowCard-${i}`);
286
- let tmpConfig = tmpCard.getNodeTypeConfiguration();
287
- tmpNodeTypes[tmpConfig.Hash] = tmpConfig;
288
- }
289
-
290
- return tmpNodeTypes;
291
- }
292
-
293
- onAfterRender(pRenderable, pRenderDestinationAddress, pRecord, pContent)
294
- {
295
- // Create and render the flow section view into its container
296
- if (!this._FlowView)
297
- {
298
- this._FlowView = this.pict.addView('FlowExample-FlowDiagram',
299
- {
300
- ViewIdentifier: 'FlowExample-FlowDiagram',
301
-
302
- DefaultRenderable: 'Flow-Container',
303
- DefaultDestinationAddress: '#FlowExample-Flow-Container',
304
-
305
- AutoRender: false,
306
-
307
- FlowDataAddress: 'AppData.FlowExample.SampleFlow',
308
-
309
- TargetElementAddress: '#Flow-SVG-Container',
310
-
311
- EnableToolbar: true,
312
- EnablePanning: true,
313
- EnableZooming: true,
314
- EnableNodeDragging: true,
315
- EnableConnectionCreation: true,
316
- EnableGridSnap: false,
317
- GridSnapSize: 20,
318
-
319
- MinZoom: 0.1,
320
- MaxZoom: 5.0,
321
- ZoomStep: 0.1,
322
-
323
- DefaultNodeType: 'default',
324
- DefaultNodeWidth: 180,
325
- DefaultNodeHeight: 80,
326
-
327
- // Pre-register FlowCard node types so they are available
328
- // when the NodeTypeProvider is created, before toolbar renders
329
- NodeTypes: this._buildFlowCardNodeTypes(),
330
-
331
- Renderables:
332
- [
333
- {
334
- RenderableHash: 'Flow-Container',
335
- TemplateHash: 'Flow-Container-Template',
336
- DestinationAddress: '#FlowExample-Flow-Container',
337
- RenderMethod: 'replace'
338
- }
339
- ]
340
- },
341
- libPictSectionFlow
342
- );
343
- }
344
-
345
- // Reset the flow view's render state so it re-initializes SVG elements
346
- // when re-rendered (e.g. after navigating away and back)
347
- this._FlowView.initialRenderComplete = false;
348
- this._FlowView.render();
349
-
350
- // Wire up the help toggle button
351
- let tmpHelpToggle = document.getElementById('FlowExample-HelpToggle');
352
- let tmpHelpPanel = document.getElementById('FlowExample-HelpPanel');
353
- if (tmpHelpToggle && tmpHelpPanel)
354
- {
355
- tmpHelpToggle.addEventListener('click', function ()
356
- {
357
- tmpHelpPanel.classList.toggle('visible');
358
- tmpHelpToggle.classList.toggle('active');
359
- });
360
- }
361
-
362
- // Populate the sample-graph selector and wire its change handler.
363
- this._populateSampleSelector();
364
-
365
- return super.onAfterRender(pRenderable, pRenderDestinationAddress, pRecord, pContent);
366
- }
367
-
368
- /**
369
- * Populate the sample-graph dropdown above the flow diagram and wire
370
- * the change handler. The first option ("Hello World") is the rich
371
- * default flow that lives in AppData.FlowExample.SampleFlow; the rest
372
- * come from sample-flows.js and showcase a different layout strength.
373
- */
374
- _populateSampleSelector()
375
- {
376
- let tmpSelect = document.getElementById('FlowExample-SampleSelect');
377
- let tmpDesc = document.getElementById('FlowExample-SampleDescription');
378
- let tmpReco = document.getElementById('FlowExample-SampleRecommended');
379
- if (!tmpSelect || !tmpDesc || !tmpReco) return;
380
-
381
- // Clear pre-existing options
382
- while (tmpSelect.firstChild) tmpSelect.removeChild(tmpSelect.firstChild);
383
-
384
- let tmpHelloOpt = document.createElement('option');
385
- tmpHelloOpt.value = '__hello-world__';
386
- tmpHelloOpt.textContent = 'Hello World — multi-feature reference';
387
- tmpSelect.appendChild(tmpHelloOpt);
388
-
389
- let tmpKeys = libSampleFlows.getSampleNames();
390
- for (let i = 0; i < tmpKeys.length; i++)
391
- {
392
- let tmpSample = libSampleFlows.getSample(tmpKeys[i]);
393
- let tmpOpt = document.createElement('option');
394
- tmpOpt.value = tmpKeys[i];
395
- tmpOpt.textContent = tmpSample.Name;
396
- tmpSelect.appendChild(tmpOpt);
397
- }
398
-
399
- // Initial description (Hello World)
400
- tmpDesc.innerHTML = 'Pick a sample, then open the <strong>Algorithm</strong> popup in the toolbar to compare layouts.';
401
- tmpReco.style.display = 'none';
402
-
403
- let tmpView = this;
404
- tmpSelect.addEventListener('change', function ()
405
- {
406
- let tmpKey = tmpSelect.value;
407
- tmpView._loadSample(tmpKey, tmpDesc, tmpReco);
408
- });
409
- }
410
-
411
- /**
412
- * Load a sample flow into the FlowView. `__hello-world__` reloads the
413
- * original AppData-backed flow; everything else comes from sample-flows.
414
- *
415
- * @param {string} pKey
416
- * @param {HTMLElement} pDescEl
417
- * @param {HTMLElement} pRecoEl
418
- */
419
- _loadSample(pKey, pDescEl, pRecoEl)
420
- {
421
- if (!this._FlowView) return;
422
-
423
- if (pKey === '__hello-world__')
424
- {
425
- this._FlowView.setFlowData(this.pict.AppData.FlowExample.SampleFlow);
426
- pDescEl.innerHTML = 'The full reference flow with all card types, properties panels, and an error branch. Originally designed by hand — set <code>LayoutAlgorithm</code> to <em>Layered</em> to see how the auto-layout compares.';
427
- pRecoEl.style.display = 'none';
428
- return;
429
- }
430
-
431
- let tmpSample = libSampleFlows.getSample(pKey);
432
- if (!tmpSample) return;
433
-
434
- // setFlowData expects a fresh _FlowData-shaped object — deep clone so
435
- // re-loading the same sample doesn't share mutated node references
436
- // with prior loads.
437
- this._FlowView.setFlowData(JSON.parse(JSON.stringify(tmpSample.Flow)));
438
- pDescEl.textContent = tmpSample.Description;
439
- if (tmpSample.Recommended)
440
- {
441
- pRecoEl.style.display = '';
442
- pRecoEl.textContent = `Try: ${tmpSample.Recommended}`;
443
- }
444
- else
445
- {
446
- pRecoEl.style.display = 'none';
447
- }
448
- }
449
- }
450
-
451
- module.exports = FlowExampleMainWorkspaceView;
452
-
453
- module.exports.default_configuration = _ViewConfiguration;
@@ -1,95 +0,0 @@
1
- const libPictView = require('pict-view');
2
-
3
- const _ViewConfiguration =
4
- {
5
- ViewIdentifier: "FlowExample-TopBar",
6
-
7
- DefaultRenderable: "FlowExample-TopBar-Content",
8
- DefaultDestinationAddress: "#FlowExample-TopBar-Container",
9
-
10
- AutoRender: false,
11
-
12
- CSS: /*css*/`
13
- .flowexample-topbar {
14
- display: flex;
15
- align-items: center;
16
- justify-content: space-between;
17
- background-color: #2c3e50;
18
- color: #ecf0f1;
19
- padding: 0 1.5em;
20
- height: 56px;
21
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
22
- position: sticky;
23
- top: 0;
24
- z-index: 100;
25
- }
26
- .flowexample-topbar-brand {
27
- font-size: 1.25em;
28
- font-weight: 600;
29
- letter-spacing: 0.02em;
30
- color: #ecf0f1;
31
- text-decoration: none;
32
- cursor: pointer;
33
- }
34
- .flowexample-topbar-brand:hover {
35
- color: var(--theme-color-background-panel, #fff);
36
- }
37
- .flowexample-topbar-nav {
38
- display: flex;
39
- align-items: center;
40
- gap: 0.25em;
41
- }
42
- .flowexample-topbar-nav a {
43
- color: #bdc3c7;
44
- text-decoration: none;
45
- padding: 0.5em 0.75em;
46
- border-radius: 4px;
47
- font-size: 0.9em;
48
- transition: background-color 0.15s, color 0.15s;
49
- cursor: pointer;
50
- }
51
- .flowexample-topbar-nav a:hover {
52
- background-color: #34495e;
53
- color: var(--theme-color-background-panel, #fff);
54
- }
55
- `,
56
-
57
- Templates:
58
- [
59
- {
60
- Hash: "FlowExample-TopBar-Template",
61
- Template: /*html*/`
62
- <div class="flowexample-topbar">
63
- <a class="flowexample-topbar-brand" onclick="{~P~}.PictApplication.navigateTo('/Home')">Pict Section Flow</a>
64
- <div class="flowexample-topbar-nav">
65
- <a onclick="{~P~}.PictApplication.navigateTo('/Home')">Home</a>
66
- <a onclick="{~P~}.PictApplication.navigateTo('/About')">About</a>
67
- <a onclick="{~P~}.PictApplication.navigateTo('/Documentation')">Documentation</a>
68
- </div>
69
- </div>
70
- `
71
- }
72
- ],
73
-
74
- Renderables:
75
- [
76
- {
77
- RenderableHash: "FlowExample-TopBar-Content",
78
- TemplateHash: "FlowExample-TopBar-Template",
79
- DestinationAddress: "#FlowExample-TopBar-Container",
80
- RenderMethod: "replace"
81
- }
82
- ]
83
- };
84
-
85
- class FlowExampleTopBarView extends libPictView
86
- {
87
- constructor(pFable, pOptions, pServiceHash)
88
- {
89
- super(pFable, pOptions, pServiceHash);
90
- }
91
- }
92
-
93
- module.exports = FlowExampleTopBarView;
94
-
95
- module.exports.default_configuration = _ViewConfiguration;