base-screen 0.1.2 → 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 +15 -17
- 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-callbacks.d.ts +2 -0
- package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-workbench-controller.d.ts +73 -16
- package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-workbench-panel.d.ts +48 -0
- 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-panel-controller.d.ts +62 -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-size-tier-controller.d.ts +60 -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-material-group-navigation-controller.d.ts +2 -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 +4 -2
- package/dist/_internal/engine/browser/controllers/panel/designer-panel-inspector-controller.d.ts +6 -0
- package/dist/_internal/engine/browser/controllers/panel/designer-panel-material-controller.d.ts +5 -0
- package/dist/_internal/engine/browser/controllers/panel/designer-panel-property-controller.d.ts +2 -0
- package/dist/_internal/engine/browser/controllers/workbench/designer-panel-layout-controller.d.ts +22 -1
- 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 +12 -1
- package/dist/_internal/engine/browser/controllers/workbench/designer-workbench-tabs-controller.d.ts +1 -0
- 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-markup.d.ts +2 -0
- package/dist/_internal/engine/browser/dom/workspace/designer-workspace-skeleton.d.ts +7 -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 +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 +170 -0
- package/dist/_internal/engine/common/ui-text/designer-ui-text.d.ts +427 -89
- package/dist/_internal/engine/designer-blueprint-workbench-panel-CJ3iZo5v.js +2872 -0
- package/dist/_internal/engine/designer-dataset-controller-CrfOg2Ys.js +4683 -0
- 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 +18 -1
- package/dist/_internal/engine/designer-element/runtime/designer-element-runtime.d.ts +15 -14
- package/dist/_internal/engine/designer-element/runtime/designer-element-skeleton.d.ts +14 -0
- package/dist/_internal/engine/designer-element/runtime/designer-element-state.d.ts +41 -12
- package/dist/_internal/engine/designer-field-primitives-KBZuWN_D.js +2685 -0
- 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 +9177 -18839
- 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 +1789 -610
- 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-skeleton.d.ts +10 -0
- package/dist/_internal/renderer/viewer/viewer-stale-style.d.ts +3 -0
- package/dist/_internal/renderer/viewer/viewer-variable-controller.d.ts +4 -0
- package/dist/_internal/renderer/viewer/viewer.d.ts +26 -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 +7 -1
- package/dist/_internal/sdk/designer.js +15 -5
- 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/authoring-EcyK2YVN.js +103 -0
- package/dist/authoring-EcyK2YVN.js.map +1 -0
- package/dist/auto-register.js +12 -10
- package/dist/auto-register.js.map +1 -1
- package/dist/contracts.js +73 -42
- package/dist/contracts.js.map +1 -1
- package/dist/core.js +151 -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/designer-3Tb0EIDV.js +21 -0
- package/dist/designer-3Tb0EIDV.js.map +1 -0
- package/dist/designer-auto-register.js +6 -4
- 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-CrfOg2Ys-DhKUEJJe.js +4609 -0
- package/dist/designer-dataset-controller-CrfOg2Ys-DhKUEJJe.js.map +1 -0
- package/dist/designer-field-primitives-KBZuWN_D-B3h4jpYe.js +2674 -0
- 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 -3
- package/dist/dist-6GRboBs-.js +3305 -0
- package/dist/dist-6GRboBs-.js.map +1 -0
- package/dist/dist-BjLjFUy1.js +23245 -0
- package/dist/dist-BjLjFUy1.js.map +1 -0
- package/dist/engine.js +5 -2
- package/dist/fragment-Y6YnW6wy.js +393 -0
- package/dist/fragment-Y6YnW6wy.js.map +1 -0
- package/dist/hierarchy-BQZrZWbC.js +86 -0
- package/dist/hierarchy-BQZrZWbC.js.map +1 -0
- package/dist/host-kit.js +297 -3
- package/dist/host-kit.js.map +1 -1
- package/dist/host-resource-selection-xo2mLCD4-BR5XCcim.js +2437 -0
- package/dist/host-resource-selection-xo2mLCD4-BR5XCcim.js.map +1 -0
- package/dist/host-tokens.css +12 -12
- package/dist/index.js +11 -9
- package/dist/level-scale-BzUjE31V.js +139 -0
- package/dist/level-scale-BzUjE31V.js.map +1 -0
- package/dist/{manager-Bhqi_KmD.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-UbSfiuZq.js.map +1 -0
- package/dist/material-auto-register.d.ts +1 -0
- package/dist/material-auto-register.js +16 -0
- package/dist/material-auto-register.js.map +1 -0
- package/dist/{material-definition-BJ4ujhuj.js → material-definition-BeW34dJr.js} +2 -2
- package/dist/{material-definition-BJ4ujhuj.js.map → material-definition-BeW34dJr.js.map} +1 -1
- package/dist/{material-manifest-LdgIkzgH.js → material-manifest-B1XatGPx.js} +232 -333
- 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/material-theme-C91eus78.js +252 -0
- 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 -2
- 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-B1OD1teS.js +272 -0
- package/dist/parse-B1OD1teS.js.map +1 -0
- 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 -7
- 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-CYtTqIxF.js → plugin-registration-rsmb4GvS.js} +4 -4
- package/dist/{plugin-registration-CYtTqIxF.js.map → plugin-registration-rsmb4GvS.js.map} +1 -1
- package/dist/plugin-sdk.js +6 -6
- package/dist/{plugins-DRaykV9c.js → plugins-DGRHgREK.js} +2 -2
- package/dist/{plugins-DRaykV9c.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-BPS5TRsq.js → src-Bm7u11mN-_0u6cMEw.js} +65 -64
- package/dist/{src-Bm7u11mN-BPS5TRsq.js.map → src-Bm7u11mN-_0u6cMEw.js.map} +1 -1
- package/dist/{material-2XmHe-aH.js → text-BNksUr5J.js} +405 -372
- 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-BG_MV9C-.js +278 -0
- package/dist/value-ref-BG_MV9C-.js.map +1 -0
- package/dist/{viewer-CrJupI8I-D2BtwLsA.js → viewer-CrJupI8I-D9dVcNw4.js} +5 -5
- package/dist/{viewer-CrJupI8I-D2BtwLsA.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-B4TH-dvm.js → viewport-CiCKeAQH.js} +367 -409
- package/dist/viewport-CiCKeAQH.js.map +1 -0
- package/package.json +16 -21
- 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-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/react/components.d.ts +0 -32
- package/dist/_internal/react/index.d.ts +0 -14
- package/dist/_internal/react/index.js +0 -215
- package/dist/_internal/renderer/style-rules.d.ts +0 -9
- package/dist/_internal/vue/components.d.ts +0 -36
- package/dist/_internal/vue/global-styles.d.ts +0 -10
- package/dist/_internal/vue/index.d.ts +0 -14
- package/dist/_internal/vue/index.js +0 -290
- package/dist/contrast-B4TH-dvm.js.map +0 -1
- package/dist/dataset-port-CUsMmX2x.js +0 -65
- package/dist/dataset-port-CUsMmX2x.js.map +0 -1
- package/dist/designer-xtN0h7PL.js +0 -11
- package/dist/designer-xtN0h7PL.js.map +0 -1
- package/dist/dist-CAdGDmU3.js +0 -2135
- package/dist/dist-CAdGDmU3.js.map +0 -1
- package/dist/dist-CR13A2Yb.js +0 -32734
- package/dist/dist-CR13A2Yb.js.map +0 -1
- package/dist/manager-Bhqi_KmD.js.map +0 -1
- package/dist/material-2XmHe-aH.js.map +0 -1
- package/dist/material-manifest-LdgIkzgH.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/parse-CYwxTDJU.js +0 -364
- package/dist/parse-CYwxTDJU.js.map +0 -1
- package/dist/plugin-B9Xxtw7G.js.map +0 -1
- package/dist/plugin-package-BfZLl3ru.js +0 -174
- package/dist/plugin-package-BfZLl3ru.js.map +0 -1
- package/dist/react.d.ts +0 -1
- package/dist/react.js +0 -213
- package/dist/react.js.map +0 -1
- package/dist/schema-C38FI_z2.js +0 -541
- package/dist/schema-C38FI_z2.js.map +0 -1
- package/dist/value-ref-Z0o70Vy6.js +0 -716
- package/dist/value-ref-Z0o70Vy6.js.map +0 -1
- package/dist/vue.d.ts +0 -1
- package/dist/vue.js +0 -288
- package/dist/vue.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { i as e, m as t } from "./image-url-D6mUcjY1.js";
|
|
2
|
-
import {
|
|
3
|
-
import { c as i, n as a } from "./parse-BQw3u9_4.js";
|
|
2
|
+
import { b as n, f as r, n as i, y as a } from "./parse-AOTE9WnD.js";
|
|
4
3
|
import { t as o } from "./equality-DjZ9cv4u.js";
|
|
5
|
-
import {
|
|
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
6
|
//#region ../core/dist/data/data-source-dependents.js
|
|
7
|
-
function
|
|
7
|
+
function g(e, t) {
|
|
8
8
|
let n = new Set(t);
|
|
9
9
|
if (n.size === 0) return [];
|
|
10
10
|
let r = [];
|
|
@@ -16,10 +16,10 @@ function m(e, t) {
|
|
|
16
16
|
}
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region ../core/dist/internal/diagnostics.js
|
|
19
|
-
function
|
|
19
|
+
function _(e) {
|
|
20
20
|
return t(e);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function v(e, t) {
|
|
23
23
|
return {
|
|
24
24
|
severity: e.severity,
|
|
25
25
|
code: e.code,
|
|
@@ -29,7 +29,7 @@ function g(e, t) {
|
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region ../core/dist/validation/invariant-error.js
|
|
32
|
-
var
|
|
32
|
+
var y = class extends Error {
|
|
33
33
|
name = "ScreenCoreInvariantError";
|
|
34
34
|
diagnostics;
|
|
35
35
|
constructor(e) {
|
|
@@ -38,16 +38,16 @@ var _ = class extends Error {
|
|
|
38
38
|
};
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region ../core/dist/internal/preconditions.js
|
|
41
|
-
function
|
|
41
|
+
function b(e, t) {
|
|
42
42
|
if (!Number.isFinite(e)) throw RangeError(`${t} must be a finite number.`);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function x(e) {
|
|
45
45
|
return Object.is(e, -0) ? 0 : e;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function S(e) {
|
|
48
48
|
return {
|
|
49
|
-
x:
|
|
50
|
-
y:
|
|
49
|
+
x: x(e.x),
|
|
50
|
+
y: x(e.y)
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
//#endregion
|
|
@@ -78,27 +78,27 @@ function ee(e) {
|
|
|
78
78
|
if (!Number.isFinite(a) || !Number.isFinite(c)) return null;
|
|
79
79
|
a < m && (m = a), a > g && (g = a), c < h && (h = c), c > _ && (_ = c);
|
|
80
80
|
}
|
|
81
|
-
let v = g - m,
|
|
82
|
-
return !Number.isFinite(v) || !Number.isFinite(
|
|
83
|
-
left:
|
|
84
|
-
top:
|
|
85
|
-
right:
|
|
86
|
-
bottom:
|
|
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
87
|
};
|
|
88
88
|
}
|
|
89
89
|
//#endregion
|
|
90
90
|
//#region ../core/dist/validation/validate-semantics.js
|
|
91
|
-
var te = 256,
|
|
92
|
-
function
|
|
93
|
-
if (
|
|
91
|
+
var te = 256, C = /* @__PURE__ */ new WeakSet();
|
|
92
|
+
function w(e) {
|
|
93
|
+
if (C.has(e)) return ne;
|
|
94
94
|
let t = re(e);
|
|
95
|
-
return t.length === 0 &&
|
|
95
|
+
return t.length === 0 && C.add(e), t;
|
|
96
96
|
}
|
|
97
97
|
var ne = [];
|
|
98
98
|
function re(e) {
|
|
99
|
-
let t =
|
|
99
|
+
let t = h(e), n = [];
|
|
100
100
|
for (let r = 0; r < e.components.length; r++) {
|
|
101
|
-
let i = e.components[r], a =
|
|
101
|
+
let i = e.components[r], a = f(t, i.id);
|
|
102
102
|
a > te && n.push({
|
|
103
103
|
severity: "error",
|
|
104
104
|
code: "CORE_INVARIANT_VIOLATION",
|
|
@@ -115,21 +115,21 @@ function re(e) {
|
|
|
115
115
|
message: "Component rotated bounds must be finite with positive width and height."
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
|
-
return
|
|
118
|
+
return _(n);
|
|
119
119
|
}
|
|
120
120
|
//#endregion
|
|
121
121
|
//#region ../core/dist/internal/document.js
|
|
122
|
-
function
|
|
123
|
-
let t =
|
|
124
|
-
if (t.length > 0) throw new
|
|
122
|
+
function T(e) {
|
|
123
|
+
let t = w(e);
|
|
124
|
+
if (t.length > 0) throw new y(t);
|
|
125
125
|
}
|
|
126
126
|
function ie(e, t) {
|
|
127
|
-
let n =
|
|
127
|
+
let n = i(e, t);
|
|
128
128
|
if (!n.ok) return {
|
|
129
129
|
ok: !1,
|
|
130
130
|
diagnostics: n.diagnostics
|
|
131
131
|
};
|
|
132
|
-
let r =
|
|
132
|
+
let r = w(n.value);
|
|
133
133
|
return r.length > 0 ? {
|
|
134
134
|
ok: !1,
|
|
135
135
|
diagnostics: r
|
|
@@ -140,7 +140,7 @@ function ie(e, t) {
|
|
|
140
140
|
}
|
|
141
141
|
//#endregion
|
|
142
142
|
//#region ../core/dist/commands/command-input.js
|
|
143
|
-
function
|
|
143
|
+
function E(e, t) {
|
|
144
144
|
let n = new Set(t), r = new Set(e.components.map((e) => e.id));
|
|
145
145
|
if (![...n].some((e) => !r.has(e))) return e.components.filter((e) => n.has(e.id)).map(({ id: e }) => e);
|
|
146
146
|
}
|
|
@@ -151,24 +151,24 @@ function ae(e, t) {
|
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
153
|
function oe(e, t) {
|
|
154
|
-
return
|
|
154
|
+
return D(e) && Object.keys(e).every((e) => t.has(e));
|
|
155
155
|
}
|
|
156
156
|
function se(e) {
|
|
157
|
-
return
|
|
157
|
+
return D(e) && Object.keys(e).length === 1 && e.status !== void 0;
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function D(e) {
|
|
160
160
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function O(e) {
|
|
163
163
|
return Array.isArray(e) && e.every((e) => typeof e == "string");
|
|
164
164
|
}
|
|
165
165
|
//#endregion
|
|
166
166
|
//#region ../core/dist/commands/command-result.js
|
|
167
|
-
function
|
|
167
|
+
function k(e, t, n) {
|
|
168
168
|
let r = ie(t, e);
|
|
169
|
-
return r.ok ?
|
|
169
|
+
return r.ok ? A(r.document, n) : j(e, r.diagnostics);
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function A(e, t) {
|
|
172
172
|
return {
|
|
173
173
|
ok: !0,
|
|
174
174
|
document: e,
|
|
@@ -176,17 +176,17 @@ function O(e, t) {
|
|
|
176
176
|
diagnostics: []
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function j(e, t) {
|
|
180
180
|
return {
|
|
181
181
|
ok: !1,
|
|
182
182
|
document: e,
|
|
183
|
-
diagnostics:
|
|
183
|
+
diagnostics: _(Array.isArray(t) ? t : [t])
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
|
-
function
|
|
187
|
-
return [
|
|
186
|
+
function M(e, t) {
|
|
187
|
+
return [N("CORE_COMMAND_INVALID", t, e)];
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function N(e, t, n) {
|
|
190
190
|
return {
|
|
191
191
|
severity: "error",
|
|
192
192
|
code: e,
|
|
@@ -205,104 +205,153 @@ var ce = /* @__PURE__ */ new Set([
|
|
|
205
205
|
"status",
|
|
206
206
|
"props",
|
|
207
207
|
"style",
|
|
208
|
-
"
|
|
208
|
+
"states",
|
|
209
209
|
"dataSource",
|
|
210
210
|
"dataValue",
|
|
211
|
-
"dataBinding"
|
|
211
|
+
"dataBinding",
|
|
212
|
+
"belowSubCanvas"
|
|
212
213
|
]);
|
|
213
214
|
function le(e, t) {
|
|
214
|
-
if (!
|
|
215
|
-
let n =
|
|
216
|
-
return typeof t.id == "string" ? n.byId.has(t.id) ?
|
|
215
|
+
if (!D(t)) return j(e, M("Component must be an object.", ["component"]));
|
|
216
|
+
let n = h(e);
|
|
217
|
+
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, {
|
|
217
218
|
...e,
|
|
218
219
|
components: [...e.components, t]
|
|
219
|
-
}, [t.id]) :
|
|
220
|
+
}, [t.id]) : j(e, M("Component id must be a string.", ["component", "id"]));
|
|
220
221
|
}
|
|
221
222
|
function ue(e, t, n) {
|
|
222
|
-
if (!
|
|
223
|
-
if (!oe(n, ce) || Object.keys(n).length === 0) return
|
|
224
|
-
let r =
|
|
225
|
-
if (r === void 0) return
|
|
226
|
-
if (r.length === 0) return
|
|
227
|
-
let i =
|
|
228
|
-
if (a !== void 0 && !se(n)) return
|
|
223
|
+
if (!O(t)) return j(e, M("Component ids must be a string array.", ["componentIds"]));
|
|
224
|
+
if (!oe(n, ce) || Object.keys(n).length === 0) return j(e, M("Component patch must contain known fields.", ["patch"]));
|
|
225
|
+
let r = E(e, t);
|
|
226
|
+
if (r === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["componentIds"], "One or more components do not exist."));
|
|
227
|
+
if (r.length === 0) return A(e, []);
|
|
228
|
+
let i = h(e), a = r.find((e) => d(i, e));
|
|
229
|
+
if (a !== void 0 && !se(n)) return j(e, N("CORE_COMMAND_TARGET_LOCKED", ["componentIds"], `Component "${a}" is locked.`));
|
|
229
230
|
let s = new Set(r), c = e.components.map((e) => {
|
|
230
231
|
if (!s.has(e.id)) return e;
|
|
231
232
|
let t = ae(e, n);
|
|
232
|
-
return "dataValue" in n && n.dataValue === null && delete t.dataValue, t;
|
|
233
|
+
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;
|
|
233
234
|
}), l = r.filter((e) => {
|
|
234
235
|
let t = i.byId.get(e);
|
|
235
236
|
return !o(t.component, c[t.index]);
|
|
236
237
|
});
|
|
237
|
-
return l.length === 0 ?
|
|
238
|
+
return l.length === 0 ? A(e, []) : k(e, {
|
|
238
239
|
...e,
|
|
239
240
|
components: c
|
|
240
241
|
}, l);
|
|
241
242
|
}
|
|
242
243
|
function de(e, t) {
|
|
243
|
-
if (!
|
|
244
|
-
let n =
|
|
245
|
-
if (n === void 0) return
|
|
246
|
-
if (n.length === 0) return
|
|
247
|
-
let r =
|
|
244
|
+
if (!O(t)) return j(e, M("Component ids must be a string array.", ["componentIds"]));
|
|
245
|
+
let n = E(e, t);
|
|
246
|
+
if (n === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["componentIds"], "One or more components do not exist."));
|
|
247
|
+
if (n.length === 0) return A(e, []);
|
|
248
|
+
let r = h(e), i = /* @__PURE__ */ new Set();
|
|
248
249
|
for (let e of n) {
|
|
249
250
|
i.add(e);
|
|
250
|
-
for (let t of
|
|
251
|
+
for (let t of u(r, e)) i.add(t);
|
|
251
252
|
}
|
|
252
|
-
let a = e.components.filter((e) => i.has(e.id)).map(({ id: e }) => e), o = a.find((e) =>
|
|
253
|
-
return o === void 0 ?
|
|
253
|
+
let a = e.components.filter((e) => i.has(e.id)).map(({ id: e }) => e), o = a.find((e) => d(r, e));
|
|
254
|
+
return o === void 0 ? k(e, {
|
|
254
255
|
...e,
|
|
255
256
|
components: e.components.filter((e) => !i.has(e.id))
|
|
256
|
-
}, a) :
|
|
257
|
+
}, a) : j(e, N("CORE_COMMAND_TARGET_LOCKED", ["componentIds"], `Component "${o}" is locked.`));
|
|
257
258
|
}
|
|
258
259
|
function fe(e, t, n) {
|
|
259
|
-
if (!
|
|
260
|
-
let r =
|
|
261
|
-
if (r === void 0) return
|
|
262
|
-
if (r.length === 0) return
|
|
263
|
-
let i =
|
|
264
|
-
if (n !== null && !i.byId.has(n)) return
|
|
260
|
+
if (!O(t) || n !== null && typeof n != "string") return j(e, M("Reparent command fields are invalid.", []));
|
|
261
|
+
let r = E(e, t);
|
|
262
|
+
if (r === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["componentIds"], "One or more components do not exist."));
|
|
263
|
+
if (r.length === 0) return A(e, []);
|
|
264
|
+
let i = h(e), a = new Set(r), o = r.filter((e) => !m(i, e).some((e) => a.has(e)));
|
|
265
|
+
if (n !== null && !i.byId.has(n)) return j(e, N("CORE_COMMAND_PARENT_INVALID", ["parentId"], "New parent does not exist."));
|
|
265
266
|
let s = /* @__PURE__ */ new Set();
|
|
266
267
|
for (let e of o) {
|
|
267
268
|
s.add(e);
|
|
268
|
-
for (let t of
|
|
269
|
+
for (let t of u(i, e)) s.add(t);
|
|
269
270
|
}
|
|
270
|
-
if (n !== null && s.has(n)) return
|
|
271
|
-
if (o.find((e) =>
|
|
272
|
-
let
|
|
273
|
-
if (
|
|
274
|
-
let
|
|
275
|
-
return
|
|
271
|
+
if (n !== null && s.has(n)) return j(e, N("CORE_COMMAND_PARENT_INVALID", ["parentId"], "New parent cannot be a target or descendant."));
|
|
272
|
+
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."));
|
|
273
|
+
let c = o.filter((e) => i.byId.get(e).component.parentId !== n);
|
|
274
|
+
if (c.length === 0) return A(e, []);
|
|
275
|
+
let l = new Set(c);
|
|
276
|
+
return k(e, {
|
|
276
277
|
...e,
|
|
277
|
-
components: e.components.map((e) =>
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
278
|
+
components: e.components.map((e) => {
|
|
279
|
+
if (!l.has(e.id)) return e;
|
|
280
|
+
if (n === null) return {
|
|
281
|
+
...e,
|
|
282
|
+
parentId: n
|
|
283
|
+
};
|
|
284
|
+
let { canvasId: t, belowSubCanvas: r, ...i } = e;
|
|
285
|
+
return {
|
|
286
|
+
...i,
|
|
287
|
+
parentId: n
|
|
288
|
+
};
|
|
289
|
+
})
|
|
290
|
+
}, c);
|
|
291
|
+
}
|
|
292
|
+
function pe(e, t, n) {
|
|
293
|
+
if (!O(t) || n !== null && typeof n != "string") return j(e, M("Move command fields are invalid.", []));
|
|
294
|
+
let r = n === null ? void 0 : (e.subCanvases ?? []).find((e) => e.id === n);
|
|
295
|
+
if (n !== null && r === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["canvasId"], "Target sub canvas does not exist."));
|
|
296
|
+
let i = E(e, t);
|
|
297
|
+
if (i === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["componentIds"], "One or more components do not exist."));
|
|
298
|
+
if (i.length === 0) return A(e, []);
|
|
299
|
+
let a = h(e);
|
|
300
|
+
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"]));
|
|
301
|
+
let o = i.find((e) => d(a, e));
|
|
302
|
+
if (o !== void 0) return j(e, N("CORE_COMMAND_TARGET_LOCKED", ["componentIds"], `Component "${o}" is locked.`));
|
|
303
|
+
let s = new Set(i), c = [], l = e.components.map((e) => {
|
|
304
|
+
if (!s.has(e.id) || (e.canvasId ?? null) === n) return e;
|
|
305
|
+
let { canvasId: t, belowSubCanvas: i, ...a } = e, o = n === null ? {
|
|
306
|
+
...a,
|
|
307
|
+
...e.belowSubCanvas === !0 ? { belowSubCanvas: !0 } : {}
|
|
308
|
+
} : {
|
|
309
|
+
...a,
|
|
310
|
+
canvasId: n
|
|
311
|
+
};
|
|
312
|
+
if (r?.display === "popup") {
|
|
313
|
+
let t = P(e.position.x, 0, Math.max(0, r.width - e.size.width)), n = P(e.position.y, 0, Math.max(0, r.height - e.size.height));
|
|
314
|
+
(t !== e.position.x || n !== e.position.y) && (o = {
|
|
315
|
+
...o,
|
|
316
|
+
position: {
|
|
317
|
+
x: t,
|
|
318
|
+
y: n
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
return c.push(e.id), o;
|
|
323
|
+
});
|
|
324
|
+
return c.length === 0 ? A(e, []) : k(e, {
|
|
325
|
+
...e,
|
|
326
|
+
components: l
|
|
327
|
+
}, c);
|
|
328
|
+
}
|
|
329
|
+
function P(e, t, n) {
|
|
330
|
+
return Math.min(n, Math.max(t, e));
|
|
282
331
|
}
|
|
283
332
|
//#endregion
|
|
284
333
|
//#region ../core/dist/commands/apply-data-source-command.js
|
|
285
|
-
function
|
|
286
|
-
if (!Array.isArray(t)) return
|
|
334
|
+
function me(e, t) {
|
|
335
|
+
if (!Array.isArray(t)) return j(e, M("Data sources must be an array.", ["dataSources"]));
|
|
287
336
|
let n = e.dataSources ?? [], r = new Map(n.map((e) => [e.id, e])), i = t.map((e) => {
|
|
288
337
|
let t = ge(e);
|
|
289
338
|
if (t === void 0) return e;
|
|
290
339
|
let n = r.get(t);
|
|
291
340
|
return n !== void 0 && o(n, e) ? n : e;
|
|
292
341
|
});
|
|
293
|
-
if (he(n, i)) return
|
|
294
|
-
let a =
|
|
342
|
+
if (he(n, i)) return A(e, []);
|
|
343
|
+
let a = k(e, {
|
|
295
344
|
...e,
|
|
296
345
|
dataSources: i
|
|
297
346
|
}, []);
|
|
298
347
|
if (!a.ok) return a;
|
|
299
|
-
let s =
|
|
348
|
+
let s = g(a.document, F(n, a.document.dataSources ?? []));
|
|
300
349
|
return {
|
|
301
350
|
...a,
|
|
302
351
|
changedComponentIds: s
|
|
303
352
|
};
|
|
304
353
|
}
|
|
305
|
-
function
|
|
354
|
+
function F(e, t) {
|
|
306
355
|
let n = new Map(e.map((e) => [e.id, e])), r = new Map(t.map((e) => [e.id, e])), i = [];
|
|
307
356
|
for (let [e, t] of n) {
|
|
308
357
|
let n = r.get(e);
|
|
@@ -327,103 +376,126 @@ var _e = /* @__PURE__ */ new Set([
|
|
|
327
376
|
"nextName"
|
|
328
377
|
]);
|
|
329
378
|
function ve(e, t) {
|
|
330
|
-
if (!
|
|
331
|
-
if (!
|
|
332
|
-
if (!
|
|
333
|
-
let
|
|
334
|
-
if (
|
|
335
|
-
if (
|
|
336
|
-
if (e.variables.some((e) => e.name === t.nextName)) return
|
|
337
|
-
let
|
|
379
|
+
if (!D(t) || Object.keys(t).some((e) => !_e.has(e)) || t.type !== "rename-variable" || typeof t.variableId != "string" || typeof t.nextName != "string") return j(e, M("Rename variable command is invalid.", []));
|
|
380
|
+
if (!a(t.variableId)) return j(e, M("Variable id is invalid.", ["variableId"]));
|
|
381
|
+
if (!n(t.nextName)) return j(e, M("Next variable name is invalid.", ["nextName"]));
|
|
382
|
+
let r = e.variables.find((e) => e.id === t.variableId);
|
|
383
|
+
if (r === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["variableId"], "Variable target does not exist."));
|
|
384
|
+
if (r.name === t.nextName) return A(e, []);
|
|
385
|
+
if (e.variables.some((e) => e.name === t.nextName)) return j(e, M("Next variable name is already in use.", ["nextName"]));
|
|
386
|
+
let i = e.variables.map((e) => e === r ? {
|
|
338
387
|
...e,
|
|
339
388
|
name: t.nextName
|
|
340
389
|
} : e);
|
|
341
|
-
return
|
|
390
|
+
return k(e, {
|
|
342
391
|
...e,
|
|
343
|
-
variables:
|
|
392
|
+
variables: i
|
|
344
393
|
}, []);
|
|
345
394
|
}
|
|
346
395
|
//#endregion
|
|
347
396
|
//#region ../core/dist/commands/apply.js
|
|
348
|
-
var ye = new Set(
|
|
397
|
+
var ye = new Set(r);
|
|
349
398
|
function be(e, t) {
|
|
350
|
-
return
|
|
399
|
+
return T(e), I(e, t);
|
|
351
400
|
}
|
|
352
401
|
function xe(e, t) {
|
|
353
|
-
if (
|
|
402
|
+
if (T(e), !D(t) || !Array.isArray(t.commands)) return {
|
|
354
403
|
ok: !1,
|
|
355
404
|
document: e,
|
|
356
405
|
failedCommandIndex: 0,
|
|
357
|
-
diagnostics:
|
|
406
|
+
diagnostics: M("Transaction commands must be an array.", ["commands"])
|
|
358
407
|
};
|
|
359
408
|
if (t.commands.length > 1e3) return {
|
|
360
409
|
ok: !1,
|
|
361
410
|
document: e,
|
|
362
411
|
failedCommandIndex: 0,
|
|
363
|
-
diagnostics: [
|
|
412
|
+
diagnostics: [N("CORE_COMMAND_LIMIT_EXCEEDED", ["commands"], "Transaction exceeds 1000 commands.")]
|
|
364
413
|
};
|
|
365
414
|
let n = e;
|
|
366
415
|
for (let r = 0; r < t.commands.length; r++) {
|
|
367
|
-
let i =
|
|
416
|
+
let i = I(n, t.commands[r]);
|
|
368
417
|
if (!i.ok) return {
|
|
369
418
|
ok: !1,
|
|
370
419
|
document: e,
|
|
371
420
|
failedCommandIndex: r,
|
|
372
|
-
diagnostics:
|
|
421
|
+
diagnostics: _(i.diagnostics.map((e) => v(e, ["commands", r])))
|
|
373
422
|
};
|
|
374
423
|
n = i.document;
|
|
375
424
|
}
|
|
376
425
|
return {
|
|
377
426
|
ok: !0,
|
|
378
427
|
document: n,
|
|
379
|
-
changedComponentIds:
|
|
428
|
+
changedComponentIds: De(e, n),
|
|
380
429
|
diagnostics: []
|
|
381
430
|
};
|
|
382
431
|
}
|
|
383
|
-
function
|
|
384
|
-
if (!
|
|
432
|
+
function I(e, t) {
|
|
433
|
+
if (!D(t) || typeof t.type != "string") return j(e, M("Command must be an object with a known type.", []));
|
|
385
434
|
switch (t.type) {
|
|
386
|
-
case "update-canvas": return
|
|
435
|
+
case "update-canvas": return Se(e, t.patch);
|
|
387
436
|
case "add-component": return le(e, t.component);
|
|
388
437
|
case "update-components": return ue(e, t.componentIds, t.patch);
|
|
389
438
|
case "remove-components": return de(e, t.componentIds);
|
|
390
439
|
case "reparent-components": return fe(e, t.componentIds, t.parentId);
|
|
391
|
-
case "replace-blueprint": return
|
|
392
|
-
case "replace-data-sources": return
|
|
440
|
+
case "replace-blueprint": return Ee(e, t.blueprint);
|
|
441
|
+
case "replace-data-sources": return me(e, t.dataSources);
|
|
393
442
|
case "replace-variables": return we(e, t.variables);
|
|
443
|
+
case "replace-sub-canvases": return Te(e, t.subCanvases, t.startCanvasId);
|
|
444
|
+
case "move-components": return pe(e, t.componentIds, t.canvasId);
|
|
394
445
|
case "rename-variable": return ve(e, t);
|
|
395
|
-
|
|
446
|
+
case "update-theme": return Ce(e, t.patch);
|
|
447
|
+
default: return j(e, M("Command type is not supported.", ["type"]));
|
|
396
448
|
}
|
|
397
449
|
}
|
|
398
|
-
function
|
|
399
|
-
if (!oe(t, ye)) return
|
|
400
|
-
if (Object.keys(t).length === 0) return
|
|
450
|
+
function Se(e, t) {
|
|
451
|
+
if (!oe(t, ye)) return j(e, M("Canvas patch contains an unknown or invalid field.", ["patch"]));
|
|
452
|
+
if (Object.keys(t).length === 0) return A(e, []);
|
|
401
453
|
let n = { ...e.canvas };
|
|
402
454
|
for (let [e, r] of Object.entries(t)) r === null ? delete n[e] : n[e] = r;
|
|
403
|
-
return o(e.canvas, n) ?
|
|
455
|
+
return o(e.canvas, n) ? A(e, []) : k(e, {
|
|
404
456
|
...e,
|
|
405
457
|
canvas: n
|
|
406
458
|
}, []);
|
|
407
459
|
}
|
|
460
|
+
function Ce(e, t) {
|
|
461
|
+
if (!D(t)) return j(e, M("Theme patch must be an object of slot colors.", ["patch"]));
|
|
462
|
+
for (let [n, r] of Object.entries(t)) if (!s(n) || typeof r != "string" || r.trim() === "" || r.length > 64) return j(e, M("Theme patch keys must be palette slots with color strings.", ["patch", n]));
|
|
463
|
+
let n = {
|
|
464
|
+
...e.theme?.palette,
|
|
465
|
+
...t
|
|
466
|
+
};
|
|
467
|
+
if (c.some((e) => typeof n[e] != "string")) return j(e, M("Theme patch must complete all palette slots.", ["patch"]));
|
|
468
|
+
let r = { palette: n };
|
|
469
|
+
return o(e.theme, r) ? A(e, []) : k(e, {
|
|
470
|
+
...e,
|
|
471
|
+
theme: r
|
|
472
|
+
}, []);
|
|
473
|
+
}
|
|
408
474
|
function we(e, t) {
|
|
409
|
-
return Array.isArray(t) ? o(e.variables, t) ?
|
|
475
|
+
return Array.isArray(t) ? o(e.variables, t) ? A(e, []) : k(e, {
|
|
410
476
|
...e,
|
|
411
477
|
variables: t
|
|
412
|
-
}, []) :
|
|
478
|
+
}, []) : j(e, M("Variables must be an array.", ["variables"]));
|
|
479
|
+
}
|
|
480
|
+
function Te(e, t, n) {
|
|
481
|
+
if (!Array.isArray(t)) return j(e, M("Sub canvases must be an array.", ["subCanvases"]));
|
|
482
|
+
if (n != null && typeof n != "string") return j(e, M("startCanvasId must be a string or null.", ["startCanvasId"]));
|
|
483
|
+
let r = { ...e };
|
|
484
|
+
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, []);
|
|
413
485
|
}
|
|
414
|
-
function
|
|
415
|
-
return !
|
|
486
|
+
function Ee(e, t) {
|
|
487
|
+
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, {
|
|
416
488
|
...e,
|
|
417
489
|
blueprint: t
|
|
418
490
|
}, []);
|
|
419
491
|
}
|
|
420
|
-
function
|
|
421
|
-
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 =
|
|
492
|
+
function De(e, t) {
|
|
493
|
+
let n = new Map(t.components.map((e) => [e.id, e])), r = new Map(e.components.map((e) => [e.id, e])), i = t.components.filter((e) => r.get(e.id) !== e && !o(r.get(e.id), e)).map(({ id: e }) => e), a = e.components.filter((e) => !n.has(e.id)).map(({ id: e }) => e), s = /* @__PURE__ */ new Set([...i, ...a]), c = g(t, F(e.dataSources ?? [], t.dataSources ?? [])).filter((e) => !s.has(e));
|
|
422
494
|
return c.length === 0 ? [...s] : [...s, ...c];
|
|
423
495
|
}
|
|
424
496
|
//#endregion
|
|
425
497
|
//#region ../core/dist/commands/parse-command.js
|
|
426
|
-
var
|
|
498
|
+
var Oe = /* @__PURE__ */ new Set([
|
|
427
499
|
"update-canvas",
|
|
428
500
|
"add-component",
|
|
429
501
|
"update-components",
|
|
@@ -432,8 +504,11 @@ var De = /* @__PURE__ */ new Set([
|
|
|
432
504
|
"replace-blueprint",
|
|
433
505
|
"replace-data-sources",
|
|
434
506
|
"replace-variables",
|
|
435
|
-
"
|
|
436
|
-
|
|
507
|
+
"replace-sub-canvases",
|
|
508
|
+
"move-components",
|
|
509
|
+
"rename-variable",
|
|
510
|
+
"update-theme"
|
|
511
|
+
]), ke = {
|
|
437
512
|
"update-canvas": /* @__PURE__ */ new Set(["type", "patch"]),
|
|
438
513
|
"add-component": /* @__PURE__ */ new Set(["type", "component"]),
|
|
439
514
|
"update-components": /* @__PURE__ */ new Set([
|
|
@@ -450,32 +525,43 @@ var De = /* @__PURE__ */ new Set([
|
|
|
450
525
|
"replace-blueprint": /* @__PURE__ */ new Set(["type", "blueprint"]),
|
|
451
526
|
"replace-data-sources": /* @__PURE__ */ new Set(["type", "dataSources"]),
|
|
452
527
|
"replace-variables": /* @__PURE__ */ new Set(["type", "variables"]),
|
|
528
|
+
"replace-sub-canvases": /* @__PURE__ */ new Set([
|
|
529
|
+
"type",
|
|
530
|
+
"subCanvases",
|
|
531
|
+
"startCanvasId"
|
|
532
|
+
]),
|
|
533
|
+
"move-components": /* @__PURE__ */ new Set([
|
|
534
|
+
"type",
|
|
535
|
+
"componentIds",
|
|
536
|
+
"canvasId"
|
|
537
|
+
]),
|
|
453
538
|
"rename-variable": /* @__PURE__ */ new Set([
|
|
454
539
|
"type",
|
|
455
540
|
"variableId",
|
|
456
541
|
"nextName"
|
|
457
|
-
])
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
542
|
+
]),
|
|
543
|
+
"update-theme": /* @__PURE__ */ new Set(["type", "patch"])
|
|
544
|
+
}, Ae = { "replace-sub-canvases": /* @__PURE__ */ new Set(["startCanvasId"]) }, je = 262144;
|
|
545
|
+
function Me(t) {
|
|
546
|
+
let n = e(t, { maxBytes: je });
|
|
461
547
|
if (!n.ok) return n;
|
|
462
|
-
if (!
|
|
548
|
+
if (!D(n.value) || typeof n.value.type != "string") return {
|
|
463
549
|
ok: !1,
|
|
464
|
-
diagnostics:
|
|
550
|
+
diagnostics: M("Command must be an object with a known type.", [])
|
|
465
551
|
};
|
|
466
552
|
let r = n.value.type;
|
|
467
|
-
if (!
|
|
553
|
+
if (!Oe.has(r)) return {
|
|
468
554
|
ok: !1,
|
|
469
|
-
diagnostics:
|
|
555
|
+
diagnostics: M("Command type is not supported.", ["type"])
|
|
470
556
|
};
|
|
471
|
-
let i =
|
|
557
|
+
let i = ke[r];
|
|
472
558
|
for (let e of Object.keys(n.value)) if (!i.has(e)) return {
|
|
473
559
|
ok: !1,
|
|
474
|
-
diagnostics:
|
|
560
|
+
diagnostics: M("Command contains an unknown field.", [e])
|
|
475
561
|
};
|
|
476
|
-
for (let e of i) if (!Object.hasOwn(n.value, e)) return {
|
|
562
|
+
for (let e of i) if (Ae[r]?.has(e) !== !0 && !Object.hasOwn(n.value, e)) return {
|
|
477
563
|
ok: !1,
|
|
478
|
-
diagnostics:
|
|
564
|
+
diagnostics: M("Command field is required.", [e])
|
|
479
565
|
};
|
|
480
566
|
return {
|
|
481
567
|
ok: !0,
|
|
@@ -485,8 +571,8 @@ function Ae(t) {
|
|
|
485
571
|
}
|
|
486
572
|
//#endregion
|
|
487
573
|
//#region ../core/dist/diff/screen-diff.js
|
|
488
|
-
var
|
|
489
|
-
function
|
|
574
|
+
var Ne = 80;
|
|
575
|
+
function Pe(e, t) {
|
|
490
576
|
let n = new Map(e.components.map((e) => [e.id, e])), r = new Map(t.components.map((e) => [e.id, e])), i = [];
|
|
491
577
|
for (let e of t.components) {
|
|
492
578
|
let t = n.get(e.id);
|
|
@@ -499,7 +585,7 @@ function Me(e, t) {
|
|
|
499
585
|
});
|
|
500
586
|
continue;
|
|
501
587
|
}
|
|
502
|
-
let r =
|
|
588
|
+
let r = Fe(t, e);
|
|
503
589
|
r.length > 0 && i.push({
|
|
504
590
|
componentId: e.id,
|
|
505
591
|
componentName: e.name,
|
|
@@ -515,67 +601,67 @@ function Me(e, t) {
|
|
|
515
601
|
});
|
|
516
602
|
return i;
|
|
517
603
|
}
|
|
518
|
-
function
|
|
604
|
+
function Fe(e, t) {
|
|
519
605
|
let n = [];
|
|
520
|
-
return
|
|
606
|
+
return L("name", e.name, t.name, n), L("position.x", e.position.x, t.position.x, n), L("position.y", e.position.y, t.position.y, n), L("size.width", e.size.width, t.size.width, n), L("size.height", e.size.height, t.size.height, n), L("rotation", e.rotation, t.rotation, n), L("zIndex", e.zIndex, t.zIndex, n), Ie("props", e.props, t.props, n), Ie("style", e.style, t.style, n), L("dataValue", e.dataValue ?? null, t.dataValue ?? null, n), L("dataSource", e.dataSource ?? null, t.dataSource ?? null, n), L("states", e.states ?? null, t.states ?? null, n), n;
|
|
521
607
|
}
|
|
522
|
-
function
|
|
608
|
+
function Ie(e, t, n, r) {
|
|
523
609
|
let i = [.../* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(n)])].sort();
|
|
524
|
-
for (let a of i)
|
|
610
|
+
for (let a of i) L(`${e}.${a}`, t[a], n[a], r);
|
|
525
611
|
}
|
|
526
|
-
function
|
|
527
|
-
let i =
|
|
528
|
-
i !==
|
|
612
|
+
function L(e, t, n, r) {
|
|
613
|
+
let i = R(t);
|
|
614
|
+
i !== R(n) && r.push({
|
|
529
615
|
path: e,
|
|
530
|
-
before:
|
|
531
|
-
after:
|
|
616
|
+
before: Le(i),
|
|
617
|
+
after: Le(R(n))
|
|
532
618
|
});
|
|
533
619
|
}
|
|
534
|
-
function
|
|
620
|
+
function R(e) {
|
|
535
621
|
return e === void 0 ? "null" : JSON.stringify(e) ?? "null";
|
|
536
622
|
}
|
|
537
|
-
function
|
|
538
|
-
return e.length >
|
|
623
|
+
function Le(e) {
|
|
624
|
+
return e.length > Ne ? `${e.slice(0, 79)}…` : e;
|
|
539
625
|
}
|
|
540
626
|
//#endregion
|
|
541
627
|
//#region ../core/dist/geometry/component-bounds.js
|
|
542
|
-
function
|
|
628
|
+
function z(e) {
|
|
543
629
|
let t = ee(e);
|
|
544
630
|
if (t === null) throw RangeError("Component geometry must be finite with positive dimensions.");
|
|
545
631
|
return t;
|
|
546
632
|
}
|
|
547
|
-
function
|
|
633
|
+
function Re(e) {
|
|
548
634
|
if (e.length === 0) return null;
|
|
549
|
-
let t =
|
|
635
|
+
let t = z(e[0]), n = t.left, r = t.top, i = t.right, a = t.bottom;
|
|
550
636
|
for (let t = 1; t < e.length; t++) {
|
|
551
|
-
let o =
|
|
637
|
+
let o = z(e[t]);
|
|
552
638
|
n = Math.min(n, o.left), r = Math.min(r, o.top), i = Math.max(i, o.right), a = Math.max(a, o.bottom);
|
|
553
639
|
}
|
|
554
640
|
return {
|
|
555
|
-
left:
|
|
556
|
-
top:
|
|
557
|
-
right:
|
|
558
|
-
bottom:
|
|
641
|
+
left: x(n),
|
|
642
|
+
top: x(r),
|
|
643
|
+
right: x(i),
|
|
644
|
+
bottom: x(a)
|
|
559
645
|
};
|
|
560
646
|
}
|
|
561
647
|
//#endregion
|
|
562
648
|
//#region ../core/dist/geometry/alignment.js
|
|
563
|
-
function
|
|
649
|
+
function ze(e, t, n) {
|
|
564
650
|
if (t !== "x" && t !== "y") throw RangeError("Alignment axis must be x or y.");
|
|
565
651
|
if (n !== "start" && n !== "center" && n !== "end") throw RangeError("Alignment mode must be start, center, or end.");
|
|
566
|
-
let r =
|
|
652
|
+
let r = Ve(e);
|
|
567
653
|
if (r.length < 2) return [];
|
|
568
|
-
let i = r.filter(({ locked: e }) => e), a = i.length > 0 ? i : r, o = a.map(({ bounds: e }) =>
|
|
654
|
+
let i = r.filter(({ locked: e }) => e), a = i.length > 0 ? i : r, o = a.map(({ bounds: e }) => B(e, t)), s = a.map(({ bounds: e }) => V(e, t)), c = n === "start" ? Math.min(...o) : n === "end" ? Math.max(...s) : (Math.min(...o) + Math.max(...s)) / 2;
|
|
569
655
|
return r.filter(({ locked: e }) => !e).map(({ component: e, bounds: r }) => ({
|
|
570
656
|
componentId: e.id,
|
|
571
|
-
delta:
|
|
572
|
-
})).filter(({ delta: e }) => e.x !== 0 || e.y !== 0).sort(
|
|
657
|
+
delta: U(t, c - He(r, t, n))
|
|
658
|
+
})).filter(({ delta: e }) => e.x !== 0 || e.y !== 0).sort(W);
|
|
573
659
|
}
|
|
574
|
-
function
|
|
660
|
+
function Be(e, t) {
|
|
575
661
|
if (t !== "x" && t !== "y") throw RangeError("Distribution axis must be x or y.");
|
|
576
|
-
let n = [...
|
|
577
|
-
let r =
|
|
578
|
-
return r === 0 ?
|
|
662
|
+
let n = [...Ve(e)].sort((e, n) => {
|
|
663
|
+
let r = B(e.bounds, t) - B(n.bounds, t);
|
|
664
|
+
return r === 0 ? G(e.component.id, n.component.id) : r;
|
|
579
665
|
});
|
|
580
666
|
if (n.length < 2) return [];
|
|
581
667
|
let r = /* @__PURE__ */ new Set([0, n.length - 1]);
|
|
@@ -584,97 +670,97 @@ function Re(e, t) {
|
|
|
584
670
|
for (let e = 1; e < i.length; e++) {
|
|
585
671
|
let r = i[e - 1], o = i[e], s = n.slice(r + 1, o);
|
|
586
672
|
if (s.length === 0) continue;
|
|
587
|
-
let c = n[r], l = n[o], u = (
|
|
673
|
+
let c = n[r], l = n[o], u = (B(l.bounds, t) - V(c.bounds, t) - s.reduce((e, n) => e + H(n.bounds, t), 0)) / (s.length + 1), d = V(c.bounds, t) + u;
|
|
588
674
|
for (let e of s) {
|
|
589
|
-
let n = d -
|
|
675
|
+
let n = d - B(e.bounds, t);
|
|
590
676
|
n !== 0 && a.push({
|
|
591
677
|
componentId: e.component.id,
|
|
592
|
-
delta:
|
|
593
|
-
}), d +=
|
|
678
|
+
delta: U(t, n)
|
|
679
|
+
}), d += H(e.bounds, t) + u;
|
|
594
680
|
}
|
|
595
681
|
}
|
|
596
|
-
return a.sort(
|
|
682
|
+
return a.sort(W);
|
|
597
683
|
}
|
|
598
|
-
function
|
|
599
|
-
let t =
|
|
600
|
-
return e.filter((e) => !
|
|
684
|
+
function Ve(e) {
|
|
685
|
+
let t = h({ components: e });
|
|
686
|
+
return e.filter((e) => !l(t, e.id)).map((e) => ({
|
|
601
687
|
component: e,
|
|
602
|
-
bounds:
|
|
603
|
-
locked:
|
|
688
|
+
bounds: z(e),
|
|
689
|
+
locked: d(t, e.id)
|
|
604
690
|
}));
|
|
605
691
|
}
|
|
606
|
-
function
|
|
692
|
+
function B(e, t) {
|
|
607
693
|
return t === "x" ? e.left : e.top;
|
|
608
694
|
}
|
|
609
|
-
function
|
|
695
|
+
function V(e, t) {
|
|
610
696
|
return t === "x" ? e.right : e.bottom;
|
|
611
697
|
}
|
|
612
|
-
function
|
|
613
|
-
return
|
|
698
|
+
function H(e, t) {
|
|
699
|
+
return V(e, t) - B(e, t);
|
|
614
700
|
}
|
|
615
|
-
function
|
|
616
|
-
let r =
|
|
701
|
+
function He(e, t, n) {
|
|
702
|
+
let r = B(e, t);
|
|
617
703
|
if (n === "start") return r;
|
|
618
|
-
let i =
|
|
704
|
+
let i = V(e, t);
|
|
619
705
|
return n === "end" ? i : r + (i - r) / 2;
|
|
620
706
|
}
|
|
621
|
-
function
|
|
707
|
+
function U(e, t) {
|
|
622
708
|
return e === "x" ? {
|
|
623
|
-
x:
|
|
709
|
+
x: x(t),
|
|
624
710
|
y: 0
|
|
625
711
|
} : {
|
|
626
712
|
x: 0,
|
|
627
|
-
y:
|
|
713
|
+
y: x(t)
|
|
628
714
|
};
|
|
629
715
|
}
|
|
630
|
-
function
|
|
631
|
-
return
|
|
716
|
+
function W(e, t) {
|
|
717
|
+
return G(e.componentId, t.componentId);
|
|
632
718
|
}
|
|
633
|
-
function
|
|
719
|
+
function G(e, t) {
|
|
634
720
|
return e < t ? -1 : +(e > t);
|
|
635
721
|
}
|
|
636
722
|
//#endregion
|
|
637
723
|
//#region ../core/dist/geometry/validation.js
|
|
638
|
-
function
|
|
724
|
+
function K(e, t) {
|
|
639
725
|
if (typeof e != "object" || !e) throw RangeError(`${t} must be a finite point.`);
|
|
640
|
-
|
|
726
|
+
b(e.x, `${t}.x`), b(e.y, `${t}.y`);
|
|
641
727
|
}
|
|
642
|
-
function
|
|
728
|
+
function Ue(e) {
|
|
643
729
|
if (typeof e != "object" || !e) throw RangeError("Rectangle must be an object.");
|
|
644
|
-
if (
|
|
730
|
+
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.");
|
|
645
731
|
}
|
|
646
|
-
function
|
|
732
|
+
function We(e) {
|
|
647
733
|
if (typeof e != "object" || !e || e.offset === null) throw RangeError("Viewport must contain a zoom and finite offset.");
|
|
648
734
|
if (e.zoom < .05 || e.zoom > 64) throw RangeError("Viewport zoom must be from 0.05 through 64.");
|
|
649
|
-
|
|
735
|
+
b(e.zoom, "viewport.zoom"), K(e.offset, "viewport.offset");
|
|
650
736
|
}
|
|
651
737
|
//#endregion
|
|
652
738
|
//#region ../core/dist/geometry/hit-testing.js
|
|
653
|
-
function
|
|
654
|
-
|
|
739
|
+
function Ge(e, t, n = {}) {
|
|
740
|
+
T(e), K(t, "point");
|
|
655
741
|
let r = n.minimumThickness ?? 0;
|
|
656
742
|
if (!Number.isFinite(r) || r < 0) throw RangeError("Hit test minimumThickness must be a non-negative finite number.");
|
|
657
|
-
let i =
|
|
658
|
-
return [...
|
|
743
|
+
let i = h(e), a = i.byId;
|
|
744
|
+
return [...p(e)].reverse().filter((e) => {
|
|
659
745
|
let n = a.get(e)?.component;
|
|
660
|
-
return n !== void 0 && !
|
|
746
|
+
return n !== void 0 && !l(i, e) && qe(t, n, r);
|
|
661
747
|
});
|
|
662
748
|
}
|
|
663
|
-
function
|
|
664
|
-
if (
|
|
665
|
-
let r =
|
|
749
|
+
function Ke(e, t, n) {
|
|
750
|
+
if (T(e), Ue(t), n !== "intersect" && n !== "contain") throw RangeError("Query mode must be intersect or contain.");
|
|
751
|
+
let r = h(e);
|
|
666
752
|
return e.components.filter((e) => {
|
|
667
|
-
if (
|
|
668
|
-
let i =
|
|
669
|
-
return n === "contain" ? i.every((e) =>
|
|
753
|
+
if (l(r, e.id)) return !1;
|
|
754
|
+
let i = Je(e);
|
|
755
|
+
return n === "contain" ? i.every((e) => J(e, t)) : Ye(i, t);
|
|
670
756
|
}).map(({ id: e }) => e);
|
|
671
757
|
}
|
|
672
|
-
function
|
|
758
|
+
function qe(e, t, n) {
|
|
673
759
|
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;
|
|
674
760
|
return f >= -a && f <= r + a && p >= -o && p <= i + o;
|
|
675
761
|
}
|
|
676
|
-
function
|
|
677
|
-
|
|
762
|
+
function Je(e) {
|
|
763
|
+
z(e);
|
|
678
764
|
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);
|
|
679
765
|
return [
|
|
680
766
|
{
|
|
@@ -693,13 +779,13 @@ function Ge(e) {
|
|
|
693
779
|
x: -r,
|
|
694
780
|
y: i
|
|
695
781
|
}
|
|
696
|
-
].map(({ x: e, y: r }) =>
|
|
782
|
+
].map(({ x: e, y: r }) => S({
|
|
697
783
|
x: t + e * o - r * s,
|
|
698
784
|
y: n + e * s + r * o
|
|
699
785
|
}));
|
|
700
786
|
}
|
|
701
|
-
function
|
|
702
|
-
if (e.some((e) =>
|
|
787
|
+
function Ye(e, t) {
|
|
788
|
+
if (e.some((e) => J(e, t))) return !0;
|
|
703
789
|
let n = [
|
|
704
790
|
{
|
|
705
791
|
x: t.x,
|
|
@@ -718,17 +804,17 @@ function Ke(e, t) {
|
|
|
718
804
|
y: t.y + t.height
|
|
719
805
|
}
|
|
720
806
|
];
|
|
721
|
-
if (n.some((t) =>
|
|
807
|
+
if (n.some((t) => Xe(t, e))) return !0;
|
|
722
808
|
for (let t = 0; t < e.length; t++) {
|
|
723
809
|
let r = e[t], i = e[(t + 1) % e.length];
|
|
724
810
|
for (let e = 0; e < n.length; e++) {
|
|
725
811
|
let t = n[e], a = n[(e + 1) % n.length];
|
|
726
|
-
if (
|
|
812
|
+
if (Ze(r, i, t, a)) return !0;
|
|
727
813
|
}
|
|
728
814
|
}
|
|
729
815
|
return !1;
|
|
730
816
|
}
|
|
731
|
-
function
|
|
817
|
+
function Xe(e, t) {
|
|
732
818
|
let n = !1, r = !1;
|
|
733
819
|
for (let i = 0; i < t.length; i++) {
|
|
734
820
|
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);
|
|
@@ -736,35 +822,35 @@ function qe(e, t) {
|
|
|
736
822
|
}
|
|
737
823
|
return !(n && r);
|
|
738
824
|
}
|
|
739
|
-
function
|
|
825
|
+
function Ze(e, t, n, r) {
|
|
740
826
|
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);
|
|
741
|
-
return a === 0 &&
|
|
827
|
+
return a === 0 && q(n, e, t) || o === 0 && q(r, e, t) || s === 0 && q(e, n, r) || c === 0 && q(t, n, r) ? !0 : a > 0 != o > 0 && s > 0 != c > 0;
|
|
742
828
|
}
|
|
743
|
-
function
|
|
829
|
+
function q(e, t, n) {
|
|
744
830
|
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);
|
|
745
831
|
}
|
|
746
|
-
function
|
|
832
|
+
function J(e, t) {
|
|
747
833
|
return e.x >= t.x && e.x <= t.x + t.width && e.y >= t.y && e.y <= t.y + t.height;
|
|
748
834
|
}
|
|
749
835
|
//#endregion
|
|
750
836
|
//#region ../core/dist/hierarchy/query.js
|
|
751
|
-
function
|
|
752
|
-
return
|
|
837
|
+
function Qe(e, t) {
|
|
838
|
+
return l(h(e), t);
|
|
753
839
|
}
|
|
754
|
-
function
|
|
755
|
-
return
|
|
840
|
+
function $e(e, t) {
|
|
841
|
+
return d(h(e), t);
|
|
756
842
|
}
|
|
757
843
|
//#endregion
|
|
758
844
|
//#region ../core/dist/history/history.js
|
|
759
|
-
function
|
|
760
|
-
return
|
|
845
|
+
function et(e) {
|
|
846
|
+
return T(e), {
|
|
761
847
|
past: [],
|
|
762
848
|
present: e,
|
|
763
849
|
future: []
|
|
764
850
|
};
|
|
765
851
|
}
|
|
766
|
-
function
|
|
767
|
-
if (
|
|
852
|
+
function tt(e, t, n = 100, r) {
|
|
853
|
+
if (Y(e), T(t), st(n), t === e.present) return e;
|
|
768
854
|
let i = [...e.past, {
|
|
769
855
|
before: e.present,
|
|
770
856
|
after: t,
|
|
@@ -776,26 +862,26 @@ function $e(e, t, n = 100, r) {
|
|
|
776
862
|
future: []
|
|
777
863
|
};
|
|
778
864
|
}
|
|
779
|
-
function
|
|
780
|
-
|
|
865
|
+
function nt(e) {
|
|
866
|
+
Y(e);
|
|
781
867
|
let t = e.past.at(-1);
|
|
782
868
|
return t === void 0 ? e : {
|
|
783
869
|
past: e.past.slice(0, -1),
|
|
784
870
|
present: t.before,
|
|
785
|
-
future: [
|
|
871
|
+
future: [ot(t), ...e.future]
|
|
786
872
|
};
|
|
787
873
|
}
|
|
788
|
-
function
|
|
789
|
-
|
|
874
|
+
function rt(e) {
|
|
875
|
+
Y(e);
|
|
790
876
|
let t = e.future[0];
|
|
791
877
|
return t === void 0 ? e : {
|
|
792
|
-
past: [...e.past,
|
|
878
|
+
past: [...e.past, ot(t)],
|
|
793
879
|
present: t.after,
|
|
794
880
|
future: e.future.slice(1)
|
|
795
881
|
};
|
|
796
882
|
}
|
|
797
|
-
function
|
|
798
|
-
if (
|
|
883
|
+
function it(e, t) {
|
|
884
|
+
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.");
|
|
799
885
|
let n = t === 0 ? e.past[0]?.before : e.past[t - 1]?.after;
|
|
800
886
|
return n === void 0 || n === e.present ? e : {
|
|
801
887
|
past: e.past.slice(0, t),
|
|
@@ -803,8 +889,8 @@ function nt(e, t) {
|
|
|
803
889
|
future: [...e.past.slice(t), ...e.future]
|
|
804
890
|
};
|
|
805
891
|
}
|
|
806
|
-
function
|
|
807
|
-
|
|
892
|
+
function at(e) {
|
|
893
|
+
Y(e);
|
|
808
894
|
let t = e.past.length, n = [{
|
|
809
895
|
index: 0,
|
|
810
896
|
position: t === 0 ? "current" : "past"
|
|
@@ -824,44 +910,44 @@ function rt(e) {
|
|
|
824
910
|
});
|
|
825
911
|
}), n;
|
|
826
912
|
}
|
|
827
|
-
function
|
|
913
|
+
function ot(e) {
|
|
828
914
|
return {
|
|
829
915
|
before: e.before,
|
|
830
916
|
after: e.after,
|
|
831
917
|
...e.provenance === void 0 ? {} : { provenance: e.provenance }
|
|
832
918
|
};
|
|
833
919
|
}
|
|
834
|
-
function
|
|
920
|
+
function Y(e) {
|
|
835
921
|
if (typeof e.present != "object" || e.present === null || !Array.isArray(e.past) || !Array.isArray(e.future)) throw TypeError("Screen history state is corrupted.");
|
|
836
922
|
}
|
|
837
|
-
function
|
|
923
|
+
function st(e) {
|
|
838
924
|
if (!Number.isInteger(e) || e < 1 || e > 1e3) throw RangeError("History limit must be an integer from 1 through 1000.");
|
|
839
925
|
}
|
|
840
926
|
//#endregion
|
|
841
927
|
//#region ../core/dist/state/interaction.js
|
|
842
|
-
function
|
|
843
|
-
|
|
844
|
-
let r =
|
|
845
|
-
if (typeof t != "object" || !t) return
|
|
928
|
+
function ct(e, t, n) {
|
|
929
|
+
T(n);
|
|
930
|
+
let r = X(e.selectedComponentIds, n);
|
|
931
|
+
if (typeof t != "object" || !t) return Z(e, r, e.focusedComponentId);
|
|
846
932
|
switch (t.type) {
|
|
847
|
-
case "replace-selection": return
|
|
933
|
+
case "replace-selection": return Z(e, Array.isArray(t.componentIds) ? X(t.componentIds, n) : r, t.focusedComponentId);
|
|
848
934
|
case "toggle-selection": {
|
|
849
|
-
if (typeof t.componentId != "string") return
|
|
850
|
-
let i =
|
|
851
|
-
if (i === void 0) return
|
|
852
|
-
let a = r.includes(i) ? r.filter((e) => e !== i) :
|
|
853
|
-
return
|
|
935
|
+
if (typeof t.componentId != "string") return Z(e, r, e.focusedComponentId);
|
|
936
|
+
let i = X([t.componentId], n)[0];
|
|
937
|
+
if (i === void 0) return Z(e, r, e.focusedComponentId);
|
|
938
|
+
let a = r.includes(i) ? r.filter((e) => e !== i) : X([...r, i], n);
|
|
939
|
+
return Z(e, a, a.includes(i) ? i : e.focusedComponentId);
|
|
854
940
|
}
|
|
855
|
-
case "clear-selection": return
|
|
856
|
-
case "reconcile-document": return
|
|
857
|
-
default: return
|
|
941
|
+
case "clear-selection": return Z(e, [], null);
|
|
942
|
+
case "reconcile-document": return Z(e, r, e.focusedComponentId);
|
|
943
|
+
default: return Z(e, r, e.focusedComponentId);
|
|
858
944
|
}
|
|
859
945
|
}
|
|
860
|
-
function
|
|
861
|
-
let n = new Set(e.filter((e) => typeof e == "string")), r =
|
|
862
|
-
return t.components.filter((e) => n.has(e.id) && !
|
|
946
|
+
function X(e, t) {
|
|
947
|
+
let n = new Set(e.filter((e) => typeof e == "string")), r = h(t);
|
|
948
|
+
return t.components.filter((e) => n.has(e.id) && !l(r, e.id)).map(({ id: e }) => e);
|
|
863
949
|
}
|
|
864
|
-
function
|
|
950
|
+
function Z(e, t, n) {
|
|
865
951
|
let r = typeof n == "string" && t.includes(n) ? n : null;
|
|
866
952
|
return e.focusedComponentId === r && e.selectedComponentIds.length === t.length && e.selectedComponentIds.every((e, n) => e === t[n]) ? e : {
|
|
867
953
|
selectedComponentIds: t,
|
|
@@ -870,181 +956,53 @@ function K(e, t, n) {
|
|
|
870
956
|
}
|
|
871
957
|
//#endregion
|
|
872
958
|
//#region ../core/dist/state/viewport.js
|
|
873
|
-
var
|
|
959
|
+
var lt = {
|
|
874
960
|
zoom: 1,
|
|
875
961
|
offset: {
|
|
876
962
|
x: 0,
|
|
877
963
|
y: 0
|
|
878
964
|
}
|
|
879
965
|
};
|
|
880
|
-
function
|
|
881
|
-
if (!
|
|
966
|
+
function ut(e, t) {
|
|
967
|
+
if (!dt(e) || typeof t != "object" || !t) return e;
|
|
882
968
|
switch (t.type) {
|
|
883
|
-
case "reset": return e.zoom === 1 && e.offset.x === 0 && e.offset.y === 0 ? e :
|
|
884
|
-
case "pan-by": return
|
|
969
|
+
case "reset": return e.zoom === 1 && e.offset.x === 0 && e.offset.y === 0 ? e : lt;
|
|
970
|
+
case "pan-by": return $(t.delta) ? Q(e, e.zoom, {
|
|
885
971
|
x: e.offset.x + t.delta.x,
|
|
886
972
|
y: e.offset.y + t.delta.y
|
|
887
973
|
}) : e;
|
|
888
|
-
case "set-offset": return
|
|
974
|
+
case "set-offset": return $(t.offset) ? Q(e, e.zoom, t.offset) : e;
|
|
889
975
|
case "set-zoom":
|
|
890
|
-
if (!
|
|
976
|
+
if (!ft(t.zoom) || !$(t.anchor)) return e;
|
|
891
977
|
let n = (t.anchor.x - e.offset.x) / e.zoom, r = (t.anchor.y - e.offset.y) / e.zoom;
|
|
892
|
-
return
|
|
978
|
+
return Q(e, t.zoom, {
|
|
893
979
|
x: t.anchor.x - n * t.zoom,
|
|
894
980
|
y: t.anchor.y - r * t.zoom
|
|
895
981
|
});
|
|
896
982
|
default: return e;
|
|
897
983
|
}
|
|
898
984
|
}
|
|
899
|
-
function
|
|
985
|
+
function Q(e, t, n) {
|
|
900
986
|
if (!Number.isFinite(n.x) || !Number.isFinite(n.y)) return e;
|
|
901
987
|
let r = {
|
|
902
|
-
x:
|
|
903
|
-
y:
|
|
988
|
+
x: x(n.x),
|
|
989
|
+
y: x(n.y)
|
|
904
990
|
};
|
|
905
991
|
return e.zoom === t && e.offset.x === r.x && e.offset.y === r.y ? e : {
|
|
906
|
-
zoom:
|
|
992
|
+
zoom: x(t),
|
|
907
993
|
offset: r
|
|
908
994
|
};
|
|
909
995
|
}
|
|
910
|
-
function
|
|
911
|
-
return
|
|
996
|
+
function dt(e) {
|
|
997
|
+
return ft(e.zoom) && $(e.offset);
|
|
912
998
|
}
|
|
913
|
-
function
|
|
999
|
+
function ft(e) {
|
|
914
1000
|
return typeof e == "number" && Number.isFinite(e) && e >= .05 && e <= 64;
|
|
915
1001
|
}
|
|
916
|
-
function J(e) {
|
|
917
|
-
return typeof e == "object" && !!e && typeof e.x == "number" && typeof e.y == "number" && Number.isFinite(e.x) && Number.isFinite(e.y);
|
|
918
|
-
}
|
|
919
|
-
//#endregion
|
|
920
|
-
//#region ../core/dist/validation/contrast.js
|
|
921
|
-
var dt = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i, ft = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i, pt = /^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,/]+([0-9.]+)(%?))?\s*\)$/i;
|
|
922
|
-
function mt(e) {
|
|
923
|
-
let t = e.trim(), n = dt.exec(t);
|
|
924
|
-
if (n !== null) return {
|
|
925
|
-
r: Number.parseInt(`${n[1]}${n[1]}`, 16),
|
|
926
|
-
g: Number.parseInt(`${n[2]}${n[2]}`, 16),
|
|
927
|
-
b: Number.parseInt(`${n[3]}${n[3]}`, 16)
|
|
928
|
-
};
|
|
929
|
-
let r = ft.exec(t);
|
|
930
|
-
if (r !== null) return {
|
|
931
|
-
r: Number.parseInt(r[1], 16),
|
|
932
|
-
g: Number.parseInt(r[2], 16),
|
|
933
|
-
b: Number.parseInt(r[3], 16)
|
|
934
|
-
};
|
|
935
|
-
let i = pt.exec(t);
|
|
936
|
-
if (i !== null) {
|
|
937
|
-
let e = i[4] === void 0 ? 1 : i[5] === "%" ? Number(i[4]) / 100 : Number(i[4]);
|
|
938
|
-
return !Number.isFinite(e) || e < 1 ? void 0 : {
|
|
939
|
-
r: $(Number(i[1])),
|
|
940
|
-
g: $(Number(i[2])),
|
|
941
|
-
b: $(Number(i[3]))
|
|
942
|
-
};
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
function ht(e) {
|
|
946
|
-
let t = e.trim();
|
|
947
|
-
if (t === "transparent") return {
|
|
948
|
-
color: {
|
|
949
|
-
r: 0,
|
|
950
|
-
g: 0,
|
|
951
|
-
b: 0
|
|
952
|
-
},
|
|
953
|
-
alpha: 0
|
|
954
|
-
};
|
|
955
|
-
let n = pt.exec(t);
|
|
956
|
-
if (n !== null) {
|
|
957
|
-
let e = n[4] === void 0 ? 1 : n[5] === "%" ? Number(n[4]) / 100 : Number(n[4]);
|
|
958
|
-
return Number.isFinite(e) ? {
|
|
959
|
-
color: {
|
|
960
|
-
r: $(Number(n[1])),
|
|
961
|
-
g: $(Number(n[2])),
|
|
962
|
-
b: $(Number(n[3]))
|
|
963
|
-
},
|
|
964
|
-
alpha: Math.min(1, Math.max(0, e))
|
|
965
|
-
} : void 0;
|
|
966
|
-
}
|
|
967
|
-
let r = mt(t);
|
|
968
|
-
return r === void 0 ? void 0 : {
|
|
969
|
-
color: r,
|
|
970
|
-
alpha: 1
|
|
971
|
-
};
|
|
972
|
-
}
|
|
973
|
-
function gt(e, t, n) {
|
|
974
|
-
let r = (e, n) => e * t + n * (1 - t);
|
|
975
|
-
return {
|
|
976
|
-
r: r(e.r, n.r),
|
|
977
|
-
g: r(e.g, n.g),
|
|
978
|
-
b: r(e.b, n.b)
|
|
979
|
-
};
|
|
980
|
-
}
|
|
981
|
-
function _t(e) {
|
|
982
|
-
let t = (e) => Math.round($(e)).toString(16).padStart(2, "0");
|
|
983
|
-
return `#${t(e.r)}${t(e.g)}${t(e.b)}`;
|
|
984
|
-
}
|
|
985
|
-
function Y(e) {
|
|
986
|
-
return .2126 * Q(e.r) + .7152 * Q(e.g) + .0722 * Q(e.b);
|
|
987
|
-
}
|
|
988
|
-
function X(e, t) {
|
|
989
|
-
let n = Y(e), r = Y(t), i = Math.max(n, r), a = Math.min(n, r);
|
|
990
|
-
return (i + .05) / (a + .05);
|
|
991
|
-
}
|
|
992
|
-
function vt(e, t) {
|
|
993
|
-
return e >= 24 || e >= 18.66 && t >= 700 ? 3 : 4.5;
|
|
994
|
-
}
|
|
995
|
-
function yt(e, t, n) {
|
|
996
|
-
if (X(e, t) >= n) return e;
|
|
997
|
-
let r = X({
|
|
998
|
-
r: 0,
|
|
999
|
-
g: 0,
|
|
1000
|
-
b: 0
|
|
1001
|
-
}, t), i = X({
|
|
1002
|
-
r: 255,
|
|
1003
|
-
g: 255,
|
|
1004
|
-
b: 255
|
|
1005
|
-
}, t), a = r >= i ? {
|
|
1006
|
-
r: 0,
|
|
1007
|
-
g: 0,
|
|
1008
|
-
b: 0
|
|
1009
|
-
} : {
|
|
1010
|
-
r: 255,
|
|
1011
|
-
g: 255,
|
|
1012
|
-
b: 255
|
|
1013
|
-
};
|
|
1014
|
-
if (Math.max(r, i) < n) return;
|
|
1015
|
-
let o = 0, s = 1;
|
|
1016
|
-
for (let r = 0; r < 24; r++) {
|
|
1017
|
-
let r = (o + s) / 2;
|
|
1018
|
-
X(Z(e, a, r), t) >= n ? s = r : o = r;
|
|
1019
|
-
}
|
|
1020
|
-
for (let r = s; r <= 1; r += .002) {
|
|
1021
|
-
let i = bt(Z(e, a, r));
|
|
1022
|
-
if (X(i, t) >= n) return i;
|
|
1023
|
-
}
|
|
1024
|
-
}
|
|
1025
|
-
function Z(e, t, n) {
|
|
1026
|
-
let r = (e, t) => e + (t - e) * n;
|
|
1027
|
-
return {
|
|
1028
|
-
r: r(e.r, t.r),
|
|
1029
|
-
g: r(e.g, t.g),
|
|
1030
|
-
b: r(e.b, t.b)
|
|
1031
|
-
};
|
|
1032
|
-
}
|
|
1033
|
-
function bt(e) {
|
|
1034
|
-
return {
|
|
1035
|
-
r: Math.round(e.r),
|
|
1036
|
-
g: Math.round(e.g),
|
|
1037
|
-
b: Math.round(e.b)
|
|
1038
|
-
};
|
|
1039
|
-
}
|
|
1040
|
-
function Q(e) {
|
|
1041
|
-
let t = $(e) / 255;
|
|
1042
|
-
return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
1043
|
-
}
|
|
1044
1002
|
function $(e) {
|
|
1045
|
-
return Number.isFinite(e)
|
|
1003
|
+
return typeof e == "object" && !!e && typeof e.x == "number" && typeof e.y == "number" && Number.isFinite(e.x) && Number.isFinite(e.y);
|
|
1046
1004
|
}
|
|
1047
1005
|
//#endregion
|
|
1048
|
-
export {
|
|
1006
|
+
export { w as C, g as D, y as E, xe as S, S as T, z as _, at as a, Me as b, nt as c, Ge as d, Ke as f, Be as g, ze as h, et as i, Qe as l, We as m, ct as n, rt as o, K as p, tt as r, it as s, ut as t, $e as u, Re as v, b as w, be as x, Pe as y };
|
|
1049
1007
|
|
|
1050
|
-
//# sourceMappingURL=
|
|
1008
|
+
//# sourceMappingURL=viewport-CiCKeAQH.js.map
|