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.
- 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 +99 -7
- package/source/providers/PictProvider-Flow-ConnectorShapes.js +8 -0
- package/source/providers/PictProvider-Flow-Geometry.js +11 -421
- package/source/providers/PictProvider-Flow-Icons.js +20 -0
- package/source/providers/PictProvider-Flow-Layouts.js +107 -0
- package/source/services/PictService-Flow-ConnectionRenderer.js +77 -5
- package/source/services/PictService-Flow-CursorManager.js +113 -0
- package/source/services/PictService-Flow-InteractionManager.js +443 -61
- 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 +57 -0
- package/source/views/PictView-Flow-Node.js +36 -0
- package/source/views/PictView-Flow-PropertiesPanel.js +27 -5
- package/source/views/PictView-Flow-Toolbar.js +148 -13
- package/source/views/PictView-Flow.js +628 -3
- 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/ConnectionHandleManager_tests.js +0 -717
- package/test/ConnectionRenderer_tests.js +0 -591
- 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/docs/index.html
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
7
|
-
<meta name="description" content="Pict-Section-Flow v1.0.1 Documentation — Pict Section Flow Diagram">
|
|
8
|
-
|
|
9
|
-
<title>Pict-Section-Flow v1.0.1 Documentation</title>
|
|
10
|
-
|
|
11
|
-
<!-- KaTeX stylesheet for LaTeX equation rendering -->
|
|
12
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/katex.min.css">
|
|
13
|
-
<!-- PICT Dynamic View CSS Container -->
|
|
14
|
-
<style id="PICT-CSS"></style>
|
|
15
|
-
|
|
16
|
-
<!-- Load the PICT library from jsDelivr CDN -->
|
|
17
|
-
<script src="https://cdn.jsdelivr.net/npm/pict@1/dist/pict.min.js" type="text/javascript"></script>
|
|
18
|
-
<!-- Bootstrap the Application -->
|
|
19
|
-
<script type="text/javascript">
|
|
20
|
-
//<![CDATA[
|
|
21
|
-
Pict.safeOnDocumentReady(() => { Pict.safeLoadPictApplication(PictDocuserve, 2)});
|
|
22
|
-
//]]>
|
|
23
|
-
</script>
|
|
24
|
-
</head>
|
|
25
|
-
<body>
|
|
26
|
-
<!-- The root container for the Pict application -->
|
|
27
|
-
<div id="Docuserve-Application-Container"></div>
|
|
28
|
-
|
|
29
|
-
<!-- Mermaid diagram rendering. pict-section-content (v0.1.8+) drives
|
|
30
|
-
initialization with theme: 'base' + themeVariables sourced
|
|
31
|
-
from --theme-color-* so diagrams follow the active theme. -->
|
|
32
|
-
<script src="https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.min.js"></script>
|
|
33
|
-
<!-- KaTeX for LaTeX equation rendering -->
|
|
34
|
-
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.21/dist/katex.min.js"></script>
|
|
35
|
-
<!-- Load the Docuserve PICT Application Bundle from jsDelivr CDN -->
|
|
36
|
-
<script src="https://cdn.jsdelivr.net/npm/pict-docuserve@1/dist/pict-docuserve.min.js" type="text/javascript"></script>
|
|
37
|
-
</body>
|
|
38
|
-
</html>
|
package/docs/playground/app.json
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"FlowData":
|
|
3
|
-
{
|
|
4
|
-
"Nodes":
|
|
5
|
-
[
|
|
6
|
-
{
|
|
7
|
-
"Hash": "node-source",
|
|
8
|
-
"Type": "default",
|
|
9
|
-
"X": 120,
|
|
10
|
-
"Y": 160,
|
|
11
|
-
"Width": 160,
|
|
12
|
-
"Height": 80,
|
|
13
|
-
"Title": "Read CSV",
|
|
14
|
-
"TitleBarColor": "#42a5f5",
|
|
15
|
-
"BodyStyle": { "fill": "#eaf2f8", "stroke": "#42a5f5" },
|
|
16
|
-
"Ports":
|
|
17
|
-
[
|
|
18
|
-
{ "Hash": "node-source-trigger", "Direction": "input", "Side": "left", "Label": "Run", "PortType": "event-in" },
|
|
19
|
-
{ "Hash": "node-source-rows", "Direction": "output", "Side": "right", "Label": "Rows", "PortType": "value" },
|
|
20
|
-
{ "Hash": "node-source-error", "Direction": "output", "Side": "right", "Label": "Error", "PortType": "error" }
|
|
21
|
-
],
|
|
22
|
-
"Data": { "FilePath": "/tmp/sample.csv" }
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"Hash": "node-transform",
|
|
26
|
-
"Type": "default",
|
|
27
|
-
"X": 420,
|
|
28
|
-
"Y": 120,
|
|
29
|
-
"Width": 170,
|
|
30
|
-
"Height": 80,
|
|
31
|
-
"Title": "Normalize",
|
|
32
|
-
"TitleBarColor": "#ec407a",
|
|
33
|
-
"BodyStyle": { "fill": "#fce4ec", "stroke": "#ec407a" },
|
|
34
|
-
"Ports":
|
|
35
|
-
[
|
|
36
|
-
{ "Hash": "node-transform-in", "Direction": "input", "Side": "left", "Label": "Rows", "PortType": "value" },
|
|
37
|
-
{ "Hash": "node-transform-out", "Direction": "output", "Side": "right", "Label": "Rows", "PortType": "value" }
|
|
38
|
-
],
|
|
39
|
-
"Data": { "TrimWhitespace": true, "Lowercase": true }
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"Hash": "node-sink",
|
|
43
|
-
"Type": "default",
|
|
44
|
-
"X": 720,
|
|
45
|
-
"Y": 160,
|
|
46
|
-
"Width": 160,
|
|
47
|
-
"Height": 80,
|
|
48
|
-
"Title": "Write JSON",
|
|
49
|
-
"TitleBarColor": "#66bb6a",
|
|
50
|
-
"BodyStyle": { "fill": "#e8f5e9", "stroke": "#66bb6a" },
|
|
51
|
-
"Ports":
|
|
52
|
-
[
|
|
53
|
-
{ "Hash": "node-sink-in", "Direction": "input", "Side": "left", "Label": "Rows", "PortType": "value" },
|
|
54
|
-
{ "Hash": "node-sink-done", "Direction": "output", "Side": "right", "Label": "Done", "PortType": "event-out" }
|
|
55
|
-
],
|
|
56
|
-
"Data": { "FilePath": "/tmp/output.json" }
|
|
57
|
-
}
|
|
58
|
-
],
|
|
59
|
-
"Connections":
|
|
60
|
-
[
|
|
61
|
-
{
|
|
62
|
-
"Hash": "edge-source-to-transform",
|
|
63
|
-
"SourceNodeHash": "node-source",
|
|
64
|
-
"SourcePortHash": "node-source-rows",
|
|
65
|
-
"TargetNodeHash": "node-transform",
|
|
66
|
-
"TargetPortHash": "node-transform-in",
|
|
67
|
-
"Data": {}
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"Hash": "edge-transform-to-sink",
|
|
71
|
-
"SourceNodeHash": "node-transform",
|
|
72
|
-
"SourcePortHash": "node-transform-out",
|
|
73
|
-
"TargetNodeHash": "node-sink",
|
|
74
|
-
"TargetPortHash": "node-sink-in",
|
|
75
|
-
"Data": {}
|
|
76
|
-
}
|
|
77
|
-
],
|
|
78
|
-
"OpenPanels": [],
|
|
79
|
-
"SavedLayouts": [],
|
|
80
|
-
"ViewState": { "PanX": 0, "PanY": 0, "Zoom": 1, "SelectedNodeHash": null, "SelectedConnectionHash": null, "SelectedTetherHash": null },
|
|
81
|
-
"LayoutAlgorithm": "Custom",
|
|
82
|
-
"LayoutParameters": {},
|
|
83
|
-
"LayoutAutoApply": false
|
|
84
|
-
}
|
|
85
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// Application Code for the Flow playground.
|
|
2
|
-
//
|
|
3
|
-
// `Base` is the synthesized PictApplication wrapper that registers the
|
|
4
|
-
// Flow view from your Pict Config (under `FlowViewConfig`). The view
|
|
5
|
-
// reads its data from `AppData.FlowData` (set in Initial AppData) via
|
|
6
|
-
// the configured `FlowDataAddress`.
|
|
7
|
-
//
|
|
8
|
-
// Return a class that extends `Base` to add lifecycle hooks or
|
|
9
|
-
// register additional views/providers. Most playgrounds need nothing
|
|
10
|
-
// custom here — edit the data/config tabs and click Run.
|
|
11
|
-
//
|
|
12
|
-
// Example: log the current flow data after the diagram renders so you
|
|
13
|
-
// can inspect node hashes, connection wiring, and saved viewport state
|
|
14
|
-
// in the browser console.
|
|
15
|
-
//
|
|
16
|
-
return class extends Base
|
|
17
|
-
{
|
|
18
|
-
onAfterInitialize()
|
|
19
|
-
{
|
|
20
|
-
super.onAfterInitialize();
|
|
21
|
-
console.log('[playground] Initial FlowData =', this.pict.AppData.FlowData);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Product": "FlowPlayground",
|
|
3
|
-
"FlowViewConfig":
|
|
4
|
-
{
|
|
5
|
-
"FlowDataAddress": "AppData.FlowData",
|
|
6
|
-
"EnableToolbar": true,
|
|
7
|
-
"EnableCardPalette": true,
|
|
8
|
-
"IncludeDefaultNodeTypes": true,
|
|
9
|
-
"EnablePanning": true,
|
|
10
|
-
"EnableZooming": true,
|
|
11
|
-
"EnableNodeDragging": true,
|
|
12
|
-
"EnableConnectionCreation":true,
|
|
13
|
-
"EnableLayoutMenu": true,
|
|
14
|
-
"DefaultLayoutAlgorithm": "Custom",
|
|
15
|
-
"DefaultEdgeTheme": "Bezier"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";function _defineProperty(i,t,e){return(t=_toPropertyKey(t))in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function _toPropertyKey(i){var t=_toPrimitive(i,"string");return"symbol"==typeof t?t:t+""}function _toPrimitive(i,t){if("object"!=typeof i||!i)return i;var e=i[Symbol.toPrimitive];if(void 0!==e){var s=e.call(i,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(i)}!function(i){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=i();else if("function"==typeof define&&define.amd)define([],i);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).PictApplication=i()}}((function(){return function i(t,e,s){function o(a,r){if(!e[a]){if(!t[a]){var h="function"==typeof require&&require;if(!r&&h)return h(a,!0);if(n)return n(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=e[a]={exports:{}};t[a][0].call(c.exports,(function(i){return o(t[a][1][i]||i)}),c,c.exports,i,t,e,s)}return e[a].exports}for(var n="function"==typeof require&&require,a=0;a<s.length;a++)o(s[a]);return o}({1:[function(i,t,e){t.exports={name:"fable-serviceproviderbase",version:"3.0.15",description:"Simple base classes for fable services.",main:"source/Fable-ServiceProviderBase.js",scripts:{start:"node source/Fable-ServiceProviderBase.js",test:"npx mocha -u tdd -R spec",tests:"npx mocha -u tdd --exit -R spec --grep",coverage:"npx nyc --reporter=lcov --reporter=text-lcov npx mocha -- -u tdd -R spec",build:"npx quack build"},mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},repository:{type:"git",url:"https://github.com/stevenvelozo/fable-serviceproviderbase.git"},keywords:["entity","behavior"],author:"Steven Velozo <steven@velozo.com> (http://velozo.com/)",license:"MIT",bugs:{url:"https://github.com/stevenvelozo/fable-serviceproviderbase/issues"},homepage:"https://github.com/stevenvelozo/fable-serviceproviderbase",devDependencies:{fable:"^3.0.143",quackage:"^1.0.33"}}},{}],2:[function(i,t,e){const s=i("../package.json");class o{constructor(i,t,e){"object"==typeof i&&i.isFable?this.connectFable(i):this.fable=!1,this._PackageFableServiceProvider=s,this.fable?(this.UUID=i.getUUID(),this.options="object"==typeof t?t:{}):(this.options="object"!=typeof i||i.isFable?"object"==typeof t?t:{}:i,this.UUID=`CORE-SVC-${Math.floor(89999*Math.random()+1e4)}`),this.serviceType=`Unknown-${this.UUID}`,this.Hash="string"==typeof e?e:this.fable||"string"!=typeof t?`${this.UUID}`:t}connectFable(i){if("object"!=typeof i||!i.isFable){let t=`Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [${typeof i}].}`;return console.log(t),new Error(t)}return this.fable||(this.fable=i),this.log||(this.log=this.fable.Logging),this.services||(this.services=this.fable.services),this.servicesMap||(this.servicesMap=this.fable.servicesMap),!0}}_defineProperty(o,"isFableService",!0),t.exports=o,t.exports.CoreServiceProviderBase=o},{"../package.json":1}],3:[function(i,t,e){t.exports={name:"pict-application",version:"1.0.30",description:"Application base class for a pict view-based application",main:"source/Pict-Application.js",scripts:{test:"npx mocha -u tdd -R spec",start:"node source/Pict-Application.js",coverage:"npx nyc --reporter=lcov --reporter=text-lcov npx mocha -- -u tdd -R spec",build:"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-application-image:local","docker-dev-run":'docker run -it -d --name pict-application-dev -p 30001:8080 -p 38086:8086 -v "$PWD/.config:/home/coder/.config" -v "$PWD:/home/coder/pict-application" -u "$(id -u):$(id -g)" -e "DOCKER_USER=$USER" pict-application-image:local',"docker-dev-shell":"docker exec -it pict-application-dev /bin/bash",tests:"npx mocha -u tdd --exit -R spec --grep",lint:"eslint source/**",types:"tsc -p ."},types:"types/source/Pict-Application.d.ts",repository:{type:"git",url:"git+https://github.com/stevenvelozo/pict-application.git"},author:"steven velozo <steven@velozo.com>",license:"MIT",bugs:{url:"https://github.com/stevenvelozo/pict-application/issues"},homepage:"https://github.com/stevenvelozo/pict-application#readme",devDependencies:{"@eslint/js":"^9.28.0","browser-env":"^3.3.0",eslint:"^9.28.0",pict:"^1.0.343","pict-provider":"^1.0.7","pict-view":"^1.0.64",quackage:"^1.0.45"},mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},dependencies:{"fable-serviceproviderbase":"^3.0.15"}}},{}],4:[function(i,t,e){const s=i("fable-serviceproviderbase"),o=i("../package.json"),n={Name:"DefaultPictApplication",MainViewportViewIdentifier:"Default-View",MainViewportRenderableHash:!1,MainViewportDestinationAddress:!1,MainViewportDefaultDataAddress:!1,AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!0,AutoRenderViewsAfterInitialize:!1,AutoLoginAfterInitialize:!1,AutoLoadDataAfterLogin:!1,ConfigurationOnlyViews:[],Manifests:{},IdentifierAddressPrefix:"PICT-"};t.exports=class extends s{constructor(i,t,e){let s="object"==typeof i.settings.PictApplicationConfiguration?i.settings.PictApplicationConfiguration:{};super(i,Object.assign({},JSON.parse(JSON.stringify(n)),s,t),e),this.options,this.log,this.fable,this.UUID,this.Hash,this.servicesMap,this.serviceType="PictApplication",this._Package=o,this.pict=this.fable,this.AppData=this.fable.AppData,this.Bundle=this.fable.Bundle,this.initializeTimestamp,this.lastSolvedTimestamp,this.lastLoginTimestamp,this.lastMarshalFromViewsTimestamp,this.lastMarshalToViewsTimestamp,this.lastAutoRenderTimestamp,this.lastLoadDataTimestamp;let a=Object.keys(this.options.Manifests);if(a.length>0)for(let i=0;i<a.length;i++){let t=a[i];this.fable.instantiateServiceProvider("Manifest",this.options.Manifests[t],t)}}onPreSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onPreSolve:`),!0}onPreSolveAsync(i){return this.onPreSolve(),i()}onBeforeSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeSolve:`),!0}onBeforeSolveAsync(i){return this.onBeforeSolve(),i()}onSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onSolve:`),!0}onSolveAsync(i){return this.onSolve(),i()}solve(){this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} executing solve() function...`);let i=Object.keys(this.pict.providers),t=[];for(let e=0;e<i.length;e++){let s=this.pict.providers[i[e]];s.options.AutoSolveWithApp&&t.push(s)}t.sort(((i,t)=>i.options.AutoSolveOrdinal-t.options.AutoSolveOrdinal));for(let i=0;i<t.length;i++)t[i].solve(t[i]);this.onBeforeSolve();let e=Object.keys(this.pict.views),s=[];for(let i=0;i<e.length;i++){let t=this.pict.views[e[i]];t.options.AutoInitialize&&s.push(t)}s.sort(((i,t)=>i.options.AutoInitializeOrdinal-t.options.AutoInitializeOrdinal));for(let i=0;i<s.length;i++)s[i].solve();return this.onSolve(),this.onAfterSolve(),this.lastSolvedTimestamp=this.fable.log.getTimeStamp(),!0}solveAsync(i){let t=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");t.anticipate(this.onBeforeSolveAsync.bind(this));let e="function"==typeof i&&i;e||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),e=i=>{i&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync Auto Callback Error: ${i}`,i)});let s=Object.keys(this.pict.providers),o=[];for(let i=0;i<s.length;i++){let t=this.pict.providers[s[i]];t.options.AutoSolveWithApp&&o.push(t)}o.sort(((i,t)=>i.options.AutoSolveOrdinal-t.options.AutoSolveOrdinal));for(let i=0;i<o.length;i++)t.anticipate(o[i].solveAsync.bind(o[i]));let n=Object.keys(this.pict.views),a=[];for(let i=0;i<n.length;i++){let t=this.pict.views[n[i]];t.options.AutoSolveWithApp&&a.push(t)}a.sort(((i,t)=>i.options.AutoSolveOrdinal-t.options.AutoSolveOrdinal));for(let i=0;i<a.length;i++)t.anticipate(a[i].solveAsync.bind(a[i]));t.anticipate(this.onSolveAsync.bind(this)),t.anticipate(this.onAfterSolveAsync.bind(this)),t.wait((i=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync() complete.`),this.lastSolvedTimestamp=this.fable.log.getTimeStamp(),e(i))))}onAfterSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterSolve:`),!0}onAfterSolveAsync(i){return this.onAfterSolve(),i()}onBeforeLoginAsync(i){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeLoginAsync:`),i()}onLoginAsync(i){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onLoginAsync:`),i()}loginAsync(i){const t=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");let e=i;"function"!=typeof e&&(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loginAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),e=i=>{i&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loginAsync Auto Callback Error: ${i}`,i)}),t.anticipate(this.onBeforeLoginAsync.bind(this)),t.anticipate(this.onLoginAsync.bind(this)),t.anticipate(this.onAfterLoginAsync.bind(this)),this.options.AutoLoadDataAfterLogin&&t.anticipate((i=>{if(!this.isLoggedIn())return i();this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto loading data after login...`),this.loadDataAsync((t=>{i(t)}))})),t.wait((i=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loginAsync() complete.`),this.lastLoginTimestamp=this.fable.log.getTimeStamp(),e(i))))}isLoggedIn(){return!0}onAfterLoginAsync(i){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterLoginAsync:`),i()}onBeforeLoadDataAsync(i){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeLoadDataAsync:`),i()}onLoadDataAsync(i){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onLoadDataAsync:`),i()}loadDataAsync(i){const t=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");let e=i;"function"!=typeof e&&(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loadDataAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),e=i=>{i&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loadDataAsync Auto Callback Error: ${i}`,i)}),t.anticipate(this.onBeforeLoadDataAsync.bind(this));let s=Object.keys(this.pict.providers),o=[];for(let i=0;i<s.length;i++){let t=this.pict.providers[s[i]];t.options.AutoLoadDataWithApp&&o.push(t)}o.sort(((i,t)=>i.options.AutoLoadDataOrdinal-t.options.AutoLoadDataOrdinal));for(const i of o)t.anticipate(i.onBeforeLoadDataAsync.bind(i));t.anticipate(this.onLoadDataAsync.bind(this));for(const i of o)t.anticipate(i.onLoadDataAsync.bind(i));t.anticipate(this.onAfterLoadDataAsync.bind(this));for(const i of o)t.anticipate(i.onAfterLoadDataAsync.bind(i));t.wait((i=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loadDataAsync() complete.`),this.lastLoadDataTimestamp=this.fable.log.getTimeStamp(),e(i))))}onAfterLoadDataAsync(i){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterLoadDataAsync:`),i()}onBeforeSaveDataAsync(i){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeSaveDataAsync:`),i()}onSaveDataAsync(i){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onSaveDataAsync:`),i()}saveDataAsync(i){const t=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");let e=i;"function"!=typeof e&&(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} saveDataAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),e=i=>{i&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} saveDataAsync Auto Callback Error: ${i}`,i)}),t.anticipate(this.onBeforeSaveDataAsync.bind(this));let s=Object.keys(this.pict.providers),o=[];for(let i=0;i<s.length;i++){let t=this.pict.providers[s[i]];t.options.AutoSaveDataWithApp&&o.push(t)}o.sort(((i,t)=>i.options.AutoSaveDataOrdinal-t.options.AutoSaveDataOrdinal));for(const i of o)t.anticipate(i.onBeforeSaveDataAsync.bind(i));t.anticipate(this.onSaveDataAsync.bind(this));for(const i of o)t.anticipate(i.onSaveDataAsync.bind(i));t.anticipate(this.onAfterSaveDataAsync.bind(this));for(const i of o)t.anticipate(i.onAfterSaveDataAsync.bind(i));t.wait((i=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} saveDataAsync() complete.`),this.lastSaveDataTimestamp=this.fable.log.getTimeStamp(),e(i))))}onAfterSaveDataAsync(i){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterSaveDataAsync:`),i()}onBeforeInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeInitialize:`),!0}onBeforeInitializeAsync(i){return this.onBeforeInitialize(),i()}onInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onInitialize:`),!0}onInitializeAsync(i){return this.onInitialize(),i()}initialize(){if(this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} initialize:`),this.initializeTimestamp)return this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initialize called but initialization is already completed. Aborting.`),!1;{if(this.onBeforeInitialize(),"ConfigurationOnlyViews"in this.options)for(let i=0;i<this.options.ConfigurationOnlyViews.length;i++){let t=void 0===this.options.ConfigurationOnlyViews[i].ViewIdentifier?`AutoView-${this.fable.getUUID()}`:this.options.ConfigurationOnlyViews[i].ViewIdentifier;this.log.info(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} adding configuration only view: ${t}`),this.pict.addView(t,this.options.ConfigurationOnlyViews[i])}this.onInitialize();let i=Object.keys(this.pict.providers),t=[];for(let e=0;e<i.length;e++){let s=this.pict.providers[i[e]];s.options.AutoInitialize&&t.push(s)}t.sort(((i,t)=>i.options.AutoInitializeOrdinal-t.options.AutoInitializeOrdinal));for(let i=0;i<t.length;i++)t[i].initialize();let e=Object.keys(this.pict.views),s=[];for(let i=0;i<e.length;i++){let t=this.pict.views[e[i]];t.options.AutoInitialize&&s.push(t)}s.sort(((i,t)=>i.options.AutoInitializeOrdinal-t.options.AutoInitializeOrdinal));for(let i=0;i<s.length;i++)s[i].initialize();return this.onAfterInitialize(),this.options.AutoSolveAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto solving after initialization...`),this.solve()),this.options.AutoRenderMainViewportViewAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto rendering after initialization...`),this.render()),this.initializeTimestamp=this.fable.log.getTimeStamp(),this.onCompletionOfInitialize(),!0}}initializeAsync(i){this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} initializeAsync:`);let t="function"==typeof i&&i;if(t||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initializeAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),t=i=>{i&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initializeAsync Auto Callback Error: ${i}`,i)}),this.initializeTimestamp)return this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} async initialize called but initialization is already completed. Aborting.`),this.onCompletionOfInitializeAsync(t);{let i=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");if(this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} beginning initialization...`),"ConfigurationOnlyViews"in this.options)for(let i=0;i<this.options.ConfigurationOnlyViews.length;i++){let t=void 0===this.options.ConfigurationOnlyViews[i].ViewIdentifier?`AutoView-${this.fable.getUUID()}`:this.options.ConfigurationOnlyViews[i].ViewIdentifier;this.log.info(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} adding configuration only view: ${t}`),this.pict.addView(t,this.options.ConfigurationOnlyViews[i])}i.anticipate(this.onBeforeInitializeAsync.bind(this)),i.anticipate(this.onInitializeAsync.bind(this));let e=Object.keys(this.pict.providers),s=[];for(let i=0;i<e.length;i++){let t=this.pict.providers[e[i]];t.options.AutoInitialize&&s.push(t)}s.sort(((i,t)=>i.options.AutoInitializeOrdinal-t.options.AutoInitializeOrdinal));for(let t=0;t<s.length;t++)i.anticipate(s[t].initializeAsync.bind(s[t]));let o=Object.keys(this.pict.views),n=[];for(let i=0;i<o.length;i++){let t=this.pict.views[o[i]];t.options.AutoInitialize&&n.push(t)}n.sort(((i,t)=>i.options.AutoInitializeOrdinal-t.options.AutoInitializeOrdinal));for(let t=0;t<n.length;t++){let e=n[t];i.anticipate(e.initializeAsync.bind(e))}i.anticipate(this.onAfterInitializeAsync.bind(this)),this.options.AutoLoginAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto login (asynchronously) after initialization...`),i.anticipate(this.loginAsync.bind(this))),this.options.AutoSolveAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto solving (asynchronously) after initialization...`),i.anticipate(this.solveAsync.bind(this))),this.options.AutoRenderMainViewportViewAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto rendering (asynchronously) after initialization...`),i.anticipate(this.renderMainViewportAsync.bind(this))),i.wait((i=>(i&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initializeAsync Error: ${i.message||i}`,{stack:i.stack}),this.initializeTimestamp=this.fable.log.getTimeStamp(),this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initialization complete.`),t())))}}onAfterInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterInitialize:`),!0}onAfterInitializeAsync(i){return this.onAfterInitialize(),i()}onCompletionOfInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onCompletionOfInitialize:`),!0}onCompletionOfInitializeAsync(i){return this.onCompletionOfInitialize(),i()}onBeforeMarshalFromViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeMarshalFromViews:`),!0}onBeforeMarshalFromViewsAsync(i){return this.onBeforeMarshalFromViews(),i()}onMarshalFromViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onMarshalFromViews:`),!0}onMarshalFromViewsAsync(i){return this.onMarshalFromViews(),i()}marshalFromViews(){this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} executing marshalFromViews() function...`),this.onBeforeMarshalFromViews();let i=Object.keys(this.pict.views),t=[];for(let e=0;e<i.length;e++){let s=this.pict.views[i[e]];t.push(s)}for(let i=0;i<t.length;i++)t[i].marshalFromView();return this.onMarshalFromViews(),this.onAfterMarshalFromViews(),this.lastMarshalFromViewsTimestamp=this.fable.log.getTimeStamp(),!0}marshalFromViewsAsync(i){let t=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate"),e="function"==typeof i&&i;e||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),e=i=>{i&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewsAsync Auto Callback Error: ${i}`,i)}),t.anticipate(this.onBeforeMarshalFromViewsAsync.bind(this));let s=Object.keys(this.pict.views),o=[];for(let i=0;i<s.length;i++){let t=this.pict.views[s[i]];o.push(t)}for(let i=0;i<o.length;i++)t.anticipate(o[i].marshalFromViewAsync.bind(o[i]));t.anticipate(this.onMarshalFromViewsAsync.bind(this)),t.anticipate(this.onAfterMarshalFromViewsAsync.bind(this)),t.wait((i=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewsAsync() complete.`),this.lastMarshalFromViewsTimestamp=this.fable.log.getTimeStamp(),e(i))))}onAfterMarshalFromViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterMarshalFromViews:`),!0}onAfterMarshalFromViewsAsync(i){return this.onAfterMarshalFromViews(),i()}onBeforeMarshalToViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeMarshalToViews:`),!0}onBeforeMarshalToViewsAsync(i){return this.onBeforeMarshalToViews(),i()}onMarshalToViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onMarshalToViews:`),!0}onMarshalToViewsAsync(i){return this.onMarshalToViews(),i()}marshalToViews(){this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} executing marshalToViews() function...`),this.onBeforeMarshalToViews();let i=Object.keys(this.pict.views),t=[];for(let e=0;e<i.length;e++){let s=this.pict.views[i[e]];t.push(s)}for(let i=0;i<t.length;i++)t[i].marshalToView();return this.onMarshalToViews(),this.onAfterMarshalToViews(),this.lastMarshalToViewsTimestamp=this.fable.log.getTimeStamp(),!0}marshalToViewsAsync(i){let t=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate"),e="function"==typeof i&&i;e||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),e=i=>{i&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewsAsync Auto Callback Error: ${i}`,i)}),t.anticipate(this.onBeforeMarshalToViewsAsync.bind(this));let s=Object.keys(this.pict.views),o=[];for(let i=0;i<s.length;i++){let t=this.pict.views[s[i]];o.push(t)}for(let i=0;i<o.length;i++)t.anticipate(o[i].marshalToViewAsync.bind(o[i]));t.anticipate(this.onMarshalToViewsAsync.bind(this)),t.anticipate(this.onAfterMarshalToViewsAsync.bind(this)),t.wait((i=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewsAsync() complete.`),this.lastMarshalToViewsTimestamp=this.fable.log.getTimeStamp(),e(i))))}onAfterMarshalToViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterMarshalToViews:`),!0}onAfterMarshalToViewsAsync(i){return this.onAfterMarshalToViews(),i()}onBeforeRender(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeRender:`),!0}onBeforeRenderAsync(i){return this.onBeforeRender(),i()}render(i,t,e,s){let o="string"!=typeof i?this.options.MainViewportViewIdentifier:i,n="string"!=typeof t?this.options.MainViewportRenderableHash:t,a="string"!=typeof e?this.options.MainViewportDestinationAddress:e,r="string"!=typeof s?this.options.MainViewportDefaultDataAddress:s;this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} VIEW Renderable[${n}] Destination[${a}] TemplateDataAddress[${r}] render:`),this.onBeforeRender();let h="string"==typeof o&&this.servicesMap.PictView[o];return h?(this.onRender(),h.render(n,a,r),this.onAfterRender(),!0):(this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} could not render from View ${o} because it is not a valid view.`),!1)}onRender(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onRender:`),!0}onRenderAsync(i){return this.onRender(),i()}renderAsync(i,t,e,s,o){let n="string"!=typeof i?this.options.MainViewportViewIdentifier:i,a="string"!=typeof t?this.options.MainViewportRenderableHash:t,r="string"!=typeof e?this.options.MainViewportDestinationAddress:e,h="string"!=typeof s?this.options.MainViewportDefaultDataAddress:s,l="function"==typeof o?o:"function"==typeof s?s:"function"==typeof e?e:"function"==typeof t?t:"function"==typeof i&&i;l||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),l=i=>{i&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAsync Auto Callback Error: ${i}`,i)}),this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} VIEW Renderable[${a}] Destination[${r}] TemplateDataAddress[${h}] renderAsync:`);let c=this.fable.newAnticipate();c.anticipate(this.onBeforeRenderAsync.bind(this));let p="string"==typeof n&&this.servicesMap.PictView[n];if(!p){let i=`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} could not asynchronously render from View ${n} because it is not a valid view.`;return this.pict.LogNoisiness>3&&this.log.error(i),l(new Error(i))}return c.anticipate(this.onRenderAsync.bind(this)),c.anticipate((i=>{p.renderAsync.call(p,a,r,h,i)})),c.anticipate(this.onAfterRenderAsync.bind(this)),c.wait(l)}onAfterRender(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterRender:`),!0}onAfterRenderAsync(i){return this.onAfterRender(),i()}renderMainViewport(){return this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderMainViewport:`),this.render()}renderMainViewportAsync(i){return this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderMainViewportAsync:`),this.renderAsync(i)}renderAutoViews(){this.pict.LogNoisiness>0&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} beginning renderAutoViews...`);let i=Object.keys(this.pict.views);i.sort(((i,t)=>this.pict.views[i].options.AutoRenderOrdinal-this.pict.views[t].options.AutoRenderOrdinal));for(let t=0;t<i.length;t++){let e=this.pict.views[i[t]];e.options.AutoRender&&e.render()}this.pict.LogNoisiness>0&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAutoViewsAsync complete.`)}renderAutoViewsAsync(i){let t=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate"),e="function"==typeof i&&i;e||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAutoViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),e=i=>{i&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAutoViewsAsync Auto Callback Error: ${i}`,i)}),this.pict.LogNoisiness>0&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} beginning renderAutoViewsAsync...`);let s=Object.keys(this.pict.views);s.sort(((i,t)=>this.pict.views[i].options.AutoRenderOrdinal-this.pict.views[t].options.AutoRenderOrdinal));for(let i=0;i<s.length;i++){let e=this.pict.views[s[i]];e.options.AutoRender&&t.anticipate(e.renderAsync.bind(e))}t.wait((i=>(this.lastAutoRenderTimestamp=this.fable.log.getTimeStamp(),this.pict.LogNoisiness>0&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAutoViewsAsync complete.`),e(i))))}get isPictApplication(){return!0}}},{"../package.json":3,"fable-serviceproviderbase":2}]},{},[4])(4)}));
|
|
2
|
-
//# sourceMappingURL=pict-application.min.js.map
|