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
package/dist/auto-register.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { o as e } from "./authoring-EcyK2YVN.js";
|
|
2
|
-
import { I as t, R as n, S as r, a as i, c as a, d as o, h as s, l as c, t as l, u, x as d } from "./designer-left-panel-groups-dom-
|
|
3
|
-
import { a as f, k as p, m, t as h } from "./host-resource-selection-
|
|
4
|
-
import { t as g } from "./dist-
|
|
5
|
-
import { a as _,
|
|
6
|
-
import { n as k, r as A, t as j } from "./designer-
|
|
7
|
-
import { i as M, l as N, u as P } from "./viewer-CrJupI8I-
|
|
8
|
-
import { t as F } from "./plugins-
|
|
9
|
-
import { n as I, t as L } from "./material-
|
|
10
|
-
import { a as R, i as z, n as B, r as V, t as H } from "./src-Bm7u11mN-
|
|
2
|
+
import { I as t, R as n, S as r, a as i, c as a, d as o, h as s, l as c, t as l, u, x as d } from "./designer-left-panel-groups-dom-DFdLWxxY-BarlWMLY.js";
|
|
3
|
+
import { a as f, k as p, m, t as h } from "./host-resource-selection-CWrPLVOc-DPDq3jau.js";
|
|
4
|
+
import { t as g } from "./dist-B2bW2Tru.js";
|
|
5
|
+
import { a as _, h as v, i as y, l as b, m as x, n as S, o as C, p as w, r as T, s as E, t as D, u as O } from "./dist-CHK9BTXX.js";
|
|
6
|
+
import { n as k, r as A, t as j } from "./designer-CFOvOmLn.js";
|
|
7
|
+
import { i as M, l as N, u as P } from "./viewer-CrJupI8I-BJiz1cvW.js";
|
|
8
|
+
import { t as F } from "./plugins-QDL0yIql.js";
|
|
9
|
+
import { n as I, t as L } from "./material-DeVkzSoT.js";
|
|
10
|
+
import { a as R, i as z, n as B, r as V, t as H } from "./src-Bm7u11mN-Bi1hDVkh.js";
|
|
11
11
|
//#region ../sdk/dist/auto-register.js
|
|
12
12
|
if (!V().ok) throw Error("Base Screen product element registration failed.");
|
|
13
13
|
//#endregion
|
|
14
|
-
export { a as BASE_SCREEN_BLUEPRINT_CANVAS_COMMAND_EVENT, n as BASE_SCREEN_BLUEPRINT_CANVAS_STATE_EVENT, r as BASE_SCREEN_BLUEPRINT_NODE_DRAG_MIME,
|
|
14
|
+
export { a as BASE_SCREEN_BLUEPRINT_CANVAS_COMMAND_EVENT, n as BASE_SCREEN_BLUEPRINT_CANVAS_STATE_EVENT, r as BASE_SCREEN_BLUEPRINT_NODE_DRAG_MIME, _ as BASE_SCREEN_CANVAS_PRESENTATION_CHANGE_EVENT, b as BASE_SCREEN_CHANGE_STATE_EVENT, C as BASE_SCREEN_DESIGNER_BACK_REQUEST_EVENT, c as BASE_SCREEN_DESIGNER_BLUEPRINT_CANVAS_SLOT, i as BASE_SCREEN_DESIGNER_LEFT_PANEL_GROUP_CHANGE_EVENT, s as BASE_SCREEN_DESIGNER_LEFT_PANEL_GROUP_ICONS, l as BASE_SCREEN_DESIGNER_LEFT_PANEL_SLOT_PREFIX, A as BASE_SCREEN_DESIGNER_TAG_NAME, d as BASE_SCREEN_DESIGNER_WORKBENCH_MODE_CHANGE_EVENT, f as BASE_SCREEN_HOST_RESOURCE_DRAG_MIME, p as BASE_SCREEN_HOST_RESOURCE_SELECTION_REQUEST_EVENT, x as BASE_SCREEN_MATERIAL_LIBRARY_ACTION_EVENT, E as BASE_SCREEN_METRIC_EVENT, I as BASE_SCREEN_OFFICIAL_GROUP_MATERIAL_TYPE, L as BASE_SCREEN_OFFICIAL_TOOL_MATERIAL_TYPES, S as BASE_SCREEN_PROJECT_STATE_CHANGE_EVENT, M as BASE_SCREEN_VIEWER_TAG_NAME, O as BaseScreenDesignerElement, g as BaseScreenViewerElement, e as SCREEN_AUTHORING_REQUEST_EVENT, B as adoptBaseScreenRuntime, o as baseScreenDesignerLeftPanelSlotName, F as createBaseScreenBlueprintCapabilityPlugin, y as createBaseScreenCorePluginCommandPort, w as createBaseScreenCorePluginDesignReadPort, R as createBaseScreenDesignerMountController, N as createBaseScreenMountHandle, z as createBaseScreenRuntime, H as createBaseScreenViewerMountController, j as defineBaseScreenDesigner, V as defineBaseScreenElements, P as defineBaseScreenViewer, k as mountBaseScreenDesignerSkeleton, t as parseBaseScreenBlueprintCanvasCommand, u as parseBaseScreenDesignerLeftPanelGroups, m as parseBaseScreenHostResourceAuthoringIntent, T as parseBaseScreenMaterialLibraryGrouping, D as parseBaseScreenMaterialLibraryItems, v as parseBaseScreenMaterialLibraryState, h as writeBaseScreenHostResourceDragData };
|
|
15
15
|
|
|
16
16
|
//# sourceMappingURL=auto-register.js.map
|
package/dist/contracts.js
CHANGED
|
@@ -2,14 +2,14 @@ import { i as e, m as t, p as n, r, t as i } from "./image-url-D6mUcjY1.js";
|
|
|
2
2
|
import { a, c as o, i as s, o as c, r as l, s as ee, t as te } from "./parse-B5b0hjql.js";
|
|
3
3
|
import { i as ne, n as re, r as u, t as d } from "./definition-DlTP-401.js";
|
|
4
4
|
import { a as f, c as p, d as m, f as h, i as g, l as _, n as v, o as y, r as b, s as x, t as S, u as C } from "./dataset-port-D993nOlT.js";
|
|
5
|
-
import { $ as w, A as T, At as E, B as D, C as O, Ct as k, D as A, Dt as j, E as M, Et as N, F as P, G as F, H as I, I as L, J as R, K as z, L as B, M as V, Mt as H, N as U, Nt as W, O as G, Ot as K, P as q, Q as J, R as Y, S as X, St as ie, T as ae, Tt as oe, U as se, V as ce, W as le, X as ue, Y as de, Z as fe, _ as pe, _t as me, at as he, b as ge, bt as _e, ct as ve, d as ye, dt as be, et as xe, f as Se, ft as Ce, g as we, gt as Te, h as Ee, ht as De, it as Oe, j as ke, jt as Ae, k as je, kt as Me, l as Ne, lt as Pe, m as Fe, mt as Ie, n as Le, nt as Re, ot as ze, p as Be, pt as Ve, q as He, r as Ue, rt as We, st as Ge, t as Ke, tt as qe, u as Je, ut as Ye, v as Xe, vt as Ze, w as Qe, wt as $e, x as et, xt as tt, y as nt, yt as rt, z as it } from "./parse-
|
|
5
|
+
import { $ as w, A as T, At as E, B as D, C as O, Ct as k, D as A, Dt as j, E as M, Et as N, F as P, G as F, H as I, I as L, J as R, K as z, L as B, M as V, Mt as H, N as U, Nt as W, O as G, Ot as K, P as q, Q as J, R as Y, S as X, St as ie, T as ae, Tt as oe, U as se, V as ce, W as le, X as ue, Y as de, Z as fe, _ as pe, _t as me, at as he, b as ge, bt as _e, ct as ve, d as ye, dt as be, et as xe, f as Se, ft as Ce, g as we, gt as Te, h as Ee, ht as De, it as Oe, j as ke, jt as Ae, k as je, kt as Me, l as Ne, lt as Pe, m as Fe, mt as Ie, n as Le, nt as Re, ot as ze, p as Be, pt as Ve, q as He, r as Ue, rt as We, st as Ge, t as Ke, tt as qe, u as Je, ut as Ye, v as Xe, vt as Ze, w as Qe, wt as $e, x as et, xt as tt, y as nt, yt as rt, z as it } from "./parse-Ji7kE9ZT.js";
|
|
6
6
|
import { t as at } from "./equality-DjZ9cv4u.js";
|
|
7
|
-
import { i as ot, n as st, r as ct, t as lt } from "./parse-parts-
|
|
7
|
+
import { i as ot, n as st, r as ct, t as lt } from "./parse-parts-qzl4suzk.js";
|
|
8
8
|
import { a as ut, i as dt, n as ft, r as pt, t as mt } from "./read-data-value-WmMKWshv.js";
|
|
9
|
-
import { a as ht, i as gt, n as _t, o as vt, r as yt, s as bt, t as xt } from "./parse-
|
|
9
|
+
import { a as ht, i as gt, n as _t, o as vt, r as yt, s as bt, t as xt } from "./parse-aZat9tAS.js";
|
|
10
10
|
import { a as St, c as Ct, d as wt, i as Tt, l as Et, n as Dt, o as Ot, r as kt, s as At, t as jt, u as Mt } from "./theme-CcBXf4Ay.js";
|
|
11
|
-
import { t as Nt } from "./migrate-document-
|
|
12
|
-
import { i as Pt, n as Ft, r as It, t as Lt } from "./level-scale-
|
|
11
|
+
import { t as Nt } from "./migrate-document-BM888PtC.js";
|
|
12
|
+
import { i as Pt, n as Ft, r as It, t as Lt } from "./level-scale-CwHqFEVd.js";
|
|
13
13
|
import { a as Rt, c as zt, i as Bt, l as Vt, n as Ht, o as Z, r as Ut, s as Wt, t as Gt, u as Kt } from "./authoring-EcyK2YVN.js";
|
|
14
14
|
import { z as qt } from "zod";
|
|
15
15
|
//#region ../contracts/dist/document/json-schema.js
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
//#region ../core/dist/validation/contrast.js
|
|
2
|
+
var e = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i, t = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i, n = /^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,/]+([0-9.]+)(%?))?\s*\)$/i;
|
|
3
|
+
function r(r) {
|
|
4
|
+
let i = r.trim(), a = e.exec(i);
|
|
5
|
+
if (a !== null) return {
|
|
6
|
+
r: Number.parseInt(`${a[1]}${a[1]}`, 16),
|
|
7
|
+
g: Number.parseInt(`${a[2]}${a[2]}`, 16),
|
|
8
|
+
b: Number.parseInt(`${a[3]}${a[3]}`, 16)
|
|
9
|
+
};
|
|
10
|
+
let o = t.exec(i);
|
|
11
|
+
if (o !== null) return {
|
|
12
|
+
r: Number.parseInt(o[1], 16),
|
|
13
|
+
g: Number.parseInt(o[2], 16),
|
|
14
|
+
b: Number.parseInt(o[3], 16)
|
|
15
|
+
};
|
|
16
|
+
let s = n.exec(i);
|
|
17
|
+
if (s !== null) {
|
|
18
|
+
let e = s[4] === void 0 ? 1 : s[5] === "%" ? Number(s[4]) / 100 : Number(s[4]);
|
|
19
|
+
return !Number.isFinite(e) || e < 1 ? void 0 : {
|
|
20
|
+
r: m(Number(s[1])),
|
|
21
|
+
g: m(Number(s[2])),
|
|
22
|
+
b: m(Number(s[3]))
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function i(e) {
|
|
27
|
+
let t = e.trim();
|
|
28
|
+
if (t === "transparent") return {
|
|
29
|
+
color: {
|
|
30
|
+
r: 0,
|
|
31
|
+
g: 0,
|
|
32
|
+
b: 0
|
|
33
|
+
},
|
|
34
|
+
alpha: 0
|
|
35
|
+
};
|
|
36
|
+
let i = n.exec(t);
|
|
37
|
+
if (i !== null) {
|
|
38
|
+
let e = i[4] === void 0 ? 1 : i[5] === "%" ? Number(i[4]) / 100 : Number(i[4]);
|
|
39
|
+
return Number.isFinite(e) ? {
|
|
40
|
+
color: {
|
|
41
|
+
r: m(Number(i[1])),
|
|
42
|
+
g: m(Number(i[2])),
|
|
43
|
+
b: m(Number(i[3]))
|
|
44
|
+
},
|
|
45
|
+
alpha: Math.min(1, Math.max(0, e))
|
|
46
|
+
} : void 0;
|
|
47
|
+
}
|
|
48
|
+
let a = r(t);
|
|
49
|
+
return a === void 0 ? void 0 : {
|
|
50
|
+
color: a,
|
|
51
|
+
alpha: 1
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function a(e, t, n) {
|
|
55
|
+
let r = (e, n) => e * t + n * (1 - t);
|
|
56
|
+
return {
|
|
57
|
+
r: r(e.r, n.r),
|
|
58
|
+
g: r(e.g, n.g),
|
|
59
|
+
b: r(e.b, n.b)
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function o(e) {
|
|
63
|
+
let t = (e) => Math.round(m(e)).toString(16).padStart(2, "0");
|
|
64
|
+
return `#${t(e.r)}${t(e.g)}${t(e.b)}`;
|
|
65
|
+
}
|
|
66
|
+
function s(e) {
|
|
67
|
+
return .2126 * p(e.r) + .7152 * p(e.g) + .0722 * p(e.b);
|
|
68
|
+
}
|
|
69
|
+
function c(e, t) {
|
|
70
|
+
let n = s(e), r = s(t), i = Math.max(n, r), a = Math.min(n, r);
|
|
71
|
+
return (i + .05) / (a + .05);
|
|
72
|
+
}
|
|
73
|
+
function l(e, t) {
|
|
74
|
+
return e >= 24 || e >= 18.66 && t >= 700 ? 3 : 4.5;
|
|
75
|
+
}
|
|
76
|
+
function u(e, t, n) {
|
|
77
|
+
if (c(e, t) >= n) return e;
|
|
78
|
+
let r = c({
|
|
79
|
+
r: 0,
|
|
80
|
+
g: 0,
|
|
81
|
+
b: 0
|
|
82
|
+
}, t), i = c({
|
|
83
|
+
r: 255,
|
|
84
|
+
g: 255,
|
|
85
|
+
b: 255
|
|
86
|
+
}, t), a = r >= i ? {
|
|
87
|
+
r: 0,
|
|
88
|
+
g: 0,
|
|
89
|
+
b: 0
|
|
90
|
+
} : {
|
|
91
|
+
r: 255,
|
|
92
|
+
g: 255,
|
|
93
|
+
b: 255
|
|
94
|
+
};
|
|
95
|
+
if (Math.max(r, i) < n) return;
|
|
96
|
+
let o = 0, s = 1;
|
|
97
|
+
for (let r = 0; r < 24; r++) {
|
|
98
|
+
let r = (o + s) / 2;
|
|
99
|
+
c(d(e, a, r), t) >= n ? s = r : o = r;
|
|
100
|
+
}
|
|
101
|
+
for (let r = s; r <= 1; r += .002) {
|
|
102
|
+
let i = f(d(e, a, r));
|
|
103
|
+
if (c(i, t) >= n) return i;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function d(e, t, n) {
|
|
107
|
+
let r = (e, t) => e + (t - e) * n;
|
|
108
|
+
return {
|
|
109
|
+
r: r(e.r, t.r),
|
|
110
|
+
g: r(e.g, t.g),
|
|
111
|
+
b: r(e.b, t.b)
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
function f(e) {
|
|
115
|
+
return {
|
|
116
|
+
r: Math.round(e.r),
|
|
117
|
+
g: Math.round(e.g),
|
|
118
|
+
b: Math.round(e.b)
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function p(e) {
|
|
122
|
+
let t = m(e) / 255;
|
|
123
|
+
return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
124
|
+
}
|
|
125
|
+
function m(e) {
|
|
126
|
+
return Number.isFinite(e) ? Math.min(255, Math.max(0, e)) : 0;
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
export { l as a, s as c, o as i, u as l, a as n, r as o, c as r, i as s, d as t };
|
|
130
|
+
|
|
131
|
+
//# sourceMappingURL=contrast-DRPezUIl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contrast-DRPezUIl.js","names":[],"sources":["../../core/dist/validation/contrast.js"],"sourcesContent":["/**\n * WCAG 2.x 对比度计算:纯函数,无 DOM 依赖。\n *\n * 供设计器守卫与任何需要「从真实渲染颜色判定可读性」的调用方复用。\n * 只接受不透明颜色——带 alpha 的颜色需要知道背景才能合成,由测量层负责,避免这里猜。\n */\nconst SHORT_HEX_PATTERN = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i;\nconst HEX_PATTERN = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i;\nconst RGB_PATTERN = /^rgba?\\(\\s*(\\d{1,3})[\\s,]+(\\d{1,3})[\\s,]+(\\d{1,3})(?:[\\s,/]+([0-9.]+)(%?))?\\s*\\)$/i;\n/** 解析不透明 CSS 颜色(`#rgb` / `#rrggbb` / `rgb()` / `rgba(..., 1)`),失败返回 undefined。 */\nexport function parseCssColor(value) {\n const text = value.trim();\n const short = SHORT_HEX_PATTERN.exec(text);\n if (short !== null) {\n return {\n r: Number.parseInt(`${short[1]}${short[1]}`, 16),\n g: Number.parseInt(`${short[2]}${short[2]}`, 16),\n b: Number.parseInt(`${short[3]}${short[3]}`, 16),\n };\n }\n const hex = HEX_PATTERN.exec(text);\n if (hex !== null) {\n return {\n r: Number.parseInt(hex[1], 16),\n g: Number.parseInt(hex[2], 16),\n b: Number.parseInt(hex[3], 16),\n };\n }\n const rgb = RGB_PATTERN.exec(text);\n if (rgb !== null) {\n const alpha = rgb[4] === undefined ? 1 : rgb[5] === '%' ? Number(rgb[4]) / 100 : Number(rgb[4]);\n if (!Number.isFinite(alpha) || alpha < 1)\n return undefined;\n return {\n r: clampChannel(Number(rgb[1])),\n g: clampChannel(Number(rgb[2])),\n b: clampChannel(Number(rgb[3])),\n };\n }\n return undefined;\n}\n/** 解析 CSS 颜色并保留 alpha(0–1),供测量层逐级合成背景。 */\nexport function parseCssColorAlpha(value) {\n const text = value.trim();\n if (text === 'transparent')\n return { color: { r: 0, g: 0, b: 0 }, alpha: 0 };\n const rgb = RGB_PATTERN.exec(text);\n if (rgb !== null) {\n const alpha = rgb[4] === undefined ? 1 : rgb[5] === '%' ? Number(rgb[4]) / 100 : Number(rgb[4]);\n if (!Number.isFinite(alpha))\n return undefined;\n return {\n color: {\n r: clampChannel(Number(rgb[1])),\n g: clampChannel(Number(rgb[2])),\n b: clampChannel(Number(rgb[3])),\n },\n alpha: Math.min(1, Math.max(0, alpha)),\n };\n }\n const opaque = parseCssColor(text);\n return opaque === undefined ? undefined : { color: opaque, alpha: 1 };\n}\n/** 把一层带 alpha 的颜色合成到不透明底色上。 */\nexport function compositeOver(top, alpha, bottom) {\n const mix = (a, b) => a * alpha + b * (1 - alpha);\n return { r: mix(top.r, bottom.r), g: mix(top.g, bottom.g), b: mix(top.b, bottom.b) };\n}\nexport function formatCssColor(color) {\n const hex = (channel) => Math.round(clampChannel(channel)).toString(16).padStart(2, '0');\n return `#${hex(color.r)}${hex(color.g)}${hex(color.b)}`;\n}\n/** WCAG 相对亮度,输入通道范围 0–255。 */\nexport function relativeLuminance(color) {\n return 0.2126 * linearize(color.r) + 0.7152 * linearize(color.g) + 0.0722 * linearize(color.b);\n}\n/** 对比度比值,范围 1–21。 */\nexport function contrastRatio(a, b) {\n const first = relativeLuminance(a);\n const second = relativeLuminance(b);\n const lighter = Math.max(first, second);\n const darker = Math.min(first, second);\n return (lighter + 0.05) / (darker + 0.05);\n}\n/**\n * 正文字号门槛:WCAG 把 ≥24px,或 ≥18.66px 且 ≥700 字重视为大字号(3:1),\n * 其余为普通文本(4.5:1)。\n */\nexport function minimumContrastRatio(fontSizePx, fontWeight) {\n const large = fontSizePx >= 24 || (fontSizePx >= 18.66 && fontWeight >= 700);\n return large ? 3 : 4.5;\n}\n/**\n * 求满足门槛的最小改动颜色:保持色相趋势,把前景色向黑或白混合。\n * 返回 undefined 表示该背景上任何不透明颜色都达不到门槛。\n */\nexport function suggestReadableColor(foreground, background, minRatio) {\n if (contrastRatio(foreground, background) >= minRatio)\n return foreground;\n const towardsBlack = contrastRatio({ r: 0, g: 0, b: 0 }, background);\n const towardsWhite = contrastRatio({ r: 255, g: 255, b: 255 }, background);\n const target = towardsBlack >= towardsWhite ? { r: 0, g: 0, b: 0 } : { r: 255, g: 255, b: 255 };\n if (Math.max(towardsBlack, towardsWhite) < minRatio)\n return undefined;\n let low = 0;\n let high = 1;\n for (let step = 0; step < 24; step++) {\n const middle = (low + high) / 2;\n if (contrastRatio(blend(foreground, target, middle), background) >= minRatio)\n high = middle;\n else\n low = middle;\n }\n // 通道取整会损失一点对比度,所以对取整后的颜色复核并按需继续推进,\n // 保证返回的颜色本身满足门槛,而不是只在浮点中间值上满足。\n for (let amount = high; amount <= 1; amount += 0.002) {\n const candidate = roundColor(blend(foreground, target, amount));\n if (contrastRatio(candidate, background) >= minRatio)\n return candidate;\n }\n return undefined;\n}\n/** 按 `amount`(0–1)把 `from` 混向 `to`,模拟颜色插值。 */\nexport function blend(from, to, amount) {\n const mix = (a, b) => a + (b - a) * amount;\n return { r: mix(from.r, to.r), g: mix(from.g, to.g), b: mix(from.b, to.b) };\n}\nfunction roundColor(color) {\n return { r: Math.round(color.r), g: Math.round(color.g), b: Math.round(color.b) };\n}\nfunction linearize(channel) {\n const ratio = clampChannel(channel) / 255;\n return ratio <= 0.03928 ? ratio / 12.92 : ((ratio + 0.055) / 1.055) ** 2.4;\n}\nfunction clampChannel(channel) {\n if (!Number.isFinite(channel))\n return 0;\n return Math.min(255, Math.max(0, channel));\n}\n//# sourceMappingURL=contrast.js.map"],"mappings":"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"}
|
package/dist/core.js
CHANGED
|
@@ -1,182 +1,202 @@
|
|
|
1
|
-
import { Mt as e } from "./parse-
|
|
2
|
-
import { n as t, r as n, t as r } from "./runtime-dispatch-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { a as
|
|
1
|
+
import { Mt as e } from "./parse-Ji7kE9ZT.js";
|
|
2
|
+
import { n as t, r as n, t as r } from "./runtime-dispatch-C0gyIrTv.js";
|
|
3
|
+
import { n as i, t as a } from "./runtime-simulate-aSYO9yDX.js";
|
|
4
|
+
import { C as o, D as s, E as c, O as l, S as u, T as ee, _ as d, a as f, b as p, c as m, d as h, f as te, g, h as _, i as v, k as ne, l as re, m as y, n as ie, o as ae, p as b, r as oe, s as se, t as ce, u as le, v as ue, w as de, x as fe, y as pe } from "./viewport-BNIRWjiT.js";
|
|
5
|
+
import { a as me, i as x, n as S, o as C, r as w, s as T, t as E } from "./hierarchy-BQZrZWbC.js";
|
|
6
|
+
import { a as D, i as O, n as k, o as A, r as j, t as M } from "./dataset-profile-Dk6xdtsM.js";
|
|
7
|
+
import { a as N, c as P, d as F, f as I, i as L, l as R, n as z, o as he, r as ge, s as _e, t as ve, u as ye } from "./value-ref-XkLuckGV.js";
|
|
8
|
+
import { t as be } from "./state-preset-DtpygJOH.js";
|
|
9
|
+
import { a as B, c as xe, i as Se, l as Ce, n as we, o as V, r as H, s as Te, t as Ee } from "./contrast-DRPezUIl.js";
|
|
10
|
+
import { n as U, t as De } from "./legibility-CS28ivEz.js";
|
|
6
11
|
//#region ../core/dist/geometry/coordinates.js
|
|
7
|
-
function
|
|
8
|
-
return
|
|
12
|
+
function Oe(e, t) {
|
|
13
|
+
return b(e, "point"), y(t), W({
|
|
9
14
|
x: e.x * t.zoom + t.offset.x,
|
|
10
15
|
y: e.y * t.zoom + t.offset.y
|
|
11
16
|
});
|
|
12
17
|
}
|
|
13
|
-
function
|
|
14
|
-
return
|
|
18
|
+
function ke(e, t) {
|
|
19
|
+
return b(e, "point"), y(t), W({
|
|
15
20
|
x: (e.x - t.offset.x) / t.zoom,
|
|
16
21
|
y: (e.y - t.offset.y) / t.zoom
|
|
17
22
|
});
|
|
18
23
|
}
|
|
19
|
-
function
|
|
20
|
-
return
|
|
24
|
+
function W(e) {
|
|
25
|
+
return c(e.x, "calculated point x"), c(e.y, "calculated point y"), s(e);
|
|
21
26
|
}
|
|
22
27
|
//#endregion
|
|
23
28
|
//#region ../core/dist/geometry/snapping.js
|
|
24
|
-
function
|
|
25
|
-
if (
|
|
29
|
+
function Ae(e, t) {
|
|
30
|
+
if (c(t, "threshold"), t < 0) throw RangeError("Snap threshold must not be negative.");
|
|
26
31
|
let n = null;
|
|
27
|
-
for (let r of e)
|
|
32
|
+
for (let r of e) Ne(r), !(Math.abs(r.targetValue - r.movingValue) > t) && (n === null || je(r, n) < 0) && (n = r);
|
|
28
33
|
return n === null ? null : { ...n };
|
|
29
34
|
}
|
|
30
|
-
function
|
|
35
|
+
function je(e, t) {
|
|
31
36
|
let n = Math.abs(e.targetValue - e.movingValue) - Math.abs(t.targetValue - t.movingValue);
|
|
32
37
|
if (n !== 0) return n;
|
|
33
38
|
if (e.axis !== t.axis) return e.axis === "x" ? -1 : 1;
|
|
34
39
|
let r = G(e.sourceComponentId, t.sourceComponentId);
|
|
35
40
|
if (r !== 0) return r;
|
|
36
|
-
let i =
|
|
41
|
+
let i = Me(e.targetComponentId, t.targetComponentId);
|
|
37
42
|
return i === 0 ? e.movingValue === t.movingValue ? e.targetValue - t.targetValue : e.movingValue - t.movingValue : i;
|
|
38
43
|
}
|
|
39
|
-
function
|
|
44
|
+
function Me(e, t) {
|
|
40
45
|
return e === t ? 0 : e === null ? -1 : t === null ? 1 : G(e, t);
|
|
41
46
|
}
|
|
42
47
|
function G(e, t) {
|
|
43
48
|
return e < t ? -1 : +(e > t);
|
|
44
49
|
}
|
|
45
|
-
function
|
|
50
|
+
function Ne(e) {
|
|
46
51
|
if (typeof e != "object" || !e) throw RangeError("Snap candidate must be an object.");
|
|
47
52
|
if (e.axis !== "x" && e.axis !== "y") throw RangeError("Snap candidate axis must be x or y.");
|
|
48
53
|
if (typeof e.sourceComponentId != "string" || typeof e.targetComponentId != "string" && e.targetComponentId !== null) throw RangeError("Snap candidate component ids must be strings or null.");
|
|
49
|
-
|
|
54
|
+
c(e.movingValue, "candidate.movingValue"), c(e.targetValue, "candidate.targetValue");
|
|
50
55
|
}
|
|
51
56
|
//#endregion
|
|
52
|
-
//#region ../core/dist/validation/
|
|
53
|
-
var
|
|
54
|
-
function
|
|
55
|
-
let t = e.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
r: Number.parseInt(r[1], 16),
|
|
64
|
-
g: Number.parseInt(r[2], 16),
|
|
65
|
-
b: Number.parseInt(r[3], 16)
|
|
66
|
-
};
|
|
67
|
-
let i = K.exec(t);
|
|
68
|
-
if (i !== null) {
|
|
69
|
-
let e = i[4] === void 0 ? 1 : i[5] === "%" ? Number(i[4]) / 100 : Number(i[4]);
|
|
70
|
-
return !Number.isFinite(e) || e < 1 ? void 0 : {
|
|
71
|
-
r: $(Number(i[1])),
|
|
72
|
-
g: $(Number(i[2])),
|
|
73
|
-
b: $(Number(i[3]))
|
|
74
|
-
};
|
|
57
|
+
//#region ../core/dist/validation/layout-audit.js
|
|
58
|
+
var Pe = .1;
|
|
59
|
+
function K(e, t = {}) {
|
|
60
|
+
let n = t.severity ?? "error", r = E(e), i = t.componentIds === void 0 ? void 0 : new Set(t.componentIds), a = (e) => i === void 0 || i.has(e), o = U(e.canvas.width, t.targetDisplay), s = C(e), c = new Map(s.map((e, t) => [e, t])), l = new Set(e.components.flatMap((e) => e.parentId === null ? [] : [e.parentId])), u = (e) => {
|
|
61
|
+
let t = e;
|
|
62
|
+
for (; t !== void 0 && t.parentId !== null;) t = r.byId.get(t.parentId)?.component;
|
|
63
|
+
return t?.canvasId ?? "";
|
|
64
|
+
}, d = Fe(e), f = /* @__PURE__ */ new Map();
|
|
65
|
+
for (let t of e.components) {
|
|
66
|
+
let e = ee(t);
|
|
67
|
+
e !== null && f.set(t.id, e);
|
|
75
68
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
69
|
+
let p = [], m = (e, ...t) => [
|
|
70
|
+
"components",
|
|
71
|
+
r.byId.get(e.id)?.index ?? -1,
|
|
72
|
+
...t
|
|
73
|
+
];
|
|
74
|
+
for (let t of e.components) {
|
|
75
|
+
if (!a(t.id) || t.status.hidden) continue;
|
|
76
|
+
let r = f.get(t.id), i = d.get(u(t)), s = Y(t.style.fontSize);
|
|
77
|
+
if (s !== void 0 && s < o - 1e-9 && p.push({
|
|
78
|
+
severity: n,
|
|
79
|
+
code: "LAYOUT_FONT_TOO_SMALL",
|
|
80
|
+
path: m(t, "style", "fontSize"),
|
|
81
|
+
message: `Font size ${s}px is below the legible minimum of ${$(o)}px.`
|
|
82
|
+
}), r !== void 0 && i !== void 0 && Re(r, i) && p.push({
|
|
83
|
+
severity: n,
|
|
84
|
+
code: "LAYOUT_OUT_OF_BOUNDS",
|
|
85
|
+
path: m(t, "position"),
|
|
86
|
+
message: `Component geometry leaves its ${i.width}x${i.height} canvas.`
|
|
87
|
+
}), s !== void 0 && r !== void 0) {
|
|
88
|
+
let a = J(t.style.color), o = a === void 0 ? void 0 : Ie(t, r, e, f, c, u, i);
|
|
89
|
+
if (a !== void 0 && o !== void 0) {
|
|
90
|
+
let e = B(s, Le(t.style.fontWeight)), r = H(a, o);
|
|
91
|
+
r < e && p.push({
|
|
92
|
+
severity: n,
|
|
93
|
+
code: "LAYOUT_CONTRAST_LOW",
|
|
94
|
+
path: m(t, "style", "color"),
|
|
95
|
+
message: `Text contrast ${$(r)}:1 is below the required ${e}:1.`
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
let h = /* @__PURE__ */ new Map();
|
|
101
|
+
for (let t of e.components) {
|
|
102
|
+
if (t.status.hidden || l.has(t.id) || !f.has(t.id)) continue;
|
|
103
|
+
let e = `${u(t)}\u0000${t.parentId ?? ""}`, n = h.get(e);
|
|
104
|
+
n === void 0 ? h.set(e, [t]) : n.push(t);
|
|
105
|
+
}
|
|
106
|
+
for (let e of h.values()) for (let t = 0; t < e.length; t++) for (let r = t + 1; r < e.length; r++) {
|
|
107
|
+
let i = e[t], o = e[r];
|
|
108
|
+
if (!a(i.id) && !a(o.id)) continue;
|
|
109
|
+
let s = f.get(i.id), c = f.get(o.id);
|
|
110
|
+
if (X(s, c) || X(c, s)) continue;
|
|
111
|
+
let l = Q(s, c), u = Math.min(Z(s), Z(c));
|
|
112
|
+
if (u > 0 && l > u * Pe) {
|
|
113
|
+
let e = a(o.id) ? o : i, t = e === o ? i : o;
|
|
114
|
+
p.push({
|
|
115
|
+
severity: n,
|
|
116
|
+
code: "LAYOUT_OVERLAP",
|
|
117
|
+
path: m(e, "position"),
|
|
118
|
+
message: `Component overlaps "${t.id}" by ${Math.round(l / u * 100)}% of the smaller area.`
|
|
119
|
+
});
|
|
120
|
+
}
|
|
98
121
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
122
|
+
return p;
|
|
123
|
+
}
|
|
124
|
+
function Fe(e) {
|
|
125
|
+
let t = e.canvas, n = t.backgroundImage === void 0 && (t.background === void 0 || t.background.type === "solid") ? J(t.background?.type === "solid" ? t.background.color : t.backgroundColor) : void 0, r = /* @__PURE__ */ new Map([["", {
|
|
126
|
+
width: t.width,
|
|
127
|
+
height: t.height,
|
|
128
|
+
background: n
|
|
129
|
+
}]]);
|
|
130
|
+
for (let i of e.subCanvases ?? []) {
|
|
131
|
+
let e = i.background === void 0 || i.background.type === "solid" ? J(i.background?.type === "solid" ? i.background.color : i.backgroundColor) : void 0;
|
|
132
|
+
if (i.display === "popup") r.set(i.id, {
|
|
133
|
+
width: i.width,
|
|
134
|
+
height: i.height,
|
|
135
|
+
background: e
|
|
136
|
+
});
|
|
137
|
+
else {
|
|
138
|
+
let a = i.backgroundColor === void 0 && i.background === void 0 ? n : e;
|
|
139
|
+
r.set(i.id, {
|
|
140
|
+
width: t.width,
|
|
141
|
+
height: t.height,
|
|
142
|
+
background: a
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return r;
|
|
147
|
+
}
|
|
148
|
+
function Ie(e, t, n, r, i, a, o) {
|
|
149
|
+
let s = q(e);
|
|
150
|
+
if (s !== null) return s;
|
|
151
|
+
let c = i.get(e.id) ?? -1, l = a(e), u = n.components.filter((t) => t.id !== e.id && !t.status.hidden && (i.get(t.id) ?? -1) < c && a(t) === l).sort((e, t) => (i.get(t.id) ?? -1) - (i.get(e.id) ?? -1));
|
|
152
|
+
for (let e of u) {
|
|
153
|
+
let n = r.get(e.id);
|
|
154
|
+
if (n === void 0 || Q(t, n) <= 0) continue;
|
|
155
|
+
if (!X(n, t)) return;
|
|
156
|
+
let i = q(e);
|
|
157
|
+
return i === null ? void 0 : i;
|
|
158
|
+
}
|
|
159
|
+
return o?.background;
|
|
160
|
+
}
|
|
161
|
+
function q(e) {
|
|
162
|
+
let t = e.style.backgroundColor ?? e.style.fill;
|
|
163
|
+
if (t == null || t === "" || t === "transparent") return null;
|
|
164
|
+
if (e.style.backgroundImage !== void 0) return;
|
|
165
|
+
let n = Y(e.style.opacity);
|
|
166
|
+
if (!(n !== void 0 && n < 1)) return J(t);
|
|
116
167
|
}
|
|
117
168
|
function J(e) {
|
|
118
|
-
return
|
|
169
|
+
return typeof e == "string" ? V(e) : void 0;
|
|
119
170
|
}
|
|
120
|
-
function Y(e
|
|
121
|
-
|
|
122
|
-
return (i + .05) / (a + .05);
|
|
171
|
+
function Y(e) {
|
|
172
|
+
return typeof e == "number" && Number.isFinite(e) ? e : void 0;
|
|
123
173
|
}
|
|
124
|
-
function
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
r: 0,
|
|
131
|
-
g: 0,
|
|
132
|
-
b: 0
|
|
133
|
-
}, t), i = Y({
|
|
134
|
-
r: 255,
|
|
135
|
-
g: 255,
|
|
136
|
-
b: 255
|
|
137
|
-
}, t), a = r >= i ? {
|
|
138
|
-
r: 0,
|
|
139
|
-
g: 0,
|
|
140
|
-
b: 0
|
|
141
|
-
} : {
|
|
142
|
-
r: 255,
|
|
143
|
-
g: 255,
|
|
144
|
-
b: 255
|
|
145
|
-
};
|
|
146
|
-
if (Math.max(r, i) < n) return;
|
|
147
|
-
let o = 0, s = 1;
|
|
148
|
-
for (let r = 0; r < 24; r++) {
|
|
149
|
-
let r = (o + s) / 2;
|
|
150
|
-
Y(Z(e, a, r), t) >= n ? s = r : o = r;
|
|
151
|
-
}
|
|
152
|
-
for (let r = s; r <= 1; r += .002) {
|
|
153
|
-
let i = ve(Z(e, a, r));
|
|
154
|
-
if (Y(i, t) >= n) return i;
|
|
174
|
+
function Le(e) {
|
|
175
|
+
if (typeof e == "number" && Number.isFinite(e)) return e;
|
|
176
|
+
if (e === "bold" || e === "bolder") return 700;
|
|
177
|
+
if (typeof e == "string") {
|
|
178
|
+
let t = Number(e);
|
|
179
|
+
if (Number.isFinite(t)) return t;
|
|
155
180
|
}
|
|
181
|
+
return 400;
|
|
182
|
+
}
|
|
183
|
+
function Re(e, t) {
|
|
184
|
+
return e.left < 0 || e.top < 0 || e.right > t.width || e.bottom > t.height;
|
|
185
|
+
}
|
|
186
|
+
function X(e, t) {
|
|
187
|
+
return e.left <= t.left && e.top <= t.top && e.right >= t.right && e.bottom >= t.bottom;
|
|
188
|
+
}
|
|
189
|
+
function Z(e) {
|
|
190
|
+
return Math.max(0, e.right - e.left) * Math.max(0, e.bottom - e.top);
|
|
156
191
|
}
|
|
157
|
-
function
|
|
158
|
-
let
|
|
159
|
-
return
|
|
160
|
-
r: r(e.r, t.r),
|
|
161
|
-
g: r(e.g, t.g),
|
|
162
|
-
b: r(e.b, t.b)
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
function ve(e) {
|
|
166
|
-
return {
|
|
167
|
-
r: Math.round(e.r),
|
|
168
|
-
g: Math.round(e.g),
|
|
169
|
-
b: Math.round(e.b)
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
function Q(e) {
|
|
173
|
-
let t = $(e) / 255;
|
|
174
|
-
return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
192
|
+
function Q(e, t) {
|
|
193
|
+
let n = Math.min(e.right, t.right) - Math.max(e.left, t.left), r = Math.min(e.bottom, t.bottom) - Math.max(e.top, t.top);
|
|
194
|
+
return n > 0 && r > 0 ? n * r : 0;
|
|
175
195
|
}
|
|
176
196
|
function $(e) {
|
|
177
|
-
return
|
|
197
|
+
return Math.round(e * 10) / 10;
|
|
178
198
|
}
|
|
179
199
|
//#endregion
|
|
180
|
-
export { e as SCREEN_BLUEPRINT_COMPONENT_VISIBILITY_CAPABILITY,
|
|
200
|
+
export { e as SCREEN_BLUEPRINT_COMPONENT_VISIBILITY_CAPABILITY, a as SCREEN_BLUEPRINT_SIMULATION_MAX_DEPTH, O as SCREEN_CATEGORY_MAX, M as SCREEN_PROFILE_MAX_FIELDS, k as SCREEN_PROFILE_MAX_ROWS, D as SCREEN_PROPORTION_MAX, l as ScreenCoreInvariantError, u as applyScreenDocumentCommand, o as applyScreenDocumentTransaction, K as auditScreenLayout, Ee as blend, E as buildComponentIndex, _ as calculateScreenAlignment, g as calculateScreenDistribution, Oe as canvasPointToViewport, Ae as chooseScreenSnapCandidate, ve as collectScreenValueRefDependencies, oe as commitScreenHistory, n as compileScreenBlueprint, ne as componentsReferencingDataSources, we as compositeOver, De as computeMinimumLegibleFontPx, H as contrastRatio, v as createScreenHistory, he as deleteScreenJsonPath, pe as diffScreenDocuments, r as dispatchScreenBlueprintEvent, A as enumerateScreenDataCandidates, z as evaluateScreenHostResourceParameters, ge as evaluateScreenValueRef, L as extractScreenHostResourceVariableDependencies, Se as formatCssColor, S as getAncestorDepth, w as getAncestorIds, x as getDescendantIds, me as getDescendantSet, C as getPainterOrder, T as getRootIds, d as getScreenComponentBounds, _e as getScreenJsonPath, ue as getScreenSelectionBounds, h as hitTestScreenComponents, P as insertScreenJsonArrayItem, re as isScreenComponentEffectivelyHidden, le as isScreenComponentEffectivelyLocked, p as listSampleValueRefs, B as minimumContrastRatio, R as moveScreenJsonArrayItem, V as parseCssColor, Te as parseCssColorAlpha, fe as parseScreenDocumentCommand, j as profileScreenDataset, te as queryScreenComponentsInRect, f as readScreenHistoryNodes, ae as redoScreenHistory, ie as reduceScreenInteraction, ce as reduceScreenViewport, xe as relativeLuminance, ye as removeScreenJsonArrayItem, U as resolveScreenFontFloorPx, se as revertScreenHistory, be as screenStatePresetStyle, F as setScreenJsonArrayItem, I as setScreenJsonPath, i as simulateScreenBlueprint, Ce as suggestReadableColor, t as traceScreenBlueprintEvent, m as undoScreenHistory, N as validateScreenDataBinding, N as validateScreenHostResourceBinding, de as validateScreenDocumentSemantics, ke as viewportPointToCanvas };
|
|
181
201
|
|
|
182
202
|
//# sourceMappingURL=core.js.map
|