base-screen 0.2.0 → 0.3.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/README.md +3 -12
- package/dist/_internal/contracts/document/blueprint-capabilities.d.ts +9 -1
- package/dist/_internal/contracts/document/blueprint-capabilities.js +16 -0
- package/dist/_internal/contracts/document/blueprint-graph.d.ts +68 -0
- package/dist/_internal/contracts/document/blueprint-graph.js +424 -0
- package/dist/_internal/contracts/document/blueprint-strict.d.ts +3 -1
- package/dist/_internal/contracts/document/blueprint-strict.js +77 -91
- package/dist/_internal/contracts/document/component-states.d.ts +54 -0
- package/dist/_internal/contracts/document/component-states.js +171 -0
- package/dist/_internal/contracts/document/json-schema.js +49 -17
- package/dist/_internal/contracts/document/limits.d.ts +40 -8
- package/dist/_internal/contracts/document/limits.js +40 -8
- package/dist/_internal/contracts/document/parse-parts.d.ts +12 -0
- package/dist/_internal/contracts/document/parse-parts.js +56 -0
- package/dist/_internal/contracts/document/parse.js +1 -1
- package/dist/_internal/contracts/document/references.js +108 -41
- package/dist/_internal/contracts/document/schema.d.ts +525 -186
- package/dist/_internal/contracts/document/schema.js +234 -95
- package/dist/_internal/contracts/document/sub-canvas.d.ts +27 -0
- package/dist/_internal/contracts/document/sub-canvas.js +38 -0
- package/dist/_internal/contracts/document/theme.d.ts +22 -0
- package/dist/_internal/contracts/document/theme.js +65 -0
- package/dist/_internal/contracts/document/validate-blueprint.d.ts +7 -0
- package/dist/_internal/contracts/document/validate-blueprint.js +223 -25
- package/dist/_internal/contracts/document/validate-component.d.ts +2 -0
- package/dist/_internal/contracts/document/validate-component.js +111 -54
- package/dist/_internal/contracts/document/validate-data-source.js +84 -9
- package/dist/_internal/contracts/document/validate-sub-canvas.d.ts +9 -0
- package/dist/_internal/contracts/document/validate-sub-canvas.js +92 -0
- package/dist/_internal/contracts/document/validate-theme.d.ts +4 -0
- package/dist/_internal/contracts/document/validate-theme.js +20 -0
- package/dist/_internal/contracts/document/validate.js +19 -2
- package/dist/_internal/contracts/index.d.ts +11 -4
- package/dist/_internal/contracts/index.js +8 -2
- package/dist/_internal/contracts/migration/blueprint-graph-migration.d.ts +21 -0
- package/dist/_internal/contracts/migration/blueprint-graph-migration.js +328 -0
- package/dist/_internal/contracts/migration/migrate-document.d.ts +2 -1
- package/dist/_internal/contracts/migration/migrate-document.js +11 -3
- package/dist/_internal/contracts/push/delivery.d.ts +16 -0
- package/dist/_internal/contracts/push/delivery.js +70 -0
- package/dist/_internal/contracts/push/level-scale.d.ts +7 -0
- package/dist/_internal/contracts/push/level-scale.js +91 -0
- package/dist/_internal/contracts/screen-document.schema.json +1056 -383
- package/dist/_internal/contracts/types/document.d.ts +277 -76
- package/dist/_internal/contracts/types/execution.d.ts +12 -2
- package/dist/_internal/contracts/types/execution.js +0 -5
- package/dist/_internal/contracts/types/host.d.ts +35 -1
- package/dist/_internal/contracts/types/host.js +7 -1
- package/dist/_internal/contracts/types/push.d.ts +86 -0
- package/dist/_internal/contracts/types/push.js +1 -0
- package/dist/_internal/contracts/types/variable.d.ts +5 -0
- package/dist/_internal/contracts/variable/parse.js +30 -1
- package/dist/_internal/core/blueprint/runtime-compile.d.ts +4 -0
- package/dist/_internal/core/blueprint/runtime-compile.js +45 -21
- package/dist/_internal/core/blueprint/runtime-dispatch.js +270 -156
- package/dist/_internal/core/blueprint/runtime-types.d.ts +112 -6
- package/dist/_internal/core/blueprint/runtime.d.ts +1 -1
- package/dist/_internal/core/commands/apply-component-commands.d.ts +5 -0
- package/dist/_internal/core/commands/apply-component-commands.js +74 -2
- package/dist/_internal/core/commands/apply.js +63 -3
- package/dist/_internal/core/commands/parse-command.js +12 -0
- package/dist/_internal/core/commands/types.d.ts +28 -3
- package/dist/_internal/core/diff/screen-diff.js +1 -1
- package/dist/_internal/core/index.d.ts +1 -1
- package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-canvas-bridge-helpers.d.ts +1 -1
- package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-canvas-bridge.d.ts +11 -1
- package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-panels-controller.d.ts +18 -4
- package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-timer-scheduler.d.ts +21 -0
- package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-workbench-panel.d.ts +8 -1
- package/dist/_internal/engine/browser/controllers/dataset/designer-data-source-authoring.d.ts +25 -1
- package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-controller-context.d.ts +6 -2
- package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-draft-controller.d.ts +8 -0
- package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-surface-controller.d.ts +14 -0
- package/dist/_internal/engine/browser/controllers/dataset/designer-update-policy-authoring.d.ts +52 -0
- package/dist/_internal/engine/browser/controllers/designer-artboard-controller.d.ts +80 -0
- package/dist/_internal/engine/browser/controllers/designer-canvas-runtime-controller.d.ts +21 -3
- package/dist/_internal/engine/browser/controllers/designer-change-controller.d.ts +2 -0
- package/dist/_internal/engine/browser/controllers/designer-command-palette-controller.d.ts +2 -0
- package/dist/_internal/engine/browser/controllers/designer-notification-controller.d.ts +7 -0
- package/dist/_internal/engine/browser/controllers/designer-page-preview-controller.d.ts +34 -0
- package/dist/_internal/engine/browser/controllers/designer-popup-preview-controller.d.ts +40 -0
- package/dist/_internal/engine/browser/controllers/designer-preview-controller.d.ts +1 -3
- package/dist/_internal/engine/browser/controllers/designer-reference-layer-controller.d.ts +45 -0
- package/dist/_internal/engine/browser/controllers/designer-viewport-controller.d.ts +10 -0
- package/dist/_internal/engine/browser/controllers/gesture/designer-gesture-callbacks.d.ts +5 -1
- package/dist/_internal/engine/browser/controllers/gesture/designer-gesture-controller.d.ts +2 -0
- package/dist/_internal/engine/browser/controllers/gesture/designer-gesture-environment.d.ts +18 -7
- package/dist/_internal/engine/browser/controllers/gesture/designer-group-editing-controller.d.ts +8 -1
- package/dist/_internal/engine/browser/controllers/layers/designer-layers-controller.d.ts +11 -0
- package/dist/_internal/engine/browser/controllers/panel/designer-component-states-controller.d.ts +26 -0
- package/dist/_internal/engine/browser/controllers/panel/designer-inspector-focus.d.ts +30 -0
- package/dist/_internal/engine/browser/controllers/panel/designer-panel-controller-callbacks.d.ts +23 -6
- package/dist/_internal/engine/browser/controllers/panel/designer-panel-controller.d.ts +2 -2
- package/dist/_internal/engine/browser/controllers/panel/designer-panel-material-controller.d.ts +4 -0
- package/dist/_internal/engine/browser/controllers/panel/designer-panel-property-controller.d.ts +2 -0
- package/dist/_internal/engine/browser/controllers/workbench/designer-snap-controller.d.ts +5 -1
- package/dist/_internal/engine/browser/controllers/workbench/designer-workbench-controller.d.ts +7 -1
- package/dist/_internal/engine/browser/dom/blueprint/designer-blueprint-inspector-configuration.d.ts +12 -0
- package/dist/_internal/engine/browser/dom/blueprint/designer-blueprint-library-dom.d.ts +18 -2
- package/dist/_internal/engine/browser/dom/change/designer-change-dom.d.ts +1 -0
- package/dist/_internal/engine/browser/dom/color/designer-color-palette-dom.d.ts +1 -0
- package/dist/_internal/engine/browser/dom/color/designer-color-palette-theme.d.ts +10 -0
- package/dist/_internal/engine/browser/dom/color/designer-color-palette-types.d.ts +13 -0
- package/dist/_internal/engine/browser/dom/color/designer-color-theme-slots.d.ts +10 -0
- package/dist/_internal/engine/browser/dom/dataset/designer-dataset-types.d.ts +17 -6
- package/dist/_internal/engine/browser/dom/descriptor/designer-descriptor-control-dom.d.ts +17 -1
- package/dist/_internal/engine/browser/dom/descriptor/designer-descriptor-model.d.ts +2 -0
- package/dist/_internal/engine/browser/dom/designer-field-primitives.d.ts +43 -1
- package/dist/_internal/engine/browser/dom/designer-icons.d.ts +2 -0
- package/dist/_internal/engine/browser/dom/designer-select-dom.d.ts +2 -0
- package/dist/_internal/engine/browser/dom/designer-ui-primitives.d.ts +5 -0
- package/dist/_internal/engine/browser/dom/layers/designer-layers-model.d.ts +28 -0
- package/dist/_internal/engine/browser/dom/material-library/designer-material-library-dom.d.ts +18 -2
- package/dist/_internal/engine/browser/dom/material-library/designer-material-library-group-view.d.ts +1 -0
- package/dist/_internal/engine/browser/dom/menu/designer-menu-model.d.ts +4 -2
- package/dist/_internal/engine/browser/dom/panel/designer-canvas-properties-dom.d.ts +10 -2
- package/dist/_internal/engine/browser/dom/panel/designer-canvas-transactions.d.ts +5 -1
- package/dist/_internal/engine/browser/dom/panel/designer-chrome-primitives.d.ts +12 -0
- package/dist/_internal/engine/browser/dom/panel/designer-color-group-dom.d.ts +45 -0
- package/dist/_internal/engine/browser/dom/panel/designer-component-properties-dom.d.ts +4 -3
- package/dist/_internal/engine/browser/dom/panel/designer-component-states-dom.d.ts +22 -0
- package/dist/_internal/engine/browser/dom/panel/designer-panel-primitives.d.ts +18 -2
- package/dist/_internal/engine/browser/dom/workspace/designer-workspace-template.d.ts +13 -0
- package/dist/_internal/engine/browser/dom/workspace/designer-workspace.d.ts +2 -1
- package/dist/_internal/engine/browser/viewport/designer-canvas-aids-types.d.ts +8 -2
- package/dist/_internal/engine/browser/viewport/designer-canvas-aids.d.ts +14 -4
- package/dist/_internal/engine/browser/viewport/designer-canvas-coordinates.d.ts +7 -0
- package/dist/_internal/engine/browser/viewport/designer-canvas-measurements.d.ts +12 -1
- package/dist/_internal/engine/browser/viewport/designer-canvas-snap-alignment-index.d.ts +27 -0
- package/dist/_internal/engine/browser/viewport/designer-canvas-snap-geometry.d.ts +13 -2
- package/dist/_internal/engine/browser/viewport/designer-canvas-snap-preview.d.ts +1 -1
- package/dist/_internal/engine/browser/viewport/designer-canvas-snap-spacing.d.ts +12 -0
- package/dist/_internal/engine/browser/viewport/designer-guide-overlay-nodes.d.ts +2 -0
- package/dist/_internal/engine/common/observability/designer-metrics.d.ts +1 -1
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-geometry.d.ts +12 -0
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-graph.d.ts +203 -0
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-model-types.d.ts +6 -2
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-model.d.ts +58 -7
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-protocol-types.d.ts +131 -51
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-value-sources.d.ts +7 -3
- package/dist/_internal/engine/common/operations/catalog/designer-catalog-refresh.d.ts +13 -1
- package/dist/_internal/engine/common/operations/designer-operation-registry.d.ts +5 -1
- package/dist/_internal/engine/common/operations/designer-variable-operations.d.ts +8 -0
- package/dist/_internal/engine/common/operations/element/designer-element-operation-types.d.ts +8 -0
- package/dist/_internal/engine/common/operations/host-resource/host-resource-authoring.d.ts +1 -1
- package/dist/_internal/engine/common/operations/material-component/material-component-fragment-extract.d.ts +34 -0
- package/dist/_internal/engine/common/operations/material-component/material-component-fragment.d.ts +24 -41
- package/dist/_internal/engine/common/operations/material-component/material-component.d.ts +1 -1
- package/dist/_internal/engine/common/operations/material-library/material-library-fragments.d.ts +46 -0
- package/dist/_internal/engine/common/operations/material-library/material-library-grouping.d.ts +11 -0
- package/dist/_internal/engine/common/operations/selection/designer-group.d.ts +16 -4
- package/dist/_internal/engine/common/operations/selection/designer-multi-selection-operations.d.ts +4 -3
- package/dist/_internal/engine/common/operations/selection/designer-selection-actions.d.ts +6 -0
- package/dist/_internal/engine/common/operations/selection/designer-selection.d.ts +8 -0
- package/dist/_internal/engine/common/operations/style/designer-component-states.d.ts +62 -0
- package/dist/_internal/engine/common/operations/style/designer-material-appearance.d.ts +30 -0
- package/dist/_internal/engine/common/session/designer-artboard.d.ts +40 -0
- package/dist/_internal/engine/common/session/designer-session.d.ts +21 -0
- package/dist/_internal/engine/common/ui-text/designer-blueprint-ui-text.d.ts +169 -0
- package/dist/_internal/engine/common/ui-text/designer-ui-text.d.ts +422 -88
- package/dist/_internal/engine/designer-blueprint-workbench-panel-CJ3iZo5v.js +2872 -0
- package/dist/_internal/engine/{designer-dataset-controller-CPytVNBK.js → designer-dataset-controller-CrfOg2Ys.js} +1764 -1507
- package/dist/_internal/engine/designer-element/api/designer-element-catalog.d.ts +4 -3
- package/dist/_internal/engine/designer-element/api/designer-element-configuration-types.d.ts +11 -8
- package/dist/_internal/engine/designer-element/api/designer-element-fragment-save.d.ts +16 -0
- package/dist/_internal/engine/designer-element/api/designer-element-host-properties.d.ts +0 -5
- package/dist/_internal/engine/designer-element/api/designer-element-insert-component-fragment.d.ts +9 -2
- package/dist/_internal/engine/designer-element/api/designer-element-material-library-fragments.d.ts +17 -0
- package/dist/_internal/engine/designer-element/api/designer-element-project.d.ts +0 -1
- package/dist/_internal/engine/designer-element/base-screen-designer-element.d.ts +24 -24
- package/dist/_internal/engine/designer-element/designer-element-public-api.d.ts +5 -5
- package/dist/_internal/engine/designer-element/runtime/designer-element-guards.d.ts +0 -2
- package/dist/_internal/engine/designer-element/runtime/designer-element-host.d.ts +6 -7
- package/dist/_internal/engine/designer-element/runtime/designer-element-rendering.d.ts +11 -1
- package/dist/_internal/engine/designer-element/runtime/designer-element-runtime.d.ts +15 -14
- package/dist/_internal/engine/designer-element/runtime/designer-element-state.d.ts +29 -10
- package/dist/_internal/engine/{designer-ui-primitives-CH4RNiMa.js → designer-field-primitives-KBZuWN_D.js} +876 -346
- package/dist/_internal/engine/designer-left-panel-groups-dom-N2OHOWjl.js +1282 -0
- package/dist/_internal/engine/host-resource-selection-xo2mLCD4.js +2482 -0
- package/dist/_internal/engine/host-tokens.css +12 -12
- package/dist/_internal/engine/index.js +8643 -6102
- package/dist/_internal/host-kit/index.d.ts +2 -0
- package/dist/_internal/host-kit/index.js +2 -0
- package/dist/_internal/host-kit/push-result.d.ts +5 -0
- package/dist/_internal/host-kit/push-result.js +8 -0
- package/dist/_internal/host-kit/sse-subscribe.d.ts +59 -0
- package/dist/_internal/host-kit/sse-subscribe.js +253 -0
- package/dist/_internal/host-kit/subscription-hub.d.ts +41 -0
- package/dist/_internal/host-kit/subscription-hub.js +179 -0
- package/dist/_internal/material/base-material.d.ts +1 -0
- package/dist/_internal/material/chart.d.ts +4 -0
- package/dist/_internal/material/chart.js +101 -58
- package/dist/_internal/material/container.js +19 -33
- package/dist/_internal/material/{base-material-BArgjOeL.js → editor-descriptor-DJZYygOa.js} +49 -20
- package/dist/_internal/material/editor-descriptor.d.ts +18 -0
- package/dist/_internal/material/image.js +30 -34
- package/dist/_internal/material/rule.js +29 -42
- package/dist/_internal/material/shapes.js +57 -74
- package/dist/_internal/material/table.d.ts +4 -0
- package/dist/_internal/material/table.js +118 -71
- package/dist/_internal/material/text.js +40 -68
- package/dist/_internal/plugin-core/contracts.d.ts +38 -49
- package/dist/_internal/plugin-core/contribution-kind.js +47 -2
- package/dist/_internal/plugin-core/editor/editor-ai-description.d.ts +3 -0
- package/dist/_internal/plugin-core/editor/editor-ai-description.js +124 -0
- package/dist/_internal/plugin-core/editor/editor-descriptor-conditions.js +5 -0
- package/dist/_internal/plugin-core/editor/editor-descriptor-inference.d.ts +32 -0
- package/dist/_internal/plugin-core/editor/editor-descriptor-inference.js +83 -0
- package/dist/_internal/plugin-core/editor/editor-descriptor-items.d.ts +6 -0
- package/dist/_internal/plugin-core/editor/editor-descriptor-items.js +41 -12
- package/dist/_internal/plugin-core/editor/editor-descriptor-model.d.ts +24 -1
- package/dist/_internal/plugin-core/editor/editor-descriptor-model.js +6 -1
- package/dist/_internal/plugin-core/editor/editor-descriptor-schema.js +21 -0
- package/dist/_internal/plugin-core/editor/editor-descriptor-sections.js +5 -7
- package/dist/_internal/plugin-core/editor/editor-descriptor.d.ts +1 -0
- package/dist/_internal/plugin-core/editor/editor-descriptor.js +55 -2
- package/dist/_internal/plugin-core/fragment/fragment.d.ts +96 -0
- package/dist/_internal/plugin-core/fragment/fragment.js +535 -0
- package/dist/_internal/plugin-core/index.d.ts +7 -4
- package/dist/_internal/plugin-core/index.js +5 -2
- package/dist/_internal/plugin-core/material/material-manifest.js +14 -2
- package/dist/_internal/plugin-core/material/material-schema.d.ts +9 -0
- package/dist/_internal/plugin-core/material/material-schema.js +31 -1
- package/dist/_internal/plugin-core/material/material-theme.d.ts +25 -0
- package/dist/_internal/plugin-core/material/material-theme.js +77 -0
- package/dist/_internal/plugin-core/material/material-validation-constants.js +2 -0
- package/dist/_internal/plugin-core/material/material.d.ts +1 -1
- package/dist/_internal/plugin-core/material/material.js +1 -1
- package/dist/_internal/plugin-manager/contribution-kind-plan.d.ts +2 -1
- package/dist/_internal/plugin-manager/contribution-kind-plan.js +6 -0
- package/dist/_internal/plugin-manager/contributions.js +10 -0
- package/dist/_internal/plugin-sdk/authoring-finding.d.ts +19 -0
- package/dist/_internal/plugin-sdk/authoring-finding.js +12 -0
- package/dist/_internal/plugin-sdk/fragment-audit.d.ts +14 -0
- package/dist/_internal/plugin-sdk/fragment-audit.js +170 -0
- package/dist/_internal/plugin-sdk/fragment-definition.d.ts +11 -0
- package/dist/_internal/plugin-sdk/fragment-definition.js +16 -0
- package/dist/_internal/plugin-sdk/index.d.ts +9 -0
- package/dist/_internal/plugin-sdk/index.js +9 -0
- package/dist/_internal/plugin-sdk/material-config-groups.d.ts +44 -0
- package/dist/_internal/plugin-sdk/material-config-groups.js +80 -0
- package/dist/_internal/plugin-sdk/material-editor-audit.d.ts +24 -0
- package/dist/_internal/plugin-sdk/material-editor-audit.js +160 -0
- package/dist/_internal/plugin-sdk/material-rendered-element.d.ts +69 -0
- package/dist/_internal/plugin-sdk/material-rendered-element.js +165 -0
- package/dist/_internal/plugin-sdk/material-spec-audit.d.ts +22 -0
- package/dist/_internal/plugin-sdk/material-spec-audit.js +184 -0
- package/dist/_internal/plugin-sdk/material-spec.d.ts +114 -0
- package/dist/_internal/plugin-sdk/material-spec.js +635 -0
- package/dist/_internal/plugin-sdk/material-style-keys.d.ts +17 -0
- package/dist/_internal/plugin-sdk/material-style-keys.js +82 -0
- package/dist/_internal/renderer/index.d.ts +2 -0
- package/dist/_internal/renderer/index.js +1745 -616
- package/dist/_internal/renderer/renderer/renderer-component-states.d.ts +34 -0
- package/dist/_internal/renderer/renderer/renderer-effective-style.d.ts +12 -6
- package/dist/_internal/renderer/renderer/renderer-material-dom.d.ts +19 -3
- package/dist/_internal/renderer/renderer/renderer-mounted-material.d.ts +11 -10
- package/dist/_internal/renderer/renderer/renderer-state.d.ts +17 -1
- package/dist/_internal/renderer/renderer/renderer-theme.d.ts +11 -0
- package/dist/_internal/renderer/renderer/renderer-types.d.ts +15 -5
- package/dist/_internal/renderer/renderer/renderer.d.ts +30 -9
- package/dist/_internal/renderer/resource/data-source-runtime.d.ts +25 -2
- package/dist/_internal/renderer/resource/push-window.d.ts +43 -0
- package/dist/_internal/renderer/resource/source-query-port.d.ts +8 -1
- package/dist/_internal/renderer/sub-canvas-layer.d.ts +83 -0
- package/dist/_internal/renderer/viewer/viewer-blueprint-timer-scheduler.d.ts +23 -0
- package/dist/_internal/renderer/viewer/viewer-configuration-guards.d.ts +0 -1
- package/dist/_internal/renderer/viewer/viewer-configuration.d.ts +6 -3
- package/dist/_internal/renderer/viewer/viewer-stale-style.d.ts +3 -0
- package/dist/_internal/renderer/viewer/viewer-variable-controller.d.ts +2 -0
- package/dist/_internal/renderer/viewer/viewer.d.ts +18 -7
- package/dist/_internal/sdk/auto-register.js +7 -7
- package/dist/_internal/sdk/designer-auto-register.js +3 -3
- package/dist/_internal/sdk/designer.d.ts +1 -1
- package/dist/_internal/sdk/designer.js +8 -8
- package/dist/_internal/sdk/host-tokens.css +12 -12
- package/dist/_internal/sdk/index.d.ts +1 -1
- package/dist/_internal/sdk/index.js +6 -6
- package/dist/auto-register.js +11 -11
- package/dist/auto-register.js.map +1 -1
- package/dist/contracts.js +73 -43
- package/dist/contracts.js.map +1 -1
- package/dist/core.js +151 -23
- package/dist/core.js.map +1 -1
- package/dist/{data-contracts-BFld0hw_.js → data-contracts-CnnB5KC9.js} +2 -2
- package/dist/{data-contracts-BFld0hw_.js.map → data-contracts-CnnB5KC9.js.map} +1 -1
- package/dist/dataset-port-D993nOlT.js +182 -0
- package/dist/dataset-port-D993nOlT.js.map +1 -0
- package/dist/{designer-Byw45cUM.js → designer-3Tb0EIDV.js} +3 -3
- package/dist/designer-3Tb0EIDV.js.map +1 -0
- package/dist/designer-auto-register.js +6 -6
- package/dist/designer-auto-register.js.map +1 -1
- package/dist/designer-blueprint-workbench-panel-CJ3iZo5v-BebifP4x.js +2852 -0
- package/dist/designer-blueprint-workbench-panel-CJ3iZo5v-BebifP4x.js.map +1 -0
- package/dist/{designer-dataset-controller-CPytVNBK-DWL3SRTP.js → designer-dataset-controller-CrfOg2Ys-DhKUEJJe.js} +1487 -1232
- package/dist/designer-dataset-controller-CrfOg2Ys-DhKUEJJe.js.map +1 -0
- package/dist/{designer-ui-primitives-CH4RNiMa-BNXQwJPZ.js → designer-field-primitives-KBZuWN_D-B3h4jpYe.js} +871 -343
- package/dist/designer-field-primitives-KBZuWN_D-B3h4jpYe.js.map +1 -0
- package/dist/designer-left-panel-groups-dom-N2OHOWjl-D8CzGwbF.js +1265 -0
- package/dist/designer-left-panel-groups-dom-N2OHOWjl-D8CzGwbF.js.map +1 -0
- package/dist/designer.js +5 -5
- package/dist/dist-6GRboBs-.js +3305 -0
- package/dist/dist-6GRboBs-.js.map +1 -0
- package/dist/{dist-BHTClwId.js → dist-BjLjFUy1.js} +8564 -6030
- package/dist/dist-BjLjFUy1.js.map +1 -0
- package/dist/engine.js +5 -4
- package/dist/fragment-Y6YnW6wy.js +393 -0
- package/dist/fragment-Y6YnW6wy.js.map +1 -0
- package/dist/host-kit.js +297 -3
- package/dist/host-kit.js.map +1 -1
- package/dist/{host-resource-selection-5Cf_gclK-Sv4Z8UXS.js → host-resource-selection-xo2mLCD4-BR5XCcim.js} +1233 -937
- package/dist/host-resource-selection-xo2mLCD4-BR5XCcim.js.map +1 -0
- package/dist/host-tokens.css +12 -12
- package/dist/index.js +10 -10
- package/dist/level-scale-BzUjE31V.js +139 -0
- package/dist/level-scale-BzUjE31V.js.map +1 -0
- package/dist/{manager-B2CZ2b5I.js → manager-Ch0RTu_i.js} +20 -10
- package/dist/manager-Ch0RTu_i.js.map +1 -0
- package/dist/material-UbSfiuZq.js +12 -0
- package/dist/{material-BPlvEmDi.js.map → material-UbSfiuZq.js.map} +1 -1
- package/dist/material-auto-register.js +6 -6
- package/dist/material-auto-register.js.map +1 -1
- package/dist/{material-definition-B9xCZcD-.js → material-definition-BeW34dJr.js} +2 -2
- package/dist/{material-definition-B9xCZcD-.js.map → material-definition-BeW34dJr.js.map} +1 -1
- package/dist/{material-manifest-bsGl6vZZ.js → material-manifest-B1XatGPx.js} +222 -137
- package/dist/material-manifest-B1XatGPx.js.map +1 -0
- package/dist/material-schema-CLoDx-Tl.js +203 -0
- package/dist/material-schema-CLoDx-Tl.js.map +1 -0
- package/dist/{editor-descriptor-schema-Be30Wv8w.js → material-theme-C91eus78.js} +90 -28
- package/dist/material-theme-C91eus78.js.map +1 -0
- package/dist/material-validation-utils-ku_6Xxk2.js +125 -0
- package/dist/material-validation-utils-ku_6Xxk2.js.map +1 -0
- package/dist/material.js +3 -3
- package/dist/migrate-document-D3HhCVlZ.js +768 -0
- package/dist/migrate-document-D3HhCVlZ.js.map +1 -0
- package/dist/parse-AOTE9WnD.js +2308 -0
- package/dist/parse-AOTE9WnD.js.map +1 -0
- package/dist/{parse-B0hwp_yj.js → parse-B1OD1teS.js} +69 -61
- package/dist/{parse-B0hwp_yj.js.map → parse-B1OD1teS.js.map} +1 -1
- package/dist/parse-parts-BNrpdG5o.js +42 -0
- package/dist/parse-parts-BNrpdG5o.js.map +1 -0
- package/dist/{plugin-B9Xxtw7G.js → plugin-DHgh9uHh.js} +140 -94
- package/dist/plugin-DHgh9uHh.js.map +1 -0
- package/dist/plugin-core.js +93 -8
- package/dist/plugin-core.js.map +1 -0
- package/dist/plugin-manager.js +1 -1
- package/dist/plugin-package-Dr5ro6h6.js +1221 -0
- package/dist/plugin-package-Dr5ro6h6.js.map +1 -0
- package/dist/{plugin-registration-BjS_CXJU.js → plugin-registration-rsmb4GvS.js} +4 -4
- package/dist/{plugin-registration-BjS_CXJU.js.map → plugin-registration-rsmb4GvS.js.map} +1 -1
- package/dist/plugin-sdk.js +6 -6
- package/dist/{plugins-B9bwk-t6.js → plugins-DGRHgREK.js} +2 -2
- package/dist/{plugins-B9bwk-t6.js.map → plugins-DGRHgREK.js.map} +1 -1
- package/dist/plugins.js +8 -8
- package/dist/renderer.js +1 -1
- package/dist/runtime-dispatch-BfnRDtMe.js +479 -0
- package/dist/runtime-dispatch-BfnRDtMe.js.map +1 -0
- package/dist/{src-Bm7u11mN-BMeb9fvV.js → src-Bm7u11mN-_0u6cMEw.js} +60 -60
- package/dist/{src-Bm7u11mN-BMeb9fvV.js.map → src-Bm7u11mN-_0u6cMEw.js.map} +1 -1
- package/dist/{text-BVzTcUas.js → text-BNksUr5J.js} +401 -360
- package/dist/text-BNksUr5J.js.map +1 -0
- package/dist/theme-CcBXf4Ay.js +48 -0
- package/dist/theme-CcBXf4Ay.js.map +1 -0
- package/dist/{value-ref-y4_YKUP5.js → value-ref-BG_MV9C-.js} +2 -2
- package/dist/{value-ref-y4_YKUP5.js.map → value-ref-BG_MV9C-.js.map} +1 -1
- package/dist/{viewer-CrJupI8I-DZZfdHXr.js → viewer-CrJupI8I-D9dVcNw4.js} +5 -5
- package/dist/{viewer-CrJupI8I-DZZfdHXr.js.map → viewer-CrJupI8I-D9dVcNw4.js.map} +1 -1
- package/dist/viewer-auto-register.js +2 -2
- package/dist/viewer.js +2 -2
- package/dist/{contrast-CZFqj1I5.js → viewport-CiCKeAQH.js} +369 -411
- package/dist/viewport-CiCKeAQH.js.map +1 -0
- package/package.json +11 -11
- package/dist/_internal/contracts/document/blueprint-relations.d.ts +0 -16
- package/dist/_internal/contracts/document/blueprint-relations.js +0 -196
- package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-panel-mutations.d.ts +0 -5
- package/dist/_internal/engine/browser/controllers/designer-guard-controller.d.ts +0 -27
- package/dist/_internal/engine/browser/controllers/designer-scene-controller.d.ts +0 -47
- package/dist/_internal/engine/browser/controllers/panel/designer-style-rules-controller.d.ts +0 -12
- package/dist/_internal/engine/browser/dom/guard/designer-contrast-measure.d.ts +0 -24
- package/dist/_internal/engine/browser/dom/guard/designer-guard-dom.d.ts +0 -15
- package/dist/_internal/engine/browser/dom/workspace/designer-canvas-hint-dom.d.ts +0 -6
- package/dist/_internal/engine/browser/viewport/designer-canvas-snap-index.d.ts +0 -9
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-connection.d.ts +0 -14
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-mutation-helpers.d.ts +0 -20
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-mutations.d.ts +0 -15
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-node-ids.d.ts +0 -12
- package/dist/_internal/engine/common/operations/designer-name-validation.d.ts +0 -2
- package/dist/_internal/engine/common/operations/scene/designer-scene.d.ts +0 -55
- package/dist/_internal/engine/common/operations/style/designer-host-conditional-style.d.ts +0 -21
- package/dist/_internal/engine/common/operations/style/designer-style-rules.d.ts +0 -25
- package/dist/_internal/engine/common/validation/designer-guard.d.ts +0 -49
- package/dist/_internal/engine/designer-blueprint-workbench-panel-C2MoZwKA.js +0 -3548
- package/dist/_internal/engine/designer-element/api/designer-element-guard.d.ts +0 -13
- package/dist/_internal/engine/designer-element/api/designer-element-scene.d.ts +0 -14
- package/dist/_internal/engine/designer-left-panel-groups-dom-WMsH33zw.js +0 -573
- package/dist/_internal/engine/host-resource-selection-5Cf_gclK.js +0 -2188
- package/dist/_internal/renderer/style-rules.d.ts +0 -9
- package/dist/contrast-CZFqj1I5.js.map +0 -1
- package/dist/dataset-port-CUsMmX2x.js +0 -65
- package/dist/dataset-port-CUsMmX2x.js.map +0 -1
- package/dist/designer-Byw45cUM.js.map +0 -1
- package/dist/designer-blueprint-workbench-panel-C2MoZwKA-CbXkv78O.js +0 -3517
- package/dist/designer-blueprint-workbench-panel-C2MoZwKA-CbXkv78O.js.map +0 -1
- package/dist/designer-dataset-controller-CPytVNBK-DWL3SRTP.js.map +0 -1
- package/dist/designer-left-panel-groups-dom-WMsH33zw-B9pl8loh.js +0 -557
- package/dist/designer-left-panel-groups-dom-WMsH33zw-B9pl8loh.js.map +0 -1
- package/dist/designer-ui-primitives-CH4RNiMa-BNXQwJPZ.js.map +0 -1
- package/dist/dist-BHTClwId.js.map +0 -1
- package/dist/dist-DfAV2jGI.js +0 -2185
- package/dist/dist-DfAV2jGI.js.map +0 -1
- package/dist/editor-descriptor-schema-Be30Wv8w.js.map +0 -1
- package/dist/host-resource-selection-5Cf_gclK-Sv4Z8UXS.js.map +0 -1
- package/dist/manager-B2CZ2b5I.js.map +0 -1
- package/dist/material-BPlvEmDi.js +0 -12
- package/dist/material-manifest-bsGl6vZZ.js.map +0 -1
- package/dist/material-schema-CtxTkCP2.js +0 -267
- package/dist/material-schema-CtxTkCP2.js.map +0 -1
- package/dist/migrate-document-BJUN7NPv.js +0 -436
- package/dist/migrate-document-BJUN7NPv.js.map +0 -1
- package/dist/parse-BQw3u9_4.js +0 -1126
- package/dist/parse-BQw3u9_4.js.map +0 -1
- package/dist/plugin-B9Xxtw7G.js.map +0 -1
- package/dist/plugin-package-BT-pCoTt.js +0 -174
- package/dist/plugin-package-BT-pCoTt.js.map +0 -1
- package/dist/runtime-dispatch-Dt9fhcI5.js +0 -360
- package/dist/runtime-dispatch-Dt9fhcI5.js.map +0 -1
- package/dist/schema-C38FI_z2.js +0 -541
- package/dist/schema-C38FI_z2.js.map +0 -1
- package/dist/text-BVzTcUas.js.map +0 -1
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type ScreenComponentStyleRule, type ScreenJsonObject } from '../contracts/index.js';
|
|
2
|
-
import type { BaseScreenMaterialDataState } from '../plugin-core/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* 组件条件样式规则求值(ADR-0058):以组件自身 `dataState.value` 为唯一条件源。
|
|
5
|
-
* 非 `ready` 状态、路径不可解析、类型不匹配均视为不命中而不是错误;
|
|
6
|
-
* 命中规则按数组顺序逐键合并,同键后写覆盖先写。
|
|
7
|
-
*/
|
|
8
|
-
export declare function evaluateScreenComponentStyleRules(rules: readonly ScreenComponentStyleRule[] | undefined, dataState: BaseScreenMaterialDataState): ScreenJsonObject | undefined;
|
|
9
|
-
//# sourceMappingURL=style-rules.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contrast-CZFqj1I5.js","names":[],"sources":["../../core/dist/data/data-source-dependents.js","../../core/dist/internal/diagnostics.js","../../core/dist/validation/invariant-error.js","../../core/dist/internal/preconditions.js","../../core/dist/geometry/bounds.js","../../core/dist/validation/validate-semantics.js","../../core/dist/internal/document.js","../../core/dist/commands/command-input.js","../../core/dist/commands/command-result.js","../../core/dist/commands/apply-component-commands.js","../../core/dist/commands/apply-data-source-command.js","../../core/dist/commands/apply-variable-command.js","../../core/dist/commands/apply.js","../../core/dist/commands/parse-command.js","../../core/dist/diff/screen-diff.js","../../core/dist/geometry/component-bounds.js","../../core/dist/geometry/alignment.js","../../core/dist/geometry/validation.js","../../core/dist/geometry/hit-testing.js","../../core/dist/hierarchy/query.js","../../core/dist/history/history.js","../../core/dist/state/interaction.js","../../core/dist/state/viewport.js","../../core/dist/validation/contrast.js"],"sourcesContent":["/**\n * 引用了指定数据源实例的组件 id(按文档顺序)。\n *\n * 实例结果变化时,读它的组件必须重投影:值不在组件上,而在「实例 + 取值引用」这条链上,\n * 因此「组件被 patch」不是唯一的重绘判据。这里只读组件 `dataValue`:旧 `dataSource`\n * 四形态没有文档级实例,随 T05 消失。\n *\n * @param document 读取哪份文档的组件(通常取命令执行后的文档)。\n * @param dataSourceIds 本次发生变化的实例 id。\n */\nexport function componentsReferencingDataSources(document, dataSourceIds) {\n const targets = new Set(dataSourceIds);\n if (targets.size === 0)\n return [];\n const affected = [];\n for (const component of document.components) {\n const ref = component.dataValue;\n if (ref?.kind !== 'data-source-field')\n continue;\n if (targets.has(ref.dataSourceId))\n affected.push(component.id);\n }\n return affected;\n}\n//# sourceMappingURL=data-source-dependents.js.map","import { sortScreenDiagnostics, } from '@base-screen/contracts';\n/** 诊断规范序由 Contracts 独占定义(compareScreenDiagnostics),本包不再自行排序。 */\nexport function sortDiagnostics(diagnostics) {\n return sortScreenDiagnostics(diagnostics);\n}\n/**\n * Prepend path segments to a diagnostic, preserving severity, code, and message.\n * Used by transaction to prefix command diagnostics with `['commands', index]`.\n */\nexport function prefixDiagnostic(diagnostic, prefix) {\n return {\n severity: diagnostic.severity,\n code: diagnostic.code,\n path: [...prefix, ...diagnostic.path],\n message: diagnostic.message,\n };\n}\n//# sourceMappingURL=diagnostics.js.map","export class ScreenCoreInvariantError extends Error {\n name = 'ScreenCoreInvariantError';\n diagnostics;\n constructor(diagnostics) {\n super('Screen document failed Core semantic validation.');\n this.diagnostics = diagnostics;\n }\n}\n//# sourceMappingURL=invariant-error.js.map","export function assertFinite(value, name) {\n if (!Number.isFinite(value)) {\n throw new RangeError(`${name} must be a finite number.`);\n }\n}\nexport function normalizeZero(value) {\n return Object.is(value, -0) ? 0 : value;\n}\nexport function normalizePoint(point) {\n return {\n x: normalizeZero(point.x),\n y: normalizeZero(point.y),\n };\n}\n//# sourceMappingURL=preconditions.js.map","import { normalizeZero } from '../internal/preconditions.js';\n/**\n * Compute the axis-aligned bounds of a component after rotation around its\n * center. Component position is the top-left corner in canvas coordinates.\n * Rotation is in degrees, applied clockwise around the component center.\n *\n * Returns `null` when the result would not be finite or would have\n * non-positive width/height. Public geometry APIs throw `RangeError` for\n * such inputs; validation surfaces them as `CORE_GEOMETRY_INVALID` diagnostics.\n */\nexport function computeComponentBounds(component) {\n const { position: { x, y }, size: { width, height }, rotation, } = component;\n if (!Number.isFinite(x) ||\n !Number.isFinite(y) ||\n !Number.isFinite(width) ||\n !Number.isFinite(height) ||\n !Number.isFinite(rotation) ||\n x < -1_000_000 ||\n x > 1_000_000 ||\n y < -1_000_000 ||\n y > 1_000_000 ||\n width <= 0 ||\n height <= 0 ||\n width > 1_000_000 ||\n height > 1_000_000 ||\n rotation < -180 ||\n rotation >= 180) {\n return null;\n }\n const centerX = x + width / 2;\n const centerY = y + height / 2;\n const halfWidth = width / 2;\n const halfHeight = height / 2;\n const theta = (rotation * Math.PI) / 180;\n const cosTheta = Math.cos(theta);\n const sinTheta = Math.sin(theta);\n const corners = [\n { x: -halfWidth, y: -halfHeight },\n { x: halfWidth, y: -halfHeight },\n { x: halfWidth, y: halfHeight },\n { x: -halfWidth, y: halfHeight },\n ];\n let minX = Number.POSITIVE_INFINITY;\n let minY = Number.POSITIVE_INFINITY;\n let maxX = Number.NEGATIVE_INFINITY;\n let maxY = Number.NEGATIVE_INFINITY;\n for (const corner of corners) {\n const dx = corner.x;\n const dy = corner.y;\n const rotatedX = dx * cosTheta - dy * sinTheta;\n const rotatedY = dx * sinTheta + dy * cosTheta;\n const absoluteX = centerX + rotatedX;\n const absoluteY = centerY + rotatedY;\n if (!Number.isFinite(absoluteX) || !Number.isFinite(absoluteY)) {\n return null;\n }\n if (absoluteX < minX) {\n minX = absoluteX;\n }\n if (absoluteX > maxX) {\n maxX = absoluteX;\n }\n if (absoluteY < minY) {\n minY = absoluteY;\n }\n if (absoluteY > maxY) {\n maxY = absoluteY;\n }\n }\n const boundsWidth = maxX - minX;\n const boundsHeight = maxY - minY;\n if (!Number.isFinite(boundsWidth) ||\n !Number.isFinite(boundsHeight) ||\n boundsWidth <= 0 ||\n boundsHeight <= 0) {\n return null;\n }\n return {\n left: normalizeZero(minX),\n top: normalizeZero(minY),\n right: normalizeZero(maxX),\n bottom: normalizeZero(maxY),\n };\n}\n//# sourceMappingURL=bounds.js.map","import { computeComponentBounds } from '../geometry/bounds.js';\nimport { buildComponentIndex, getAncestorDepth } from '../hierarchy/hierarchy.js';\nimport { sortDiagnostics } from '../internal/diagnostics.js';\n/**\n * Maximum ancestor depth allowed for any component in a Core-valid document.\n * A root has depth 0; a child of a root has depth 1; and so on.\n */\nconst MAX_ANCESTOR_DEPTH = 256;\n/**\n * Validate Core semantic invariants on a canonical ScreenDocument.\n *\n * Contracts is responsible for structural validation (fields, primitives, JSON\n * boundary, resource limits, id uniqueness, parent existence, self-reference,\n * parent cycles, and canonical numeric ranges). Core only verifies the\n * additional domain invariants listed in Spec §10:\n *\n * - No component has an ancestor chain deeper than 256.\n * - Every component's rotated bounds are finite with positive width and height.\n * - Sibling `(zIndex, document order)` ordering is stable (same zIndex legal).\n * - Parent relation does not introduce local coordinate interpretation.\n *\n * The last two are structural guarantees of the canonical document and have no\n * additional runtime check beyond what Contracts and the painter-order\n * algorithm already enforce. The function returns an empty array when the\n * document satisfies all Core invariants.\n *\n * Diagnostics are sorted by path, code, then message, matching Contracts'\n * ordering rules. Consumers must rely only on code and path; message text is\n * not a stable contract.\n *\n * 空结果(合法文档)按引用缓存:canonical 文档不可变,同一引用的「通过」结论恒定。\n * 事务路径在同一文档上多次断言(apply 入口、finalize、history commit)时,\n * 命中缓存将 O(n×depth) 的重复扫描降为 O(1);WeakMap 随文档引用回收。\n * 非空诊断不缓存:失败路径每次返回全新数组,调用方无法通过持有/变更旧数组\n * 影响后续调用。\n */\nconst validSemanticsCache = new WeakSet();\nexport function validateScreenDocumentSemantics(document) {\n if (validSemanticsCache.has(document))\n return EMPTY_DIAGNOSTICS;\n const diagnostics = computeScreenDocumentSemantics(document);\n if (diagnostics.length === 0)\n validSemanticsCache.add(document);\n return diagnostics;\n}\nconst EMPTY_DIAGNOSTICS = [];\nfunction computeScreenDocumentSemantics(document) {\n const index = buildComponentIndex(document);\n const diagnostics = [];\n for (let position = 0; position < document.components.length; position++) {\n const component = document.components[position];\n const depth = getAncestorDepth(index, component.id);\n if (depth > MAX_ANCESTOR_DEPTH) {\n diagnostics.push({\n severity: 'error',\n code: 'CORE_INVARIANT_VIOLATION',\n path: ['components', position, 'parentId'],\n message: `Component ancestor depth ${depth} exceeds the maximum of ${MAX_ANCESTOR_DEPTH}.`,\n });\n }\n const bounds = computeComponentBounds(component);\n if (bounds === null) {\n diagnostics.push({\n severity: 'error',\n code: 'CORE_GEOMETRY_INVALID',\n path: ['components', position],\n message: 'Component rotated bounds must be finite with positive width and height.',\n });\n }\n }\n return sortDiagnostics(diagnostics);\n}\n//# sourceMappingURL=validate-semantics.js.map","import { parseScreenDocument } from '@base-screen/contracts';\nimport { ScreenCoreInvariantError } from '../validation/invariant-error.js';\nimport { validateScreenDocumentSemantics } from '../validation/validate-semantics.js';\nexport function assertCoreValidDocument(document) {\n const diagnostics = validateScreenDocumentSemantics(document);\n if (diagnostics.length > 0) {\n throw new ScreenCoreInvariantError(diagnostics);\n }\n}\nexport function parseCandidateDocument(candidate, base) {\n const parsed = parseScreenDocument(candidate, base);\n if (!parsed.ok) {\n return { ok: false, diagnostics: parsed.diagnostics };\n }\n const semanticDiagnostics = validateScreenDocumentSemantics(parsed.value);\n if (semanticDiagnostics.length > 0) {\n return { ok: false, diagnostics: semanticDiagnostics };\n }\n return { ok: true, document: parsed.value };\n}\n//# sourceMappingURL=document.js.map","export function canonicalTargetIds(document, componentIds) {\n const unique = new Set(componentIds);\n const ids = new Set(document.components.map((component) => component.id));\n if ([...unique].some((id) => !ids.has(id))) {\n return undefined;\n }\n return document.components.filter((component) => unique.has(component.id)).map(({ id }) => id);\n}\nexport function patchDocument(base, patch) {\n return { ...base, ...patch };\n}\nexport function isExactPatch(value, allowed) {\n return isRecord(value) && Object.keys(value).every((key) => allowed.has(key));\n}\nexport function isStatusOnlyPatch(value) {\n return isRecord(value) && Object.keys(value).length === 1 && value.status !== undefined;\n}\nexport function isRecord(value) {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\nexport function isStringArray(value) {\n return Array.isArray(value) && value.every((item) => typeof item === 'string');\n}\n//# sourceMappingURL=command-input.js.map","import { sortDiagnostics } from '../internal/diagnostics.js';\nimport { parseCandidateDocument } from '../internal/document.js';\nexport function finalizeScreenCommand(original, candidate, changedComponentIds) {\n // candidate 由 original 经引用共享派生:以 original 为 base,未变更部分\n // 跳过克隆与结构校验,仅完整校验新增/变更的值。\n const parsed = parseCandidateDocument(candidate, original);\n if (!parsed.ok) {\n return screenCommandFailure(original, parsed.diagnostics);\n }\n return screenCommandSuccess(parsed.document, changedComponentIds);\n}\nexport function screenCommandSuccess(document, changedComponentIds) {\n return { ok: true, document, changedComponentIds, diagnostics: [] };\n}\nexport function screenCommandFailure(document, diagnostics) {\n return {\n ok: false,\n document,\n diagnostics: sortDiagnostics(Array.isArray(diagnostics) ? diagnostics : [diagnostics]),\n };\n}\nexport function invalidScreenCommand(message, path) {\n return [screenCommandDiagnostic('CORE_COMMAND_INVALID', path, message)];\n}\nexport function screenCommandDiagnostic(code, path, message) {\n return { severity: 'error', code, path, message };\n}\n//# sourceMappingURL=command-result.js.map","import { screenJsonEquals } from '@base-screen/contracts';\nimport { buildComponentIndex, getAncestorIds, getDescendantIds, isEffectiveLocked, } from '../hierarchy/hierarchy.js';\nimport { canonicalTargetIds, isExactPatch, isRecord, isStatusOnlyPatch, isStringArray, patchDocument, } from './command-input.js';\nimport { finalizeScreenCommand, invalidScreenCommand, screenCommandDiagnostic, screenCommandFailure, screenCommandSuccess, } from './command-result.js';\nconst COMPONENT_PATCH_FIELDS = new Set([\n 'name',\n 'position',\n 'size',\n 'rotation',\n 'zIndex',\n 'status',\n 'props',\n 'style',\n 'styleRules',\n 'dataSource',\n 'dataValue',\n 'dataBinding',\n]);\nexport function applyAddComponentCommand(document, component) {\n if (!isRecord(component)) {\n return screenCommandFailure(document, invalidScreenCommand('Component must be an object.', ['component']));\n }\n const index = buildComponentIndex(document);\n if (typeof component.id !== 'string') {\n return screenCommandFailure(document, invalidScreenCommand('Component id must be a string.', ['component', 'id']));\n }\n if (index.byId.has(component.id)) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_INVALID', ['component', 'id'], 'Component id already exists.'));\n }\n if (component.parentId !== null && !index.byId.has(component.parentId)) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_PARENT_INVALID', ['component', 'parentId'], 'Component parent does not exist.'));\n }\n if (component.parentId !== null && isEffectiveLocked(index, component.parentId)) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_TARGET_LOCKED', ['component', 'parentId'], 'Component parent is locked.'));\n }\n return finalizeScreenCommand(document, { ...document, components: [...document.components, component] }, [component.id]);\n}\nexport function applyUpdateComponentsCommand(document, componentIds, patch) {\n if (!isStringArray(componentIds)) {\n return screenCommandFailure(document, invalidScreenCommand('Component ids must be a string array.', ['componentIds']));\n }\n if (!isExactPatch(patch, COMPONENT_PATCH_FIELDS) || Object.keys(patch).length === 0) {\n return screenCommandFailure(document, invalidScreenCommand('Component patch must contain known fields.', ['patch']));\n }\n const targets = canonicalTargetIds(document, componentIds);\n if (targets === undefined) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_TARGET_MISSING', ['componentIds'], 'One or more components do not exist.'));\n }\n if (targets.length === 0) {\n return screenCommandSuccess(document, []);\n }\n const index = buildComponentIndex(document);\n const locked = targets.find((id) => isEffectiveLocked(index, id));\n if (locked !== undefined && !isStatusOnlyPatch(patch)) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_TARGET_LOCKED', ['componentIds'], `Component \"${locked}\" is locked.`));\n }\n const targetSet = new Set(targets);\n const components = document.components.map((component) => {\n if (!targetSet.has(component.id))\n return component;\n const next = patchDocument(component, patch);\n // `dataValue: null` 表示清除取值引用;保留 null 键会被严格解析视为与 dataSource 并存。\n if ('dataValue' in patch && patch.dataValue === null) {\n delete next.dataValue;\n }\n return next;\n });\n const changed = targets.filter((id) => {\n const entry = index.byId.get(id);\n return !screenJsonEquals(entry.component, components[entry.index]);\n });\n if (changed.length === 0) {\n return screenCommandSuccess(document, []);\n }\n return finalizeScreenCommand(document, { ...document, components }, changed);\n}\nexport function applyRemoveComponentsCommand(document, componentIds) {\n if (!isStringArray(componentIds)) {\n return screenCommandFailure(document, invalidScreenCommand('Component ids must be a string array.', ['componentIds']));\n }\n const targets = canonicalTargetIds(document, componentIds);\n if (targets === undefined) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_TARGET_MISSING', ['componentIds'], 'One or more components do not exist.'));\n }\n if (targets.length === 0) {\n return screenCommandSuccess(document, []);\n }\n const index = buildComponentIndex(document);\n const removed = new Set();\n for (const target of targets) {\n removed.add(target);\n for (const descendant of getDescendantIds(index, target)) {\n removed.add(descendant);\n }\n }\n // 按文档序收集被移除组件(即后续 changed),锁检查只遍历该集合:\n // 首个命中与原先全量扫描的首个命中一致(诊断消息保持文档序)。\n const changed = document.components\n .filter((component) => removed.has(component.id))\n .map(({ id }) => id);\n const locked = changed.find((id) => isEffectiveLocked(index, id));\n if (locked !== undefined) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_TARGET_LOCKED', ['componentIds'], `Component \"${locked}\" is locked.`));\n }\n return finalizeScreenCommand(document, {\n ...document,\n components: document.components.filter((component) => !removed.has(component.id)),\n }, changed);\n}\nexport function applyReparentComponentsCommand(document, componentIds, parentId) {\n if (!isStringArray(componentIds) || (parentId !== null && typeof parentId !== 'string')) {\n return screenCommandFailure(document, invalidScreenCommand('Reparent command fields are invalid.', []));\n }\n const targets = canonicalTargetIds(document, componentIds);\n if (targets === undefined) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_TARGET_MISSING', ['componentIds'], 'One or more components do not exist.'));\n }\n if (targets.length === 0) {\n return screenCommandSuccess(document, []);\n }\n const index = buildComponentIndex(document);\n // 判定「是否为另一 target 的后代」改走祖先链:id 的祖先命中 targets 即为内层,\n // 等价于原先对每个 target 展开 descendants 的 O(n²×d) 扫描,降为 O(n×depth)。\n const targetSet = new Set(targets);\n const outerTargets = targets.filter((id) => !getAncestorIds(index, id).some((ancestor) => targetSet.has(ancestor)));\n if (parentId !== null && !index.byId.has(parentId)) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_PARENT_INVALID', ['parentId'], 'New parent does not exist.'));\n }\n const descendants = new Set();\n for (const target of outerTargets) {\n descendants.add(target);\n for (const descendant of getDescendantIds(index, target)) {\n descendants.add(descendant);\n }\n }\n if (parentId !== null && descendants.has(parentId)) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_PARENT_INVALID', ['parentId'], 'New parent cannot be a target or descendant.'));\n }\n const lockedTarget = outerTargets.find((id) => isEffectiveLocked(index, id));\n if (lockedTarget !== undefined || (parentId !== null && isEffectiveLocked(index, parentId))) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_TARGET_LOCKED', [], 'Reparenting crosses a locked component boundary.'));\n }\n const changed = outerTargets.filter((id) => index.byId.get(id).component.parentId !== parentId);\n if (changed.length === 0) {\n return screenCommandSuccess(document, []);\n }\n const changedSet = new Set(changed);\n return finalizeScreenCommand(document, {\n ...document,\n components: document.components.map((component) => changedSet.has(component.id) ? { ...component, parentId } : component),\n }, changed);\n}\n//# sourceMappingURL=apply-component-commands.js.map","import { screenJsonEquals, } from '@base-screen/contracts';\nimport { componentsReferencingDataSources } from '../data/data-source-dependents.js';\nimport { finalizeScreenCommand, invalidScreenCommand, screenCommandFailure, screenCommandSuccess, } from './command-result.js';\n/**\n * 整组替换文档级数据源实例。\n *\n * 结构共享:新集合里与旧集合**同 id 且内容相等**的实例按引用复用旧对象,因此下游\n * 「引用未变」的短路判据(`getNetChangedComponentIds`、历史快照 diff)仍然成立,\n * 不会因为一次整组替换把全部实例判成变更。\n *\n * 变更组件 = 引用了本次被改写实例的组件:值不在组件上,而在「实例 + 取值引用」这条链上,\n * 所以实例变了,读它的组件必须重投影。\n *\n * @param document 当前文档。\n * @param dataSources 新的实例集合(未校验的原始值,交由 `finalizeScreenCommand` 解析)。\n */\nexport function applyReplaceDataSourcesCommand(document, dataSources) {\n if (!Array.isArray(dataSources)) {\n return screenCommandFailure(document, invalidScreenCommand('Data sources must be an array.', ['dataSources']));\n }\n const previous = document.dataSources ?? [];\n const previousById = new Map(previous.map((instance) => [instance.id, instance]));\n const next = dataSources.map((instance) => {\n const id = readInstanceId(instance);\n if (id === undefined)\n return instance;\n const before = previousById.get(id);\n return before !== undefined && screenJsonEquals(before, instance) ? before : instance;\n });\n if (isSameInstances(previous, next)) {\n return screenCommandSuccess(document, []);\n }\n const finalized = finalizeScreenCommand(document, { ...document, dataSources: next }, []);\n if (!finalized.ok)\n return finalized;\n const dependents = componentsReferencingDataSources(finalized.document, changedDataSourceIds(previous, finalized.document.dataSources ?? []));\n return { ...finalized, changedComponentIds: dependents };\n}\n/**\n * 两侧集合里内容不相等的实例 id(新增、删除、改写都算变更)。\n *\n * 命令级 `changedComponentIds` 与事务级「净变更组件」共用这一条判据,避免两处口径不同。\n */\nexport function changedDataSourceIds(before, after) {\n const beforeById = new Map(before.map((instance) => [instance.id, instance]));\n const afterById = new Map(after.map((instance) => [instance.id, instance]));\n const changed = [];\n for (const [id, instance] of beforeById) {\n const next = afterById.get(id);\n if (next === undefined || !screenJsonEquals(instance, next))\n changed.push(id);\n }\n for (const id of afterById.keys()) {\n if (!beforeById.has(id))\n changed.push(id);\n }\n return changed;\n}\n/** 引用相等即「没变」:上面已对未变实例做结构共享。 */\nfunction isSameInstances(before, after) {\n return (before.length === after.length && after.every((instance, index) => instance === before[index]));\n}\nfunction readInstanceId(instance) {\n if (instance === null || typeof instance !== 'object' || Array.isArray(instance)) {\n return undefined;\n }\n const id = instance.id;\n return typeof id === 'string' ? id : undefined;\n}\n//# sourceMappingURL=apply-data-source-command.js.map","import { isScreenComponentId, isScreenVariableName, } from '@base-screen/contracts';\nimport { isRecord } from './command-input.js';\nimport { finalizeScreenCommand, invalidScreenCommand, screenCommandDiagnostic, screenCommandFailure, screenCommandSuccess, } from './command-result.js';\nconst RENAME_VARIABLE_FIELDS = new Set(['type', 'variableId', 'nextName']);\n/**\n * Renames only the author-facing label. Canonical references use the immutable variable id,\n * so a rename is atomic without rewriting component data or Blueprint expressions.\n */\nexport function applyRenameVariableCommand(document, command) {\n if (!isRecord(command) ||\n Object.keys(command).some((key) => !RENAME_VARIABLE_FIELDS.has(key)) ||\n command.type !== 'rename-variable' ||\n typeof command.variableId !== 'string' ||\n typeof command.nextName !== 'string') {\n return screenCommandFailure(document, invalidScreenCommand('Rename variable command is invalid.', []));\n }\n if (!isScreenComponentId(command.variableId)) {\n return screenCommandFailure(document, invalidScreenCommand('Variable id is invalid.', ['variableId']));\n }\n if (!isScreenVariableName(command.nextName)) {\n return screenCommandFailure(document, invalidScreenCommand('Next variable name is invalid.', ['nextName']));\n }\n const target = document.variables.find((variable) => variable.id === command.variableId);\n if (target === undefined) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_TARGET_MISSING', ['variableId'], 'Variable target does not exist.'));\n }\n if (target.name === command.nextName)\n return screenCommandSuccess(document, []);\n if (document.variables.some((variable) => variable.name === command.nextName)) {\n return screenCommandFailure(document, invalidScreenCommand('Next variable name is already in use.', ['nextName']));\n }\n const variables = document.variables.map((variable) => variable === target ? { ...variable, name: command.nextName } : variable);\n return finalizeScreenCommand(document, { ...document, variables }, []);\n}\n//# sourceMappingURL=apply-variable-command.js.map","import { SCREEN_CANVAS_FIELDS, screenJsonEquals, } from '@base-screen/contracts';\nimport { componentsReferencingDataSources } from '../data/data-source-dependents.js';\nimport { prefixDiagnostic, sortDiagnostics } from '../internal/diagnostics.js';\nimport { assertCoreValidDocument } from '../internal/document.js';\nimport { applyAddComponentCommand, applyRemoveComponentsCommand, applyReparentComponentsCommand, applyUpdateComponentsCommand, } from './apply-component-commands.js';\nimport { applyReplaceDataSourcesCommand, changedDataSourceIds, } from './apply-data-source-command.js';\nimport { applyRenameVariableCommand } from './apply-variable-command.js';\nimport { isExactPatch, isRecord } from './command-input.js';\nimport { finalizeScreenCommand, invalidScreenCommand, screenCommandDiagnostic, screenCommandFailure, screenCommandSuccess, } from './command-result.js';\n// canvas patch 字段白名单来自契约(`SCREEN_CANVAS_FIELDS`)而不是这里再抄一份:\n// 抄一份的代价是契约新增字段时这里静默拒绝,且没有任何测试会红(ADR-0043:可选字段在\n// patch 中值为 null 表示删除该字段——canvas 全部字段均不可空,null 无歧义)。\nconst CANVAS_FIELDS = new Set(SCREEN_CANVAS_FIELDS);\nexport function applyScreenDocumentCommand(document, command) {\n assertCoreValidDocument(document);\n return applyValidatedCommand(document, command);\n}\nexport function applyScreenDocumentTransaction(document, transaction) {\n assertCoreValidDocument(document);\n if (!isRecord(transaction) || !Array.isArray(transaction.commands)) {\n return {\n ok: false,\n document,\n failedCommandIndex: 0,\n diagnostics: invalidScreenCommand('Transaction commands must be an array.', ['commands']),\n };\n }\n if (transaction.commands.length > 1000) {\n return {\n ok: false,\n document,\n failedCommandIndex: 0,\n diagnostics: [\n screenCommandDiagnostic('CORE_COMMAND_LIMIT_EXCEEDED', ['commands'], 'Transaction exceeds 1000 commands.'),\n ],\n };\n }\n let current = document;\n for (let index = 0; index < transaction.commands.length; index++) {\n // 事务入口已断言语义,后续命令的输入来自上一命令 finalize 的已校验输出,\n // 无需逐命令重复全量断言。\n const result = applyValidatedCommand(current, transaction.commands[index]);\n if (!result.ok) {\n return {\n ok: false,\n document,\n failedCommandIndex: index,\n diagnostics: sortDiagnostics(result.diagnostics.map((item) => prefixDiagnostic(item, ['commands', index]))),\n };\n }\n current = result.document;\n }\n return {\n ok: true,\n document: current,\n changedComponentIds: getNetChangedComponentIds(document, current),\n diagnostics: [],\n };\n}\nfunction applyValidatedCommand(document, command) {\n if (!isRecord(command) || typeof command.type !== 'string') {\n return screenCommandFailure(document, invalidScreenCommand('Command must be an object with a known type.', []));\n }\n switch (command.type) {\n case 'update-canvas':\n return applyCanvas(document, command.patch);\n case 'add-component':\n return applyAddComponentCommand(document, command.component);\n case 'update-components':\n return applyUpdateComponentsCommand(document, command.componentIds, command.patch);\n case 'remove-components':\n return applyRemoveComponentsCommand(document, command.componentIds);\n case 'reparent-components':\n return applyReparentComponentsCommand(document, command.componentIds, command.parentId);\n case 'replace-blueprint':\n return applyBlueprint(document, command.blueprint);\n case 'replace-data-sources':\n return applyReplaceDataSourcesCommand(document, command.dataSources);\n case 'replace-variables':\n return applyVariables(document, command.variables);\n case 'rename-variable':\n return applyRenameVariableCommand(document, command);\n default:\n return screenCommandFailure(document, invalidScreenCommand('Command type is not supported.', ['type']));\n }\n}\nfunction applyCanvas(document, patch) {\n if (!isExactPatch(patch, CANVAS_FIELDS)) {\n return screenCommandFailure(document, invalidScreenCommand('Canvas patch contains an unknown or invalid field.', ['patch']));\n }\n if (Object.keys(patch).length === 0) {\n return screenCommandSuccess(document, []);\n }\n // null 值表示删除字段(canvas 字段均不可空,无歧义);其余值合并。\n const canvas = { ...document.canvas };\n for (const [key, value] of Object.entries(patch)) {\n if (value === null) {\n delete canvas[key];\n }\n else {\n canvas[key] = value;\n }\n }\n if (screenJsonEquals(document.canvas, canvas)) {\n return screenCommandSuccess(document, []);\n }\n return finalizeScreenCommand(document, { ...document, canvas }, []);\n}\nfunction applyVariables(document, variables) {\n if (!Array.isArray(variables)) {\n return screenCommandFailure(document, invalidScreenCommand('Variables must be an array.', ['variables']));\n }\n if (screenJsonEquals(document.variables, variables)) {\n return screenCommandSuccess(document, []);\n }\n return finalizeScreenCommand(document, { ...document, variables }, []);\n}\nfunction applyBlueprint(document, blueprint) {\n if (!isRecord(blueprint) || !Array.isArray(blueprint.relations)) {\n return screenCommandFailure(document, invalidScreenCommand('Blueprint must be a canonical object.', ['blueprint']));\n }\n if (screenJsonEquals(document.blueprint, blueprint))\n return screenCommandSuccess(document, []);\n return finalizeScreenCommand(document, { ...document, blueprint }, []);\n}\nfunction getNetChangedComponentIds(before, after) {\n const afterById = new Map(after.components.map((component) => [component.id, component]));\n const beforeById = new Map(before.components.map((component) => [component.id, component]));\n // 命令路径结构共享:未变更组件在 before/after 中是同一引用(screenJsonEquals(x, x) 恒真)。\n // 先按引用短路,仅对引用变化(真正被命令改写)的少数组件做深比较,\n // 语义与全量深比较完全一致,成本从 O(n×fields) 降为 O(changed×fields)。\n const current = after.components\n .filter((component) => beforeById.get(component.id) !== component &&\n !screenJsonEquals(beforeById.get(component.id), component))\n .map(({ id }) => id);\n const removed = before.components\n .filter((component) => !afterById.has(component.id))\n .map(({ id }) => id);\n // 实例结果变化时,读它的组件也必须重投影:值在「实例 + 取值引用」这条链上,\n // 而不是挂在组件上,因此「组件被 patch」不是唯一的重绘判据。\n const changed = new Set([...current, ...removed]);\n const affected = componentsReferencingDataSources(after, changedDataSourceIds(before.dataSources ?? [], after.dataSources ?? []));\n const dependents = affected.filter((id) => !changed.has(id));\n return dependents.length === 0 ? [...changed] : [...changed, ...dependents];\n}\n//# sourceMappingURL=apply.js.map","import { parseScreenJsonValue } from '@base-screen/contracts';\nimport { isRecord } from './command-input.js';\nimport { invalidScreenCommand } from './command-result.js';\nconst COMMAND_TYPES = new Set([\n 'update-canvas',\n 'add-component',\n 'update-components',\n 'remove-components',\n 'reparent-components',\n 'replace-blueprint',\n 'replace-data-sources',\n 'replace-variables',\n 'rename-variable',\n]);\nconst COMMAND_FIELDS = {\n 'update-canvas': new Set(['type', 'patch']),\n 'add-component': new Set(['type', 'component']),\n 'update-components': new Set(['type', 'componentIds', 'patch']),\n 'remove-components': new Set(['type', 'componentIds']),\n 'reparent-components': new Set(['type', 'componentIds', 'parentId']),\n 'replace-blueprint': new Set(['type', 'blueprint']),\n 'replace-data-sources': new Set(['type', 'dataSources']),\n 'replace-variables': new Set(['type', 'variables']),\n 'rename-variable': new Set(['type', 'variableId', 'nextName']),\n};\nconst MAX_COMMAND_BYTES = 256 * 1024;\nexport function parseScreenDocumentCommand(input) {\n const parsed = parseScreenJsonValue(input, { maxBytes: MAX_COMMAND_BYTES });\n if (!parsed.ok) {\n return parsed;\n }\n if (!isRecord(parsed.value) || typeof parsed.value.type !== 'string') {\n return {\n ok: false,\n diagnostics: invalidScreenCommand('Command must be an object with a known type.', []),\n };\n }\n const type = parsed.value.type;\n if (!COMMAND_TYPES.has(type)) {\n return {\n ok: false,\n diagnostics: invalidScreenCommand('Command type is not supported.', ['type']),\n };\n }\n const allowed = COMMAND_FIELDS[type];\n for (const key of Object.keys(parsed.value)) {\n if (!allowed.has(key)) {\n return {\n ok: false,\n diagnostics: invalidScreenCommand('Command contains an unknown field.', [key]),\n };\n }\n }\n for (const field of allowed) {\n if (!Object.hasOwn(parsed.value, field)) {\n return {\n ok: false,\n diagnostics: invalidScreenCommand('Command field is required.', [field]),\n };\n }\n }\n return { ok: true, value: parsed.value, diagnostics: [] };\n}\n//# sourceMappingURL=parse-command.js.map","const MAX_VALUE_LENGTH = 80;\n/**\n * 文档级 diff:按组件 id 对齐,给出属性级差异行。\n *\n * 放在 core 而不是 engine:工具面与设计器要用同一份实现,否则会出现两套口径。\n * 只比较文档本身,不关心它是怎么产生的。\n */\nexport function diffScreenDocuments(before, after) {\n const beforeById = new Map(before.components.map((component) => [component.id, component]));\n const afterById = new Map(after.components.map((component) => [component.id, component]));\n const rows = [];\n for (const component of after.components) {\n const previous = beforeById.get(component.id);\n if (previous === undefined) {\n rows.push({\n componentId: component.id,\n componentName: component.name,\n kind: 'added',\n entries: [],\n });\n continue;\n }\n const entries = diffComponent(previous, component);\n if (entries.length > 0) {\n rows.push({\n componentId: component.id,\n componentName: component.name,\n kind: 'changed',\n entries,\n });\n }\n }\n for (const component of before.components) {\n if (afterById.has(component.id))\n continue;\n rows.push({\n componentId: component.id,\n componentName: component.name,\n kind: 'removed',\n entries: [],\n });\n }\n return rows;\n}\nfunction diffComponent(before, after) {\n const entries = [];\n compareValue('name', before.name, after.name, entries);\n compareValue('position.x', before.position.x, after.position.x, entries);\n compareValue('position.y', before.position.y, after.position.y, entries);\n compareValue('size.width', before.size.width, after.size.width, entries);\n compareValue('size.height', before.size.height, after.size.height, entries);\n compareValue('rotation', before.rotation, after.rotation, entries);\n compareValue('zIndex', before.zIndex, after.zIndex, entries);\n diffObject('props', before.props, after.props, entries);\n diffObject('style', before.style, after.style, entries);\n compareValue('dataValue', before.dataValue ?? null, after.dataValue ?? null, entries);\n compareValue('dataSource', before.dataSource ?? null, after.dataSource ?? null, entries);\n compareValue('styleRules', before.styleRules ?? [], after.styleRules ?? [], entries);\n return entries;\n}\nfunction diffObject(prefix, before, after, entries) {\n const keys = [...new Set([...Object.keys(before), ...Object.keys(after)])].sort();\n for (const key of keys) {\n compareValue(`${prefix}.${key}`, before[key], after[key], entries);\n }\n}\nfunction compareValue(path, before, after, entries) {\n const beforeJson = stableJson(before);\n if (beforeJson === stableJson(after))\n return;\n entries.push({ path, before: formatValue(beforeJson), after: formatValue(stableJson(after)) });\n}\nfunction stableJson(value) {\n if (value === undefined)\n return 'null';\n return JSON.stringify(value) ?? 'null';\n}\nfunction formatValue(json) {\n return json.length > MAX_VALUE_LENGTH ? `${json.slice(0, MAX_VALUE_LENGTH - 1)}…` : json;\n}\n//# sourceMappingURL=screen-diff.js.map","import { normalizeZero } from '../internal/preconditions.js';\nimport { computeComponentBounds } from './bounds.js';\nexport function getScreenComponentBounds(component) {\n const bounds = computeComponentBounds(component);\n if (bounds === null) {\n throw new RangeError('Component geometry must be finite with positive dimensions.');\n }\n return bounds;\n}\nexport function getScreenSelectionBounds(components) {\n if (components.length === 0) {\n return null;\n }\n const first = getScreenComponentBounds(components[0]);\n let left = first.left;\n let top = first.top;\n let right = first.right;\n let bottom = first.bottom;\n for (let index = 1; index < components.length; index++) {\n const bounds = getScreenComponentBounds(components[index]);\n left = Math.min(left, bounds.left);\n top = Math.min(top, bounds.top);\n right = Math.max(right, bounds.right);\n bottom = Math.max(bottom, bounds.bottom);\n }\n return {\n left: normalizeZero(left),\n top: normalizeZero(top),\n right: normalizeZero(right),\n bottom: normalizeZero(bottom),\n };\n}\n//# sourceMappingURL=component-bounds.js.map","import { buildComponentIndex, isEffectiveHidden, isEffectiveLocked, } from '../hierarchy/hierarchy.js';\nimport { normalizeZero } from '../internal/preconditions.js';\nimport { getScreenComponentBounds } from './component-bounds.js';\nexport function calculateScreenAlignment(components, axis, mode) {\n if (axis !== 'x' && axis !== 'y') {\n throw new RangeError('Alignment axis must be x or y.');\n }\n if (mode !== 'start' && mode !== 'center' && mode !== 'end') {\n throw new RangeError('Alignment mode must be start, center, or end.');\n }\n const visible = getVisibleComponents(components);\n if (visible.length < 2) {\n return [];\n }\n const fixed = visible.filter(({ locked }) => locked);\n const candidates = fixed.length > 0 ? fixed : visible;\n const starts = candidates.map(({ bounds }) => axisStart(bounds, axis));\n const ends = candidates.map(({ bounds }) => axisEnd(bounds, axis));\n // start 对齐到最左/最上,end 对齐到最右/最下;center 对齐到选区并集的中心。\n const reference = mode === 'start'\n ? Math.min(...starts)\n : mode === 'end'\n ? Math.max(...ends)\n : (Math.min(...starts) + Math.max(...ends)) / 2;\n return visible\n .filter(({ locked }) => !locked)\n .map(({ component, bounds }) => ({\n componentId: component.id,\n delta: deltaForAxis(axis, reference - axisValue(bounds, axis, mode)),\n }))\n .filter(({ delta }) => delta.x !== 0 || delta.y !== 0)\n .sort(compareDelta);\n}\nexport function calculateScreenDistribution(components, axis) {\n if (axis !== 'x' && axis !== 'y') {\n throw new RangeError('Distribution axis must be x or y.');\n }\n const items = [...getVisibleComponents(components)].sort((left, right) => {\n const byStart = axisStart(left.bounds, axis) - axisStart(right.bounds, axis);\n return byStart !== 0 ? byStart : compareStrings(left.component.id, right.component.id);\n });\n if (items.length < 2) {\n return [];\n }\n const fixedIndices = new Set([0, items.length - 1]);\n for (let index = 0; index < items.length; index++) {\n if (items[index].locked) {\n fixedIndices.add(index);\n }\n }\n const orderedFixed = [...fixedIndices].sort((left, right) => left - right);\n const deltas = [];\n for (let fixedIndex = 1; fixedIndex < orderedFixed.length; fixedIndex++) {\n const startIndex = orderedFixed[fixedIndex - 1];\n const endIndex = orderedFixed[fixedIndex];\n const moving = items.slice(startIndex + 1, endIndex);\n if (moving.length === 0) {\n continue;\n }\n const start = items[startIndex];\n const end = items[endIndex];\n const available = axisStart(end.bounds, axis) - axisEnd(start.bounds, axis);\n const movingSize = moving.reduce((total, item) => total + axisSize(item.bounds, axis), 0);\n const gap = (available - movingSize) / (moving.length + 1);\n let cursor = axisEnd(start.bounds, axis) + gap;\n for (const item of moving) {\n const delta = cursor - axisStart(item.bounds, axis);\n if (delta !== 0) {\n deltas.push({ componentId: item.component.id, delta: deltaForAxis(axis, delta) });\n }\n cursor += axisSize(item.bounds, axis) + gap;\n }\n }\n return deltas.sort(compareDelta);\n}\nfunction getVisibleComponents(components) {\n const document = { components };\n const index = buildComponentIndex(document);\n return components\n .filter((component) => !isEffectiveHidden(index, component.id))\n .map((component) => ({\n component,\n bounds: getScreenComponentBounds(component),\n locked: isEffectiveLocked(index, component.id),\n }));\n}\nfunction axisStart(bounds, axis) {\n return axis === 'x' ? bounds.left : bounds.top;\n}\nfunction axisEnd(bounds, axis) {\n return axis === 'x' ? bounds.right : bounds.bottom;\n}\nfunction axisSize(bounds, axis) {\n return axisEnd(bounds, axis) - axisStart(bounds, axis);\n}\nfunction axisValue(bounds, axis, mode) {\n const start = axisStart(bounds, axis);\n if (mode === 'start') {\n return start;\n }\n const end = axisEnd(bounds, axis);\n return mode === 'end' ? end : start + (end - start) / 2;\n}\nfunction deltaForAxis(axis, value) {\n return axis === 'x' ? { x: normalizeZero(value), y: 0 } : { x: 0, y: normalizeZero(value) };\n}\nfunction compareDelta(left, right) {\n return compareStrings(left.componentId, right.componentId);\n}\nfunction compareStrings(left, right) {\n return left < right ? -1 : left > right ? 1 : 0;\n}\n//# sourceMappingURL=alignment.js.map","import { assertFinite } from '../internal/preconditions.js';\nexport function assertPoint(point, name) {\n if (point === null || typeof point !== 'object') {\n throw new RangeError(`${name} must be a finite point.`);\n }\n assertFinite(point.x, `${name}.x`);\n assertFinite(point.y, `${name}.y`);\n}\nexport function assertRect(rect) {\n if (rect === null || typeof rect !== 'object') {\n throw new RangeError('Rectangle must be an object.');\n }\n assertFinite(rect.x, 'rect.x');\n assertFinite(rect.y, 'rect.y');\n assertFinite(rect.width, 'rect.width');\n assertFinite(rect.height, 'rect.height');\n if (rect.width <= 0 || rect.height <= 0) {\n throw new RangeError('Rectangle dimensions must be positive.');\n }\n}\nexport function assertViewport(viewport) {\n if (viewport === null || typeof viewport !== 'object' || viewport.offset === null) {\n throw new RangeError('Viewport must contain a zoom and finite offset.');\n }\n if (viewport.zoom < 0.05 || viewport.zoom > 64) {\n throw new RangeError('Viewport zoom must be from 0.05 through 64.');\n }\n assertFinite(viewport.zoom, 'viewport.zoom');\n assertPoint(viewport.offset, 'viewport.offset');\n}\n//# sourceMappingURL=validation.js.map","import { buildComponentIndex, getPainterOrder, isEffectiveHidden } from '../hierarchy/hierarchy.js';\nimport { assertCoreValidDocument } from '../internal/document.js';\nimport { normalizePoint } from '../internal/preconditions.js';\nimport { getScreenComponentBounds } from './component-bounds.js';\nimport { assertPoint, assertRect } from './validation.js';\nexport function hitTestScreenComponents(document, point, options = {}) {\n assertCoreValidDocument(document);\n assertPoint(point, 'point');\n const minimumThickness = options.minimumThickness ?? 0;\n if (!Number.isFinite(minimumThickness) || minimumThickness < 0) {\n throw new RangeError('Hit test minimumThickness must be a non-negative finite number.');\n }\n const index = buildComponentIndex(document);\n const byId = index.byId;\n return [...getPainterOrder(document)].reverse().filter((id) => {\n const component = byId.get(id)?.component;\n return (component !== undefined &&\n !isEffectiveHidden(index, id) &&\n pointInComponent(point, component, minimumThickness));\n });\n}\nexport function queryScreenComponentsInRect(document, rect, mode) {\n assertCoreValidDocument(document);\n assertRect(rect);\n if (mode !== 'intersect' && mode !== 'contain') {\n throw new RangeError('Query mode must be intersect or contain.');\n }\n const index = buildComponentIndex(document);\n return document.components\n .filter((component) => {\n if (isEffectiveHidden(index, component.id)) {\n return false;\n }\n const corners = getComponentCorners(component);\n return mode === 'contain'\n ? corners.every((corner) => pointInRect(corner, rect))\n : rotatedRectIntersectsRect(corners, rect);\n })\n .map(({ id }) => id);\n}\nfunction pointInComponent(point, component, minimumThickness) {\n const width = component.size.width;\n const height = component.size.height;\n // 薄轴上的命中带以中心为轴加宽,厚轴不受影响;判断仍在组件局部坐标系里做,\n // 所以旋转后的命中带与组件本身同向。\n const padX = Math.max(0, minimumThickness - width) / 2;\n const padY = Math.max(0, minimumThickness - height) / 2;\n const centerX = component.position.x + width / 2;\n const centerY = component.position.y + height / 2;\n const radians = (-component.rotation * Math.PI) / 180;\n const cos = Math.cos(radians);\n const sin = Math.sin(radians);\n const x = (point.x - centerX) * cos - (point.y - centerY) * sin + width / 2;\n const y = (point.x - centerX) * sin + (point.y - centerY) * cos + height / 2;\n return x >= -padX && x <= width + padX && y >= -padY && y <= height + padY;\n}\nfunction getComponentCorners(component) {\n getScreenComponentBounds(component);\n const centerX = component.position.x + component.size.width / 2;\n const centerY = component.position.y + component.size.height / 2;\n const halfWidth = component.size.width / 2;\n const halfHeight = component.size.height / 2;\n const radians = (component.rotation * Math.PI) / 180;\n const cos = Math.cos(radians);\n const sin = Math.sin(radians);\n return [\n { x: -halfWidth, y: -halfHeight },\n { x: halfWidth, y: -halfHeight },\n { x: halfWidth, y: halfHeight },\n { x: -halfWidth, y: halfHeight },\n ].map(({ x, y }) => normalizePoint({\n x: centerX + x * cos - y * sin,\n y: centerY + x * sin + y * cos,\n }));\n}\nfunction rotatedRectIntersectsRect(corners, rect) {\n if (corners.some((corner) => pointInRect(corner, rect))) {\n return true;\n }\n const rectCorners = [\n { x: rect.x, y: rect.y },\n { x: rect.x + rect.width, y: rect.y },\n { x: rect.x + rect.width, y: rect.y + rect.height },\n { x: rect.x, y: rect.y + rect.height },\n ];\n if (rectCorners.some((corner) => pointInPolygon(corner, corners))) {\n return true;\n }\n for (let index = 0; index < corners.length; index++) {\n const a = corners[index];\n const b = corners[(index + 1) % corners.length];\n for (let rectIndex = 0; rectIndex < rectCorners.length; rectIndex++) {\n const c = rectCorners[rectIndex];\n const d = rectCorners[(rectIndex + 1) % rectCorners.length];\n if (segmentsIntersect(a, b, c, d)) {\n return true;\n }\n }\n }\n return false;\n}\nfunction pointInPolygon(point, corners) {\n let hasPositive = false;\n let hasNegative = false;\n for (let index = 0; index < corners.length; index++) {\n const start = corners[index];\n const end = corners[(index + 1) % corners.length];\n const cross = (end.x - start.x) * (point.y - start.y) - (end.y - start.y) * (point.x - start.x);\n hasPositive ||= cross > 0;\n hasNegative ||= cross < 0;\n }\n return !(hasPositive && hasNegative);\n}\nfunction segmentsIntersect(a, b, c, d) {\n const cross = (first, second, third) => (second.x - first.x) * (third.y - first.y) - (second.y - first.y) * (third.x - first.x);\n const abC = cross(a, b, c);\n const abD = cross(a, b, d);\n const cdA = cross(c, d, a);\n const cdB = cross(c, d, b);\n if (abC === 0 && pointOnSegment(c, a, b)) {\n return true;\n }\n if (abD === 0 && pointOnSegment(d, a, b)) {\n return true;\n }\n if (cdA === 0 && pointOnSegment(a, c, d)) {\n return true;\n }\n if (cdB === 0 && pointOnSegment(b, c, d)) {\n return true;\n }\n return abC > 0 !== abD > 0 && cdA > 0 !== cdB > 0;\n}\nfunction pointOnSegment(point, start, end) {\n return (point.x >= Math.min(start.x, end.x) &&\n point.x <= Math.max(start.x, end.x) &&\n point.y >= Math.min(start.y, end.y) &&\n point.y <= Math.max(start.y, end.y));\n}\nfunction pointInRect(point, rect) {\n return (point.x >= rect.x &&\n point.x <= rect.x + rect.width &&\n point.y >= rect.y &&\n point.y <= rect.y + rect.height);\n}\n//# sourceMappingURL=hit-testing.js.map","import { buildComponentIndex, isEffectiveHidden, isEffectiveLocked } from './hierarchy.js';\nexport function isScreenComponentEffectivelyHidden(document, componentId) {\n return isEffectiveHidden(buildComponentIndex(document), componentId);\n}\nexport function isScreenComponentEffectivelyLocked(document, componentId) {\n return isEffectiveLocked(buildComponentIndex(document), componentId);\n}\n//# sourceMappingURL=query.js.map","import { assertCoreValidDocument } from '../internal/document.js';\nexport function createScreenHistory(document) {\n assertCoreValidDocument(document);\n return { past: [], present: document, future: [] };\n}\nexport function commitScreenHistory(history, document, limit = 100, provenance) {\n assertHistory(history);\n assertCoreValidDocument(document);\n assertHistoryLimit(limit);\n if (document === history.present) {\n return history;\n }\n const past = [\n ...history.past,\n {\n before: history.present,\n after: document,\n ...(provenance === undefined ? {} : { provenance }),\n },\n ];\n return {\n past: past.length > limit ? past.slice(past.length - limit) : past,\n present: document,\n future: [],\n };\n}\nexport function undoScreenHistory(history) {\n assertHistory(history);\n const entry = history.past.at(-1);\n if (entry === undefined) {\n return history;\n }\n return {\n past: history.past.slice(0, -1),\n present: entry.before,\n future: [copyEntry(entry), ...history.future],\n };\n}\nexport function redoScreenHistory(history) {\n assertHistory(history);\n const entry = history.future[0];\n if (entry === undefined) {\n return history;\n }\n return {\n past: [...history.past, copyEntry(entry)],\n present: entry.after,\n future: history.future.slice(1),\n };\n}\n/**\n * 指针式回退:把当前状态移到任意历史节点,不删除任何节点。\n *\n * 被跳过的节点整体进入 future(保持顺序),因此「回退本身」可以再走回来——\n * 一次 redo 前进一格,或再次调用本函数回到原处。\n */\nexport function revertScreenHistory(history, targetIndex) {\n assertHistory(history);\n if (!Number.isInteger(targetIndex) || targetIndex < 0 || targetIndex > history.past.length) {\n throw new RangeError('History revert target must be an integer from 0 through past.length.');\n }\n const target = targetIndex === 0 ? history.past[0]?.before : history.past[targetIndex - 1]?.after;\n if (target === undefined || target === history.present) {\n return history;\n }\n return {\n past: history.past.slice(0, targetIndex),\n present: target,\n future: [...history.past.slice(targetIndex), ...history.future],\n };\n}\n/**\n * 历史节点列表:0 表示初始状态,其余按提交顺序编号,携带来源标注。\n *\n * `future` 里的节点同样列出,因此界面能画出「前进栈」:撤销与回退都不删节点,\n * 用户看得到自己退到了哪一格、还能往哪走。`position` 只相对于当前指针,\n * 不代表节点是否可编辑。\n */\nexport function readScreenHistoryNodes(history) {\n assertHistory(history);\n const current = history.past.length;\n const nodes = [{ index: 0, position: current === 0 ? 'current' : 'past' }];\n history.past.forEach((entry, position) => {\n const index = position + 1;\n nodes.push({\n index,\n position: index === current ? 'current' : 'past',\n ...(entry.provenance === undefined ? {} : { provenance: entry.provenance }),\n });\n });\n history.future.forEach((entry, offset) => {\n nodes.push({\n index: current + offset + 1,\n position: 'future',\n ...(entry.provenance === undefined ? {} : { provenance: entry.provenance }),\n });\n });\n return nodes;\n}\n/** 复制条目时保留来源标注:撤销后再重做,历史不能丢掉「谁改的」。 */\nfunction copyEntry(entry) {\n return {\n before: entry.before,\n after: entry.after,\n ...(entry.provenance === undefined ? {} : { provenance: entry.provenance }),\n };\n}\nfunction assertHistory(history) {\n if (typeof history.present !== 'object' ||\n history.present === null ||\n !Array.isArray(history.past) ||\n !Array.isArray(history.future)) {\n throw new TypeError('Screen history state is corrupted.');\n }\n}\nfunction assertHistoryLimit(limit) {\n if (!Number.isInteger(limit) || limit < 1 || limit > 1000) {\n throw new RangeError('History limit must be an integer from 1 through 1000.');\n }\n}\n//# sourceMappingURL=history.js.map","import { buildComponentIndex, isEffectiveHidden } from '../hierarchy/hierarchy.js';\nimport { assertCoreValidDocument } from '../internal/document.js';\nexport function reduceScreenInteraction(state, action, document) {\n assertCoreValidDocument(document);\n const selection = canonicalSelection(state.selectedComponentIds, document);\n if (action === null || typeof action !== 'object') {\n return normalize(state, selection, state.focusedComponentId);\n }\n switch (action.type) {\n case 'replace-selection':\n return normalize(state, Array.isArray(action.componentIds)\n ? canonicalSelection(action.componentIds, document)\n : selection, action.focusedComponentId);\n case 'toggle-selection': {\n if (typeof action.componentId !== 'string') {\n return normalize(state, selection, state.focusedComponentId);\n }\n const id = canonicalSelection([action.componentId], document)[0];\n if (id === undefined) {\n return normalize(state, selection, state.focusedComponentId);\n }\n const next = selection.includes(id)\n ? selection.filter((selected) => selected !== id)\n : canonicalSelection([...selection, id], document);\n return normalize(state, next, next.includes(id) ? id : state.focusedComponentId);\n }\n case 'clear-selection':\n return normalize(state, [], null);\n case 'reconcile-document':\n return normalize(state, selection, state.focusedComponentId);\n default:\n return normalize(state, selection, state.focusedComponentId);\n }\n}\nfunction canonicalSelection(ids, document) {\n const requested = new Set(ids.filter((id) => typeof id === 'string'));\n const index = buildComponentIndex(document);\n return document.components\n .filter((component) => requested.has(component.id) && !isEffectiveHidden(index, component.id))\n .map(({ id }) => id);\n}\nfunction normalize(original, selectedComponentIds, focusedComponentId) {\n const focus = typeof focusedComponentId === 'string' && selectedComponentIds.includes(focusedComponentId)\n ? focusedComponentId\n : null;\n if (original.focusedComponentId === focus &&\n original.selectedComponentIds.length === selectedComponentIds.length &&\n original.selectedComponentIds.every((id, index) => id === selectedComponentIds[index])) {\n return original;\n }\n return { selectedComponentIds, focusedComponentId: focus };\n}\n//# sourceMappingURL=interaction.js.map","import { normalizeZero } from '../internal/preconditions.js';\nconst INITIAL_VIEWPORT = { zoom: 1, offset: { x: 0, y: 0 } };\nexport function reduceScreenViewport(state, action) {\n if (!isViewportState(state) || action === null || typeof action !== 'object') {\n return state;\n }\n switch (action.type) {\n case 'reset':\n return state.zoom === 1 && state.offset.x === 0 && state.offset.y === 0\n ? state\n : INITIAL_VIEWPORT;\n case 'pan-by':\n if (!isPoint(action.delta)) {\n return state;\n }\n return withViewport(state, state.zoom, {\n x: state.offset.x + action.delta.x,\n y: state.offset.y + action.delta.y,\n });\n case 'set-offset':\n return isPoint(action.offset) ? withViewport(state, state.zoom, action.offset) : state;\n case 'set-zoom':\n if (!isZoom(action.zoom) || !isPoint(action.anchor)) {\n return state;\n }\n const canvasX = (action.anchor.x - state.offset.x) / state.zoom;\n const canvasY = (action.anchor.y - state.offset.y) / state.zoom;\n return withViewport(state, action.zoom, {\n x: action.anchor.x - canvasX * action.zoom,\n y: action.anchor.y - canvasY * action.zoom,\n });\n default:\n return state;\n }\n}\nfunction withViewport(state, zoom, offset) {\n if (!Number.isFinite(offset.x) || !Number.isFinite(offset.y)) {\n return state;\n }\n const next = { x: normalizeZero(offset.x), y: normalizeZero(offset.y) };\n if (state.zoom === zoom && state.offset.x === next.x && state.offset.y === next.y) {\n return state;\n }\n return { zoom: normalizeZero(zoom), offset: next };\n}\nfunction isViewportState(value) {\n return isZoom(value.zoom) && isPoint(value.offset);\n}\nfunction isZoom(value) {\n return typeof value === 'number' && Number.isFinite(value) && value >= 0.05 && value <= 64;\n}\nfunction isPoint(value) {\n return (value !== null &&\n typeof value === 'object' &&\n typeof value.x === 'number' &&\n typeof value.y === 'number' &&\n Number.isFinite(value.x) &&\n Number.isFinite(value.y));\n}\n//# sourceMappingURL=viewport.js.map","/**\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":";;;;;;AAUA,SAAgB,EAAiC,GAAU,GAAe;CACtE,IAAM,IAAU,IAAI,IAAI,CAAa;CACrC,IAAI,EAAQ,SAAS,GACjB,OAAO,CAAC;CACZ,IAAM,IAAW,CAAC;CAClB,KAAK,IAAM,KAAa,EAAS,YAAY;EACzC,IAAM,IAAM,EAAU;EAClB,GAAK,SA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AGA,KAAK,IAAI,IAAS,GAAM,KAAU,GAAG,KAAU,MAAO;EAClD,IAAM,IAAY,GAAW,EAAM,GAAY,GAAQ,CAAM,CAAC;EAC9D,IAAI,EAAc,GAAW,CAAU,KAAK,GACxC,OAAO;CACf;AAEJ;AAEA,SAAgB,EAAM,GAAM,GAAI,GAAQ;CACpC,IAAM,KAAO,GAAG,MAAM,KAAK,IAAI,KAAK;CACpC,OAAO;EAAE,GAAG,EAAI,EAAK,GAAG,EAAG,CAAC;EAAG,GAAG,EAAI,EAAK,GAAG,EAAG,CAAC;EAAG,GAAG,EAAI,EAAK,GAAG,EAAG,CAAC;CAAE;AAC9E;AACA,SAAS,GAAW,GAAO;CACvB,OAAO;EAAE,GAAG,KAAK,MAAM,EAAM,CAAC;EAAG,GAAG,KAAK,MAAM,EAAM,CAAC;EAAG,GAAG,KAAK,MAAM,EAAM,CAAC;CAAE;AACpF;AACA,SAAS,EAAU,GAAS;CACxB,IAAM,IAAQ,EAAa,CAAO,IAAI;CACtC,OAAO,KAAS,SAAU,IAAQ,UAAU,IAAQ,QAAS,UAAU;AAC3E;AACA,SAAS,EAAa,GAAS;CAG3B,OAFK,OAAO,SAAS,CAAO,IAErB,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,CAAO,CAAC,IAD9B;AAEf"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
//#region ../contracts/dist/diagnostics/material-error.js
|
|
2
|
-
var e = [
|
|
3
|
-
"HOST_RESOURCE_ACCESS_DENIED",
|
|
4
|
-
"HOST_RESOURCE_UNAVAILABLE",
|
|
5
|
-
"HOST_RESOURCE_TIMEOUT",
|
|
6
|
-
"HOST_RESOURCE_FAILED",
|
|
7
|
-
"HOST_RESOURCE_INVALID",
|
|
8
|
-
"HOST_DATASET_INVALID",
|
|
9
|
-
"HOST_DATASET_BINDING_INVALID",
|
|
10
|
-
"HOST_DATASET_ADAPTER_FAILED"
|
|
11
|
-
], t = 256, n = new Set(e), r = {
|
|
12
|
-
HOST_RESOURCE_ACCESS_DENIED: "Host resource access is denied.",
|
|
13
|
-
HOST_RESOURCE_UNAVAILABLE: "Host resource is unavailable.",
|
|
14
|
-
HOST_RESOURCE_TIMEOUT: "Host resource request timed out.",
|
|
15
|
-
HOST_RESOURCE_FAILED: "Host resource request failed.",
|
|
16
|
-
HOST_RESOURCE_INVALID: "Host resource is invalid.",
|
|
17
|
-
HOST_DATASET_INVALID: "Host dataset is invalid.",
|
|
18
|
-
HOST_DATASET_BINDING_INVALID: "Host dataset binding is invalid.",
|
|
19
|
-
HOST_DATASET_ADAPTER_FAILED: "Host dataset adapter failed."
|
|
20
|
-
};
|
|
21
|
-
function i(e) {
|
|
22
|
-
return typeof e == "string" && n.has(e);
|
|
23
|
-
}
|
|
24
|
-
function a(e) {
|
|
25
|
-
try {
|
|
26
|
-
return s(e) ? o(e.code, e.message) : o(void 0, void 0);
|
|
27
|
-
} catch {
|
|
28
|
-
return o(void 0, void 0);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function o(e, t) {
|
|
32
|
-
return i(e) ? {
|
|
33
|
-
code: e,
|
|
34
|
-
message: typeof t == "string" && c(t) ? t : r[e]
|
|
35
|
-
} : {
|
|
36
|
-
code: "HOST_RESOURCE_FAILED",
|
|
37
|
-
message: r.HOST_RESOURCE_FAILED
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
function s(e) {
|
|
41
|
-
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
42
|
-
}
|
|
43
|
-
function c(e) {
|
|
44
|
-
if (e.length === 0 || e.length > 256) return !1;
|
|
45
|
-
for (let t = 0; t < e.length; t++) {
|
|
46
|
-
let n = e.charCodeAt(t);
|
|
47
|
-
if (n <= 31 || n >= 127 && n <= 159) return !1;
|
|
48
|
-
}
|
|
49
|
-
return !0;
|
|
50
|
-
}
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region ../contracts/dist/types/dataset-port.js
|
|
53
|
-
function l(e) {
|
|
54
|
-
if (typeof e != "object" || !e || Array.isArray(e)) return !1;
|
|
55
|
-
let t = e;
|
|
56
|
-
return [
|
|
57
|
-
"list",
|
|
58
|
-
"describe",
|
|
59
|
-
"query"
|
|
60
|
-
].every((e) => typeof t[e] == "function") && (t.groups === void 0 || typeof t.groups == "function") && (t.queryScope === void 0 || t.queryScope === "dataset");
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
63
|
-
export { a, i, t as n, e as r, l as t };
|
|
64
|
-
|
|
65
|
-
//# sourceMappingURL=dataset-port-CUsMmX2x.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dataset-port-CUsMmX2x.js","names":[],"sources":["../../contracts/dist/diagnostics/material-error.js","../../contracts/dist/types/dataset-port.js"],"sourcesContent":["/**\n * Frozen public, material-facing terminal error codes (ADR-0025 §7 / DRH-R7).\n * Materials receive exactly these codes and no other host or runtime code; all\n * other failures collapse to `HOST_RESOURCE_FAILED` at the material boundary.\n */\nexport const SCREEN_MATERIAL_ERROR_CODES = [\n 'HOST_RESOURCE_ACCESS_DENIED',\n 'HOST_RESOURCE_UNAVAILABLE',\n 'HOST_RESOURCE_TIMEOUT',\n 'HOST_RESOURCE_FAILED',\n 'HOST_RESOURCE_INVALID',\n 'HOST_DATASET_INVALID',\n 'HOST_DATASET_BINDING_INVALID',\n 'HOST_DATASET_ADAPTER_FAILED',\n];\n/** Upper bound for a public material error message, in UTF-16 code units. */\nexport const MAX_SCREEN_MATERIAL_ERROR_MESSAGE_LENGTH = 256;\nconst SCREEN_MATERIAL_ERROR_CODE_SET = new Set(SCREEN_MATERIAL_ERROR_CODES);\n/** Stable safe default messages used whenever a host message is missing or unsafe. */\nconst DEFAULT_SCREEN_MATERIAL_ERROR_MESSAGES = {\n HOST_RESOURCE_ACCESS_DENIED: 'Host resource access is denied.',\n HOST_RESOURCE_UNAVAILABLE: 'Host resource is unavailable.',\n HOST_RESOURCE_TIMEOUT: 'Host resource request timed out.',\n HOST_RESOURCE_FAILED: 'Host resource request failed.',\n HOST_RESOURCE_INVALID: 'Host resource is invalid.',\n HOST_DATASET_INVALID: 'Host dataset is invalid.',\n HOST_DATASET_BINDING_INVALID: 'Host dataset binding is invalid.',\n HOST_DATASET_ADAPTER_FAILED: 'Host dataset adapter failed.',\n};\nexport function isScreenMaterialErrorCode(value) {\n return typeof value === 'string' && SCREEN_MATERIAL_ERROR_CODE_SET.has(value);\n}\n/**\n * Normalizes arbitrary host/runtime failure input to the frozen material-facing\n * terminal set. Only `code` and `message` are read from an object-like input;\n * path, params, payload, stack, and all unknown keys are discarded. A code that\n * is not one of the frozen codes is not an accepted safe-failure input: it\n * collapses to `HOST_RESOURCE_FAILED` with the stable safe default message and\n * its raw message is discarded regardless of value. A frozen code preserves a\n * structurally safe message; missing, empty, overlong (over 256 UTF-16 code\n * units), or control-character-bearing messages fall back to the stable safe\n * default for the preserved code. Never throws.\n */\nexport function normalizeScreenMaterialError(input) {\n try {\n if (!isObjectLike(input)) {\n return toMaterialError(undefined, undefined);\n }\n return toMaterialError(input.code, input.message);\n }\n catch {\n return toMaterialError(undefined, undefined);\n }\n}\nfunction toMaterialError(code, message) {\n if (!isScreenMaterialErrorCode(code)) {\n // An unrecognized host code is not an accepted safe-failure input, so its\n // message must not survive either: emit the stable default verbatim.\n return {\n code: 'HOST_RESOURCE_FAILED',\n message: DEFAULT_SCREEN_MATERIAL_ERROR_MESSAGES.HOST_RESOURCE_FAILED,\n };\n }\n const normalizedMessage = typeof message === 'string' && isSafeMaterialErrorMessage(message)\n ? message\n : DEFAULT_SCREEN_MATERIAL_ERROR_MESSAGES[code];\n return { code, message: normalizedMessage };\n}\nfunction isObjectLike(value) {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\nfunction isSafeMaterialErrorMessage(value) {\n if (value.length === 0 || value.length > MAX_SCREEN_MATERIAL_ERROR_MESSAGE_LENGTH) {\n return false;\n }\n for (let index = 0; index < value.length; index++) {\n const unit = value.charCodeAt(index);\n if (unit <= 0x1f || (unit >= 0x7f && unit <= 0x9f)) {\n return false;\n }\n }\n return true;\n}\n//# sourceMappingURL=material-error.js.map","export function isScreenHostDatasetPort(input) {\n if (input === null || typeof input !== 'object' || Array.isArray(input))\n return false;\n const value = input;\n return (['list', 'describe', 'query'].every((name) => typeof value[name] === 'function') &&\n (value.groups === undefined || typeof value.groups === 'function') &&\n (value.queryScope === undefined || value.queryScope === 'dataset'));\n}\n//# sourceMappingURL=dataset-port.js.map"],"mappings":";AAKA,IAAa,IAA8B;CACvC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ,GAEa,IAA2C,KAClD,IAAiC,IAAI,IAAI,CAA2B,GAEpE,IAAyC;CAC3C,6BAA6B;CAC7B,2BAA2B;CAC3B,uBAAuB;CACvB,sBAAsB;CACtB,uBAAuB;CACvB,sBAAsB;CACtB,8BAA8B;CAC9B,6BAA6B;AACjC;AACA,SAAgB,EAA0B,GAAO;CAC7C,OAAO,OAAO,KAAU,YAAY,EAA+B,IAAI,CAAK;AAChF;AAYA,SAAgB,EAA6B,GAAO;CAChD,IAAI;EAIA,OAHK,EAAa,CAAK,IAGhB,EAAgB,EAAM,MAAM,EAAM,OAAO,IAFrC,EAAgB,KAAA,GAAW,KAAA,CAAS;CAGnD,QACM;EACF,OAAO,EAAgB,KAAA,GAAW,KAAA,CAAS;CAC/C;AACJ;AACA,SAAS,EAAgB,GAAM,GAAS;CAYpC,OAXK,EAA0B,CAAI,IAW5B;EAAE;EAAM,SAHW,OAAO,KAAY,YAAY,EAA2B,CAAO,IACrF,IACA,EAAuC;CACH,IAR/B;EACH,MAAM;EACN,SAAS,EAAuC;CACpD;AAMR;AACA,SAAS,EAAa,GAAO;CACzB,OAAO,OAAO,KAAU,cAAY,KAAkB,CAAC,MAAM,QAAQ,CAAK;AAC9E;AACA,SAAS,EAA2B,GAAO;CACvC,IAAI,EAAM,WAAW,KAAK,EAAM,SAAA,KAC5B,OAAO;CAEX,KAAK,IAAI,IAAQ,GAAG,IAAQ,EAAM,QAAQ,KAAS;EAC/C,IAAM,IAAO,EAAM,WAAW,CAAK;EACnC,IAAI,KAAQ,MAAS,KAAQ,OAAQ,KAAQ,KACzC,OAAO;CAEf;CACA,OAAO;AACX;;;AClFA,SAAgB,EAAwB,GAAO;CAC3C,IAAsB,OAAO,KAAU,aAAnC,KAA+C,MAAM,QAAQ,CAAK,GAClE,OAAO;CACX,IAAM,IAAQ;CACd,OAAQ;EAAC;EAAQ;EAAY;CAAO,CAAC,CAAC,OAAO,MAAS,OAAO,EAAM,MAAU,UAAU,MAClF,EAAM,WAAW,KAAA,KAAa,OAAO,EAAM,UAAW,gBACtD,EAAM,eAAe,KAAA,KAAa,EAAM,eAAe;AAChE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"designer-Byw45cUM.js","names":["b"],"sources":["../../sdk/dist/designer.js"],"sourcesContent":["import { t as e } from \"./definition-CCm2r5Uf.js\";\nimport { BASE_SCREEN_BLUEPRINT_CANVAS_COMMAND_EVENT as t, BASE_SCREEN_BLUEPRINT_CANVAS_STATE_EVENT as n, BASE_SCREEN_BLUEPRINT_NODE_DRAG_MIME as r, BASE_SCREEN_CANVAS_PRESENTATION_CHANGE_EVENT as i, BASE_SCREEN_CHANGE_STATE_EVENT as a, BASE_SCREEN_DESIGNER_BACK_REQUEST_EVENT as o, BASE_SCREEN_DESIGNER_BLUEPRINT_CANVAS_SLOT as s, BASE_SCREEN_DESIGNER_LEFT_PANEL_GROUP_CHANGE_EVENT as c, BASE_SCREEN_DESIGNER_LEFT_PANEL_GROUP_ICONS as l, BASE_SCREEN_DESIGNER_LEFT_PANEL_SLOT_PREFIX as u, BASE_SCREEN_DESIGNER_WORKBENCH_MODE_CHANGE_EVENT as d, BASE_SCREEN_GUARD_CHANGE_EVENT as f, BASE_SCREEN_HOST_RESOURCE_DRAG_MIME as p, BASE_SCREEN_HOST_RESOURCE_SELECTION_REQUEST_EVENT as m, BASE_SCREEN_MATERIAL_LIBRARY_ACTION_EVENT as h, BASE_SCREEN_METRIC_EVENT as g, BASE_SCREEN_PROJECT_STATE_CHANGE_EVENT as _, BASE_SCREEN_SCENE_CHANGE_EVENT as v, BaseScreenDesignerElement as y, BaseScreenDesignerElement as b, baseScreenDesignerLeftPanelSlotName as x, createBaseScreenCorePluginCommandPort as S, createBaseScreenCorePluginDesignReadPort as C, parseBaseScreenBlueprintCanvasCommand as w, parseBaseScreenDesignerLeftPanelGroups as T, parseBaseScreenHostResourceAuthoringIntent as E, parseBaseScreenMaterialLibraryGrouping as D, parseBaseScreenMaterialLibraryItems as O, parseBaseScreenMaterialLibraryState as k, prepareDesignerScenePreview as A, writeBaseScreenHostResourceDragData as j } from \"@base-screen/engine\";\n//#region src/designer.ts\nvar M = \"base-screen-designer\";\nfunction N() {\n\treturn e(M, b);\n}\nfunction P(e) {\n\tlet t = N();\n\tif (!t.ok) return t;\n\tlet n = e.ownerDocument.createElement(M);\n\treturn e.append(n), {\n\t\tok: !0,\n\t\tvalue: n,\n\t\tdiagnostics: []\n\t};\n}\n//#endregion\nexport { t as BASE_SCREEN_BLUEPRINT_CANVAS_COMMAND_EVENT, n as BASE_SCREEN_BLUEPRINT_CANVAS_STATE_EVENT, r as BASE_SCREEN_BLUEPRINT_NODE_DRAG_MIME, i as BASE_SCREEN_CANVAS_PRESENTATION_CHANGE_EVENT, a as BASE_SCREEN_CHANGE_STATE_EVENT, o as BASE_SCREEN_DESIGNER_BACK_REQUEST_EVENT, s as BASE_SCREEN_DESIGNER_BLUEPRINT_CANVAS_SLOT, c as BASE_SCREEN_DESIGNER_LEFT_PANEL_GROUP_CHANGE_EVENT, l as BASE_SCREEN_DESIGNER_LEFT_PANEL_GROUP_ICONS, u as BASE_SCREEN_DESIGNER_LEFT_PANEL_SLOT_PREFIX, M as BASE_SCREEN_DESIGNER_TAG_NAME, d as BASE_SCREEN_DESIGNER_WORKBENCH_MODE_CHANGE_EVENT, f as BASE_SCREEN_GUARD_CHANGE_EVENT, p as BASE_SCREEN_HOST_RESOURCE_DRAG_MIME, m as BASE_SCREEN_HOST_RESOURCE_SELECTION_REQUEST_EVENT, h as BASE_SCREEN_MATERIAL_LIBRARY_ACTION_EVENT, g as BASE_SCREEN_METRIC_EVENT, _ as BASE_SCREEN_PROJECT_STATE_CHANGE_EVENT, v as BASE_SCREEN_SCENE_CHANGE_EVENT, y as BaseScreenDesignerElement, x as baseScreenDesignerLeftPanelSlotName, S as createBaseScreenCorePluginCommandPort, C as createBaseScreenCorePluginDesignReadPort, N as defineBaseScreenDesigner, P as mountBaseScreenDesignerSkeleton, w as parseBaseScreenBlueprintCanvasCommand, T as parseBaseScreenDesignerLeftPanelGroups, E as parseBaseScreenHostResourceAuthoringIntent, D as parseBaseScreenMaterialLibraryGrouping, O as parseBaseScreenMaterialLibraryItems, k as parseBaseScreenMaterialLibraryState, A as prepareDesignerScenePreview, j as writeBaseScreenHostResourceDragData };\n\n//# sourceMappingURL=designer.js.map"],"mappings":";;;AAGA,IAAI,IAAI;AACR,SAAS,IAAI;CACZ,OAAO,EAAE,GAAGA,CAAC;AACd;AACA,SAAS,EAAE,GAAG;CACb,IAAI,IAAI,EAAE;CACV,IAAI,CAAC,EAAE,IAAI,OAAO;CAClB,IAAI,IAAI,EAAE,cAAc,cAAc,CAAC;CACvC,OAAO,EAAE,OAAO,CAAC,GAAG;EACnB,IAAI,CAAC;EACL,OAAO;EACP,aAAa,CAAC;CACf;AACD"}
|