pict-section-flow 0.0.17 → 0.0.19
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/README.md +18 -18
- package/docs/Architecture.md +1 -1
- package/docs/Data_Model.md +2 -2
- package/docs/Getting_Started.md +5 -5
- package/docs/Implementation_Reference.md +6 -6
- package/docs/Layout_Persistence.md +3 -3
- package/docs/README.md +12 -12
- package/docs/Theme_Integration.md +150 -0
- package/docs/_cover.md +1 -1
- package/docs/_sidebar.md +7 -6
- package/docs/_version.json +7 -0
- package/docs/api/PictFlowCard.md +6 -6
- package/docs/api/PictFlowCardPropertiesPanel.md +2 -2
- package/docs/api/addConnection.md +4 -4
- package/docs/api/addNode.md +6 -6
- package/docs/api/autoLayout.md +2 -2
- package/docs/api/getFlowData.md +5 -5
- package/docs/api/marshalToView.md +3 -3
- package/docs/api/openPanel.md +2 -2
- package/docs/api/registerHandler.md +3 -3
- package/docs/api/registerNodeType.md +3 -3
- package/docs/api/removeConnection.md +5 -5
- package/docs/api/removeNode.md +6 -6
- package/docs/api/saveLayout.md +2 -2
- package/docs/api/screenToSVGCoords.md +2 -2
- package/docs/api/selectNode.md +3 -3
- package/docs/api/setTheme.md +2 -2
- package/docs/api/setZoom.md +3 -3
- package/docs/api/toggleFullscreen.md +2 -2
- package/docs/card-help/EACH.md +3 -3
- package/docs/card-help/FREAD.md +5 -5
- package/docs/card-help/FWRITE.md +5 -5
- package/docs/card-help/GET.md +2 -2
- package/docs/card-help/ITE.md +3 -3
- package/docs/card-help/LOG.md +4 -4
- package/docs/card-help/NOTE.md +1 -1
- package/docs/card-help/PREV.md +2 -2
- package/docs/card-help/SET.md +5 -5
- package/docs/card-help/SPKL.md +2 -2
- package/docs/card-help/STAT.md +3 -3
- package/docs/card-help/SW.md +4 -4
- package/docs/css/docuserve.css +277 -23
- package/docs/index.html +2 -2
- package/docs/retold-catalog.json +1 -1
- package/docs/retold-keyword-index.json +1 -1
- package/example_applications/simple_cards/css/flowexample.css +2 -2
- package/example_applications/simple_cards/source/card-help-content.js +12 -12
- package/example_applications/simple_cards/source/cards/FlowCard-DataPreview.js +1 -1
- package/example_applications/simple_cards/source/sample-flows.js +410 -0
- package/example_applications/simple_cards/source/views/PictView-FlowExample-About.js +5 -5
- package/example_applications/simple_cards/source/views/PictView-FlowExample-Documentation.js +5 -5
- package/example_applications/simple_cards/source/views/PictView-FlowExample-FileWriteInfo.js +4 -4
- package/example_applications/simple_cards/source/views/PictView-FlowExample-MainWorkspace.js +141 -8
- package/example_applications/simple_cards/source/views/PictView-FlowExample-TopBar.js +2 -2
- package/package.json +8 -7
- package/source/Pict-Section-Flow.js +26 -0
- package/source/providers/PictProvider-Flow-CSS.js +435 -61
- package/source/providers/PictProvider-Flow-ConnectorShapes.js +9 -5
- package/source/providers/PictProvider-Flow-NodeTypes.js +10 -0
- package/source/providers/PictProvider-Flow-PanelChrome.js +7 -17
- package/source/providers/PictProvider-Flow-Theme.js +7 -7
- package/source/providers/edges/Edge-Bezier.js +41 -0
- package/source/providers/edges/Edge-Orthogonal.js +37 -0
- package/source/providers/edges/Edge-OrthogonalSnap.js +72 -0
- package/source/providers/edges/Edge-Perimeter-Linear.js +31 -0
- package/source/providers/edges/Edge-Perimeter-Orthogonal.js +39 -0
- package/source/providers/edges/Edge-Perimeter.js +48 -0
- package/source/providers/edges/Edge-PerimeterMath.js +92 -0
- package/source/providers/edges/Edge-Straight.js +24 -0
- package/source/providers/layouts/Layout-Circular.js +203 -0
- package/source/providers/layouts/Layout-Coerce.js +40 -0
- package/source/providers/layouts/Layout-Columnar.js +134 -0
- package/source/providers/layouts/Layout-Custom.js +27 -0
- package/source/providers/layouts/Layout-ForcedFromCenter.js +256 -0
- package/source/providers/layouts/Layout-Grid.js +134 -0
- package/source/providers/layouts/Layout-Layered.js +209 -0
- package/source/providers/layouts/Layout-Tabular.js +94 -0
- package/source/services/PictService-Flow-ConnectionRenderer.js +532 -28
- package/source/services/PictService-Flow-DataManager.js +12 -1
- package/source/services/PictService-Flow-InteractionManager.js +39 -42
- package/source/services/PictService-Flow-Layout.js +305 -121
- package/source/services/PictService-Flow-PortRenderer.js +108 -26
- package/source/services/PictService-Flow-RenderManager.js +41 -11
- package/source/views/PictView-Flow-FloatingToolbar.js +69 -61
- package/source/views/PictView-Flow-Node.js +47 -6
- package/source/views/PictView-Flow-PropertiesPanel.js +46 -53
- package/source/views/PictView-Flow-Toolbar.js +1065 -485
- package/source/views/PictView-Flow.js +455 -7
- package/test/Layout_tests.js +1400 -0
- package/test/PortRenderer_tests.js +11 -2
|
@@ -74,7 +74,17 @@ const _DefaultConfiguration =
|
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
Hash: 'Flow-NodeProps-Editor',
|
|
77
|
-
|
|
77
|
+
// Inline oninput/onpointerdown wired to the FlowView's helper —
|
|
78
|
+
// see PictViewFlow._applyNodePropChange / _stopEvent.
|
|
79
|
+
Template: '<div class="pict-flow-node-props-fields" data-flow-view="{~D:Record.FlowViewIdentifier~}" data-node-hash="{~D:Record.NodeHash~}">'
|
|
80
|
+
+ '<div class="pict-flow-node-props-field"><label class="pict-flow-node-props-label">Title</label><input type="text" class="pict-flow-node-props-input" data-prop="Title" value="{~D:Record.Title~}" oninput="_Pict.views[\'{~D:Record.FlowViewIdentifier~}\']._applyNodePropChange(\'{~D:Record.NodeHash~}\', this.getAttribute(\'data-prop\'), this.value, this.type, event)" onpointerdown="event.stopPropagation()" /></div>'
|
|
81
|
+
+ '<div class="pict-flow-node-props-field"><label class="pict-flow-node-props-label">Width</label><input type="number" class="pict-flow-node-props-input" data-prop="Width" value="{~D:Record.Width~}" min="60" step="10" oninput="_Pict.views[\'{~D:Record.FlowViewIdentifier~}\']._applyNodePropChange(\'{~D:Record.NodeHash~}\', this.getAttribute(\'data-prop\'), this.value, this.type, event)" onpointerdown="event.stopPropagation()" /></div>'
|
|
82
|
+
+ '<div class="pict-flow-node-props-field"><label class="pict-flow-node-props-label">Height</label><input type="number" class="pict-flow-node-props-input" data-prop="Height" value="{~D:Record.Height~}" min="40" step="10" oninput="_Pict.views[\'{~D:Record.FlowViewIdentifier~}\']._applyNodePropChange(\'{~D:Record.NodeHash~}\', this.getAttribute(\'data-prop\'), this.value, this.type, event)" onpointerdown="event.stopPropagation()" /></div>'
|
|
83
|
+
+ '<div class="pict-flow-node-props-field"><label class="pict-flow-node-props-label">Body Fill</label><input type="color" class="pict-flow-node-props-input pict-flow-node-props-color" data-prop="Style.BodyFill" value="{~D:Record.BodyFillValue~}" oninput="_Pict.views[\'{~D:Record.FlowViewIdentifier~}\']._applyNodePropChange(\'{~D:Record.NodeHash~}\', this.getAttribute(\'data-prop\'), this.value, this.type, event)" onpointerdown="event.stopPropagation()" /></div>'
|
|
84
|
+
+ '<div class="pict-flow-node-props-field"><label class="pict-flow-node-props-label">Body Stroke</label><input type="color" class="pict-flow-node-props-input pict-flow-node-props-color" data-prop="Style.BodyStroke" value="{~D:Record.BodyStrokeValue~}" oninput="_Pict.views[\'{~D:Record.FlowViewIdentifier~}\']._applyNodePropChange(\'{~D:Record.NodeHash~}\', this.getAttribute(\'data-prop\'), this.value, this.type, event)" onpointerdown="event.stopPropagation()" /></div>'
|
|
85
|
+
+ '<div class="pict-flow-node-props-field"><label class="pict-flow-node-props-label">Stroke Width</label><input type="number" class="pict-flow-node-props-input" data-prop="Style.BodyStrokeWidth" value="{~D:Record.BodyStrokeWidthValue~}" min="0" max="10" step="0.5" oninput="_Pict.views[\'{~D:Record.FlowViewIdentifier~}\']._applyNodePropChange(\'{~D:Record.NodeHash~}\', this.getAttribute(\'data-prop\'), this.value, this.type, event)" onpointerdown="event.stopPropagation()" /></div>'
|
|
86
|
+
+ '<div class="pict-flow-node-props-field"><label class="pict-flow-node-props-label">Title Bar</label><input type="color" class="pict-flow-node-props-input pict-flow-node-props-color" data-prop="Style.TitleBarColor" value="{~D:Record.TitleBarColorValue~}" oninput="_Pict.views[\'{~D:Record.FlowViewIdentifier~}\']._applyNodePropChange(\'{~D:Record.NodeHash~}\', this.getAttribute(\'data-prop\'), this.value, this.type, event)" onpointerdown="event.stopPropagation()" /></div>'
|
|
87
|
+
+ '</div>'
|
|
78
88
|
}
|
|
79
89
|
]
|
|
80
90
|
};
|
|
@@ -216,12 +226,11 @@ class PictViewFlowPropertiesPanel extends libPictView
|
|
|
216
226
|
let tmpFO = pPanelsLayer.querySelector(`[data-panel-hash="${pPanelData.Hash}"]`);
|
|
217
227
|
if (tmpFO)
|
|
218
228
|
{
|
|
219
|
-
// Render appearance and help tabs
|
|
229
|
+
// Render appearance and help tabs. Tab-switching click handlers
|
|
230
|
+
// are inline `onclick=` attributes in Flow-PanelChrome-Template
|
|
231
|
+
// that call FlowView._handlePanelTabClick → switchPanelTab.
|
|
220
232
|
this._renderAppearanceTab(pPanelData, tmpFO);
|
|
221
233
|
this._renderHelpTab(pPanelData, tmpFO);
|
|
222
|
-
|
|
223
|
-
// Wire up tab switching
|
|
224
|
-
this._wireTabSwitching(tmpFO);
|
|
225
234
|
}
|
|
226
235
|
}
|
|
227
236
|
|
|
@@ -559,27 +568,16 @@ class PictViewFlowPropertiesPanel extends libPictView
|
|
|
559
568
|
BodyFillValue: tmpStyle.BodyFill || tmpDefaultBodyFill,
|
|
560
569
|
BodyStrokeValue: tmpStyle.BodyStroke || tmpDefaultBodyStroke,
|
|
561
570
|
BodyStrokeWidthValue: tmpStyle.BodyStrokeWidth || 1,
|
|
562
|
-
TitleBarColorValue: tmpStyle.TitleBarColor || tmpDefaultTitleBarColor
|
|
571
|
+
TitleBarColorValue: tmpStyle.TitleBarColor || tmpDefaultTitleBarColor,
|
|
572
|
+
NodeHash: pPanelData.NodeHash,
|
|
573
|
+
FlowViewIdentifier: this._FlowView.options.ViewIdentifier
|
|
563
574
|
};
|
|
564
575
|
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
//
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
{
|
|
571
|
-
let tmpInput = tmpInputs[i];
|
|
572
|
-
let tmpProp = tmpInput.getAttribute('data-prop');
|
|
573
|
-
|
|
574
|
-
tmpInput.addEventListener('input', (pEvent) =>
|
|
575
|
-
{
|
|
576
|
-
pEvent.stopPropagation();
|
|
577
|
-
this._applyNodePropChange(pPanelData.NodeHash, tmpProp, tmpInput.value, tmpInput.type);
|
|
578
|
-
});
|
|
579
|
-
|
|
580
|
-
// Prevent pointer events from propagating to SVG drag handler
|
|
581
|
-
tmpInput.addEventListener('pointerdown', (pEvent) => { pEvent.stopPropagation(); });
|
|
582
|
-
}
|
|
576
|
+
// Inputs in the rendered template carry inline oninput/onpointerdown
|
|
577
|
+
// handlers that call the FlowView's _applyNodePropChange — no
|
|
578
|
+
// addEventListener wiring needed here.
|
|
579
|
+
this.pict.ContentAssignment.assignContent(tmpAppearancePane,
|
|
580
|
+
this.pict.parseTemplateByHash('Flow-NodeProps-Editor', tmpRecord));
|
|
583
581
|
}
|
|
584
582
|
|
|
585
583
|
/**
|
|
@@ -619,42 +617,37 @@ class PictViewFlowPropertiesPanel extends libPictView
|
|
|
619
617
|
}
|
|
620
618
|
|
|
621
619
|
/**
|
|
622
|
-
*
|
|
620
|
+
* Switch the visible tab pane within a panel foreignObject. Invoked
|
|
621
|
+
* from the inline `onclick` handler on tab buttons in
|
|
622
|
+
* Flow-PanelChrome-Template via FlowView._handlePanelTabClick.
|
|
623
623
|
*
|
|
624
|
-
* @param {Element}
|
|
624
|
+
* @param {Element} pTabElement - The clicked tab button
|
|
625
625
|
*/
|
|
626
|
-
|
|
626
|
+
switchPanelTab(pTabElement)
|
|
627
627
|
{
|
|
628
|
-
let
|
|
629
|
-
|
|
628
|
+
let tmpForeignObject = pTabElement.closest('foreignObject');
|
|
629
|
+
if (!tmpForeignObject) return;
|
|
630
|
+
|
|
631
|
+
let tmpTarget = pTabElement.getAttribute('data-tab-target');
|
|
632
|
+
let tmpTabs = tmpForeignObject.querySelectorAll('.pict-flow-panel-tab');
|
|
633
|
+
let tmpPanes = tmpForeignObject.querySelectorAll('.pict-flow-panel-tab-pane');
|
|
630
634
|
|
|
631
635
|
for (let i = 0; i < tmpTabs.length; i++)
|
|
632
636
|
{
|
|
633
|
-
tmpTabs[i].
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
{
|
|
641
|
-
tmpTabs[j].classList.remove('active');
|
|
642
|
-
}
|
|
643
|
-
for (let j = 0; j < tmpPanes.length; j++)
|
|
644
|
-
{
|
|
645
|
-
tmpPanes[j].classList.remove('active');
|
|
646
|
-
tmpPanes[j].style.display = 'none';
|
|
647
|
-
}
|
|
637
|
+
tmpTabs[i].classList.remove('active');
|
|
638
|
+
}
|
|
639
|
+
for (let i = 0; i < tmpPanes.length; i++)
|
|
640
|
+
{
|
|
641
|
+
tmpPanes[i].classList.remove('active');
|
|
642
|
+
tmpPanes[i].style.display = 'none';
|
|
643
|
+
}
|
|
648
644
|
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
tmpTargetPane.style.display = 'block';
|
|
656
|
-
}
|
|
657
|
-
});
|
|
645
|
+
pTabElement.classList.add('active');
|
|
646
|
+
let tmpTargetPane = tmpForeignObject.querySelector('.pict-flow-panel-tab-pane[data-tab="' + tmpTarget + '"]');
|
|
647
|
+
if (tmpTargetPane)
|
|
648
|
+
{
|
|
649
|
+
tmpTargetPane.classList.add('active');
|
|
650
|
+
tmpTargetPane.style.display = 'block';
|
|
658
651
|
}
|
|
659
652
|
}
|
|
660
653
|
|