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
package/dist/dist-DfAV2jGI.js
DELETED
|
@@ -1,2185 +0,0 @@
|
|
|
1
|
-
import { i as e, m as t } from "./image-url-D6mUcjY1.js";
|
|
2
|
-
import { t as n } from "./parse-B5b0hjql.js";
|
|
3
|
-
import { n as r, t as i } from "./definition-DlTP-401.js";
|
|
4
|
-
import { a, t as o } from "./dataset-port-CUsMmX2x.js";
|
|
5
|
-
import { T as s } from "./schema-C38FI_z2.js";
|
|
6
|
-
import { n as c, o as l } from "./parse-BQw3u9_4.js";
|
|
7
|
-
import { a as u, i as d, n as f, r as p } from "./read-data-value-WmMKWshv.js";
|
|
8
|
-
import { t as m } from "./equality-DjZ9cv4u.js";
|
|
9
|
-
import { n as h, t as g } from "./data-capabilities-V1eEBn7W.js";
|
|
10
|
-
import { a as ee, n as _, r as v } from "./material-schema-CtxTkCP2.js";
|
|
11
|
-
import { r as y, t as te } from "./runtime-dispatch-Dt9fhcI5.js";
|
|
12
|
-
import { o as ne } from "./hierarchy-BQZrZWbC.js";
|
|
13
|
-
import { a as re, r as b, t as x } from "./value-ref-y4_YKUP5.js";
|
|
14
|
-
//#region ../renderer/dist/index.js
|
|
15
|
-
function ie(e, t) {
|
|
16
|
-
let n = t.background;
|
|
17
|
-
e.style.backgroundColor = n?.type === "solid" ? n.color : t.backgroundColor;
|
|
18
|
-
let r = [], i = [];
|
|
19
|
-
t.backgroundImage !== void 0 && (r.push(`url("${oe(t.backgroundImage)}")`), i.push(t.backgroundImageFit === "contain" ? "contain" : "cover"));
|
|
20
|
-
let a = n === void 0 ? void 0 : ae(n);
|
|
21
|
-
if (a !== void 0 && (r.push(a), i.push("100% 100%")), r.length === 0) {
|
|
22
|
-
e.style.backgroundImage = "", e.style.backgroundSize = "", e.style.backgroundPosition = "", e.style.backgroundRepeat = "";
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
e.style.backgroundImage = r.join(", "), e.style.backgroundSize = i.join(", "), e.style.backgroundPosition = r.map(() => "center").join(", "), e.style.backgroundRepeat = r.map(() => "no-repeat").join(", ");
|
|
26
|
-
}
|
|
27
|
-
function ae(e) {
|
|
28
|
-
if (e.type === "solid") return;
|
|
29
|
-
let t = e.stops.map((e) => `${e.color} ${e.position}%`).join(", ");
|
|
30
|
-
return e.type === "linear-gradient" ? `linear-gradient(${e.angle}deg, ${t})` : `radial-gradient(circle at ${e.position.x}% ${e.position.y}%, ${t})`;
|
|
31
|
-
}
|
|
32
|
-
function oe(e) {
|
|
33
|
-
return e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
|
|
34
|
-
}
|
|
35
|
-
function S(e) {
|
|
36
|
-
if (e === null) return "null";
|
|
37
|
-
if (typeof e == "boolean") return e ? "true" : "false";
|
|
38
|
-
if (typeof e == "number" || typeof e == "string") return JSON.stringify(e);
|
|
39
|
-
if (Array.isArray(e)) return `[${e.map((e) => S(e)).join(",")}]`;
|
|
40
|
-
let t = e;
|
|
41
|
-
return `{${Object.keys(t).sort().map((e) => `${JSON.stringify(e)}:${S(t[e])}`).join(",")}}`;
|
|
42
|
-
}
|
|
43
|
-
function se() {
|
|
44
|
-
return {
|
|
45
|
-
projectionKey: void 0,
|
|
46
|
-
dataState: { status: "idle" }
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
function ce(e) {
|
|
50
|
-
return S(e);
|
|
51
|
-
}
|
|
52
|
-
function C(e, t) {
|
|
53
|
-
return e.map((e) => ({
|
|
54
|
-
...e,
|
|
55
|
-
path: [...t, ...e.path]
|
|
56
|
-
}));
|
|
57
|
-
}
|
|
58
|
-
function w(e, t, n) {
|
|
59
|
-
return {
|
|
60
|
-
severity: "error",
|
|
61
|
-
code: e,
|
|
62
|
-
path: t,
|
|
63
|
-
message: n
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
function T(e, t, n) {
|
|
67
|
-
return {
|
|
68
|
-
ok: !1,
|
|
69
|
-
diagnostics: [w(e, t, n)]
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
function E(e, t) {
|
|
73
|
-
return {
|
|
74
|
-
severity: "error",
|
|
75
|
-
code: "PLUGIN_CORE_RENDER_FAILED",
|
|
76
|
-
path: ["components", e.component.id],
|
|
77
|
-
message: t
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
function D(e) {
|
|
81
|
-
return t(e);
|
|
82
|
-
}
|
|
83
|
-
function le(e, t, r, i, a) {
|
|
84
|
-
if (r === null) return {
|
|
85
|
-
status: "ready",
|
|
86
|
-
value: t
|
|
87
|
-
};
|
|
88
|
-
let o = n(t);
|
|
89
|
-
return o.ok ? k(e, o.value, r, i, a, {
|
|
90
|
-
bindingCode: "Host dataset binding is invalid.",
|
|
91
|
-
adapterCode: "Host dataset adapter failed."
|
|
92
|
-
}) : {
|
|
93
|
-
status: "error",
|
|
94
|
-
code: "HOST_DATASET_INVALID",
|
|
95
|
-
message: "Host dataset is invalid."
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
function O(e, t, r) {
|
|
99
|
-
if (e.manifest.staticData?.kind !== "tabular") return {
|
|
100
|
-
status: "ready",
|
|
101
|
-
value: t
|
|
102
|
-
};
|
|
103
|
-
let i = n(t);
|
|
104
|
-
return i.ok ? r === null ? {
|
|
105
|
-
status: "error",
|
|
106
|
-
code: "HOST_DATASET_BINDING_INVALID",
|
|
107
|
-
message: "Static dataset binding is invalid."
|
|
108
|
-
} : k(e, i.value, r, void 0, void 0, {
|
|
109
|
-
bindingCode: "Static dataset binding is invalid.",
|
|
110
|
-
adapterCode: "Static dataset adapter failed."
|
|
111
|
-
}) : {
|
|
112
|
-
status: "error",
|
|
113
|
-
code: "HOST_DATASET_INVALID",
|
|
114
|
-
message: "Static dataset is invalid."
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
function k(t, n, r, i, a, o) {
|
|
118
|
-
let s = t.manifest.dataBinding, c = t.tabularDataAdapter;
|
|
119
|
-
if (s === void 0 || c === void 0) return {
|
|
120
|
-
status: "error",
|
|
121
|
-
code: "HOST_DATASET_BINDING_INVALID",
|
|
122
|
-
message: o.bindingCode
|
|
123
|
-
};
|
|
124
|
-
let l = re(r, n.fields, s.roles);
|
|
125
|
-
if (!l.ok) return {
|
|
126
|
-
status: "error",
|
|
127
|
-
code: "HOST_DATASET_BINDING_INVALID",
|
|
128
|
-
message: o.bindingCode
|
|
129
|
-
};
|
|
130
|
-
try {
|
|
131
|
-
let t = c.adapt({
|
|
132
|
-
dataset: n,
|
|
133
|
-
fields: l.value.fields
|
|
134
|
-
});
|
|
135
|
-
if (!t.ok) return {
|
|
136
|
-
status: "error",
|
|
137
|
-
code: "HOST_DATASET_ADAPTER_FAILED",
|
|
138
|
-
message: o.adapterCode
|
|
139
|
-
};
|
|
140
|
-
let r = e(t.value, { maxBytes: 1048576 });
|
|
141
|
-
return r.ok ? {
|
|
142
|
-
status: "ready",
|
|
143
|
-
value: r.value
|
|
144
|
-
} : {
|
|
145
|
-
status: "error",
|
|
146
|
-
code: "HOST_DATASET_ADAPTER_FAILED",
|
|
147
|
-
message: o.adapterCode
|
|
148
|
-
};
|
|
149
|
-
} catch {
|
|
150
|
-
return i !== void 0 && a?.(w("PLUGIN_CORE_RENDER_FAILED", [
|
|
151
|
-
"components",
|
|
152
|
-
i,
|
|
153
|
-
"dataBinding"
|
|
154
|
-
], "Material dataset adapter raised an exception.")), {
|
|
155
|
-
status: "error",
|
|
156
|
-
code: "HOST_DATASET_ADAPTER_FAILED",
|
|
157
|
-
message: o.adapterCode
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
function A(e, t, n, r, i, a, o, s = "fail") {
|
|
162
|
-
let c = [], l = [], u = /* @__PURE__ */ new Map();
|
|
163
|
-
for (let s = 0; s < e.components.length; s++) {
|
|
164
|
-
let d = e.components[s], f = t.get(d.type);
|
|
165
|
-
if (f === void 0) {
|
|
166
|
-
l.push(w("PLUGIN_CORE_IDENTITY_INVALID", [
|
|
167
|
-
"components",
|
|
168
|
-
s,
|
|
169
|
-
"type"
|
|
170
|
-
], "Component material is not enabled in this catalog."));
|
|
171
|
-
continue;
|
|
172
|
-
}
|
|
173
|
-
let p = o.entries.get(d), m, h;
|
|
174
|
-
if (p !== void 0 && p.entry === f) m = p.props, h = p.style, u.set(d, p);
|
|
175
|
-
else {
|
|
176
|
-
let e = _(d.props, f.manifest.propsSchema);
|
|
177
|
-
if (!e.ok) {
|
|
178
|
-
l.push(...C(e.diagnostics, [
|
|
179
|
-
"components",
|
|
180
|
-
s,
|
|
181
|
-
"props"
|
|
182
|
-
]));
|
|
183
|
-
continue;
|
|
184
|
-
}
|
|
185
|
-
let t = v(d.style, f.manifest.styleSchema);
|
|
186
|
-
if (!t.ok) {
|
|
187
|
-
l.push(...C(t.diagnostics, [
|
|
188
|
-
"components",
|
|
189
|
-
s,
|
|
190
|
-
"style"
|
|
191
|
-
]));
|
|
192
|
-
continue;
|
|
193
|
-
}
|
|
194
|
-
let n = d.styleRules ?? [], r = !0;
|
|
195
|
-
for (let e = 0; e < n.length; e++) {
|
|
196
|
-
let i = v({
|
|
197
|
-
...t.value,
|
|
198
|
-
...n[e].style
|
|
199
|
-
}, f.manifest.styleSchema);
|
|
200
|
-
if (!i.ok) {
|
|
201
|
-
l.push(...C(i.diagnostics, [
|
|
202
|
-
"components",
|
|
203
|
-
s,
|
|
204
|
-
"styleRules",
|
|
205
|
-
e,
|
|
206
|
-
"style"
|
|
207
|
-
])), r = !1;
|
|
208
|
-
break;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
if (!r) continue;
|
|
212
|
-
m = e.value, h = t.value, u.set(d, {
|
|
213
|
-
entry: f,
|
|
214
|
-
props: m,
|
|
215
|
-
style: h
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
let g = j(a, d, f, i, ["components", s]);
|
|
219
|
-
if ("diagnostic" in g) {
|
|
220
|
-
l.push(g.diagnostic);
|
|
221
|
-
continue;
|
|
222
|
-
}
|
|
223
|
-
c.push({
|
|
224
|
-
component: d,
|
|
225
|
-
entry: f,
|
|
226
|
-
model: {
|
|
227
|
-
componentId: d.id,
|
|
228
|
-
mode: n,
|
|
229
|
-
interactive: r,
|
|
230
|
-
props: m,
|
|
231
|
-
style: h,
|
|
232
|
-
size: {
|
|
233
|
-
width: d.size.width,
|
|
234
|
-
height: d.size.height
|
|
235
|
-
},
|
|
236
|
-
dataState: g.dataState
|
|
237
|
-
},
|
|
238
|
-
dataSource: g.dataSource,
|
|
239
|
-
dataEpoch: g.epoch
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
if (o.entries = u, l.length === 0) return {
|
|
243
|
-
ok: !0,
|
|
244
|
-
value: c,
|
|
245
|
-
diagnostics: []
|
|
246
|
-
};
|
|
247
|
-
let d = D(l);
|
|
248
|
-
return s === "skip" ? {
|
|
249
|
-
ok: !0,
|
|
250
|
-
value: c,
|
|
251
|
-
diagnostics: d
|
|
252
|
-
} : {
|
|
253
|
-
ok: !1,
|
|
254
|
-
diagnostics: d
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
function j(e, t, n, r, i, a) {
|
|
258
|
-
let o = p(t), s = f(t);
|
|
259
|
-
if (o === null) return s !== null || n.manifest.defaultData === void 0 ? {
|
|
260
|
-
dataState: { status: "idle" },
|
|
261
|
-
dataSource: void 0,
|
|
262
|
-
epoch: void 0
|
|
263
|
-
} : {
|
|
264
|
-
dataState: O(n, n.manifest.defaultData, n.manifest.staticData?.kind === "tabular" ? n.manifest.staticData.defaultBinding : null),
|
|
265
|
-
dataSource: void 0,
|
|
266
|
-
epoch: void 0
|
|
267
|
-
};
|
|
268
|
-
let c = o.kind === "data-source-field" ? e.read(o.dataSourceId) : void 0, l = c?.source;
|
|
269
|
-
if (!g(n.manifest.dataCapabilities, o, l)) return { diagnostic: w("PLUGIN_CORE_MANIFEST_FIELD_INVALID", [...i, "dataValue"], "Material does not accept the configured data source.") };
|
|
270
|
-
if (o.kind !== "data-source-field") return {
|
|
271
|
-
dataState: M(e.evaluate(o), n, s),
|
|
272
|
-
dataSource: void 0,
|
|
273
|
-
epoch: e.variablesKey
|
|
274
|
-
};
|
|
275
|
-
if (l === void 0 || c === void 0) return {
|
|
276
|
-
dataState: {
|
|
277
|
-
status: "error",
|
|
278
|
-
code: "HOST_RESOURCE_UNAVAILABLE",
|
|
279
|
-
message: "Host data source is unavailable."
|
|
280
|
-
},
|
|
281
|
-
dataSource: void 0,
|
|
282
|
-
epoch: void 0
|
|
283
|
-
};
|
|
284
|
-
let u = ue(l.kind === "host-resource" ? l.resourceType : void 0, r, i);
|
|
285
|
-
if (u !== void 0) return { diagnostic: u };
|
|
286
|
-
let d = {
|
|
287
|
-
dataSourceId: o.dataSourceId,
|
|
288
|
-
projectionKey: ce(s)
|
|
289
|
-
};
|
|
290
|
-
if (s !== null && (n.manifest.dataBinding === void 0 || n.tabularDataAdapter === void 0)) return {
|
|
291
|
-
dataState: {
|
|
292
|
-
status: "error",
|
|
293
|
-
code: "HOST_DATASET_BINDING_INVALID",
|
|
294
|
-
message: "Host dataset binding is invalid."
|
|
295
|
-
},
|
|
296
|
-
dataSource: d,
|
|
297
|
-
epoch: c.dataState
|
|
298
|
-
};
|
|
299
|
-
if (c.dataState.status === "error") return {
|
|
300
|
-
dataState: c.dataState,
|
|
301
|
-
dataSource: d,
|
|
302
|
-
epoch: c.dataState
|
|
303
|
-
};
|
|
304
|
-
let m = e.evaluate(o);
|
|
305
|
-
return c.dataState.status === "ready" && m.kind === "value" ? m.value === void 0 ? {
|
|
306
|
-
dataState: { status: "idle" },
|
|
307
|
-
dataSource: d,
|
|
308
|
-
epoch: c.dataState
|
|
309
|
-
} : {
|
|
310
|
-
dataState: le(n, m.value, s, t.id, a),
|
|
311
|
-
dataSource: d,
|
|
312
|
-
epoch: c.dataState
|
|
313
|
-
} : {
|
|
314
|
-
dataState: M(m, n, s),
|
|
315
|
-
dataSource: d,
|
|
316
|
-
epoch: c.dataState
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
function M(e, t, n) {
|
|
320
|
-
switch (e.kind) {
|
|
321
|
-
case "pending": return { status: "loading" };
|
|
322
|
-
case "failed": return e.reason === "variable-missing" ? {
|
|
323
|
-
status: "error",
|
|
324
|
-
code: "HOST_DATASET_INVALID",
|
|
325
|
-
message: "Variable data is unavailable."
|
|
326
|
-
} : e.reason === "value-invalid" ? {
|
|
327
|
-
status: "error",
|
|
328
|
-
code: "HOST_RESOURCE_INVALID",
|
|
329
|
-
message: "Host resource returned an invalid value."
|
|
330
|
-
} : {
|
|
331
|
-
status: "error",
|
|
332
|
-
code: "HOST_RESOURCE_FAILED",
|
|
333
|
-
message: "Host resource request failed."
|
|
334
|
-
};
|
|
335
|
-
default: return e.value === void 0 ? { status: "idle" } : O(t, e.value, n);
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
function ue(e, t, n) {
|
|
339
|
-
if (e !== void 0 && t !== void 0 && t.getResourceType(e) === void 0) return w("PLUGIN_CORE_CONTRIBUTION_UNKNOWN", [
|
|
340
|
-
...n,
|
|
341
|
-
"dataSource",
|
|
342
|
-
"resourceType"
|
|
343
|
-
], "Host resource type is not enabled by an active plugin contribution.");
|
|
344
|
-
}
|
|
345
|
-
function de(e, t) {
|
|
346
|
-
if (e === void 0 || e.length === 0 || t.status !== "ready") return;
|
|
347
|
-
let n;
|
|
348
|
-
for (let r of e) fe(r, t.value) && (n = {
|
|
349
|
-
...n ?? {},
|
|
350
|
-
...r.style
|
|
351
|
-
});
|
|
352
|
-
return n;
|
|
353
|
-
}
|
|
354
|
-
function fe(e, t) {
|
|
355
|
-
let n = pe(t, e.when.path);
|
|
356
|
-
if (e.when.operator === "exists") return n.ok;
|
|
357
|
-
if (!n.ok) return !1;
|
|
358
|
-
let r = n.value, i = e.when.value;
|
|
359
|
-
switch (e.when.operator) {
|
|
360
|
-
case "eq": return m(r, i);
|
|
361
|
-
case "neq": return !m(r, i);
|
|
362
|
-
case "gt":
|
|
363
|
-
case "gte":
|
|
364
|
-
case "lt":
|
|
365
|
-
case "lte": return !N(r) || !N(i) ? !1 : e.when.operator === "gt" ? r > i : e.when.operator === "gte" ? r >= i : e.when.operator === "lt" ? r < i : r <= i;
|
|
366
|
-
case "contains": return typeof r == "string" ? typeof i == "string" && r.includes(i) : Array.isArray(r) && r.some((e) => m(e, i));
|
|
367
|
-
default: return !1;
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
function pe(e, t) {
|
|
371
|
-
let n = e;
|
|
372
|
-
for (let e of t) {
|
|
373
|
-
if (typeof n != "object" || !n) return { ok: !1 };
|
|
374
|
-
if (Array.isArray(n)) {
|
|
375
|
-
if (!/^\d+$/.test(e)) return { ok: !1 };
|
|
376
|
-
let t = Number(e);
|
|
377
|
-
if (!Number.isSafeInteger(t) || t >= n.length) return { ok: !1 };
|
|
378
|
-
n = n[t];
|
|
379
|
-
continue;
|
|
380
|
-
}
|
|
381
|
-
if (!Object.prototype.hasOwnProperty.call(n, e)) return { ok: !1 };
|
|
382
|
-
n = n[e];
|
|
383
|
-
}
|
|
384
|
-
return {
|
|
385
|
-
ok: !0,
|
|
386
|
-
value: n
|
|
387
|
-
};
|
|
388
|
-
}
|
|
389
|
-
function N(e) {
|
|
390
|
-
return typeof e == "number" && Number.isFinite(e);
|
|
391
|
-
}
|
|
392
|
-
function P(e, t, n) {
|
|
393
|
-
let r = de(t.component.styleRules, n), i = r === void 0 ? t.model.style : {
|
|
394
|
-
...t.model.style,
|
|
395
|
-
...r
|
|
396
|
-
}, a = e.options.conditionalStylePort;
|
|
397
|
-
if (a !== void 0) {
|
|
398
|
-
let r = me(e, a, t.component.id, n);
|
|
399
|
-
if (r !== void 0) {
|
|
400
|
-
let n = v({
|
|
401
|
-
...i,
|
|
402
|
-
...r
|
|
403
|
-
}, t.entry.manifest.styleSchema);
|
|
404
|
-
if (n.ok) i = n.value;
|
|
405
|
-
else for (let r of C(n.diagnostics, [
|
|
406
|
-
"components",
|
|
407
|
-
t.component.id,
|
|
408
|
-
"conditionalStyle"
|
|
409
|
-
])) e.options.onDiagnostic?.(r);
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
return {
|
|
413
|
-
...t.model,
|
|
414
|
-
dataState: n,
|
|
415
|
-
style: i
|
|
416
|
-
};
|
|
417
|
-
}
|
|
418
|
-
function me(e, t, n, r) {
|
|
419
|
-
try {
|
|
420
|
-
return t.resolve({
|
|
421
|
-
componentId: n,
|
|
422
|
-
dataState: r
|
|
423
|
-
});
|
|
424
|
-
} catch {
|
|
425
|
-
e.options.onDiagnostic?.(w("PLUGIN_CORE_RENDER_FAILED", [
|
|
426
|
-
"components",
|
|
427
|
-
n,
|
|
428
|
-
"conditionalStyle"
|
|
429
|
-
], "Conditional style port resolve raised an exception."));
|
|
430
|
-
return;
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
function F(e, t, n, r, i) {
|
|
434
|
-
I(e, t, n, i), e.model = n, L(e, r);
|
|
435
|
-
}
|
|
436
|
-
function I(e, t, n, r) {
|
|
437
|
-
let i = t.position, a = e.style;
|
|
438
|
-
a.position !== "absolute" && (a.position = "absolute");
|
|
439
|
-
let o = `${i.x}px`;
|
|
440
|
-
a.left !== o && (a.left = o);
|
|
441
|
-
let s = `${i.y}px`;
|
|
442
|
-
a.top !== s && (a.top = s);
|
|
443
|
-
let c = `${t.size.width}px`;
|
|
444
|
-
a.width !== "max-content" && a.width !== c && (a.width = c);
|
|
445
|
-
let l = `${t.size.height}px`;
|
|
446
|
-
a.height !== l && (a.height = l);
|
|
447
|
-
let u = String(r);
|
|
448
|
-
a.zIndex !== u && (a.zIndex = u), e.dataset.baseScreenComponentId !== t.id && (e.dataset.baseScreenComponentId = t.id), a.transformOrigin !== "center" && (a.transformOrigin = "center");
|
|
449
|
-
let d = `rotate(${t.rotation}deg)`, f = n.style.flipX === !0 ? -1 : 1, p = n.style.flipY === !0 ? -1 : 1, m = f === 1 && p === 1 ? d : `${d} scale(${f}, ${p})`;
|
|
450
|
-
a.transform !== m && (a.transform = m);
|
|
451
|
-
let h = typeof n.style.opacity == "number" && Number.isFinite(n.style.opacity) ? String(Math.min(1, Math.max(0, n.style.opacity))) : "";
|
|
452
|
-
a.opacity !== h && (a.opacity = h);
|
|
453
|
-
}
|
|
454
|
-
function L(e, t) {
|
|
455
|
-
let n = t ? "none" : "block";
|
|
456
|
-
e.style.display !== n && (e.style.display = n);
|
|
457
|
-
}
|
|
458
|
-
function R(e, t, n, r) {
|
|
459
|
-
n.stackOrder = r, n.projection.projectionKey = t.dataSource?.projectionKey, n.projection.dataState = t.model.dataState;
|
|
460
|
-
let i = B(e, t, r);
|
|
461
|
-
if (n.applied !== void 0 && n.appliedModel !== void 0 && he(n.applied, i)) {
|
|
462
|
-
I(n.element, t.component, n.appliedModel, r), L(n.element, e.visibility.isHidden(t.component.id));
|
|
463
|
-
return;
|
|
464
|
-
}
|
|
465
|
-
z(e, t, n, r);
|
|
466
|
-
}
|
|
467
|
-
function z(e, t, n, r) {
|
|
468
|
-
let i = P(e, t, t.model.dataState);
|
|
469
|
-
F(n.element, t.component, i, e.visibility.isHidden(t.component.id), r), n.applied = B(e, t, r), n.appliedModel = i;
|
|
470
|
-
}
|
|
471
|
-
function B(e, t, n) {
|
|
472
|
-
return {
|
|
473
|
-
component: t.component,
|
|
474
|
-
entry: t.entry,
|
|
475
|
-
interactive: t.model.interactive,
|
|
476
|
-
stackOrder: n,
|
|
477
|
-
hidden: e.visibility.isHidden(t.component.id),
|
|
478
|
-
dataEpoch: t.dataEpoch
|
|
479
|
-
};
|
|
480
|
-
}
|
|
481
|
-
function he(e, t) {
|
|
482
|
-
return e.component === t.component && e.entry === t.entry && e.interactive === t.interactive && e.stackOrder === t.stackOrder && e.hidden === t.hidden && e.dataEpoch === t.dataEpoch;
|
|
483
|
-
}
|
|
484
|
-
function ge(e, t, n) {
|
|
485
|
-
let r = P(e, t, t.model.dataState);
|
|
486
|
-
n.element.model = r, n.appliedModel = r;
|
|
487
|
-
}
|
|
488
|
-
function _e(e, t, n) {
|
|
489
|
-
if (n.bubbles !== !0 || n.composed !== !0 || n.type !== "base-screen-material-event") return;
|
|
490
|
-
let r = e.candidates.get(t.component.id) ?? t;
|
|
491
|
-
if (r.model.interactive !== !0) return;
|
|
492
|
-
let i = ee(n.detail);
|
|
493
|
-
if (!(!i.ok || !r.entry.manifest.events.includes(i.value.name))) {
|
|
494
|
-
n.stopPropagation();
|
|
495
|
-
try {
|
|
496
|
-
e.options.onMaterialEvent?.({
|
|
497
|
-
componentId: r.component.id,
|
|
498
|
-
type: r.component.type,
|
|
499
|
-
name: i.value.name,
|
|
500
|
-
payload: i.value.payload
|
|
501
|
-
});
|
|
502
|
-
} catch {
|
|
503
|
-
e.options.onDiagnostic?.({
|
|
504
|
-
severity: "error",
|
|
505
|
-
code: "PLUGIN_CORE_RENDER_FAILED",
|
|
506
|
-
path: ["components", r.component.id],
|
|
507
|
-
message: "Host material event callback raised an exception."
|
|
508
|
-
});
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
var ve = class {
|
|
513
|
-
root;
|
|
514
|
-
#e = /* @__PURE__ */ new Map();
|
|
515
|
-
#t = /* @__PURE__ */ new Map();
|
|
516
|
-
#n = /* @__PURE__ */ new Map();
|
|
517
|
-
constructor(e) {
|
|
518
|
-
this.root = e;
|
|
519
|
-
}
|
|
520
|
-
prepare(e) {
|
|
521
|
-
this.#e = new Map(e.components.map((e) => [e.id, e]));
|
|
522
|
-
}
|
|
523
|
-
isHidden(e) {
|
|
524
|
-
let t = this.#e.get(e), n = /* @__PURE__ */ new Set();
|
|
525
|
-
for (; t !== void 0 && !n.has(t.id);) {
|
|
526
|
-
n.add(t.id);
|
|
527
|
-
let e = this.#t.get(t.id);
|
|
528
|
-
if (e === !1 || e === void 0 && t.status.hidden) return !0;
|
|
529
|
-
t = t.parentId === null ? void 0 : this.#e.get(t.parentId);
|
|
530
|
-
}
|
|
531
|
-
return !1;
|
|
532
|
-
}
|
|
533
|
-
apply(e, t, n) {
|
|
534
|
-
if (t === void 0 || e.length === 0) return {
|
|
535
|
-
ok: !0,
|
|
536
|
-
value: null,
|
|
537
|
-
diagnostics: []
|
|
538
|
-
};
|
|
539
|
-
this.prepare(t);
|
|
540
|
-
for (let t of e) {
|
|
541
|
-
let e = this.#e.get(t.componentId);
|
|
542
|
-
if (e === void 0) return {
|
|
543
|
-
ok: !1,
|
|
544
|
-
diagnostics: [{
|
|
545
|
-
severity: "error",
|
|
546
|
-
code: "DOCUMENT_FIELD_INVALID",
|
|
547
|
-
path: ["blueprint", "componentId"],
|
|
548
|
-
message: "Blueprint visibility target is missing."
|
|
549
|
-
}]
|
|
550
|
-
};
|
|
551
|
-
let r = /* @__PURE__ */ new Map();
|
|
552
|
-
for (let e of n.keys()) r.set(e, this.isHidden(e));
|
|
553
|
-
let i = this.#t.get(t.componentId) ?? !e.status.hidden, a = t.operation === "show" || t.operation !== "hide" && !i;
|
|
554
|
-
this.#t.set(t.componentId, a);
|
|
555
|
-
for (let [e, i] of n) {
|
|
556
|
-
let n = this.isHidden(e);
|
|
557
|
-
(r.get(e) ?? !1) !== n && this.animate(e, i.element, !n, t.transition);
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
return {
|
|
561
|
-
ok: !0,
|
|
562
|
-
value: null,
|
|
563
|
-
diagnostics: []
|
|
564
|
-
};
|
|
565
|
-
}
|
|
566
|
-
reset() {
|
|
567
|
-
for (let e of this.#n.values()) e.cancel();
|
|
568
|
-
this.#n.clear(), this.#t.clear();
|
|
569
|
-
}
|
|
570
|
-
animate(e, t, n, r) {
|
|
571
|
-
let i = this.#n.get(e), a = this.root.ownerDocument?.defaultView, o = a?.getComputedStyle(t), s = o?.opacity ?? (n ? "0" : "1"), c = o?.translate ?? "none";
|
|
572
|
-
i?.cancel(), this.#n.delete(e);
|
|
573
|
-
let l = a?.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? !1;
|
|
574
|
-
if (r === void 0 || r.effect === "appear" || r.durationMs === 0 || l || typeof t.animate != "function") {
|
|
575
|
-
t.style.display = n ? "block" : "none";
|
|
576
|
-
return;
|
|
577
|
-
}
|
|
578
|
-
n && (t.style.display = "block");
|
|
579
|
-
let u = t.style.opacity.length > 0 ? t.style.opacity : "1", d = r.effect === "slide-up", f = n ? [{
|
|
580
|
-
opacity: s,
|
|
581
|
-
...d ? { translate: c } : {}
|
|
582
|
-
}, {
|
|
583
|
-
opacity: u,
|
|
584
|
-
...d ? { translate: "0 0" } : {}
|
|
585
|
-
}] : [{
|
|
586
|
-
opacity: s,
|
|
587
|
-
...d ? { translate: c } : {}
|
|
588
|
-
}, {
|
|
589
|
-
opacity: "0",
|
|
590
|
-
...d ? { translate: "0 12px" } : {}
|
|
591
|
-
}], p = t.animate(f, {
|
|
592
|
-
duration: r.durationMs,
|
|
593
|
-
easing: ye(r.easing),
|
|
594
|
-
fill: "none"
|
|
595
|
-
});
|
|
596
|
-
this.#n.set(e, p), p.finished.then(() => {
|
|
597
|
-
this.#n.get(e) === p && (this.#n.delete(e), t.style.display = n ? "block" : "none");
|
|
598
|
-
}).catch(() => void 0);
|
|
599
|
-
}
|
|
600
|
-
};
|
|
601
|
-
function ye(e) {
|
|
602
|
-
return e === "ease-in-out-quad" ? "cubic-bezier(0.455, 0.03, 0.515, 0.955)" : e === "ease-in-out-expo" ? "cubic-bezier(1, 0, 0, 1)" : "linear";
|
|
603
|
-
}
|
|
604
|
-
var be = "#source-dataset", xe = "#source-resource", Se = "#source";
|
|
605
|
-
function Ce(e) {
|
|
606
|
-
return e.kind === "dataset" ? be : e.kind === "host-resource" ? xe : Se;
|
|
607
|
-
}
|
|
608
|
-
var we = class {
|
|
609
|
-
resources;
|
|
610
|
-
datasets;
|
|
611
|
-
hostCatalog;
|
|
612
|
-
#e = /* @__PURE__ */ new Map();
|
|
613
|
-
#t = 0;
|
|
614
|
-
constructor(e, t, n) {
|
|
615
|
-
this.resources = e, this.datasets = t, this.hostCatalog = n;
|
|
616
|
-
}
|
|
617
|
-
clear() {
|
|
618
|
-
this.#t++, this.#e.clear();
|
|
619
|
-
}
|
|
620
|
-
accepts(e) {
|
|
621
|
-
switch (e.kind) {
|
|
622
|
-
case "dataset": return this.datasets !== void 0;
|
|
623
|
-
case "host-resource": return this.resources !== void 0;
|
|
624
|
-
default: return this.hostCatalog !== void 0;
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
query(e, t) {
|
|
628
|
-
switch (e.source.kind) {
|
|
629
|
-
case "dataset": return this.queryDataset(e, e.source.datasetId, t);
|
|
630
|
-
case "host-resource": return this.resources?.resolve({
|
|
631
|
-
dataSourceId: e.dataSourceId,
|
|
632
|
-
resourceType: e.source.resourceType,
|
|
633
|
-
resourceId: e.source.resourceId,
|
|
634
|
-
params: e.params
|
|
635
|
-
}, t) ?? Promise.resolve(V());
|
|
636
|
-
default: return this.hostCatalog?.resolve({
|
|
637
|
-
sourceId: e.source.sourceId,
|
|
638
|
-
params: e.params,
|
|
639
|
-
purpose: "runtime",
|
|
640
|
-
signal: t.signal
|
|
641
|
-
}) ?? Promise.resolve(V());
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
async queryDataset(e, t, a) {
|
|
645
|
-
if (this.datasets === void 0) return V();
|
|
646
|
-
let o = this.#t, s = () => !a.signal.aborted && o === this.#t;
|
|
647
|
-
if (!s()) return U();
|
|
648
|
-
let c = this.#e.get(t);
|
|
649
|
-
if (c === void 0) {
|
|
650
|
-
let e = await this.datasets.describe({
|
|
651
|
-
datasetId: t,
|
|
652
|
-
signal: a.signal
|
|
653
|
-
});
|
|
654
|
-
if (!s()) return U();
|
|
655
|
-
if (!e.ok) return e;
|
|
656
|
-
let n = r(e.value);
|
|
657
|
-
if (!n.ok) return n;
|
|
658
|
-
if (n.value.datasetId !== t) return H();
|
|
659
|
-
c = n.value, this.#e.size >= 32 && this.#e.delete(this.#e.keys().next().value), this.#e.set(t, c);
|
|
660
|
-
}
|
|
661
|
-
let l = i(c.parameters, e.params);
|
|
662
|
-
if (!l.ok) return l;
|
|
663
|
-
if (!s()) return U();
|
|
664
|
-
let u = await this.datasets.query({
|
|
665
|
-
datasetId: t,
|
|
666
|
-
dataSourceId: e.dataSourceId,
|
|
667
|
-
params: l.value
|
|
668
|
-
}, a);
|
|
669
|
-
if (!s()) return U();
|
|
670
|
-
if (!u.ok) return u;
|
|
671
|
-
let d = n(u.value);
|
|
672
|
-
return d.ok ? S(d.value.fields) === S(c.fields) ? {
|
|
673
|
-
ok: !0,
|
|
674
|
-
value: d.value,
|
|
675
|
-
diagnostics: []
|
|
676
|
-
} : H() : d;
|
|
677
|
-
}
|
|
678
|
-
};
|
|
679
|
-
function V() {
|
|
680
|
-
return {
|
|
681
|
-
ok: !1,
|
|
682
|
-
diagnostics: [{
|
|
683
|
-
severity: "error",
|
|
684
|
-
code: "HOST_RESOURCE_UNAVAILABLE",
|
|
685
|
-
path: [],
|
|
686
|
-
message: "Host resource port is unavailable."
|
|
687
|
-
}]
|
|
688
|
-
};
|
|
689
|
-
}
|
|
690
|
-
function H() {
|
|
691
|
-
return {
|
|
692
|
-
ok: !1,
|
|
693
|
-
diagnostics: [{
|
|
694
|
-
severity: "error",
|
|
695
|
-
code: "HOST_DATASET_INVALID",
|
|
696
|
-
path: [],
|
|
697
|
-
message: "Dataset definition does not match its result."
|
|
698
|
-
}]
|
|
699
|
-
};
|
|
700
|
-
}
|
|
701
|
-
function U() {
|
|
702
|
-
return {
|
|
703
|
-
ok: !1,
|
|
704
|
-
diagnostics: []
|
|
705
|
-
};
|
|
706
|
-
}
|
|
707
|
-
var Te = class {
|
|
708
|
-
options;
|
|
709
|
-
#e = /* @__PURE__ */ new Map();
|
|
710
|
-
#t;
|
|
711
|
-
#n = {};
|
|
712
|
-
#r = S({});
|
|
713
|
-
constructor(e) {
|
|
714
|
-
this.options = e;
|
|
715
|
-
}
|
|
716
|
-
get variablesKey() {
|
|
717
|
-
return this.#r;
|
|
718
|
-
}
|
|
719
|
-
ensure(e, t, n, r = {}) {
|
|
720
|
-
this.#t = e, t !== this.#n && (this.#n = t, this.#r = S(t));
|
|
721
|
-
let i = {
|
|
722
|
-
variableValues: t,
|
|
723
|
-
dataSourceValues: /* @__PURE__ */ new Map(),
|
|
724
|
-
dataSourceErrors: /* @__PURE__ */ new Map()
|
|
725
|
-
}, a = Ee(e);
|
|
726
|
-
for (let e of a) {
|
|
727
|
-
let t = this.#i(e.id);
|
|
728
|
-
t.source = e.source, this.#a(t, e, i, n, r.startOnly);
|
|
729
|
-
}
|
|
730
|
-
let o = new Set(a.map((e) => e.id));
|
|
731
|
-
for (let [e, t] of this.#e) o.has(e) || (this.#l(t), this.#e.delete(e));
|
|
732
|
-
}
|
|
733
|
-
reportProjection(e, t, n) {
|
|
734
|
-
let r = this.#e.get(e);
|
|
735
|
-
if (r === void 0) return;
|
|
736
|
-
let i = W(n);
|
|
737
|
-
this.#u(r, "adapted", {
|
|
738
|
-
startedAt: r.startedAt,
|
|
739
|
-
...i
|
|
740
|
-
}, t);
|
|
741
|
-
}
|
|
742
|
-
read(e) {
|
|
743
|
-
return this.#e.get(e);
|
|
744
|
-
}
|
|
745
|
-
entryIds() {
|
|
746
|
-
return [...this.#e.keys()];
|
|
747
|
-
}
|
|
748
|
-
evaluate(e) {
|
|
749
|
-
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
|
|
750
|
-
if (e.kind === "data-source-field") {
|
|
751
|
-
let r = this.#e.get(e.dataSourceId);
|
|
752
|
-
r?.dataState.status === "ready" && r.rawValue !== void 0 ? t.set(e.dataSourceId, r.rawValue) : r?.dataState.status === "error" && n.set(e.dataSourceId, r.rawError ?? G("Host data source failed."));
|
|
753
|
-
}
|
|
754
|
-
let r = {
|
|
755
|
-
variableValues: this.#n,
|
|
756
|
-
dataSourceValues: t,
|
|
757
|
-
dataSourceErrors: n
|
|
758
|
-
};
|
|
759
|
-
return b(e, r);
|
|
760
|
-
}
|
|
761
|
-
refresh(e, t) {
|
|
762
|
-
let n = e === void 0 ? [...this.#e.keys()] : this.#e.has(e) ? [e] : [], r = [];
|
|
763
|
-
for (let e of n) {
|
|
764
|
-
let n = this.#e.get(e);
|
|
765
|
-
n.requestKey !== void 0 && (n.requestSlotId === void 0 || this.options.coordinator?.isPending(n.requestSlotId) !== !0) && (this.#l(n), this.#s(n, t ?? {
|
|
766
|
-
trigger: "manual",
|
|
767
|
-
traceId: ""
|
|
768
|
-
}), r.push(e));
|
|
769
|
-
}
|
|
770
|
-
return r;
|
|
771
|
-
}
|
|
772
|
-
suspend() {
|
|
773
|
-
for (let e of this.#e.values()) this.#l(e), e.dataState = { status: "loading" }, e.rawValue = void 0, e.rawError = void 0, this.options.onChanged(e.dataSourceId);
|
|
774
|
-
}
|
|
775
|
-
clear() {
|
|
776
|
-
for (let e of this.#e.values()) this.#l(e);
|
|
777
|
-
this.#e.clear(), this.#t = void 0, this.#n = {}, this.#r = S({});
|
|
778
|
-
}
|
|
779
|
-
#i(e) {
|
|
780
|
-
let t = this.#e.get(e);
|
|
781
|
-
if (t !== void 0) return t;
|
|
782
|
-
let n = {
|
|
783
|
-
dataSourceId: e,
|
|
784
|
-
requestKey: void 0,
|
|
785
|
-
dataState: { status: "loading" },
|
|
786
|
-
rawValue: void 0,
|
|
787
|
-
generation: 0,
|
|
788
|
-
requestSlotId: void 0,
|
|
789
|
-
rawError: void 0,
|
|
790
|
-
source: void 0,
|
|
791
|
-
params: {},
|
|
792
|
-
requestId: void 0,
|
|
793
|
-
executionContext: void 0,
|
|
794
|
-
startedAt: void 0
|
|
795
|
-
};
|
|
796
|
-
return this.#e.set(e, n), n;
|
|
797
|
-
}
|
|
798
|
-
#a(e, t, n, r, i) {
|
|
799
|
-
let a = this.#o(t.params, n);
|
|
800
|
-
if (a.kind === "pending") {
|
|
801
|
-
e.dataState = { status: "loading" };
|
|
802
|
-
return;
|
|
803
|
-
}
|
|
804
|
-
if (a.kind === "failed") {
|
|
805
|
-
this.#c(e, a.diagnostic), n.dataSourceErrors.set(e.dataSourceId, a.diagnostic);
|
|
806
|
-
return;
|
|
807
|
-
}
|
|
808
|
-
let o = De(e.dataSourceId, t.source, a.params);
|
|
809
|
-
if (e.requestKey !== o && (this.#l(e), e.requestKey = o, e.params = a.params, e.dataState = { status: "loading" }, e.rawValue = void 0, e.rawError = void 0), e.requestSlotId === void 0) {
|
|
810
|
-
if (e.dataState.status === "ready") {
|
|
811
|
-
e.rawValue !== void 0 && n.dataSourceValues.set(e.dataSourceId, e.rawValue);
|
|
812
|
-
return;
|
|
813
|
-
}
|
|
814
|
-
if (e.dataState.status === "error") {
|
|
815
|
-
n.dataSourceErrors.set(e.dataSourceId, e.rawError ?? G("Host data source failed."));
|
|
816
|
-
return;
|
|
817
|
-
}
|
|
818
|
-
i !== void 0 && !i.has(e.dataSourceId) || this.#s(e, r);
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
#o(e, t) {
|
|
822
|
-
let n = {}, r = !1;
|
|
823
|
-
for (let [i, a] of Object.entries(e)) {
|
|
824
|
-
let e = b(a, t);
|
|
825
|
-
if (e.kind === "pending") {
|
|
826
|
-
r = !0;
|
|
827
|
-
continue;
|
|
828
|
-
}
|
|
829
|
-
if (e.kind === "failed") return {
|
|
830
|
-
kind: "failed",
|
|
831
|
-
diagnostic: G(e.reason === "variable-missing" ? "Data source parameter references a variable without a value." : "Data source parameter is invalid.")
|
|
832
|
-
};
|
|
833
|
-
if (e.value === void 0) return {
|
|
834
|
-
kind: "failed",
|
|
835
|
-
diagnostic: G("Data source parameter resolved to no value.")
|
|
836
|
-
};
|
|
837
|
-
n[i] = e.value;
|
|
838
|
-
}
|
|
839
|
-
return r ? { kind: "pending" } : {
|
|
840
|
-
kind: "ok",
|
|
841
|
-
params: n
|
|
842
|
-
};
|
|
843
|
-
}
|
|
844
|
-
#s(t, n) {
|
|
845
|
-
let r = t.source;
|
|
846
|
-
if (r === void 0 || t.requestKey === void 0 || this.options.isSuspended()) return;
|
|
847
|
-
if (!this.options.sourcePort.accepts(r)) {
|
|
848
|
-
this.#c(t, {
|
|
849
|
-
severity: "error",
|
|
850
|
-
code: "HOST_RESOURCE_UNAVAILABLE",
|
|
851
|
-
path: [],
|
|
852
|
-
message: "Host resource port is unavailable."
|
|
853
|
-
}, { emitStarted: !0 }), this.options.onChanged(t.dataSourceId);
|
|
854
|
-
return;
|
|
855
|
-
}
|
|
856
|
-
let i = this.options.validateParams?.(r, t.params);
|
|
857
|
-
if (i !== void 0) {
|
|
858
|
-
this.#c(t, i, { emitStarted: !1 }), this.options.onChanged(t.dataSourceId);
|
|
859
|
-
return;
|
|
860
|
-
}
|
|
861
|
-
let o = this.options.coordinator;
|
|
862
|
-
if (o === void 0) {
|
|
863
|
-
this.options.onChanged(t.dataSourceId);
|
|
864
|
-
return;
|
|
865
|
-
}
|
|
866
|
-
let c = ++t.generation, l = this.options.createExecutionContext(n, t.dataSourceId), u = Date.now(), d = `${t.dataSourceId}:${t.requestKey}:${c}`;
|
|
867
|
-
t.executionContext = l, t.startedAt = u, t.requestId = d;
|
|
868
|
-
let { resolution: f, slotId: p } = o.request(t.requestKey, Ce(r), t.dataSourceId, {
|
|
869
|
-
dataSourceId: t.dataSourceId,
|
|
870
|
-
source: r,
|
|
871
|
-
params: t.params
|
|
872
|
-
}, l);
|
|
873
|
-
t.requestSlotId = p, this.#u(t, "started", { startedAt: u }), f.then((n) => {
|
|
874
|
-
if (this.#e.get(t.dataSourceId) !== t || t.generation !== c || t.requestSlotId !== p) return;
|
|
875
|
-
if (t.requestSlotId = void 0, n.kind === "timeout") {
|
|
876
|
-
this.#c(t, {
|
|
877
|
-
severity: "error",
|
|
878
|
-
code: "HOST_RESOURCE_TIMEOUT",
|
|
879
|
-
path: [],
|
|
880
|
-
message: "Host data source request timed out."
|
|
881
|
-
}, { emitStarted: !1 }), this.#u(t, "timed-out", {
|
|
882
|
-
startedAt: u,
|
|
883
|
-
code: "HOST_RESOURCE_TIMEOUT"
|
|
884
|
-
}), this.options.onChanged(t.dataSourceId);
|
|
885
|
-
return;
|
|
886
|
-
}
|
|
887
|
-
if (n.kind === "failure") {
|
|
888
|
-
let e = n.diagnostics.diagnostics[0], r = e === void 0 ? G() : e;
|
|
889
|
-
this.#c(t, r, { emitStarted: !1 }), this.#u(t, "failed", {
|
|
890
|
-
startedAt: u,
|
|
891
|
-
code: a(r).code
|
|
892
|
-
}), this.options.onChanged(t.dataSourceId);
|
|
893
|
-
return;
|
|
894
|
-
}
|
|
895
|
-
let r = e(n.value, { maxBytes: s });
|
|
896
|
-
if (!r.ok) {
|
|
897
|
-
let e = {
|
|
898
|
-
severity: "error",
|
|
899
|
-
code: "HOST_RESOURCE_INVALID",
|
|
900
|
-
path: [],
|
|
901
|
-
message: "Host data source returned invalid JSON."
|
|
902
|
-
};
|
|
903
|
-
this.#c(t, e, { emitStarted: !1 }), this.#u(t, "failed", {
|
|
904
|
-
startedAt: u,
|
|
905
|
-
code: e.code
|
|
906
|
-
}), this.options.onChanged(t.dataSourceId);
|
|
907
|
-
return;
|
|
908
|
-
}
|
|
909
|
-
t.dataState = {
|
|
910
|
-
status: "ready",
|
|
911
|
-
value: r.value
|
|
912
|
-
}, t.rawValue = r.value, t.rawError = void 0;
|
|
913
|
-
let i = W(r.value);
|
|
914
|
-
this.#u(t, "succeeded", {
|
|
915
|
-
startedAt: u,
|
|
916
|
-
...i
|
|
917
|
-
}), this.options.onChanged(t.dataSourceId);
|
|
918
|
-
});
|
|
919
|
-
}
|
|
920
|
-
#c(e, t, n = { emitStarted: !1 }) {
|
|
921
|
-
e.generation++, e.requestSlotId = void 0, e.rawValue = void 0, e.rawError = t;
|
|
922
|
-
let r = a(t);
|
|
923
|
-
e.dataState = {
|
|
924
|
-
status: "error",
|
|
925
|
-
code: r.code,
|
|
926
|
-
message: r.message
|
|
927
|
-
}, n.emitStarted && this.#u(e, "started", { startedAt: void 0 }), this.#u(e, "failed", {
|
|
928
|
-
startedAt: void 0,
|
|
929
|
-
code: r.code
|
|
930
|
-
});
|
|
931
|
-
}
|
|
932
|
-
#l(e) {
|
|
933
|
-
let t = e.requestSlotId;
|
|
934
|
-
e.generation++, e.requestSlotId = void 0, t !== void 0 && (this.options.coordinator?.release(t, e.dataSourceId), this.#u(e, "aborted", { startedAt: void 0 })), e.requestId = void 0;
|
|
935
|
-
}
|
|
936
|
-
#u(e, t, n, r) {
|
|
937
|
-
let i = e.source;
|
|
938
|
-
if (i === void 0) return;
|
|
939
|
-
let a = Oe(i), o = e.executionContext ?? this.options.createExecutionContext({
|
|
940
|
-
trigger: "manual",
|
|
941
|
-
traceId: ""
|
|
942
|
-
}, e.dataSourceId);
|
|
943
|
-
this.options.emit({
|
|
944
|
-
type: t,
|
|
945
|
-
dataSourceId: e.dataSourceId,
|
|
946
|
-
componentId: r ?? this.#d(e.dataSourceId),
|
|
947
|
-
resourceType: a.resourceType,
|
|
948
|
-
resourceId: a.resourceId,
|
|
949
|
-
requestId: e.requestId,
|
|
950
|
-
context: o,
|
|
951
|
-
startedAt: n.startedAt,
|
|
952
|
-
...n.fieldCount === void 0 ? {} : { fieldCount: n.fieldCount },
|
|
953
|
-
...n.rowCount === void 0 ? {} : { rowCount: n.rowCount },
|
|
954
|
-
...n.code === void 0 ? {} : { code: n.code }
|
|
955
|
-
});
|
|
956
|
-
}
|
|
957
|
-
#d(e) {
|
|
958
|
-
let t = this.#t?.components ?? [];
|
|
959
|
-
for (let n of t) {
|
|
960
|
-
let t = p(n);
|
|
961
|
-
if (t?.kind === "data-source-field" && t.dataSourceId === e) return n.id;
|
|
962
|
-
}
|
|
963
|
-
return e;
|
|
964
|
-
}
|
|
965
|
-
};
|
|
966
|
-
function Ee(e) {
|
|
967
|
-
let t = d(e), n = new Map(t.map((e) => [e.id, e])), r = [];
|
|
968
|
-
for (let t of l(e)) {
|
|
969
|
-
let e = n.get(t);
|
|
970
|
-
e !== void 0 && (r.push(e), n.delete(t));
|
|
971
|
-
}
|
|
972
|
-
for (let e of t) n.has(e.id) && r.push(e);
|
|
973
|
-
return r;
|
|
974
|
-
}
|
|
975
|
-
function De(e, t, n) {
|
|
976
|
-
return `ds:${e}:${S(t)}:${S(n)}`;
|
|
977
|
-
}
|
|
978
|
-
function Oe(e) {
|
|
979
|
-
switch (e.kind) {
|
|
980
|
-
case "dataset": return {
|
|
981
|
-
resourceType: "dataset",
|
|
982
|
-
resourceId: e.datasetId
|
|
983
|
-
};
|
|
984
|
-
case "host-resource": return {
|
|
985
|
-
resourceType: e.resourceType,
|
|
986
|
-
resourceId: e.resourceId
|
|
987
|
-
};
|
|
988
|
-
default: return {
|
|
989
|
-
resourceType: e.kind,
|
|
990
|
-
resourceId: e.sourceId
|
|
991
|
-
};
|
|
992
|
-
}
|
|
993
|
-
}
|
|
994
|
-
function W(e) {
|
|
995
|
-
if (e === void 0 || typeof e != "object" || !e || Array.isArray(e)) return {};
|
|
996
|
-
let t = e.fields, n = e.rows;
|
|
997
|
-
return {
|
|
998
|
-
...Array.isArray(t) ? { fieldCount: t.length } : {},
|
|
999
|
-
...Array.isArray(n) ? { rowCount: n.length } : {}
|
|
1000
|
-
};
|
|
1001
|
-
}
|
|
1002
|
-
function G(e = "Host resource request failed.") {
|
|
1003
|
-
return {
|
|
1004
|
-
severity: "error",
|
|
1005
|
-
code: "HOST_RESOURCE_FAILED",
|
|
1006
|
-
path: [],
|
|
1007
|
-
message: e
|
|
1008
|
-
};
|
|
1009
|
-
}
|
|
1010
|
-
var ke = class {
|
|
1011
|
-
resourcePort;
|
|
1012
|
-
isShareable;
|
|
1013
|
-
timeoutMs;
|
|
1014
|
-
onShared;
|
|
1015
|
-
#e = /* @__PURE__ */ new Map();
|
|
1016
|
-
#t = 0;
|
|
1017
|
-
constructor(e, t, n, r) {
|
|
1018
|
-
this.resourcePort = e, this.isShareable = t, this.timeoutMs = n, this.onShared = r;
|
|
1019
|
-
}
|
|
1020
|
-
request(e, t, n, r, i) {
|
|
1021
|
-
if (this.isShareable(t)) {
|
|
1022
|
-
for (let t of this.#e.values()) if (t.key === e) return t.consumers.add(n), this.onShared?.(e, n, i), {
|
|
1023
|
-
resolution: t.promise,
|
|
1024
|
-
shared: !0,
|
|
1025
|
-
slotId: t.slotId
|
|
1026
|
-
};
|
|
1027
|
-
}
|
|
1028
|
-
let a = `request-slot-${++this.#t}`;
|
|
1029
|
-
return {
|
|
1030
|
-
resolution: this.#n(a, e, t, n, r, i),
|
|
1031
|
-
shared: !1,
|
|
1032
|
-
slotId: a
|
|
1033
|
-
};
|
|
1034
|
-
}
|
|
1035
|
-
release(e, t) {
|
|
1036
|
-
let n = this.#e.get(e);
|
|
1037
|
-
n !== void 0 && (n.consumers.delete(t), n.consumers.size === 0 && this.#r(n));
|
|
1038
|
-
}
|
|
1039
|
-
abortAll() {
|
|
1040
|
-
for (let e of this.#e.values()) this.#r(e);
|
|
1041
|
-
this.#e.clear();
|
|
1042
|
-
}
|
|
1043
|
-
get pending() {
|
|
1044
|
-
return this.#e.size;
|
|
1045
|
-
}
|
|
1046
|
-
isPending(e) {
|
|
1047
|
-
return this.#e.has(e);
|
|
1048
|
-
}
|
|
1049
|
-
#n(e, t, n, r, i, a) {
|
|
1050
|
-
let o = new AbortController(), s = () => {}, c = new Promise((e) => {
|
|
1051
|
-
s = e;
|
|
1052
|
-
}), l = {
|
|
1053
|
-
slotId: e,
|
|
1054
|
-
key: t,
|
|
1055
|
-
resourceType: n,
|
|
1056
|
-
consumers: /* @__PURE__ */ new Set([r]),
|
|
1057
|
-
controller: o,
|
|
1058
|
-
promise: c,
|
|
1059
|
-
timer: void 0
|
|
1060
|
-
};
|
|
1061
|
-
l.timer = setTimeout(() => {
|
|
1062
|
-
this.#e.get(e) === l && (o.abort(), this.#e.delete(e), s({ kind: "timeout" }));
|
|
1063
|
-
}, this.timeoutMs), this.#e.set(e, l);
|
|
1064
|
-
let u;
|
|
1065
|
-
try {
|
|
1066
|
-
u = this.resourcePort.resolve(i, {
|
|
1067
|
-
signal: o.signal,
|
|
1068
|
-
...a === void 0 ? {} : { context: a }
|
|
1069
|
-
});
|
|
1070
|
-
} catch {
|
|
1071
|
-
return this.#e.get(e) === l && this.#e.delete(e), l.timer !== void 0 && clearTimeout(l.timer), s({
|
|
1072
|
-
kind: "failure",
|
|
1073
|
-
diagnostics: {
|
|
1074
|
-
ok: !1,
|
|
1075
|
-
diagnostics: []
|
|
1076
|
-
}
|
|
1077
|
-
}), c;
|
|
1078
|
-
}
|
|
1079
|
-
return u.then((t) => {
|
|
1080
|
-
this.#e.get(e) === l && (l.timer !== void 0 && clearTimeout(l.timer), this.#e.delete(e), s(t.ok ? {
|
|
1081
|
-
kind: "ok",
|
|
1082
|
-
value: t.value
|
|
1083
|
-
} : {
|
|
1084
|
-
kind: "failure",
|
|
1085
|
-
diagnostics: t
|
|
1086
|
-
}));
|
|
1087
|
-
}, () => {
|
|
1088
|
-
this.#e.get(e) === l && (l.timer !== void 0 && clearTimeout(l.timer), this.#e.delete(e), s({
|
|
1089
|
-
kind: "failure",
|
|
1090
|
-
diagnostics: {
|
|
1091
|
-
ok: !1,
|
|
1092
|
-
diagnostics: []
|
|
1093
|
-
}
|
|
1094
|
-
}));
|
|
1095
|
-
}), c;
|
|
1096
|
-
}
|
|
1097
|
-
#r(e) {
|
|
1098
|
-
e.timer !== void 0 && clearTimeout(e.timer), e.controller.abort(), this.#e.get(e.slotId) === e && this.#e.delete(e.slotId);
|
|
1099
|
-
}
|
|
1100
|
-
};
|
|
1101
|
-
function Ae(e) {
|
|
1102
|
-
if (!Fe(e.resourceTimeoutMs ?? 15e3)) throw RangeError("resourceTimeoutMs must be an integer between 100 and 60000.");
|
|
1103
|
-
let t = new we(e.resourcePort, e.datasetPort, e.hostCatalogPort), n, r = e.resourcePort !== void 0 || e.datasetPort !== void 0 || e.hostCatalogPort !== void 0 ? new ke({ resolve: (e, n) => t.query(e, n) }, (t) => je(t, e), e.resourceTimeoutMs ?? 15e3) : void 0, i = new Te({
|
|
1104
|
-
sourcePort: t,
|
|
1105
|
-
coordinator: r,
|
|
1106
|
-
isSuspended: () => n.dataSuspended,
|
|
1107
|
-
createExecutionContext: (e, t) => Pe(n, t, e),
|
|
1108
|
-
emit: (e) => Ne(n, e),
|
|
1109
|
-
onChanged: (e) => n.onDataSourceChanged(e),
|
|
1110
|
-
validateParams: (e, t) => Me(n, e, t)
|
|
1111
|
-
});
|
|
1112
|
-
return n = {
|
|
1113
|
-
options: e,
|
|
1114
|
-
catalog: e.catalog,
|
|
1115
|
-
mounted: /* @__PURE__ */ new Map(),
|
|
1116
|
-
candidates: /* @__PURE__ */ new Map(),
|
|
1117
|
-
document: void 0,
|
|
1118
|
-
lastValidatedInput: void 0,
|
|
1119
|
-
validationCache: { entries: /* @__PURE__ */ new Map() },
|
|
1120
|
-
variables: {},
|
|
1121
|
-
dataSuspended: !1,
|
|
1122
|
-
disposed: !1,
|
|
1123
|
-
interactive: e.interactive,
|
|
1124
|
-
coordinator: r,
|
|
1125
|
-
sourceQueries: t,
|
|
1126
|
-
dataSources: i,
|
|
1127
|
-
visibility: new ve(e.root),
|
|
1128
|
-
onDataSourceChanged: () => {}
|
|
1129
|
-
}, n;
|
|
1130
|
-
}
|
|
1131
|
-
function je(e, t) {
|
|
1132
|
-
return e === "#source-dataset" ? t.datasetPort?.queryScope === "dataset" : e === "#source-resource";
|
|
1133
|
-
}
|
|
1134
|
-
function Me(e, t, n) {
|
|
1135
|
-
if (t.kind !== "host-resource") return;
|
|
1136
|
-
let r = e.options.contributionIndex;
|
|
1137
|
-
if (r === void 0) return;
|
|
1138
|
-
let i = r.getResourceType(t.resourceType);
|
|
1139
|
-
if (i === void 0) return {
|
|
1140
|
-
severity: "error",
|
|
1141
|
-
code: "HOST_RESOURCE_FAILED",
|
|
1142
|
-
path: [],
|
|
1143
|
-
message: "Host resource type is not enabled by an active plugin contribution."
|
|
1144
|
-
};
|
|
1145
|
-
if (!_(n, i.configSchema).ok) return {
|
|
1146
|
-
severity: "error",
|
|
1147
|
-
code: "HOST_RESOURCE_FAILED",
|
|
1148
|
-
path: [],
|
|
1149
|
-
message: "Host resource request failed."
|
|
1150
|
-
};
|
|
1151
|
-
}
|
|
1152
|
-
function Ne(e, t) {
|
|
1153
|
-
let n = e.options.observer;
|
|
1154
|
-
if (n !== void 0) try {
|
|
1155
|
-
n({
|
|
1156
|
-
type: t.type,
|
|
1157
|
-
requestId: t.requestId ?? `${t.dataSourceId}:${t.resourceType}:cancel`,
|
|
1158
|
-
componentId: t.componentId,
|
|
1159
|
-
resourceType: t.resourceType,
|
|
1160
|
-
resourceId: t.resourceId,
|
|
1161
|
-
context: t.context,
|
|
1162
|
-
durationMs: t.startedAt === void 0 ? 0 : Date.now() - t.startedAt,
|
|
1163
|
-
...t.fieldCount === void 0 ? {} : { fieldCount: t.fieldCount },
|
|
1164
|
-
...t.rowCount === void 0 ? {} : { rowCount: t.rowCount },
|
|
1165
|
-
...t.code === void 0 ? {} : { code: t.code }
|
|
1166
|
-
});
|
|
1167
|
-
} catch {}
|
|
1168
|
-
}
|
|
1169
|
-
function Pe(e, t, n) {
|
|
1170
|
-
return {
|
|
1171
|
-
instanceId: e.options.instanceId ?? "renderer",
|
|
1172
|
-
mode: e.options.executionMode ?? "viewer",
|
|
1173
|
-
trigger: n.trigger,
|
|
1174
|
-
traceId: n.traceId,
|
|
1175
|
-
...e.options.projectId === void 0 ? {} : { projectId: e.options.projectId },
|
|
1176
|
-
...e.options.documentRevision === void 0 ? {} : { documentRevision: e.options.documentRevision }
|
|
1177
|
-
};
|
|
1178
|
-
}
|
|
1179
|
-
function Fe(e) {
|
|
1180
|
-
return Number.isInteger(e) && e >= 100 && e <= 6e4;
|
|
1181
|
-
}
|
|
1182
|
-
function K(e) {
|
|
1183
|
-
return new Ie(e);
|
|
1184
|
-
}
|
|
1185
|
-
var Ie = class {
|
|
1186
|
-
#e;
|
|
1187
|
-
#t = /* @__PURE__ */ new Map();
|
|
1188
|
-
constructor(e) {
|
|
1189
|
-
this.#e = Ae(e), this.#e.onDataSourceChanged = (e) => this.#n(e);
|
|
1190
|
-
}
|
|
1191
|
-
render(e, t) {
|
|
1192
|
-
if (this.#e.disposed) return T("PLUGIN_CORE_LIFECYCLE_INVALID", [], "Renderer has been disposed.");
|
|
1193
|
-
let n = e === this.#e.lastValidatedInput && this.#e.document !== void 0 ? {
|
|
1194
|
-
ok: !0,
|
|
1195
|
-
value: this.#e.document,
|
|
1196
|
-
diagnostics: []
|
|
1197
|
-
} : c(e, this.#e.lastValidatedInput);
|
|
1198
|
-
if (!n.ok) return n;
|
|
1199
|
-
let r = {
|
|
1200
|
-
trigger: t?.trigger ?? "manual",
|
|
1201
|
-
traceId: t?.traceId ?? ""
|
|
1202
|
-
};
|
|
1203
|
-
this.#e.dataSources.ensure(n.value, this.#e.variables, r), this.#t = q(n.value);
|
|
1204
|
-
let i = A(n.value, this.#e.catalog, this.#e.options.mode, this.#e.interactive, this.#e.options.contributionIndex, this.#e.dataSources, this.#e.validationCache, this.#e.options.componentFailurePolicy ?? "fail");
|
|
1205
|
-
if (!i.ok) return i;
|
|
1206
|
-
let a = new Map(ne(n.value).map((e, t) => [e, t]));
|
|
1207
|
-
this.#e.visibility.prepare(n.value);
|
|
1208
|
-
let o = [...i.value].sort((e, t) => a.get(e.component.id) - a.get(t.component.id)), s = /* @__PURE__ */ new Map(), l = [];
|
|
1209
|
-
for (let e of o) {
|
|
1210
|
-
let t = a.get(e.component.id), n = this.#e.mounted.get(e.component.id);
|
|
1211
|
-
if (n !== void 0 && n.type === e.component.type) {
|
|
1212
|
-
try {
|
|
1213
|
-
R(this.#e, e, n, t);
|
|
1214
|
-
} catch {
|
|
1215
|
-
l.push(E(e, "Material model update raised an exception."));
|
|
1216
|
-
}
|
|
1217
|
-
s.set(e.component.id, n);
|
|
1218
|
-
continue;
|
|
1219
|
-
}
|
|
1220
|
-
n !== void 0 && (n.element.removeEventListener("base-screen-material-event", n.onEvent), n.element.remove());
|
|
1221
|
-
let r;
|
|
1222
|
-
try {
|
|
1223
|
-
r = new e.entry.constructor();
|
|
1224
|
-
} catch {
|
|
1225
|
-
l.push(E(e, "Material constructor raised an exception."));
|
|
1226
|
-
continue;
|
|
1227
|
-
}
|
|
1228
|
-
let i = (t) => _e(this.#e, e, t);
|
|
1229
|
-
r.addEventListener("base-screen-material-event", i);
|
|
1230
|
-
let o;
|
|
1231
|
-
try {
|
|
1232
|
-
o = P(this.#e, e, e.model.dataState), F(r, e.component, o, this.#e.visibility.isHidden(e.component.id), t);
|
|
1233
|
-
} catch {
|
|
1234
|
-
l.push(E(e, "Material render raised an exception."));
|
|
1235
|
-
continue;
|
|
1236
|
-
}
|
|
1237
|
-
this.#e.options.root.appendChild(r);
|
|
1238
|
-
let c = {
|
|
1239
|
-
type: e.component.type,
|
|
1240
|
-
element: r,
|
|
1241
|
-
onEvent: i,
|
|
1242
|
-
projection: se(),
|
|
1243
|
-
stackOrder: t,
|
|
1244
|
-
applied: B(this.#e, e, t),
|
|
1245
|
-
appliedModel: o
|
|
1246
|
-
};
|
|
1247
|
-
c.projection.dataState = e.model.dataState, c.projection.projectionKey = e.dataSource?.projectionKey, s.set(e.component.id, c);
|
|
1248
|
-
}
|
|
1249
|
-
for (let [e, t] of this.#e.mounted) s.has(e) || (t.element.removeEventListener("base-screen-material-event", t.onEvent), t.element.remove());
|
|
1250
|
-
if (this.#e.options.root.style.position = "relative", this.#e.options.root.style.width = `${n.value.canvas.width}px`, this.#e.options.root.style.height = `${n.value.canvas.height}px`, this.#e.options.mode !== "design" && this.#e.options.root.style.overflow !== "hidden" && (this.#e.options.root.style.overflow = "hidden"), ie(this.#e.options.root, n.value.canvas), this.#e.mounted = s, this.#e.candidates = new Map(o.map((e) => [e.component.id, e])), this.#e.document = n.value, this.#e.lastValidatedInput = e, l.length > 0) for (let e of l) this.#e.options.onDiagnostic?.(e);
|
|
1251
|
-
return {
|
|
1252
|
-
ok: !0,
|
|
1253
|
-
value: null,
|
|
1254
|
-
diagnostics: [...i.diagnostics, ...l]
|
|
1255
|
-
};
|
|
1256
|
-
}
|
|
1257
|
-
setVariables(t) {
|
|
1258
|
-
let n = e(t, { maxBytes: 2097152 });
|
|
1259
|
-
return !n.ok || n.value === null || Array.isArray(n.value) || typeof n.value != "object" ? T("HOST_DATASET_VARIABLE_INVALID", [], "Runtime variables are invalid.") : (this.#e.variables = n.value, this.#e.dataSuspended = !1, {
|
|
1260
|
-
ok: !0,
|
|
1261
|
-
value: null,
|
|
1262
|
-
diagnostics: []
|
|
1263
|
-
});
|
|
1264
|
-
}
|
|
1265
|
-
setInteractive(e) {
|
|
1266
|
-
return this.#e.disposed ? T("PLUGIN_CORE_LIFECYCLE_INVALID", [], "Renderer has been disposed.") : this.#e.interactive === e || (this.#e.interactive = e, this.#e.document === void 0) ? {
|
|
1267
|
-
ok: !0,
|
|
1268
|
-
value: null,
|
|
1269
|
-
diagnostics: []
|
|
1270
|
-
} : this.render(this.#e.document);
|
|
1271
|
-
}
|
|
1272
|
-
validateCatalog(e, t) {
|
|
1273
|
-
if (this.#e.disposed) return T("PLUGIN_CORE_LIFECYCLE_INVALID", [], "Renderer has been disposed.");
|
|
1274
|
-
let n = c(e, this.#e.lastValidatedInput);
|
|
1275
|
-
if (!n.ok) return n;
|
|
1276
|
-
try {
|
|
1277
|
-
let e = A(n.value, t, this.#e.options.mode, this.#e.interactive, this.#e.options.contributionIndex, this.#e.dataSources, { entries: /* @__PURE__ */ new Map() }, "fail");
|
|
1278
|
-
return e.ok ? {
|
|
1279
|
-
ok: !0,
|
|
1280
|
-
value: null,
|
|
1281
|
-
diagnostics: []
|
|
1282
|
-
} : {
|
|
1283
|
-
ok: !1,
|
|
1284
|
-
diagnostics: e.diagnostics
|
|
1285
|
-
};
|
|
1286
|
-
} catch {
|
|
1287
|
-
return T("PLUGIN_CORE_RENDER_FAILED", [], "Catalog validation failed.");
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
setCatalog(e) {
|
|
1291
|
-
if (this.#e.disposed) return T("PLUGIN_CORE_LIFECYCLE_INVALID", [], "Renderer has been disposed.");
|
|
1292
|
-
if (e === this.#e.catalog) return {
|
|
1293
|
-
ok: !0,
|
|
1294
|
-
value: null,
|
|
1295
|
-
diagnostics: []
|
|
1296
|
-
};
|
|
1297
|
-
let t = h(this.#e.catalog, e), n = new Set(t.implementationChanged), r = new Set(t.removed);
|
|
1298
|
-
for (let [e, t] of this.#e.mounted) !n.has(t.type) && !r.has(t.type) || (t.element.removeEventListener("base-screen-material-event", t.onEvent), t.element.remove(), this.#e.mounted.delete(e), this.#e.candidates.delete(e));
|
|
1299
|
-
let i = new Set(t.unchanged);
|
|
1300
|
-
for (let t of this.#e.mounted.values()) {
|
|
1301
|
-
if (t.applied === void 0 || !i.has(t.type)) continue;
|
|
1302
|
-
let n = e.get(t.type);
|
|
1303
|
-
n !== void 0 && (t.applied = {
|
|
1304
|
-
...t.applied,
|
|
1305
|
-
entry: n
|
|
1306
|
-
});
|
|
1307
|
-
}
|
|
1308
|
-
return this.#e.validationCache.entries.clear(), this.#e.catalog = e, {
|
|
1309
|
-
ok: !0,
|
|
1310
|
-
value: null,
|
|
1311
|
-
diagnostics: []
|
|
1312
|
-
};
|
|
1313
|
-
}
|
|
1314
|
-
applyBlueprintVisibilityEffects(e) {
|
|
1315
|
-
return this.#e.disposed ? T("PLUGIN_CORE_LIFECYCLE_INVALID", [], "Renderer has been disposed.") : this.#e.visibility.apply(e, this.#e.document, this.#e.mounted);
|
|
1316
|
-
}
|
|
1317
|
-
resetBlueprintVisibility() {
|
|
1318
|
-
this.#e.visibility.reset();
|
|
1319
|
-
}
|
|
1320
|
-
suspendData() {
|
|
1321
|
-
this.#e.dataSuspended = !0, this.#e.coordinator?.abortAll(), this.#e.dataSources.suspend();
|
|
1322
|
-
for (let [e, t] of this.#e.mounted) {
|
|
1323
|
-
t.projection.projectionKey = void 0, t.projection.dataState = { status: "loading" };
|
|
1324
|
-
let n = this.#e.candidates.get(e);
|
|
1325
|
-
if (n !== void 0 && n.dataSource !== void 0) {
|
|
1326
|
-
let e = {
|
|
1327
|
-
...n.model,
|
|
1328
|
-
dataState: { status: "loading" }
|
|
1329
|
-
};
|
|
1330
|
-
t.element.model = e, t.appliedModel = e;
|
|
1331
|
-
}
|
|
1332
|
-
}
|
|
1333
|
-
}
|
|
1334
|
-
refreshData(e, t, n) {
|
|
1335
|
-
let r = {
|
|
1336
|
-
trigger: t === "polling" ? "polling" : "manual",
|
|
1337
|
-
traceId: n ?? ""
|
|
1338
|
-
};
|
|
1339
|
-
if (e === void 0) {
|
|
1340
|
-
this.#e.dataSources.refresh(void 0, r);
|
|
1341
|
-
return;
|
|
1342
|
-
}
|
|
1343
|
-
let i = this.#e.candidates.get(e);
|
|
1344
|
-
if (i === void 0) return;
|
|
1345
|
-
let a = p(i.component);
|
|
1346
|
-
a?.kind === "data-source-field" && this.#e.dataSources.refresh(a.dataSourceId, r);
|
|
1347
|
-
}
|
|
1348
|
-
refreshConditionalStyles(e) {
|
|
1349
|
-
if (this.#e.disposed || this.#e.options.conditionalStylePort === void 0) return;
|
|
1350
|
-
let t = e === void 0 ? [...this.#e.mounted.keys()] : [...new Set(e)];
|
|
1351
|
-
for (let e of t) {
|
|
1352
|
-
let t = this.#e.candidates.get(e), n = this.#e.mounted.get(e);
|
|
1353
|
-
if (t !== void 0 && n !== void 0) try {
|
|
1354
|
-
ge(this.#e, t, n);
|
|
1355
|
-
} catch {
|
|
1356
|
-
this.#e.options.onDiagnostic?.(w("PLUGIN_CORE_RENDER_FAILED", [
|
|
1357
|
-
"components",
|
|
1358
|
-
e,
|
|
1359
|
-
"conditionalStyle"
|
|
1360
|
-
], "Conditional style refresh failed for material."));
|
|
1361
|
-
}
|
|
1362
|
-
}
|
|
1363
|
-
}
|
|
1364
|
-
prepareDataSources(e, t, n, r) {
|
|
1365
|
-
if (this.#e.disposed) return;
|
|
1366
|
-
let i = c(e, this.#e.lastValidatedInput);
|
|
1367
|
-
i.ok && (this.#e.dataSources.ensure(i.value, t, {
|
|
1368
|
-
trigger: n?.trigger ?? "manual",
|
|
1369
|
-
traceId: n?.traceId ?? ""
|
|
1370
|
-
}, r === void 0 ? {} : { startOnly: r }), this.#t = q(i.value));
|
|
1371
|
-
}
|
|
1372
|
-
refreshDataSource(e, t) {
|
|
1373
|
-
this.#e.dataSources.refresh(e, {
|
|
1374
|
-
trigger: t?.trigger ?? "manual",
|
|
1375
|
-
traceId: t?.traceId ?? ""
|
|
1376
|
-
});
|
|
1377
|
-
}
|
|
1378
|
-
readDataSourceValue(e) {
|
|
1379
|
-
let t = this.#e.dataSources.read(e);
|
|
1380
|
-
if (t !== void 0 && t.dataState.status === "ready") return t.rawValue;
|
|
1381
|
-
}
|
|
1382
|
-
isDataSourceSettled(e) {
|
|
1383
|
-
let t = this.#e.dataSources.read(e);
|
|
1384
|
-
return t !== void 0 && t.dataState.status !== "loading";
|
|
1385
|
-
}
|
|
1386
|
-
evaluateValueRef(e) {
|
|
1387
|
-
return this.#e.dataSources.evaluate(e);
|
|
1388
|
-
}
|
|
1389
|
-
clear() {
|
|
1390
|
-
this.resetBlueprintVisibility(), this.#e.coordinator?.abortAll(), this.#e.sourceQueries.clear(), this.#e.dataSources.clear(), this.#t = /* @__PURE__ */ new Map();
|
|
1391
|
-
for (let e of this.#e.mounted.values()) e.element.removeEventListener("base-screen-material-event", e.onEvent), e.element.remove();
|
|
1392
|
-
this.#e.mounted.clear(), this.#e.candidates.clear(), this.#e.document = void 0, this.#e.lastValidatedInput = void 0, this.#e.validationCache.entries.clear();
|
|
1393
|
-
}
|
|
1394
|
-
dispose() {
|
|
1395
|
-
this.#e.disposed || (this.clear(), this.#e.disposed = !0);
|
|
1396
|
-
}
|
|
1397
|
-
#n(e) {
|
|
1398
|
-
let t = this.#e.document;
|
|
1399
|
-
!this.#e.disposed && t !== void 0 && this.#r(e, t);
|
|
1400
|
-
let n = this.#e.dataSources.read(e);
|
|
1401
|
-
n !== void 0 && n.dataState.status !== "loading" && this.#e.options.onDataSourceSettled?.(e);
|
|
1402
|
-
}
|
|
1403
|
-
#r(e, t) {
|
|
1404
|
-
let n = new Map(t.components.map((e) => [e.id, e]));
|
|
1405
|
-
for (let t of this.#t.get(e) ?? []) {
|
|
1406
|
-
let r = n.get(t), i = this.#e.candidates.get(t), a = this.#e.mounted.get(t);
|
|
1407
|
-
if (r === void 0 || i === void 0 || a === void 0) continue;
|
|
1408
|
-
let o = j(this.#e.dataSources, r, i.entry, this.#e.options.contributionIndex, ["components", t], (e) => this.#e.options.onDiagnostic?.(e));
|
|
1409
|
-
if ("diagnostic" in o) continue;
|
|
1410
|
-
let s = {
|
|
1411
|
-
...i,
|
|
1412
|
-
model: {
|
|
1413
|
-
...i.model,
|
|
1414
|
-
dataState: o.dataState
|
|
1415
|
-
},
|
|
1416
|
-
dataSource: o.dataSource,
|
|
1417
|
-
dataEpoch: o.epoch
|
|
1418
|
-
};
|
|
1419
|
-
this.#e.candidates.set(t, s), o.dataState.status === "ready" && this.#e.dataSources.reportProjection(e, t, o.dataState.value), a.projection.dataState = o.dataState, a.projection.projectionKey = o.dataSource?.projectionKey, z(this.#e, s, a, a.stackOrder);
|
|
1420
|
-
}
|
|
1421
|
-
}
|
|
1422
|
-
};
|
|
1423
|
-
function q(e) {
|
|
1424
|
-
let t = /* @__PURE__ */ new Map();
|
|
1425
|
-
for (let n of e.components) {
|
|
1426
|
-
let e = p(n);
|
|
1427
|
-
if (e?.kind !== "data-source-field") continue;
|
|
1428
|
-
let r = t.get(e.dataSourceId);
|
|
1429
|
-
r === void 0 ? t.set(e.dataSourceId, [n.id]) : r.push(n.id);
|
|
1430
|
-
}
|
|
1431
|
-
return t;
|
|
1432
|
-
}
|
|
1433
|
-
function Le(e, t, n, r) {
|
|
1434
|
-
let i = [];
|
|
1435
|
-
if (S(n) !== S(r.variables)) {
|
|
1436
|
-
let n = e.setVariables(r.variables);
|
|
1437
|
-
if (n.ok) {
|
|
1438
|
-
let n = e.render(t, { trigger: "variable" });
|
|
1439
|
-
i.push(...n.diagnostics);
|
|
1440
|
-
} else i.push(...n.diagnostics);
|
|
1441
|
-
}
|
|
1442
|
-
if (r.visibilityEffects.length > 0) {
|
|
1443
|
-
let t = e.applyBlueprintVisibilityEffects(r.visibilityEffects);
|
|
1444
|
-
t.ok || i.push(...t.diagnostics);
|
|
1445
|
-
}
|
|
1446
|
-
return i;
|
|
1447
|
-
}
|
|
1448
|
-
function J(e) {
|
|
1449
|
-
return typeof e == "object" && !!e && typeof e.get == "function" && typeof e.has == "function" && typeof e.list == "function";
|
|
1450
|
-
}
|
|
1451
|
-
function Re(e) {
|
|
1452
|
-
return typeof e == "object" && !!e && typeof e.resolve == "function";
|
|
1453
|
-
}
|
|
1454
|
-
function ze(e) {
|
|
1455
|
-
if (typeof e != "object" || !e) return !1;
|
|
1456
|
-
let t = e;
|
|
1457
|
-
return [
|
|
1458
|
-
"list",
|
|
1459
|
-
"describe",
|
|
1460
|
-
"resolve"
|
|
1461
|
-
].every((e) => typeof t[e] == "function");
|
|
1462
|
-
}
|
|
1463
|
-
function Be(e) {
|
|
1464
|
-
return typeof e == "object" && !!e && typeof e.getResourceType == "function" && typeof e.hasBlueprintCapability == "function";
|
|
1465
|
-
}
|
|
1466
|
-
function Ve(e) {
|
|
1467
|
-
return typeof e == "object" && !!e && typeof e.emit == "function";
|
|
1468
|
-
}
|
|
1469
|
-
function He(e) {
|
|
1470
|
-
return typeof e == "object" && !!e && typeof e.resolve == "function";
|
|
1471
|
-
}
|
|
1472
|
-
function Ue(e) {
|
|
1473
|
-
return typeof e == "object" && !!e && typeof e.execute == "function";
|
|
1474
|
-
}
|
|
1475
|
-
function Y(e) {
|
|
1476
|
-
return {
|
|
1477
|
-
ok: !1,
|
|
1478
|
-
diagnostics: [{
|
|
1479
|
-
severity: "error",
|
|
1480
|
-
code: "PLUGIN_CORE_LIFECYCLE_INVALID",
|
|
1481
|
-
path: [],
|
|
1482
|
-
message: e
|
|
1483
|
-
}]
|
|
1484
|
-
};
|
|
1485
|
-
}
|
|
1486
|
-
function We(e) {
|
|
1487
|
-
if (!J(e.catalog)) return Y("Viewer catalog 必须是合法的物料目录。");
|
|
1488
|
-
if (e.datasetPort !== void 0 && !o(e.datasetPort)) return Y("Viewer dataset port must provide list, describe and query.");
|
|
1489
|
-
let t = e.resourceTimeoutMs ?? 15e3;
|
|
1490
|
-
return !Number.isInteger(t) || t < 100 || t > 6e4 ? Y("resourceTimeoutMs 必须是 100..60000 的整数。") : e.resourcePort !== void 0 && !Re(e.resourcePort) ? Y("Viewer resource port 必须是含 resolve 的对象。") : e.hostCatalogPort !== void 0 && !ze(e.hostCatalogPort) ? Y("Viewer host catalog port 必须同时提供 list、describe 与 resolve。") : e.conditionalStylePort !== void 0 && !He(e.conditionalStylePort) ? Y("Viewer conditional style port 必须是含 resolve 的对象。") : e.runtimeContributions !== void 0 && !Be(e.runtimeContributions) ? Y("Viewer runtime contributions 必须是含 getResourceType 的对象。") : e.blueprintRuntimePort !== void 0 && !Ve(e.blueprintRuntimePort) ? Y("Viewer blueprint runtime port 必须是含 emit 的对象。") : e.blueprintHostActionPort !== void 0 && !Ue(e.blueprintHostActionPort) ? Y("Viewer blueprint host action port 必须是含 execute 的对象。") : {
|
|
1491
|
-
ok: !0,
|
|
1492
|
-
value: {
|
|
1493
|
-
...e,
|
|
1494
|
-
resourceTimeoutMs: t
|
|
1495
|
-
},
|
|
1496
|
-
diagnostics: []
|
|
1497
|
-
};
|
|
1498
|
-
}
|
|
1499
|
-
var X = class {
|
|
1500
|
-
host;
|
|
1501
|
-
#e = /* @__PURE__ */ new Map();
|
|
1502
|
-
#t = !1;
|
|
1503
|
-
constructor(e) {
|
|
1504
|
-
this.host = e;
|
|
1505
|
-
}
|
|
1506
|
-
sync(e) {
|
|
1507
|
-
let t = /* @__PURE__ */ new Map();
|
|
1508
|
-
for (let n of e === void 0 ? [] : d(e)) {
|
|
1509
|
-
let e = Ge(n);
|
|
1510
|
-
e !== void 0 && t.set(n.id, e);
|
|
1511
|
-
}
|
|
1512
|
-
for (let [e, n] of this.#e) t.get(e) !== n.intervalSeconds && (clearTimeout(n.timer), this.#e.delete(e));
|
|
1513
|
-
for (let [e, n] of t) this.#e.has(e) || this.#n(e, n);
|
|
1514
|
-
}
|
|
1515
|
-
suspend() {
|
|
1516
|
-
this.#t = !0;
|
|
1517
|
-
for (let e of this.#e.values()) clearTimeout(e.timer);
|
|
1518
|
-
this.#e.clear();
|
|
1519
|
-
}
|
|
1520
|
-
resume() {
|
|
1521
|
-
this.#t = !1, this.sync(this.host.readDocument());
|
|
1522
|
-
}
|
|
1523
|
-
dispose() {
|
|
1524
|
-
this.#t = !0;
|
|
1525
|
-
for (let e of this.#e.values()) clearTimeout(e.timer);
|
|
1526
|
-
this.#e.clear();
|
|
1527
|
-
}
|
|
1528
|
-
#n(e, t) {
|
|
1529
|
-
if (this.#t) return;
|
|
1530
|
-
let n = setTimeout(() => {
|
|
1531
|
-
this.#e.delete(e), this.host.readRenderer()?.refreshDataSource(e, { trigger: "polling" }), this.#n(e, t);
|
|
1532
|
-
}, t * 1e3);
|
|
1533
|
-
this.#e.set(e, {
|
|
1534
|
-
intervalSeconds: t,
|
|
1535
|
-
timer: n
|
|
1536
|
-
});
|
|
1537
|
-
}
|
|
1538
|
-
};
|
|
1539
|
-
function Ge(e) {
|
|
1540
|
-
return e.updatePolicy?.mode === "auto" ? e.updatePolicy.intervalSeconds : void 0;
|
|
1541
|
-
}
|
|
1542
|
-
var Z = "data-viewer-skeleton", Ke = `
|
|
1543
|
-
[${Z}] {
|
|
1544
|
-
display: block;
|
|
1545
|
-
box-sizing: border-box;
|
|
1546
|
-
width: 100%;
|
|
1547
|
-
height: 100%;
|
|
1548
|
-
background: rgba(127, 127, 127, 0.12);
|
|
1549
|
-
background: color-mix(in srgb, currentColor 10%, transparent);
|
|
1550
|
-
animation: base-screen-viewer-skeleton-pulse 1.4s ease-in-out infinite;
|
|
1551
|
-
}
|
|
1552
|
-
@keyframes base-screen-viewer-skeleton-pulse {
|
|
1553
|
-
0%,
|
|
1554
|
-
100% {
|
|
1555
|
-
opacity: 0.6;
|
|
1556
|
-
}
|
|
1557
|
-
50% {
|
|
1558
|
-
opacity: 1;
|
|
1559
|
-
}
|
|
1560
|
-
}
|
|
1561
|
-
@media (prefers-reduced-motion: reduce) {
|
|
1562
|
-
[${Z}] {
|
|
1563
|
-
animation: none;
|
|
1564
|
-
}
|
|
1565
|
-
}
|
|
1566
|
-
`;
|
|
1567
|
-
function qe(e) {
|
|
1568
|
-
let t = e.createElement("style");
|
|
1569
|
-
return t.setAttribute("data-viewer-skeleton-style", "true"), t.textContent = Ke, t;
|
|
1570
|
-
}
|
|
1571
|
-
function Je(e) {
|
|
1572
|
-
let t = e.createElement("div");
|
|
1573
|
-
return t.setAttribute(Z, "true"), t.setAttribute("aria-hidden", "true"), t;
|
|
1574
|
-
}
|
|
1575
|
-
var Ye = class {
|
|
1576
|
-
#e;
|
|
1577
|
-
#t = /* @__PURE__ */ new Map();
|
|
1578
|
-
#n = 0;
|
|
1579
|
-
#r = !1;
|
|
1580
|
-
#i = !1;
|
|
1581
|
-
#a;
|
|
1582
|
-
#o = "manual";
|
|
1583
|
-
#s;
|
|
1584
|
-
#c = !1;
|
|
1585
|
-
constructor(e) {
|
|
1586
|
-
this.#e = e;
|
|
1587
|
-
}
|
|
1588
|
-
get hasDeferredDocument() {
|
|
1589
|
-
return this.#a !== void 0;
|
|
1590
|
-
}
|
|
1591
|
-
refreshData(e) {
|
|
1592
|
-
let t = typeof e == "string" ? { componentId: e } : e ?? {}, n = this.#e.readRenderer();
|
|
1593
|
-
if (n === void 0 || t.componentId !== void 0 && !this.#m(t.componentId)) return;
|
|
1594
|
-
let r = t.trigger === "polling" ? "polling" : "manual", i = t.traceId;
|
|
1595
|
-
if (t.componentId !== void 0) {
|
|
1596
|
-
this.refreshVariables(i === void 0 ? {} : { traceId: i }), n.refreshData(t.componentId, r, i);
|
|
1597
|
-
return;
|
|
1598
|
-
}
|
|
1599
|
-
n.refreshData(void 0, r, i);
|
|
1600
|
-
}
|
|
1601
|
-
refreshVariables(e = {}) {
|
|
1602
|
-
let t = this.#e.readDocument(), n = this.#e.readRenderer();
|
|
1603
|
-
if (t === void 0 || n === void 0) return;
|
|
1604
|
-
let r = e.variableIds === void 0 ? void 0 : new Set(e.variableIds), i = /* @__PURE__ */ new Set();
|
|
1605
|
-
for (let e of t.variables) {
|
|
1606
|
-
let t = u(e);
|
|
1607
|
-
if (!(r !== void 0 && !r.has(t.id))) for (let e of x(t.value).dataSourceIds) i.add(e);
|
|
1608
|
-
}
|
|
1609
|
-
for (let t of i) n.refreshDataSource(t, {
|
|
1610
|
-
trigger: "variable",
|
|
1611
|
-
...e.traceId === void 0 ? {} : { traceId: e.traceId }
|
|
1612
|
-
});
|
|
1613
|
-
}
|
|
1614
|
-
handleDataSourceSettled(e) {
|
|
1615
|
-
let t = this.#a;
|
|
1616
|
-
if (t !== void 0) {
|
|
1617
|
-
let e = this.#e.readBlueprintPlan(), n = this.#e.readRenderer();
|
|
1618
|
-
if (e !== void 0 && n !== void 0 && this.#u(t.document, n)) {
|
|
1619
|
-
this.#a = void 0, this.#d(t.document, t.componentId, t.trigger, t.traceId, e);
|
|
1620
|
-
return;
|
|
1621
|
-
}
|
|
1622
|
-
}
|
|
1623
|
-
if (this.#t.has(e)) {
|
|
1624
|
-
if (this.#r) {
|
|
1625
|
-
this.#i = !0;
|
|
1626
|
-
return;
|
|
1627
|
-
}
|
|
1628
|
-
this.#f("variable");
|
|
1629
|
-
}
|
|
1630
|
-
}
|
|
1631
|
-
start(e, t = !1, n = !1) {
|
|
1632
|
-
if (this.#r) {
|
|
1633
|
-
this.#i = !0;
|
|
1634
|
-
return;
|
|
1635
|
-
}
|
|
1636
|
-
n && this.#n++;
|
|
1637
|
-
let r = t ? this.#o : this.#c ? "document-change" : "initial", i = t ? this.#s : void 0;
|
|
1638
|
-
this.#l(e, t, r, i);
|
|
1639
|
-
}
|
|
1640
|
-
cancel() {
|
|
1641
|
-
this.#n++, this.#r = !1, this.#i = !1, this.#t.clear(), this.#a = void 0;
|
|
1642
|
-
}
|
|
1643
|
-
reset() {
|
|
1644
|
-
this.cancel(), this.#c = !1, this.#o = "manual", this.#s = void 0;
|
|
1645
|
-
}
|
|
1646
|
-
#l(e, t, n, r) {
|
|
1647
|
-
let i = this.#e.readRenderer(), a = this.#e.readDocument(), o = this.#e.readBlueprintPlan();
|
|
1648
|
-
if (i !== void 0 && a !== void 0 && o !== void 0) {
|
|
1649
|
-
if (!t && e === void 0) {
|
|
1650
|
-
let t = this.#e.readBlueprintVariables() ?? o.initialVariables, s = /* @__PURE__ */ new Set();
|
|
1651
|
-
for (let e of a.variables) {
|
|
1652
|
-
let t = u(e);
|
|
1653
|
-
for (let e of x(t.value).dataSourceIds) s.add(e);
|
|
1654
|
-
}
|
|
1655
|
-
if (i.prepareDataSources(a, t, {
|
|
1656
|
-
trigger: n,
|
|
1657
|
-
traceId: r ?? ""
|
|
1658
|
-
}, s), !this.#u(a, i)) {
|
|
1659
|
-
this.#a = {
|
|
1660
|
-
document: a,
|
|
1661
|
-
componentId: e,
|
|
1662
|
-
trigger: n,
|
|
1663
|
-
traceId: r
|
|
1664
|
-
};
|
|
1665
|
-
return;
|
|
1666
|
-
}
|
|
1667
|
-
}
|
|
1668
|
-
this.#a = void 0, this.#d(a, e, n, r, o, t);
|
|
1669
|
-
}
|
|
1670
|
-
}
|
|
1671
|
-
#u(e, t) {
|
|
1672
|
-
for (let n of e.variables) {
|
|
1673
|
-
let e = u(n);
|
|
1674
|
-
if (e.value.kind === "data-source-field" && !t.isDataSourceSettled(e.value.dataSourceId)) return !1;
|
|
1675
|
-
}
|
|
1676
|
-
return !0;
|
|
1677
|
-
}
|
|
1678
|
-
#d(e, t, n, r, i, a = !1) {
|
|
1679
|
-
let o = this.#e.readRenderer();
|
|
1680
|
-
if (o === void 0) return;
|
|
1681
|
-
let s = ++this.#n, c = this.#p(e, i, o);
|
|
1682
|
-
if (s === this.#n) {
|
|
1683
|
-
this.#r = !0;
|
|
1684
|
-
try {
|
|
1685
|
-
let i = o.setVariables(c);
|
|
1686
|
-
if (!i.ok) {
|
|
1687
|
-
this.#e.emitDiagnostics(i.diagnostics);
|
|
1688
|
-
return;
|
|
1689
|
-
}
|
|
1690
|
-
let s = o.render(e, {
|
|
1691
|
-
trigger: n,
|
|
1692
|
-
traceId: r ?? ""
|
|
1693
|
-
});
|
|
1694
|
-
if (!s.ok) {
|
|
1695
|
-
this.#e.emitDiagnostics(s.diagnostics);
|
|
1696
|
-
return;
|
|
1697
|
-
}
|
|
1698
|
-
s.diagnostics.length > 0 && this.#e.emitDiagnostics(s.diagnostics), this.#e.writeBlueprintVariables(c), a || (this.#c = !0), a && o.refreshData(t, n === "polling" ? "polling" : "manual", r);
|
|
1699
|
-
} finally {
|
|
1700
|
-
this.#r = !1, this.#e.onRenderSettled?.();
|
|
1701
|
-
}
|
|
1702
|
-
this.#i && (this.#i = !1, this.#f("variable"));
|
|
1703
|
-
}
|
|
1704
|
-
}
|
|
1705
|
-
#f(e) {
|
|
1706
|
-
let t = this.#e.readRenderer(), n = this.#e.readDocument(), r = this.#e.readBlueprintPlan();
|
|
1707
|
-
if (t === void 0 || n === void 0 || r === void 0) return;
|
|
1708
|
-
let i = this.#p(n, r, t), a = this.#e.readBlueprintVariables();
|
|
1709
|
-
if (a !== void 0 && S(a) === S(i)) return;
|
|
1710
|
-
let o = ++this.#n;
|
|
1711
|
-
this.#r = !0;
|
|
1712
|
-
try {
|
|
1713
|
-
let r = t.setVariables(i);
|
|
1714
|
-
if (!r.ok) {
|
|
1715
|
-
this.#e.emitDiagnostics(r.diagnostics);
|
|
1716
|
-
return;
|
|
1717
|
-
}
|
|
1718
|
-
let a = t.render(n, {
|
|
1719
|
-
trigger: e,
|
|
1720
|
-
traceId: ""
|
|
1721
|
-
});
|
|
1722
|
-
if (!a.ok) {
|
|
1723
|
-
this.#e.emitDiagnostics(a.diagnostics);
|
|
1724
|
-
return;
|
|
1725
|
-
}
|
|
1726
|
-
if (a.diagnostics.length > 0 && this.#e.emitDiagnostics(a.diagnostics), o !== this.#n) return;
|
|
1727
|
-
this.#e.writeBlueprintVariables(i);
|
|
1728
|
-
} finally {
|
|
1729
|
-
this.#r = !1;
|
|
1730
|
-
}
|
|
1731
|
-
}
|
|
1732
|
-
#p(e, t, n) {
|
|
1733
|
-
let r = this.#e.readBlueprintVariables() ?? t.initialVariables, i = {}, a = /* @__PURE__ */ new Map();
|
|
1734
|
-
for (let t of e.variables) {
|
|
1735
|
-
let e = u(t), o = e.value;
|
|
1736
|
-
if (o.kind === "inline") {
|
|
1737
|
-
i[e.id] = r[e.id] ?? o.value;
|
|
1738
|
-
continue;
|
|
1739
|
-
}
|
|
1740
|
-
if (o.kind !== "data-source-field") {
|
|
1741
|
-
i[e.id] = e.initialValue;
|
|
1742
|
-
continue;
|
|
1743
|
-
}
|
|
1744
|
-
let s = n.evaluateValueRef(o);
|
|
1745
|
-
i[e.id] = s.kind === "value" && s.value !== void 0 ? s.value : e.controlled ? null : e.initialValue;
|
|
1746
|
-
let c = a.get(o.dataSourceId);
|
|
1747
|
-
c === void 0 ? a.set(o.dataSourceId, [e.id]) : c.push(e.id);
|
|
1748
|
-
}
|
|
1749
|
-
return this.#t = a, i;
|
|
1750
|
-
}
|
|
1751
|
-
#m(e) {
|
|
1752
|
-
return this.#e.readDocument()?.components.some((t) => t.id === e) ?? !1;
|
|
1753
|
-
}
|
|
1754
|
-
};
|
|
1755
|
-
function Q(e) {
|
|
1756
|
-
let t = u(e);
|
|
1757
|
-
if (t.value.kind === "data-source-field") return {
|
|
1758
|
-
ok: !1,
|
|
1759
|
-
diagnostics: [{
|
|
1760
|
-
severity: "error",
|
|
1761
|
-
code: "VARIABLE_WRITE_FORBIDDEN",
|
|
1762
|
-
path: ["variables", t.id],
|
|
1763
|
-
message: "Derived variable values are overwritten by the next data source refresh."
|
|
1764
|
-
}]
|
|
1765
|
-
};
|
|
1766
|
-
}
|
|
1767
|
-
function Xe(e, t, n) {
|
|
1768
|
-
if (e === void 0) return n;
|
|
1769
|
-
let r;
|
|
1770
|
-
for (let i of e.variables) {
|
|
1771
|
-
let e = u(i);
|
|
1772
|
-
$(t[e.id], n[e.id]) || Q(i) !== void 0 && (r ??= { ...n }, r[e.id] = t[e.id] ?? null);
|
|
1773
|
-
}
|
|
1774
|
-
return r ?? n;
|
|
1775
|
-
}
|
|
1776
|
-
var Ze = class {
|
|
1777
|
-
host;
|
|
1778
|
-
#e = /* @__PURE__ */ new Map();
|
|
1779
|
-
constructor(e) {
|
|
1780
|
-
this.host = e;
|
|
1781
|
-
}
|
|
1782
|
-
get(e) {
|
|
1783
|
-
let t = this.host.readDocument()?.variables.find((t) => t.id === e);
|
|
1784
|
-
if (t === void 0) return;
|
|
1785
|
-
let n = this, r = u(t);
|
|
1786
|
-
return {
|
|
1787
|
-
id: e,
|
|
1788
|
-
get value() {
|
|
1789
|
-
let t = n.host.readVariables()?.[e];
|
|
1790
|
-
return t === void 0 ? r.value.kind === "inline" ? r.value.value : r.initialValue : t;
|
|
1791
|
-
},
|
|
1792
|
-
set: (r) => {
|
|
1793
|
-
let i = Q(t);
|
|
1794
|
-
return i === void 0 ? n.host.setValue(e, r) : i;
|
|
1795
|
-
},
|
|
1796
|
-
onChange: (t) => n.subscribe(e, t)
|
|
1797
|
-
};
|
|
1798
|
-
}
|
|
1799
|
-
clear() {
|
|
1800
|
-
this.#e.clear();
|
|
1801
|
-
}
|
|
1802
|
-
notify(e, t) {
|
|
1803
|
-
let n = [.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])].filter((n) => !$(e[n], t[n]));
|
|
1804
|
-
for (let e of n) {
|
|
1805
|
-
let n = t[e] ?? null;
|
|
1806
|
-
for (let t of this.#e.get(e) ?? []) try {
|
|
1807
|
-
t(n);
|
|
1808
|
-
} catch {
|
|
1809
|
-
this.host.reportListenerFailure();
|
|
1810
|
-
}
|
|
1811
|
-
}
|
|
1812
|
-
return n;
|
|
1813
|
-
}
|
|
1814
|
-
subscribe(e, t) {
|
|
1815
|
-
let n = this.#e.get(e) ?? /* @__PURE__ */ new Set();
|
|
1816
|
-
return n.add(t), this.#e.set(e, n), () => {
|
|
1817
|
-
n.delete(t), n.size === 0 && this.#e.delete(e);
|
|
1818
|
-
};
|
|
1819
|
-
}
|
|
1820
|
-
};
|
|
1821
|
-
function $(e, t) {
|
|
1822
|
-
return JSON.stringify(e) === JSON.stringify(t);
|
|
1823
|
-
}
|
|
1824
|
-
var Qe = globalThis.HTMLElement ?? class {}, $e = class extends Qe {
|
|
1825
|
-
#e;
|
|
1826
|
-
#t;
|
|
1827
|
-
#n;
|
|
1828
|
-
#r;
|
|
1829
|
-
#i;
|
|
1830
|
-
#a;
|
|
1831
|
-
#o;
|
|
1832
|
-
#s;
|
|
1833
|
-
#c;
|
|
1834
|
-
#l;
|
|
1835
|
-
#u;
|
|
1836
|
-
#d = 15e3;
|
|
1837
|
-
#f = "viewer";
|
|
1838
|
-
#p = "viewer";
|
|
1839
|
-
#m;
|
|
1840
|
-
#h;
|
|
1841
|
-
#g;
|
|
1842
|
-
#_;
|
|
1843
|
-
#v;
|
|
1844
|
-
#y = !1;
|
|
1845
|
-
#b;
|
|
1846
|
-
#x;
|
|
1847
|
-
#S = new Ze({
|
|
1848
|
-
readDocument: () => this.#c,
|
|
1849
|
-
readVariables: () => this.#u,
|
|
1850
|
-
setValue: (e, t) => this.setVariableValue(e, t),
|
|
1851
|
-
reportListenerFailure: () => this.emitLifecycleDiagnostic("Variable change listener failed.")
|
|
1852
|
-
});
|
|
1853
|
-
#C = new Ye({
|
|
1854
|
-
readRenderer: () => this.#h,
|
|
1855
|
-
readDocument: () => this.#c,
|
|
1856
|
-
readBlueprintPlan: () => this.#l,
|
|
1857
|
-
readBlueprintVariables: () => this.#u,
|
|
1858
|
-
writeBlueprintVariables: (e) => {
|
|
1859
|
-
this.writeBlueprintVariables(e, !0);
|
|
1860
|
-
},
|
|
1861
|
-
emitDiagnostics: (e) => this.emitDiagnostics(e),
|
|
1862
|
-
onRenderSettled: () => this.markRendered()
|
|
1863
|
-
});
|
|
1864
|
-
#w = new X({
|
|
1865
|
-
readRenderer: () => this.#h,
|
|
1866
|
-
readDocument: () => this.#c
|
|
1867
|
-
});
|
|
1868
|
-
configure(e) {
|
|
1869
|
-
if (this.#h !== void 0) return Y("Viewer 已初始化,请先 unload 再重新配置。");
|
|
1870
|
-
let t = We(e);
|
|
1871
|
-
if (!t.ok) return t;
|
|
1872
|
-
let n = t.value;
|
|
1873
|
-
return this.#e = n.catalog, this.#t = n.resourcePort, this.#n = n.datasetPort, this.#r = n.hostCatalogPort, this.#i = n.conditionalStylePort, this.#a = n.runtimeContributions, this.#o = n.blueprintRuntimePort, this.#s = n.blueprintHostActionPort, this.#d = n.resourceTimeoutMs, this.#f = n.instanceId ?? "viewer", this.#p = n.mode ?? "viewer", this.#m = n.observer, this.#b = n.projectId, this.#x = n.documentRevision, this.initialize(), this.#C.start(void 0, !1, !0), this.#w.sync(this.#c), {
|
|
1874
|
-
ok: !0,
|
|
1875
|
-
value: null,
|
|
1876
|
-
diagnostics: []
|
|
1877
|
-
};
|
|
1878
|
-
}
|
|
1879
|
-
get catalog() {
|
|
1880
|
-
return this.#e;
|
|
1881
|
-
}
|
|
1882
|
-
set catalog(e) {
|
|
1883
|
-
if (this.#h !== void 0 && e !== this.#e) {
|
|
1884
|
-
this.emitLifecycleDiagnostic("Catalog cannot change after initialization. Call unload first.");
|
|
1885
|
-
return;
|
|
1886
|
-
}
|
|
1887
|
-
this.#e = e;
|
|
1888
|
-
}
|
|
1889
|
-
refreshCatalog(e) {
|
|
1890
|
-
let t = this.#e;
|
|
1891
|
-
if (t === void 0 || !J(e)) return Y("Viewer must have a configured catalog before refreshing a valid catalog.");
|
|
1892
|
-
if (t === e) return {
|
|
1893
|
-
ok: !0,
|
|
1894
|
-
value: null,
|
|
1895
|
-
diagnostics: []
|
|
1896
|
-
};
|
|
1897
|
-
let n = this.#h, r = this.#c;
|
|
1898
|
-
if (n === void 0) return r === void 0 ? (this.#e = e, {
|
|
1899
|
-
ok: !0,
|
|
1900
|
-
value: null,
|
|
1901
|
-
diagnostics: []
|
|
1902
|
-
}) : Y("Catalog refresh requires an initialized renderer while a document is loaded.");
|
|
1903
|
-
if (r !== void 0) {
|
|
1904
|
-
let t = n.validateCatalog(r, e);
|
|
1905
|
-
if (!t.ok) return t;
|
|
1906
|
-
}
|
|
1907
|
-
let i = this.#C.hasDeferredDocument;
|
|
1908
|
-
try {
|
|
1909
|
-
let a = n.setCatalog(e);
|
|
1910
|
-
if (!a.ok) return a;
|
|
1911
|
-
let o = r === void 0 || i ? {
|
|
1912
|
-
ok: !0,
|
|
1913
|
-
value: null,
|
|
1914
|
-
diagnostics: []
|
|
1915
|
-
} : n.render(r);
|
|
1916
|
-
if (o.ok && !o.diagnostics.some((e) => e.severity === "error")) return this.#e = e, o;
|
|
1917
|
-
let s = n.setCatalog(t), c = s.ok && r !== void 0 && !i ? n.render(r) : s;
|
|
1918
|
-
return {
|
|
1919
|
-
ok: !1,
|
|
1920
|
-
diagnostics: [...o.diagnostics, ...c.diagnostics]
|
|
1921
|
-
};
|
|
1922
|
-
} catch {
|
|
1923
|
-
let e = Y("Viewer catalog refresh failed.");
|
|
1924
|
-
try {
|
|
1925
|
-
let a = n.setCatalog(t), o = a.ok && r !== void 0 && !i ? n.render(r) : a;
|
|
1926
|
-
return {
|
|
1927
|
-
ok: !1,
|
|
1928
|
-
diagnostics: [...e.diagnostics, ...o.diagnostics]
|
|
1929
|
-
};
|
|
1930
|
-
} catch {
|
|
1931
|
-
return {
|
|
1932
|
-
ok: !1,
|
|
1933
|
-
diagnostics: [...e.diagnostics, ...Y("Viewer catalog rollback failed.").diagnostics]
|
|
1934
|
-
};
|
|
1935
|
-
}
|
|
1936
|
-
}
|
|
1937
|
-
}
|
|
1938
|
-
get datasetPort() {
|
|
1939
|
-
return this.#n;
|
|
1940
|
-
}
|
|
1941
|
-
get resourcePort() {
|
|
1942
|
-
return this.#t;
|
|
1943
|
-
}
|
|
1944
|
-
get hostCatalogPort() {
|
|
1945
|
-
return this.#r;
|
|
1946
|
-
}
|
|
1947
|
-
get conditionalStylePort() {
|
|
1948
|
-
return this.#i;
|
|
1949
|
-
}
|
|
1950
|
-
set conditionalStylePort(e) {
|
|
1951
|
-
if (this.#h !== void 0 && e !== this.#i) {
|
|
1952
|
-
this.emitLifecycleDiagnostic("Conditional style port cannot change after initialization. Call unload first.");
|
|
1953
|
-
return;
|
|
1954
|
-
}
|
|
1955
|
-
this.#i = e;
|
|
1956
|
-
}
|
|
1957
|
-
get resourceTimeoutMs() {
|
|
1958
|
-
return this.#d;
|
|
1959
|
-
}
|
|
1960
|
-
set resourceTimeoutMs(e) {
|
|
1961
|
-
if (this.#h !== void 0 && e !== this.#d) {
|
|
1962
|
-
this.emitLifecycleDiagnostic("Resource timeout cannot change after initialization. Call unload first.");
|
|
1963
|
-
return;
|
|
1964
|
-
}
|
|
1965
|
-
if (!Number.isInteger(e) || e < 100 || e > 6e4) {
|
|
1966
|
-
this.emitLifecycleDiagnostic("Resource timeout must be an integer between 100 and 60000.");
|
|
1967
|
-
return;
|
|
1968
|
-
}
|
|
1969
|
-
this.#d = e;
|
|
1970
|
-
}
|
|
1971
|
-
set hostCatalogPort(e) {
|
|
1972
|
-
if (this.#h !== void 0 && e !== this.#r) {
|
|
1973
|
-
this.emitLifecycleDiagnostic("Host catalog port cannot change after initialization. Call unload first.");
|
|
1974
|
-
return;
|
|
1975
|
-
}
|
|
1976
|
-
this.#r = e;
|
|
1977
|
-
}
|
|
1978
|
-
set runtimeContributions(e) {
|
|
1979
|
-
if (this.#h !== void 0 && e !== this.#a) {
|
|
1980
|
-
this.emitLifecycleDiagnostic("Runtime contributions cannot change after initialization. Call unload first.");
|
|
1981
|
-
return;
|
|
1982
|
-
}
|
|
1983
|
-
this.#a = e;
|
|
1984
|
-
}
|
|
1985
|
-
set resourcePort(e) {
|
|
1986
|
-
if (this.#h !== void 0 && e !== this.#t) {
|
|
1987
|
-
this.emitLifecycleDiagnostic("Resource port cannot change after initialization. Call unload first.");
|
|
1988
|
-
return;
|
|
1989
|
-
}
|
|
1990
|
-
this.#t = e;
|
|
1991
|
-
}
|
|
1992
|
-
get blueprintRuntimePort() {
|
|
1993
|
-
return this.#o;
|
|
1994
|
-
}
|
|
1995
|
-
set blueprintRuntimePort(e) {
|
|
1996
|
-
this.#o = e;
|
|
1997
|
-
}
|
|
1998
|
-
get blueprintHostActionPort() {
|
|
1999
|
-
return this.#s;
|
|
2000
|
-
}
|
|
2001
|
-
set blueprintHostActionPort(e) {
|
|
2002
|
-
this.#s = e;
|
|
2003
|
-
}
|
|
2004
|
-
get document() {
|
|
2005
|
-
return this.#c;
|
|
2006
|
-
}
|
|
2007
|
-
set document(e) {
|
|
2008
|
-
this.#C.cancel(), this.#w.suspend(), this.#h?.resetBlueprintVisibility(), this.#c = e, this.compileBlueprint(), e !== void 0 && this.ensureSkeleton(), this.initialize(), this.#C.start(void 0, !1, !0), this.#w.resume(), e === void 0 ? this.clearSkeleton() : this.#l === void 0 && this.markRendered();
|
|
2009
|
-
}
|
|
2010
|
-
connectedCallback() {
|
|
2011
|
-
this.ensureSkeleton(), this.initialize(), this.#C.start(void 0, !1, !0), this.#w.resume();
|
|
2012
|
-
}
|
|
2013
|
-
disconnectedCallback() {
|
|
2014
|
-
this.#w.suspend(), this.#C.cancel(), this.#h?.clear();
|
|
2015
|
-
}
|
|
2016
|
-
unload() {
|
|
2017
|
-
this.#w.dispose(), this.#C.reset(), this.#S.clear(), this.disposeRenderer(), this.#c = void 0, this.compileBlueprint(), this.#y = !1;
|
|
2018
|
-
}
|
|
2019
|
-
refreshData(e) {
|
|
2020
|
-
this.#C.refreshData(e);
|
|
2021
|
-
}
|
|
2022
|
-
refreshVariables(e) {
|
|
2023
|
-
this.#C.refreshVariables(e);
|
|
2024
|
-
}
|
|
2025
|
-
refreshConditionalStyles(e) {
|
|
2026
|
-
this.#h?.refreshConditionalStyles(e);
|
|
2027
|
-
}
|
|
2028
|
-
getVariable(e) {
|
|
2029
|
-
return this.#S.get(e);
|
|
2030
|
-
}
|
|
2031
|
-
initialize() {
|
|
2032
|
-
if (!this.isConnected || this.#e === void 0 || this.#h !== void 0) return;
|
|
2033
|
-
let e = this.shadowRoot ?? this.attachShadow({ mode: "open" });
|
|
2034
|
-
this.#g = this.ownerDocument.createElement("div"), e.appendChild(this.#g), this.#h = K({
|
|
2035
|
-
root: this.#g,
|
|
2036
|
-
catalog: this.#e,
|
|
2037
|
-
mode: "viewer",
|
|
2038
|
-
interactive: !0,
|
|
2039
|
-
componentFailurePolicy: "skip",
|
|
2040
|
-
onMaterialEvent: (e) => {
|
|
2041
|
-
this.handleMaterialEvent(e), this.dispatchEvent(new CustomEvent("base-screen-material-event", {
|
|
2042
|
-
bubbles: !0,
|
|
2043
|
-
composed: !0,
|
|
2044
|
-
detail: e
|
|
2045
|
-
}));
|
|
2046
|
-
},
|
|
2047
|
-
resourcePort: this.#t,
|
|
2048
|
-
...this.#n === void 0 ? {} : { datasetPort: this.#n },
|
|
2049
|
-
...this.#r === void 0 ? {} : { hostCatalogPort: this.#r },
|
|
2050
|
-
onDataSourceSettled: (e) => this.#C.handleDataSourceSettled(e),
|
|
2051
|
-
...this.#i === void 0 ? {} : { conditionalStylePort: this.#i },
|
|
2052
|
-
resourceTimeoutMs: this.#d,
|
|
2053
|
-
...this.#a === void 0 ? {} : { contributionIndex: this.#a },
|
|
2054
|
-
...this.#m === void 0 ? {} : { observer: this.#m },
|
|
2055
|
-
...this.#f === void 0 ? {} : { instanceId: this.#f },
|
|
2056
|
-
...this.#p === void 0 ? {} : { executionMode: this.#p },
|
|
2057
|
-
...this.#b === void 0 ? {} : { projectId: this.#b },
|
|
2058
|
-
...this.#x === void 0 ? {} : { documentRevision: this.#x }
|
|
2059
|
-
});
|
|
2060
|
-
}
|
|
2061
|
-
ensureSkeleton() {
|
|
2062
|
-
if (this.#y || this.#_ !== void 0) return;
|
|
2063
|
-
let e = this.shadowRoot ?? this.attachShadow({ mode: "open" });
|
|
2064
|
-
this.#v === void 0 && (this.#v = qe(this.ownerDocument), e.appendChild(this.#v)), this.#_ = Je(this.ownerDocument), e.appendChild(this.#_), this.setAttribute("data-viewer-state", "loading"), this.setAttribute("aria-busy", "true");
|
|
2065
|
-
}
|
|
2066
|
-
markRendered() {
|
|
2067
|
-
this.#y = !0, this.clearSkeleton(), this.isConnected && (this.setAttribute("data-viewer-state", "ready"), this.removeAttribute("aria-busy"));
|
|
2068
|
-
}
|
|
2069
|
-
clearSkeleton() {
|
|
2070
|
-
this.#_?.remove(), this.#_ = void 0, this.#v?.remove(), this.#v = void 0;
|
|
2071
|
-
}
|
|
2072
|
-
disposeRenderer() {
|
|
2073
|
-
this.#h?.dispose(), this.#h = void 0, this.#g?.remove(), this.#g = void 0, this.clearSkeleton();
|
|
2074
|
-
}
|
|
2075
|
-
compileBlueprint() {
|
|
2076
|
-
if (this.#c === void 0) {
|
|
2077
|
-
this.#l = void 0, this.#u = void 0;
|
|
2078
|
-
return;
|
|
2079
|
-
}
|
|
2080
|
-
let e = y(this.#c, this.#a ?? { hasBlueprintCapability: () => !1 });
|
|
2081
|
-
if (!e.ok) {
|
|
2082
|
-
this.#l = void 0, this.#u = void 0, this.dispatchEvent(new CustomEvent("base-screen-diagnostic", { detail: { diagnostics: e.diagnostics } }));
|
|
2083
|
-
return;
|
|
2084
|
-
}
|
|
2085
|
-
this.#l = e.value, this.#u = e.value.initialVariables;
|
|
2086
|
-
}
|
|
2087
|
-
handleMaterialEvent(e) {
|
|
2088
|
-
this.handleBlueprintEvent({
|
|
2089
|
-
type: "material-event",
|
|
2090
|
-
componentId: e.componentId,
|
|
2091
|
-
name: e.name,
|
|
2092
|
-
payload: e.payload
|
|
2093
|
-
});
|
|
2094
|
-
}
|
|
2095
|
-
handleBlueprintEvent(e, t = 0) {
|
|
2096
|
-
if (this.#l === void 0 || this.#u === void 0) return;
|
|
2097
|
-
if (t > 32) {
|
|
2098
|
-
this.emitLifecycleDiagnostic("Blueprint variable event cycle exceeded its limit.");
|
|
2099
|
-
return;
|
|
2100
|
-
}
|
|
2101
|
-
let n = this.#u, r = te(this.#l, n, e);
|
|
2102
|
-
if (!r.ok) {
|
|
2103
|
-
this.emitLifecycleDiagnostic("Blueprint event payload is invalid.");
|
|
2104
|
-
return;
|
|
2105
|
-
}
|
|
2106
|
-
let i = this.#h, a = this.#c, o = {
|
|
2107
|
-
...r.value,
|
|
2108
|
-
variables: Xe(a, n, r.value.variables)
|
|
2109
|
-
}, s = this.writeBlueprintVariables(o.variables, !1);
|
|
2110
|
-
if (i !== void 0 && a !== void 0) {
|
|
2111
|
-
let e = Le(i, a, n, o);
|
|
2112
|
-
e.length > 0 && this.emitDiagnostics(e);
|
|
2113
|
-
}
|
|
2114
|
-
for (let e of r.value.hostEvents) this.#o === void 0 ? this.dispatchEvent(new CustomEvent("base-screen-blueprint-event", { detail: e })) : Promise.resolve(this.#o.emit(e)).catch(() => {
|
|
2115
|
-
this.emitLifecycleDiagnostic("Blueprint host event failed.");
|
|
2116
|
-
});
|
|
2117
|
-
for (let e of r.value.hostActions) this.#s === void 0 ? this.emitLifecycleDiagnostic("Blueprint host action is unavailable.") : Promise.resolve(this.#s.execute(e)).catch(() => {
|
|
2118
|
-
this.emitLifecycleDiagnostic("Blueprint host action failed.");
|
|
2119
|
-
});
|
|
2120
|
-
for (let e of r.value.componentDataRequests) i?.refreshData(e);
|
|
2121
|
-
r.value.variableRequests.length > 0 && this.#C.refreshVariables({ variableIds: [...new Set(r.value.variableRequests)] });
|
|
2122
|
-
for (let e of s) this.handleBlueprintEvent({
|
|
2123
|
-
type: "variable-event",
|
|
2124
|
-
variableId: e,
|
|
2125
|
-
name: "data-updated",
|
|
2126
|
-
payload: r.value.variables[e] ?? null
|
|
2127
|
-
}, t + 1);
|
|
2128
|
-
}
|
|
2129
|
-
setVariableValue(t, n) {
|
|
2130
|
-
let r = e(n);
|
|
2131
|
-
if (!r.ok) return r;
|
|
2132
|
-
let i = this.#h, a = this.#c, o = this.#u, s = a?.variables.find((e) => e.id === t);
|
|
2133
|
-
if (i === void 0 || a === void 0 || o === void 0 || s === void 0) return Y("Viewer variable is unavailable.");
|
|
2134
|
-
let c = Q(s);
|
|
2135
|
-
if (c !== void 0) return c;
|
|
2136
|
-
if ($(o[t], r.value)) return {
|
|
2137
|
-
ok: !0,
|
|
2138
|
-
value: null,
|
|
2139
|
-
diagnostics: []
|
|
2140
|
-
};
|
|
2141
|
-
let l = {
|
|
2142
|
-
...o,
|
|
2143
|
-
[t]: r.value
|
|
2144
|
-
}, u = i.setVariables(l);
|
|
2145
|
-
if (!u.ok) return u;
|
|
2146
|
-
let d = i.render(a, { trigger: "variable" });
|
|
2147
|
-
return d.ok ? (this.writeBlueprintVariables(l, !1), this.handleBlueprintEvent({
|
|
2148
|
-
type: "variable-event",
|
|
2149
|
-
variableId: t,
|
|
2150
|
-
name: "data-updated",
|
|
2151
|
-
payload: r.value
|
|
2152
|
-
}), {
|
|
2153
|
-
ok: !0,
|
|
2154
|
-
value: null,
|
|
2155
|
-
diagnostics: d.diagnostics
|
|
2156
|
-
}) : (i.setVariables(o), d);
|
|
2157
|
-
}
|
|
2158
|
-
writeBlueprintVariables(e, t = !1) {
|
|
2159
|
-
let n = this.#u;
|
|
2160
|
-
if (this.#u = e, n === void 0) return [];
|
|
2161
|
-
let r = this.#S.notify(n, e);
|
|
2162
|
-
if (t) for (let t of r) this.handleBlueprintEvent({
|
|
2163
|
-
type: "variable-event",
|
|
2164
|
-
variableId: t,
|
|
2165
|
-
name: "data-updated",
|
|
2166
|
-
payload: e[t] ?? null
|
|
2167
|
-
});
|
|
2168
|
-
return r;
|
|
2169
|
-
}
|
|
2170
|
-
emitDiagnostics(e) {
|
|
2171
|
-
this.dispatchEvent(new CustomEvent("base-screen-diagnostic", { detail: { diagnostics: e } }));
|
|
2172
|
-
}
|
|
2173
|
-
emitLifecycleDiagnostic(e) {
|
|
2174
|
-
this.emitDiagnostics([{
|
|
2175
|
-
severity: "error",
|
|
2176
|
-
code: "PLUGIN_CORE_LIFECYCLE_INVALID",
|
|
2177
|
-
path: [],
|
|
2178
|
-
message: e
|
|
2179
|
-
}]);
|
|
2180
|
-
}
|
|
2181
|
-
};
|
|
2182
|
-
//#endregion
|
|
2183
|
-
export { K as n, $e as t };
|
|
2184
|
-
|
|
2185
|
-
//# sourceMappingURL=dist-DfAV2jGI.js.map
|