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,5 +1,5 @@
|
|
|
1
1
|
import { i as e, m as t } from "./image-url-D6mUcjY1.js";
|
|
2
|
-
import { b as n, f as r, n as i, y as a } from "./parse-
|
|
2
|
+
import { b as n, f as r, n as i, y as a } from "./parse-Ji7kE9ZT.js";
|
|
3
3
|
import { t as o } from "./equality-DjZ9cv4u.js";
|
|
4
4
|
import { o as s, t as c } from "./theme-CcBXf4Ay.js";
|
|
5
5
|
import { c as l, i as u, l as d, n as f, o as p, r as m, t as h } from "./hierarchy-BQZrZWbC.js";
|
|
@@ -44,7 +44,7 @@ function b(e, t) {
|
|
|
44
44
|
function x(e) {
|
|
45
45
|
return Object.is(e, -0) ? 0 : e;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function ee(e) {
|
|
48
48
|
return {
|
|
49
49
|
x: x(e.x),
|
|
50
50
|
y: x(e.y)
|
|
@@ -52,7 +52,7 @@ function S(e) {
|
|
|
52
52
|
}
|
|
53
53
|
//#endregion
|
|
54
54
|
//#region ../core/dist/geometry/bounds.js
|
|
55
|
-
function
|
|
55
|
+
function S(e) {
|
|
56
56
|
let { position: { x: t, y: n }, size: { width: r, height: i }, rotation: a } = e;
|
|
57
57
|
if (!Number.isFinite(t) || !Number.isFinite(n) || !Number.isFinite(r) || !Number.isFinite(i) || !Number.isFinite(a) || t < -1e6 || t > 1e6 || n < -1e6 || n > 1e6 || r <= 0 || i <= 0 || r > 1e6 || i > 1e6 || a < -180 || a >= 180) return null;
|
|
58
58
|
let o = t + r / 2, s = n + i / 2, c = r / 2, l = i / 2, u = a * Math.PI / 180, d = Math.cos(u), f = Math.sin(u), p = [
|
|
@@ -108,7 +108,7 @@ function re(e) {
|
|
|
108
108
|
"parentId"
|
|
109
109
|
],
|
|
110
110
|
message: `Component ancestor depth ${a} exceeds the maximum of ${te}.`
|
|
111
|
-
}),
|
|
111
|
+
}), S(i) === null && n.push({
|
|
112
112
|
severity: "error",
|
|
113
113
|
code: "CORE_GEOMETRY_INVALID",
|
|
114
114
|
path: ["components", r],
|
|
@@ -195,8 +195,130 @@ function N(e, t, n) {
|
|
|
195
195
|
};
|
|
196
196
|
}
|
|
197
197
|
//#endregion
|
|
198
|
+
//#region ../core/dist/commands/apply-collection-commands.js
|
|
199
|
+
function ce(e, t) {
|
|
200
|
+
if (!Array.isArray(t) || t.length === 0) return j(e, M("Data sources to add must be a non-empty array.", ["dataSources"]));
|
|
201
|
+
let n = P(t, new Set((e.dataSources ?? []).map((e) => e.id)));
|
|
202
|
+
if (n !== void 0) return j(e, M("Data source id already exists.", [
|
|
203
|
+
"dataSources",
|
|
204
|
+
n,
|
|
205
|
+
"id"
|
|
206
|
+
]));
|
|
207
|
+
let r = k(e, {
|
|
208
|
+
...e,
|
|
209
|
+
dataSources: [...e.dataSources ?? [], ...t]
|
|
210
|
+
}, []);
|
|
211
|
+
if (!r.ok) return r;
|
|
212
|
+
let i = t.map((e) => e.id);
|
|
213
|
+
return {
|
|
214
|
+
...r,
|
|
215
|
+
changedComponentIds: g(r.document, i)
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
function le(e, t, n) {
|
|
219
|
+
if (typeof t != "string" || !a(t)) return j(e, M("Data source id is invalid.", ["dataSourceId"]));
|
|
220
|
+
if (!D(n) || Object.keys(n).length === 0) return j(e, M("Params patch must be a non-empty object.", ["params"]));
|
|
221
|
+
let r = e.dataSources ?? [], i = r.findIndex((e) => e.id === t), s = r[i];
|
|
222
|
+
if (s === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["dataSourceId"], "Data source target does not exist."));
|
|
223
|
+
let c = { ...s.params };
|
|
224
|
+
for (let [e, t] of Object.entries(n)) t === null ? delete c[e] : c[e] = t;
|
|
225
|
+
if (o(s.params, c)) return A(e, []);
|
|
226
|
+
let l = r.map((e, t) => t === i ? {
|
|
227
|
+
...e,
|
|
228
|
+
params: c
|
|
229
|
+
} : e), u = k(e, {
|
|
230
|
+
...e,
|
|
231
|
+
dataSources: l
|
|
232
|
+
}, []);
|
|
233
|
+
return u.ok ? {
|
|
234
|
+
...u,
|
|
235
|
+
changedComponentIds: g(u.document, [t])
|
|
236
|
+
} : u;
|
|
237
|
+
}
|
|
238
|
+
function ue(e, t) {
|
|
239
|
+
if (!Array.isArray(t) || t.length === 0) return j(e, M("Variables to add must be a non-empty array.", ["variables"]));
|
|
240
|
+
let n = P(t, new Set(e.variables.map((e) => e.id)));
|
|
241
|
+
return n === void 0 ? k(e, {
|
|
242
|
+
...e,
|
|
243
|
+
variables: [...e.variables, ...t]
|
|
244
|
+
}, []) : j(e, M("Variable id already exists.", [
|
|
245
|
+
"variables",
|
|
246
|
+
n,
|
|
247
|
+
"id"
|
|
248
|
+
]));
|
|
249
|
+
}
|
|
250
|
+
function de(e, t) {
|
|
251
|
+
let n = F(t);
|
|
252
|
+
if (n === void 0) return j(e, M("Variable ids must be a non-empty array of ids.", ["variableIds"]));
|
|
253
|
+
let r = new Set(e.variables.map((e) => e.id)), i = n.findIndex((e) => !r.has(e));
|
|
254
|
+
if (i >= 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["variableIds", i], "Variable target does not exist."));
|
|
255
|
+
let a = new Set(n);
|
|
256
|
+
return k(e, {
|
|
257
|
+
...e,
|
|
258
|
+
variables: e.variables.filter((e) => !a.has(e.id))
|
|
259
|
+
}, []);
|
|
260
|
+
}
|
|
261
|
+
function fe(e, t, n) {
|
|
262
|
+
if (!Array.isArray(t) || !Array.isArray(n) || t.length + n.length === 0) return j(e, M("Blueprint nodes and edges must be arrays, not both empty.", []));
|
|
263
|
+
let r = P(t, new Set(e.blueprint.nodes.map((e) => e.id)));
|
|
264
|
+
if (r !== void 0) return j(e, M("Blueprint node id already exists.", [
|
|
265
|
+
"nodes",
|
|
266
|
+
r,
|
|
267
|
+
"id"
|
|
268
|
+
]));
|
|
269
|
+
let i = P(n, new Set(e.blueprint.edges.map((e) => e.id)));
|
|
270
|
+
if (i !== void 0) return j(e, M("Blueprint edge id already exists.", [
|
|
271
|
+
"edges",
|
|
272
|
+
i,
|
|
273
|
+
"id"
|
|
274
|
+
]));
|
|
275
|
+
let a = {
|
|
276
|
+
...e.blueprint,
|
|
277
|
+
nodes: [...e.blueprint.nodes, ...t],
|
|
278
|
+
edges: [...e.blueprint.edges, ...n]
|
|
279
|
+
};
|
|
280
|
+
return k(e, {
|
|
281
|
+
...e,
|
|
282
|
+
blueprint: a
|
|
283
|
+
}, []);
|
|
284
|
+
}
|
|
285
|
+
function pe(e, t, n) {
|
|
286
|
+
let r = F(t, !0), i = F(n, !0);
|
|
287
|
+
if (r === void 0 || i === void 0 || r.length + i.length === 0) return j(e, M("Blueprint node and edge ids must be arrays, not both empty.", []));
|
|
288
|
+
let a = new Set(e.blueprint.nodes.map((e) => e.id)), o = r.findIndex((e) => !a.has(e));
|
|
289
|
+
if (o >= 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["nodeIds", o], "Blueprint node does not exist."));
|
|
290
|
+
let s = new Set(e.blueprint.edges.map((e) => e.id)), c = i.findIndex((e) => !s.has(e));
|
|
291
|
+
if (c >= 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["edgeIds", c], "Blueprint edge does not exist."));
|
|
292
|
+
let l = new Set(r), u = new Set(i), d = (e) => l.has(e.from.node) || l.has(e.to.node), f = e.blueprint.layout, p = {
|
|
293
|
+
...e.blueprint,
|
|
294
|
+
nodes: e.blueprint.nodes.filter((e) => !l.has(e.id)),
|
|
295
|
+
edges: e.blueprint.edges.filter((e) => !u.has(e.id) && !d(e)),
|
|
296
|
+
...f === void 0 ? {} : { layout: {
|
|
297
|
+
...f,
|
|
298
|
+
nodes: f.nodes.filter((e) => !l.has(e.id))
|
|
299
|
+
} }
|
|
300
|
+
};
|
|
301
|
+
return k(e, {
|
|
302
|
+
...e,
|
|
303
|
+
blueprint: p
|
|
304
|
+
}, []);
|
|
305
|
+
}
|
|
306
|
+
function P(e, t) {
|
|
307
|
+
let n = new Set(t);
|
|
308
|
+
for (let [t, r] of e.entries()) {
|
|
309
|
+
let e = D(r) && typeof r.id == "string" ? r.id : void 0;
|
|
310
|
+
if (e === void 0 || n.has(e)) return t;
|
|
311
|
+
n.add(e);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
function F(e, t = !1) {
|
|
315
|
+
if (!Array.isArray(e) || !t && e.length === 0 || e.some((e) => typeof e != "string")) return;
|
|
316
|
+
let n = e;
|
|
317
|
+
return new Set(n).size === n.length ? n : void 0;
|
|
318
|
+
}
|
|
319
|
+
//#endregion
|
|
198
320
|
//#region ../core/dist/commands/apply-component-commands.js
|
|
199
|
-
var
|
|
321
|
+
var me = /* @__PURE__ */ new Set([
|
|
200
322
|
"name",
|
|
201
323
|
"position",
|
|
202
324
|
"size",
|
|
@@ -211,7 +333,7 @@ var ce = /* @__PURE__ */ new Set([
|
|
|
211
333
|
"dataBinding",
|
|
212
334
|
"belowSubCanvas"
|
|
213
335
|
]);
|
|
214
|
-
function
|
|
336
|
+
function he(e, t) {
|
|
215
337
|
if (!D(t)) return j(e, M("Component must be an object.", ["component"]));
|
|
216
338
|
let n = h(e);
|
|
217
339
|
return typeof t.id == "string" ? n.byId.has(t.id) ? j(e, N("CORE_COMMAND_INVALID", ["component", "id"], "Component id already exists.")) : t.parentId !== null && !n.byId.has(t.parentId) ? j(e, N("CORE_COMMAND_PARENT_INVALID", ["component", "parentId"], "Component parent does not exist.")) : t.parentId !== null && d(n, t.parentId) ? j(e, N("CORE_COMMAND_TARGET_LOCKED", ["component", "parentId"], "Component parent is locked.")) : k(e, {
|
|
@@ -219,9 +341,9 @@ function le(e, t) {
|
|
|
219
341
|
components: [...e.components, t]
|
|
220
342
|
}, [t.id]) : j(e, M("Component id must be a string.", ["component", "id"]));
|
|
221
343
|
}
|
|
222
|
-
function
|
|
344
|
+
function ge(e, t, n) {
|
|
223
345
|
if (!O(t)) return j(e, M("Component ids must be a string array.", ["componentIds"]));
|
|
224
|
-
if (!oe(n,
|
|
346
|
+
if (!oe(n, me) || Object.keys(n).length === 0) return j(e, M("Component patch must contain known fields.", ["patch"]));
|
|
225
347
|
let r = E(e, t);
|
|
226
348
|
if (r === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["componentIds"], "One or more components do not exist."));
|
|
227
349
|
if (r.length === 0) return A(e, []);
|
|
@@ -240,7 +362,7 @@ function ue(e, t, n) {
|
|
|
240
362
|
components: c
|
|
241
363
|
}, l);
|
|
242
364
|
}
|
|
243
|
-
function
|
|
365
|
+
function _e(e, t) {
|
|
244
366
|
if (!O(t)) return j(e, M("Component ids must be a string array.", ["componentIds"]));
|
|
245
367
|
let n = E(e, t);
|
|
246
368
|
if (n === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["componentIds"], "One or more components do not exist."));
|
|
@@ -256,7 +378,7 @@ function de(e, t) {
|
|
|
256
378
|
components: e.components.filter((e) => !i.has(e.id))
|
|
257
379
|
}, a) : j(e, N("CORE_COMMAND_TARGET_LOCKED", ["componentIds"], `Component "${o}" is locked.`));
|
|
258
380
|
}
|
|
259
|
-
function
|
|
381
|
+
function ve(e, t, n) {
|
|
260
382
|
if (!O(t) || n !== null && typeof n != "string") return j(e, M("Reparent command fields are invalid.", []));
|
|
261
383
|
let r = E(e, t);
|
|
262
384
|
if (r === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["componentIds"], "One or more components do not exist."));
|
|
@@ -289,7 +411,7 @@ function fe(e, t, n) {
|
|
|
289
411
|
})
|
|
290
412
|
}, c);
|
|
291
413
|
}
|
|
292
|
-
function
|
|
414
|
+
function ye(e, t, n) {
|
|
293
415
|
if (!O(t) || n !== null && typeof n != "string") return j(e, M("Move command fields are invalid.", []));
|
|
294
416
|
let r = n === null ? void 0 : (e.subCanvases ?? []).find((e) => e.id === n);
|
|
295
417
|
if (n !== null && r === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["canvasId"], "Target sub canvas does not exist."));
|
|
@@ -310,7 +432,7 @@ function pe(e, t, n) {
|
|
|
310
432
|
canvasId: n
|
|
311
433
|
};
|
|
312
434
|
if (r?.display === "popup") {
|
|
313
|
-
let t =
|
|
435
|
+
let t = I(e.position.x, 0, Math.max(0, r.width - e.size.width)), n = I(e.position.y, 0, Math.max(0, r.height - e.size.height));
|
|
314
436
|
(t !== e.position.x || n !== e.position.y) && (o = {
|
|
315
437
|
...o,
|
|
316
438
|
position: {
|
|
@@ -326,32 +448,32 @@ function pe(e, t, n) {
|
|
|
326
448
|
components: l
|
|
327
449
|
}, c);
|
|
328
450
|
}
|
|
329
|
-
function
|
|
451
|
+
function I(e, t, n) {
|
|
330
452
|
return Math.min(n, Math.max(t, e));
|
|
331
453
|
}
|
|
332
454
|
//#endregion
|
|
333
455
|
//#region ../core/dist/commands/apply-data-source-command.js
|
|
334
|
-
function
|
|
456
|
+
function be(e, t) {
|
|
335
457
|
if (!Array.isArray(t)) return j(e, M("Data sources must be an array.", ["dataSources"]));
|
|
336
458
|
let n = e.dataSources ?? [], r = new Map(n.map((e) => [e.id, e])), i = t.map((e) => {
|
|
337
|
-
let t =
|
|
459
|
+
let t = Se(e);
|
|
338
460
|
if (t === void 0) return e;
|
|
339
461
|
let n = r.get(t);
|
|
340
462
|
return n !== void 0 && o(n, e) ? n : e;
|
|
341
463
|
});
|
|
342
|
-
if (
|
|
464
|
+
if (xe(n, i)) return A(e, []);
|
|
343
465
|
let a = k(e, {
|
|
344
466
|
...e,
|
|
345
467
|
dataSources: i
|
|
346
468
|
}, []);
|
|
347
469
|
if (!a.ok) return a;
|
|
348
|
-
let s = g(a.document,
|
|
470
|
+
let s = g(a.document, L(n, a.document.dataSources ?? []));
|
|
349
471
|
return {
|
|
350
472
|
...a,
|
|
351
473
|
changedComponentIds: s
|
|
352
474
|
};
|
|
353
475
|
}
|
|
354
|
-
function
|
|
476
|
+
function L(e, t) {
|
|
355
477
|
let n = new Map(e.map((e) => [e.id, e])), r = new Map(t.map((e) => [e.id, e])), i = [];
|
|
356
478
|
for (let [e, t] of n) {
|
|
357
479
|
let n = r.get(e);
|
|
@@ -360,23 +482,23 @@ function F(e, t) {
|
|
|
360
482
|
for (let e of r.keys()) n.has(e) || i.push(e);
|
|
361
483
|
return i;
|
|
362
484
|
}
|
|
363
|
-
function
|
|
485
|
+
function xe(e, t) {
|
|
364
486
|
return e.length === t.length && t.every((t, n) => t === e[n]);
|
|
365
487
|
}
|
|
366
|
-
function
|
|
488
|
+
function Se(e) {
|
|
367
489
|
if (typeof e != "object" || !e || Array.isArray(e)) return;
|
|
368
490
|
let t = e.id;
|
|
369
491
|
return typeof t == "string" ? t : void 0;
|
|
370
492
|
}
|
|
371
493
|
//#endregion
|
|
372
494
|
//#region ../core/dist/commands/apply-variable-command.js
|
|
373
|
-
var
|
|
495
|
+
var Ce = /* @__PURE__ */ new Set([
|
|
374
496
|
"type",
|
|
375
497
|
"variableId",
|
|
376
498
|
"nextName"
|
|
377
499
|
]);
|
|
378
|
-
function
|
|
379
|
-
if (!D(t) || Object.keys(t).some((e) => !
|
|
500
|
+
function we(e, t) {
|
|
501
|
+
if (!D(t) || Object.keys(t).some((e) => !Ce.has(e)) || t.type !== "rename-variable" || typeof t.variableId != "string" || typeof t.nextName != "string") return j(e, M("Rename variable command is invalid.", []));
|
|
380
502
|
if (!a(t.variableId)) return j(e, M("Variable id is invalid.", ["variableId"]));
|
|
381
503
|
if (!n(t.nextName)) return j(e, M("Next variable name is invalid.", ["nextName"]));
|
|
382
504
|
let r = e.variables.find((e) => e.id === t.variableId);
|
|
@@ -394,11 +516,11 @@ function ve(e, t) {
|
|
|
394
516
|
}
|
|
395
517
|
//#endregion
|
|
396
518
|
//#region ../core/dist/commands/apply.js
|
|
397
|
-
var
|
|
398
|
-
function
|
|
399
|
-
return T(e),
|
|
519
|
+
var Te = new Set(r);
|
|
520
|
+
function Ee(e, t) {
|
|
521
|
+
return T(e), R(e, t);
|
|
400
522
|
}
|
|
401
|
-
function
|
|
523
|
+
function De(e, t) {
|
|
402
524
|
if (T(e), !D(t) || !Array.isArray(t.commands)) return {
|
|
403
525
|
ok: !1,
|
|
404
526
|
document: e,
|
|
@@ -413,7 +535,7 @@ function xe(e, t) {
|
|
|
413
535
|
};
|
|
414
536
|
let n = e;
|
|
415
537
|
for (let r = 0; r < t.commands.length; r++) {
|
|
416
|
-
let i =
|
|
538
|
+
let i = R(n, t.commands[r]);
|
|
417
539
|
if (!i.ok) return {
|
|
418
540
|
ok: !1,
|
|
419
541
|
document: e,
|
|
@@ -425,30 +547,36 @@ function xe(e, t) {
|
|
|
425
547
|
return {
|
|
426
548
|
ok: !0,
|
|
427
549
|
document: n,
|
|
428
|
-
changedComponentIds:
|
|
550
|
+
changedComponentIds: Ne(e, n),
|
|
429
551
|
diagnostics: []
|
|
430
552
|
};
|
|
431
553
|
}
|
|
432
|
-
function
|
|
554
|
+
function R(e, t) {
|
|
433
555
|
if (!D(t) || typeof t.type != "string") return j(e, M("Command must be an object with a known type.", []));
|
|
434
556
|
switch (t.type) {
|
|
435
|
-
case "update-canvas": return
|
|
436
|
-
case "add-component": return
|
|
437
|
-
case "update-components": return
|
|
438
|
-
case "remove-components": return
|
|
439
|
-
case "reparent-components": return
|
|
440
|
-
case "replace-blueprint": return
|
|
441
|
-
case "replace-data-sources": return
|
|
442
|
-
case "replace-variables": return
|
|
443
|
-
case "replace-sub-canvases": return
|
|
444
|
-
case "move-components": return
|
|
445
|
-
case "rename-variable": return
|
|
446
|
-
case "update-theme": return
|
|
557
|
+
case "update-canvas": return Oe(e, t.patch);
|
|
558
|
+
case "add-component": return he(e, t.component);
|
|
559
|
+
case "update-components": return ge(e, t.componentIds, t.patch);
|
|
560
|
+
case "remove-components": return _e(e, t.componentIds);
|
|
561
|
+
case "reparent-components": return ve(e, t.componentIds, t.parentId);
|
|
562
|
+
case "replace-blueprint": return Me(e, t.blueprint);
|
|
563
|
+
case "replace-data-sources": return be(e, t.dataSources);
|
|
564
|
+
case "replace-variables": return Ae(e, t.variables);
|
|
565
|
+
case "replace-sub-canvases": return je(e, t.subCanvases, t.startCanvasId);
|
|
566
|
+
case "move-components": return ye(e, t.componentIds, t.canvasId);
|
|
567
|
+
case "rename-variable": return we(e, t);
|
|
568
|
+
case "update-theme": return ke(e, t.patch);
|
|
569
|
+
case "add-data-sources": return ce(e, t.dataSources);
|
|
570
|
+
case "update-data-source-params": return le(e, t.dataSourceId, t.params);
|
|
571
|
+
case "add-variables": return ue(e, t.variables);
|
|
572
|
+
case "remove-variables": return de(e, t.variableIds);
|
|
573
|
+
case "add-blueprint-elements": return fe(e, t.nodes, t.edges);
|
|
574
|
+
case "remove-blueprint-elements": return pe(e, t.nodeIds, t.edgeIds);
|
|
447
575
|
default: return j(e, M("Command type is not supported.", ["type"]));
|
|
448
576
|
}
|
|
449
577
|
}
|
|
450
|
-
function
|
|
451
|
-
if (!oe(t,
|
|
578
|
+
function Oe(e, t) {
|
|
579
|
+
if (!oe(t, Te)) return j(e, M("Canvas patch contains an unknown or invalid field.", ["patch"]));
|
|
452
580
|
if (Object.keys(t).length === 0) return A(e, []);
|
|
453
581
|
let n = { ...e.canvas };
|
|
454
582
|
for (let [e, r] of Object.entries(t)) r === null ? delete n[e] : n[e] = r;
|
|
@@ -457,7 +585,7 @@ function Se(e, t) {
|
|
|
457
585
|
canvas: n
|
|
458
586
|
}, []);
|
|
459
587
|
}
|
|
460
|
-
function
|
|
588
|
+
function ke(e, t) {
|
|
461
589
|
if (!D(t)) return j(e, M("Theme patch must be an object of slot colors.", ["patch"]));
|
|
462
590
|
for (let [n, r] of Object.entries(t)) if (!s(n) || typeof r != "string" || r.trim() === "" || r.length > 64) return j(e, M("Theme patch keys must be palette slots with color strings.", ["patch", n]));
|
|
463
591
|
let n = {
|
|
@@ -471,31 +599,31 @@ function Ce(e, t) {
|
|
|
471
599
|
theme: r
|
|
472
600
|
}, []);
|
|
473
601
|
}
|
|
474
|
-
function
|
|
602
|
+
function Ae(e, t) {
|
|
475
603
|
return Array.isArray(t) ? o(e.variables, t) ? A(e, []) : k(e, {
|
|
476
604
|
...e,
|
|
477
605
|
variables: t
|
|
478
606
|
}, []) : j(e, M("Variables must be an array.", ["variables"]));
|
|
479
607
|
}
|
|
480
|
-
function
|
|
608
|
+
function je(e, t, n) {
|
|
481
609
|
if (!Array.isArray(t)) return j(e, M("Sub canvases must be an array.", ["subCanvases"]));
|
|
482
610
|
if (n != null && typeof n != "string") return j(e, M("startCanvasId must be a string or null.", ["startCanvasId"]));
|
|
483
611
|
let r = { ...e };
|
|
484
612
|
return t.length === 0 ? delete r.subCanvases : r.subCanvases = t, n === null ? delete r.startCanvasId : typeof n == "string" ? r.startCanvasId = n : e.startCanvasId !== void 0 && !t.some((t) => D(t) && t.id === e.startCanvasId && t.display === "page") && delete r.startCanvasId, o(e.subCanvases ?? [], t) && r.startCanvasId === e.startCanvasId ? A(e, []) : k(e, r, []);
|
|
485
613
|
}
|
|
486
|
-
function
|
|
614
|
+
function Me(e, t) {
|
|
487
615
|
return !D(t) || !Array.isArray(t.nodes) || !Array.isArray(t.edges) ? j(e, M("Blueprint must be a canonical object.", ["blueprint"])) : o(e.blueprint, t) ? A(e, []) : k(e, {
|
|
488
616
|
...e,
|
|
489
617
|
blueprint: t
|
|
490
618
|
}, []);
|
|
491
619
|
}
|
|
492
|
-
function
|
|
493
|
-
let n = new Map(t.components.map((e) => [e.id, e])), r = new Map(e.components.map((e) => [e.id, e])), i = t.components.filter((e) => r.get(e.id) !== e && !o(r.get(e.id), e)).map(({ id: e }) => e), a = e.components.filter((e) => !n.has(e.id)).map(({ id: e }) => e), s = /* @__PURE__ */ new Set([...i, ...a]), c = g(t,
|
|
620
|
+
function Ne(e, t) {
|
|
621
|
+
let n = new Map(t.components.map((e) => [e.id, e])), r = new Map(e.components.map((e) => [e.id, e])), i = t.components.filter((e) => r.get(e.id) !== e && !o(r.get(e.id), e)).map(({ id: e }) => e), a = e.components.filter((e) => !n.has(e.id)).map(({ id: e }) => e), s = /* @__PURE__ */ new Set([...i, ...a]), c = g(t, L(e.dataSources ?? [], t.dataSources ?? [])).filter((e) => !s.has(e));
|
|
494
622
|
return c.length === 0 ? [...s] : [...s, ...c];
|
|
495
623
|
}
|
|
496
624
|
//#endregion
|
|
497
625
|
//#region ../core/dist/commands/parse-command.js
|
|
498
|
-
var
|
|
626
|
+
var Pe = /* @__PURE__ */ new Set([
|
|
499
627
|
"update-canvas",
|
|
500
628
|
"add-component",
|
|
501
629
|
"update-components",
|
|
@@ -507,8 +635,14 @@ var Oe = /* @__PURE__ */ new Set([
|
|
|
507
635
|
"replace-sub-canvases",
|
|
508
636
|
"move-components",
|
|
509
637
|
"rename-variable",
|
|
510
|
-
"update-theme"
|
|
511
|
-
|
|
638
|
+
"update-theme",
|
|
639
|
+
"add-data-sources",
|
|
640
|
+
"update-data-source-params",
|
|
641
|
+
"add-variables",
|
|
642
|
+
"remove-variables",
|
|
643
|
+
"add-blueprint-elements",
|
|
644
|
+
"remove-blueprint-elements"
|
|
645
|
+
]), Fe = {
|
|
512
646
|
"update-canvas": /* @__PURE__ */ new Set(["type", "patch"]),
|
|
513
647
|
"add-component": /* @__PURE__ */ new Set(["type", "component"]),
|
|
514
648
|
"update-components": /* @__PURE__ */ new Set([
|
|
@@ -540,26 +674,44 @@ var Oe = /* @__PURE__ */ new Set([
|
|
|
540
674
|
"variableId",
|
|
541
675
|
"nextName"
|
|
542
676
|
]),
|
|
543
|
-
"update-theme": /* @__PURE__ */ new Set(["type", "patch"])
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
677
|
+
"update-theme": /* @__PURE__ */ new Set(["type", "patch"]),
|
|
678
|
+
"add-data-sources": /* @__PURE__ */ new Set(["type", "dataSources"]),
|
|
679
|
+
"update-data-source-params": /* @__PURE__ */ new Set([
|
|
680
|
+
"type",
|
|
681
|
+
"dataSourceId",
|
|
682
|
+
"params"
|
|
683
|
+
]),
|
|
684
|
+
"add-variables": /* @__PURE__ */ new Set(["type", "variables"]),
|
|
685
|
+
"remove-variables": /* @__PURE__ */ new Set(["type", "variableIds"]),
|
|
686
|
+
"add-blueprint-elements": /* @__PURE__ */ new Set([
|
|
687
|
+
"type",
|
|
688
|
+
"nodes",
|
|
689
|
+
"edges"
|
|
690
|
+
]),
|
|
691
|
+
"remove-blueprint-elements": /* @__PURE__ */ new Set([
|
|
692
|
+
"type",
|
|
693
|
+
"nodeIds",
|
|
694
|
+
"edgeIds"
|
|
695
|
+
])
|
|
696
|
+
}, Ie = { "replace-sub-canvases": /* @__PURE__ */ new Set(["startCanvasId"]) }, Le = 262144;
|
|
697
|
+
function Re(t) {
|
|
698
|
+
let n = e(t, { maxBytes: Le });
|
|
547
699
|
if (!n.ok) return n;
|
|
548
700
|
if (!D(n.value) || typeof n.value.type != "string") return {
|
|
549
701
|
ok: !1,
|
|
550
702
|
diagnostics: M("Command must be an object with a known type.", [])
|
|
551
703
|
};
|
|
552
704
|
let r = n.value.type;
|
|
553
|
-
if (!
|
|
705
|
+
if (!Pe.has(r)) return {
|
|
554
706
|
ok: !1,
|
|
555
707
|
diagnostics: M("Command type is not supported.", ["type"])
|
|
556
708
|
};
|
|
557
|
-
let i =
|
|
709
|
+
let i = Fe[r];
|
|
558
710
|
for (let e of Object.keys(n.value)) if (!i.has(e)) return {
|
|
559
711
|
ok: !1,
|
|
560
712
|
diagnostics: M("Command contains an unknown field.", [e])
|
|
561
713
|
};
|
|
562
|
-
for (let e of i) if (
|
|
714
|
+
for (let e of i) if (Ie[r]?.has(e) !== !0 && !Object.hasOwn(n.value, e)) return {
|
|
563
715
|
ok: !1,
|
|
564
716
|
diagnostics: M("Command field is required.", [e])
|
|
565
717
|
};
|
|
@@ -570,9 +722,56 @@ function Me(t) {
|
|
|
570
722
|
};
|
|
571
723
|
}
|
|
572
724
|
//#endregion
|
|
725
|
+
//#region ../core/dist/data/sample-values.js
|
|
726
|
+
function ze(e) {
|
|
727
|
+
let t = [];
|
|
728
|
+
return e.components.forEach((e, n) => {
|
|
729
|
+
z(e.dataValue) && t.push({
|
|
730
|
+
path: [
|
|
731
|
+
"components",
|
|
732
|
+
n,
|
|
733
|
+
"dataValue"
|
|
734
|
+
],
|
|
735
|
+
owner: {
|
|
736
|
+
kind: "component",
|
|
737
|
+
id: e.id
|
|
738
|
+
}
|
|
739
|
+
});
|
|
740
|
+
}), (e.dataSources ?? []).forEach((e, n) => {
|
|
741
|
+
for (let [r, i] of Object.entries(e.params)) z(i) && t.push({
|
|
742
|
+
path: [
|
|
743
|
+
"dataSources",
|
|
744
|
+
n,
|
|
745
|
+
"params",
|
|
746
|
+
r
|
|
747
|
+
],
|
|
748
|
+
owner: {
|
|
749
|
+
kind: "data-source-param",
|
|
750
|
+
id: e.id,
|
|
751
|
+
param: r
|
|
752
|
+
}
|
|
753
|
+
});
|
|
754
|
+
}), e.variables.forEach((e, n) => {
|
|
755
|
+
z("value" in e ? e.value : void 0) && t.push({
|
|
756
|
+
path: [
|
|
757
|
+
"variables",
|
|
758
|
+
n,
|
|
759
|
+
"value"
|
|
760
|
+
],
|
|
761
|
+
owner: {
|
|
762
|
+
kind: "variable",
|
|
763
|
+
id: e.id
|
|
764
|
+
}
|
|
765
|
+
});
|
|
766
|
+
}), t;
|
|
767
|
+
}
|
|
768
|
+
function z(e) {
|
|
769
|
+
return typeof e == "object" && !!e && e.kind === "inline" && e.sample === !0;
|
|
770
|
+
}
|
|
771
|
+
//#endregion
|
|
573
772
|
//#region ../core/dist/diff/screen-diff.js
|
|
574
|
-
var
|
|
575
|
-
function
|
|
773
|
+
var Be = 80;
|
|
774
|
+
function Ve(e, t) {
|
|
576
775
|
let n = new Map(e.components.map((e) => [e.id, e])), r = new Map(t.components.map((e) => [e.id, e])), i = [];
|
|
577
776
|
for (let e of t.components) {
|
|
578
777
|
let t = n.get(e.id);
|
|
@@ -585,7 +784,7 @@ function Pe(e, t) {
|
|
|
585
784
|
});
|
|
586
785
|
continue;
|
|
587
786
|
}
|
|
588
|
-
let r =
|
|
787
|
+
let r = He(t, e);
|
|
589
788
|
r.length > 0 && i.push({
|
|
590
789
|
componentId: e.id,
|
|
591
790
|
componentName: e.name,
|
|
@@ -601,40 +800,40 @@ function Pe(e, t) {
|
|
|
601
800
|
});
|
|
602
801
|
return i;
|
|
603
802
|
}
|
|
604
|
-
function
|
|
803
|
+
function He(e, t) {
|
|
605
804
|
let n = [];
|
|
606
|
-
return
|
|
805
|
+
return V("type", e.type, t.type, n), V("name", e.name, t.name, n), V("parentId", e.parentId, t.parentId, n), V("position.x", e.position.x, t.position.x, n), V("position.y", e.position.y, t.position.y, n), V("size.width", e.size.width, t.size.width, n), V("size.height", e.size.height, t.size.height, n), V("rotation", e.rotation, t.rotation, n), V("zIndex", e.zIndex, t.zIndex, n), V("status", e.status, t.status, n), B("props", e.props, t.props, n), B("style", e.style, t.style, n), V("dataValue", e.dataValue ?? null, t.dataValue ?? null, n), V("dataSource", e.dataSource ?? null, t.dataSource ?? null, n), V("dataBinding", e.dataBinding ?? null, t.dataBinding ?? null, n), V("states", e.states ?? null, t.states ?? null, n), V("canvasId", e.canvasId, t.canvasId, n), V("belowSubCanvas", e.belowSubCanvas, t.belowSubCanvas, n), n;
|
|
607
806
|
}
|
|
608
|
-
function
|
|
807
|
+
function B(e, t, n, r) {
|
|
609
808
|
let i = [.../* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(n)])].sort();
|
|
610
|
-
for (let a of i)
|
|
809
|
+
for (let a of i) V(`${e}.${a}`, t[a], n[a], r);
|
|
611
810
|
}
|
|
612
|
-
function
|
|
613
|
-
let i =
|
|
614
|
-
i !==
|
|
811
|
+
function V(e, t, n, r) {
|
|
812
|
+
let i = H(t);
|
|
813
|
+
i !== H(n) && r.push({
|
|
615
814
|
path: e,
|
|
616
|
-
before:
|
|
617
|
-
after:
|
|
815
|
+
before: U(i),
|
|
816
|
+
after: U(H(n))
|
|
618
817
|
});
|
|
619
818
|
}
|
|
620
|
-
function
|
|
819
|
+
function H(e) {
|
|
621
820
|
return e === void 0 ? "null" : JSON.stringify(e) ?? "null";
|
|
622
821
|
}
|
|
623
|
-
function
|
|
624
|
-
return e.length >
|
|
822
|
+
function U(e) {
|
|
823
|
+
return e.length > Be ? `${e.slice(0, 79)}…` : e;
|
|
625
824
|
}
|
|
626
825
|
//#endregion
|
|
627
826
|
//#region ../core/dist/geometry/component-bounds.js
|
|
628
|
-
function
|
|
629
|
-
let t =
|
|
827
|
+
function W(e) {
|
|
828
|
+
let t = S(e);
|
|
630
829
|
if (t === null) throw RangeError("Component geometry must be finite with positive dimensions.");
|
|
631
830
|
return t;
|
|
632
831
|
}
|
|
633
|
-
function
|
|
832
|
+
function Ue(e) {
|
|
634
833
|
if (e.length === 0) return null;
|
|
635
|
-
let t =
|
|
834
|
+
let t = W(e[0]), n = t.left, r = t.top, i = t.right, a = t.bottom;
|
|
636
835
|
for (let t = 1; t < e.length; t++) {
|
|
637
|
-
let o =
|
|
836
|
+
let o = W(e[t]);
|
|
638
837
|
n = Math.min(n, o.left), r = Math.min(r, o.top), i = Math.max(i, o.right), a = Math.max(a, o.bottom);
|
|
639
838
|
}
|
|
640
839
|
return {
|
|
@@ -646,22 +845,22 @@ function Re(e) {
|
|
|
646
845
|
}
|
|
647
846
|
//#endregion
|
|
648
847
|
//#region ../core/dist/geometry/alignment.js
|
|
649
|
-
function
|
|
848
|
+
function We(e, t, n) {
|
|
650
849
|
if (t !== "x" && t !== "y") throw RangeError("Alignment axis must be x or y.");
|
|
651
850
|
if (n !== "start" && n !== "center" && n !== "end") throw RangeError("Alignment mode must be start, center, or end.");
|
|
652
|
-
let r =
|
|
851
|
+
let r = Ke(e);
|
|
653
852
|
if (r.length < 2) return [];
|
|
654
|
-
let i = r.filter(({ locked: e }) => e), a = i.length > 0 ? i : r, o = a.map(({ bounds: e }) =>
|
|
853
|
+
let i = r.filter(({ locked: e }) => e), a = i.length > 0 ? i : r, o = a.map(({ bounds: e }) => G(e, t)), s = a.map(({ bounds: e }) => K(e, t)), c = n === "start" ? Math.min(...o) : n === "end" ? Math.max(...s) : (Math.min(...o) + Math.max(...s)) / 2;
|
|
655
854
|
return r.filter(({ locked: e }) => !e).map(({ component: e, bounds: r }) => ({
|
|
656
855
|
componentId: e.id,
|
|
657
|
-
delta:
|
|
658
|
-
})).filter(({ delta: e }) => e.x !== 0 || e.y !== 0).sort(
|
|
856
|
+
delta: Ye(t, c - Je(r, t, n))
|
|
857
|
+
})).filter(({ delta: e }) => e.x !== 0 || e.y !== 0).sort(Xe);
|
|
659
858
|
}
|
|
660
|
-
function
|
|
859
|
+
function Ge(e, t) {
|
|
661
860
|
if (t !== "x" && t !== "y") throw RangeError("Distribution axis must be x or y.");
|
|
662
|
-
let n = [...
|
|
663
|
-
let r =
|
|
664
|
-
return r === 0 ?
|
|
861
|
+
let n = [...Ke(e)].sort((e, n) => {
|
|
862
|
+
let r = G(e.bounds, t) - G(n.bounds, t);
|
|
863
|
+
return r === 0 ? Ze(e.component.id, n.component.id) : r;
|
|
665
864
|
});
|
|
666
865
|
if (n.length < 2) return [];
|
|
667
866
|
let r = /* @__PURE__ */ new Set([0, n.length - 1]);
|
|
@@ -670,41 +869,41 @@ function Be(e, t) {
|
|
|
670
869
|
for (let e = 1; e < i.length; e++) {
|
|
671
870
|
let r = i[e - 1], o = i[e], s = n.slice(r + 1, o);
|
|
672
871
|
if (s.length === 0) continue;
|
|
673
|
-
let c = n[r], l = n[o], u = (
|
|
872
|
+
let c = n[r], l = n[o], u = (G(l.bounds, t) - K(c.bounds, t) - s.reduce((e, n) => e + qe(n.bounds, t), 0)) / (s.length + 1), d = K(c.bounds, t) + u;
|
|
674
873
|
for (let e of s) {
|
|
675
|
-
let n = d -
|
|
874
|
+
let n = d - G(e.bounds, t);
|
|
676
875
|
n !== 0 && a.push({
|
|
677
876
|
componentId: e.component.id,
|
|
678
|
-
delta:
|
|
679
|
-
}), d +=
|
|
877
|
+
delta: Ye(t, n)
|
|
878
|
+
}), d += qe(e.bounds, t) + u;
|
|
680
879
|
}
|
|
681
880
|
}
|
|
682
|
-
return a.sort(
|
|
881
|
+
return a.sort(Xe);
|
|
683
882
|
}
|
|
684
|
-
function
|
|
883
|
+
function Ke(e) {
|
|
685
884
|
let t = h({ components: e });
|
|
686
885
|
return e.filter((e) => !l(t, e.id)).map((e) => ({
|
|
687
886
|
component: e,
|
|
688
|
-
bounds:
|
|
887
|
+
bounds: W(e),
|
|
689
888
|
locked: d(t, e.id)
|
|
690
889
|
}));
|
|
691
890
|
}
|
|
692
|
-
function
|
|
891
|
+
function G(e, t) {
|
|
693
892
|
return t === "x" ? e.left : e.top;
|
|
694
893
|
}
|
|
695
|
-
function
|
|
894
|
+
function K(e, t) {
|
|
696
895
|
return t === "x" ? e.right : e.bottom;
|
|
697
896
|
}
|
|
698
|
-
function
|
|
699
|
-
return
|
|
897
|
+
function qe(e, t) {
|
|
898
|
+
return K(e, t) - G(e, t);
|
|
700
899
|
}
|
|
701
|
-
function
|
|
702
|
-
let r =
|
|
900
|
+
function Je(e, t, n) {
|
|
901
|
+
let r = G(e, t);
|
|
703
902
|
if (n === "start") return r;
|
|
704
|
-
let i =
|
|
903
|
+
let i = K(e, t);
|
|
705
904
|
return n === "end" ? i : r + (i - r) / 2;
|
|
706
905
|
}
|
|
707
|
-
function
|
|
906
|
+
function Ye(e, t) {
|
|
708
907
|
return e === "x" ? {
|
|
709
908
|
x: x(t),
|
|
710
909
|
y: 0
|
|
@@ -713,54 +912,54 @@ function U(e, t) {
|
|
|
713
912
|
y: x(t)
|
|
714
913
|
};
|
|
715
914
|
}
|
|
716
|
-
function
|
|
717
|
-
return
|
|
915
|
+
function Xe(e, t) {
|
|
916
|
+
return Ze(e.componentId, t.componentId);
|
|
718
917
|
}
|
|
719
|
-
function
|
|
918
|
+
function Ze(e, t) {
|
|
720
919
|
return e < t ? -1 : +(e > t);
|
|
721
920
|
}
|
|
722
921
|
//#endregion
|
|
723
922
|
//#region ../core/dist/geometry/validation.js
|
|
724
|
-
function
|
|
923
|
+
function q(e, t) {
|
|
725
924
|
if (typeof e != "object" || !e) throw RangeError(`${t} must be a finite point.`);
|
|
726
925
|
b(e.x, `${t}.x`), b(e.y, `${t}.y`);
|
|
727
926
|
}
|
|
728
|
-
function
|
|
927
|
+
function Qe(e) {
|
|
729
928
|
if (typeof e != "object" || !e) throw RangeError("Rectangle must be an object.");
|
|
730
929
|
if (b(e.x, "rect.x"), b(e.y, "rect.y"), b(e.width, "rect.width"), b(e.height, "rect.height"), e.width <= 0 || e.height <= 0) throw RangeError("Rectangle dimensions must be positive.");
|
|
731
930
|
}
|
|
732
|
-
function
|
|
931
|
+
function $e(e) {
|
|
733
932
|
if (typeof e != "object" || !e || e.offset === null) throw RangeError("Viewport must contain a zoom and finite offset.");
|
|
734
933
|
if (e.zoom < .05 || e.zoom > 64) throw RangeError("Viewport zoom must be from 0.05 through 64.");
|
|
735
|
-
b(e.zoom, "viewport.zoom"),
|
|
934
|
+
b(e.zoom, "viewport.zoom"), q(e.offset, "viewport.offset");
|
|
736
935
|
}
|
|
737
936
|
//#endregion
|
|
738
937
|
//#region ../core/dist/geometry/hit-testing.js
|
|
739
|
-
function
|
|
740
|
-
T(e),
|
|
938
|
+
function et(e, t, n = {}) {
|
|
939
|
+
T(e), q(t, "point");
|
|
741
940
|
let r = n.minimumThickness ?? 0;
|
|
742
941
|
if (!Number.isFinite(r) || r < 0) throw RangeError("Hit test minimumThickness must be a non-negative finite number.");
|
|
743
942
|
let i = h(e), a = i.byId;
|
|
744
943
|
return [...p(e)].reverse().filter((e) => {
|
|
745
944
|
let n = a.get(e)?.component;
|
|
746
|
-
return n !== void 0 && !l(i, e) &&
|
|
945
|
+
return n !== void 0 && !l(i, e) && nt(t, n, r);
|
|
747
946
|
});
|
|
748
947
|
}
|
|
749
|
-
function
|
|
750
|
-
if (T(e),
|
|
948
|
+
function tt(e, t, n) {
|
|
949
|
+
if (T(e), Qe(t), n !== "intersect" && n !== "contain") throw RangeError("Query mode must be intersect or contain.");
|
|
751
950
|
let r = h(e);
|
|
752
951
|
return e.components.filter((e) => {
|
|
753
952
|
if (l(r, e.id)) return !1;
|
|
754
|
-
let i =
|
|
755
|
-
return n === "contain" ? i.every((e) =>
|
|
953
|
+
let i = rt(e);
|
|
954
|
+
return n === "contain" ? i.every((e) => st(e, t)) : it(i, t);
|
|
756
955
|
}).map(({ id: e }) => e);
|
|
757
956
|
}
|
|
758
|
-
function
|
|
957
|
+
function nt(e, t, n) {
|
|
759
958
|
let r = t.size.width, i = t.size.height, a = Math.max(0, n - r) / 2, o = Math.max(0, n - i) / 2, s = t.position.x + r / 2, c = t.position.y + i / 2, l = -t.rotation * Math.PI / 180, u = Math.cos(l), d = Math.sin(l), f = (e.x - s) * u - (e.y - c) * d + r / 2, p = (e.x - s) * d + (e.y - c) * u + i / 2;
|
|
760
959
|
return f >= -a && f <= r + a && p >= -o && p <= i + o;
|
|
761
960
|
}
|
|
762
|
-
function
|
|
763
|
-
|
|
961
|
+
function rt(e) {
|
|
962
|
+
W(e);
|
|
764
963
|
let t = e.position.x + e.size.width / 2, n = e.position.y + e.size.height / 2, r = e.size.width / 2, i = e.size.height / 2, a = e.rotation * Math.PI / 180, o = Math.cos(a), s = Math.sin(a);
|
|
765
964
|
return [
|
|
766
965
|
{
|
|
@@ -779,13 +978,13 @@ function Je(e) {
|
|
|
779
978
|
x: -r,
|
|
780
979
|
y: i
|
|
781
980
|
}
|
|
782
|
-
].map(({ x: e, y: r }) =>
|
|
981
|
+
].map(({ x: e, y: r }) => ee({
|
|
783
982
|
x: t + e * o - r * s,
|
|
784
983
|
y: n + e * s + r * o
|
|
785
984
|
}));
|
|
786
985
|
}
|
|
787
|
-
function
|
|
788
|
-
if (e.some((e) =>
|
|
986
|
+
function it(e, t) {
|
|
987
|
+
if (e.some((e) => st(e, t))) return !0;
|
|
789
988
|
let n = [
|
|
790
989
|
{
|
|
791
990
|
x: t.x,
|
|
@@ -804,17 +1003,17 @@ function Ye(e, t) {
|
|
|
804
1003
|
y: t.y + t.height
|
|
805
1004
|
}
|
|
806
1005
|
];
|
|
807
|
-
if (n.some((t) =>
|
|
1006
|
+
if (n.some((t) => at(t, e))) return !0;
|
|
808
1007
|
for (let t = 0; t < e.length; t++) {
|
|
809
1008
|
let r = e[t], i = e[(t + 1) % e.length];
|
|
810
1009
|
for (let e = 0; e < n.length; e++) {
|
|
811
1010
|
let t = n[e], a = n[(e + 1) % n.length];
|
|
812
|
-
if (
|
|
1011
|
+
if (ot(r, i, t, a)) return !0;
|
|
813
1012
|
}
|
|
814
1013
|
}
|
|
815
1014
|
return !1;
|
|
816
1015
|
}
|
|
817
|
-
function
|
|
1016
|
+
function at(e, t) {
|
|
818
1017
|
let n = !1, r = !1;
|
|
819
1018
|
for (let i = 0; i < t.length; i++) {
|
|
820
1019
|
let a = t[i], o = t[(i + 1) % t.length], s = (o.x - a.x) * (e.y - a.y) - (o.y - a.y) * (e.x - a.x);
|
|
@@ -822,35 +1021,35 @@ function Xe(e, t) {
|
|
|
822
1021
|
}
|
|
823
1022
|
return !(n && r);
|
|
824
1023
|
}
|
|
825
|
-
function
|
|
1024
|
+
function ot(e, t, n, r) {
|
|
826
1025
|
let i = (e, t, n) => (t.x - e.x) * (n.y - e.y) - (t.y - e.y) * (n.x - e.x), a = i(e, t, n), o = i(e, t, r), s = i(n, r, e), c = i(n, r, t);
|
|
827
|
-
return a === 0 &&
|
|
1026
|
+
return a === 0 && J(n, e, t) || o === 0 && J(r, e, t) || s === 0 && J(e, n, r) || c === 0 && J(t, n, r) ? !0 : a > 0 != o > 0 && s > 0 != c > 0;
|
|
828
1027
|
}
|
|
829
|
-
function
|
|
1028
|
+
function J(e, t, n) {
|
|
830
1029
|
return e.x >= Math.min(t.x, n.x) && e.x <= Math.max(t.x, n.x) && e.y >= Math.min(t.y, n.y) && e.y <= Math.max(t.y, n.y);
|
|
831
1030
|
}
|
|
832
|
-
function
|
|
1031
|
+
function st(e, t) {
|
|
833
1032
|
return e.x >= t.x && e.x <= t.x + t.width && e.y >= t.y && e.y <= t.y + t.height;
|
|
834
1033
|
}
|
|
835
1034
|
//#endregion
|
|
836
1035
|
//#region ../core/dist/hierarchy/query.js
|
|
837
|
-
function
|
|
1036
|
+
function ct(e, t) {
|
|
838
1037
|
return l(h(e), t);
|
|
839
1038
|
}
|
|
840
|
-
function
|
|
1039
|
+
function lt(e, t) {
|
|
841
1040
|
return d(h(e), t);
|
|
842
1041
|
}
|
|
843
1042
|
//#endregion
|
|
844
1043
|
//#region ../core/dist/history/history.js
|
|
845
|
-
function
|
|
1044
|
+
function ut(e) {
|
|
846
1045
|
return T(e), {
|
|
847
1046
|
past: [],
|
|
848
1047
|
present: e,
|
|
849
1048
|
future: []
|
|
850
1049
|
};
|
|
851
1050
|
}
|
|
852
|
-
function
|
|
853
|
-
if (Y(e), T(t),
|
|
1051
|
+
function dt(e, t, n = 100, r) {
|
|
1052
|
+
if (Y(e), T(t), _t(n), t === e.present) return e;
|
|
854
1053
|
let i = [...e.past, {
|
|
855
1054
|
before: e.present,
|
|
856
1055
|
after: t,
|
|
@@ -862,25 +1061,25 @@ function tt(e, t, n = 100, r) {
|
|
|
862
1061
|
future: []
|
|
863
1062
|
};
|
|
864
1063
|
}
|
|
865
|
-
function
|
|
1064
|
+
function ft(e) {
|
|
866
1065
|
Y(e);
|
|
867
1066
|
let t = e.past.at(-1);
|
|
868
1067
|
return t === void 0 ? e : {
|
|
869
1068
|
past: e.past.slice(0, -1),
|
|
870
1069
|
present: t.before,
|
|
871
|
-
future: [
|
|
1070
|
+
future: [gt(t), ...e.future]
|
|
872
1071
|
};
|
|
873
1072
|
}
|
|
874
|
-
function
|
|
1073
|
+
function pt(e) {
|
|
875
1074
|
Y(e);
|
|
876
1075
|
let t = e.future[0];
|
|
877
1076
|
return t === void 0 ? e : {
|
|
878
|
-
past: [...e.past,
|
|
1077
|
+
past: [...e.past, gt(t)],
|
|
879
1078
|
present: t.after,
|
|
880
1079
|
future: e.future.slice(1)
|
|
881
1080
|
};
|
|
882
1081
|
}
|
|
883
|
-
function
|
|
1082
|
+
function mt(e, t) {
|
|
884
1083
|
if (Y(e), !Number.isInteger(t) || t < 0 || t > e.past.length) throw RangeError("History revert target must be an integer from 0 through past.length.");
|
|
885
1084
|
let n = t === 0 ? e.past[0]?.before : e.past[t - 1]?.after;
|
|
886
1085
|
return n === void 0 || n === e.present ? e : {
|
|
@@ -889,7 +1088,7 @@ function it(e, t) {
|
|
|
889
1088
|
future: [...e.past.slice(t), ...e.future]
|
|
890
1089
|
};
|
|
891
1090
|
}
|
|
892
|
-
function
|
|
1091
|
+
function ht(e) {
|
|
893
1092
|
Y(e);
|
|
894
1093
|
let t = e.past.length, n = [{
|
|
895
1094
|
index: 0,
|
|
@@ -910,7 +1109,7 @@ function at(e) {
|
|
|
910
1109
|
});
|
|
911
1110
|
}), n;
|
|
912
1111
|
}
|
|
913
|
-
function
|
|
1112
|
+
function gt(e) {
|
|
914
1113
|
return {
|
|
915
1114
|
before: e.before,
|
|
916
1115
|
after: e.after,
|
|
@@ -920,12 +1119,12 @@ function ot(e) {
|
|
|
920
1119
|
function Y(e) {
|
|
921
1120
|
if (typeof e.present != "object" || e.present === null || !Array.isArray(e.past) || !Array.isArray(e.future)) throw TypeError("Screen history state is corrupted.");
|
|
922
1121
|
}
|
|
923
|
-
function
|
|
1122
|
+
function _t(e) {
|
|
924
1123
|
if (!Number.isInteger(e) || e < 1 || e > 1e3) throw RangeError("History limit must be an integer from 1 through 1000.");
|
|
925
1124
|
}
|
|
926
1125
|
//#endregion
|
|
927
1126
|
//#region ../core/dist/state/interaction.js
|
|
928
|
-
function
|
|
1127
|
+
function vt(e, t, n) {
|
|
929
1128
|
T(n);
|
|
930
1129
|
let r = X(e.selectedComponentIds, n);
|
|
931
1130
|
if (typeof t != "object" || !t) return Z(e, r, e.focusedComponentId);
|
|
@@ -956,24 +1155,24 @@ function Z(e, t, n) {
|
|
|
956
1155
|
}
|
|
957
1156
|
//#endregion
|
|
958
1157
|
//#region ../core/dist/state/viewport.js
|
|
959
|
-
var
|
|
1158
|
+
var yt = {
|
|
960
1159
|
zoom: 1,
|
|
961
1160
|
offset: {
|
|
962
1161
|
x: 0,
|
|
963
1162
|
y: 0
|
|
964
1163
|
}
|
|
965
1164
|
};
|
|
966
|
-
function
|
|
967
|
-
if (!
|
|
1165
|
+
function bt(e, t) {
|
|
1166
|
+
if (!xt(e) || typeof t != "object" || !t) return e;
|
|
968
1167
|
switch (t.type) {
|
|
969
|
-
case "reset": return e.zoom === 1 && e.offset.x === 0 && e.offset.y === 0 ? e :
|
|
1168
|
+
case "reset": return e.zoom === 1 && e.offset.x === 0 && e.offset.y === 0 ? e : yt;
|
|
970
1169
|
case "pan-by": return $(t.delta) ? Q(e, e.zoom, {
|
|
971
1170
|
x: e.offset.x + t.delta.x,
|
|
972
1171
|
y: e.offset.y + t.delta.y
|
|
973
1172
|
}) : e;
|
|
974
1173
|
case "set-offset": return $(t.offset) ? Q(e, e.zoom, t.offset) : e;
|
|
975
1174
|
case "set-zoom":
|
|
976
|
-
if (!
|
|
1175
|
+
if (!St(t.zoom) || !$(t.anchor)) return e;
|
|
977
1176
|
let n = (t.anchor.x - e.offset.x) / e.zoom, r = (t.anchor.y - e.offset.y) / e.zoom;
|
|
978
1177
|
return Q(e, t.zoom, {
|
|
979
1178
|
x: t.anchor.x - n * t.zoom,
|
|
@@ -993,16 +1192,16 @@ function Q(e, t, n) {
|
|
|
993
1192
|
offset: r
|
|
994
1193
|
};
|
|
995
1194
|
}
|
|
996
|
-
function
|
|
997
|
-
return
|
|
1195
|
+
function xt(e) {
|
|
1196
|
+
return St(e.zoom) && $(e.offset);
|
|
998
1197
|
}
|
|
999
|
-
function
|
|
1198
|
+
function St(e) {
|
|
1000
1199
|
return typeof e == "number" && Number.isFinite(e) && e >= .05 && e <= 64;
|
|
1001
1200
|
}
|
|
1002
1201
|
function $(e) {
|
|
1003
1202
|
return typeof e == "object" && !!e && typeof e.x == "number" && typeof e.y == "number" && Number.isFinite(e.x) && Number.isFinite(e.y);
|
|
1004
1203
|
}
|
|
1005
1204
|
//#endregion
|
|
1006
|
-
export {
|
|
1205
|
+
export { De as C, ee as D, b as E, y as O, Ee as S, S as T, W as _, ht as a, ze as b, ft as c, et as d, tt as f, Ge as g, We as h, ut as i, g as k, ct as l, $e as m, vt as n, pt as o, q as p, dt as r, mt as s, bt as t, lt as u, Ue as v, w, Re as x, Ve as y };
|
|
1007
1206
|
|
|
1008
|
-
//# sourceMappingURL=viewport-
|
|
1207
|
+
//# sourceMappingURL=viewport-BNIRWjiT.js.map
|