base-screen 0.3.0 → 0.4.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/dist/_internal/contracts/document/schema.d.ts +7 -0
- package/dist/_internal/contracts/document/schema.js +1 -1
- package/dist/_internal/contracts/document/validate-value-ref.js +6 -1
- package/dist/_internal/contracts/screen-document.schema.json +15 -3
- package/dist/_internal/contracts/types/diagnostics.d.ts +1 -1
- package/dist/_internal/contracts/types/document.d.ts +3 -1
- package/dist/_internal/core/blueprint/runtime-simulate.d.ts +57 -0
- package/dist/_internal/core/blueprint/runtime-simulate.js +177 -0
- package/dist/_internal/core/blueprint/runtime.d.ts +1 -0
- package/dist/_internal/core/blueprint/runtime.js +1 -0
- package/dist/_internal/core/commands/apply-collection-commands.d.ts +32 -0
- package/dist/_internal/core/commands/apply-collection-commands.js +174 -0
- package/dist/_internal/core/commands/apply.js +13 -0
- package/dist/_internal/core/commands/parse-command.js +12 -0
- package/dist/_internal/core/commands/types.d.ts +29 -1
- package/dist/_internal/core/data/data-candidates.d.ts +38 -0
- package/dist/_internal/core/data/data-candidates.js +186 -0
- package/dist/_internal/core/data/dataset-profile.d.ts +71 -0
- package/dist/_internal/core/data/dataset-profile.js +170 -0
- package/dist/_internal/core/data/sample-values.d.ts +25 -0
- package/dist/_internal/core/data/sample-values.js +45 -0
- package/dist/_internal/core/diff/screen-diff.js +6 -0
- package/dist/_internal/core/index.d.ts +7 -1
- package/dist/_internal/core/index.js +7 -1
- package/dist/_internal/core/state/state-preset.d.ts +32 -0
- package/dist/_internal/core/state/state-preset.js +37 -0
- package/dist/_internal/core/validation/layout-audit.d.ts +17 -0
- package/dist/_internal/core/validation/layout-audit.js +228 -0
- package/dist/_internal/core/validation/legibility.d.ts +9 -0
- package/dist/_internal/core/validation/legibility.js +33 -0
- package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-draft-controller.d.ts +6 -1
- package/dist/_internal/engine/browser/controllers/designer-change-controller.d.ts +27 -0
- package/dist/_internal/engine/browser/dom/change/designer-change-dom.d.ts +21 -5
- package/dist/_internal/engine/browser/dom/dataset/designer-data-section-diff.d.ts +4 -6
- package/dist/_internal/engine/browser/dom/value-ref/designer-value-ref-types.d.ts +2 -0
- package/dist/_internal/engine/browser/viewport/designer-canvas-aids-types.d.ts +3 -3
- package/dist/_internal/engine/browser/viewport/designer-canvas-aids.d.ts +5 -3
- package/dist/_internal/engine/browser/viewport/designer-canvas-measurements.d.ts +2 -14
- package/dist/_internal/engine/browser/viewport/designer-guide-overlay-nodes.d.ts +2 -0
- package/dist/_internal/engine/browser/viewport/designer-snap-tuning.d.ts +14 -0
- package/dist/_internal/engine/common/operations/change/designer-change-events.d.ts +2 -0
- package/dist/_internal/engine/common/operations/change/designer-change-proposal.d.ts +35 -2
- package/dist/_internal/engine/common/operations/display/designer-target-display.d.ts +2 -2
- package/dist/_internal/engine/common/operations/style/designer-component-states.d.ts +7 -2
- package/dist/_internal/engine/common/ui-text/designer-ui-text.d.ts +42 -2
- package/dist/_internal/engine/{designer-blueprint-workbench-panel-CJ3iZo5v.js → designer-blueprint-workbench-panel-BWSglfAb.js} +210 -290
- package/dist/_internal/engine/{designer-dataset-controller-CrfOg2Ys.js → designer-dataset-controller-DdbY4ILC.js} +619 -561
- package/dist/_internal/engine/designer-element/api/designer-element-change.d.ts +24 -0
- package/dist/_internal/engine/designer-element/base-screen-designer-element.d.ts +12 -0
- package/dist/_internal/engine/designer-element/designer-element-public-api.d.ts +2 -1
- package/dist/_internal/engine/designer-element/runtime/designer-element-rendering.d.ts +1 -1
- package/dist/_internal/engine/designer-element/runtime/designer-element-runtime.d.ts +4 -1
- package/dist/_internal/engine/designer-element/runtime/designer-element-sample-data.d.ts +23 -0
- package/dist/_internal/engine/{designer-field-primitives-KBZuWN_D.js → designer-field-primitives-Crn464Qg.js} +44 -3
- package/dist/_internal/engine/{designer-left-panel-groups-dom-N2OHOWjl.js → designer-left-panel-groups-dom-DFdLWxxY.js} +2 -2
- package/dist/_internal/engine/{host-resource-selection-xo2mLCD4.js → host-resource-selection-CWrPLVOc.js} +2 -2
- package/dist/_internal/engine/index.js +4742 -4360
- package/dist/_internal/host-kit/index.d.ts +1 -0
- package/dist/_internal/host-kit/index.js +1 -0
- package/dist/_internal/host-kit/intent/index.d.ts +16 -0
- package/dist/_internal/host-kit/intent/index.js +13 -0
- package/dist/_internal/host-kit/intent/intent-behavior.d.ts +59 -0
- package/dist/_internal/host-kit/intent/intent-behavior.js +812 -0
- package/dist/_internal/host-kit/intent/intent-block.d.ts +59 -0
- package/dist/_internal/host-kit/intent/intent-block.js +359 -0
- package/dist/_internal/host-kit/intent/intent-catalog.d.ts +105 -0
- package/dist/_internal/host-kit/intent/intent-catalog.js +60 -0
- package/dist/_internal/host-kit/intent/intent-compile-types.d.ts +222 -0
- package/dist/_internal/host-kit/intent/intent-compile-types.js +10 -0
- package/dist/_internal/host-kit/intent/intent-compile.d.ts +35 -0
- package/dist/_internal/host-kit/intent/intent-compile.js +465 -0
- package/dist/_internal/host-kit/intent/intent-data-check.d.ts +50 -0
- package/dist/_internal/host-kit/intent/intent-data-check.js +163 -0
- package/dist/_internal/host-kit/intent/intent-data-context.d.ts +53 -0
- package/dist/_internal/host-kit/intent/intent-data-context.js +200 -0
- package/dist/_internal/host-kit/intent/intent-dataset.d.ts +52 -0
- package/dist/_internal/host-kit/intent/intent-dataset.js +125 -0
- package/dist/_internal/host-kit/intent/intent-format.d.ts +33 -0
- package/dist/_internal/host-kit/intent/intent-format.js +94 -0
- package/dist/_internal/host-kit/intent/intent-kpi-bind.d.ts +29 -0
- package/dist/_internal/host-kit/intent/intent-kpi-bind.js +59 -0
- package/dist/_internal/host-kit/intent/intent-layout.d.ts +102 -0
- package/dist/_internal/host-kit/intent/intent-layout.js +264 -0
- package/dist/_internal/host-kit/intent/intent-parse.d.ts +39 -0
- package/dist/_internal/host-kit/intent/intent-parse.js +930 -0
- package/dist/_internal/host-kit/intent/intent-prepare.d.ts +52 -0
- package/dist/_internal/host-kit/intent/intent-prepare.js +104 -0
- package/dist/_internal/host-kit/intent/intent-session.d.ts +202 -0
- package/dist/_internal/host-kit/intent/intent-session.js +1001 -0
- package/dist/_internal/host-kit/intent/intent-stream.d.ts +28 -0
- package/dist/_internal/host-kit/intent/intent-stream.js +183 -0
- package/dist/_internal/host-kit/intent/intent-style.d.ts +37 -0
- package/dist/_internal/host-kit/intent/intent-style.js +77 -0
- package/dist/_internal/host-kit/intent/intent-types.d.ts +234 -0
- package/dist/_internal/host-kit/intent/intent-types.js +10 -0
- package/dist/_internal/material/chart.js +34 -12
- package/dist/_internal/material/table.js +52 -21
- package/dist/_internal/plugin-sdk/index.d.ts +6 -0
- package/dist/_internal/plugin-sdk/index.js +6 -0
- package/dist/_internal/plugin-sdk/material-isolated-csp.d.ts +38 -0
- package/dist/_internal/plugin-sdk/material-isolated-csp.js +67 -0
- package/dist/_internal/plugin-sdk/material-isolated-runtime.d.ts +22 -0
- package/dist/_internal/plugin-sdk/material-isolated-runtime.js +262 -0
- package/dist/_internal/plugin-sdk/material-isolated.d.ts +94 -0
- package/dist/_internal/plugin-sdk/material-isolated.js +1024 -0
- package/dist/_internal/plugin-sdk/material-rendered-element.d.ts +10 -2
- package/dist/_internal/plugin-sdk/material-rendered-element.js +71 -7
- package/dist/_internal/plugin-sdk/material-spec-audit.d.ts +2 -0
- package/dist/_internal/plugin-sdk/material-spec-audit.js +26 -6
- package/dist/_internal/plugin-sdk/material-spec.d.ts +20 -0
- package/dist/_internal/plugin-sdk/material-spec.js +78 -3
- package/dist/_internal/plugin-sdk/material-template-audit.d.ts +12 -0
- package/dist/_internal/plugin-sdk/material-template-audit.js +302 -0
- package/dist/_internal/plugin-sdk/material-template-expression.d.ts +98 -0
- package/dist/_internal/plugin-sdk/material-template-expression.js +549 -0
- package/dist/_internal/plugin-sdk/material-template-render.d.ts +32 -0
- package/dist/_internal/plugin-sdk/material-template-render.js +579 -0
- package/dist/_internal/plugin-sdk/material-template.d.ts +185 -0
- package/dist/_internal/plugin-sdk/material-template.js +879 -0
- package/dist/auto-register.js +10 -10
- package/dist/contracts.js +5 -5
- package/dist/contrast-DRPezUIl.js +131 -0
- package/dist/contrast-DRPezUIl.js.map +1 -0
- package/dist/core.js +156 -136
- package/dist/core.js.map +1 -1
- package/dist/dataset-profile-Dk6xdtsM.js +261 -0
- package/dist/dataset-profile-Dk6xdtsM.js.map +1 -0
- package/dist/{designer-3Tb0EIDV.js → designer-CFOvOmLn.js} +2 -2
- package/dist/{designer-3Tb0EIDV.js.map → designer-CFOvOmLn.js.map} +1 -1
- package/dist/designer-auto-register.js +5 -5
- package/dist/{designer-blueprint-workbench-panel-CJ3iZo5v-BebifP4x.js → designer-blueprint-workbench-panel-BWSglfAb-ktaj6Ci9.js} +452 -531
- package/dist/designer-blueprint-workbench-panel-BWSglfAb-ktaj6Ci9.js.map +1 -0
- package/dist/{designer-dataset-controller-CrfOg2Ys-DhKUEJJe.js → designer-dataset-controller-DdbY4ILC-CMdGdGbr.js} +862 -804
- package/dist/designer-dataset-controller-DdbY4ILC-CMdGdGbr.js.map +1 -0
- package/dist/{designer-field-primitives-KBZuWN_D-B3h4jpYe.js → designer-field-primitives-Crn464Qg-Bi7q8s5J.js} +45 -4
- package/dist/designer-field-primitives-Crn464Qg-Bi7q8s5J.js.map +1 -0
- package/dist/{designer-left-panel-groups-dom-N2OHOWjl-D8CzGwbF.js → designer-left-panel-groups-dom-DFdLWxxY-BarlWMLY.js} +4 -4
- package/dist/{designer-left-panel-groups-dom-N2OHOWjl-D8CzGwbF.js.map → designer-left-panel-groups-dom-DFdLWxxY-BarlWMLY.js.map} +1 -1
- package/dist/designer.js +5 -5
- package/dist/{dist-6GRboBs-.js → dist-B2bW2Tru.js} +4 -4
- package/dist/{dist-6GRboBs-.js.map → dist-B2bW2Tru.js.map} +1 -1
- package/dist/{dist-BjLjFUy1.js → dist-CHK9BTXX.js} +3833 -3453
- package/dist/dist-CHK9BTXX.js.map +1 -0
- package/dist/engine.js +5 -5
- package/dist/{fragment-Y6YnW6wy.js → fragment-B-oP0Fru.js} +3 -3
- package/dist/{fragment-Y6YnW6wy.js.map → fragment-B-oP0Fru.js.map} +1 -1
- package/dist/host-kit.js +3963 -187
- package/dist/host-kit.js.map +1 -1
- package/dist/{host-resource-selection-xo2mLCD4-BR5XCcim.js → host-resource-selection-CWrPLVOc-DPDq3jau.js} +5 -5
- package/dist/{host-resource-selection-xo2mLCD4-BR5XCcim.js.map → host-resource-selection-CWrPLVOc-DPDq3jau.js.map} +1 -1
- package/dist/index.js +10 -10
- package/dist/legibility-CS28ivEz.js +12 -0
- package/dist/legibility-CS28ivEz.js.map +1 -0
- package/dist/{level-scale-BzUjE31V.js → level-scale-CwHqFEVd.js} +2 -2
- package/dist/{level-scale-BzUjE31V.js.map → level-scale-CwHqFEVd.js.map} +1 -1
- package/dist/{manager-Ch0RTu_i.js → manager-CeB4Jnr9.js} +3 -3
- package/dist/{manager-Ch0RTu_i.js.map → manager-CeB4Jnr9.js.map} +1 -1
- package/dist/{material-UbSfiuZq.js → material-DeVkzSoT.js} +2 -2
- package/dist/{material-UbSfiuZq.js.map → material-DeVkzSoT.js.map} +1 -1
- package/dist/material-auto-register.js +1 -1
- package/dist/material.js +2 -2
- package/dist/{migrate-document-D3HhCVlZ.js → migrate-document-BM888PtC.js} +2 -2
- package/dist/{migrate-document-D3HhCVlZ.js.map → migrate-document-BM888PtC.js.map} +1 -1
- package/dist/{parse-AOTE9WnD.js → parse-Ji7kE9ZT.js} +9 -4
- package/dist/parse-Ji7kE9ZT.js.map +1 -0
- package/dist/{parse-B1OD1teS.js → parse-aZat9tAS.js} +3 -3
- package/dist/{parse-B1OD1teS.js.map → parse-aZat9tAS.js.map} +1 -1
- package/dist/{parse-parts-BNrpdG5o.js → parse-parts-qzl4suzk.js} +2 -2
- package/dist/{parse-parts-BNrpdG5o.js.map → parse-parts-qzl4suzk.js.map} +1 -1
- package/dist/{plugin-DHgh9uHh.js → plugin-CstHQ5ws.js} +4 -4
- package/dist/{plugin-DHgh9uHh.js.map → plugin-CstHQ5ws.js.map} +1 -1
- package/dist/plugin-core.js +2 -2
- package/dist/plugin-manager.js +1 -1
- package/dist/plugin-package-DWifuHi1.js +4206 -0
- package/dist/plugin-package-DWifuHi1.js.map +1 -0
- package/dist/{plugin-registration-rsmb4GvS.js → plugin-registration-DTwBvnHX.js} +2 -2
- package/dist/{plugin-registration-rsmb4GvS.js.map → plugin-registration-DTwBvnHX.js.map} +1 -1
- package/dist/plugin-sdk.js +6 -6
- package/dist/{plugins-DGRHgREK.js → plugins-QDL0yIql.js} +2 -2
- package/dist/{plugins-DGRHgREK.js.map → plugins-QDL0yIql.js.map} +1 -1
- package/dist/plugins.js +8 -8
- package/dist/renderer.js +1 -1
- package/dist/{runtime-dispatch-BfnRDtMe.js → runtime-dispatch-C0gyIrTv.js} +2 -2
- package/dist/{runtime-dispatch-BfnRDtMe.js.map → runtime-dispatch-C0gyIrTv.js.map} +1 -1
- package/dist/runtime-simulate-aSYO9yDX.js +147 -0
- package/dist/runtime-simulate-aSYO9yDX.js.map +1 -0
- package/dist/{src-Bm7u11mN-_0u6cMEw.js → src-Bm7u11mN-Bi1hDVkh.js} +39 -39
- package/dist/{src-Bm7u11mN-_0u6cMEw.js.map → src-Bm7u11mN-Bi1hDVkh.js.map} +1 -1
- package/dist/state-preset-DtpygJOH.js +22 -0
- package/dist/state-preset-DtpygJOH.js.map +1 -0
- package/dist/{text-BNksUr5J.js → text-BSTz0pFQ.js} +87 -34
- package/dist/text-BSTz0pFQ.js.map +1 -0
- package/dist/{value-ref-BG_MV9C-.js → value-ref-XkLuckGV.js} +2 -2
- package/dist/{value-ref-BG_MV9C-.js.map → value-ref-XkLuckGV.js.map} +1 -1
- package/dist/{viewer-CrJupI8I-D9dVcNw4.js → viewer-CrJupI8I-BJiz1cvW.js} +4 -4
- package/dist/{viewer-CrJupI8I-D9dVcNw4.js.map → viewer-CrJupI8I-BJiz1cvW.js.map} +1 -1
- package/dist/viewer-auto-register.js +2 -2
- package/dist/viewer.js +2 -2
- package/dist/{viewport-CiCKeAQH.js → viewport-BNIRWjiT.js} +354 -155
- package/dist/viewport-BNIRWjiT.js.map +1 -0
- package/package.json +12 -12
- package/dist/designer-blueprint-workbench-panel-CJ3iZo5v-BebifP4x.js.map +0 -1
- package/dist/designer-dataset-controller-CrfOg2Ys-DhKUEJJe.js.map +0 -1
- package/dist/designer-field-primitives-KBZuWN_D-B3h4jpYe.js.map +0 -1
- package/dist/dist-BjLjFUy1.js.map +0 -1
- package/dist/parse-AOTE9WnD.js.map +0 -1
- package/dist/plugin-package-Dr5ro6h6.js +0 -1221
- package/dist/plugin-package-Dr5ro6h6.js.map +0 -1
- package/dist/text-BNksUr5J.js.map +0 -1
- package/dist/viewport-CiCKeAQH.js.map +0 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { i as e } from "./image-url-D6mUcjY1.js";
|
|
2
|
-
import { At as t, B as n,
|
|
3
|
-
import { t as
|
|
4
|
-
import { C as
|
|
5
|
-
import { A as
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { At as t, B as n, H as r, O as i, V as a, g as o, k as s, n as c, q as l } from "./parse-Ji7kE9ZT.js";
|
|
3
|
+
import { t as u } from "./equality-DjZ9cv4u.js";
|
|
4
|
+
import { C as d, c as f, d as p, i as m, m as h } from "./designer-field-primitives-Crn464Qg-Bi7q8s5J.js";
|
|
5
|
+
import { A as ee, B as g, C as _, D as v, E as y, F as b, G as x, I as S, K as C, L as w, M as T, N as E, O as D, R as te, S as ne, T as re, U as ie, V as ae, W as oe, _ as se, b as ce, c as le, g as O, i as ue, j as de, k, m as fe, n as A, o as j, p as M, q as pe, r as me, v as N, w as he, x as ge, z as _e } from "./designer-left-panel-groups-dom-DFdLWxxY-BarlWMLY.js";
|
|
6
|
+
import { r as ve } from "./runtime-dispatch-C0gyIrTv.js";
|
|
7
|
+
import { n as ye } from "./runtime-simulate-aSYO9yDX.js";
|
|
8
|
+
//#region ../engine/dist/designer-blueprint-workbench-panel-BWSglfAb.js
|
|
9
|
+
var be = 260, xe = 176, P = 80;
|
|
10
|
+
function F(e, n, r) {
|
|
10
11
|
let i = ue(r, t.materialEvent);
|
|
11
12
|
return e.components.flatMap((e) => {
|
|
12
13
|
let t = n?.get(e.type)?.manifest, a = new Map((t?.editorDescriptor?.events ?? []).map((e) => [e.name, e]));
|
|
@@ -25,17 +26,17 @@ function I(e, n, r) {
|
|
|
25
26
|
});
|
|
26
27
|
}
|
|
27
28
|
function Se(e, t, n) {
|
|
28
|
-
let r =
|
|
29
|
+
let r = F(e, t, n);
|
|
29
30
|
return {
|
|
30
31
|
isEventAvailable: (e, t) => r.some((n) => n.componentId === e && n.name === t && n.available),
|
|
31
|
-
isHostActionAvailable: (e) =>
|
|
32
|
+
isHostActionAvailable: (e) => ce(n, e),
|
|
32
33
|
componentStateIds: (t) => e.components.find((e) => e.id === t)?.states?.items.map((e) => e.id) ?? []
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
36
|
function Ce(e, t, n) {
|
|
36
|
-
let r =
|
|
37
|
+
let r = F(e, t, n), i = Me(e);
|
|
37
38
|
return e.components.map((t) => {
|
|
38
|
-
let n =
|
|
39
|
+
let n = g(e.blueprint, t.id);
|
|
39
40
|
return {
|
|
40
41
|
kind: "component",
|
|
41
42
|
entityId: t.id,
|
|
@@ -48,8 +49,8 @@ function Ce(e, t, n) {
|
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
function we(e, t) {
|
|
51
|
-
return
|
|
52
|
-
let r =
|
|
52
|
+
return f(e).map((n) => {
|
|
53
|
+
let r = C(e.blueprint, n.id);
|
|
53
54
|
return {
|
|
54
55
|
kind: "variable",
|
|
55
56
|
entityId: n.id,
|
|
@@ -61,17 +62,17 @@ function we(e, t) {
|
|
|
61
62
|
};
|
|
62
63
|
});
|
|
63
64
|
}
|
|
64
|
-
function Te(e, t,
|
|
65
|
-
let l =
|
|
66
|
-
for (let e of u.edges)
|
|
67
|
-
let
|
|
65
|
+
function Te(e, t, o, c) {
|
|
66
|
+
let l = c.graph, u = e.blueprint, d = F(e, t, o), p = ie(o), m = new Map(e.components.map((e) => [e.id, e])), h = new Map(f(e).map((e) => [e.id, e])), ee = new Map((e.subCanvases ?? []).map((e) => [e.id, e])), g = new Map(u.layout?.nodes.map((e) => [e.id, e])), _ = je(u.nodes, u.edges), v = /* @__PURE__ */ new Set(), y = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map();
|
|
67
|
+
for (let e of u.edges) b.set(e.from.node, (b.get(e.from.node) ?? 0) + 1), y.set(e.to.node, (y.get(e.to.node) ?? 0) + 1), e.kind === "flow" && (v.add(`${e.from.node}\u0000out\u0000${e.from.port}`), v.add(`${e.to.node}\u0000in\u0000${e.to.port}`));
|
|
68
|
+
let x = (e, t, n, r, i = !0) => ({
|
|
68
69
|
id: n,
|
|
69
70
|
direction: t,
|
|
70
71
|
label: r,
|
|
71
72
|
available: i,
|
|
72
|
-
connected:
|
|
73
|
+
connected: v.has(`${e.id}\u0000${t}\u0000${n}`),
|
|
73
74
|
...i ? {} : { unavailableReason: l.unavailablePort }
|
|
74
|
-
}),
|
|
75
|
+
}), S = (e, t) => {
|
|
75
76
|
let n = [];
|
|
76
77
|
for (let r of u.edges) {
|
|
77
78
|
if (r.kind !== "flow") continue;
|
|
@@ -79,11 +80,11 @@ function Te(e, t, r, s) {
|
|
|
79
80
|
i.node === e.id && !n.includes(i.port) && n.push(i.port);
|
|
80
81
|
}
|
|
81
82
|
return n;
|
|
82
|
-
},
|
|
83
|
-
let t =
|
|
84
|
-
x:
|
|
85
|
-
y:
|
|
86
|
-
},
|
|
83
|
+
}, C = u.nodes.map((e) => {
|
|
84
|
+
let t = g.get(e.id) ?? _.get(e.id) ?? {
|
|
85
|
+
x: P,
|
|
86
|
+
y: P
|
|
87
|
+
}, a = i[e.kind].map((t) => x(e, "in", t, l.ports[t] ?? t)), o = s[e.kind].map((t) => x(e, "out", t, l.ports[t] ?? t)), f = {
|
|
87
88
|
id: e.id,
|
|
88
89
|
kind: e.kind,
|
|
89
90
|
x: t.x,
|
|
@@ -92,24 +93,24 @@ function Te(e, t, r, s) {
|
|
|
92
93
|
semantic: !1,
|
|
93
94
|
renamable: e.kind === "timer" || e.kind === "condition",
|
|
94
95
|
duplicable: e.kind === "timer" || e.kind === "condition",
|
|
95
|
-
inboundCount:
|
|
96
|
-
outboundCount:
|
|
96
|
+
inboundCount: y.get(e.id) ?? 0,
|
|
97
|
+
outboundCount: b.get(e.id) ?? 0
|
|
97
98
|
};
|
|
98
99
|
switch (e.kind) {
|
|
99
100
|
case "component": {
|
|
100
|
-
let t = m.get(e.componentId), n = d.filter((t) => t.componentId === e.componentId).map((t) =>
|
|
101
|
-
|
|
102
|
-
for (let t of
|
|
101
|
+
let t = m.get(e.componentId), n = d.filter((t) => t.componentId === e.componentId).map((t) => x(e, "out", `event:${t.name}`, t.label, t.available)), i = t?.states !== void 0;
|
|
102
|
+
i && n.push(x(e, "out", "state-changed", l.ports["state-changed"] ?? "state"));
|
|
103
|
+
for (let t of S(e, "out")) {
|
|
103
104
|
if (n.some((e) => e.id === t)) continue;
|
|
104
|
-
let
|
|
105
|
-
n.push(
|
|
105
|
+
let i = r(t) ?? t;
|
|
106
|
+
n.push(x(e, "out", t, l.missingEventPort(i), !1));
|
|
106
107
|
}
|
|
107
108
|
return {
|
|
108
|
-
...
|
|
109
|
+
...f,
|
|
109
110
|
title: t?.name ?? e.componentId,
|
|
110
111
|
subtitle: t === void 0 ? l.missingEntity : t.type,
|
|
111
112
|
outputs: n,
|
|
112
|
-
inputs:
|
|
113
|
+
inputs: i ? a : a.filter((e) => e.id !== "set-state" && e.id !== "reset-state"),
|
|
113
114
|
semantic: !0,
|
|
114
115
|
componentId: e.componentId,
|
|
115
116
|
...t === void 0 ? {} : {
|
|
@@ -121,29 +122,29 @@ function Te(e, t, r, s) {
|
|
|
121
122
|
case "variable": {
|
|
122
123
|
let t = h.get(e.variableId);
|
|
123
124
|
return {
|
|
124
|
-
...
|
|
125
|
+
...f,
|
|
125
126
|
title: t?.name ?? e.variableId,
|
|
126
|
-
subtitle: t === void 0 ? l.missingEntity :
|
|
127
|
+
subtitle: t === void 0 ? l.missingEntity : c.variableKind[t.type],
|
|
127
128
|
outputs: o,
|
|
128
|
-
inputs:
|
|
129
|
+
inputs: a,
|
|
129
130
|
variableId: e.variableId,
|
|
130
131
|
...t === void 0 ? {} : { variableType: t.type }
|
|
131
132
|
};
|
|
132
133
|
}
|
|
133
134
|
case "host": {
|
|
134
135
|
let t = [];
|
|
135
|
-
for (let n of
|
|
136
|
-
let
|
|
137
|
-
|
|
136
|
+
for (let n of S(e, "in")) {
|
|
137
|
+
let i = r(n);
|
|
138
|
+
i !== void 0 && t.push(x(e, "in", n, l.hostEventPort(i)));
|
|
138
139
|
}
|
|
139
|
-
t.push(
|
|
140
|
-
for (let n of
|
|
141
|
-
for (let r of
|
|
140
|
+
t.push(x(e, "in", `event:${De(u, e.id)}`, l.newHostEventPort));
|
|
141
|
+
for (let n of p) t.push(x(e, "in", `action:${n.actionId}`, l.hostActionPort(n.name)));
|
|
142
|
+
for (let r of S(e, "in")) {
|
|
142
143
|
let i = n(r);
|
|
143
|
-
i === void 0 || t.some((e) => e.id === r) || t.push(
|
|
144
|
+
i === void 0 || t.some((e) => e.id === r) || t.push(x(e, "in", r, c.hostActionUndeclared(i), !1));
|
|
144
145
|
}
|
|
145
146
|
return {
|
|
146
|
-
...
|
|
147
|
+
...f,
|
|
147
148
|
title: l.nodeKinds.host,
|
|
148
149
|
subtitle: l.nodeKindHints.host,
|
|
149
150
|
outputs: [],
|
|
@@ -151,14 +152,14 @@ function Te(e, t, r, s) {
|
|
|
151
152
|
};
|
|
152
153
|
}
|
|
153
154
|
case "lifecycle": return {
|
|
154
|
-
...
|
|
155
|
+
...f,
|
|
155
156
|
title: l.nodeKinds.lifecycle,
|
|
156
157
|
subtitle: l.nodeKindHints.lifecycle,
|
|
157
158
|
outputs: o,
|
|
158
159
|
inputs: []
|
|
159
160
|
};
|
|
160
161
|
case "timer": return {
|
|
161
|
-
...
|
|
162
|
+
...f,
|
|
162
163
|
title: e.name ?? l.timerTitle(e.intervalSeconds),
|
|
163
164
|
subtitle: l.nodeKinds.timer,
|
|
164
165
|
outputs: o,
|
|
@@ -167,41 +168,41 @@ function Te(e, t, r, s) {
|
|
|
167
168
|
...e.name === void 0 ? {} : { name: e.name }
|
|
168
169
|
};
|
|
169
170
|
case "sub-canvas": {
|
|
170
|
-
let t =
|
|
171
|
+
let t = ee.get(e.canvasId), n = l.subCanvasPorts[t?.display ?? "popup"];
|
|
171
172
|
return {
|
|
172
|
-
...
|
|
173
|
+
...f,
|
|
173
174
|
title: t?.name ?? e.canvasId,
|
|
174
175
|
subtitle: t === void 0 ? l.missingEntity : l.subCanvasKinds[t.display],
|
|
175
|
-
outputs:
|
|
176
|
-
inputs:
|
|
176
|
+
outputs: s["sub-canvas"].map((t) => x(e, "out", t, n[t] ?? t)),
|
|
177
|
+
inputs: i["sub-canvas"].map((t) => x(e, "in", t, n[t] ?? t)),
|
|
177
178
|
canvasId: e.canvasId,
|
|
178
179
|
...t === void 0 ? {} : { canvasDisplay: t.display }
|
|
179
180
|
};
|
|
180
181
|
}
|
|
181
182
|
case "main-canvas": return {
|
|
182
|
-
...
|
|
183
|
+
...f,
|
|
183
184
|
title: l.nodeKinds["main-canvas"],
|
|
184
185
|
subtitle: l.nodeKindHints["main-canvas"],
|
|
185
|
-
outputs:
|
|
186
|
-
inputs:
|
|
186
|
+
outputs: s["main-canvas"].map((t) => x(e, "out", t, l.mainCanvasPorts[t] ?? t)),
|
|
187
|
+
inputs: i["main-canvas"].map((t) => x(e, "in", t, l.mainCanvasPorts[t] ?? t))
|
|
187
188
|
};
|
|
188
189
|
case "condition": return {
|
|
189
|
-
...
|
|
190
|
+
...f,
|
|
190
191
|
title: e.name ?? l.conditionTitle,
|
|
191
|
-
subtitle: Oe(e.condition,
|
|
192
|
+
subtitle: Oe(e.condition, c),
|
|
192
193
|
outputs: o,
|
|
193
|
-
inputs:
|
|
194
|
+
inputs: a,
|
|
194
195
|
condition: e.condition,
|
|
195
196
|
...e.name === void 0 ? {} : { name: e.name }
|
|
196
197
|
};
|
|
197
198
|
}
|
|
198
199
|
});
|
|
199
|
-
Ae(
|
|
200
|
-
let
|
|
200
|
+
Ae(C, g);
|
|
201
|
+
let w = new Map(C.map((e) => [e.id, e])), T = me(u);
|
|
201
202
|
return {
|
|
202
|
-
nodes:
|
|
203
|
+
nodes: C,
|
|
203
204
|
edges: u.edges.map((e) => {
|
|
204
|
-
let t =
|
|
205
|
+
let t = w.get(e.from.node), n = w.get(e.to.node), r = t?.enabled !== !1 && n?.enabled !== !1;
|
|
205
206
|
if (e.kind === "semantic") return {
|
|
206
207
|
id: e.id,
|
|
207
208
|
kind: "semantic",
|
|
@@ -210,20 +211,20 @@ function Te(e, t, r, s) {
|
|
|
210
211
|
sourcePort: "semantic",
|
|
211
212
|
target: e.to.node,
|
|
212
213
|
targetPort: "semantic",
|
|
213
|
-
label:
|
|
214
|
+
label: c.semanticRoles[e.role],
|
|
214
215
|
role: e.role,
|
|
215
216
|
active: r
|
|
216
217
|
};
|
|
217
|
-
let i =
|
|
218
|
+
let i = ae(u, e.id), o = n?.inputs.find((t) => t.id === e.to.port);
|
|
218
219
|
return {
|
|
219
220
|
id: e.id,
|
|
220
221
|
kind: "flow",
|
|
221
|
-
category:
|
|
222
|
+
category: a(e, T),
|
|
222
223
|
source: e.from.node,
|
|
223
224
|
sourcePort: e.from.port,
|
|
224
225
|
target: e.to.node,
|
|
225
226
|
targetPort: e.to.port,
|
|
226
|
-
label:
|
|
227
|
+
label: o?.label ?? e.to.port,
|
|
227
228
|
...i === void 0 ? {} : {
|
|
228
229
|
order: i.order,
|
|
229
230
|
siblingCount: i.count
|
|
@@ -243,7 +244,7 @@ function Ee(e, t) {
|
|
|
243
244
|
for (let r of t.blueprint.nodes) {
|
|
244
245
|
if (r.enabled === !1) continue;
|
|
245
246
|
let t = e.nodes.find((e) => e.id === r.id);
|
|
246
|
-
for (let e of t?.outputs ?? []) e.connected &&
|
|
247
|
+
for (let e of t?.outputs ?? []) e.connected && l(r, e.id) !== void 0 && n.push({
|
|
247
248
|
nodeId: r.id,
|
|
248
249
|
port: e.id,
|
|
249
250
|
label: `${t?.title ?? r.id} · ${e.label}`
|
|
@@ -278,7 +279,7 @@ function Ae(e, t) {
|
|
|
278
279
|
i.push(r), n.set(e.x, i);
|
|
279
280
|
});
|
|
280
281
|
for (let t of n.values()) {
|
|
281
|
-
let n =
|
|
282
|
+
let n = P;
|
|
282
283
|
for (let r of t) {
|
|
283
284
|
let t = e[r];
|
|
284
285
|
e[r] = {
|
|
@@ -307,8 +308,8 @@ function je(e, t) {
|
|
|
307
308
|
for (let t of e) {
|
|
308
309
|
let e = a(t.id), n = o.get(e) ?? 0;
|
|
309
310
|
o.set(e, n + 1), s.set(t.id, {
|
|
310
|
-
x:
|
|
311
|
-
y:
|
|
311
|
+
x: P + e * be,
|
|
312
|
+
y: P + n * xe
|
|
312
313
|
});
|
|
313
314
|
}
|
|
314
315
|
return s;
|
|
@@ -322,7 +323,7 @@ function Me(e) {
|
|
|
322
323
|
}
|
|
323
324
|
return n;
|
|
324
325
|
}
|
|
325
|
-
var Ne = 0,
|
|
326
|
+
var Ne = 0, I = 8, L = .3, Pe = 2, R = d.blueprint.graph, Fe = [
|
|
326
327
|
"lifecycle",
|
|
327
328
|
"timer",
|
|
328
329
|
"condition",
|
|
@@ -392,7 +393,7 @@ var Re = class {
|
|
|
392
393
|
constructor(e) {
|
|
393
394
|
this.#e = e;
|
|
394
395
|
let t = e.createElement("div");
|
|
395
|
-
t.className = "designer-blueprint-canvas", t.tabIndex = 0, t.setAttribute("role", "application"), t.setAttribute("aria-label",
|
|
396
|
+
t.className = "designer-blueprint-canvas", t.tabIndex = 0, t.setAttribute("role", "application"), t.setAttribute("aria-label", d.blueprint.canvas), t.dataset.designerBlueprintCanvas = "true", t.innerHTML = `<div class="bp-toolbar" role="toolbar" aria-label="${N(d.blueprint.localToolbar)}"></div>
|
|
396
397
|
<div class="bp-stage" data-bp-stage>
|
|
397
398
|
<div class="bp-world" data-bp-world>
|
|
398
399
|
<svg class="bp-edges" data-bp-edges aria-hidden="true"></svg>
|
|
@@ -403,7 +404,7 @@ var Re = class {
|
|
|
403
404
|
<div class="bp-empty" data-bp-empty hidden></div>
|
|
404
405
|
</div>
|
|
405
406
|
<div class="bp-simulation" data-bp-simulation hidden></div>
|
|
406
|
-
<div class="designer-context-menu bp-context-menu" data-bp-menu role="menu" hidden tabindex="-1"></div>`, this.element = t, this.#c = t.querySelector(".bp-toolbar"), this.#t = t.querySelector("[data-bp-stage]"), this.#n = t.querySelector("[data-bp-world]"), this.#r = t.querySelector("[data-bp-edges]"), this.#i = t.querySelector("[data-bp-nodes]"), this.#a = t.querySelector("[data-bp-labels]"), this.#o = t.querySelector("[data-bp-marquee]"), this.#s = t.querySelector("[data-bp-menu]"), this.#l = t.querySelector("[data-bp-simulation]"), this.#u = t.querySelector("[data-bp-empty]"), this.listen(t,
|
|
407
|
+
<div class="designer-context-menu bp-context-menu" data-bp-menu role="menu" hidden tabindex="-1"></div>`, this.element = t, this.#c = t.querySelector(".bp-toolbar"), this.#t = t.querySelector("[data-bp-stage]"), this.#n = t.querySelector("[data-bp-world]"), this.#r = t.querySelector("[data-bp-edges]"), this.#i = t.querySelector("[data-bp-nodes]"), this.#a = t.querySelector("[data-bp-labels]"), this.#o = t.querySelector("[data-bp-marquee]"), this.#s = t.querySelector("[data-bp-menu]"), this.#l = t.querySelector("[data-bp-simulation]"), this.#u = t.querySelector("[data-bp-empty]"), this.listen(t, te, (e) => this.receive(e.detail.state)), this.listen(this.#t, "pointerdown", (e) => this.onPointerDown(e)), this.listen(this.#t, "pointermove", (e) => this.onPointerMove(e)), this.listen(this.#t, "pointerup", (e) => this.onPointerUp(e)), this.listen(this.#t, "pointercancel", () => this.cancelDrag()), this.listen(this.#t, "pointerleave", () => this.setHoverEdge(void 0)), this.listen(this.#t, "contextmenu", (e) => e.preventDefault()), this.listen(this.#t, "dblclick", (e) => this.onDoubleClick(e)), this.listen(this.#t, "wheel", (e) => this.onWheel(e), { passive: !1 }), this.listen(this.#t, "dragover", (e) => this.onDragOver(e)), this.listen(this.#t, "drop", (e) => this.onDrop(e)), this.listen(t, "keydown", (e) => this.onKeyDown(e)), this.listen(t, "keyup", (e) => {
|
|
407
408
|
e.code === "Space" && (this.#C = !1, this.#t.classList.remove("is-space"));
|
|
408
409
|
}), this.listen(this.#c, "click", (e) => this.onToolbarClick(e)), this.listen(this.#s, "click", (e) => this.onMenuClick(e)), this.listen(this.#l, "click", (e) => this.onSimulationClick(e)), this.listen(this.#l, "change", (e) => {
|
|
409
410
|
let t = e.target.closest("[data-bp-sim-trigger]");
|
|
@@ -429,7 +430,7 @@ var Re = class {
|
|
|
429
430
|
this.#d = e, this.#h = e.selection, (t === void 0 || t.documentRevision !== e.documentRevision) && this.#m.clear(), !this.#p && e.graph.viewport !== void 0 && (this.#f = {
|
|
430
431
|
x: e.graph.viewport.x,
|
|
431
432
|
y: e.graph.viewport.y,
|
|
432
|
-
z:
|
|
433
|
+
z: z(e.graph.viewport.zoom, L, Pe)
|
|
433
434
|
}, this.#p = !0), this.element.dataset.active = String(e.active), this.render();
|
|
434
435
|
let n = e.viewRequest;
|
|
435
436
|
n !== void 0 && n.id !== this.#T ? (this.#T = n.id, n.type === "fit" ? this.fit() : n.type === "auto-layout" ? this.autoLayout() : n.targetId !== void 0 && this.focus(n.targetId)) : !this.#p && e.graph.nodes.length > 0 && (this.#p = !0, this.fit());
|
|
@@ -441,7 +442,7 @@ var Re = class {
|
|
|
441
442
|
generation: t?.generation ?? 0,
|
|
442
443
|
documentRevision: t?.documentRevision ?? 0
|
|
443
444
|
};
|
|
444
|
-
this.element.dispatchEvent(new CustomEvent(
|
|
445
|
+
this.element.dispatchEvent(new CustomEvent(le, {
|
|
445
446
|
bubbles: !0,
|
|
446
447
|
composed: !0,
|
|
447
448
|
detail: { command: n }
|
|
@@ -498,7 +499,7 @@ var Re = class {
|
|
|
498
499
|
render() {
|
|
499
500
|
this.renderNodes(), this.renderEdges(), this.renderToolbar(), this.renderSimulation();
|
|
500
501
|
let e = this.graph.nodes.length === 0;
|
|
501
|
-
this.#u.hidden = !e, e && (this.#u.innerHTML = `<strong>${
|
|
502
|
+
this.#u.hidden = !e, e && (this.#u.innerHTML = `<strong>${x(d.blueprint.directNodeHint)}</strong>`);
|
|
502
503
|
}
|
|
503
504
|
renderNodes() {
|
|
504
505
|
let e = this.#y ? this.#d?.trace : null;
|
|
@@ -507,13 +508,13 @@ var Re = class {
|
|
|
507
508
|
let r = this.position(e), i = this.rows(e).map((r) => {
|
|
508
509
|
if (r === "semantic") {
|
|
509
510
|
let n = t.has(`${e.id}\u0000semantic`);
|
|
510
|
-
return `<div class="bp-anchor bp-anchor-semantic"><span class="bp-port bp-port-semantic${n ? " is-used" : ""}" data-bp-node="${
|
|
511
|
+
return `<div class="bp-anchor bp-anchor-semantic"><span class="bp-port bp-port-semantic${n ? " is-used" : ""}" data-bp-node="${N(e.id)}" data-bp-port="semantic" data-bp-dir="in"></span><span class="bp-anchor-label">${x(R.ports.semantic ?? "")}</span><span class="bp-port bp-port-semantic${n ? " is-used" : ""}" data-bp-node="${N(e.id)}" data-bp-port="semantic" data-bp-dir="out"></span></div>`;
|
|
511
512
|
}
|
|
512
513
|
let i = r.unavailableReason === void 0 ? r.id : `${r.id} · ${r.unavailableReason}`, a = n.get(`${e.id}\u0000${r.direction}\u0000${r.id}`);
|
|
513
|
-
return `<div class="bp-anchor" data-dir="${r.direction}" data-available="${String(r.available)}" title="${
|
|
514
|
-
}).join(""), a = e.kind === "sub-canvas" && e.canvasDisplay !== void 0 ?
|
|
515
|
-
return `<div class="bp-node" data-bp-node-id="${
|
|
516
|
-
<div class="bp-node-header" data-bp-drag="${
|
|
514
|
+
return `<div class="bp-anchor" data-dir="${r.direction}" data-available="${String(r.available)}" title="${N(i)}"><span class="bp-port${r.connected ? " is-used" : ""}" data-bp-node="${N(e.id)}" data-bp-port="${N(r.id)}" data-bp-dir="${r.direction}" data-available="${String(r.available)}"${a === void 0 ? "" : ` data-category="${a}"`}></span><span class="bp-anchor-label">${x(r.label)}</span></div>`;
|
|
515
|
+
}).join(""), a = e.kind === "sub-canvas" && e.canvasDisplay !== void 0 ? R.subCanvasKinds[e.canvasDisplay] : R.nodeKinds[e.kind], o = e.kind === "sub-canvas" && e.canvasDisplay === "page" ? "doc" : Ie[e.kind], s = this.#v === e.id ? `<input class="bp-rename" data-bp-rename-input value="${N(e.name ?? e.title)}" maxlength="64" aria-label="${N(R.nodeName)}">` : x(e.title);
|
|
516
|
+
return `<div class="bp-node" data-bp-node-id="${N(e.id)}" data-kind="${e.kind}" data-enabled="${String(e.enabled)}" style="left:${r.x}px;top:${r.y}px;min-height:${this.height(e)}px" role="group" aria-label="${N(`${a} ${e.title}`)}">
|
|
517
|
+
<div class="bp-node-header" data-bp-drag="${N(e.id)}" title="${N(`${e.title} · ${e.subtitle}`)}"><span class="bp-node-icon" aria-hidden="true">${h(o)}</span><span class="bp-node-heading"><span class="bp-node-title" data-bp-rename="${N(e.id)}">${s}</span>${e.title === a ? "" : `<span class="bp-node-kind">${x(a)}</span>`}</span></div>
|
|
517
518
|
<div class="bp-node-content">${i}</div>
|
|
518
519
|
</div>`;
|
|
519
520
|
}).join("");
|
|
@@ -553,9 +554,9 @@ var Re = class {
|
|
|
553
554
|
e.active ? "" : "is-off",
|
|
554
555
|
n.has(e.id) ? "is-traced" : ""
|
|
555
556
|
].filter((e) => e !== "").join(" ");
|
|
556
|
-
r += `<g class="${s}" data-bp-edge-group="${
|
|
557
|
+
r += `<g class="${s}" data-bp-edge-group="${N(e.id)}" data-bp-edge-source="${N(e.source)}" data-bp-edge-target="${N(e.target)}" data-category="${e.category}"><path class="bp-edge-line" d="${o.d}"/><path class="bp-edge-flow" d="${o.d}"/><path class="bp-edge-arrow" d="M-4.5,-4 L4,0 L-4.5,4 L-2.5,0 Z" transform="translate(${o.mid.x} ${o.mid.y}) rotate(${o.angle})"/><path class="bp-edge-hit" data-bp-edge="${N(e.id)}" d="${o.d}"/></g>`;
|
|
557
558
|
let c = e.order !== void 0 && (e.siblingCount ?? 1) > 1 ? `#${e.order} ` : "";
|
|
558
|
-
i += `<div class="bp-edge-label" data-bp-edge-label="${
|
|
559
|
+
i += `<div class="bp-edge-label" data-bp-edge-label="${N(e.id)}" data-category="${e.category}" style="left:${o.mid.x}px;top:${o.mid.y}px">${x(c + e.label)}</div>`;
|
|
559
560
|
}
|
|
560
561
|
e !== void 0 && (r += `<path class="bp-edge-ghost" d="${ze(e.from, e.to).d}"/><circle class="bp-edge-ghost-end" cx="${e.to.x}" cy="${e.to.y}" r="4"/>`);
|
|
561
562
|
let a = `${r}\u0000${i}`;
|
|
@@ -604,43 +605,43 @@ var Re = class {
|
|
|
604
605
|
}
|
|
605
606
|
}
|
|
606
607
|
renderToolbar() {
|
|
607
|
-
let e = this.#d, t =
|
|
608
|
-
<button type="button" class="designer-control designer-button bp-tool bp-tool-wide" data-bp-tool="add" aria-haspopup="menu" aria-label="${
|
|
608
|
+
let e = this.#d, t = d.blueprint.graph.toolbar, n = (e, t, n, r = "") => `<button type="button" class="designer-control designer-button bp-tool" data-bp-tool="${e}" aria-label="${N(n)}" data-tip="${N(n)}"${r}>${h(t)}</button>`, r = e?.diagnostics.filter((e) => e.severity === "error").length ?? 0, i = `<div class="bp-tool-group">
|
|
609
|
+
<button type="button" class="designer-control designer-button bp-tool bp-tool-wide" data-bp-tool="add" aria-haspopup="menu" aria-label="${N(t.addNode)}" data-tip="${N(t.addNode)}">${h("plus")}<span>${x(t.addNode)}</span></button>
|
|
609
610
|
${n("auto-layout", "grid", t.autoLayout)}
|
|
610
611
|
</div>
|
|
611
612
|
<div class="bp-tool-group">
|
|
612
|
-
${n("undo", "undo",
|
|
613
|
-
${n("redo", "redo",
|
|
613
|
+
${n("undo", "undo", d.blueprint.graph.toolbar.undo, e?.canUndo === !0 ? "" : " disabled")}
|
|
614
|
+
${n("redo", "redo", d.blueprint.graph.toolbar.redo, e?.canRedo === !0 ? "" : " disabled")}
|
|
614
615
|
</div>
|
|
615
616
|
<div class="bp-tool-group">
|
|
616
617
|
${n("semantic", "link", t.semantic, ` aria-pressed="${String(this.#b)}"`)}
|
|
617
618
|
${n("trace", "activity", t.highlightTrace, ` aria-pressed="${String(this.#y)}"`)}
|
|
618
|
-
<span class="bp-tool-status" data-state="${r === 0 ? "ok" : "error"}" aria-live="polite">${
|
|
619
|
+
<span class="bp-tool-status" data-state="${r === 0 ? "ok" : "error"}" aria-live="polite">${h(r === 0 ? "check-circle" : "x-circle")}<span>${x(r === 0 ? d.blueprint.problemsHealthy : `${d.blueprint.problemsTitle} ${r}`)}</span></span>
|
|
619
620
|
</div>
|
|
620
621
|
<div class="bp-tool-group bp-tool-group-end">
|
|
621
622
|
${n("zoom-out", "zoom-out", t.zoomOut)}
|
|
622
623
|
<span class="bp-zoom-value" data-bp-zoom>${Math.round(this.#f.z * 100)}%</span>
|
|
623
624
|
${n("zoom-in", "zoom-in", t.zoomIn)}
|
|
624
625
|
${n("fit", "fit", t.fit)}
|
|
625
|
-
<button type="button" class="designer-control designer-button bp-tool bp-tool-wide" data-bp-tool="simulate" data-variant="${this.#x ? "primary" : "neutral"}" aria-pressed="${String(this.#x)}" aria-label="${
|
|
626
|
+
<button type="button" class="designer-control designer-button bp-tool bp-tool-wide" data-bp-tool="simulate" data-variant="${this.#x ? "primary" : "neutral"}" aria-pressed="${String(this.#x)}" aria-label="${N(t.simulate)}" data-tip="${N(t.simulate)}">${h("play")}<span>${x(t.simulate)}</span></button>
|
|
626
627
|
</div>`;
|
|
627
|
-
i !== this.#k && (this.#k = i, this.#c.innerHTML = i,
|
|
628
|
+
i !== this.#k && (this.#k = i, this.#c.innerHTML = i, b(this.#c));
|
|
628
629
|
}
|
|
629
630
|
renderSimulation() {
|
|
630
631
|
if (this.#l.hidden = !this.#x, !this.#x) {
|
|
631
632
|
this.#A = "";
|
|
632
633
|
return;
|
|
633
634
|
}
|
|
634
|
-
let e =
|
|
635
|
+
let e = R.simulation, t = this.#d?.simulationTriggers ?? [], n = (e) => `${e.nodeId}\u0000${e.port}`;
|
|
635
636
|
(this.#S === void 0 || !t.some((e) => n(e) === this.#S)) && (this.#S = t[0] === void 0 ? void 0 : n(t[0]));
|
|
636
|
-
let r = this.#l.querySelector("[data-bp-sim-payload]")?.value ?? "{}", i = t.length === 0 ? `<p class="bp-simulation-empty">${
|
|
637
|
-
<label class="designer-field bp-simulation-payload"><span class="designer-field-label">${
|
|
637
|
+
let r = this.#l.querySelector("[data-bp-sim-payload]")?.value ?? "{}", i = t.length === 0 ? `<p class="bp-simulation-empty">${x(e.noTriggers)}</p>` : `<label class="designer-field"><span class="designer-field-label">${x(e.trigger)}</span><select class="designer-control designer-select" data-bp-sim-trigger>${t.map((e) => `<option value="${N(n(e))}"${n(e) === this.#S ? " selected" : ""}>${x(e.label)}</option>`).join("")}</select></label>
|
|
638
|
+
<label class="designer-field bp-simulation-payload"><span class="designer-field-label">${x(e.payload)}</span><textarea class="designer-control designer-input" data-bp-sim-payload rows="2" spellcheck="false">${x(r)}</textarea></label>
|
|
638
639
|
<div class="bp-simulation-actions">
|
|
639
|
-
<button type="button" class="designer-control designer-button" data-variant="primary" data-bp-sim="run">${
|
|
640
|
-
<button type="button" class="designer-control designer-button" data-bp-sim="clear"${this.#d?.trace === null ? " disabled" : ""}>${
|
|
640
|
+
<button type="button" class="designer-control designer-button" data-variant="primary" data-bp-sim="run">${h("play")}<span>${x(e.run)}</span></button>
|
|
641
|
+
<button type="button" class="designer-control designer-button" data-bp-sim="clear"${this.#d?.trace === null ? " disabled" : ""}>${x(e.clear)}</button>
|
|
641
642
|
</div>
|
|
642
643
|
<p class="bp-simulation-message" data-bp-sim-message aria-live="polite"></p>`;
|
|
643
|
-
i !== this.#A && (this.#A = i, this.#l.innerHTML = i,
|
|
644
|
+
i !== this.#A && (this.#A = i, this.#l.innerHTML = i, b(this.#l));
|
|
644
645
|
}
|
|
645
646
|
applyView() {
|
|
646
647
|
this.#n.style.transform = `translate(${this.#f.x}px, ${this.#f.y}px) scale(${this.#f.z})`, this.#t.style.setProperty("--bp-pan-x", `${this.#f.x}px`), this.#t.style.setProperty("--bp-pan-y", `${this.#f.y}px`), this.#t.style.setProperty("--bp-zoom", String(this.#f.z)), this.#t.dataset.zoomFar = String(this.#f.z < .6);
|
|
@@ -648,7 +649,7 @@ var Re = class {
|
|
|
648
649
|
e !== null && (e.textContent = `${Math.round(this.#f.z * 100)}%`);
|
|
649
650
|
}
|
|
650
651
|
zoomAt(e, t, n) {
|
|
651
|
-
let r =
|
|
652
|
+
let r = z(this.#f.z * e, L, Pe), i = r / this.#f.z;
|
|
652
653
|
this.#f = {
|
|
653
654
|
x: t - (t - this.#f.x) * i,
|
|
654
655
|
y: n - (n - this.#f.y) * i,
|
|
@@ -661,7 +662,7 @@ var Re = class {
|
|
|
661
662
|
let n = e.map((e) => ({
|
|
662
663
|
...this.position(e),
|
|
663
664
|
h: this.height(e)
|
|
664
|
-
})), r = Math.min(...n.map((e) => e.x)), i = Math.min(...n.map((e) => e.y)), a = Math.max(...n.map((e) => e.x + 164)), o = Math.max(...n.map((e) => e.y + e.h)), s =
|
|
665
|
+
})), r = Math.min(...n.map((e) => e.x)), i = Math.min(...n.map((e) => e.y)), a = Math.max(...n.map((e) => e.x + 164)), o = Math.max(...n.map((e) => e.y + e.h)), s = z(Math.min((t.width - 64) / (a - r), (t.height - 64) / (o - i)), L, 1.1);
|
|
665
666
|
this.#f = {
|
|
666
667
|
z: s,
|
|
667
668
|
x: 32 + (t.width - 64 - (a - r) * s) / 2 - r * s,
|
|
@@ -852,8 +853,8 @@ var Re = class {
|
|
|
852
853
|
x: 0,
|
|
853
854
|
y: 0
|
|
854
855
|
}, o = {
|
|
855
|
-
x: Math.round((a.x + n) /
|
|
856
|
-
y: Math.round((a.y + r) /
|
|
856
|
+
x: Math.round((a.x + n) / I) * I,
|
|
857
|
+
y: Math.round((a.y + r) / I) * I
|
|
857
858
|
};
|
|
858
859
|
this.#m.set(e, o);
|
|
859
860
|
let s = this.#i.querySelector(`[data-bp-node-id="${Ve(e)}"]`);
|
|
@@ -964,7 +965,7 @@ var Re = class {
|
|
|
964
965
|
e.dataTransfer?.types.includes("application/x-base-screen-blueprint-node") === !0 && (e.preventDefault(), e.dataTransfer.dropEffect = "copy");
|
|
965
966
|
}
|
|
966
967
|
onDrop(e) {
|
|
967
|
-
let t = e.dataTransfer?.getData(
|
|
968
|
+
let t = e.dataTransfer?.getData(ne);
|
|
968
969
|
if (t === void 0 || t === "") return;
|
|
969
970
|
e.preventDefault();
|
|
970
971
|
let n;
|
|
@@ -1089,7 +1090,7 @@ var Re = class {
|
|
|
1089
1090
|
a = JSON.parse(i?.value.trim() || "null");
|
|
1090
1091
|
} catch {
|
|
1091
1092
|
let e = this.#l.querySelector("[data-bp-sim-message]");
|
|
1092
|
-
e !== null && (e.textContent =
|
|
1093
|
+
e !== null && (e.textContent = R.simulation.invalidPayload);
|
|
1093
1094
|
return;
|
|
1094
1095
|
}
|
|
1095
1096
|
n !== void 0 && r !== void 0 && this.send({
|
|
@@ -1100,11 +1101,11 @@ var Re = class {
|
|
|
1100
1101
|
});
|
|
1101
1102
|
}
|
|
1102
1103
|
menuItem(e, t, n, r = {}) {
|
|
1103
|
-
return `<button type="button" class="designer-control designer-button designer-menu-item" role="menuitem" data-bp-menu-action="${
|
|
1104
|
+
return `<button type="button" class="designer-control designer-button designer-menu-item" role="menuitem" data-bp-menu-action="${N(e)}"${r.danger === !0 ? " data-menu-tone=\"danger\"" : ""}${r.disabled === !0 ? " disabled" : ""}><span class="menu-item-icon" aria-hidden="true">${h(t)}</span><span class="menu-item-label">${x(n)}</span>${r.kbd === void 0 ? "" : `<kbd>${x(r.kbd)}</kbd>`}</button>`;
|
|
1104
1105
|
}
|
|
1105
1106
|
addItems() {
|
|
1106
1107
|
let e = new Set(this.graph.nodes.map((e) => e.kind));
|
|
1107
|
-
return Fe.map((t) => this.menuItem(`add:${t}`, Ie[t],
|
|
1108
|
+
return Fe.map((t) => this.menuItem(`add:${t}`, Ie[t], R.nodeKinds[t], { disabled: (t === "host" || t === "lifecycle") && e.has(t) })).join("");
|
|
1108
1109
|
}
|
|
1109
1110
|
openMenu(e, t, n, r) {
|
|
1110
1111
|
let i = n?.closest("[data-bp-node-id]") ?? null, a = n?.closest("[data-bp-edge]") ?? null;
|
|
@@ -1125,8 +1126,8 @@ var Re = class {
|
|
|
1125
1126
|
edges: []
|
|
1126
1127
|
});
|
|
1127
1128
|
this.#w = this.toWorld(e, t);
|
|
1128
|
-
let o =
|
|
1129
|
-
if (s.length > 1 && (l += `<div class="designer-context-menu-heading"><span class="designer-context-menu-heading-icon" aria-hidden="true">${
|
|
1129
|
+
let o = R.menu, s = this.#h.nodes.map((e) => this.node(e)).filter(Be), c = s.length === 1 ? s[0] : void 0, l = "";
|
|
1130
|
+
if (s.length > 1 && (l += `<div class="designer-context-menu-heading"><span class="designer-context-menu-heading-icon" aria-hidden="true">${h("select-all")}</span><span class="designer-context-menu-heading-label">${x(R.multiSelection(s.length, this.#h.edges.length))}</span></div>`), s.length > 0) {
|
|
1130
1131
|
let e = s.some((e) => e.enabled);
|
|
1131
1132
|
l += this.menuItem("delete", "trash", o.delete, {
|
|
1132
1133
|
kbd: "Delete",
|
|
@@ -1144,13 +1145,13 @@ var Re = class {
|
|
|
1144
1145
|
kbd: "Delete",
|
|
1145
1146
|
danger: !0
|
|
1146
1147
|
}), l += "<div class=\"designer-menu-separator\" role=\"separator\"></div>");
|
|
1147
|
-
l += `<div class="designer-menu-section-label">${
|
|
1148
|
+
l += `<div class="designer-menu-section-label">${x(o.addHere)}</div>`, l += this.addItems(), l += "<div class=\"designer-menu-separator\" role=\"separator\"></div>", l += this.menuItem("select-all", "select-all", o.selectAll, { kbd: "Ctrl A" }), l += this.menuItem("auto-layout", "grid", o.autoLayout), l += this.menuItem("fit", "fit", o.fit, { kbd: "Ctrl 0" }), this.showMenu(l, e, t);
|
|
1148
1149
|
}
|
|
1149
1150
|
openAddMenu(e, t) {
|
|
1150
|
-
this.showMenu(`<div class="designer-menu-section-label">${
|
|
1151
|
+
this.showMenu(`<div class="designer-menu-section-label">${x(R.toolbar.addNode)}</div>${this.addItems()}`, e, t);
|
|
1151
1152
|
}
|
|
1152
1153
|
showMenu(e, t, n) {
|
|
1153
|
-
this.#s.innerHTML = e,
|
|
1154
|
+
this.#s.innerHTML = e, b(this.#s), this.#s.hidden = !1;
|
|
1154
1155
|
let r = this.element.getBoundingClientRect();
|
|
1155
1156
|
this.#s.style.left = "0px", this.#s.style.top = "0px";
|
|
1156
1157
|
let i = t - r.left, a = n - r.top, o = this.#s.offsetWidth, s = this.#s.offsetHeight;
|
|
@@ -1239,7 +1240,7 @@ function ze(e, t) {
|
|
|
1239
1240
|
angle: Math.round(Math.atan2(u, l) * 180 / Math.PI)
|
|
1240
1241
|
};
|
|
1241
1242
|
}
|
|
1242
|
-
function
|
|
1243
|
+
function z(e, t, n) {
|
|
1243
1244
|
return Math.min(n, Math.max(t, e));
|
|
1244
1245
|
}
|
|
1245
1246
|
function Be(e) {
|
|
@@ -1256,30 +1257,30 @@ function He(e, t, n, r) {
|
|
|
1256
1257
|
for (let r of e.querySelectorAll("[data-workbench-mode-tab]")) {
|
|
1257
1258
|
let e = r.dataset.workbenchModeTab, i = e === t, a = e === "blueprint" && !n;
|
|
1258
1259
|
r.disabled = a, r.dataset.active = String(i), r.setAttribute("aria-selected", String(i)), r.tabIndex = i ? 0 : -1;
|
|
1259
|
-
let o = a ?
|
|
1260
|
+
let o = a ? d.interactionWorkspaceUnavailable : e === "blueprint" ? d.interactionWorkspaceHint : d.canvasWorkspace;
|
|
1260
1261
|
r.setAttribute("data-tip", o), r.ariaLabel = o;
|
|
1261
1262
|
}
|
|
1262
|
-
let o = t === "blueprint" ?
|
|
1263
|
+
let o = t === "blueprint" ? d.commandPalette.blueprintTrigger : d.commandPalette.trigger, s = e.querySelector("[data-command-palette-trigger-label]");
|
|
1263
1264
|
s !== null && (s.textContent = o);
|
|
1264
1265
|
let c = e.querySelector("[data-command-palette-toggle]");
|
|
1265
1266
|
if (c !== null && (c.ariaLabel = o, c.setAttribute("data-tip", o)), Ue(e, t, r.nodes), t !== "blueprint") return;
|
|
1266
1267
|
let l = e.querySelector("[data-status-selection]");
|
|
1267
|
-
l !== null && (l.textContent =
|
|
1268
|
+
l !== null && (l.textContent = d.blueprint.workbench);
|
|
1268
1269
|
let u = e.querySelector("[data-status-canvas]");
|
|
1269
|
-
u !== null && (u.textContent =
|
|
1270
|
+
u !== null && (u.textContent = d.blueprint.status(r.nodes, r.relations, r.semantic, r.structural, r.problems));
|
|
1270
1271
|
}
|
|
1271
1272
|
function Ue(e, t, n) {
|
|
1272
1273
|
let r = t === "blueprint", i = e.querySelector("[data-blueprint-library]"), a = e.querySelector("[data-blueprint-inspector]");
|
|
1273
|
-
i !== null && (i.hidden = !r), a !== null && (a.hidden = !r), We(e, "left", r,
|
|
1274
|
+
i !== null && (i.hidden = !r), a !== null && (a.hidden = !r), We(e, "left", r, d.blueprint.library, n), We(e, "right", r, d.blueprint.inspector);
|
|
1274
1275
|
}
|
|
1275
1276
|
function We(e, t, n, r, i) {
|
|
1276
1277
|
let a = e.querySelector(`[data-${t}-panel-title]`), o = e.querySelector(`[data-${t}-panel-count]`);
|
|
1277
|
-
a !== null && (n ? (a.dataset.canvasTitle ??= a.textContent ?? "", a.textContent = r) : a.dataset.canvasTitle !== void 0 && (a.textContent = a.dataset.canvasTitle, delete a.dataset.canvasTitle)), o !== null && (n ? (o.dataset.canvasCount ??= o.textContent ?? "", o.dataset.canvasAriaLabel ??= o.getAttribute("aria-label") ?? "", o.textContent = String(i ?? 0), o.setAttribute("aria-label",
|
|
1278
|
+
a !== null && (n ? (a.dataset.canvasTitle ??= a.textContent ?? "", a.textContent = r) : a.dataset.canvasTitle !== void 0 && (a.textContent = a.dataset.canvasTitle, delete a.dataset.canvasTitle)), o !== null && (n ? (o.dataset.canvasCount ??= o.textContent ?? "", o.dataset.canvasAriaLabel ??= o.getAttribute("aria-label") ?? "", o.textContent = String(i ?? 0), o.setAttribute("aria-label", d.blueprint.panelCount(r, i ?? 0))) : o.dataset.canvasCount !== void 0 && (o.textContent = o.dataset.canvasCount, o.setAttribute("aria-label", o.dataset.canvasAriaLabel ?? ""), delete o.dataset.canvasCount, delete o.dataset.canvasAriaLabel));
|
|
1278
1279
|
}
|
|
1279
1280
|
function Ge(e) {
|
|
1280
1281
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1281
1282
|
}
|
|
1282
|
-
function
|
|
1283
|
+
function B(e, t) {
|
|
1283
1284
|
return {
|
|
1284
1285
|
severity: "error",
|
|
1285
1286
|
code: e,
|
|
@@ -1287,15 +1288,15 @@ function V(e, t) {
|
|
|
1287
1288
|
message: t
|
|
1288
1289
|
};
|
|
1289
1290
|
}
|
|
1290
|
-
function
|
|
1291
|
+
function V(e, t) {
|
|
1291
1292
|
return {
|
|
1292
1293
|
ok: !1,
|
|
1293
|
-
diagnostics: [
|
|
1294
|
+
diagnostics: [B(e, t)]
|
|
1294
1295
|
};
|
|
1295
1296
|
}
|
|
1296
1297
|
function Ke(e, t) {
|
|
1297
1298
|
let n = Ge(e) && typeof e.commandId == "string" ? e.commandId.slice(0, 128) : "invalid-command";
|
|
1298
|
-
return
|
|
1299
|
+
return E({
|
|
1299
1300
|
commandId: n,
|
|
1300
1301
|
status: "rejected",
|
|
1301
1302
|
diagnostics: t
|
|
@@ -1311,10 +1312,10 @@ function qe(e) {
|
|
|
1311
1312
|
} };
|
|
1312
1313
|
}
|
|
1313
1314
|
function Je(e) {
|
|
1314
|
-
let t =
|
|
1315
|
+
let t = d.blueprint.graph.connection;
|
|
1315
1316
|
return e === "duplicate" ? t.duplicate : e === "cycle" ? t.cycle : e === "unavailable" ? t.unavailable : t.invalid;
|
|
1316
1317
|
}
|
|
1317
|
-
var Ye = 256,
|
|
1318
|
+
var Ye = 256, H = d.blueprint.graph, Xe = class {
|
|
1318
1319
|
callbacks;
|
|
1319
1320
|
#e;
|
|
1320
1321
|
#t;
|
|
@@ -1336,7 +1337,7 @@ var Ye = 256, Xe = 32, U = f.blueprint.graph, Ze = class {
|
|
|
1336
1337
|
this.#e !== e && (this.disconnect(), this.#e = e, e.addEventListener("base-screen-blueprint-canvas-command", this.#o));
|
|
1337
1338
|
}
|
|
1338
1339
|
disconnect() {
|
|
1339
|
-
this.#e?.removeEventListener(
|
|
1340
|
+
this.#e?.removeEventListener(le, this.#o), this.#e = void 0;
|
|
1340
1341
|
}
|
|
1341
1342
|
setCanvas(e) {
|
|
1342
1343
|
return e !== this.#t && (this.#t = e, this.#i++, this.#a.clear(), this.#r = void 0, !0);
|
|
@@ -1350,7 +1351,7 @@ var Ye = 256, Xe = 32, U = f.blueprint.graph, Ze = class {
|
|
|
1350
1351
|
dispatchState(e = this.callbacks.getGraph()) {
|
|
1351
1352
|
let t = this.#t;
|
|
1352
1353
|
if (t === void 0) return;
|
|
1353
|
-
let n = this.callbacks.getDocument(), r = this.callbacks.getViewRequest(), i =
|
|
1354
|
+
let n = this.callbacks.getDocument(), r = this.callbacks.getViewRequest(), i = E({
|
|
1354
1355
|
generation: this.#i,
|
|
1355
1356
|
documentRevision: this.callbacks.getDocumentRevision(),
|
|
1356
1357
|
projectRevision: this.callbacks.getProjectRevision(),
|
|
@@ -1366,18 +1367,18 @@ var Ye = 256, Xe = 32, U = f.blueprint.graph, Ze = class {
|
|
|
1366
1367
|
...r === void 0 ? {} : { viewRequest: r },
|
|
1367
1368
|
...this.#r === void 0 ? {} : { lastCommand: this.#r }
|
|
1368
1369
|
});
|
|
1369
|
-
t.dispatchEvent(new CustomEvent(
|
|
1370
|
+
t.dispatchEvent(new CustomEvent(te, { detail: { state: i } }));
|
|
1370
1371
|
}
|
|
1371
1372
|
commitBlueprint(e) {
|
|
1372
1373
|
let t = this.callbacks.getDocument();
|
|
1373
|
-
if (t === void 0) return
|
|
1374
|
-
if (e === null) return
|
|
1375
|
-
if (
|
|
1374
|
+
if (t === void 0) return V("AUTHORING_EXPIRED", d.lifecycle.unloaded);
|
|
1375
|
+
if (e === null) return V("AUTHORING_REQUEST_INVALID", d.blueprint.invalidCommand);
|
|
1376
|
+
if (u(e, t.blueprint)) return {
|
|
1376
1377
|
ok: !0,
|
|
1377
1378
|
value: t,
|
|
1378
1379
|
diagnostics: []
|
|
1379
1380
|
};
|
|
1380
|
-
let n =
|
|
1381
|
+
let n = c({
|
|
1381
1382
|
...t,
|
|
1382
1383
|
blueprint: e
|
|
1383
1384
|
});
|
|
@@ -1387,7 +1388,7 @@ var Ye = 256, Xe = 32, U = f.blueprint.graph, Ze = class {
|
|
|
1387
1388
|
}) : n;
|
|
1388
1389
|
}
|
|
1389
1390
|
stateDiagnostics() {
|
|
1390
|
-
let e = this.callbacks.getDocument(), t = e === void 0 ? void 0 :
|
|
1391
|
+
let e = this.callbacks.getDocument(), t = e === void 0 ? void 0 : ve(e, this.capabilities);
|
|
1391
1392
|
return [...t !== void 0 && !t.ok ? t.diagnostics : [], ...this.#r?.diagnostics ?? []];
|
|
1392
1393
|
}
|
|
1393
1394
|
simulate(e, t, n) {
|
|
@@ -1396,7 +1397,7 @@ var Ye = 256, Xe = 32, U = f.blueprint.graph, Ze = class {
|
|
|
1396
1397
|
}
|
|
1397
1398
|
receive(e) {
|
|
1398
1399
|
if (this.#t === void 0 || !e.composedPath().includes(this.#t)) return;
|
|
1399
|
-
let t = e.detail, n = Ge(t) && Object.keys(t).length === 1 && "command" in t ? t.command : void 0, r =
|
|
1400
|
+
let t = e.detail, n = Ge(t) && Object.keys(t).length === 1 && "command" in t ? t.command : void 0, r = S(n);
|
|
1400
1401
|
if (!r.ok) {
|
|
1401
1402
|
this.rejectUnknown(n, r.diagnostics);
|
|
1402
1403
|
return;
|
|
@@ -1408,7 +1409,7 @@ var Ye = 256, Xe = 32, U = f.blueprint.graph, Ze = class {
|
|
|
1408
1409
|
}
|
|
1409
1410
|
let o = i.type === "select" || i.type === "run-simulation" || i.type === "clear-simulation";
|
|
1410
1411
|
if (i.generation !== this.#i || !o && i.documentRevision !== this.callbacks.getDocumentRevision()) {
|
|
1411
|
-
this.finish(i.commandId, "rejected", [
|
|
1412
|
+
this.finish(i.commandId, "rejected", [B("AUTHORING_EXPIRED", d.blueprint.staleCommand)]);
|
|
1412
1413
|
return;
|
|
1413
1414
|
}
|
|
1414
1415
|
this.execute(i);
|
|
@@ -1420,7 +1421,7 @@ var Ye = 256, Xe = 32, U = f.blueprint.graph, Ze = class {
|
|
|
1420
1421
|
}
|
|
1421
1422
|
let t = this.callbacks.getDocument();
|
|
1422
1423
|
if (t === void 0) {
|
|
1423
|
-
this.finish(e.commandId, "rejected", [
|
|
1424
|
+
this.finish(e.commandId, "rejected", [B("AUTHORING_EXPIRED", d.lifecycle.unloaded)]);
|
|
1424
1425
|
return;
|
|
1425
1426
|
}
|
|
1426
1427
|
let n = {
|
|
@@ -1434,17 +1435,17 @@ var Ye = 256, Xe = 32, U = f.blueprint.graph, Ze = class {
|
|
|
1434
1435
|
break;
|
|
1435
1436
|
case "connect": {
|
|
1436
1437
|
let r = _e(t.blueprint, e.from, e.to, Se(t, this.callbacks.getCatalog(), this.callbacks.getRuntimeContributions()));
|
|
1437
|
-
n = r.ok ? this.commitBlueprint(r.blueprint) :
|
|
1438
|
+
n = r.ok ? this.commitBlueprint(r.blueprint) : V("AUTHORING_REQUEST_INVALID", Je(r.reason)), n.ok && r.ok && (n = this.callbacks.select({
|
|
1438
1439
|
nodes: [],
|
|
1439
1440
|
edges: [r.edgeId]
|
|
1440
1441
|
}, !1));
|
|
1441
1442
|
break;
|
|
1442
1443
|
}
|
|
1443
1444
|
case "delete-selection":
|
|
1444
|
-
n = this.commitBlueprint(
|
|
1445
|
+
n = this.commitBlueprint(w(t.blueprint, e.selection)), n.ok && this.callbacks.select(_, !1);
|
|
1445
1446
|
break;
|
|
1446
1447
|
case "insert-node": {
|
|
1447
|
-
let { type: r, commandId: i, generation: a, documentRevision: o, position: s, ...c } = e, l =
|
|
1448
|
+
let { type: r, commandId: i, generation: a, documentRevision: o, position: s, ...c } = e, l = T(t, c, s);
|
|
1448
1449
|
n = this.commitBlueprint(l?.blueprint ?? null), n.ok && l !== null && (n = this.callbacks.select({
|
|
1449
1450
|
nodes: [l.nodeId],
|
|
1450
1451
|
edges: []
|
|
@@ -1455,13 +1456,13 @@ var Ye = 256, Xe = 32, U = f.blueprint.graph, Ze = class {
|
|
|
1455
1456
|
let r = t.blueprint;
|
|
1456
1457
|
for (let t of e.nodeIds) {
|
|
1457
1458
|
if (r === null) break;
|
|
1458
|
-
r =
|
|
1459
|
+
r = A(r, t, e.update);
|
|
1459
1460
|
}
|
|
1460
1461
|
n = this.commitBlueprint(r);
|
|
1461
1462
|
break;
|
|
1462
1463
|
}
|
|
1463
1464
|
case "reorder-edge":
|
|
1464
|
-
n = this.commitBlueprint(
|
|
1465
|
+
n = this.commitBlueprint(re(t.blueprint, e.edgeId, e.direction));
|
|
1465
1466
|
break;
|
|
1466
1467
|
case "duplicate-nodes": {
|
|
1467
1468
|
let r = pe(t.blueprint, e.nodeIds);
|
|
@@ -1472,10 +1473,10 @@ var Ye = 256, Xe = 32, U = f.blueprint.graph, Ze = class {
|
|
|
1472
1473
|
break;
|
|
1473
1474
|
}
|
|
1474
1475
|
case "commit-layout":
|
|
1475
|
-
n = this.commitBlueprint(
|
|
1476
|
+
n = this.commitBlueprint(y(t.blueprint, e.nodes, e.viewport));
|
|
1476
1477
|
break;
|
|
1477
1478
|
case "commit-viewport":
|
|
1478
|
-
n = this.commitBlueprint(
|
|
1479
|
+
n = this.commitBlueprint(oe(t.blueprint, e.viewport));
|
|
1479
1480
|
break;
|
|
1480
1481
|
case "history-undo":
|
|
1481
1482
|
n = this.callbacks.undo();
|
|
@@ -1491,149 +1492,69 @@ var Ye = 256, Xe = 32, U = f.blueprint.graph, Ze = class {
|
|
|
1491
1492
|
this.finish(e.commandId, n.ok ? "accepted" : "rejected", n.diagnostics);
|
|
1492
1493
|
}
|
|
1493
1494
|
runSimulation(e, t, n) {
|
|
1494
|
-
let
|
|
1495
|
-
if (
|
|
1496
|
-
let
|
|
1497
|
-
if (
|
|
1498
|
-
let
|
|
1499
|
-
if (!
|
|
1500
|
-
let c =
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1495
|
+
let r = this.callbacks.getDocument();
|
|
1496
|
+
if (r === void 0) return V("AUTHORING_EXPIRED", d.lifecycle.unloaded);
|
|
1497
|
+
let i = D(r.blueprint, e), a = i === void 0 ? void 0 : Ze(i, t, n);
|
|
1498
|
+
if (a === void 0) return V("AUTHORING_REQUEST_INVALID", d.blueprint.invalidCommand);
|
|
1499
|
+
let o = ye(r, a);
|
|
1500
|
+
if (!o.ok) return o;
|
|
1501
|
+
let { plan: s, dispatches: c } = o.value, l = [], u = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set([e]), p = new Map(this.callbacks.getGraph().nodes.map((e) => [e.id, e.title]));
|
|
1502
|
+
for (let { depth: e, ruleTraces: t } of c) for (let n of t) {
|
|
1503
|
+
if (!n.triggerMatched) continue;
|
|
1504
|
+
let t = s.rules.find((e) => e.id === n.ruleId);
|
|
1505
|
+
if (t === void 0) continue;
|
|
1506
|
+
f.add(t.nodeId), l.push({
|
|
1507
|
+
kind: e === 0 ? "trigger" : "cascade",
|
|
1508
|
+
nodeId: t.nodeId,
|
|
1509
|
+
depth: e,
|
|
1510
|
+
text: p.get(t.nodeId) ?? t.nodeId
|
|
1504
1511
|
});
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
let i = v;
|
|
1514
|
-
i !== null && (n && y.push(i), b({
|
|
1515
|
-
type: "canvas-event",
|
|
1516
|
-
canvasId: i,
|
|
1517
|
-
name: "closed",
|
|
1518
|
-
payload: null
|
|
1519
|
-
}, r)), v = e, b({
|
|
1520
|
-
type: "canvas-event",
|
|
1521
|
-
canvasId: e,
|
|
1522
|
-
name: "opened",
|
|
1523
|
-
payload: t ?? null
|
|
1524
|
-
}, r), b({
|
|
1525
|
-
type: "page-changed",
|
|
1526
|
-
name: "page-changed",
|
|
1527
|
-
payload: {
|
|
1528
|
-
from: i,
|
|
1529
|
-
to: e
|
|
1530
|
-
}
|
|
1531
|
-
}, r);
|
|
1532
|
-
}, S = !1, C = [{
|
|
1533
|
-
event: o,
|
|
1534
|
-
depth: 0
|
|
1535
|
-
}];
|
|
1536
|
-
for (; C.length > 0;) {
|
|
1537
|
-
let { event: e, depth: t } = C.shift();
|
|
1538
|
-
if (t > Xe) {
|
|
1539
|
-
l.push({
|
|
1540
|
-
kind: "error",
|
|
1541
|
-
depth: t,
|
|
1542
|
-
text: U.simulation.depthExceeded
|
|
1543
|
-
}), S = !0;
|
|
1544
|
-
break;
|
|
1545
|
-
}
|
|
1546
|
-
let n = ve(c, h, e);
|
|
1547
|
-
if (!n.ok) {
|
|
1548
|
-
l.push({
|
|
1549
|
-
kind: "error",
|
|
1550
|
-
depth: t,
|
|
1551
|
-
text: n.diagnostics[0]?.message ?? f.blueprint.invalidCommand
|
|
1552
|
-
}), S = !0;
|
|
1553
|
-
break;
|
|
1554
|
-
}
|
|
1555
|
-
for (let e of n.value.ruleTraces) {
|
|
1556
|
-
if (!e.triggerMatched) continue;
|
|
1557
|
-
let n = c.rules.find((t) => t.id === e.ruleId);
|
|
1558
|
-
if (n === void 0) continue;
|
|
1559
|
-
p.add(n.nodeId), l.push({
|
|
1560
|
-
kind: t === 0 ? "trigger" : "cascade",
|
|
1561
|
-
nodeId: n.nodeId,
|
|
1562
|
-
depth: t,
|
|
1563
|
-
text: m.get(n.nodeId) ?? n.nodeId
|
|
1564
|
-
});
|
|
1565
|
-
let r = [...e.conditions], a = [...e.actions], o = (e, t) => {
|
|
1566
|
-
for (let n of e) {
|
|
1567
|
-
if (n.type === "condition") {
|
|
1568
|
-
let e = r[0];
|
|
1569
|
-
if (e === void 0 || e.nodeId !== n.nodeId) return;
|
|
1570
|
-
r.shift(), u.add(n.edgeId), p.add(n.nodeId), l.push({
|
|
1571
|
-
kind: "condition",
|
|
1572
|
-
nodeId: n.nodeId,
|
|
1573
|
-
edgeId: n.edgeId,
|
|
1574
|
-
passed: e.passed,
|
|
1575
|
-
depth: t,
|
|
1576
|
-
text: `${m.get(n.nodeId) ?? n.nodeId} · ${e.passed ? U.simulation.passed : U.simulation.failed}`
|
|
1577
|
-
}), o(e.passed ? n.yes : n.no, t + 1);
|
|
1578
|
-
continue;
|
|
1579
|
-
}
|
|
1580
|
-
let e = a[0];
|
|
1581
|
-
if (e === void 0 || e.edgeId !== n.edgeId) continue;
|
|
1582
|
-
a.shift(), u.add(n.edgeId);
|
|
1583
|
-
let s = i.blueprint.edges.find((e) => e.id === n.edgeId)?.to.node;
|
|
1584
|
-
s !== void 0 && p.add(s), l.push({
|
|
1585
|
-
kind: n.action.type === "request-variable" || n.action.type === "request-component-data" ? "request" : "action",
|
|
1512
|
+
let i = [...n.conditions], a = [...n.actions], o = (e, t) => {
|
|
1513
|
+
for (let n of e) {
|
|
1514
|
+
if (n.type === "condition") {
|
|
1515
|
+
let e = i[0];
|
|
1516
|
+
if (e === void 0 || e.nodeId !== n.nodeId) return;
|
|
1517
|
+
i.shift(), u.add(n.edgeId), f.add(n.nodeId), l.push({
|
|
1518
|
+
kind: "condition",
|
|
1519
|
+
nodeId: n.nodeId,
|
|
1586
1520
|
edgeId: n.edgeId,
|
|
1587
|
-
|
|
1521
|
+
passed: e.passed,
|
|
1588
1522
|
depth: t,
|
|
1589
|
-
text:
|
|
1590
|
-
});
|
|
1591
|
-
|
|
1592
|
-
};
|
|
1593
|
-
o(n.steps, t + 1);
|
|
1594
|
-
}
|
|
1595
|
-
let r = n.value.variables;
|
|
1596
|
-
for (let [e, n] of Object.entries(r)) d(n, h[e] ?? null) && e in h || C.push({
|
|
1597
|
-
event: {
|
|
1598
|
-
type: "variable-event",
|
|
1599
|
-
variableId: e,
|
|
1600
|
-
name: "data-updated",
|
|
1601
|
-
payload: n
|
|
1602
|
-
},
|
|
1603
|
-
depth: t + 1
|
|
1604
|
-
});
|
|
1605
|
-
h = r;
|
|
1606
|
-
for (let e of n.value.canvasEffects) {
|
|
1607
|
-
if (e.type === "page-navigation") {
|
|
1608
|
-
if (e.operation === "back") x(y.pop(), void 0, !1, t + 1);
|
|
1609
|
-
else {
|
|
1610
|
-
let n = v === null ? -1 : _.indexOf(v);
|
|
1611
|
-
x(_[e.operation === "next" ? n + 1 : n - 1], void 0, !0, t + 1);
|
|
1523
|
+
text: `${p.get(n.nodeId) ?? n.nodeId} · ${e.passed ? H.simulation.passed : H.simulation.failed}`
|
|
1524
|
+
}), o(e.passed ? n.yes : n.no, t + 1);
|
|
1525
|
+
continue;
|
|
1612
1526
|
}
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1527
|
+
let e = a[0];
|
|
1528
|
+
if (e === void 0 || e.edgeId !== n.edgeId) continue;
|
|
1529
|
+
a.shift(), u.add(n.edgeId);
|
|
1530
|
+
let s = r.blueprint.edges.find((e) => e.id === n.edgeId)?.to.node;
|
|
1531
|
+
s !== void 0 && f.add(s), l.push({
|
|
1532
|
+
kind: n.action.type === "request-variable" || n.action.type === "request-component-data" ? "request" : "action",
|
|
1533
|
+
edgeId: n.edgeId,
|
|
1534
|
+
...s === void 0 ? {} : { nodeId: s },
|
|
1535
|
+
depth: t,
|
|
1536
|
+
text: Qe(n.action, r)
|
|
1537
|
+
});
|
|
1618
1538
|
}
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
type: "canvas-event",
|
|
1622
|
-
canvasId: e.canvasId,
|
|
1623
|
-
name: n ? "opened" : "closed",
|
|
1624
|
-
payload: n ? e.payload ?? null : null
|
|
1625
|
-
}, t + 1));
|
|
1626
|
-
}
|
|
1539
|
+
};
|
|
1540
|
+
o(t.steps, e + 1);
|
|
1627
1541
|
}
|
|
1542
|
+
let m = o.value.failure;
|
|
1543
|
+
m !== void 0 && l.push({
|
|
1544
|
+
kind: "error",
|
|
1545
|
+
depth: m.depth,
|
|
1546
|
+
text: m.kind === "depth-exceeded" ? H.simulation.depthExceeded : m.message
|
|
1547
|
+
});
|
|
1548
|
+
let h = m !== void 0;
|
|
1628
1549
|
return this.#n = {
|
|
1629
1550
|
trigger: {
|
|
1630
1551
|
nodeId: e,
|
|
1631
1552
|
port: t
|
|
1632
1553
|
},
|
|
1633
1554
|
executedEdgeIds: [...u],
|
|
1634
|
-
visitedNodeIds: [...
|
|
1555
|
+
visitedNodeIds: [...f],
|
|
1635
1556
|
steps: l,
|
|
1636
|
-
failed:
|
|
1557
|
+
failed: h
|
|
1637
1558
|
}, {
|
|
1638
1559
|
ok: !0,
|
|
1639
1560
|
value: null,
|
|
@@ -1641,7 +1562,7 @@ var Ye = 256, Xe = 32, U = f.blueprint.graph, Ze = class {
|
|
|
1641
1562
|
};
|
|
1642
1563
|
}
|
|
1643
1564
|
finish(e, t, n) {
|
|
1644
|
-
let r =
|
|
1565
|
+
let r = E({
|
|
1645
1566
|
commandId: e,
|
|
1646
1567
|
status: t,
|
|
1647
1568
|
diagnostics: n
|
|
@@ -1655,7 +1576,7 @@ var Ye = 256, Xe = 32, U = f.blueprint.graph, Ze = class {
|
|
|
1655
1576
|
return qe(this.callbacks.getRuntimeContributions);
|
|
1656
1577
|
}
|
|
1657
1578
|
};
|
|
1658
|
-
function
|
|
1579
|
+
function Ze(e, t, n) {
|
|
1659
1580
|
if (e.kind === "component") {
|
|
1660
1581
|
if (t === "state-changed") return {
|
|
1661
1582
|
type: "component-state-changed",
|
|
@@ -1663,10 +1584,10 @@ function Qe(e, t, n) {
|
|
|
1663
1584
|
name: "state-changed",
|
|
1664
1585
|
payload: n
|
|
1665
1586
|
};
|
|
1666
|
-
let
|
|
1667
|
-
return
|
|
1587
|
+
let i = r(t);
|
|
1588
|
+
return i === void 0 ? void 0 : {
|
|
1668
1589
|
componentId: e.componentId,
|
|
1669
|
-
name:
|
|
1590
|
+
name: i,
|
|
1670
1591
|
payload: n
|
|
1671
1592
|
};
|
|
1672
1593
|
}
|
|
@@ -1699,76 +1620,76 @@ function Qe(e, t, n) {
|
|
|
1699
1620
|
payload: n
|
|
1700
1621
|
};
|
|
1701
1622
|
}
|
|
1702
|
-
function
|
|
1623
|
+
function Qe(e, t) {
|
|
1703
1624
|
let n = (e) => t.components.find((t) => t.id === e)?.name ?? e;
|
|
1704
1625
|
switch (e.type) {
|
|
1705
|
-
case "component-visibility": return `${
|
|
1706
|
-
case "request-component-data": return
|
|
1707
|
-
case "request-variable": return
|
|
1708
|
-
case "set-variable": return
|
|
1709
|
-
case "emit-host-event": return
|
|
1710
|
-
case "host-action": return
|
|
1626
|
+
case "component-visibility": return `${H.ports[e.operation] ?? e.operation} · ${n(e.componentId)}`;
|
|
1627
|
+
case "request-component-data": return H.simulation.requested(n(e.componentId));
|
|
1628
|
+
case "request-variable": return H.simulation.requested(e.variableId);
|
|
1629
|
+
case "set-variable": return d.blueprint.setVariableAction(e.variableId);
|
|
1630
|
+
case "emit-host-event": return d.blueprint.emitHostEventAction(e.eventName);
|
|
1631
|
+
case "host-action": return d.blueprint.hostAction(e.actionId);
|
|
1711
1632
|
case "canvas-visibility": {
|
|
1712
1633
|
let n = t.subCanvases?.find((t) => t.id === e.canvasId);
|
|
1713
|
-
return
|
|
1634
|
+
return d.blueprint.canvasAction(H.subCanvasPorts[n?.display ?? "popup"][e.operation] ?? e.operation, n?.name ?? e.canvasId);
|
|
1714
1635
|
}
|
|
1715
|
-
case "page-navigation": return
|
|
1636
|
+
case "page-navigation": return H.mainCanvasPorts[e.operation] ?? e.operation;
|
|
1716
1637
|
case "component-state": {
|
|
1717
1638
|
let r = t.components.find((t) => t.id === e.componentId)?.states?.items.find((t) => t.id === e.stateId);
|
|
1718
|
-
return `${
|
|
1639
|
+
return `${H.ports[e.operation === "set" ? "set-state" : "reset-state"] ?? e.operation} · ${n(e.componentId)}${r === void 0 ? "" : ` · ${r.name}`}`;
|
|
1719
1640
|
}
|
|
1720
1641
|
}
|
|
1721
1642
|
}
|
|
1722
|
-
var
|
|
1723
|
-
function
|
|
1724
|
-
return
|
|
1643
|
+
var $e = new RegExp(o);
|
|
1644
|
+
function et(e, t) {
|
|
1645
|
+
return se(e.blueprint, t).some((e) => e.node.kind === "component" || e.node.kind === "sub-canvas" && e.port === "opened" || e.node.kind === "main-canvas" && e.port === "page-changed");
|
|
1725
1646
|
}
|
|
1726
|
-
function
|
|
1647
|
+
function tt(e) {
|
|
1727
1648
|
let t = e.split(".").map((e) => e.trim());
|
|
1728
|
-
return t.length === 0 || t.length > 8 || t.some((e) => e === "" ||
|
|
1649
|
+
return t.length === 0 || t.length > 8 || t.some((e) => e === "" || !$e.test(e)) ? null : t;
|
|
1729
1650
|
}
|
|
1730
|
-
function
|
|
1651
|
+
function nt(e) {
|
|
1731
1652
|
return e.kind === "literal" ? "literal" : e.kind === "event-payload" ? e.path.length === 0 ? "event" : "event-field" : e.kind === "variable" ? "variable" : "advanced";
|
|
1732
1653
|
}
|
|
1733
|
-
function
|
|
1734
|
-
let
|
|
1735
|
-
for (let o of
|
|
1654
|
+
function rt(e, t, n) {
|
|
1655
|
+
let i = [], a = /* @__PURE__ */ new Set();
|
|
1656
|
+
for (let o of se(e.blueprint, t)) {
|
|
1736
1657
|
if (o.node.kind !== "component") continue;
|
|
1737
1658
|
if (o.port === "state-changed") {
|
|
1738
1659
|
for (let e of [
|
|
1739
1660
|
"from",
|
|
1740
1661
|
"to",
|
|
1741
1662
|
"cause"
|
|
1742
|
-
]) a.has(e) || (a.add(e),
|
|
1663
|
+
]) a.has(e) || (a.add(e), i.push([e]));
|
|
1743
1664
|
continue;
|
|
1744
1665
|
}
|
|
1745
|
-
let t = o.node.componentId, s =
|
|
1746
|
-
if (l !== void 0) for (let e of
|
|
1666
|
+
let t = o.node.componentId, s = r(o.port), c = e.components.find((e) => e.id === t), l = n?.get(c?.type ?? "")?.manifest.editorDescriptor?.events?.find((e) => e.name === s)?.payloadSchema;
|
|
1667
|
+
if (l !== void 0) for (let e of it(l)) {
|
|
1747
1668
|
let t = e.join(".");
|
|
1748
|
-
a.has(t) || (a.add(t),
|
|
1669
|
+
a.has(t) || (a.add(t), i.push(e));
|
|
1749
1670
|
}
|
|
1750
1671
|
}
|
|
1751
|
-
return
|
|
1672
|
+
return i;
|
|
1752
1673
|
}
|
|
1753
|
-
function
|
|
1674
|
+
function it(e, t = []) {
|
|
1754
1675
|
return Object.entries(e.properties).flatMap(([e, n]) => {
|
|
1755
1676
|
let r = [...t, e];
|
|
1756
|
-
return n.kind === "object" ? [r, ...
|
|
1677
|
+
return n.kind === "object" ? [r, ...it(n, r)] : [r];
|
|
1757
1678
|
});
|
|
1758
1679
|
}
|
|
1759
|
-
function
|
|
1680
|
+
function at(e, t, n) {
|
|
1760
1681
|
for (let n of e.querySelectorAll(".host-left-panel-view[data-host-left-panel-group]")) {
|
|
1761
1682
|
let e = n.dataset.hostLeftPanelGroup === t?.id;
|
|
1762
1683
|
n.hidden = !e, e && t !== void 0 && n.setAttribute("aria-labelledby", de(t.id));
|
|
1763
1684
|
}
|
|
1764
1685
|
let r = e.querySelector("[data-left-panel-count]");
|
|
1765
|
-
r !== null && (r.hidden = t !== void 0, t === void 0 ? (r.textContent = String(n), r.setAttribute("aria-label",
|
|
1686
|
+
r !== null && (r.hidden = t !== void 0, t === void 0 ? (r.textContent = String(n), r.setAttribute("aria-label", d.blueprint.panelCount(d.blueprint.library, n))) : (r.textContent = "", r.removeAttribute("aria-label")));
|
|
1766
1687
|
let i = e.querySelector("[data-left-panel-title]");
|
|
1767
|
-
i !== null && (i.textContent = t?.label ??
|
|
1688
|
+
i !== null && (i.textContent = t?.label ?? d.blueprint.library);
|
|
1768
1689
|
let a = e.querySelector("[data-left-panel-scope]");
|
|
1769
|
-
a !== null && (a.textContent = t === void 0 ?
|
|
1690
|
+
a !== null && (a.textContent = t === void 0 ? d.panelScope.builtin : d.panelScope.host);
|
|
1770
1691
|
}
|
|
1771
|
-
var
|
|
1692
|
+
var U = d.blueprint, W = U.graph, ot = [
|
|
1772
1693
|
"eq",
|
|
1773
1694
|
"neq",
|
|
1774
1695
|
"gt",
|
|
@@ -1777,96 +1698,96 @@ var W = f.blueprint, G = W.graph, st = [
|
|
|
1777
1698
|
"lte",
|
|
1778
1699
|
"contains",
|
|
1779
1700
|
"exists"
|
|
1780
|
-
],
|
|
1701
|
+
], st = [
|
|
1781
1702
|
"appear",
|
|
1782
1703
|
"fade",
|
|
1783
1704
|
"slide-up"
|
|
1784
|
-
],
|
|
1705
|
+
], ct = [
|
|
1785
1706
|
"related",
|
|
1786
1707
|
"detail",
|
|
1787
1708
|
"group",
|
|
1788
1709
|
"drill-down"
|
|
1789
1710
|
];
|
|
1790
|
-
function
|
|
1711
|
+
function lt(e, t, n, r) {
|
|
1791
1712
|
let i = n.nodes.length + n.edges.length;
|
|
1792
|
-
if (e === void 0 || i === 0) return `<div class="designer-empty"><span class="designer-empty-icon" aria-hidden="true">${
|
|
1793
|
-
if (i > 1) return
|
|
1713
|
+
if (e === void 0 || i === 0) return `<div class="designer-empty"><span class="designer-empty-icon" aria-hidden="true">${h("sliders")}</span><p class="designer-empty-title">${U.inspectorEmpty}</p><p class="designer-empty-hint">${U.inspectorEmptyHint}</p></div>`;
|
|
1714
|
+
if (i > 1) return ut(n);
|
|
1794
1715
|
let a = n.nodes[0];
|
|
1795
1716
|
if (a !== void 0) {
|
|
1796
1717
|
let n = t.nodes.find((e) => e.id === a);
|
|
1797
|
-
return n === void 0 ? "" :
|
|
1718
|
+
return n === void 0 ? "" : pt(e, t, n);
|
|
1798
1719
|
}
|
|
1799
1720
|
let o = t.edges.find((e) => e.id === n.edges[0]);
|
|
1800
|
-
return o === void 0 ? "" :
|
|
1721
|
+
return o === void 0 ? "" : ht(e, t, o, r);
|
|
1801
1722
|
}
|
|
1802
|
-
function
|
|
1803
|
-
let t = e.nodes.length === 0 ? "" : `<button type="button" class="designer-control designer-button" data-blueprint-nodes-enabled="true">${
|
|
1723
|
+
function ut(e) {
|
|
1724
|
+
let t = e.nodes.length === 0 ? "" : `<button type="button" class="designer-control designer-button" data-blueprint-nodes-enabled="true">${W.enableNodes}</button><button type="button" class="designer-control designer-button" data-blueprint-nodes-enabled="false">${W.disableNodes}</button>`;
|
|
1804
1725
|
return `<div class="blueprint-config" data-blueprint-multi>
|
|
1805
|
-
${
|
|
1726
|
+
${G("multi", U.selectionOverview, `<p class="blueprint-config-summary">${x(W.multiSelection(e.nodes.length, e.edges.length))}</p>
|
|
1806
1727
|
<div class="blueprint-config-actions">${t}</div>`)}
|
|
1807
|
-
${
|
|
1728
|
+
${ft(W.menu.delete)}
|
|
1808
1729
|
</div>`;
|
|
1809
1730
|
}
|
|
1810
|
-
function
|
|
1811
|
-
return `<details class="designer-panel-section designer-inspector-section designer-inspector-disclosure blueprint-config-section" data-inspector-search-key="blueprint-${e}" open><summary class="designer-panel-section-title designer-inspector-section-title designer-inspector-section-summary designer-panel-section-summary">${
|
|
1731
|
+
function G(e, t, n, r = "") {
|
|
1732
|
+
return `<details class="designer-panel-section designer-inspector-section designer-inspector-disclosure blueprint-config-section" data-inspector-search-key="blueprint-${e}" open><summary class="designer-panel-section-title designer-inspector-section-title designer-inspector-section-summary designer-panel-section-summary">${x(t)}${r === "" ? "" : `<span class="designer-inspector-section-meta">${x(r)}</span>`}<span class="designer-panel-section-disclosure designer-inspector-section-disclosure" aria-hidden="true">${h("chevron-down")}</span></summary><div class="blueprint-config-content">${n}</div></details>`;
|
|
1812
1733
|
}
|
|
1813
|
-
function
|
|
1814
|
-
return `<div data-blueprint-field-row="${
|
|
1734
|
+
function K(e, t, n = "row") {
|
|
1735
|
+
return `<div data-blueprint-field-row="${N(e)}" data-blueprint-field-variant="${n}">${t}</div>`;
|
|
1815
1736
|
}
|
|
1816
|
-
function
|
|
1817
|
-
return
|
|
1737
|
+
function q(e, t, n = "") {
|
|
1738
|
+
return K(e, `<span class="blueprint-config-value">${t === "" ? "" : `<span>${x(t)}</span>`}${n === "" ? "" : `<code>${x(n)}</code>`}</span>`);
|
|
1818
1739
|
}
|
|
1819
|
-
function
|
|
1820
|
-
return `<span data-blueprint-field-switch="${
|
|
1740
|
+
function dt(e, t, n) {
|
|
1741
|
+
return `<span data-blueprint-field-switch="${N(e)}" data-checked="${String(t)}" ${n}></span>`;
|
|
1821
1742
|
}
|
|
1822
|
-
function
|
|
1823
|
-
return `<div class="blueprint-config-footer"><button type="button" class="designer-control designer-button blueprint-delete-button" data-variant="danger" data-blueprint-delete>${
|
|
1743
|
+
function ft(e) {
|
|
1744
|
+
return `<div class="blueprint-config-footer"><button type="button" class="designer-control designer-button blueprint-delete-button" data-variant="danger" data-blueprint-delete>${x(e)}</button></div>`;
|
|
1824
1745
|
}
|
|
1825
|
-
function
|
|
1826
|
-
return `<p class="blueprint-config-empty">${
|
|
1746
|
+
function J(e) {
|
|
1747
|
+
return `<p class="blueprint-config-empty">${x(e)}</p>`;
|
|
1827
1748
|
}
|
|
1828
|
-
function
|
|
1829
|
-
let r = (e, t) => e.map((e) => `<li class="blueprint-anchor" data-direction="${t}" data-connected="${String(e.connected)}" data-available="${String(e.available)}"><span class="designer-badge" data-tone="${t === "in" ? "success" : "accent"}">${t === "in" ?
|
|
1749
|
+
function pt(e, t, n) {
|
|
1750
|
+
let r = (e, t) => e.map((e) => `<li class="blueprint-anchor" data-direction="${t}" data-connected="${String(e.connected)}" data-available="${String(e.available)}"><span class="designer-badge" data-tone="${t === "in" ? "success" : "accent"}">${t === "in" ? W.inputs : W.outputs}</span><span class="blueprint-anchor-label">${x(e.label)}</span><code>${x(e.id)}</code></li>`).join(""), i = `${r(n.outputs, "out")}${r(n.inputs, "in")}`, a = i === "" ? J(W.noEdges) : `<ul class="blueprint-anchor-list">${i}</ul>`, o = N(n.id), s = [n.renamable ? K(W.nodeName, `<input type="text" class="designer-control designer-input" data-blueprint-node-field="name" data-node-id="${o}" value="${N(n.name ?? "")}" placeholder="${N(W.nodeNamePlaceholder)}" maxlength="64">`) : "", dt(W.enabledState, n.enabled, `data-blueprint-node-field="enabled" data-node-id="${o}"`)].join(""), c = mt(e, n), l = t.edges.filter((e) => e.source === n.id || e.target === n.id), u = new Map(t.nodes.map((e) => [e.id, e.title])), d = l.length === 0 ? J(W.noEdges) : `<ul class="blueprint-config-edges">${l.map((e) => {
|
|
1830
1751
|
let t = e.target === n.id, r = t ? e.source : e.target;
|
|
1831
|
-
return `<li><button type="button" class="blueprint-config-link" data-blueprint-select-edge="${
|
|
1752
|
+
return `<li><button type="button" class="blueprint-config-link" data-blueprint-select-edge="${N(e.id)}" data-category="${e.category}"><span class="designer-badge" data-tone="${t ? "success" : "accent"}">${t ? W.upstream : W.downstream}</span><span class="blueprint-config-link-copy"><strong>${x(u.get(r) ?? r)}</strong><small>${x(e.label)}</small></span><span class="blueprint-config-link-arrow" aria-hidden="true">${h("chevron-right")}</span></button></li>`;
|
|
1832
1753
|
}).join("")}</ul>`;
|
|
1833
1754
|
return `<div class="blueprint-config" data-blueprint-node-config="${o}" data-node-kind="${n.kind}">
|
|
1834
|
-
${
|
|
1835
|
-
${
|
|
1836
|
-
${c === "" ? "" :
|
|
1837
|
-
${
|
|
1755
|
+
${G("anchors", W.anchorInfo, a, String(n.inputs.length + n.outputs.length))}
|
|
1756
|
+
${G("basic", W.basicConfig, s)}
|
|
1757
|
+
${c === "" ? "" : G("node", W.nodeConfig, c)}
|
|
1758
|
+
${G("edges", W.edgeList, d, String(l.length))}
|
|
1838
1759
|
</div>`;
|
|
1839
1760
|
}
|
|
1840
|
-
function
|
|
1841
|
-
let n =
|
|
1761
|
+
function mt(e, t) {
|
|
1762
|
+
let n = N(t.id);
|
|
1842
1763
|
switch (t.kind) {
|
|
1843
|
-
case "timer": return
|
|
1764
|
+
case "timer": return K(U.timerInterval, `<input type="number" class="designer-control designer-input" min="1" max="86400" step="1" data-blueprint-node-field="interval" data-node-id="${n}" value="${t.intervalSeconds ?? 5}">`);
|
|
1844
1765
|
case "condition": {
|
|
1845
1766
|
let r = t.condition;
|
|
1846
1767
|
return r === void 0 ? "" : [
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
r.operator === "exists" || r.right === void 0 ? "" :
|
|
1768
|
+
Y(e, "node", t.id, "left", W.conditionLeft, r.left, !0),
|
|
1769
|
+
K(U.conditionOperatorLabel, `<select class="designer-control designer-select" data-blueprint-node-field="operator" data-node-id="${n}">${ot.map((e) => `<option value="${e}"${e === r.operator ? " selected" : ""}>${x(U.conditionOperator(e))}</option>`).join("")}</select>`),
|
|
1770
|
+
r.operator === "exists" || r.right === void 0 ? "" : Y(e, "node", t.id, "right", W.conditionRight, r.right, !0)
|
|
1850
1771
|
].join("");
|
|
1851
1772
|
}
|
|
1852
|
-
case "component": return
|
|
1773
|
+
case "component": return q(W.material, "", t.materialType ?? t.subtitle);
|
|
1853
1774
|
case "variable": {
|
|
1854
|
-
let n =
|
|
1855
|
-
return [
|
|
1775
|
+
let n = f(e).find((e) => e.id === t.variableId);
|
|
1776
|
+
return [q(U.variableId, "", t.variableId ?? ""), q(W.initialValue, "", _t(JSON.stringify(n?.initialValue ?? null) ?? "null"))].join("");
|
|
1856
1777
|
}
|
|
1857
|
-
default: return
|
|
1778
|
+
default: return J(t.subtitle);
|
|
1858
1779
|
}
|
|
1859
1780
|
}
|
|
1860
|
-
function
|
|
1861
|
-
let i = new Map(t.nodes.map((e) => [e.id, e])), a = i.get(n.source), o = i.get(n.target), s =
|
|
1862
|
-
if (n.kind === "semantic") d.push(
|
|
1781
|
+
function ht(e, t, n, r) {
|
|
1782
|
+
let i = new Map(t.nodes.map((e) => [e.id, e])), a = i.get(n.source), o = i.get(n.target), s = N(n.id), c = a?.outputs.find((e) => e.id === n.sourcePort), l = o?.inputs.find((e) => e.id === n.targetPort), u = [q(W.source, `${a?.title ?? n.source} · ${c?.label ?? n.sourcePort}`, n.sourcePort), q(W.target, n.kind === "semantic" ? o?.title ?? n.target : `${o?.title ?? n.target} · ${l?.label ?? n.targetPort}`, n.kind === "semantic" ? "" : n.targetPort)].join(""), d = [];
|
|
1783
|
+
if (n.kind === "semantic") d.push(K(W.role, `<select class="designer-control designer-select" data-blueprint-edge-field="role" data-edge-id="${s}">${ct.map((e) => `<option value="${e}"${e === n.role ? " selected" : ""}>${x(U.semanticRoles[e])}</option>`).join("")}</select>`), J(U.semanticHint));
|
|
1863
1784
|
else {
|
|
1864
1785
|
let t = o?.inputs.filter((e) => e.available) ?? [];
|
|
1865
|
-
o?.kind === "host" && n.targetPort.startsWith("event:") ? d.push(
|
|
1866
|
-
let i =
|
|
1867
|
-
if (n.value !== void 0 && d.push(
|
|
1786
|
+
o?.kind === "host" && n.targetPort.startsWith("event:") ? d.push(K(W.hostEventName, `<input type="text" class="designer-control designer-input" data-blueprint-edge-field="host-event" data-edge-id="${s}" value="${N(n.targetPort.slice(6))}" maxlength="128">`)) : t.length > 1 && d.push(K(W.targetPort, `<select class="designer-control designer-select" data-blueprint-edge-field="target-port" data-edge-id="${s}">${t.map((e) => `<option value="${N(e.id)}"${e.id === n.targetPort ? " selected" : ""}>${x(e.label)}</option>`).join("")}</select>`));
|
|
1787
|
+
let i = et(e, n.id);
|
|
1788
|
+
if (n.value !== void 0 && d.push(Y(e, "edge", n.id, "value", W.writeValue, n.value, i, r)), o?.kind === "sub-canvas" && (n.targetPort === "open" || n.targetPort === "toggle") && d.push(dt(W.popupPayload, n.payload !== void 0, `data-blueprint-edge-field="payload-enabled" data-edge-id="${s}"`)), n.payload !== void 0 && d.push(Y(e, "edge", n.id, "payload", o?.kind === "sub-canvas" ? W.popupPayloadValue : W.payload, n.payload, i, r)), o?.kind === "component" && n.targetPort === "set-state") {
|
|
1868
1789
|
let t = e.components.find((e) => e.id === o.componentId)?.states?.items ?? [];
|
|
1869
|
-
d.push(
|
|
1790
|
+
d.push(K(W.targetState, `<select class="designer-control designer-select" data-blueprint-edge-field="state" data-edge-id="${s}">${t.map((e) => `<option value="${N(e.id)}"${e.id === n.stateId ? " selected" : ""}>${x(e.name)}</option>`).join("")}</select>`));
|
|
1870
1791
|
}
|
|
1871
1792
|
if (o?.kind === "component" && [
|
|
1872
1793
|
"show",
|
|
@@ -1874,42 +1795,42 @@ function gt(e, t, n, r) {
|
|
|
1874
1795
|
"toggle"
|
|
1875
1796
|
].includes(n.targetPort)) {
|
|
1876
1797
|
let e = n.transition;
|
|
1877
|
-
d.push(
|
|
1878
|
-
<option value=""${e === void 0 ? " selected" : ""}>${
|
|
1879
|
-
${
|
|
1880
|
-
</select>`), e === void 0 ? "" :
|
|
1798
|
+
d.push(K(W.transition, `<select class="designer-control designer-select" data-blueprint-edge-field="transition-effect" data-edge-id="${s}">
|
|
1799
|
+
<option value=""${e === void 0 ? " selected" : ""}>${W.noTransition}</option>
|
|
1800
|
+
${st.map((t) => `<option value="${t}"${e?.effect === t ? " selected" : ""}>${x(W.transitionEffects[t])}</option>`).join("")}
|
|
1801
|
+
</select>`), e === void 0 ? "" : K(W.durationMs, `<input type="number" class="designer-control designer-input" min="0" max="10000" step="50" data-blueprint-edge-field="transition-duration" data-edge-id="${s}" value="${e.durationMs}">`));
|
|
1881
1802
|
}
|
|
1882
|
-
n.order !== void 0 && (n.siblingCount ?? 1) > 1 && d.push(
|
|
1803
|
+
n.order !== void 0 && (n.siblingCount ?? 1) > 1 && d.push(K(W.executionOrder, `<span class="blueprint-config-order"><span>${x(W.edgeOrder(n.order, n.siblingCount ?? 1))}</span><button type="button" class="designer-control designer-icon-button" data-blueprint-edge-order="earlier" data-edge-id="${s}" data-tip="${N(W.earlier)}" aria-label="${N(W.earlier)}"${n.order <= 1 ? " disabled" : ""}>${h("arrow-up")}</button><button type="button" class="designer-control designer-icon-button" data-blueprint-edge-order="later" data-edge-id="${s}" data-tip="${N(W.later)}" aria-label="${N(W.later)}"${n.order >= (n.siblingCount ?? 1) ? " disabled" : ""}>${h("arrow-down")}</button></span>`));
|
|
1883
1804
|
}
|
|
1884
1805
|
return `<div class="blueprint-config" data-blueprint-edge-config="${s}" data-category="${n.category}">
|
|
1885
|
-
${
|
|
1886
|
-
${d.length === 0 ? "" :
|
|
1887
|
-
${
|
|
1806
|
+
${G("anchors", W.anchorInfo, u)}
|
|
1807
|
+
${d.length === 0 ? "" : G("edge", W.edgeConfig, d.join(""))}
|
|
1808
|
+
${ft(W.menu.deleteEdge)}
|
|
1888
1809
|
</div>`;
|
|
1889
1810
|
}
|
|
1890
|
-
function
|
|
1891
|
-
let c =
|
|
1892
|
-
["literal",
|
|
1893
|
-
["event",
|
|
1894
|
-
["event-field",
|
|
1895
|
-
["variable",
|
|
1896
|
-
...c === "advanced" ? [["advanced",
|
|
1897
|
-
].filter(([e]) => e !== "event-field" || o || c === "event-field").map(([e, t]) => `<option value="${e}"${e === c ? " selected" : ""}${e === "advanced" ? " disabled" : ""}>${
|
|
1898
|
-
if (a.kind === "literal") d = `<input type="text" class="designer-control designer-input" data-expression-part="literal" value="${
|
|
1811
|
+
function Y(e, t, n, r, i, a, o, s) {
|
|
1812
|
+
let c = nt(a), l = `data-blueprint-expression="${r}" data-expression-owner="${t}" data-expression-owner-id="${N(n)}"`, u = [
|
|
1813
|
+
["literal", U.valueSources.literal],
|
|
1814
|
+
["event", U.valueSources.event],
|
|
1815
|
+
["event-field", U.valueSources.eventField],
|
|
1816
|
+
["variable", U.valueSources.variable],
|
|
1817
|
+
...c === "advanced" ? [["advanced", U.valueSources.advanced]] : []
|
|
1818
|
+
].filter(([e]) => e !== "event-field" || o || c === "event-field").map(([e, t]) => `<option value="${e}"${e === c ? " selected" : ""}${e === "advanced" ? " disabled" : ""}>${x(t)}</option>`).join(""), d = "";
|
|
1819
|
+
if (a.kind === "literal") d = `<input type="text" class="designer-control designer-input" data-expression-part="literal" value="${N(JSON.stringify(a.value) ?? "null")}" aria-label="${N(U.literalJson)}">`;
|
|
1899
1820
|
else if (a.kind === "event-payload" && a.path.length > 0) {
|
|
1900
|
-
let i = `blueprint-fields-${t}-${n}-${r}`.replace(/[^A-Za-z0-9_-]/g, "-"), o = t === "edge" ?
|
|
1901
|
-
d = `<input type="text" class="designer-control designer-input" data-expression-part="field" list="${i}" value="${
|
|
1821
|
+
let i = `blueprint-fields-${t}-${n}-${r}`.replace(/[^A-Za-z0-9_-]/g, "-"), o = t === "edge" ? rt(e, n, s) : [];
|
|
1822
|
+
d = `<input type="text" class="designer-control designer-input" data-expression-part="field" list="${i}" value="${N(a.path.join("."))}" aria-label="${N(U.eventField)}"><datalist id="${i}">${o.map((e) => `<option value="${N(e.join("."))}"></option>`).join("")}</datalist>`;
|
|
1902
1823
|
} else if (a.kind === "variable") {
|
|
1903
|
-
let t =
|
|
1904
|
-
d = `<select class="designer-control designer-select" data-expression-part="variable" aria-label="${
|
|
1905
|
-
} else c === "advanced" && (d = `<code class="blueprint-config-advanced">${
|
|
1906
|
-
return `<div class="blueprint-expression" ${l}>${
|
|
1824
|
+
let t = f(e);
|
|
1825
|
+
d = `<select class="designer-control designer-select" data-expression-part="variable" aria-label="${N(U.sourceVariable)}">${t.map((e) => `<option value="${N(e.id)}"${e.id === a.variableId ? " selected" : ""}>${x(e.name)}</option>`).join("")}</select>`;
|
|
1826
|
+
} else c === "advanced" && (d = `<code class="blueprint-config-advanced">${x(_t(JSON.stringify(a) ?? ""))}</code>`);
|
|
1827
|
+
return `<div class="blueprint-expression" ${l}>${K(i, `<span class="blueprint-expression-stack"><select class="designer-control designer-select" data-expression-part="source" aria-label="${N(U.valueSource)}">${u}</select>${d}</span>`, "expression")}</div>`;
|
|
1907
1828
|
}
|
|
1908
|
-
function
|
|
1829
|
+
function gt(e) {
|
|
1909
1830
|
if (typeof e.querySelectorAll != "function") return;
|
|
1910
1831
|
let t = e.ownerDocument ?? e;
|
|
1911
1832
|
for (let n of e.querySelectorAll("[data-blueprint-field-row]")) {
|
|
1912
|
-
let e = n.dataset.blueprintFieldRow ?? "", r = n.dataset.blueprintFieldVariant === "expression", i = n.querySelector("input, select, textarea") !== null, a =
|
|
1833
|
+
let e = n.dataset.blueprintFieldRow ?? "", r = n.dataset.blueprintFieldVariant === "expression", i = n.querySelector("input, select, textarea") !== null, a = m(t, {
|
|
1913
1834
|
label: e,
|
|
1914
1835
|
tagName: i && !r ? "label" : "div",
|
|
1915
1836
|
className: r ? "blueprint-config-field blueprint-expression-row" : "blueprint-config-field"
|
|
@@ -1921,7 +1842,7 @@ function _t(e) {
|
|
|
1921
1842
|
a.control.append(...n.childNodes), n.replaceWith(a.field);
|
|
1922
1843
|
}
|
|
1923
1844
|
for (let n of e.querySelectorAll("[data-blueprint-field-switch]")) {
|
|
1924
|
-
let { field: e, input: r } =
|
|
1845
|
+
let { field: e, input: r } = p(t, {
|
|
1925
1846
|
label: n.dataset.blueprintFieldSwitch ?? "",
|
|
1926
1847
|
checked: n.dataset.checked === "true",
|
|
1927
1848
|
className: "blueprint-config-field"
|
|
@@ -1930,51 +1851,51 @@ function _t(e) {
|
|
|
1930
1851
|
n.replaceWith(e);
|
|
1931
1852
|
}
|
|
1932
1853
|
}
|
|
1933
|
-
function
|
|
1854
|
+
function _t(e, t = 96) {
|
|
1934
1855
|
return e.length <= t ? e : `${e.slice(0, t - 1)}…`;
|
|
1935
1856
|
}
|
|
1936
|
-
var
|
|
1857
|
+
var vt = [
|
|
1937
1858
|
"configuration",
|
|
1938
1859
|
"problems",
|
|
1939
1860
|
"trace"
|
|
1940
1861
|
];
|
|
1941
|
-
function
|
|
1862
|
+
function yt(e, t, n, r, i, a, o, s) {
|
|
1942
1863
|
if (e === void 0) return;
|
|
1943
1864
|
let c = {
|
|
1944
1865
|
configuration: 0,
|
|
1945
1866
|
problems: a.length,
|
|
1946
1867
|
trace: o?.steps.length ?? 0
|
|
1947
|
-
}, l =
|
|
1868
|
+
}, l = Ct(t, n, r, i);
|
|
1948
1869
|
e.innerHTML = `<div class="blueprint-inspector-shell">
|
|
1949
1870
|
<header class="blueprint-inspector-topbar">
|
|
1950
|
-
<span><strong>${
|
|
1951
|
-
<div class="blueprint-inspector-modes" role="tablist" aria-label="${
|
|
1952
|
-
${
|
|
1871
|
+
<span><strong>${x(l.title)}</strong><small>${x(l.detail)}</small></span>
|
|
1872
|
+
<div class="blueprint-inspector-modes" role="tablist" aria-label="${d.blueprint.inspector}">
|
|
1873
|
+
${vt.map((e) => wt(e, i, c[e])).join("")}
|
|
1953
1874
|
</div>
|
|
1954
1875
|
</header>
|
|
1955
1876
|
<div class="blueprint-panel-scroll inspector-pane" data-blueprint-inspector-pane id="designer-blueprint-inspector-${i}-panel" role="tabpanel" aria-labelledby="designer-blueprint-inspector-${i}-tab" tabindex="0" aria-live="polite">
|
|
1956
|
-
${
|
|
1877
|
+
${bt(i, t, n, r, a, o, s)}
|
|
1957
1878
|
</div>
|
|
1958
|
-
</div>`,
|
|
1879
|
+
</div>`, gt(e);
|
|
1959
1880
|
}
|
|
1960
|
-
function
|
|
1961
|
-
return e === "problems" ?
|
|
1881
|
+
function bt(e, t, n, r, i, a, o) {
|
|
1882
|
+
return e === "problems" ? xt(i) : e === "trace" ? St(a) : lt(t, n, r, o);
|
|
1962
1883
|
}
|
|
1963
|
-
function
|
|
1884
|
+
function xt(e) {
|
|
1964
1885
|
let t = e.slice(0, 8);
|
|
1965
|
-
return t.length === 0 ? `<div class="designer-empty" data-tone="success"><span class="designer-empty-icon" aria-hidden="true">${
|
|
1886
|
+
return t.length === 0 ? `<div class="designer-empty" data-tone="success"><span class="designer-empty-icon" aria-hidden="true">${h("check")}</span><p class="designer-empty-title">${d.blueprint.problemsHealthy}</p><p class="designer-empty-hint">${d.blueprint.problemsHealthyHint}</p></div>` : `<section class="blueprint-inspector-status" data-blueprint-problems><ul>${t.map((e) => `<li data-severity="${e.severity}"><strong>${x(e.code)}</strong><span>${x(e.message)}</span><small>${x(e.path.join(".") || "—")}</small></li>`).join("")}</ul></section>`;
|
|
1966
1887
|
}
|
|
1967
|
-
function
|
|
1968
|
-
if (e === null) return `<div class="designer-empty"><span class="designer-empty-icon" aria-hidden="true">${
|
|
1888
|
+
function St(e) {
|
|
1889
|
+
if (e === null) return `<div class="designer-empty"><span class="designer-empty-icon" aria-hidden="true">${h("terminal")}</span><p class="designer-empty-title">${d.blueprint.noTrace}</p><p class="designer-empty-hint">${d.blueprint.noTraceHint}</p></div>`;
|
|
1969
1890
|
let t = e.steps.filter((e) => e.kind === "condition" && e.passed === !1).length;
|
|
1970
1891
|
return `<section class="blueprint-inspector-status" data-blueprint-trace data-failed="${String(e.failed)}">
|
|
1971
|
-
<div class="blueprint-trace-summary">${
|
|
1972
|
-
<ol class="blueprint-trace-steps">${e.steps.slice(0, 200).map((e) => `<li data-kind="${e.kind}"${e.passed === void 0 ? "" : ` data-passed="${String(e.passed)}"`} style="--bp-trace-depth: ${Math.min(e.depth, 12)}">${e.nodeId === void 0 ?
|
|
1973
|
-
<button type="button" class="designer-button" data-blueprint-clear-trace>${
|
|
1892
|
+
<div class="blueprint-trace-summary">${d.blueprint.traceSummary(e.executedEdgeIds.length, t)}</div>
|
|
1893
|
+
<ol class="blueprint-trace-steps">${e.steps.slice(0, 200).map((e) => `<li data-kind="${e.kind}"${e.passed === void 0 ? "" : ` data-passed="${String(e.passed)}"`} style="--bp-trace-depth: ${Math.min(e.depth, 12)}">${e.nodeId === void 0 ? x(e.text) : `<button type="button" class="blueprint-trace-step" data-blueprint-select-node="${x(e.nodeId)}">${x(e.text)}</button>`}</li>`).join("")}</ol>
|
|
1894
|
+
<button type="button" class="designer-button" data-blueprint-clear-trace>${d.blueprint.graph.simulation.clear}</button>
|
|
1974
1895
|
</section>`;
|
|
1975
1896
|
}
|
|
1976
|
-
function
|
|
1977
|
-
let i =
|
|
1897
|
+
function Ct(e, t, n, r) {
|
|
1898
|
+
let i = d.blueprint;
|
|
1978
1899
|
if (r === "problems") return {
|
|
1979
1900
|
title: i.problemsTitle,
|
|
1980
1901
|
detail: i.inspector
|
|
@@ -2003,147 +1924,147 @@ function wt(e, t, n, r) {
|
|
|
2003
1924
|
detail: s === void 0 ? i.selectionType.edge : `${s.id} | ${i.graph.edgeCategories[s.category]}`
|
|
2004
1925
|
};
|
|
2005
1926
|
}
|
|
2006
|
-
function
|
|
2007
|
-
let r =
|
|
2008
|
-
return `<button type="button" class="blueprint-inspector-mode" id="designer-blueprint-inspector-${e}-tab" role="tab" aria-controls="designer-blueprint-inspector-${e}-panel" aria-selected="${String(e === t)}" tabindex="${e === t ? 0 : -1}" data-blueprint-inspector-tab="${e}" data-tip="${r}" aria-label="${r}"><span aria-hidden="true">${
|
|
1927
|
+
function wt(e, t, n) {
|
|
1928
|
+
let r = d.blueprint.inspectorTabs[e];
|
|
1929
|
+
return `<button type="button" class="blueprint-inspector-mode" id="designer-blueprint-inspector-${e}-tab" role="tab" aria-controls="designer-blueprint-inspector-${e}-panel" aria-selected="${String(e === t)}" tabindex="${e === t ? 0 : -1}" data-blueprint-inspector-tab="${e}" data-tip="${r}" aria-label="${r}"><span aria-hidden="true">${h(e === "configuration" ? "sliders" : e === "problems" ? "check" : "terminal")}</span>${n === 0 ? "" : `<em data-tone="${e === "problems" ? "danger" : "neutral"}">${n}</em>`}</button>`;
|
|
2009
1930
|
}
|
|
2010
|
-
var
|
|
1931
|
+
var Tt = [
|
|
2011
1932
|
"components",
|
|
2012
1933
|
"relations",
|
|
2013
1934
|
"variables"
|
|
2014
|
-
],
|
|
1935
|
+
], Et = [
|
|
2015
1936
|
"lifecycle",
|
|
2016
1937
|
"timer",
|
|
2017
1938
|
"condition",
|
|
2018
1939
|
"host"
|
|
2019
|
-
],
|
|
2020
|
-
function
|
|
1940
|
+
], X = d.blueprint;
|
|
1941
|
+
function Dt(e, t) {
|
|
2021
1942
|
if (e === void 0) return;
|
|
2022
|
-
let n = (t.groups ?? []).filter((e) =>
|
|
1943
|
+
let n = (t.groups ?? []).filter((e) => M(e, "blueprint")), r = O(t.activeTab), i = n.some((e) => e.id === r) ? r : void 0, a = Ft(t.activeTab) ? t.activeTab : "components", o = i === void 0 ? a : j(i), s = a === "relations" ? X.relationList.search : X.librarySearch;
|
|
2023
1944
|
e.innerHTML = `<div class="blueprint-library-shell">
|
|
2024
|
-
<nav class="rail-tabs blueprint-library-rail" role="tablist" aria-orientation="vertical" aria-label="${
|
|
2025
|
-
${
|
|
2026
|
-
${n.map((e) =>
|
|
1945
|
+
<nav class="rail-tabs blueprint-library-rail" role="tablist" aria-orientation="vertical" aria-label="${X.library}">
|
|
1946
|
+
${Tt.map((e) => Nt(e, o)).join("")}
|
|
1947
|
+
${n.map((e) => Pt(e, i)).join("")}
|
|
2027
1948
|
</nav>
|
|
2028
1949
|
<section class="rail-view blueprint-library-main"${i === void 0 ? "" : " hidden"}>
|
|
2029
1950
|
<div class="layer-panel-controls blueprint-library-controls">
|
|
2030
1951
|
<label class="designer-field layer-search blueprint-library-search">
|
|
2031
|
-
<span class="layer-search-glyph" aria-hidden="true">${
|
|
2032
|
-
<input type="search" class="designer-control designer-input" data-blueprint-library-search value="${
|
|
1952
|
+
<span class="layer-search-glyph" aria-hidden="true">${h("search")}</span>
|
|
1953
|
+
<input type="search" class="designer-control designer-input" data-blueprint-library-search value="${N(t.query)}" placeholder="${s}" aria-label="${s}">
|
|
2033
1954
|
</label>
|
|
2034
1955
|
</div>
|
|
2035
1956
|
<div class="blueprint-panel-scroll" id="designer-blueprint-library-${a}-panel" role="tabpanel" aria-labelledby="designer-blueprint-library-${a}-tab" tabindex="0">
|
|
2036
|
-
${
|
|
1957
|
+
${Ot(a, t)}
|
|
2037
1958
|
</div>
|
|
2038
1959
|
</section>
|
|
2039
1960
|
</div>`;
|
|
2040
1961
|
}
|
|
2041
|
-
function
|
|
1962
|
+
function Ot(e, t) {
|
|
2042
1963
|
let n = t.query.trim().toLocaleLowerCase();
|
|
2043
|
-
return e === "components" ?
|
|
1964
|
+
return e === "components" ? kt(t.components, t.selection, n, X.layers, X.noComponentNodes) : e === "variables" ? kt(t.variables, t.selection, n, X.globalVariables, X.noVariables) : jt(t, n);
|
|
2044
1965
|
}
|
|
2045
|
-
function
|
|
1966
|
+
function kt(e, t, n, r, i) {
|
|
2046
1967
|
let a = e.filter((e) => n.length === 0 || `${e.name} ${e.entityId} ${e.subtitle}`.toLocaleLowerCase().includes(n));
|
|
2047
|
-
return a.length === 0 ?
|
|
2048
|
-
<header><strong>${
|
|
1968
|
+
return a.length === 0 ? Z(i) : `<section class="blueprint-palette-group" aria-label="${N(r)}">
|
|
1969
|
+
<header><strong>${x(r)}</strong><span>${a.length}</span></header>
|
|
2049
1970
|
<div class="blueprint-palette-list">
|
|
2050
|
-
${a.map((e) =>
|
|
1971
|
+
${a.map((e) => At(e, t)).join("")}
|
|
2051
1972
|
</div>
|
|
2052
|
-
<p class="blueprint-library-hint">${
|
|
1973
|
+
<p class="blueprint-library-hint">${X.componentNodeHint}</p>
|
|
2053
1974
|
</section>`;
|
|
2054
1975
|
}
|
|
2055
|
-
function
|
|
2056
|
-
let n = e.nodeId !== void 0, r = n && t.nodes.includes(e.nodeId ?? ""), i = e.kind === "component", a = n ? `data-blueprint-select-node="${
|
|
1976
|
+
function At(e, t) {
|
|
1977
|
+
let n = e.nodeId !== void 0, r = n && t.nodes.includes(e.nodeId ?? ""), i = e.kind === "component", a = n ? `data-blueprint-select-node="${N(e.nodeId ?? "")}"` : i ? `data-blueprint-add-component="${N(e.entityId)}"` : `data-blueprint-add-variable="${N(e.entityId)}"`, o = n ? i ? X.locateComponent(e.name) : X.locateVariable(e.name) : i ? X.addComponent(e.name) : X.addVariableNode(e.name), s = n ? "" : ` draggable="true" data-blueprint-drag-kind="${e.kind}" data-${i ? "component" : "variable"}-id="${N(e.entityId)}" data-blueprint-drag-label="${N(e.name)}"`, c = i ? "layers" : "variable", l = i ? X.componentEventCount(e.eventCount) : e.subtitle;
|
|
2057
1978
|
return `<div class="designer-list-row blueprint-palette-item" data-density="default" data-depth="${e.depth}" style="--bp-indent: ${e.depth * 16}px" data-placed="${String(n)}" data-selected="${String(r)}" data-node-kind="${e.kind}"${s}>
|
|
2058
|
-
<button type="button" class="blueprint-palette-primary" ${a} aria-label="${
|
|
2059
|
-
<span class="blueprint-palette-glyph" aria-hidden="true">${
|
|
2060
|
-
<span class="blueprint-palette-copy"><strong>${
|
|
2061
|
-
<span class="blueprint-palette-state" aria-hidden="true">${
|
|
1979
|
+
<button type="button" class="blueprint-palette-primary" ${a} aria-label="${N(o)}" data-tip="${N(o)}">
|
|
1980
|
+
<span class="blueprint-palette-glyph" aria-hidden="true">${h(c)}</span>
|
|
1981
|
+
<span class="blueprint-palette-copy"><strong>${x(e.name)}</strong><small>${x(l)}</small></span>
|
|
1982
|
+
<span class="blueprint-palette-state" aria-hidden="true">${h(n ? "check" : "plus")}</span>
|
|
2062
1983
|
</button>
|
|
2063
1984
|
</div>`;
|
|
2064
1985
|
}
|
|
2065
|
-
function
|
|
2066
|
-
let n =
|
|
2067
|
-
let i = t === "host" || t === "lifecycle" ? e.graph.nodes.find((e) => e.kind === t) : void 0, a = r.has(t), o = i === void 0 ? `data-blueprint-insert-node="${t}"` : `data-blueprint-select-node="${
|
|
2068
|
-
return `<div class="designer-list-row blueprint-palette-item" data-density="default" data-placed="${String(a)}" data-node-kind="${t}"${a ? "" : ` draggable="true" data-blueprint-drag-kind="${t}" data-blueprint-drag-label="${
|
|
2069
|
-
<button type="button" class="blueprint-palette-primary" ${o} aria-label="${
|
|
2070
|
-
<span class="blueprint-palette-glyph" aria-hidden="true">${
|
|
2071
|
-
<span class="blueprint-palette-copy"><strong>${
|
|
2072
|
-
<span class="blueprint-palette-state" aria-hidden="true">${
|
|
1986
|
+
function jt(e, t) {
|
|
1987
|
+
let n = X.graph, r = new Set(e.graph.nodes.filter((e) => e.kind === "host" || e.kind === "lifecycle").map((e) => e.kind)), i = Et.filter((e) => t.length === 0 || `${n.nodeKinds[e]} ${n.nodeKindHints[e]} ${e}`.toLocaleLowerCase().includes(t)), a = i.map((t) => {
|
|
1988
|
+
let i = t === "host" || t === "lifecycle" ? e.graph.nodes.find((e) => e.kind === t) : void 0, a = r.has(t), o = i === void 0 ? `data-blueprint-insert-node="${t}"` : `data-blueprint-select-node="${N(i.id)}"`, s = X.addLogicNode(n.nodeKinds[t]), c = t === "timer" ? "activity" : t === "condition" ? "sliders" : t === "host" ? "terminal" : "play";
|
|
1989
|
+
return `<div class="designer-list-row blueprint-palette-item" data-density="default" data-placed="${String(a)}" data-node-kind="${t}"${a ? "" : ` draggable="true" data-blueprint-drag-kind="${t}" data-blueprint-drag-label="${N(n.nodeKinds[t])}"`}>
|
|
1990
|
+
<button type="button" class="blueprint-palette-primary" ${o} aria-label="${N(s)}" data-tip="${N(s)}">
|
|
1991
|
+
<span class="blueprint-palette-glyph" aria-hidden="true">${h(c)}</span>
|
|
1992
|
+
<span class="blueprint-palette-copy"><strong>${x(n.nodeKinds[t])}</strong><small>${x(n.nodeKindHints[t])}</small></span>
|
|
1993
|
+
<span class="blueprint-palette-state" aria-hidden="true">${h(a ? "check" : "plus")}</span>
|
|
2073
1994
|
</button>
|
|
2074
1995
|
</div>`;
|
|
2075
1996
|
}).join(""), o = new Map(e.graph.nodes.map((e) => [e.id, e.title])), s = e.graph.edges.filter((e) => t.length === 0 || `${o.get(e.source) ?? ""} ${o.get(e.target) ?? ""} ${e.label} ${e.sourcePort} ${e.targetPort}`.toLocaleLowerCase().includes(t)), c = s.map((t) => {
|
|
2076
1997
|
let r = e.selection.edges.includes(t.id), i = `${o.get(t.source) ?? t.source} → ${o.get(t.target) ?? t.target}`;
|
|
2077
1998
|
return `<div class="designer-list-row blueprint-relation-item" data-density="default" data-selected="${String(r)}" data-category="${t.category}" data-active="${String(t.active)}">
|
|
2078
|
-
<button type="button" class="blueprint-palette-primary" data-blueprint-select-edge="${
|
|
1999
|
+
<button type="button" class="blueprint-palette-primary" data-blueprint-select-edge="${N(t.id)}" aria-label="${N(i)}">
|
|
2079
2000
|
<span class="blueprint-relation-swatch" aria-hidden="true"></span>
|
|
2080
|
-
<span class="blueprint-palette-copy"><strong>${
|
|
2001
|
+
<span class="blueprint-palette-copy"><strong>${x(i)}</strong><small>${x(`${n.edgeCategories[t.category]} · ${t.label}`)}</small></span>
|
|
2081
2002
|
</button>
|
|
2082
2003
|
</div>`;
|
|
2083
2004
|
}).join("");
|
|
2084
|
-
return `<section class="blueprint-palette-group" aria-label="${
|
|
2085
|
-
<header><strong>${
|
|
2086
|
-
<div class="blueprint-palette-list">${a ||
|
|
2087
|
-
<p class="blueprint-library-hint">${
|
|
2005
|
+
return `<section class="blueprint-palette-group" aria-label="${X.logic}">
|
|
2006
|
+
<header><strong>${X.logic}</strong><span>${i.length}</span></header>
|
|
2007
|
+
<div class="blueprint-palette-list">${a || Z(X.noLogicNodes)}</div>
|
|
2008
|
+
<p class="blueprint-library-hint">${X.directNodeHint}</p>
|
|
2088
2009
|
</section>
|
|
2089
|
-
${
|
|
2090
|
-
<section class="blueprint-palette-group" aria-label="${
|
|
2091
|
-
<header><strong>${
|
|
2092
|
-
<div class="blueprint-palette-list">${c ||
|
|
2010
|
+
${Mt(e, t)}
|
|
2011
|
+
<section class="blueprint-palette-group" aria-label="${X.graph.edgeList}">
|
|
2012
|
+
<header><strong>${X.graph.edgeList}</strong><span>${s.length}</span></header>
|
|
2013
|
+
<div class="blueprint-palette-list">${c || Z(n.noEdges)}</div>
|
|
2093
2014
|
</section>`;
|
|
2094
2015
|
}
|
|
2095
|
-
function
|
|
2016
|
+
function Mt(e, t) {
|
|
2096
2017
|
let n = e.document?.subCanvases ?? [], r = [...n.some((e) => e.display === "page") ? [{
|
|
2097
2018
|
id: "",
|
|
2098
|
-
name:
|
|
2099
|
-
detail:
|
|
2019
|
+
name: X.graph.nodeKinds["main-canvas"],
|
|
2020
|
+
detail: X.mainCanvasEntry,
|
|
2100
2021
|
icon: "grid",
|
|
2101
2022
|
kind: "main-canvas"
|
|
2102
2023
|
}] : [], ...n.map((e) => ({
|
|
2103
2024
|
id: e.id,
|
|
2104
2025
|
name: e.name,
|
|
2105
|
-
detail: e.display === "page" ?
|
|
2026
|
+
detail: e.display === "page" ? X.pageSize : `${X.graph.subCanvasKinds.popup} · ${X.popupSize(e.width, e.height)}`,
|
|
2106
2027
|
icon: e.display === "page" ? "doc" : "copy",
|
|
2107
2028
|
kind: "sub-canvas"
|
|
2108
2029
|
}))].filter((e) => t.length === 0 || `${e.name} ${e.id}`.toLocaleLowerCase().includes(t)), i = r.map((t) => {
|
|
2109
|
-
let n = e.graph.nodes.find((e) => t.kind === "main-canvas" ? e.kind === "main-canvas" : e.kind === "sub-canvas" && e.canvasId === t.id), r = n !== void 0, i = r && e.selection.nodes.includes(n.id), a = r ? `data-blueprint-select-node="${
|
|
2030
|
+
let n = e.graph.nodes.find((e) => t.kind === "main-canvas" ? e.kind === "main-canvas" : e.kind === "sub-canvas" && e.canvasId === t.id), r = n !== void 0, i = r && e.selection.nodes.includes(n.id), a = r ? `data-blueprint-select-node="${N(n.id)}"` : `data-blueprint-add-canvas="${N(t.id)}"`, o = r ? X.locateCanvas(t.name) : X.addCanvasNode(t.name), s = r ? "" : ` draggable="true" data-blueprint-drag-kind="${t.kind}"${t.kind === "sub-canvas" ? ` data-canvas-id="${N(t.id)}"` : ""} data-blueprint-drag-label="${N(t.name)}"`;
|
|
2110
2031
|
return `<div class="designer-list-row blueprint-palette-item" data-density="default" data-placed="${String(r)}" data-selected="${String(i)}" data-node-kind="${t.kind}"${s}>
|
|
2111
|
-
<button type="button" class="blueprint-palette-primary" ${a} aria-label="${
|
|
2112
|
-
<span class="blueprint-palette-glyph" aria-hidden="true">${
|
|
2113
|
-
<span class="blueprint-palette-copy"><strong>${
|
|
2114
|
-
<span class="blueprint-palette-state" aria-hidden="true">${
|
|
2032
|
+
<button type="button" class="blueprint-palette-primary" ${a} aria-label="${N(o)}" data-tip="${N(o)}">
|
|
2033
|
+
<span class="blueprint-palette-glyph" aria-hidden="true">${h(t.icon)}</span>
|
|
2034
|
+
<span class="blueprint-palette-copy"><strong>${x(t.name)}</strong><small>${x(t.detail)}</small></span>
|
|
2035
|
+
<span class="blueprint-palette-state" aria-hidden="true">${h(r ? "check" : "plus")}</span>
|
|
2115
2036
|
</button>
|
|
2116
2037
|
</div>`;
|
|
2117
2038
|
}).join("");
|
|
2118
|
-
return `<section class="blueprint-palette-group" aria-label="${
|
|
2119
|
-
<header><strong>${
|
|
2120
|
-
<div class="blueprint-palette-list">${i ||
|
|
2039
|
+
return `<section class="blueprint-palette-group" aria-label="${X.canvases}">
|
|
2040
|
+
<header><strong>${X.canvases}</strong><span>${r.length}</span></header>
|
|
2041
|
+
<div class="blueprint-palette-list">${i || Z(X.noSubCanvases)}</div>
|
|
2121
2042
|
</section>`;
|
|
2122
2043
|
}
|
|
2123
|
-
function
|
|
2124
|
-
let n =
|
|
2125
|
-
return `<button type="button" class="designer-tab blueprint-library-rail-tab" id="designer-blueprint-library-${e}-tab" role="tab" aria-controls="designer-blueprint-library-${e}-panel" aria-selected="${String(e === t)}" tabindex="${e === t ? 0 : -1}" data-blueprint-library-tab="${e}" data-tip="${r}" aria-label="${r}"><span class="rail-tab-glyph" aria-hidden="true">${
|
|
2044
|
+
function Nt(e, t) {
|
|
2045
|
+
let n = X.libraryTabs[e], r = e === "components" ? X.layers : e === "relations" ? X.logic : X.globalVariables;
|
|
2046
|
+
return `<button type="button" class="designer-tab blueprint-library-rail-tab" id="designer-blueprint-library-${e}-tab" role="tab" aria-controls="designer-blueprint-library-${e}-panel" aria-selected="${String(e === t)}" tabindex="${e === t ? 0 : -1}" data-blueprint-library-tab="${e}" data-tip="${r}" aria-label="${r}"><span class="rail-tab-glyph" aria-hidden="true">${h(e === "components" ? "layers" : e === "relations" ? "link" : "variable")}</span><span class="rail-tab-label">${n}</span></button>`;
|
|
2126
2047
|
}
|
|
2127
|
-
function
|
|
2128
|
-
let n = e.id === t, r =
|
|
2129
|
-
return `<button type="button" class="designer-tab blueprint-library-rail-tab" id="${de(e.id)}" role="tab" aria-controls="${fe(e.id)}" aria-selected="${String(n)}" tabindex="${n ? 0 : -1}" data-blueprint-library-tab="${r}" data-host-left-panel-group="${
|
|
2048
|
+
function Pt(e, t) {
|
|
2049
|
+
let n = e.id === t, r = j(e.id), i = N(e.label);
|
|
2050
|
+
return `<button type="button" class="designer-tab blueprint-library-rail-tab" id="${de(e.id)}" role="tab" aria-controls="${fe(e.id)}" aria-selected="${String(n)}" tabindex="${n ? 0 : -1}" data-blueprint-library-tab="${r}" data-host-left-panel-group="${N(e.id)}" data-host-left-panel-mode="blueprint" data-tip="${i}" aria-label="${i}"><span class="rail-tab-glyph" aria-hidden="true">${h(e.icon ?? "shapes")}</span><span class="rail-tab-label">${x(e.label)}</span></button>`;
|
|
2130
2051
|
}
|
|
2131
|
-
function
|
|
2052
|
+
function Ft(e) {
|
|
2132
2053
|
return e === "components" || e === "relations" || e === "variables";
|
|
2133
2054
|
}
|
|
2134
|
-
function
|
|
2135
|
-
return `<div class="designer-empty"><span class="designer-empty-icon" aria-hidden="true">${
|
|
2055
|
+
function Z(e) {
|
|
2056
|
+
return `<div class="designer-empty"><span class="designer-empty-icon" aria-hidden="true">${h("search")}</span><p class="designer-empty-title">${e}</p></div>`;
|
|
2136
2057
|
}
|
|
2137
|
-
function
|
|
2058
|
+
function It(e, t) {
|
|
2138
2059
|
if (e === void 0) return !1;
|
|
2139
|
-
if (
|
|
2140
|
-
let n =
|
|
2141
|
-
return n !== void 0 && t?.some((e) => e.id === n &&
|
|
2060
|
+
if (Ft(e)) return !0;
|
|
2061
|
+
let n = O(e);
|
|
2062
|
+
return n !== void 0 && t?.some((e) => e.id === n && M(e, "blueprint")) === !0;
|
|
2142
2063
|
}
|
|
2143
|
-
function
|
|
2064
|
+
function Lt(e) {
|
|
2144
2065
|
return e === "configuration" || e === "problems" || e === "trace";
|
|
2145
2066
|
}
|
|
2146
|
-
var
|
|
2067
|
+
var Rt = /* @__PURE__ */ new Set([
|
|
2147
2068
|
"eq",
|
|
2148
2069
|
"neq",
|
|
2149
2070
|
"gt",
|
|
@@ -2152,7 +2073,7 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2152
2073
|
"lte",
|
|
2153
2074
|
"contains",
|
|
2154
2075
|
"exists"
|
|
2155
|
-
]),
|
|
2076
|
+
]), zt = /^[A-Za-z_][A-Za-z0-9_]{0,127}$/, Bt = class {
|
|
2156
2077
|
callbacks;
|
|
2157
2078
|
#e;
|
|
2158
2079
|
#t;
|
|
@@ -2175,11 +2096,11 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2175
2096
|
this.#i = "trace";
|
|
2176
2097
|
}
|
|
2177
2098
|
get selectedLeftPanelGroupId() {
|
|
2178
|
-
return
|
|
2099
|
+
return O(this.#r);
|
|
2179
2100
|
}
|
|
2180
2101
|
selectLeftPanelGroup(e) {
|
|
2181
2102
|
let t = this.blueprintHostGroup(e);
|
|
2182
|
-
return t !== void 0 && (this.#r =
|
|
2103
|
+
return t !== void 0 && (this.#r = j(t.id), this.callbacks.expandLeftPanel(), this.render(), !0);
|
|
2183
2104
|
}
|
|
2184
2105
|
refreshLeftPanelGroups() {
|
|
2185
2106
|
this.reconcileLibraryTab();
|
|
@@ -2188,22 +2109,22 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2188
2109
|
let e = this.hasLibraryTabFocus();
|
|
2189
2110
|
this.reconcileLibraryTab();
|
|
2190
2111
|
let t = this.callbacks.getDocument(), n = this.callbacks.getGraph(), r = this.callbacks.getSelection(), i = t === void 0 ? [] : Ce(t, this.callbacks.getCatalog(), this.callbacks.getRuntimeContributions());
|
|
2191
|
-
|
|
2112
|
+
Dt(this.#e, {
|
|
2192
2113
|
document: t,
|
|
2193
2114
|
graph: n,
|
|
2194
2115
|
components: i,
|
|
2195
|
-
variables: t === void 0 ? [] : we(t,
|
|
2116
|
+
variables: t === void 0 ? [] : we(t, d.blueprint),
|
|
2196
2117
|
selection: r,
|
|
2197
2118
|
query: this.#n,
|
|
2198
2119
|
activeTab: this.#r,
|
|
2199
2120
|
groups: this.callbacks.getLeftPanelGroups()
|
|
2200
|
-
}),
|
|
2121
|
+
}), yt(this.#t, t, n, r, this.#i, this.callbacks.getDiagnostics(), this.callbacks.getTrace(), this.callbacks.getCatalog()), this.#e !== void 0 && b(this.#e), this.#t !== void 0 && b(this.#t), this.callbacks.getMode() === "blueprint" && this.#e !== void 0 && (at(this.#e.getRootNode(), this.blueprintHostGroup(this.selectedLeftPanelGroupId), n.nodes.length), this.callbacks.onActiveLeftPanelGroupChange()), e && this.#e?.querySelector(`[data-blueprint-library-tab="${this.#r}"]`)?.focus();
|
|
2201
2122
|
}
|
|
2202
2123
|
onClick(e) {
|
|
2203
2124
|
let t = e.closest("[data-blueprint-library-tab]")?.dataset.blueprintLibraryTab;
|
|
2204
|
-
if (
|
|
2125
|
+
if (It(t, this.callbacks.getLeftPanelGroups())) return this.#r = t, this.callbacks.expandLeftPanel(), this.render(), this.#e?.querySelector(`[data-blueprint-library-tab="${t}"]`)?.focus(), !0;
|
|
2205
2126
|
let n = e.closest("[data-blueprint-inspector-tab]")?.dataset.blueprintInspectorTab;
|
|
2206
|
-
if (
|
|
2127
|
+
if (Lt(n)) return this.#i = n, this.render(), this.#t?.querySelector(`[data-blueprint-inspector-tab="${n}"]`)?.focus(), !0;
|
|
2207
2128
|
let r = e.closest("[data-blueprint-select-node], [data-blueprint-select-edge], [data-blueprint-add-component], [data-blueprint-add-variable], [data-blueprint-add-canvas], [data-blueprint-insert-node], [data-blueprint-delete], [data-blueprint-nodes-enabled], [data-blueprint-edge-order], [data-blueprint-clear-trace]");
|
|
2208
2129
|
if (r === null) return !1;
|
|
2209
2130
|
let i = r.dataset;
|
|
@@ -2233,12 +2154,12 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2233
2154
|
let o = this.callbacks.getDocument();
|
|
2234
2155
|
if (o === void 0) return !0;
|
|
2235
2156
|
if (i.blueprintDelete !== void 0) {
|
|
2236
|
-
let e = this.callbacks.commitBlueprint(
|
|
2237
|
-
return e.ok && this.callbacks.select(
|
|
2157
|
+
let e = this.callbacks.commitBlueprint(w(o.blueprint, this.callbacks.getSelection()));
|
|
2158
|
+
return e.ok && this.callbacks.select(_, !1), this.report(e), !0;
|
|
2238
2159
|
}
|
|
2239
|
-
if (i.blueprintNodesEnabled !== void 0) return this.report(this.callbacks.commitBlueprint(
|
|
2160
|
+
if (i.blueprintNodesEnabled !== void 0) return this.report(this.callbacks.commitBlueprint(ee(o.blueprint, new Set(this.callbacks.getSelection().nodes), i.blueprintNodesEnabled === "true"))), !0;
|
|
2240
2161
|
let s = i.blueprintEdgeOrder;
|
|
2241
|
-
return (s === "earlier" || s === "later") && i.edgeId !== void 0 && this.report(this.callbacks.commitBlueprint(
|
|
2162
|
+
return (s === "earlier" || s === "later") && i.edgeId !== void 0 && this.report(this.callbacks.commitBlueprint(re(o.blueprint, i.edgeId, s))), !0;
|
|
2242
2163
|
}
|
|
2243
2164
|
onDragStart(e) {
|
|
2244
2165
|
let t = (e.target instanceof Element ? e.target : null)?.closest("[data-blueprint-drag-kind]"), n = e.dataTransfer;
|
|
@@ -2296,7 +2217,7 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2296
2217
|
insert(e) {
|
|
2297
2218
|
let t = this.callbacks.getDocument();
|
|
2298
2219
|
if (t === void 0) return;
|
|
2299
|
-
let n =
|
|
2220
|
+
let n = T(t, e);
|
|
2300
2221
|
if (n === null) {
|
|
2301
2222
|
this.report({
|
|
2302
2223
|
ok: !1,
|
|
@@ -2304,7 +2225,7 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2304
2225
|
severity: "error",
|
|
2305
2226
|
code: "AUTHORING_REQUEST_INVALID",
|
|
2306
2227
|
path: [],
|
|
2307
|
-
message:
|
|
2228
|
+
message: d.blueprint.invalidCommand
|
|
2308
2229
|
}]
|
|
2309
2230
|
});
|
|
2310
2231
|
return;
|
|
@@ -2320,22 +2241,22 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2320
2241
|
}, !0), this.report(r);
|
|
2321
2242
|
}
|
|
2322
2243
|
changeNode(e, t, n, r) {
|
|
2323
|
-
let i =
|
|
2244
|
+
let i = D(e.blueprint, t);
|
|
2324
2245
|
if (i === void 0) return;
|
|
2325
2246
|
let a = null;
|
|
2326
|
-
if (n === "name") a =
|
|
2247
|
+
if (n === "name") a = A(e.blueprint, t, {
|
|
2327
2248
|
type: "name",
|
|
2328
2249
|
name: r
|
|
2329
2250
|
});
|
|
2330
|
-
else if (n === "enabled") a =
|
|
2251
|
+
else if (n === "enabled") a = A(e.blueprint, t, {
|
|
2331
2252
|
type: "enabled",
|
|
2332
2253
|
enabled: r === "true"
|
|
2333
2254
|
});
|
|
2334
|
-
else if (n === "interval") a =
|
|
2255
|
+
else if (n === "interval") a = A(e.blueprint, t, {
|
|
2335
2256
|
type: "interval",
|
|
2336
2257
|
intervalSeconds: Number(r)
|
|
2337
2258
|
});
|
|
2338
|
-
else if (n === "operator" && i.kind === "condition" &&
|
|
2259
|
+
else if (n === "operator" && i.kind === "condition" && Rt.has(r)) {
|
|
2339
2260
|
let n = r, o = n === "exists" ? {
|
|
2340
2261
|
left: i.condition.left,
|
|
2341
2262
|
operator: n
|
|
@@ -2347,7 +2268,7 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2347
2268
|
value: null
|
|
2348
2269
|
}
|
|
2349
2270
|
};
|
|
2350
|
-
a =
|
|
2271
|
+
a = A(e.blueprint, t, {
|
|
2351
2272
|
type: "condition",
|
|
2352
2273
|
condition: o
|
|
2353
2274
|
});
|
|
@@ -2358,33 +2279,33 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2358
2279
|
let i = he(e.blueprint, t);
|
|
2359
2280
|
if (i === void 0) return;
|
|
2360
2281
|
let a = null;
|
|
2361
|
-
if (n === "role" && (r === "related" || r === "detail" || r === "group" || r === "drill-down")) a =
|
|
2282
|
+
if (n === "role" && (r === "related" || r === "detail" || r === "group" || r === "drill-down")) a = k(e.blueprint, t, {
|
|
2362
2283
|
type: "role",
|
|
2363
2284
|
role: r
|
|
2364
2285
|
});
|
|
2365
2286
|
else if (n === "target-port") {
|
|
2366
2287
|
let n = e.blueprint.nodes.find((e) => e.id === i.to.node), o = n?.kind === "component" ? e.components.find((e) => e.id === n.componentId)?.states?.items[0]?.id : void 0;
|
|
2367
|
-
a =
|
|
2288
|
+
a = k(e.blueprint, t, {
|
|
2368
2289
|
type: "target-port",
|
|
2369
2290
|
port: r,
|
|
2370
2291
|
...o === void 0 ? {} : { stateId: o }
|
|
2371
2292
|
});
|
|
2372
|
-
} else if (n === "state" && i.kind === "flow") a =
|
|
2293
|
+
} else if (n === "state" && i.kind === "flow") a = k(e.blueprint, t, {
|
|
2373
2294
|
type: "state",
|
|
2374
2295
|
stateId: r
|
|
2375
2296
|
});
|
|
2376
|
-
else if (n === "host-event" &&
|
|
2297
|
+
else if (n === "host-event" && zt.test(r.trim())) a = k(e.blueprint, t, {
|
|
2377
2298
|
type: "target-port",
|
|
2378
2299
|
port: `event:${r.trim()}`
|
|
2379
2300
|
});
|
|
2380
|
-
else if (n === "payload-enabled" && i.kind === "flow") a =
|
|
2301
|
+
else if (n === "payload-enabled" && i.kind === "flow") a = k(e.blueprint, t, {
|
|
2381
2302
|
type: "payload",
|
|
2382
2303
|
payload: r === "true" ? {
|
|
2383
2304
|
kind: "event-payload",
|
|
2384
2305
|
path: []
|
|
2385
2306
|
} : null
|
|
2386
2307
|
});
|
|
2387
|
-
else if (n === "transition-effect" && i.kind === "flow") a =
|
|
2308
|
+
else if (n === "transition-effect" && i.kind === "flow") a = k(e.blueprint, t, {
|
|
2388
2309
|
type: "transition",
|
|
2389
2310
|
transition: r === "appear" || r === "fade" || r === "slide-up" ? {
|
|
2390
2311
|
effect: r,
|
|
@@ -2394,7 +2315,7 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2394
2315
|
});
|
|
2395
2316
|
else if (n === "transition-duration" && i.kind === "flow" && i.transition !== void 0) {
|
|
2396
2317
|
let n = Number(r);
|
|
2397
|
-
Number.isInteger(n) && n >= 0 && n <= 1e4 && (a =
|
|
2318
|
+
Number.isInteger(n) && n >= 0 && n <= 1e4 && (a = k(e.blueprint, t, {
|
|
2398
2319
|
type: "transition",
|
|
2399
2320
|
transition: {
|
|
2400
2321
|
...i.transition,
|
|
@@ -2420,10 +2341,10 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2420
2341
|
};
|
|
2421
2342
|
else if (e === "event-field") c = {
|
|
2422
2343
|
kind: "event-payload",
|
|
2423
|
-
path: (a === "edge" ?
|
|
2344
|
+
path: (a === "edge" ? rt(t, o, this.callbacks.getCatalog()) : [])[0] ?? ["value"]
|
|
2424
2345
|
};
|
|
2425
2346
|
else if (e === "variable") {
|
|
2426
|
-
let e =
|
|
2347
|
+
let e = f(t)[0];
|
|
2427
2348
|
e !== void 0 && (c = {
|
|
2428
2349
|
kind: "variable",
|
|
2429
2350
|
variableId: e.id
|
|
@@ -2439,7 +2360,7 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2439
2360
|
c = void 0;
|
|
2440
2361
|
}
|
|
2441
2362
|
else if (s === "field") {
|
|
2442
|
-
let e =
|
|
2363
|
+
let e = tt(r.value);
|
|
2443
2364
|
e !== null && (c = {
|
|
2444
2365
|
kind: "event-payload",
|
|
2445
2366
|
path: e
|
|
@@ -2455,13 +2376,13 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2455
2376
|
severity: "error",
|
|
2456
2377
|
code: "AUTHORING_REQUEST_INVALID",
|
|
2457
2378
|
path: [],
|
|
2458
|
-
message: s === "field" ?
|
|
2379
|
+
message: s === "field" ? d.blueprint.eventFieldInvalid : d.blueprint.graph.simulation.invalidPayload
|
|
2459
2380
|
}]
|
|
2460
2381
|
}), this.render();
|
|
2461
2382
|
return;
|
|
2462
2383
|
}
|
|
2463
2384
|
let l = null;
|
|
2464
|
-
if (a === "edge" && (i === "value" || i === "payload")) l =
|
|
2385
|
+
if (a === "edge" && (i === "value" || i === "payload")) l = k(t.blueprint, o, i === "value" ? {
|
|
2465
2386
|
type: "value",
|
|
2466
2387
|
value: c
|
|
2467
2388
|
} : {
|
|
@@ -2469,8 +2390,8 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2469
2390
|
payload: c
|
|
2470
2391
|
});
|
|
2471
2392
|
else if (a === "node" && (i === "left" || i === "right")) {
|
|
2472
|
-
let e =
|
|
2473
|
-
e?.kind === "condition" && (l =
|
|
2393
|
+
let e = D(t.blueprint, o);
|
|
2394
|
+
e?.kind === "condition" && (l = A(t.blueprint, o, {
|
|
2474
2395
|
type: "condition",
|
|
2475
2396
|
condition: {
|
|
2476
2397
|
...e.condition,
|
|
@@ -2499,19 +2420,19 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2499
2420
|
return (this.#e?.getRootNode())?.activeElement?.closest("[data-blueprint-library-tab]") != null;
|
|
2500
2421
|
}
|
|
2501
2422
|
blueprintHostGroup(e) {
|
|
2502
|
-
if (e !== void 0) return this.callbacks.getLeftPanelGroups()?.find((t) => t.id === e &&
|
|
2423
|
+
if (e !== void 0) return this.callbacks.getLeftPanelGroups()?.find((t) => t.id === e && M(t, "blueprint"));
|
|
2503
2424
|
}
|
|
2504
|
-
},
|
|
2425
|
+
}, Vt = Object.freeze({
|
|
2505
2426
|
nodes: Object.freeze([]),
|
|
2506
2427
|
edges: Object.freeze([])
|
|
2507
|
-
}),
|
|
2428
|
+
}), Ht = class {
|
|
2508
2429
|
callbacks;
|
|
2509
2430
|
#e;
|
|
2510
2431
|
#t;
|
|
2511
2432
|
#n;
|
|
2512
2433
|
#r;
|
|
2513
2434
|
#i = "canvas";
|
|
2514
|
-
#a =
|
|
2435
|
+
#a = _;
|
|
2515
2436
|
#o = !0;
|
|
2516
2437
|
#s;
|
|
2517
2438
|
#c = 0;
|
|
@@ -2520,7 +2441,7 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2520
2441
|
#d;
|
|
2521
2442
|
#f = () => this.resolveCanvas();
|
|
2522
2443
|
constructor(e) {
|
|
2523
|
-
this.callbacks = e, this.#u = new
|
|
2444
|
+
this.callbacks = e, this.#u = new Xe({
|
|
2524
2445
|
getDocument: e.getDocument,
|
|
2525
2446
|
getGraph: () => this.graph,
|
|
2526
2447
|
getMode: () => this.#i,
|
|
@@ -2540,7 +2461,7 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2540
2461
|
render: () => this.render(),
|
|
2541
2462
|
emitDiagnostics: e.emitDiagnostics,
|
|
2542
2463
|
onSimulated: () => this.#d.showTrace()
|
|
2543
|
-
}), this.#d = new
|
|
2464
|
+
}), this.#d = new Bt({
|
|
2544
2465
|
getDocument: e.getDocument,
|
|
2545
2466
|
getGraph: () => this.graph,
|
|
2546
2467
|
getCatalog: e.getCatalog,
|
|
@@ -2602,7 +2523,7 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2602
2523
|
addVariableNode(e) {
|
|
2603
2524
|
let t = this.callbacks.getDocument();
|
|
2604
2525
|
if (t === void 0) return;
|
|
2605
|
-
let n =
|
|
2526
|
+
let n = T(t, {
|
|
2606
2527
|
kind: "variable",
|
|
2607
2528
|
variableId: e
|
|
2608
2529
|
});
|
|
@@ -2622,7 +2543,7 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2622
2543
|
} });
|
|
2623
2544
|
}
|
|
2624
2545
|
resetSession() {
|
|
2625
|
-
this.#a =
|
|
2546
|
+
this.#a = _, this.#o = !0, this.#s = void 0, this.#d.reset(), this.#u.reset(), this.render();
|
|
2626
2547
|
}
|
|
2627
2548
|
selectLeftPanelGroup(e) {
|
|
2628
2549
|
return this.#i === "blueprint" && this.#d.selectLeftPanelGroup(e);
|
|
@@ -2631,14 +2552,14 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2631
2552
|
this.#d.refreshLeftPanelGroups(), this.render();
|
|
2632
2553
|
}
|
|
2633
2554
|
setMode(e, t = {}, n = "api") {
|
|
2634
|
-
let r =
|
|
2555
|
+
let r = v(e, t);
|
|
2635
2556
|
if (!r.ok) return r;
|
|
2636
|
-
if (e === "blueprint" && !this.available) return $("BLUEPRINT_CAPABILITY_UNAVAILABLE",
|
|
2557
|
+
if (e === "blueprint" && !this.available) return $("BLUEPRINT_CAPABILITY_UNAVAILABLE", d.blueprint.noHostCanvas);
|
|
2637
2558
|
if (t.focus !== void 0) {
|
|
2638
2559
|
let e = this.ensureFocusNode(t.focus);
|
|
2639
2560
|
if (!e.ok) return e;
|
|
2640
2561
|
let n = this.resolveFocus(t.focus);
|
|
2641
|
-
if (n === void 0) return $("AUTHORING_REQUEST_INVALID",
|
|
2562
|
+
if (n === void 0) return $("AUTHORING_REQUEST_INVALID", d.blueprint.invalidSelection);
|
|
2642
2563
|
this.#a = this.graphHasEdge(n) ? {
|
|
2643
2564
|
nodes: [],
|
|
2644
2565
|
edges: [n]
|
|
@@ -2652,7 +2573,7 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2652
2573
|
};
|
|
2653
2574
|
}
|
|
2654
2575
|
let i = this.#i;
|
|
2655
|
-
return this.#i = e, this.render(), i !== e && this.emitModeChange(i, e, n),
|
|
2576
|
+
return this.#i = e, this.render(), i !== e && this.emitModeChange(i, e, n), Q(null);
|
|
2656
2577
|
}
|
|
2657
2578
|
render() {
|
|
2658
2579
|
let e = this.graph;
|
|
@@ -2673,7 +2594,7 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2673
2594
|
}
|
|
2674
2595
|
let n = e.closest("[data-blueprint-search-id]")?.dataset.blueprintSearchId;
|
|
2675
2596
|
if (n !== void 0) {
|
|
2676
|
-
let e =
|
|
2597
|
+
let e = Wt(n), t = e === void 0 ? $("AUTHORING_REQUEST_INVALID", d.blueprint.invalidSelection) : this.focusOrInsert(e);
|
|
2677
2598
|
return t.ok || this.callbacks.emitDiagnostics(t.diagnostics), !0;
|
|
2678
2599
|
}
|
|
2679
2600
|
return this.#d.onClick(e);
|
|
@@ -2704,10 +2625,10 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2704
2625
|
}
|
|
2705
2626
|
get graph() {
|
|
2706
2627
|
let e = this.callbacks.getDocument();
|
|
2707
|
-
if (e === void 0) return
|
|
2628
|
+
if (e === void 0) return Vt;
|
|
2708
2629
|
let t = this.callbacks.getCatalog(), n = this.callbacks.getRuntimeContributions(), r = this.#l;
|
|
2709
2630
|
if (r !== void 0 && r.document === e && r.catalog === t && r.contributions === n) return r.graph;
|
|
2710
|
-
let i = Te(e, t, n,
|
|
2631
|
+
let i = Te(e, t, n, d.blueprint);
|
|
2711
2632
|
return this.#l = {
|
|
2712
2633
|
document: e,
|
|
2713
2634
|
catalog: t,
|
|
@@ -2721,7 +2642,7 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2721
2642
|
ensureFocusNode(e) {
|
|
2722
2643
|
let t = this.callbacks.getDocument();
|
|
2723
2644
|
if (t !== void 0 && (e.kind === "component" || e.kind === "variable")) {
|
|
2724
|
-
let n =
|
|
2645
|
+
let n = T(t, e.kind === "component" ? {
|
|
2725
2646
|
kind: "component",
|
|
2726
2647
|
componentId: e.id
|
|
2727
2648
|
} : {
|
|
@@ -2739,7 +2660,7 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2739
2660
|
};
|
|
2740
2661
|
}
|
|
2741
2662
|
}
|
|
2742
|
-
return
|
|
2663
|
+
return Q(null);
|
|
2743
2664
|
}
|
|
2744
2665
|
mountDefaultCanvas() {
|
|
2745
2666
|
if (this.#r !== void 0 || this.#n === void 0) return;
|
|
@@ -2762,11 +2683,11 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2762
2683
|
}
|
|
2763
2684
|
fallbackToCanvas(e) {
|
|
2764
2685
|
let t = this.#i;
|
|
2765
|
-
this.#i = "canvas", this.render(), this.emitModeChange(t, "canvas", "fallback"), e && this.callbacks.emitDiagnostics([
|
|
2686
|
+
this.#i = "canvas", this.render(), this.emitModeChange(t, "canvas", "fallback"), e && this.callbacks.emitDiagnostics([Ut("BLUEPRINT_CAPABILITY_UNAVAILABLE", d.blueprint.noHostCanvas)]);
|
|
2766
2687
|
}
|
|
2767
2688
|
select(e, t) {
|
|
2768
2689
|
let n = this.graph, r = new Set(n.nodes.map((e) => e.id)), i = new Set(n.edges.map((e) => e.id));
|
|
2769
|
-
if (e.nodes.some((e) => !r.has(e)) || e.edges.some((e) => !i.has(e))) return $("AUTHORING_REQUEST_INVALID",
|
|
2690
|
+
if (e.nodes.some((e) => !r.has(e)) || e.edges.some((e) => !i.has(e))) return $("AUTHORING_REQUEST_INVALID", d.blueprint.invalidSelection);
|
|
2770
2691
|
this.#a = {
|
|
2771
2692
|
nodes: [...e.nodes],
|
|
2772
2693
|
edges: [...e.edges]
|
|
@@ -2776,7 +2697,7 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2776
2697
|
id: ++this.#c,
|
|
2777
2698
|
type: "focus",
|
|
2778
2699
|
targetId: a
|
|
2779
|
-
}), this.render(),
|
|
2700
|
+
}), this.render(), Q(null);
|
|
2780
2701
|
}
|
|
2781
2702
|
reconcileSelection(e) {
|
|
2782
2703
|
let t = new Set(e.nodes.map((e) => e.id)), n = new Set(e.edges.map((e) => e.id)), r = this.#a.nodes.filter((e) => t.has(e)), i = this.#a.edges.filter((e) => n.has(e));
|
|
@@ -2787,7 +2708,7 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2787
2708
|
}
|
|
2788
2709
|
resolveFocus(e) {
|
|
2789
2710
|
let t = this.callbacks.getDocument();
|
|
2790
|
-
if (t !== void 0) return e.kind === "component" ?
|
|
2711
|
+
if (t !== void 0) return e.kind === "component" ? g(t.blueprint, e.id)?.id : e.kind === "variable" ? C(t.blueprint, e.id)?.id : e.kind === "node" ? t.blueprint.nodes.some((t) => t.id === e.id) ? e.id : void 0 : this.graphHasEdge(e.id) ? e.id : void 0;
|
|
2791
2712
|
}
|
|
2792
2713
|
graphHasEdge(e) {
|
|
2793
2714
|
return this.graph.edges.some((t) => t.id === e);
|
|
@@ -2816,7 +2737,7 @@ var zt = /* @__PURE__ */ new Set([
|
|
|
2816
2737
|
}));
|
|
2817
2738
|
}
|
|
2818
2739
|
};
|
|
2819
|
-
function
|
|
2740
|
+
function Ut(e, t) {
|
|
2820
2741
|
return {
|
|
2821
2742
|
severity: "error",
|
|
2822
2743
|
code: e,
|
|
@@ -2824,7 +2745,7 @@ function Wt(e, t) {
|
|
|
2824
2745
|
message: t
|
|
2825
2746
|
};
|
|
2826
2747
|
}
|
|
2827
|
-
function
|
|
2748
|
+
function Q(e) {
|
|
2828
2749
|
return {
|
|
2829
2750
|
ok: !0,
|
|
2830
2751
|
value: e,
|
|
@@ -2834,10 +2755,10 @@ function Gt(e) {
|
|
|
2834
2755
|
function $(e, t) {
|
|
2835
2756
|
return {
|
|
2836
2757
|
ok: !1,
|
|
2837
|
-
diagnostics: [
|
|
2758
|
+
diagnostics: [Ut(e, t)]
|
|
2838
2759
|
};
|
|
2839
2760
|
}
|
|
2840
|
-
function
|
|
2761
|
+
function Wt(e) {
|
|
2841
2762
|
let t = e.indexOf(":");
|
|
2842
2763
|
if (t <= 0) return;
|
|
2843
2764
|
let n = e.slice(0, t), r = e.slice(t + 1);
|
|
@@ -2847,6 +2768,6 @@ function Kt(e) {
|
|
|
2847
2768
|
} : void 0;
|
|
2848
2769
|
}
|
|
2849
2770
|
//#endregion
|
|
2850
|
-
export {
|
|
2771
|
+
export { Ht as DesignerBlueprintWorkbenchPanel };
|
|
2851
2772
|
|
|
2852
|
-
//# sourceMappingURL=designer-blueprint-workbench-panel-
|
|
2773
|
+
//# sourceMappingURL=designer-blueprint-workbench-panel-BWSglfAb-ktaj6Ci9.js.map
|