pict-section-flow 1.4.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.
- package/package.json +7 -2
- package/source/Pict-Section-Flow.js +20 -14
- package/source/providers/PictProvider-Flow-Background.js +303 -0
- package/source/providers/PictProvider-Flow-CSS.js +73 -7
- package/source/providers/PictProvider-Flow-Geometry.js +11 -421
- package/source/providers/PictProvider-Flow-Icons.js +12 -0
- package/source/providers/PictProvider-Flow-Layouts.js +107 -0
- package/source/services/PictService-Flow-ConnectionRenderer.js +1 -1
- package/source/services/PictService-Flow-CursorManager.js +113 -0
- package/source/services/PictService-Flow-InteractionManager.js +439 -59
- package/source/services/PictService-Flow-Layout.js +21 -16
- package/source/services/PictService-Flow-PathGenerator.js +30 -417
- package/source/services/PictService-Flow-RenderManager.js +9 -1
- package/source/services/PictService-Flow-ViewportManager.js +102 -0
- package/source/views/PictView-Flow-FloatingToolbar.js +5 -1
- package/source/views/PictView-Flow-Node.js +29 -0
- package/source/views/PictView-Flow-Toolbar.js +50 -3
- package/source/views/PictView-Flow.js +591 -2
- package/.claude/launch.json +0 -11
- package/docs/.nojekyll +0 -0
- package/docs/Architecture.md +0 -163
- package/docs/Custom-Styling.md +0 -275
- package/docs/Data_Model.md +0 -149
- package/docs/Event_System.md +0 -156
- package/docs/Getting_Started.md +0 -237
- package/docs/Implementation_Reference.md +0 -528
- package/docs/Layout_Persistence.md +0 -117
- package/docs/README.md +0 -103
- package/docs/Theme_Integration.md +0 -150
- package/docs/_brand.json +0 -18
- package/docs/_cover.md +0 -17
- package/docs/_playground.json +0 -24
- package/docs/_sidebar.md +0 -57
- package/docs/_topbar.md +0 -8
- package/docs/_version.json +0 -7
- package/docs/api/PictFlowCard.md +0 -216
- package/docs/api/PictFlowCardPropertiesPanel.md +0 -235
- package/docs/api/addConnection.md +0 -101
- package/docs/api/addNode.md +0 -137
- package/docs/api/autoLayout.md +0 -77
- package/docs/api/getFlowData.md +0 -112
- package/docs/api/marshalToView.md +0 -95
- package/docs/api/openPanel.md +0 -128
- package/docs/api/registerHandler.md +0 -174
- package/docs/api/registerNodeType.md +0 -142
- package/docs/api/removeConnection.md +0 -57
- package/docs/api/removeNode.md +0 -80
- package/docs/api/saveLayout.md +0 -152
- package/docs/api/screenToSVGCoords.md +0 -68
- package/docs/api/selectNode.md +0 -116
- package/docs/api/setTheme.md +0 -168
- package/docs/api/setZoom.md +0 -97
- package/docs/api/toggleFullscreen.md +0 -68
- package/docs/card-help/EACH.md +0 -19
- package/docs/card-help/FREAD.md +0 -24
- package/docs/card-help/FWRITE.md +0 -24
- package/docs/card-help/GET.md +0 -22
- package/docs/card-help/ITE.md +0 -23
- package/docs/card-help/LOG.md +0 -23
- package/docs/card-help/NOTE.md +0 -17
- package/docs/card-help/PREV.md +0 -18
- package/docs/card-help/SET.md +0 -27
- package/docs/card-help/SPKL.md +0 -22
- package/docs/card-help/STAT.md +0 -23
- package/docs/card-help/SW.md +0 -25
- package/docs/diagrams/architecture-at-a-glance.excalidraw +0 -4270
- package/docs/diagrams/architecture-at-a-glance.mmd +0 -30
- package/docs/diagrams/architecture-at-a-glance.svg +0 -2
- package/docs/diagrams/data-flow.excalidraw +0 -1451
- package/docs/diagrams/data-flow.mmd +0 -17
- package/docs/diagrams/data-flow.svg +0 -2
- package/docs/diagrams/high-level-design.excalidraw +0 -5767
- package/docs/diagrams/high-level-design.mmd +0 -86
- package/docs/diagrams/high-level-design.svg +0 -2
- package/docs/diagrams/relationships.excalidraw +0 -3852
- package/docs/diagrams/relationships.mmd +0 -9
- package/docs/diagrams/relationships.svg +0 -2
- package/docs/diagrams/service-initialization-sequence.excalidraw +0 -1466
- package/docs/diagrams/service-initialization-sequence.mmd +0 -19
- package/docs/diagrams/service-initialization-sequence.svg +0 -2
- package/docs/diagrams/svg-layer-structure.excalidraw +0 -1060
- package/docs/diagrams/svg-layer-structure.mmd +0 -18
- package/docs/diagrams/svg-layer-structure.svg +0 -2
- package/docs/examples/README.md +0 -9
- package/docs/examples/simple_cards/README.md +0 -677
- package/docs/examples/simple_cards/css/flowexample.css +0 -65
- package/docs/examples/simple_cards/index.html +0 -32
- package/docs/examples/simple_cards/js/pict.min.js +0 -12
- package/docs/examples/simple_cards/pict-section-flow-example-simple-cards.compatible.min.js +0 -1
- package/docs/index.html +0 -38
- package/docs/playground/app.json +0 -6
- package/docs/playground/appdata.json +0 -85
- package/docs/playground/application.js +0 -23
- package/docs/playground/pict.json +0 -17
- package/docs/playground/runtime/pict-application.min.js +0 -2
- package/docs/playground/runtime/pict-section-flow.min.js +0 -2
- package/docs/playground/runtime/pict-section-modal.min.js +0 -2
- package/docs/playground/runtime/pict.min.js +0 -12
- package/docs/retold-catalog.json +0 -244
- package/docs/retold-keyword-index.json +0 -26028
- package/example_applications/simple_cards/css/flowexample.css +0 -65
- package/example_applications/simple_cards/html/index.html +0 -32
- package/example_applications/simple_cards/package.json +0 -52
- package/example_applications/simple_cards/source/Pict-Application-FlowExample-Configuration.json +0 -15
- package/example_applications/simple_cards/source/Pict-Application-FlowExample.js +0 -539
- package/example_applications/simple_cards/source/card-help-content.js +0 -16
- package/example_applications/simple_cards/source/cards/FlowCard-Comment.js +0 -38
- package/example_applications/simple_cards/source/cards/FlowCard-DataPreview.js +0 -44
- package/example_applications/simple_cards/source/cards/FlowCard-Each.js +0 -38
- package/example_applications/simple_cards/source/cards/FlowCard-FileRead.js +0 -56
- package/example_applications/simple_cards/source/cards/FlowCard-FileWrite.js +0 -50
- package/example_applications/simple_cards/source/cards/FlowCard-GetValue.js +0 -37
- package/example_applications/simple_cards/source/cards/FlowCard-IfThenElse.js +0 -49
- package/example_applications/simple_cards/source/cards/FlowCard-LogValues.js +0 -55
- package/example_applications/simple_cards/source/cards/FlowCard-SetValue.js +0 -97
- package/example_applications/simple_cards/source/cards/FlowCard-Sparkline.js +0 -100
- package/example_applications/simple_cards/source/cards/FlowCard-StatusMonitor.js +0 -46
- package/example_applications/simple_cards/source/cards/FlowCard-Switch.js +0 -39
- package/example_applications/simple_cards/source/providers/PictRouter-FlowExample-Configuration.json +0 -22
- package/example_applications/simple_cards/source/sample-flows.js +0 -410
- package/example_applications/simple_cards/source/views/PictView-FlowExample-About.js +0 -184
- package/example_applications/simple_cards/source/views/PictView-FlowExample-BottomBar.js +0 -77
- package/example_applications/simple_cards/source/views/PictView-FlowExample-Documentation.js +0 -325
- package/example_applications/simple_cards/source/views/PictView-FlowExample-FileWriteInfo.js +0 -59
- package/example_applications/simple_cards/source/views/PictView-FlowExample-Layout.js +0 -90
- package/example_applications/simple_cards/source/views/PictView-FlowExample-MainWorkspace.js +0 -453
- package/example_applications/simple_cards/source/views/PictView-FlowExample-TopBar.js +0 -95
- package/scripts/generate-card-help.js +0 -214
- package/source/providers/edges/Edge-Bezier.js +0 -41
- package/source/providers/edges/Edge-Orthogonal.js +0 -37
- package/source/providers/edges/Edge-OrthogonalSnap.js +0 -72
- package/source/providers/edges/Edge-Perimeter-Linear.js +0 -31
- package/source/providers/edges/Edge-Perimeter-Orthogonal.js +0 -39
- package/source/providers/edges/Edge-Perimeter.js +0 -48
- package/source/providers/edges/Edge-PerimeterMath.js +0 -92
- package/source/providers/edges/Edge-Straight.js +0 -24
- package/source/providers/layouts/Layout-Circular.js +0 -203
- package/source/providers/layouts/Layout-Coerce.js +0 -40
- package/source/providers/layouts/Layout-Columnar.js +0 -134
- package/source/providers/layouts/Layout-Custom.js +0 -27
- package/source/providers/layouts/Layout-ForcedFromCenter.js +0 -256
- package/source/providers/layouts/Layout-Grid.js +0 -134
- package/source/providers/layouts/Layout-Layered.js +0 -155
- package/source/providers/layouts/Layout-Rank.js +0 -141
- package/source/providers/layouts/Layout-Staggered.js +0 -131
- package/source/providers/layouts/Layout-Tabular.js +0 -94
- package/test/CardPalette_tests.js +0 -43
- package/test/ConnectionHandleManager_tests.js +0 -717
- package/test/ConnectionRenderer_tests.js +0 -591
- package/test/ConnectionStyle_tests.js +0 -90
- package/test/DataManager_tests.js +0 -859
- package/test/Geometry_tests.js +0 -767
- package/test/InteractionManager_tests.js +0 -279
- package/test/Layout_tests.js +0 -1604
- package/test/NodeView_tests.js +0 -66
- package/test/PanelManager_tests.js +0 -172
- package/test/PathGenerator_tests.js +0 -978
- package/test/PortRenderer_tests.js +0 -376
- package/test/RenderManager_tests.js +0 -756
- package/test/Renderer_tests.js +0 -133
- package/test/SelectionManager_tests.js +0 -185
- package/test/StylePresets_tests.js +0 -153
- package/test/ToolbarExtraButtons_tests.js +0 -138
- package/test/UndirectedConnections_tests.js +0 -70
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
const libFableServiceProviderBase = require('fable-serviceproviderbase');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* PictService-Flow-CursorManager
|
|
5
|
+
*
|
|
6
|
+
* Owns the canvas pointer cursor as a single, intentional concern. The cursor is
|
|
7
|
+
* a pure function of the interaction state machine (InteractionManager._State)
|
|
8
|
+
* plus the view mode (read-only, read-only navigation, whether panning is
|
|
9
|
+
* enabled). It is applied through ONE chokepoint: a `data-flow-cursor` token
|
|
10
|
+
* attribute on the SVG element, which the CSS maps to a real cursor.
|
|
11
|
+
*
|
|
12
|
+
* This replaces the previous approach (a base `cursor: grab` on the SVG plus
|
|
13
|
+
* `panning` / `connecting` class toggles scattered across the InteractionManager)
|
|
14
|
+
* so cursor behavior is derived from state rather than maintained by hand at
|
|
15
|
+
* every interaction site. Element-scoped hover cursors (ports, handles, panel
|
|
16
|
+
* chrome, toolbar buttons) stay on those elements -- they are correctly scoped
|
|
17
|
+
* and win for their own element regardless of the canvas cursor.
|
|
18
|
+
*
|
|
19
|
+
* To extend: add a state-to-token case in resolveCursor and a CSS rule for the
|
|
20
|
+
* token. The InteractionManager calls update() on every state transition (via
|
|
21
|
+
* its _setState), and the view calls it when the mode changes.
|
|
22
|
+
*/
|
|
23
|
+
class PictServiceFlowCursorManager extends libFableServiceProviderBase
|
|
24
|
+
{
|
|
25
|
+
constructor(pFable, pOptions, pServiceHash)
|
|
26
|
+
{
|
|
27
|
+
super(pFable, pOptions, pServiceHash);
|
|
28
|
+
|
|
29
|
+
this.serviceType = 'PictServiceFlowCursorManager';
|
|
30
|
+
|
|
31
|
+
this._FlowView = (pOptions && pOptions.FlowView) ? pOptions.FlowView : null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Map an interaction state + mode to a cursor token. Pure: no DOM, no side
|
|
36
|
+
* effects, so it is unit testable.
|
|
37
|
+
*
|
|
38
|
+
* @param {Object} pContext - { state, readOnly, navigating, panningEnabled }
|
|
39
|
+
* @returns {string} a cursor token: 'default' | 'grab' | 'grabbing' | 'crosshair' | 'resize'
|
|
40
|
+
*/
|
|
41
|
+
resolveCursor(pContext)
|
|
42
|
+
{
|
|
43
|
+
let tmpContext = pContext || {};
|
|
44
|
+
|
|
45
|
+
switch (tmpContext.state)
|
|
46
|
+
{
|
|
47
|
+
case 'panning':
|
|
48
|
+
case 'dragging-node':
|
|
49
|
+
case 'dragging-panel':
|
|
50
|
+
case 'dragging-handle':
|
|
51
|
+
case 'rotating-node':
|
|
52
|
+
return 'grabbing';
|
|
53
|
+
|
|
54
|
+
case 'resizing-node':
|
|
55
|
+
case 'resizing-panel':
|
|
56
|
+
return 'resize';
|
|
57
|
+
|
|
58
|
+
case 'connecting':
|
|
59
|
+
case 'marquee':
|
|
60
|
+
return 'crosshair';
|
|
61
|
+
|
|
62
|
+
default:
|
|
63
|
+
// Idle: the canvas cursor signals whether the background can be grabbed.
|
|
64
|
+
// Read-only is static unless navigation (the hand toggle) is on; in edit
|
|
65
|
+
// mode the background is grabbable when panning is enabled.
|
|
66
|
+
if (tmpContext.readOnly)
|
|
67
|
+
{
|
|
68
|
+
return tmpContext.navigating ? 'grab' : 'default';
|
|
69
|
+
}
|
|
70
|
+
return tmpContext.panningEnabled ? 'grab' : 'default';
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Gather the current state + mode and apply the resolved cursor token. Called
|
|
76
|
+
* by the InteractionManager on every state transition and by the view on mode
|
|
77
|
+
* changes. Safe to call before the SVG exists (no-op).
|
|
78
|
+
*/
|
|
79
|
+
update()
|
|
80
|
+
{
|
|
81
|
+
if (!this._FlowView)
|
|
82
|
+
{
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
let tmpInteractionManager = this._FlowView._InteractionManager;
|
|
87
|
+
let tmpToken = this.resolveCursor(
|
|
88
|
+
{
|
|
89
|
+
state: (tmpInteractionManager && tmpInteractionManager._State) ? tmpInteractionManager._State : 'idle',
|
|
90
|
+
readOnly: (typeof this._FlowView.isReadOnly === 'function') ? this._FlowView.isReadOnly() : false,
|
|
91
|
+
navigating: (typeof this._FlowView.isReadOnlyNavigation === 'function') ? this._FlowView.isReadOnlyNavigation() : false,
|
|
92
|
+
panningEnabled: this._FlowView.options ? (this._FlowView.options.EnablePanning !== false) : true
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
this.apply(tmpToken);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Write the cursor token to the SVG element. The CSS maps
|
|
100
|
+
* `.pict-flow-svg[data-flow-cursor="<token>"]` to a real cursor.
|
|
101
|
+
* @param {string} pToken
|
|
102
|
+
*/
|
|
103
|
+
apply(pToken)
|
|
104
|
+
{
|
|
105
|
+
let tmpElement = this._FlowView ? this._FlowView._SVGElement : null;
|
|
106
|
+
if (tmpElement && typeof tmpElement.setAttribute === 'function')
|
|
107
|
+
{
|
|
108
|
+
tmpElement.setAttribute('data-flow-cursor', pToken);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
module.exports = PictServiceFlowCursorManager;
|