base-screen 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +532 -186
- package/dist/_internal/contracts/document/schema.js +235 -96
- 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-value-ref.js +6 -1
- 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 +1071 -386
- package/dist/_internal/contracts/types/diagnostics.d.ts +1 -1
- package/dist/_internal/contracts/types/document.d.ts +280 -77
- 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-simulate.d.ts +57 -0
- package/dist/_internal/core/blueprint/runtime-simulate.js +177 -0
- package/dist/_internal/core/blueprint/runtime-types.d.ts +112 -6
- package/dist/_internal/core/blueprint/runtime.d.ts +2 -1
- package/dist/_internal/core/blueprint/runtime.js +1 -0
- package/dist/_internal/core/commands/apply-collection-commands.d.ts +32 -0
- package/dist/_internal/core/commands/apply-collection-commands.js +174 -0
- package/dist/_internal/core/commands/apply-component-commands.d.ts +5 -0
- package/dist/_internal/core/commands/apply-component-commands.js +74 -2
- package/dist/_internal/core/commands/apply.js +76 -3
- package/dist/_internal/core/commands/parse-command.js +24 -0
- package/dist/_internal/core/commands/types.d.ts +56 -3
- package/dist/_internal/core/data/data-candidates.d.ts +38 -0
- package/dist/_internal/core/data/data-candidates.js +186 -0
- package/dist/_internal/core/data/dataset-profile.d.ts +71 -0
- package/dist/_internal/core/data/dataset-profile.js +170 -0
- package/dist/_internal/core/data/sample-values.d.ts +25 -0
- package/dist/_internal/core/data/sample-values.js +45 -0
- package/dist/_internal/core/diff/screen-diff.js +7 -1
- package/dist/_internal/core/index.d.ts +7 -1
- package/dist/_internal/core/index.js +7 -1
- package/dist/_internal/core/state/state-preset.d.ts +32 -0
- package/dist/_internal/core/state/state-preset.js +37 -0
- package/dist/_internal/core/validation/layout-audit.d.ts +17 -0
- package/dist/_internal/core/validation/layout-audit.js +228 -0
- package/dist/_internal/core/validation/legibility.d.ts +9 -0
- package/dist/_internal/core/validation/legibility.js +33 -0
- package/dist/_internal/engine/browser/controllers/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 +14 -1
- 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 +29 -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 +22 -5
- 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-data-section-diff.d.ts +4 -6
- 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/value-ref/designer-value-ref-types.d.ts +2 -0
- 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 +10 -4
- package/dist/_internal/engine/browser/viewport/designer-canvas-aids.d.ts +17 -5
- package/dist/_internal/engine/browser/viewport/designer-canvas-coordinates.d.ts +7 -0
- package/dist/_internal/engine/browser/viewport/designer-canvas-measurements.d.ts +8 -9
- 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 +4 -0
- package/dist/_internal/engine/browser/viewport/designer-snap-tuning.d.ts +14 -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/change/designer-change-events.d.ts +2 -0
- package/dist/_internal/engine/common/operations/change/designer-change-proposal.d.ts +35 -2
- package/dist/_internal/engine/common/operations/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/display/designer-target-display.d.ts +2 -2
- 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 +67 -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 +464 -90
- package/dist/_internal/engine/designer-blueprint-workbench-panel-BWSglfAb.js +2792 -0
- package/dist/_internal/engine/{designer-dataset-controller-CPytVNBK.js → designer-dataset-controller-DdbY4ILC.js} +1919 -1604
- package/dist/_internal/engine/designer-element/api/designer-element-catalog.d.ts +4 -3
- package/dist/_internal/engine/designer-element/api/designer-element-change.d.ts +24 -0
- 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 +36 -24
- package/dist/_internal/engine/designer-element/designer-element-public-api.d.ts +7 -6
- 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 +12 -2
- package/dist/_internal/engine/designer-element/runtime/designer-element-runtime.d.ts +19 -15
- package/dist/_internal/engine/designer-element/runtime/designer-element-sample-data.d.ts +23 -0
- 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-Crn464Qg.js} +919 -348
- package/dist/_internal/engine/designer-left-panel-groups-dom-DFdLWxxY.js +1282 -0
- package/dist/_internal/engine/host-resource-selection-CWrPLVOc.js +2482 -0
- package/dist/_internal/engine/host-tokens.css +12 -12
- package/dist/_internal/engine/index.js +9202 -6279
- package/dist/_internal/host-kit/index.d.ts +3 -0
- package/dist/_internal/host-kit/index.js +3 -0
- package/dist/_internal/host-kit/intent/index.d.ts +16 -0
- package/dist/_internal/host-kit/intent/index.js +13 -0
- package/dist/_internal/host-kit/intent/intent-behavior.d.ts +59 -0
- package/dist/_internal/host-kit/intent/intent-behavior.js +812 -0
- package/dist/_internal/host-kit/intent/intent-block.d.ts +59 -0
- package/dist/_internal/host-kit/intent/intent-block.js +359 -0
- package/dist/_internal/host-kit/intent/intent-catalog.d.ts +105 -0
- package/dist/_internal/host-kit/intent/intent-catalog.js +60 -0
- package/dist/_internal/host-kit/intent/intent-compile-types.d.ts +222 -0
- package/dist/_internal/host-kit/intent/intent-compile-types.js +10 -0
- package/dist/_internal/host-kit/intent/intent-compile.d.ts +35 -0
- package/dist/_internal/host-kit/intent/intent-compile.js +465 -0
- package/dist/_internal/host-kit/intent/intent-data-check.d.ts +50 -0
- package/dist/_internal/host-kit/intent/intent-data-check.js +163 -0
- package/dist/_internal/host-kit/intent/intent-data-context.d.ts +53 -0
- package/dist/_internal/host-kit/intent/intent-data-context.js +200 -0
- package/dist/_internal/host-kit/intent/intent-dataset.d.ts +52 -0
- package/dist/_internal/host-kit/intent/intent-dataset.js +125 -0
- package/dist/_internal/host-kit/intent/intent-format.d.ts +33 -0
- package/dist/_internal/host-kit/intent/intent-format.js +94 -0
- package/dist/_internal/host-kit/intent/intent-kpi-bind.d.ts +29 -0
- package/dist/_internal/host-kit/intent/intent-kpi-bind.js +59 -0
- package/dist/_internal/host-kit/intent/intent-layout.d.ts +102 -0
- package/dist/_internal/host-kit/intent/intent-layout.js +264 -0
- package/dist/_internal/host-kit/intent/intent-parse.d.ts +39 -0
- package/dist/_internal/host-kit/intent/intent-parse.js +930 -0
- package/dist/_internal/host-kit/intent/intent-prepare.d.ts +52 -0
- package/dist/_internal/host-kit/intent/intent-prepare.js +104 -0
- package/dist/_internal/host-kit/intent/intent-session.d.ts +202 -0
- package/dist/_internal/host-kit/intent/intent-session.js +1001 -0
- package/dist/_internal/host-kit/intent/intent-stream.d.ts +28 -0
- package/dist/_internal/host-kit/intent/intent-stream.js +183 -0
- package/dist/_internal/host-kit/intent/intent-style.d.ts +37 -0
- package/dist/_internal/host-kit/intent/intent-style.js +77 -0
- package/dist/_internal/host-kit/intent/intent-types.d.ts +234 -0
- package/dist/_internal/host-kit/intent/intent-types.js +10 -0
- package/dist/_internal/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 +123 -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 +149 -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 +15 -0
- package/dist/_internal/plugin-sdk/index.js +15 -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-isolated-csp.d.ts +38 -0
- package/dist/_internal/plugin-sdk/material-isolated-csp.js +67 -0
- package/dist/_internal/plugin-sdk/material-isolated-runtime.d.ts +22 -0
- package/dist/_internal/plugin-sdk/material-isolated-runtime.js +262 -0
- package/dist/_internal/plugin-sdk/material-isolated.d.ts +94 -0
- package/dist/_internal/plugin-sdk/material-isolated.js +1024 -0
- package/dist/_internal/plugin-sdk/material-rendered-element.d.ts +77 -0
- package/dist/_internal/plugin-sdk/material-rendered-element.js +229 -0
- package/dist/_internal/plugin-sdk/material-spec-audit.d.ts +24 -0
- package/dist/_internal/plugin-sdk/material-spec-audit.js +204 -0
- package/dist/_internal/plugin-sdk/material-spec.d.ts +134 -0
- package/dist/_internal/plugin-sdk/material-spec.js +710 -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/plugin-sdk/material-template-audit.d.ts +12 -0
- package/dist/_internal/plugin-sdk/material-template-audit.js +302 -0
- package/dist/_internal/plugin-sdk/material-template-expression.d.ts +98 -0
- package/dist/_internal/plugin-sdk/material-template-expression.js +549 -0
- package/dist/_internal/plugin-sdk/material-template-render.d.ts +32 -0
- package/dist/_internal/plugin-sdk/material-template-render.js +579 -0
- package/dist/_internal/plugin-sdk/material-template.d.ts +185 -0
- package/dist/_internal/plugin-sdk/material-template.js +879 -0
- package/dist/_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/contrast-DRPezUIl.js +131 -0
- package/dist/contrast-DRPezUIl.js.map +1 -0
- package/dist/core.js +169 -21
- 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/dataset-profile-Dk6xdtsM.js +261 -0
- package/dist/dataset-profile-Dk6xdtsM.js.map +1 -0
- package/dist/{designer-Byw45cUM.js → designer-CFOvOmLn.js} +3 -3
- package/dist/designer-CFOvOmLn.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-BWSglfAb-ktaj6Ci9.js +2773 -0
- package/dist/designer-blueprint-workbench-panel-BWSglfAb-ktaj6Ci9.js.map +1 -0
- package/dist/{designer-dataset-controller-CPytVNBK-DWL3SRTP.js → designer-dataset-controller-DdbY4ILC-CMdGdGbr.js} +1471 -1158
- package/dist/designer-dataset-controller-DdbY4ILC-CMdGdGbr.js.map +1 -0
- package/dist/{designer-ui-primitives-CH4RNiMa-BNXQwJPZ.js → designer-field-primitives-Crn464Qg-Bi7q8s5J.js} +914 -345
- package/dist/designer-field-primitives-Crn464Qg-Bi7q8s5J.js.map +1 -0
- package/dist/designer-left-panel-groups-dom-DFdLWxxY-BarlWMLY.js +1265 -0
- package/dist/designer-left-panel-groups-dom-DFdLWxxY-BarlWMLY.js.map +1 -0
- package/dist/designer.js +5 -5
- package/dist/dist-B2bW2Tru.js +3305 -0
- package/dist/dist-B2bW2Tru.js.map +1 -0
- package/dist/{dist-BHTClwId.js → dist-CHK9BTXX.js} +9148 -6234
- package/dist/dist-CHK9BTXX.js.map +1 -0
- package/dist/engine.js +5 -4
- package/dist/fragment-B-oP0Fru.js +393 -0
- package/dist/fragment-B-oP0Fru.js.map +1 -0
- package/dist/host-kit.js +4172 -102
- package/dist/host-kit.js.map +1 -1
- package/dist/{host-resource-selection-5Cf_gclK-Sv4Z8UXS.js → host-resource-selection-CWrPLVOc-DPDq3jau.js} +1233 -937
- package/dist/host-resource-selection-CWrPLVOc-DPDq3jau.js.map +1 -0
- package/dist/host-tokens.css +12 -12
- package/dist/index.js +10 -10
- package/dist/legibility-CS28ivEz.js +12 -0
- package/dist/legibility-CS28ivEz.js.map +1 -0
- package/dist/level-scale-CwHqFEVd.js +139 -0
- package/dist/level-scale-CwHqFEVd.js.map +1 -0
- package/dist/{manager-B2CZ2b5I.js → manager-CeB4Jnr9.js} +20 -10
- package/dist/manager-CeB4Jnr9.js.map +1 -0
- package/dist/material-DeVkzSoT.js +12 -0
- package/dist/{material-BPlvEmDi.js.map → material-DeVkzSoT.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-BM888PtC.js +768 -0
- package/dist/migrate-document-BM888PtC.js.map +1 -0
- package/dist/parse-Ji7kE9ZT.js +2313 -0
- package/dist/parse-Ji7kE9ZT.js.map +1 -0
- package/dist/{parse-B0hwp_yj.js → parse-aZat9tAS.js} +69 -61
- package/dist/{parse-B0hwp_yj.js.map → parse-aZat9tAS.js.map} +1 -1
- package/dist/parse-parts-qzl4suzk.js +42 -0
- package/dist/parse-parts-qzl4suzk.js.map +1 -0
- package/dist/{plugin-B9Xxtw7G.js → plugin-CstHQ5ws.js} +140 -94
- package/dist/plugin-CstHQ5ws.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-DWifuHi1.js +4206 -0
- package/dist/plugin-package-DWifuHi1.js.map +1 -0
- package/dist/{plugin-registration-BjS_CXJU.js → plugin-registration-DTwBvnHX.js} +4 -4
- package/dist/{plugin-registration-BjS_CXJU.js.map → plugin-registration-DTwBvnHX.js.map} +1 -1
- package/dist/plugin-sdk.js +6 -6
- package/dist/{plugins-B9bwk-t6.js → plugins-QDL0yIql.js} +2 -2
- package/dist/{plugins-B9bwk-t6.js.map → plugins-QDL0yIql.js.map} +1 -1
- package/dist/plugins.js +8 -8
- package/dist/renderer.js +1 -1
- package/dist/runtime-dispatch-C0gyIrTv.js +479 -0
- package/dist/runtime-dispatch-C0gyIrTv.js.map +1 -0
- package/dist/runtime-simulate-aSYO9yDX.js +147 -0
- package/dist/runtime-simulate-aSYO9yDX.js.map +1 -0
- package/dist/{src-Bm7u11mN-BMeb9fvV.js → src-Bm7u11mN-Bi1hDVkh.js} +30 -30
- package/dist/{src-Bm7u11mN-BMeb9fvV.js.map → src-Bm7u11mN-Bi1hDVkh.js.map} +1 -1
- package/dist/state-preset-DtpygJOH.js +22 -0
- package/dist/state-preset-DtpygJOH.js.map +1 -0
- package/dist/{text-BVzTcUas.js → text-BSTz0pFQ.js} +454 -360
- package/dist/text-BSTz0pFQ.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-XkLuckGV.js} +2 -2
- package/dist/{value-ref-y4_YKUP5.js.map → value-ref-XkLuckGV.js.map} +1 -1
- package/dist/{viewer-CrJupI8I-DZZfdHXr.js → viewer-CrJupI8I-BJiz1cvW.js} +5 -5
- package/dist/{viewer-CrJupI8I-DZZfdHXr.js.map → viewer-CrJupI8I-BJiz1cvW.js.map} +1 -1
- package/dist/viewer-auto-register.js +2 -2
- package/dist/viewer.js +2 -2
- package/dist/viewport-BNIRWjiT.js +1207 -0
- package/dist/viewport-BNIRWjiT.js.map +1 -0
- package/package.json +12 -12
- 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 +0 -1050
- 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
|
@@ -0,0 +1,1207 @@
|
|
|
1
|
+
import { i as e, m as t } from "./image-url-D6mUcjY1.js";
|
|
2
|
+
import { b as n, f as r, n as i, y as a } from "./parse-Ji7kE9ZT.js";
|
|
3
|
+
import { t as o } from "./equality-DjZ9cv4u.js";
|
|
4
|
+
import { o as s, t as c } from "./theme-CcBXf4Ay.js";
|
|
5
|
+
import { c as l, i as u, l as d, n as f, o as p, r as m, t as h } from "./hierarchy-BQZrZWbC.js";
|
|
6
|
+
//#region ../core/dist/data/data-source-dependents.js
|
|
7
|
+
function g(e, t) {
|
|
8
|
+
let n = new Set(t);
|
|
9
|
+
if (n.size === 0) return [];
|
|
10
|
+
let r = [];
|
|
11
|
+
for (let t of e.components) {
|
|
12
|
+
let e = t.dataValue;
|
|
13
|
+
e?.kind === "data-source-field" && n.has(e.dataSourceId) && r.push(t.id);
|
|
14
|
+
}
|
|
15
|
+
return r;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region ../core/dist/internal/diagnostics.js
|
|
19
|
+
function _(e) {
|
|
20
|
+
return t(e);
|
|
21
|
+
}
|
|
22
|
+
function v(e, t) {
|
|
23
|
+
return {
|
|
24
|
+
severity: e.severity,
|
|
25
|
+
code: e.code,
|
|
26
|
+
path: [...t, ...e.path],
|
|
27
|
+
message: e.message
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region ../core/dist/validation/invariant-error.js
|
|
32
|
+
var y = class extends Error {
|
|
33
|
+
name = "ScreenCoreInvariantError";
|
|
34
|
+
diagnostics;
|
|
35
|
+
constructor(e) {
|
|
36
|
+
super("Screen document failed Core semantic validation."), this.diagnostics = e;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region ../core/dist/internal/preconditions.js
|
|
41
|
+
function b(e, t) {
|
|
42
|
+
if (!Number.isFinite(e)) throw RangeError(`${t} must be a finite number.`);
|
|
43
|
+
}
|
|
44
|
+
function x(e) {
|
|
45
|
+
return Object.is(e, -0) ? 0 : e;
|
|
46
|
+
}
|
|
47
|
+
function ee(e) {
|
|
48
|
+
return {
|
|
49
|
+
x: x(e.x),
|
|
50
|
+
y: x(e.y)
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region ../core/dist/geometry/bounds.js
|
|
55
|
+
function S(e) {
|
|
56
|
+
let { position: { x: t, y: n }, size: { width: r, height: i }, rotation: a } = e;
|
|
57
|
+
if (!Number.isFinite(t) || !Number.isFinite(n) || !Number.isFinite(r) || !Number.isFinite(i) || !Number.isFinite(a) || t < -1e6 || t > 1e6 || n < -1e6 || n > 1e6 || r <= 0 || i <= 0 || r > 1e6 || i > 1e6 || a < -180 || a >= 180) return null;
|
|
58
|
+
let o = t + r / 2, s = n + i / 2, c = r / 2, l = i / 2, u = a * Math.PI / 180, d = Math.cos(u), f = Math.sin(u), p = [
|
|
59
|
+
{
|
|
60
|
+
x: -c,
|
|
61
|
+
y: -l
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
x: c,
|
|
65
|
+
y: -l
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
x: c,
|
|
69
|
+
y: l
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
x: -c,
|
|
73
|
+
y: l
|
|
74
|
+
}
|
|
75
|
+
], m = Infinity, h = Infinity, g = -Infinity, _ = -Infinity;
|
|
76
|
+
for (let e of p) {
|
|
77
|
+
let t = e.x, n = e.y, r = t * d - n * f, i = t * f + n * d, a = o + r, c = s + i;
|
|
78
|
+
if (!Number.isFinite(a) || !Number.isFinite(c)) return null;
|
|
79
|
+
a < m && (m = a), a > g && (g = a), c < h && (h = c), c > _ && (_ = c);
|
|
80
|
+
}
|
|
81
|
+
let v = g - m, y = _ - h;
|
|
82
|
+
return !Number.isFinite(v) || !Number.isFinite(y) || v <= 0 || y <= 0 ? null : {
|
|
83
|
+
left: x(m),
|
|
84
|
+
top: x(h),
|
|
85
|
+
right: x(g),
|
|
86
|
+
bottom: x(_)
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region ../core/dist/validation/validate-semantics.js
|
|
91
|
+
var te = 256, C = /* @__PURE__ */ new WeakSet();
|
|
92
|
+
function w(e) {
|
|
93
|
+
if (C.has(e)) return ne;
|
|
94
|
+
let t = re(e);
|
|
95
|
+
return t.length === 0 && C.add(e), t;
|
|
96
|
+
}
|
|
97
|
+
var ne = [];
|
|
98
|
+
function re(e) {
|
|
99
|
+
let t = h(e), n = [];
|
|
100
|
+
for (let r = 0; r < e.components.length; r++) {
|
|
101
|
+
let i = e.components[r], a = f(t, i.id);
|
|
102
|
+
a > te && n.push({
|
|
103
|
+
severity: "error",
|
|
104
|
+
code: "CORE_INVARIANT_VIOLATION",
|
|
105
|
+
path: [
|
|
106
|
+
"components",
|
|
107
|
+
r,
|
|
108
|
+
"parentId"
|
|
109
|
+
],
|
|
110
|
+
message: `Component ancestor depth ${a} exceeds the maximum of ${te}.`
|
|
111
|
+
}), S(i) === null && n.push({
|
|
112
|
+
severity: "error",
|
|
113
|
+
code: "CORE_GEOMETRY_INVALID",
|
|
114
|
+
path: ["components", r],
|
|
115
|
+
message: "Component rotated bounds must be finite with positive width and height."
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
return _(n);
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region ../core/dist/internal/document.js
|
|
122
|
+
function T(e) {
|
|
123
|
+
let t = w(e);
|
|
124
|
+
if (t.length > 0) throw new y(t);
|
|
125
|
+
}
|
|
126
|
+
function ie(e, t) {
|
|
127
|
+
let n = i(e, t);
|
|
128
|
+
if (!n.ok) return {
|
|
129
|
+
ok: !1,
|
|
130
|
+
diagnostics: n.diagnostics
|
|
131
|
+
};
|
|
132
|
+
let r = w(n.value);
|
|
133
|
+
return r.length > 0 ? {
|
|
134
|
+
ok: !1,
|
|
135
|
+
diagnostics: r
|
|
136
|
+
} : {
|
|
137
|
+
ok: !0,
|
|
138
|
+
document: n.value
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region ../core/dist/commands/command-input.js
|
|
143
|
+
function E(e, t) {
|
|
144
|
+
let n = new Set(t), r = new Set(e.components.map((e) => e.id));
|
|
145
|
+
if (![...n].some((e) => !r.has(e))) return e.components.filter((e) => n.has(e.id)).map(({ id: e }) => e);
|
|
146
|
+
}
|
|
147
|
+
function ae(e, t) {
|
|
148
|
+
return {
|
|
149
|
+
...e,
|
|
150
|
+
...t
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function oe(e, t) {
|
|
154
|
+
return D(e) && Object.keys(e).every((e) => t.has(e));
|
|
155
|
+
}
|
|
156
|
+
function se(e) {
|
|
157
|
+
return D(e) && Object.keys(e).length === 1 && e.status !== void 0;
|
|
158
|
+
}
|
|
159
|
+
function D(e) {
|
|
160
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
161
|
+
}
|
|
162
|
+
function O(e) {
|
|
163
|
+
return Array.isArray(e) && e.every((e) => typeof e == "string");
|
|
164
|
+
}
|
|
165
|
+
//#endregion
|
|
166
|
+
//#region ../core/dist/commands/command-result.js
|
|
167
|
+
function k(e, t, n) {
|
|
168
|
+
let r = ie(t, e);
|
|
169
|
+
return r.ok ? A(r.document, n) : j(e, r.diagnostics);
|
|
170
|
+
}
|
|
171
|
+
function A(e, t) {
|
|
172
|
+
return {
|
|
173
|
+
ok: !0,
|
|
174
|
+
document: e,
|
|
175
|
+
changedComponentIds: t,
|
|
176
|
+
diagnostics: []
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
function j(e, t) {
|
|
180
|
+
return {
|
|
181
|
+
ok: !1,
|
|
182
|
+
document: e,
|
|
183
|
+
diagnostics: _(Array.isArray(t) ? t : [t])
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
function M(e, t) {
|
|
187
|
+
return [N("CORE_COMMAND_INVALID", t, e)];
|
|
188
|
+
}
|
|
189
|
+
function N(e, t, n) {
|
|
190
|
+
return {
|
|
191
|
+
severity: "error",
|
|
192
|
+
code: e,
|
|
193
|
+
path: t,
|
|
194
|
+
message: n
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region ../core/dist/commands/apply-collection-commands.js
|
|
199
|
+
function ce(e, t) {
|
|
200
|
+
if (!Array.isArray(t) || t.length === 0) return j(e, M("Data sources to add must be a non-empty array.", ["dataSources"]));
|
|
201
|
+
let n = P(t, new Set((e.dataSources ?? []).map((e) => e.id)));
|
|
202
|
+
if (n !== void 0) return j(e, M("Data source id already exists.", [
|
|
203
|
+
"dataSources",
|
|
204
|
+
n,
|
|
205
|
+
"id"
|
|
206
|
+
]));
|
|
207
|
+
let r = k(e, {
|
|
208
|
+
...e,
|
|
209
|
+
dataSources: [...e.dataSources ?? [], ...t]
|
|
210
|
+
}, []);
|
|
211
|
+
if (!r.ok) return r;
|
|
212
|
+
let i = t.map((e) => e.id);
|
|
213
|
+
return {
|
|
214
|
+
...r,
|
|
215
|
+
changedComponentIds: g(r.document, i)
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
function le(e, t, n) {
|
|
219
|
+
if (typeof t != "string" || !a(t)) return j(e, M("Data source id is invalid.", ["dataSourceId"]));
|
|
220
|
+
if (!D(n) || Object.keys(n).length === 0) return j(e, M("Params patch must be a non-empty object.", ["params"]));
|
|
221
|
+
let r = e.dataSources ?? [], i = r.findIndex((e) => e.id === t), s = r[i];
|
|
222
|
+
if (s === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["dataSourceId"], "Data source target does not exist."));
|
|
223
|
+
let c = { ...s.params };
|
|
224
|
+
for (let [e, t] of Object.entries(n)) t === null ? delete c[e] : c[e] = t;
|
|
225
|
+
if (o(s.params, c)) return A(e, []);
|
|
226
|
+
let l = r.map((e, t) => t === i ? {
|
|
227
|
+
...e,
|
|
228
|
+
params: c
|
|
229
|
+
} : e), u = k(e, {
|
|
230
|
+
...e,
|
|
231
|
+
dataSources: l
|
|
232
|
+
}, []);
|
|
233
|
+
return u.ok ? {
|
|
234
|
+
...u,
|
|
235
|
+
changedComponentIds: g(u.document, [t])
|
|
236
|
+
} : u;
|
|
237
|
+
}
|
|
238
|
+
function ue(e, t) {
|
|
239
|
+
if (!Array.isArray(t) || t.length === 0) return j(e, M("Variables to add must be a non-empty array.", ["variables"]));
|
|
240
|
+
let n = P(t, new Set(e.variables.map((e) => e.id)));
|
|
241
|
+
return n === void 0 ? k(e, {
|
|
242
|
+
...e,
|
|
243
|
+
variables: [...e.variables, ...t]
|
|
244
|
+
}, []) : j(e, M("Variable id already exists.", [
|
|
245
|
+
"variables",
|
|
246
|
+
n,
|
|
247
|
+
"id"
|
|
248
|
+
]));
|
|
249
|
+
}
|
|
250
|
+
function de(e, t) {
|
|
251
|
+
let n = F(t);
|
|
252
|
+
if (n === void 0) return j(e, M("Variable ids must be a non-empty array of ids.", ["variableIds"]));
|
|
253
|
+
let r = new Set(e.variables.map((e) => e.id)), i = n.findIndex((e) => !r.has(e));
|
|
254
|
+
if (i >= 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["variableIds", i], "Variable target does not exist."));
|
|
255
|
+
let a = new Set(n);
|
|
256
|
+
return k(e, {
|
|
257
|
+
...e,
|
|
258
|
+
variables: e.variables.filter((e) => !a.has(e.id))
|
|
259
|
+
}, []);
|
|
260
|
+
}
|
|
261
|
+
function fe(e, t, n) {
|
|
262
|
+
if (!Array.isArray(t) || !Array.isArray(n) || t.length + n.length === 0) return j(e, M("Blueprint nodes and edges must be arrays, not both empty.", []));
|
|
263
|
+
let r = P(t, new Set(e.blueprint.nodes.map((e) => e.id)));
|
|
264
|
+
if (r !== void 0) return j(e, M("Blueprint node id already exists.", [
|
|
265
|
+
"nodes",
|
|
266
|
+
r,
|
|
267
|
+
"id"
|
|
268
|
+
]));
|
|
269
|
+
let i = P(n, new Set(e.blueprint.edges.map((e) => e.id)));
|
|
270
|
+
if (i !== void 0) return j(e, M("Blueprint edge id already exists.", [
|
|
271
|
+
"edges",
|
|
272
|
+
i,
|
|
273
|
+
"id"
|
|
274
|
+
]));
|
|
275
|
+
let a = {
|
|
276
|
+
...e.blueprint,
|
|
277
|
+
nodes: [...e.blueprint.nodes, ...t],
|
|
278
|
+
edges: [...e.blueprint.edges, ...n]
|
|
279
|
+
};
|
|
280
|
+
return k(e, {
|
|
281
|
+
...e,
|
|
282
|
+
blueprint: a
|
|
283
|
+
}, []);
|
|
284
|
+
}
|
|
285
|
+
function pe(e, t, n) {
|
|
286
|
+
let r = F(t, !0), i = F(n, !0);
|
|
287
|
+
if (r === void 0 || i === void 0 || r.length + i.length === 0) return j(e, M("Blueprint node and edge ids must be arrays, not both empty.", []));
|
|
288
|
+
let a = new Set(e.blueprint.nodes.map((e) => e.id)), o = r.findIndex((e) => !a.has(e));
|
|
289
|
+
if (o >= 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["nodeIds", o], "Blueprint node does not exist."));
|
|
290
|
+
let s = new Set(e.blueprint.edges.map((e) => e.id)), c = i.findIndex((e) => !s.has(e));
|
|
291
|
+
if (c >= 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["edgeIds", c], "Blueprint edge does not exist."));
|
|
292
|
+
let l = new Set(r), u = new Set(i), d = (e) => l.has(e.from.node) || l.has(e.to.node), f = e.blueprint.layout, p = {
|
|
293
|
+
...e.blueprint,
|
|
294
|
+
nodes: e.blueprint.nodes.filter((e) => !l.has(e.id)),
|
|
295
|
+
edges: e.blueprint.edges.filter((e) => !u.has(e.id) && !d(e)),
|
|
296
|
+
...f === void 0 ? {} : { layout: {
|
|
297
|
+
...f,
|
|
298
|
+
nodes: f.nodes.filter((e) => !l.has(e.id))
|
|
299
|
+
} }
|
|
300
|
+
};
|
|
301
|
+
return k(e, {
|
|
302
|
+
...e,
|
|
303
|
+
blueprint: p
|
|
304
|
+
}, []);
|
|
305
|
+
}
|
|
306
|
+
function P(e, t) {
|
|
307
|
+
let n = new Set(t);
|
|
308
|
+
for (let [t, r] of e.entries()) {
|
|
309
|
+
let e = D(r) && typeof r.id == "string" ? r.id : void 0;
|
|
310
|
+
if (e === void 0 || n.has(e)) return t;
|
|
311
|
+
n.add(e);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
function F(e, t = !1) {
|
|
315
|
+
if (!Array.isArray(e) || !t && e.length === 0 || e.some((e) => typeof e != "string")) return;
|
|
316
|
+
let n = e;
|
|
317
|
+
return new Set(n).size === n.length ? n : void 0;
|
|
318
|
+
}
|
|
319
|
+
//#endregion
|
|
320
|
+
//#region ../core/dist/commands/apply-component-commands.js
|
|
321
|
+
var me = /* @__PURE__ */ new Set([
|
|
322
|
+
"name",
|
|
323
|
+
"position",
|
|
324
|
+
"size",
|
|
325
|
+
"rotation",
|
|
326
|
+
"zIndex",
|
|
327
|
+
"status",
|
|
328
|
+
"props",
|
|
329
|
+
"style",
|
|
330
|
+
"states",
|
|
331
|
+
"dataSource",
|
|
332
|
+
"dataValue",
|
|
333
|
+
"dataBinding",
|
|
334
|
+
"belowSubCanvas"
|
|
335
|
+
]);
|
|
336
|
+
function he(e, t) {
|
|
337
|
+
if (!D(t)) return j(e, M("Component must be an object.", ["component"]));
|
|
338
|
+
let n = h(e);
|
|
339
|
+
return typeof t.id == "string" ? n.byId.has(t.id) ? j(e, N("CORE_COMMAND_INVALID", ["component", "id"], "Component id already exists.")) : t.parentId !== null && !n.byId.has(t.parentId) ? j(e, N("CORE_COMMAND_PARENT_INVALID", ["component", "parentId"], "Component parent does not exist.")) : t.parentId !== null && d(n, t.parentId) ? j(e, N("CORE_COMMAND_TARGET_LOCKED", ["component", "parentId"], "Component parent is locked.")) : k(e, {
|
|
340
|
+
...e,
|
|
341
|
+
components: [...e.components, t]
|
|
342
|
+
}, [t.id]) : j(e, M("Component id must be a string.", ["component", "id"]));
|
|
343
|
+
}
|
|
344
|
+
function ge(e, t, n) {
|
|
345
|
+
if (!O(t)) return j(e, M("Component ids must be a string array.", ["componentIds"]));
|
|
346
|
+
if (!oe(n, me) || Object.keys(n).length === 0) return j(e, M("Component patch must contain known fields.", ["patch"]));
|
|
347
|
+
let r = E(e, t);
|
|
348
|
+
if (r === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["componentIds"], "One or more components do not exist."));
|
|
349
|
+
if (r.length === 0) return A(e, []);
|
|
350
|
+
let i = h(e), a = r.find((e) => d(i, e));
|
|
351
|
+
if (a !== void 0 && !se(n)) return j(e, N("CORE_COMMAND_TARGET_LOCKED", ["componentIds"], `Component "${a}" is locked.`));
|
|
352
|
+
let s = new Set(r), c = e.components.map((e) => {
|
|
353
|
+
if (!s.has(e.id)) return e;
|
|
354
|
+
let t = ae(e, n);
|
|
355
|
+
return "dataValue" in n && n.dataValue === null && delete t.dataValue, "belowSubCanvas" in n && n.belowSubCanvas === null && delete t.belowSubCanvas, "states" in n && n.states === null && delete t.states, t;
|
|
356
|
+
}), l = r.filter((e) => {
|
|
357
|
+
let t = i.byId.get(e);
|
|
358
|
+
return !o(t.component, c[t.index]);
|
|
359
|
+
});
|
|
360
|
+
return l.length === 0 ? A(e, []) : k(e, {
|
|
361
|
+
...e,
|
|
362
|
+
components: c
|
|
363
|
+
}, l);
|
|
364
|
+
}
|
|
365
|
+
function _e(e, t) {
|
|
366
|
+
if (!O(t)) return j(e, M("Component ids must be a string array.", ["componentIds"]));
|
|
367
|
+
let n = E(e, t);
|
|
368
|
+
if (n === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["componentIds"], "One or more components do not exist."));
|
|
369
|
+
if (n.length === 0) return A(e, []);
|
|
370
|
+
let r = h(e), i = /* @__PURE__ */ new Set();
|
|
371
|
+
for (let e of n) {
|
|
372
|
+
i.add(e);
|
|
373
|
+
for (let t of u(r, e)) i.add(t);
|
|
374
|
+
}
|
|
375
|
+
let a = e.components.filter((e) => i.has(e.id)).map(({ id: e }) => e), o = a.find((e) => d(r, e));
|
|
376
|
+
return o === void 0 ? k(e, {
|
|
377
|
+
...e,
|
|
378
|
+
components: e.components.filter((e) => !i.has(e.id))
|
|
379
|
+
}, a) : j(e, N("CORE_COMMAND_TARGET_LOCKED", ["componentIds"], `Component "${o}" is locked.`));
|
|
380
|
+
}
|
|
381
|
+
function ve(e, t, n) {
|
|
382
|
+
if (!O(t) || n !== null && typeof n != "string") return j(e, M("Reparent command fields are invalid.", []));
|
|
383
|
+
let r = E(e, t);
|
|
384
|
+
if (r === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["componentIds"], "One or more components do not exist."));
|
|
385
|
+
if (r.length === 0) return A(e, []);
|
|
386
|
+
let i = h(e), a = new Set(r), o = r.filter((e) => !m(i, e).some((e) => a.has(e)));
|
|
387
|
+
if (n !== null && !i.byId.has(n)) return j(e, N("CORE_COMMAND_PARENT_INVALID", ["parentId"], "New parent does not exist."));
|
|
388
|
+
let s = /* @__PURE__ */ new Set();
|
|
389
|
+
for (let e of o) {
|
|
390
|
+
s.add(e);
|
|
391
|
+
for (let t of u(i, e)) s.add(t);
|
|
392
|
+
}
|
|
393
|
+
if (n !== null && s.has(n)) return j(e, N("CORE_COMMAND_PARENT_INVALID", ["parentId"], "New parent cannot be a target or descendant."));
|
|
394
|
+
if (o.find((e) => d(i, e)) !== void 0 || n !== null && d(i, n)) return j(e, N("CORE_COMMAND_TARGET_LOCKED", [], "Reparenting crosses a locked component boundary."));
|
|
395
|
+
let c = o.filter((e) => i.byId.get(e).component.parentId !== n);
|
|
396
|
+
if (c.length === 0) return A(e, []);
|
|
397
|
+
let l = new Set(c);
|
|
398
|
+
return k(e, {
|
|
399
|
+
...e,
|
|
400
|
+
components: e.components.map((e) => {
|
|
401
|
+
if (!l.has(e.id)) return e;
|
|
402
|
+
if (n === null) return {
|
|
403
|
+
...e,
|
|
404
|
+
parentId: n
|
|
405
|
+
};
|
|
406
|
+
let { canvasId: t, belowSubCanvas: r, ...i } = e;
|
|
407
|
+
return {
|
|
408
|
+
...i,
|
|
409
|
+
parentId: n
|
|
410
|
+
};
|
|
411
|
+
})
|
|
412
|
+
}, c);
|
|
413
|
+
}
|
|
414
|
+
function ye(e, t, n) {
|
|
415
|
+
if (!O(t) || n !== null && typeof n != "string") return j(e, M("Move command fields are invalid.", []));
|
|
416
|
+
let r = n === null ? void 0 : (e.subCanvases ?? []).find((e) => e.id === n);
|
|
417
|
+
if (n !== null && r === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["canvasId"], "Target sub canvas does not exist."));
|
|
418
|
+
let i = E(e, t);
|
|
419
|
+
if (i === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["componentIds"], "One or more components do not exist."));
|
|
420
|
+
if (i.length === 0) return A(e, []);
|
|
421
|
+
let a = h(e);
|
|
422
|
+
if (i.find((e) => a.byId.get(e).component.parentId !== null) !== void 0) return j(e, M("Only root components can move between canvases.", ["componentIds"]));
|
|
423
|
+
let o = i.find((e) => d(a, e));
|
|
424
|
+
if (o !== void 0) return j(e, N("CORE_COMMAND_TARGET_LOCKED", ["componentIds"], `Component "${o}" is locked.`));
|
|
425
|
+
let s = new Set(i), c = [], l = e.components.map((e) => {
|
|
426
|
+
if (!s.has(e.id) || (e.canvasId ?? null) === n) return e;
|
|
427
|
+
let { canvasId: t, belowSubCanvas: i, ...a } = e, o = n === null ? {
|
|
428
|
+
...a,
|
|
429
|
+
...e.belowSubCanvas === !0 ? { belowSubCanvas: !0 } : {}
|
|
430
|
+
} : {
|
|
431
|
+
...a,
|
|
432
|
+
canvasId: n
|
|
433
|
+
};
|
|
434
|
+
if (r?.display === "popup") {
|
|
435
|
+
let t = I(e.position.x, 0, Math.max(0, r.width - e.size.width)), n = I(e.position.y, 0, Math.max(0, r.height - e.size.height));
|
|
436
|
+
(t !== e.position.x || n !== e.position.y) && (o = {
|
|
437
|
+
...o,
|
|
438
|
+
position: {
|
|
439
|
+
x: t,
|
|
440
|
+
y: n
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
return c.push(e.id), o;
|
|
445
|
+
});
|
|
446
|
+
return c.length === 0 ? A(e, []) : k(e, {
|
|
447
|
+
...e,
|
|
448
|
+
components: l
|
|
449
|
+
}, c);
|
|
450
|
+
}
|
|
451
|
+
function I(e, t, n) {
|
|
452
|
+
return Math.min(n, Math.max(t, e));
|
|
453
|
+
}
|
|
454
|
+
//#endregion
|
|
455
|
+
//#region ../core/dist/commands/apply-data-source-command.js
|
|
456
|
+
function be(e, t) {
|
|
457
|
+
if (!Array.isArray(t)) return j(e, M("Data sources must be an array.", ["dataSources"]));
|
|
458
|
+
let n = e.dataSources ?? [], r = new Map(n.map((e) => [e.id, e])), i = t.map((e) => {
|
|
459
|
+
let t = Se(e);
|
|
460
|
+
if (t === void 0) return e;
|
|
461
|
+
let n = r.get(t);
|
|
462
|
+
return n !== void 0 && o(n, e) ? n : e;
|
|
463
|
+
});
|
|
464
|
+
if (xe(n, i)) return A(e, []);
|
|
465
|
+
let a = k(e, {
|
|
466
|
+
...e,
|
|
467
|
+
dataSources: i
|
|
468
|
+
}, []);
|
|
469
|
+
if (!a.ok) return a;
|
|
470
|
+
let s = g(a.document, L(n, a.document.dataSources ?? []));
|
|
471
|
+
return {
|
|
472
|
+
...a,
|
|
473
|
+
changedComponentIds: s
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
function L(e, t) {
|
|
477
|
+
let n = new Map(e.map((e) => [e.id, e])), r = new Map(t.map((e) => [e.id, e])), i = [];
|
|
478
|
+
for (let [e, t] of n) {
|
|
479
|
+
let n = r.get(e);
|
|
480
|
+
(n === void 0 || !o(t, n)) && i.push(e);
|
|
481
|
+
}
|
|
482
|
+
for (let e of r.keys()) n.has(e) || i.push(e);
|
|
483
|
+
return i;
|
|
484
|
+
}
|
|
485
|
+
function xe(e, t) {
|
|
486
|
+
return e.length === t.length && t.every((t, n) => t === e[n]);
|
|
487
|
+
}
|
|
488
|
+
function Se(e) {
|
|
489
|
+
if (typeof e != "object" || !e || Array.isArray(e)) return;
|
|
490
|
+
let t = e.id;
|
|
491
|
+
return typeof t == "string" ? t : void 0;
|
|
492
|
+
}
|
|
493
|
+
//#endregion
|
|
494
|
+
//#region ../core/dist/commands/apply-variable-command.js
|
|
495
|
+
var Ce = /* @__PURE__ */ new Set([
|
|
496
|
+
"type",
|
|
497
|
+
"variableId",
|
|
498
|
+
"nextName"
|
|
499
|
+
]);
|
|
500
|
+
function we(e, t) {
|
|
501
|
+
if (!D(t) || Object.keys(t).some((e) => !Ce.has(e)) || t.type !== "rename-variable" || typeof t.variableId != "string" || typeof t.nextName != "string") return j(e, M("Rename variable command is invalid.", []));
|
|
502
|
+
if (!a(t.variableId)) return j(e, M("Variable id is invalid.", ["variableId"]));
|
|
503
|
+
if (!n(t.nextName)) return j(e, M("Next variable name is invalid.", ["nextName"]));
|
|
504
|
+
let r = e.variables.find((e) => e.id === t.variableId);
|
|
505
|
+
if (r === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["variableId"], "Variable target does not exist."));
|
|
506
|
+
if (r.name === t.nextName) return A(e, []);
|
|
507
|
+
if (e.variables.some((e) => e.name === t.nextName)) return j(e, M("Next variable name is already in use.", ["nextName"]));
|
|
508
|
+
let i = e.variables.map((e) => e === r ? {
|
|
509
|
+
...e,
|
|
510
|
+
name: t.nextName
|
|
511
|
+
} : e);
|
|
512
|
+
return k(e, {
|
|
513
|
+
...e,
|
|
514
|
+
variables: i
|
|
515
|
+
}, []);
|
|
516
|
+
}
|
|
517
|
+
//#endregion
|
|
518
|
+
//#region ../core/dist/commands/apply.js
|
|
519
|
+
var Te = new Set(r);
|
|
520
|
+
function Ee(e, t) {
|
|
521
|
+
return T(e), R(e, t);
|
|
522
|
+
}
|
|
523
|
+
function De(e, t) {
|
|
524
|
+
if (T(e), !D(t) || !Array.isArray(t.commands)) return {
|
|
525
|
+
ok: !1,
|
|
526
|
+
document: e,
|
|
527
|
+
failedCommandIndex: 0,
|
|
528
|
+
diagnostics: M("Transaction commands must be an array.", ["commands"])
|
|
529
|
+
};
|
|
530
|
+
if (t.commands.length > 1e3) return {
|
|
531
|
+
ok: !1,
|
|
532
|
+
document: e,
|
|
533
|
+
failedCommandIndex: 0,
|
|
534
|
+
diagnostics: [N("CORE_COMMAND_LIMIT_EXCEEDED", ["commands"], "Transaction exceeds 1000 commands.")]
|
|
535
|
+
};
|
|
536
|
+
let n = e;
|
|
537
|
+
for (let r = 0; r < t.commands.length; r++) {
|
|
538
|
+
let i = R(n, t.commands[r]);
|
|
539
|
+
if (!i.ok) return {
|
|
540
|
+
ok: !1,
|
|
541
|
+
document: e,
|
|
542
|
+
failedCommandIndex: r,
|
|
543
|
+
diagnostics: _(i.diagnostics.map((e) => v(e, ["commands", r])))
|
|
544
|
+
};
|
|
545
|
+
n = i.document;
|
|
546
|
+
}
|
|
547
|
+
return {
|
|
548
|
+
ok: !0,
|
|
549
|
+
document: n,
|
|
550
|
+
changedComponentIds: Ne(e, n),
|
|
551
|
+
diagnostics: []
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
function R(e, t) {
|
|
555
|
+
if (!D(t) || typeof t.type != "string") return j(e, M("Command must be an object with a known type.", []));
|
|
556
|
+
switch (t.type) {
|
|
557
|
+
case "update-canvas": return Oe(e, t.patch);
|
|
558
|
+
case "add-component": return he(e, t.component);
|
|
559
|
+
case "update-components": return ge(e, t.componentIds, t.patch);
|
|
560
|
+
case "remove-components": return _e(e, t.componentIds);
|
|
561
|
+
case "reparent-components": return ve(e, t.componentIds, t.parentId);
|
|
562
|
+
case "replace-blueprint": return Me(e, t.blueprint);
|
|
563
|
+
case "replace-data-sources": return be(e, t.dataSources);
|
|
564
|
+
case "replace-variables": return Ae(e, t.variables);
|
|
565
|
+
case "replace-sub-canvases": return je(e, t.subCanvases, t.startCanvasId);
|
|
566
|
+
case "move-components": return ye(e, t.componentIds, t.canvasId);
|
|
567
|
+
case "rename-variable": return we(e, t);
|
|
568
|
+
case "update-theme": return ke(e, t.patch);
|
|
569
|
+
case "add-data-sources": return ce(e, t.dataSources);
|
|
570
|
+
case "update-data-source-params": return le(e, t.dataSourceId, t.params);
|
|
571
|
+
case "add-variables": return ue(e, t.variables);
|
|
572
|
+
case "remove-variables": return de(e, t.variableIds);
|
|
573
|
+
case "add-blueprint-elements": return fe(e, t.nodes, t.edges);
|
|
574
|
+
case "remove-blueprint-elements": return pe(e, t.nodeIds, t.edgeIds);
|
|
575
|
+
default: return j(e, M("Command type is not supported.", ["type"]));
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
function Oe(e, t) {
|
|
579
|
+
if (!oe(t, Te)) return j(e, M("Canvas patch contains an unknown or invalid field.", ["patch"]));
|
|
580
|
+
if (Object.keys(t).length === 0) return A(e, []);
|
|
581
|
+
let n = { ...e.canvas };
|
|
582
|
+
for (let [e, r] of Object.entries(t)) r === null ? delete n[e] : n[e] = r;
|
|
583
|
+
return o(e.canvas, n) ? A(e, []) : k(e, {
|
|
584
|
+
...e,
|
|
585
|
+
canvas: n
|
|
586
|
+
}, []);
|
|
587
|
+
}
|
|
588
|
+
function ke(e, t) {
|
|
589
|
+
if (!D(t)) return j(e, M("Theme patch must be an object of slot colors.", ["patch"]));
|
|
590
|
+
for (let [n, r] of Object.entries(t)) if (!s(n) || typeof r != "string" || r.trim() === "" || r.length > 64) return j(e, M("Theme patch keys must be palette slots with color strings.", ["patch", n]));
|
|
591
|
+
let n = {
|
|
592
|
+
...e.theme?.palette,
|
|
593
|
+
...t
|
|
594
|
+
};
|
|
595
|
+
if (c.some((e) => typeof n[e] != "string")) return j(e, M("Theme patch must complete all palette slots.", ["patch"]));
|
|
596
|
+
let r = { palette: n };
|
|
597
|
+
return o(e.theme, r) ? A(e, []) : k(e, {
|
|
598
|
+
...e,
|
|
599
|
+
theme: r
|
|
600
|
+
}, []);
|
|
601
|
+
}
|
|
602
|
+
function Ae(e, t) {
|
|
603
|
+
return Array.isArray(t) ? o(e.variables, t) ? A(e, []) : k(e, {
|
|
604
|
+
...e,
|
|
605
|
+
variables: t
|
|
606
|
+
}, []) : j(e, M("Variables must be an array.", ["variables"]));
|
|
607
|
+
}
|
|
608
|
+
function je(e, t, n) {
|
|
609
|
+
if (!Array.isArray(t)) return j(e, M("Sub canvases must be an array.", ["subCanvases"]));
|
|
610
|
+
if (n != null && typeof n != "string") return j(e, M("startCanvasId must be a string or null.", ["startCanvasId"]));
|
|
611
|
+
let r = { ...e };
|
|
612
|
+
return t.length === 0 ? delete r.subCanvases : r.subCanvases = t, n === null ? delete r.startCanvasId : typeof n == "string" ? r.startCanvasId = n : e.startCanvasId !== void 0 && !t.some((t) => D(t) && t.id === e.startCanvasId && t.display === "page") && delete r.startCanvasId, o(e.subCanvases ?? [], t) && r.startCanvasId === e.startCanvasId ? A(e, []) : k(e, r, []);
|
|
613
|
+
}
|
|
614
|
+
function Me(e, t) {
|
|
615
|
+
return !D(t) || !Array.isArray(t.nodes) || !Array.isArray(t.edges) ? j(e, M("Blueprint must be a canonical object.", ["blueprint"])) : o(e.blueprint, t) ? A(e, []) : k(e, {
|
|
616
|
+
...e,
|
|
617
|
+
blueprint: t
|
|
618
|
+
}, []);
|
|
619
|
+
}
|
|
620
|
+
function Ne(e, t) {
|
|
621
|
+
let n = new Map(t.components.map((e) => [e.id, e])), r = new Map(e.components.map((e) => [e.id, e])), i = t.components.filter((e) => r.get(e.id) !== e && !o(r.get(e.id), e)).map(({ id: e }) => e), a = e.components.filter((e) => !n.has(e.id)).map(({ id: e }) => e), s = /* @__PURE__ */ new Set([...i, ...a]), c = g(t, L(e.dataSources ?? [], t.dataSources ?? [])).filter((e) => !s.has(e));
|
|
622
|
+
return c.length === 0 ? [...s] : [...s, ...c];
|
|
623
|
+
}
|
|
624
|
+
//#endregion
|
|
625
|
+
//#region ../core/dist/commands/parse-command.js
|
|
626
|
+
var Pe = /* @__PURE__ */ new Set([
|
|
627
|
+
"update-canvas",
|
|
628
|
+
"add-component",
|
|
629
|
+
"update-components",
|
|
630
|
+
"remove-components",
|
|
631
|
+
"reparent-components",
|
|
632
|
+
"replace-blueprint",
|
|
633
|
+
"replace-data-sources",
|
|
634
|
+
"replace-variables",
|
|
635
|
+
"replace-sub-canvases",
|
|
636
|
+
"move-components",
|
|
637
|
+
"rename-variable",
|
|
638
|
+
"update-theme",
|
|
639
|
+
"add-data-sources",
|
|
640
|
+
"update-data-source-params",
|
|
641
|
+
"add-variables",
|
|
642
|
+
"remove-variables",
|
|
643
|
+
"add-blueprint-elements",
|
|
644
|
+
"remove-blueprint-elements"
|
|
645
|
+
]), Fe = {
|
|
646
|
+
"update-canvas": /* @__PURE__ */ new Set(["type", "patch"]),
|
|
647
|
+
"add-component": /* @__PURE__ */ new Set(["type", "component"]),
|
|
648
|
+
"update-components": /* @__PURE__ */ new Set([
|
|
649
|
+
"type",
|
|
650
|
+
"componentIds",
|
|
651
|
+
"patch"
|
|
652
|
+
]),
|
|
653
|
+
"remove-components": /* @__PURE__ */ new Set(["type", "componentIds"]),
|
|
654
|
+
"reparent-components": /* @__PURE__ */ new Set([
|
|
655
|
+
"type",
|
|
656
|
+
"componentIds",
|
|
657
|
+
"parentId"
|
|
658
|
+
]),
|
|
659
|
+
"replace-blueprint": /* @__PURE__ */ new Set(["type", "blueprint"]),
|
|
660
|
+
"replace-data-sources": /* @__PURE__ */ new Set(["type", "dataSources"]),
|
|
661
|
+
"replace-variables": /* @__PURE__ */ new Set(["type", "variables"]),
|
|
662
|
+
"replace-sub-canvases": /* @__PURE__ */ new Set([
|
|
663
|
+
"type",
|
|
664
|
+
"subCanvases",
|
|
665
|
+
"startCanvasId"
|
|
666
|
+
]),
|
|
667
|
+
"move-components": /* @__PURE__ */ new Set([
|
|
668
|
+
"type",
|
|
669
|
+
"componentIds",
|
|
670
|
+
"canvasId"
|
|
671
|
+
]),
|
|
672
|
+
"rename-variable": /* @__PURE__ */ new Set([
|
|
673
|
+
"type",
|
|
674
|
+
"variableId",
|
|
675
|
+
"nextName"
|
|
676
|
+
]),
|
|
677
|
+
"update-theme": /* @__PURE__ */ new Set(["type", "patch"]),
|
|
678
|
+
"add-data-sources": /* @__PURE__ */ new Set(["type", "dataSources"]),
|
|
679
|
+
"update-data-source-params": /* @__PURE__ */ new Set([
|
|
680
|
+
"type",
|
|
681
|
+
"dataSourceId",
|
|
682
|
+
"params"
|
|
683
|
+
]),
|
|
684
|
+
"add-variables": /* @__PURE__ */ new Set(["type", "variables"]),
|
|
685
|
+
"remove-variables": /* @__PURE__ */ new Set(["type", "variableIds"]),
|
|
686
|
+
"add-blueprint-elements": /* @__PURE__ */ new Set([
|
|
687
|
+
"type",
|
|
688
|
+
"nodes",
|
|
689
|
+
"edges"
|
|
690
|
+
]),
|
|
691
|
+
"remove-blueprint-elements": /* @__PURE__ */ new Set([
|
|
692
|
+
"type",
|
|
693
|
+
"nodeIds",
|
|
694
|
+
"edgeIds"
|
|
695
|
+
])
|
|
696
|
+
}, Ie = { "replace-sub-canvases": /* @__PURE__ */ new Set(["startCanvasId"]) }, Le = 262144;
|
|
697
|
+
function Re(t) {
|
|
698
|
+
let n = e(t, { maxBytes: Le });
|
|
699
|
+
if (!n.ok) return n;
|
|
700
|
+
if (!D(n.value) || typeof n.value.type != "string") return {
|
|
701
|
+
ok: !1,
|
|
702
|
+
diagnostics: M("Command must be an object with a known type.", [])
|
|
703
|
+
};
|
|
704
|
+
let r = n.value.type;
|
|
705
|
+
if (!Pe.has(r)) return {
|
|
706
|
+
ok: !1,
|
|
707
|
+
diagnostics: M("Command type is not supported.", ["type"])
|
|
708
|
+
};
|
|
709
|
+
let i = Fe[r];
|
|
710
|
+
for (let e of Object.keys(n.value)) if (!i.has(e)) return {
|
|
711
|
+
ok: !1,
|
|
712
|
+
diagnostics: M("Command contains an unknown field.", [e])
|
|
713
|
+
};
|
|
714
|
+
for (let e of i) if (Ie[r]?.has(e) !== !0 && !Object.hasOwn(n.value, e)) return {
|
|
715
|
+
ok: !1,
|
|
716
|
+
diagnostics: M("Command field is required.", [e])
|
|
717
|
+
};
|
|
718
|
+
return {
|
|
719
|
+
ok: !0,
|
|
720
|
+
value: n.value,
|
|
721
|
+
diagnostics: []
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
//#endregion
|
|
725
|
+
//#region ../core/dist/data/sample-values.js
|
|
726
|
+
function ze(e) {
|
|
727
|
+
let t = [];
|
|
728
|
+
return e.components.forEach((e, n) => {
|
|
729
|
+
z(e.dataValue) && t.push({
|
|
730
|
+
path: [
|
|
731
|
+
"components",
|
|
732
|
+
n,
|
|
733
|
+
"dataValue"
|
|
734
|
+
],
|
|
735
|
+
owner: {
|
|
736
|
+
kind: "component",
|
|
737
|
+
id: e.id
|
|
738
|
+
}
|
|
739
|
+
});
|
|
740
|
+
}), (e.dataSources ?? []).forEach((e, n) => {
|
|
741
|
+
for (let [r, i] of Object.entries(e.params)) z(i) && t.push({
|
|
742
|
+
path: [
|
|
743
|
+
"dataSources",
|
|
744
|
+
n,
|
|
745
|
+
"params",
|
|
746
|
+
r
|
|
747
|
+
],
|
|
748
|
+
owner: {
|
|
749
|
+
kind: "data-source-param",
|
|
750
|
+
id: e.id,
|
|
751
|
+
param: r
|
|
752
|
+
}
|
|
753
|
+
});
|
|
754
|
+
}), e.variables.forEach((e, n) => {
|
|
755
|
+
z("value" in e ? e.value : void 0) && t.push({
|
|
756
|
+
path: [
|
|
757
|
+
"variables",
|
|
758
|
+
n,
|
|
759
|
+
"value"
|
|
760
|
+
],
|
|
761
|
+
owner: {
|
|
762
|
+
kind: "variable",
|
|
763
|
+
id: e.id
|
|
764
|
+
}
|
|
765
|
+
});
|
|
766
|
+
}), t;
|
|
767
|
+
}
|
|
768
|
+
function z(e) {
|
|
769
|
+
return typeof e == "object" && !!e && e.kind === "inline" && e.sample === !0;
|
|
770
|
+
}
|
|
771
|
+
//#endregion
|
|
772
|
+
//#region ../core/dist/diff/screen-diff.js
|
|
773
|
+
var Be = 80;
|
|
774
|
+
function Ve(e, t) {
|
|
775
|
+
let n = new Map(e.components.map((e) => [e.id, e])), r = new Map(t.components.map((e) => [e.id, e])), i = [];
|
|
776
|
+
for (let e of t.components) {
|
|
777
|
+
let t = n.get(e.id);
|
|
778
|
+
if (t === void 0) {
|
|
779
|
+
i.push({
|
|
780
|
+
componentId: e.id,
|
|
781
|
+
componentName: e.name,
|
|
782
|
+
kind: "added",
|
|
783
|
+
entries: []
|
|
784
|
+
});
|
|
785
|
+
continue;
|
|
786
|
+
}
|
|
787
|
+
let r = He(t, e);
|
|
788
|
+
r.length > 0 && i.push({
|
|
789
|
+
componentId: e.id,
|
|
790
|
+
componentName: e.name,
|
|
791
|
+
kind: "changed",
|
|
792
|
+
entries: r
|
|
793
|
+
});
|
|
794
|
+
}
|
|
795
|
+
for (let t of e.components) r.has(t.id) || i.push({
|
|
796
|
+
componentId: t.id,
|
|
797
|
+
componentName: t.name,
|
|
798
|
+
kind: "removed",
|
|
799
|
+
entries: []
|
|
800
|
+
});
|
|
801
|
+
return i;
|
|
802
|
+
}
|
|
803
|
+
function He(e, t) {
|
|
804
|
+
let n = [];
|
|
805
|
+
return V("type", e.type, t.type, n), V("name", e.name, t.name, n), V("parentId", e.parentId, t.parentId, n), V("position.x", e.position.x, t.position.x, n), V("position.y", e.position.y, t.position.y, n), V("size.width", e.size.width, t.size.width, n), V("size.height", e.size.height, t.size.height, n), V("rotation", e.rotation, t.rotation, n), V("zIndex", e.zIndex, t.zIndex, n), V("status", e.status, t.status, n), B("props", e.props, t.props, n), B("style", e.style, t.style, n), V("dataValue", e.dataValue ?? null, t.dataValue ?? null, n), V("dataSource", e.dataSource ?? null, t.dataSource ?? null, n), V("dataBinding", e.dataBinding ?? null, t.dataBinding ?? null, n), V("states", e.states ?? null, t.states ?? null, n), V("canvasId", e.canvasId, t.canvasId, n), V("belowSubCanvas", e.belowSubCanvas, t.belowSubCanvas, n), n;
|
|
806
|
+
}
|
|
807
|
+
function B(e, t, n, r) {
|
|
808
|
+
let i = [.../* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(n)])].sort();
|
|
809
|
+
for (let a of i) V(`${e}.${a}`, t[a], n[a], r);
|
|
810
|
+
}
|
|
811
|
+
function V(e, t, n, r) {
|
|
812
|
+
let i = H(t);
|
|
813
|
+
i !== H(n) && r.push({
|
|
814
|
+
path: e,
|
|
815
|
+
before: U(i),
|
|
816
|
+
after: U(H(n))
|
|
817
|
+
});
|
|
818
|
+
}
|
|
819
|
+
function H(e) {
|
|
820
|
+
return e === void 0 ? "null" : JSON.stringify(e) ?? "null";
|
|
821
|
+
}
|
|
822
|
+
function U(e) {
|
|
823
|
+
return e.length > Be ? `${e.slice(0, 79)}…` : e;
|
|
824
|
+
}
|
|
825
|
+
//#endregion
|
|
826
|
+
//#region ../core/dist/geometry/component-bounds.js
|
|
827
|
+
function W(e) {
|
|
828
|
+
let t = S(e);
|
|
829
|
+
if (t === null) throw RangeError("Component geometry must be finite with positive dimensions.");
|
|
830
|
+
return t;
|
|
831
|
+
}
|
|
832
|
+
function Ue(e) {
|
|
833
|
+
if (e.length === 0) return null;
|
|
834
|
+
let t = W(e[0]), n = t.left, r = t.top, i = t.right, a = t.bottom;
|
|
835
|
+
for (let t = 1; t < e.length; t++) {
|
|
836
|
+
let o = W(e[t]);
|
|
837
|
+
n = Math.min(n, o.left), r = Math.min(r, o.top), i = Math.max(i, o.right), a = Math.max(a, o.bottom);
|
|
838
|
+
}
|
|
839
|
+
return {
|
|
840
|
+
left: x(n),
|
|
841
|
+
top: x(r),
|
|
842
|
+
right: x(i),
|
|
843
|
+
bottom: x(a)
|
|
844
|
+
};
|
|
845
|
+
}
|
|
846
|
+
//#endregion
|
|
847
|
+
//#region ../core/dist/geometry/alignment.js
|
|
848
|
+
function We(e, t, n) {
|
|
849
|
+
if (t !== "x" && t !== "y") throw RangeError("Alignment axis must be x or y.");
|
|
850
|
+
if (n !== "start" && n !== "center" && n !== "end") throw RangeError("Alignment mode must be start, center, or end.");
|
|
851
|
+
let r = Ke(e);
|
|
852
|
+
if (r.length < 2) return [];
|
|
853
|
+
let i = r.filter(({ locked: e }) => e), a = i.length > 0 ? i : r, o = a.map(({ bounds: e }) => G(e, t)), s = a.map(({ bounds: e }) => K(e, t)), c = n === "start" ? Math.min(...o) : n === "end" ? Math.max(...s) : (Math.min(...o) + Math.max(...s)) / 2;
|
|
854
|
+
return r.filter(({ locked: e }) => !e).map(({ component: e, bounds: r }) => ({
|
|
855
|
+
componentId: e.id,
|
|
856
|
+
delta: Ye(t, c - Je(r, t, n))
|
|
857
|
+
})).filter(({ delta: e }) => e.x !== 0 || e.y !== 0).sort(Xe);
|
|
858
|
+
}
|
|
859
|
+
function Ge(e, t) {
|
|
860
|
+
if (t !== "x" && t !== "y") throw RangeError("Distribution axis must be x or y.");
|
|
861
|
+
let n = [...Ke(e)].sort((e, n) => {
|
|
862
|
+
let r = G(e.bounds, t) - G(n.bounds, t);
|
|
863
|
+
return r === 0 ? Ze(e.component.id, n.component.id) : r;
|
|
864
|
+
});
|
|
865
|
+
if (n.length < 2) return [];
|
|
866
|
+
let r = /* @__PURE__ */ new Set([0, n.length - 1]);
|
|
867
|
+
for (let e = 0; e < n.length; e++) n[e].locked && r.add(e);
|
|
868
|
+
let i = [...r].sort((e, t) => e - t), a = [];
|
|
869
|
+
for (let e = 1; e < i.length; e++) {
|
|
870
|
+
let r = i[e - 1], o = i[e], s = n.slice(r + 1, o);
|
|
871
|
+
if (s.length === 0) continue;
|
|
872
|
+
let c = n[r], l = n[o], u = (G(l.bounds, t) - K(c.bounds, t) - s.reduce((e, n) => e + qe(n.bounds, t), 0)) / (s.length + 1), d = K(c.bounds, t) + u;
|
|
873
|
+
for (let e of s) {
|
|
874
|
+
let n = d - G(e.bounds, t);
|
|
875
|
+
n !== 0 && a.push({
|
|
876
|
+
componentId: e.component.id,
|
|
877
|
+
delta: Ye(t, n)
|
|
878
|
+
}), d += qe(e.bounds, t) + u;
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
return a.sort(Xe);
|
|
882
|
+
}
|
|
883
|
+
function Ke(e) {
|
|
884
|
+
let t = h({ components: e });
|
|
885
|
+
return e.filter((e) => !l(t, e.id)).map((e) => ({
|
|
886
|
+
component: e,
|
|
887
|
+
bounds: W(e),
|
|
888
|
+
locked: d(t, e.id)
|
|
889
|
+
}));
|
|
890
|
+
}
|
|
891
|
+
function G(e, t) {
|
|
892
|
+
return t === "x" ? e.left : e.top;
|
|
893
|
+
}
|
|
894
|
+
function K(e, t) {
|
|
895
|
+
return t === "x" ? e.right : e.bottom;
|
|
896
|
+
}
|
|
897
|
+
function qe(e, t) {
|
|
898
|
+
return K(e, t) - G(e, t);
|
|
899
|
+
}
|
|
900
|
+
function Je(e, t, n) {
|
|
901
|
+
let r = G(e, t);
|
|
902
|
+
if (n === "start") return r;
|
|
903
|
+
let i = K(e, t);
|
|
904
|
+
return n === "end" ? i : r + (i - r) / 2;
|
|
905
|
+
}
|
|
906
|
+
function Ye(e, t) {
|
|
907
|
+
return e === "x" ? {
|
|
908
|
+
x: x(t),
|
|
909
|
+
y: 0
|
|
910
|
+
} : {
|
|
911
|
+
x: 0,
|
|
912
|
+
y: x(t)
|
|
913
|
+
};
|
|
914
|
+
}
|
|
915
|
+
function Xe(e, t) {
|
|
916
|
+
return Ze(e.componentId, t.componentId);
|
|
917
|
+
}
|
|
918
|
+
function Ze(e, t) {
|
|
919
|
+
return e < t ? -1 : +(e > t);
|
|
920
|
+
}
|
|
921
|
+
//#endregion
|
|
922
|
+
//#region ../core/dist/geometry/validation.js
|
|
923
|
+
function q(e, t) {
|
|
924
|
+
if (typeof e != "object" || !e) throw RangeError(`${t} must be a finite point.`);
|
|
925
|
+
b(e.x, `${t}.x`), b(e.y, `${t}.y`);
|
|
926
|
+
}
|
|
927
|
+
function Qe(e) {
|
|
928
|
+
if (typeof e != "object" || !e) throw RangeError("Rectangle must be an object.");
|
|
929
|
+
if (b(e.x, "rect.x"), b(e.y, "rect.y"), b(e.width, "rect.width"), b(e.height, "rect.height"), e.width <= 0 || e.height <= 0) throw RangeError("Rectangle dimensions must be positive.");
|
|
930
|
+
}
|
|
931
|
+
function $e(e) {
|
|
932
|
+
if (typeof e != "object" || !e || e.offset === null) throw RangeError("Viewport must contain a zoom and finite offset.");
|
|
933
|
+
if (e.zoom < .05 || e.zoom > 64) throw RangeError("Viewport zoom must be from 0.05 through 64.");
|
|
934
|
+
b(e.zoom, "viewport.zoom"), q(e.offset, "viewport.offset");
|
|
935
|
+
}
|
|
936
|
+
//#endregion
|
|
937
|
+
//#region ../core/dist/geometry/hit-testing.js
|
|
938
|
+
function et(e, t, n = {}) {
|
|
939
|
+
T(e), q(t, "point");
|
|
940
|
+
let r = n.minimumThickness ?? 0;
|
|
941
|
+
if (!Number.isFinite(r) || r < 0) throw RangeError("Hit test minimumThickness must be a non-negative finite number.");
|
|
942
|
+
let i = h(e), a = i.byId;
|
|
943
|
+
return [...p(e)].reverse().filter((e) => {
|
|
944
|
+
let n = a.get(e)?.component;
|
|
945
|
+
return n !== void 0 && !l(i, e) && nt(t, n, r);
|
|
946
|
+
});
|
|
947
|
+
}
|
|
948
|
+
function tt(e, t, n) {
|
|
949
|
+
if (T(e), Qe(t), n !== "intersect" && n !== "contain") throw RangeError("Query mode must be intersect or contain.");
|
|
950
|
+
let r = h(e);
|
|
951
|
+
return e.components.filter((e) => {
|
|
952
|
+
if (l(r, e.id)) return !1;
|
|
953
|
+
let i = rt(e);
|
|
954
|
+
return n === "contain" ? i.every((e) => st(e, t)) : it(i, t);
|
|
955
|
+
}).map(({ id: e }) => e);
|
|
956
|
+
}
|
|
957
|
+
function nt(e, t, n) {
|
|
958
|
+
let r = t.size.width, i = t.size.height, a = Math.max(0, n - r) / 2, o = Math.max(0, n - i) / 2, s = t.position.x + r / 2, c = t.position.y + i / 2, l = -t.rotation * Math.PI / 180, u = Math.cos(l), d = Math.sin(l), f = (e.x - s) * u - (e.y - c) * d + r / 2, p = (e.x - s) * d + (e.y - c) * u + i / 2;
|
|
959
|
+
return f >= -a && f <= r + a && p >= -o && p <= i + o;
|
|
960
|
+
}
|
|
961
|
+
function rt(e) {
|
|
962
|
+
W(e);
|
|
963
|
+
let t = e.position.x + e.size.width / 2, n = e.position.y + e.size.height / 2, r = e.size.width / 2, i = e.size.height / 2, a = e.rotation * Math.PI / 180, o = Math.cos(a), s = Math.sin(a);
|
|
964
|
+
return [
|
|
965
|
+
{
|
|
966
|
+
x: -r,
|
|
967
|
+
y: -i
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
x: r,
|
|
971
|
+
y: -i
|
|
972
|
+
},
|
|
973
|
+
{
|
|
974
|
+
x: r,
|
|
975
|
+
y: i
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
x: -r,
|
|
979
|
+
y: i
|
|
980
|
+
}
|
|
981
|
+
].map(({ x: e, y: r }) => ee({
|
|
982
|
+
x: t + e * o - r * s,
|
|
983
|
+
y: n + e * s + r * o
|
|
984
|
+
}));
|
|
985
|
+
}
|
|
986
|
+
function it(e, t) {
|
|
987
|
+
if (e.some((e) => st(e, t))) return !0;
|
|
988
|
+
let n = [
|
|
989
|
+
{
|
|
990
|
+
x: t.x,
|
|
991
|
+
y: t.y
|
|
992
|
+
},
|
|
993
|
+
{
|
|
994
|
+
x: t.x + t.width,
|
|
995
|
+
y: t.y
|
|
996
|
+
},
|
|
997
|
+
{
|
|
998
|
+
x: t.x + t.width,
|
|
999
|
+
y: t.y + t.height
|
|
1000
|
+
},
|
|
1001
|
+
{
|
|
1002
|
+
x: t.x,
|
|
1003
|
+
y: t.y + t.height
|
|
1004
|
+
}
|
|
1005
|
+
];
|
|
1006
|
+
if (n.some((t) => at(t, e))) return !0;
|
|
1007
|
+
for (let t = 0; t < e.length; t++) {
|
|
1008
|
+
let r = e[t], i = e[(t + 1) % e.length];
|
|
1009
|
+
for (let e = 0; e < n.length; e++) {
|
|
1010
|
+
let t = n[e], a = n[(e + 1) % n.length];
|
|
1011
|
+
if (ot(r, i, t, a)) return !0;
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
return !1;
|
|
1015
|
+
}
|
|
1016
|
+
function at(e, t) {
|
|
1017
|
+
let n = !1, r = !1;
|
|
1018
|
+
for (let i = 0; i < t.length; i++) {
|
|
1019
|
+
let a = t[i], o = t[(i + 1) % t.length], s = (o.x - a.x) * (e.y - a.y) - (o.y - a.y) * (e.x - a.x);
|
|
1020
|
+
n ||= s > 0, r ||= s < 0;
|
|
1021
|
+
}
|
|
1022
|
+
return !(n && r);
|
|
1023
|
+
}
|
|
1024
|
+
function ot(e, t, n, r) {
|
|
1025
|
+
let i = (e, t, n) => (t.x - e.x) * (n.y - e.y) - (t.y - e.y) * (n.x - e.x), a = i(e, t, n), o = i(e, t, r), s = i(n, r, e), c = i(n, r, t);
|
|
1026
|
+
return a === 0 && J(n, e, t) || o === 0 && J(r, e, t) || s === 0 && J(e, n, r) || c === 0 && J(t, n, r) ? !0 : a > 0 != o > 0 && s > 0 != c > 0;
|
|
1027
|
+
}
|
|
1028
|
+
function J(e, t, n) {
|
|
1029
|
+
return e.x >= Math.min(t.x, n.x) && e.x <= Math.max(t.x, n.x) && e.y >= Math.min(t.y, n.y) && e.y <= Math.max(t.y, n.y);
|
|
1030
|
+
}
|
|
1031
|
+
function st(e, t) {
|
|
1032
|
+
return e.x >= t.x && e.x <= t.x + t.width && e.y >= t.y && e.y <= t.y + t.height;
|
|
1033
|
+
}
|
|
1034
|
+
//#endregion
|
|
1035
|
+
//#region ../core/dist/hierarchy/query.js
|
|
1036
|
+
function ct(e, t) {
|
|
1037
|
+
return l(h(e), t);
|
|
1038
|
+
}
|
|
1039
|
+
function lt(e, t) {
|
|
1040
|
+
return d(h(e), t);
|
|
1041
|
+
}
|
|
1042
|
+
//#endregion
|
|
1043
|
+
//#region ../core/dist/history/history.js
|
|
1044
|
+
function ut(e) {
|
|
1045
|
+
return T(e), {
|
|
1046
|
+
past: [],
|
|
1047
|
+
present: e,
|
|
1048
|
+
future: []
|
|
1049
|
+
};
|
|
1050
|
+
}
|
|
1051
|
+
function dt(e, t, n = 100, r) {
|
|
1052
|
+
if (Y(e), T(t), _t(n), t === e.present) return e;
|
|
1053
|
+
let i = [...e.past, {
|
|
1054
|
+
before: e.present,
|
|
1055
|
+
after: t,
|
|
1056
|
+
...r === void 0 ? {} : { provenance: r }
|
|
1057
|
+
}];
|
|
1058
|
+
return {
|
|
1059
|
+
past: i.length > n ? i.slice(i.length - n) : i,
|
|
1060
|
+
present: t,
|
|
1061
|
+
future: []
|
|
1062
|
+
};
|
|
1063
|
+
}
|
|
1064
|
+
function ft(e) {
|
|
1065
|
+
Y(e);
|
|
1066
|
+
let t = e.past.at(-1);
|
|
1067
|
+
return t === void 0 ? e : {
|
|
1068
|
+
past: e.past.slice(0, -1),
|
|
1069
|
+
present: t.before,
|
|
1070
|
+
future: [gt(t), ...e.future]
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1073
|
+
function pt(e) {
|
|
1074
|
+
Y(e);
|
|
1075
|
+
let t = e.future[0];
|
|
1076
|
+
return t === void 0 ? e : {
|
|
1077
|
+
past: [...e.past, gt(t)],
|
|
1078
|
+
present: t.after,
|
|
1079
|
+
future: e.future.slice(1)
|
|
1080
|
+
};
|
|
1081
|
+
}
|
|
1082
|
+
function mt(e, t) {
|
|
1083
|
+
if (Y(e), !Number.isInteger(t) || t < 0 || t > e.past.length) throw RangeError("History revert target must be an integer from 0 through past.length.");
|
|
1084
|
+
let n = t === 0 ? e.past[0]?.before : e.past[t - 1]?.after;
|
|
1085
|
+
return n === void 0 || n === e.present ? e : {
|
|
1086
|
+
past: e.past.slice(0, t),
|
|
1087
|
+
present: n,
|
|
1088
|
+
future: [...e.past.slice(t), ...e.future]
|
|
1089
|
+
};
|
|
1090
|
+
}
|
|
1091
|
+
function ht(e) {
|
|
1092
|
+
Y(e);
|
|
1093
|
+
let t = e.past.length, n = [{
|
|
1094
|
+
index: 0,
|
|
1095
|
+
position: t === 0 ? "current" : "past"
|
|
1096
|
+
}];
|
|
1097
|
+
return e.past.forEach((e, r) => {
|
|
1098
|
+
let i = r + 1;
|
|
1099
|
+
n.push({
|
|
1100
|
+
index: i,
|
|
1101
|
+
position: i === t ? "current" : "past",
|
|
1102
|
+
...e.provenance === void 0 ? {} : { provenance: e.provenance }
|
|
1103
|
+
});
|
|
1104
|
+
}), e.future.forEach((e, r) => {
|
|
1105
|
+
n.push({
|
|
1106
|
+
index: t + r + 1,
|
|
1107
|
+
position: "future",
|
|
1108
|
+
...e.provenance === void 0 ? {} : { provenance: e.provenance }
|
|
1109
|
+
});
|
|
1110
|
+
}), n;
|
|
1111
|
+
}
|
|
1112
|
+
function gt(e) {
|
|
1113
|
+
return {
|
|
1114
|
+
before: e.before,
|
|
1115
|
+
after: e.after,
|
|
1116
|
+
...e.provenance === void 0 ? {} : { provenance: e.provenance }
|
|
1117
|
+
};
|
|
1118
|
+
}
|
|
1119
|
+
function Y(e) {
|
|
1120
|
+
if (typeof e.present != "object" || e.present === null || !Array.isArray(e.past) || !Array.isArray(e.future)) throw TypeError("Screen history state is corrupted.");
|
|
1121
|
+
}
|
|
1122
|
+
function _t(e) {
|
|
1123
|
+
if (!Number.isInteger(e) || e < 1 || e > 1e3) throw RangeError("History limit must be an integer from 1 through 1000.");
|
|
1124
|
+
}
|
|
1125
|
+
//#endregion
|
|
1126
|
+
//#region ../core/dist/state/interaction.js
|
|
1127
|
+
function vt(e, t, n) {
|
|
1128
|
+
T(n);
|
|
1129
|
+
let r = X(e.selectedComponentIds, n);
|
|
1130
|
+
if (typeof t != "object" || !t) return Z(e, r, e.focusedComponentId);
|
|
1131
|
+
switch (t.type) {
|
|
1132
|
+
case "replace-selection": return Z(e, Array.isArray(t.componentIds) ? X(t.componentIds, n) : r, t.focusedComponentId);
|
|
1133
|
+
case "toggle-selection": {
|
|
1134
|
+
if (typeof t.componentId != "string") return Z(e, r, e.focusedComponentId);
|
|
1135
|
+
let i = X([t.componentId], n)[0];
|
|
1136
|
+
if (i === void 0) return Z(e, r, e.focusedComponentId);
|
|
1137
|
+
let a = r.includes(i) ? r.filter((e) => e !== i) : X([...r, i], n);
|
|
1138
|
+
return Z(e, a, a.includes(i) ? i : e.focusedComponentId);
|
|
1139
|
+
}
|
|
1140
|
+
case "clear-selection": return Z(e, [], null);
|
|
1141
|
+
case "reconcile-document": return Z(e, r, e.focusedComponentId);
|
|
1142
|
+
default: return Z(e, r, e.focusedComponentId);
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
function X(e, t) {
|
|
1146
|
+
let n = new Set(e.filter((e) => typeof e == "string")), r = h(t);
|
|
1147
|
+
return t.components.filter((e) => n.has(e.id) && !l(r, e.id)).map(({ id: e }) => e);
|
|
1148
|
+
}
|
|
1149
|
+
function Z(e, t, n) {
|
|
1150
|
+
let r = typeof n == "string" && t.includes(n) ? n : null;
|
|
1151
|
+
return e.focusedComponentId === r && e.selectedComponentIds.length === t.length && e.selectedComponentIds.every((e, n) => e === t[n]) ? e : {
|
|
1152
|
+
selectedComponentIds: t,
|
|
1153
|
+
focusedComponentId: r
|
|
1154
|
+
};
|
|
1155
|
+
}
|
|
1156
|
+
//#endregion
|
|
1157
|
+
//#region ../core/dist/state/viewport.js
|
|
1158
|
+
var yt = {
|
|
1159
|
+
zoom: 1,
|
|
1160
|
+
offset: {
|
|
1161
|
+
x: 0,
|
|
1162
|
+
y: 0
|
|
1163
|
+
}
|
|
1164
|
+
};
|
|
1165
|
+
function bt(e, t) {
|
|
1166
|
+
if (!xt(e) || typeof t != "object" || !t) return e;
|
|
1167
|
+
switch (t.type) {
|
|
1168
|
+
case "reset": return e.zoom === 1 && e.offset.x === 0 && e.offset.y === 0 ? e : yt;
|
|
1169
|
+
case "pan-by": return $(t.delta) ? Q(e, e.zoom, {
|
|
1170
|
+
x: e.offset.x + t.delta.x,
|
|
1171
|
+
y: e.offset.y + t.delta.y
|
|
1172
|
+
}) : e;
|
|
1173
|
+
case "set-offset": return $(t.offset) ? Q(e, e.zoom, t.offset) : e;
|
|
1174
|
+
case "set-zoom":
|
|
1175
|
+
if (!St(t.zoom) || !$(t.anchor)) return e;
|
|
1176
|
+
let n = (t.anchor.x - e.offset.x) / e.zoom, r = (t.anchor.y - e.offset.y) / e.zoom;
|
|
1177
|
+
return Q(e, t.zoom, {
|
|
1178
|
+
x: t.anchor.x - n * t.zoom,
|
|
1179
|
+
y: t.anchor.y - r * t.zoom
|
|
1180
|
+
});
|
|
1181
|
+
default: return e;
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
function Q(e, t, n) {
|
|
1185
|
+
if (!Number.isFinite(n.x) || !Number.isFinite(n.y)) return e;
|
|
1186
|
+
let r = {
|
|
1187
|
+
x: x(n.x),
|
|
1188
|
+
y: x(n.y)
|
|
1189
|
+
};
|
|
1190
|
+
return e.zoom === t && e.offset.x === r.x && e.offset.y === r.y ? e : {
|
|
1191
|
+
zoom: x(t),
|
|
1192
|
+
offset: r
|
|
1193
|
+
};
|
|
1194
|
+
}
|
|
1195
|
+
function xt(e) {
|
|
1196
|
+
return St(e.zoom) && $(e.offset);
|
|
1197
|
+
}
|
|
1198
|
+
function St(e) {
|
|
1199
|
+
return typeof e == "number" && Number.isFinite(e) && e >= .05 && e <= 64;
|
|
1200
|
+
}
|
|
1201
|
+
function $(e) {
|
|
1202
|
+
return typeof e == "object" && !!e && typeof e.x == "number" && typeof e.y == "number" && Number.isFinite(e.x) && Number.isFinite(e.y);
|
|
1203
|
+
}
|
|
1204
|
+
//#endregion
|
|
1205
|
+
export { De as C, ee as D, b as E, y as O, Ee as S, S as T, W as _, ht as a, ze as b, ft as c, et as d, tt as f, Ge as g, We as h, ut as i, g as k, ct as l, $e as m, vt as n, pt as o, q as p, dt as r, mt as s, bt as t, lt as u, Ue as v, w, Re as x, Ve as y };
|
|
1206
|
+
|
|
1207
|
+
//# sourceMappingURL=viewport-BNIRWjiT.js.map
|