base-screen 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -12
- package/dist/_internal/contracts/document/blueprint-capabilities.d.ts +9 -1
- package/dist/_internal/contracts/document/blueprint-capabilities.js +16 -0
- package/dist/_internal/contracts/document/blueprint-graph.d.ts +68 -0
- package/dist/_internal/contracts/document/blueprint-graph.js +424 -0
- package/dist/_internal/contracts/document/blueprint-strict.d.ts +3 -1
- package/dist/_internal/contracts/document/blueprint-strict.js +77 -91
- package/dist/_internal/contracts/document/component-states.d.ts +54 -0
- package/dist/_internal/contracts/document/component-states.js +171 -0
- package/dist/_internal/contracts/document/json-schema.js +49 -17
- package/dist/_internal/contracts/document/limits.d.ts +40 -8
- package/dist/_internal/contracts/document/limits.js +40 -8
- package/dist/_internal/contracts/document/parse-parts.d.ts +12 -0
- package/dist/_internal/contracts/document/parse-parts.js +56 -0
- package/dist/_internal/contracts/document/parse.js +1 -1
- package/dist/_internal/contracts/document/references.js +108 -41
- package/dist/_internal/contracts/document/schema.d.ts +525 -186
- package/dist/_internal/contracts/document/schema.js +234 -95
- package/dist/_internal/contracts/document/sub-canvas.d.ts +27 -0
- package/dist/_internal/contracts/document/sub-canvas.js +38 -0
- package/dist/_internal/contracts/document/theme.d.ts +22 -0
- package/dist/_internal/contracts/document/theme.js +65 -0
- package/dist/_internal/contracts/document/validate-blueprint.d.ts +7 -0
- package/dist/_internal/contracts/document/validate-blueprint.js +223 -25
- package/dist/_internal/contracts/document/validate-component.d.ts +2 -0
- package/dist/_internal/contracts/document/validate-component.js +111 -54
- package/dist/_internal/contracts/document/validate-data-source.js +84 -9
- package/dist/_internal/contracts/document/validate-sub-canvas.d.ts +9 -0
- package/dist/_internal/contracts/document/validate-sub-canvas.js +92 -0
- package/dist/_internal/contracts/document/validate-theme.d.ts +4 -0
- package/dist/_internal/contracts/document/validate-theme.js +20 -0
- package/dist/_internal/contracts/document/validate.js +19 -2
- package/dist/_internal/contracts/index.d.ts +11 -4
- package/dist/_internal/contracts/index.js +8 -2
- package/dist/_internal/contracts/migration/blueprint-graph-migration.d.ts +21 -0
- package/dist/_internal/contracts/migration/blueprint-graph-migration.js +328 -0
- package/dist/_internal/contracts/migration/migrate-document.d.ts +2 -1
- package/dist/_internal/contracts/migration/migrate-document.js +11 -3
- package/dist/_internal/contracts/push/delivery.d.ts +16 -0
- package/dist/_internal/contracts/push/delivery.js +70 -0
- package/dist/_internal/contracts/push/level-scale.d.ts +7 -0
- package/dist/_internal/contracts/push/level-scale.js +91 -0
- package/dist/_internal/contracts/screen-document.schema.json +1056 -383
- package/dist/_internal/contracts/types/document.d.ts +277 -76
- package/dist/_internal/contracts/types/execution.d.ts +12 -2
- package/dist/_internal/contracts/types/execution.js +0 -5
- package/dist/_internal/contracts/types/host.d.ts +35 -1
- package/dist/_internal/contracts/types/host.js +7 -1
- package/dist/_internal/contracts/types/push.d.ts +86 -0
- package/dist/_internal/contracts/types/push.js +1 -0
- package/dist/_internal/contracts/types/variable.d.ts +5 -0
- package/dist/_internal/contracts/variable/parse.js +30 -1
- package/dist/_internal/core/blueprint/runtime-compile.d.ts +4 -0
- package/dist/_internal/core/blueprint/runtime-compile.js +45 -21
- package/dist/_internal/core/blueprint/runtime-dispatch.js +270 -156
- package/dist/_internal/core/blueprint/runtime-types.d.ts +112 -6
- package/dist/_internal/core/blueprint/runtime.d.ts +1 -1
- package/dist/_internal/core/commands/apply-component-commands.d.ts +5 -0
- package/dist/_internal/core/commands/apply-component-commands.js +74 -2
- package/dist/_internal/core/commands/apply.js +63 -3
- package/dist/_internal/core/commands/parse-command.js +12 -0
- package/dist/_internal/core/commands/types.d.ts +28 -3
- package/dist/_internal/core/diff/screen-diff.js +1 -1
- package/dist/_internal/core/index.d.ts +1 -1
- package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-canvas-bridge-helpers.d.ts +1 -1
- package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-canvas-bridge.d.ts +11 -1
- package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-panels-controller.d.ts +18 -4
- package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-timer-scheduler.d.ts +21 -0
- package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-workbench-panel.d.ts +8 -1
- package/dist/_internal/engine/browser/controllers/dataset/designer-data-source-authoring.d.ts +25 -1
- package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-controller-context.d.ts +6 -2
- package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-draft-controller.d.ts +8 -0
- package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-surface-controller.d.ts +14 -0
- package/dist/_internal/engine/browser/controllers/dataset/designer-update-policy-authoring.d.ts +52 -0
- package/dist/_internal/engine/browser/controllers/designer-artboard-controller.d.ts +80 -0
- package/dist/_internal/engine/browser/controllers/designer-canvas-runtime-controller.d.ts +21 -3
- package/dist/_internal/engine/browser/controllers/designer-change-controller.d.ts +2 -0
- package/dist/_internal/engine/browser/controllers/designer-command-palette-controller.d.ts +2 -0
- package/dist/_internal/engine/browser/controllers/designer-notification-controller.d.ts +7 -0
- package/dist/_internal/engine/browser/controllers/designer-page-preview-controller.d.ts +34 -0
- package/dist/_internal/engine/browser/controllers/designer-popup-preview-controller.d.ts +40 -0
- package/dist/_internal/engine/browser/controllers/designer-preview-controller.d.ts +1 -3
- package/dist/_internal/engine/browser/controllers/designer-reference-layer-controller.d.ts +45 -0
- package/dist/_internal/engine/browser/controllers/designer-viewport-controller.d.ts +10 -0
- package/dist/_internal/engine/browser/controllers/gesture/designer-gesture-callbacks.d.ts +5 -1
- package/dist/_internal/engine/browser/controllers/gesture/designer-gesture-controller.d.ts +2 -0
- package/dist/_internal/engine/browser/controllers/gesture/designer-gesture-environment.d.ts +18 -7
- package/dist/_internal/engine/browser/controllers/gesture/designer-group-editing-controller.d.ts +8 -1
- package/dist/_internal/engine/browser/controllers/layers/designer-layers-controller.d.ts +11 -0
- package/dist/_internal/engine/browser/controllers/panel/designer-component-states-controller.d.ts +26 -0
- package/dist/_internal/engine/browser/controllers/panel/designer-inspector-focus.d.ts +30 -0
- package/dist/_internal/engine/browser/controllers/panel/designer-panel-controller-callbacks.d.ts +23 -6
- package/dist/_internal/engine/browser/controllers/panel/designer-panel-controller.d.ts +2 -2
- package/dist/_internal/engine/browser/controllers/panel/designer-panel-material-controller.d.ts +4 -0
- package/dist/_internal/engine/browser/controllers/panel/designer-panel-property-controller.d.ts +2 -0
- package/dist/_internal/engine/browser/controllers/workbench/designer-snap-controller.d.ts +5 -1
- package/dist/_internal/engine/browser/controllers/workbench/designer-workbench-controller.d.ts +7 -1
- package/dist/_internal/engine/browser/dom/blueprint/designer-blueprint-inspector-configuration.d.ts +12 -0
- package/dist/_internal/engine/browser/dom/blueprint/designer-blueprint-library-dom.d.ts +18 -2
- package/dist/_internal/engine/browser/dom/change/designer-change-dom.d.ts +1 -0
- package/dist/_internal/engine/browser/dom/color/designer-color-palette-dom.d.ts +1 -0
- package/dist/_internal/engine/browser/dom/color/designer-color-palette-theme.d.ts +10 -0
- package/dist/_internal/engine/browser/dom/color/designer-color-palette-types.d.ts +13 -0
- package/dist/_internal/engine/browser/dom/color/designer-color-theme-slots.d.ts +10 -0
- package/dist/_internal/engine/browser/dom/dataset/designer-dataset-types.d.ts +17 -6
- package/dist/_internal/engine/browser/dom/descriptor/designer-descriptor-control-dom.d.ts +17 -1
- package/dist/_internal/engine/browser/dom/descriptor/designer-descriptor-model.d.ts +2 -0
- package/dist/_internal/engine/browser/dom/designer-field-primitives.d.ts +43 -1
- package/dist/_internal/engine/browser/dom/designer-icons.d.ts +2 -0
- package/dist/_internal/engine/browser/dom/designer-select-dom.d.ts +2 -0
- package/dist/_internal/engine/browser/dom/designer-ui-primitives.d.ts +5 -0
- package/dist/_internal/engine/browser/dom/layers/designer-layers-model.d.ts +28 -0
- package/dist/_internal/engine/browser/dom/material-library/designer-material-library-dom.d.ts +18 -2
- package/dist/_internal/engine/browser/dom/material-library/designer-material-library-group-view.d.ts +1 -0
- package/dist/_internal/engine/browser/dom/menu/designer-menu-model.d.ts +4 -2
- package/dist/_internal/engine/browser/dom/panel/designer-canvas-properties-dom.d.ts +10 -2
- package/dist/_internal/engine/browser/dom/panel/designer-canvas-transactions.d.ts +5 -1
- package/dist/_internal/engine/browser/dom/panel/designer-chrome-primitives.d.ts +12 -0
- package/dist/_internal/engine/browser/dom/panel/designer-color-group-dom.d.ts +45 -0
- package/dist/_internal/engine/browser/dom/panel/designer-component-properties-dom.d.ts +4 -3
- package/dist/_internal/engine/browser/dom/panel/designer-component-states-dom.d.ts +22 -0
- package/dist/_internal/engine/browser/dom/panel/designer-panel-primitives.d.ts +18 -2
- package/dist/_internal/engine/browser/dom/workspace/designer-workspace-template.d.ts +13 -0
- package/dist/_internal/engine/browser/dom/workspace/designer-workspace.d.ts +2 -1
- package/dist/_internal/engine/browser/viewport/designer-canvas-aids-types.d.ts +8 -2
- package/dist/_internal/engine/browser/viewport/designer-canvas-aids.d.ts +14 -4
- package/dist/_internal/engine/browser/viewport/designer-canvas-coordinates.d.ts +7 -0
- package/dist/_internal/engine/browser/viewport/designer-canvas-measurements.d.ts +12 -1
- package/dist/_internal/engine/browser/viewport/designer-canvas-snap-alignment-index.d.ts +27 -0
- package/dist/_internal/engine/browser/viewport/designer-canvas-snap-geometry.d.ts +13 -2
- package/dist/_internal/engine/browser/viewport/designer-canvas-snap-preview.d.ts +1 -1
- package/dist/_internal/engine/browser/viewport/designer-canvas-snap-spacing.d.ts +12 -0
- package/dist/_internal/engine/browser/viewport/designer-guide-overlay-nodes.d.ts +2 -0
- package/dist/_internal/engine/common/observability/designer-metrics.d.ts +1 -1
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-geometry.d.ts +12 -0
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-graph.d.ts +203 -0
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-model-types.d.ts +6 -2
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-model.d.ts +58 -7
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-protocol-types.d.ts +131 -51
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-value-sources.d.ts +7 -3
- package/dist/_internal/engine/common/operations/catalog/designer-catalog-refresh.d.ts +13 -1
- package/dist/_internal/engine/common/operations/designer-operation-registry.d.ts +5 -1
- package/dist/_internal/engine/common/operations/designer-variable-operations.d.ts +8 -0
- package/dist/_internal/engine/common/operations/element/designer-element-operation-types.d.ts +8 -0
- package/dist/_internal/engine/common/operations/host-resource/host-resource-authoring.d.ts +1 -1
- package/dist/_internal/engine/common/operations/material-component/material-component-fragment-extract.d.ts +34 -0
- package/dist/_internal/engine/common/operations/material-component/material-component-fragment.d.ts +24 -41
- package/dist/_internal/engine/common/operations/material-component/material-component.d.ts +1 -1
- package/dist/_internal/engine/common/operations/material-library/material-library-fragments.d.ts +46 -0
- package/dist/_internal/engine/common/operations/material-library/material-library-grouping.d.ts +11 -0
- package/dist/_internal/engine/common/operations/selection/designer-group.d.ts +16 -4
- package/dist/_internal/engine/common/operations/selection/designer-multi-selection-operations.d.ts +4 -3
- package/dist/_internal/engine/common/operations/selection/designer-selection-actions.d.ts +6 -0
- package/dist/_internal/engine/common/operations/selection/designer-selection.d.ts +8 -0
- package/dist/_internal/engine/common/operations/style/designer-component-states.d.ts +62 -0
- package/dist/_internal/engine/common/operations/style/designer-material-appearance.d.ts +30 -0
- package/dist/_internal/engine/common/session/designer-artboard.d.ts +40 -0
- package/dist/_internal/engine/common/session/designer-session.d.ts +21 -0
- package/dist/_internal/engine/common/ui-text/designer-blueprint-ui-text.d.ts +169 -0
- package/dist/_internal/engine/common/ui-text/designer-ui-text.d.ts +422 -88
- package/dist/_internal/engine/designer-blueprint-workbench-panel-CJ3iZo5v.js +2872 -0
- package/dist/_internal/engine/{designer-dataset-controller-CPytVNBK.js → designer-dataset-controller-CrfOg2Ys.js} +1764 -1507
- package/dist/_internal/engine/designer-element/api/designer-element-catalog.d.ts +4 -3
- package/dist/_internal/engine/designer-element/api/designer-element-configuration-types.d.ts +11 -8
- package/dist/_internal/engine/designer-element/api/designer-element-fragment-save.d.ts +16 -0
- package/dist/_internal/engine/designer-element/api/designer-element-host-properties.d.ts +0 -5
- package/dist/_internal/engine/designer-element/api/designer-element-insert-component-fragment.d.ts +9 -2
- package/dist/_internal/engine/designer-element/api/designer-element-material-library-fragments.d.ts +17 -0
- package/dist/_internal/engine/designer-element/api/designer-element-project.d.ts +0 -1
- package/dist/_internal/engine/designer-element/base-screen-designer-element.d.ts +24 -24
- package/dist/_internal/engine/designer-element/designer-element-public-api.d.ts +5 -5
- package/dist/_internal/engine/designer-element/runtime/designer-element-guards.d.ts +0 -2
- package/dist/_internal/engine/designer-element/runtime/designer-element-host.d.ts +6 -7
- package/dist/_internal/engine/designer-element/runtime/designer-element-rendering.d.ts +11 -1
- package/dist/_internal/engine/designer-element/runtime/designer-element-runtime.d.ts +15 -14
- package/dist/_internal/engine/designer-element/runtime/designer-element-state.d.ts +29 -10
- package/dist/_internal/engine/{designer-ui-primitives-CH4RNiMa.js → designer-field-primitives-KBZuWN_D.js} +876 -346
- package/dist/_internal/engine/designer-left-panel-groups-dom-N2OHOWjl.js +1282 -0
- package/dist/_internal/engine/host-resource-selection-xo2mLCD4.js +2482 -0
- package/dist/_internal/engine/host-tokens.css +12 -12
- package/dist/_internal/engine/index.js +8643 -6102
- package/dist/_internal/host-kit/index.d.ts +2 -0
- package/dist/_internal/host-kit/index.js +2 -0
- package/dist/_internal/host-kit/push-result.d.ts +5 -0
- package/dist/_internal/host-kit/push-result.js +8 -0
- package/dist/_internal/host-kit/sse-subscribe.d.ts +59 -0
- package/dist/_internal/host-kit/sse-subscribe.js +253 -0
- package/dist/_internal/host-kit/subscription-hub.d.ts +41 -0
- package/dist/_internal/host-kit/subscription-hub.js +179 -0
- package/dist/_internal/material/base-material.d.ts +1 -0
- package/dist/_internal/material/chart.d.ts +4 -0
- package/dist/_internal/material/chart.js +101 -58
- package/dist/_internal/material/container.js +19 -33
- package/dist/_internal/material/{base-material-BArgjOeL.js → editor-descriptor-DJZYygOa.js} +49 -20
- package/dist/_internal/material/editor-descriptor.d.ts +18 -0
- package/dist/_internal/material/image.js +30 -34
- package/dist/_internal/material/rule.js +29 -42
- package/dist/_internal/material/shapes.js +57 -74
- package/dist/_internal/material/table.d.ts +4 -0
- package/dist/_internal/material/table.js +118 -71
- package/dist/_internal/material/text.js +40 -68
- package/dist/_internal/plugin-core/contracts.d.ts +38 -49
- package/dist/_internal/plugin-core/contribution-kind.js +47 -2
- package/dist/_internal/plugin-core/editor/editor-ai-description.d.ts +3 -0
- package/dist/_internal/plugin-core/editor/editor-ai-description.js +124 -0
- package/dist/_internal/plugin-core/editor/editor-descriptor-conditions.js +5 -0
- package/dist/_internal/plugin-core/editor/editor-descriptor-inference.d.ts +32 -0
- package/dist/_internal/plugin-core/editor/editor-descriptor-inference.js +83 -0
- package/dist/_internal/plugin-core/editor/editor-descriptor-items.d.ts +6 -0
- package/dist/_internal/plugin-core/editor/editor-descriptor-items.js +41 -12
- package/dist/_internal/plugin-core/editor/editor-descriptor-model.d.ts +24 -1
- package/dist/_internal/plugin-core/editor/editor-descriptor-model.js +6 -1
- package/dist/_internal/plugin-core/editor/editor-descriptor-schema.js +21 -0
- package/dist/_internal/plugin-core/editor/editor-descriptor-sections.js +5 -7
- package/dist/_internal/plugin-core/editor/editor-descriptor.d.ts +1 -0
- package/dist/_internal/plugin-core/editor/editor-descriptor.js +55 -2
- package/dist/_internal/plugin-core/fragment/fragment.d.ts +96 -0
- package/dist/_internal/plugin-core/fragment/fragment.js +535 -0
- package/dist/_internal/plugin-core/index.d.ts +7 -4
- package/dist/_internal/plugin-core/index.js +5 -2
- package/dist/_internal/plugin-core/material/material-manifest.js +14 -2
- package/dist/_internal/plugin-core/material/material-schema.d.ts +9 -0
- package/dist/_internal/plugin-core/material/material-schema.js +31 -1
- package/dist/_internal/plugin-core/material/material-theme.d.ts +25 -0
- package/dist/_internal/plugin-core/material/material-theme.js +77 -0
- package/dist/_internal/plugin-core/material/material-validation-constants.js +2 -0
- package/dist/_internal/plugin-core/material/material.d.ts +1 -1
- package/dist/_internal/plugin-core/material/material.js +1 -1
- package/dist/_internal/plugin-manager/contribution-kind-plan.d.ts +2 -1
- package/dist/_internal/plugin-manager/contribution-kind-plan.js +6 -0
- package/dist/_internal/plugin-manager/contributions.js +10 -0
- package/dist/_internal/plugin-sdk/authoring-finding.d.ts +19 -0
- package/dist/_internal/plugin-sdk/authoring-finding.js +12 -0
- package/dist/_internal/plugin-sdk/fragment-audit.d.ts +14 -0
- package/dist/_internal/plugin-sdk/fragment-audit.js +170 -0
- package/dist/_internal/plugin-sdk/fragment-definition.d.ts +11 -0
- package/dist/_internal/plugin-sdk/fragment-definition.js +16 -0
- package/dist/_internal/plugin-sdk/index.d.ts +9 -0
- package/dist/_internal/plugin-sdk/index.js +9 -0
- package/dist/_internal/plugin-sdk/material-config-groups.d.ts +44 -0
- package/dist/_internal/plugin-sdk/material-config-groups.js +80 -0
- package/dist/_internal/plugin-sdk/material-editor-audit.d.ts +24 -0
- package/dist/_internal/plugin-sdk/material-editor-audit.js +160 -0
- package/dist/_internal/plugin-sdk/material-rendered-element.d.ts +69 -0
- package/dist/_internal/plugin-sdk/material-rendered-element.js +165 -0
- package/dist/_internal/plugin-sdk/material-spec-audit.d.ts +22 -0
- package/dist/_internal/plugin-sdk/material-spec-audit.js +184 -0
- package/dist/_internal/plugin-sdk/material-spec.d.ts +114 -0
- package/dist/_internal/plugin-sdk/material-spec.js +635 -0
- package/dist/_internal/plugin-sdk/material-style-keys.d.ts +17 -0
- package/dist/_internal/plugin-sdk/material-style-keys.js +82 -0
- package/dist/_internal/renderer/index.d.ts +2 -0
- package/dist/_internal/renderer/index.js +1745 -616
- package/dist/_internal/renderer/renderer/renderer-component-states.d.ts +34 -0
- package/dist/_internal/renderer/renderer/renderer-effective-style.d.ts +12 -6
- package/dist/_internal/renderer/renderer/renderer-material-dom.d.ts +19 -3
- package/dist/_internal/renderer/renderer/renderer-mounted-material.d.ts +11 -10
- package/dist/_internal/renderer/renderer/renderer-state.d.ts +17 -1
- package/dist/_internal/renderer/renderer/renderer-theme.d.ts +11 -0
- package/dist/_internal/renderer/renderer/renderer-types.d.ts +15 -5
- package/dist/_internal/renderer/renderer/renderer.d.ts +30 -9
- package/dist/_internal/renderer/resource/data-source-runtime.d.ts +25 -2
- package/dist/_internal/renderer/resource/push-window.d.ts +43 -0
- package/dist/_internal/renderer/resource/source-query-port.d.ts +8 -1
- package/dist/_internal/renderer/sub-canvas-layer.d.ts +83 -0
- package/dist/_internal/renderer/viewer/viewer-blueprint-timer-scheduler.d.ts +23 -0
- package/dist/_internal/renderer/viewer/viewer-configuration-guards.d.ts +0 -1
- package/dist/_internal/renderer/viewer/viewer-configuration.d.ts +6 -3
- package/dist/_internal/renderer/viewer/viewer-stale-style.d.ts +3 -0
- package/dist/_internal/renderer/viewer/viewer-variable-controller.d.ts +2 -0
- package/dist/_internal/renderer/viewer/viewer.d.ts +18 -7
- package/dist/_internal/sdk/auto-register.js +7 -7
- package/dist/_internal/sdk/designer-auto-register.js +3 -3
- package/dist/_internal/sdk/designer.d.ts +1 -1
- package/dist/_internal/sdk/designer.js +8 -8
- package/dist/_internal/sdk/host-tokens.css +12 -12
- package/dist/_internal/sdk/index.d.ts +1 -1
- package/dist/_internal/sdk/index.js +6 -6
- package/dist/auto-register.js +11 -11
- package/dist/auto-register.js.map +1 -1
- package/dist/contracts.js +73 -43
- package/dist/contracts.js.map +1 -1
- package/dist/core.js +151 -23
- package/dist/core.js.map +1 -1
- package/dist/{data-contracts-BFld0hw_.js → data-contracts-CnnB5KC9.js} +2 -2
- package/dist/{data-contracts-BFld0hw_.js.map → data-contracts-CnnB5KC9.js.map} +1 -1
- package/dist/dataset-port-D993nOlT.js +182 -0
- package/dist/dataset-port-D993nOlT.js.map +1 -0
- package/dist/{designer-Byw45cUM.js → designer-3Tb0EIDV.js} +3 -3
- package/dist/designer-3Tb0EIDV.js.map +1 -0
- package/dist/designer-auto-register.js +6 -6
- package/dist/designer-auto-register.js.map +1 -1
- package/dist/designer-blueprint-workbench-panel-CJ3iZo5v-BebifP4x.js +2852 -0
- package/dist/designer-blueprint-workbench-panel-CJ3iZo5v-BebifP4x.js.map +1 -0
- package/dist/{designer-dataset-controller-CPytVNBK-DWL3SRTP.js → designer-dataset-controller-CrfOg2Ys-DhKUEJJe.js} +1487 -1232
- package/dist/designer-dataset-controller-CrfOg2Ys-DhKUEJJe.js.map +1 -0
- package/dist/{designer-ui-primitives-CH4RNiMa-BNXQwJPZ.js → designer-field-primitives-KBZuWN_D-B3h4jpYe.js} +871 -343
- package/dist/designer-field-primitives-KBZuWN_D-B3h4jpYe.js.map +1 -0
- package/dist/designer-left-panel-groups-dom-N2OHOWjl-D8CzGwbF.js +1265 -0
- package/dist/designer-left-panel-groups-dom-N2OHOWjl-D8CzGwbF.js.map +1 -0
- package/dist/designer.js +5 -5
- package/dist/dist-6GRboBs-.js +3305 -0
- package/dist/dist-6GRboBs-.js.map +1 -0
- package/dist/{dist-BHTClwId.js → dist-BjLjFUy1.js} +8564 -6030
- package/dist/dist-BjLjFUy1.js.map +1 -0
- package/dist/engine.js +5 -4
- package/dist/fragment-Y6YnW6wy.js +393 -0
- package/dist/fragment-Y6YnW6wy.js.map +1 -0
- package/dist/host-kit.js +297 -3
- package/dist/host-kit.js.map +1 -1
- package/dist/{host-resource-selection-5Cf_gclK-Sv4Z8UXS.js → host-resource-selection-xo2mLCD4-BR5XCcim.js} +1233 -937
- package/dist/host-resource-selection-xo2mLCD4-BR5XCcim.js.map +1 -0
- package/dist/host-tokens.css +12 -12
- package/dist/index.js +10 -10
- package/dist/level-scale-BzUjE31V.js +139 -0
- package/dist/level-scale-BzUjE31V.js.map +1 -0
- package/dist/{manager-B2CZ2b5I.js → manager-Ch0RTu_i.js} +20 -10
- package/dist/manager-Ch0RTu_i.js.map +1 -0
- package/dist/material-UbSfiuZq.js +12 -0
- package/dist/{material-BPlvEmDi.js.map → material-UbSfiuZq.js.map} +1 -1
- package/dist/material-auto-register.js +6 -6
- package/dist/material-auto-register.js.map +1 -1
- package/dist/{material-definition-B9xCZcD-.js → material-definition-BeW34dJr.js} +2 -2
- package/dist/{material-definition-B9xCZcD-.js.map → material-definition-BeW34dJr.js.map} +1 -1
- package/dist/{material-manifest-bsGl6vZZ.js → material-manifest-B1XatGPx.js} +222 -137
- package/dist/material-manifest-B1XatGPx.js.map +1 -0
- package/dist/material-schema-CLoDx-Tl.js +203 -0
- package/dist/material-schema-CLoDx-Tl.js.map +1 -0
- package/dist/{editor-descriptor-schema-Be30Wv8w.js → material-theme-C91eus78.js} +90 -28
- package/dist/material-theme-C91eus78.js.map +1 -0
- package/dist/material-validation-utils-ku_6Xxk2.js +125 -0
- package/dist/material-validation-utils-ku_6Xxk2.js.map +1 -0
- package/dist/material.js +3 -3
- package/dist/migrate-document-D3HhCVlZ.js +768 -0
- package/dist/migrate-document-D3HhCVlZ.js.map +1 -0
- package/dist/parse-AOTE9WnD.js +2308 -0
- package/dist/parse-AOTE9WnD.js.map +1 -0
- package/dist/{parse-B0hwp_yj.js → parse-B1OD1teS.js} +69 -61
- package/dist/{parse-B0hwp_yj.js.map → parse-B1OD1teS.js.map} +1 -1
- package/dist/parse-parts-BNrpdG5o.js +42 -0
- package/dist/parse-parts-BNrpdG5o.js.map +1 -0
- package/dist/{plugin-B9Xxtw7G.js → plugin-DHgh9uHh.js} +140 -94
- package/dist/plugin-DHgh9uHh.js.map +1 -0
- package/dist/plugin-core.js +93 -8
- package/dist/plugin-core.js.map +1 -0
- package/dist/plugin-manager.js +1 -1
- package/dist/plugin-package-Dr5ro6h6.js +1221 -0
- package/dist/plugin-package-Dr5ro6h6.js.map +1 -0
- package/dist/{plugin-registration-BjS_CXJU.js → plugin-registration-rsmb4GvS.js} +4 -4
- package/dist/{plugin-registration-BjS_CXJU.js.map → plugin-registration-rsmb4GvS.js.map} +1 -1
- package/dist/plugin-sdk.js +6 -6
- package/dist/{plugins-B9bwk-t6.js → plugins-DGRHgREK.js} +2 -2
- package/dist/{plugins-B9bwk-t6.js.map → plugins-DGRHgREK.js.map} +1 -1
- package/dist/plugins.js +8 -8
- package/dist/renderer.js +1 -1
- package/dist/runtime-dispatch-BfnRDtMe.js +479 -0
- package/dist/runtime-dispatch-BfnRDtMe.js.map +1 -0
- package/dist/{src-Bm7u11mN-BMeb9fvV.js → src-Bm7u11mN-_0u6cMEw.js} +60 -60
- package/dist/{src-Bm7u11mN-BMeb9fvV.js.map → src-Bm7u11mN-_0u6cMEw.js.map} +1 -1
- package/dist/{text-BVzTcUas.js → text-BNksUr5J.js} +401 -360
- package/dist/text-BNksUr5J.js.map +1 -0
- package/dist/theme-CcBXf4Ay.js +48 -0
- package/dist/theme-CcBXf4Ay.js.map +1 -0
- package/dist/{value-ref-y4_YKUP5.js → value-ref-BG_MV9C-.js} +2 -2
- package/dist/{value-ref-y4_YKUP5.js.map → value-ref-BG_MV9C-.js.map} +1 -1
- package/dist/{viewer-CrJupI8I-DZZfdHXr.js → viewer-CrJupI8I-D9dVcNw4.js} +5 -5
- package/dist/{viewer-CrJupI8I-DZZfdHXr.js.map → viewer-CrJupI8I-D9dVcNw4.js.map} +1 -1
- package/dist/viewer-auto-register.js +2 -2
- package/dist/viewer.js +2 -2
- package/dist/{contrast-CZFqj1I5.js → viewport-CiCKeAQH.js} +369 -411
- package/dist/viewport-CiCKeAQH.js.map +1 -0
- package/package.json +11 -11
- package/dist/_internal/contracts/document/blueprint-relations.d.ts +0 -16
- package/dist/_internal/contracts/document/blueprint-relations.js +0 -196
- package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-panel-mutations.d.ts +0 -5
- package/dist/_internal/engine/browser/controllers/designer-guard-controller.d.ts +0 -27
- package/dist/_internal/engine/browser/controllers/designer-scene-controller.d.ts +0 -47
- package/dist/_internal/engine/browser/controllers/panel/designer-style-rules-controller.d.ts +0 -12
- package/dist/_internal/engine/browser/dom/guard/designer-contrast-measure.d.ts +0 -24
- package/dist/_internal/engine/browser/dom/guard/designer-guard-dom.d.ts +0 -15
- package/dist/_internal/engine/browser/dom/workspace/designer-canvas-hint-dom.d.ts +0 -6
- package/dist/_internal/engine/browser/viewport/designer-canvas-snap-index.d.ts +0 -9
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-connection.d.ts +0 -14
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-mutation-helpers.d.ts +0 -20
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-mutations.d.ts +0 -15
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-node-ids.d.ts +0 -12
- package/dist/_internal/engine/common/operations/designer-name-validation.d.ts +0 -2
- package/dist/_internal/engine/common/operations/scene/designer-scene.d.ts +0 -55
- package/dist/_internal/engine/common/operations/style/designer-host-conditional-style.d.ts +0 -21
- package/dist/_internal/engine/common/operations/style/designer-style-rules.d.ts +0 -25
- package/dist/_internal/engine/common/validation/designer-guard.d.ts +0 -49
- package/dist/_internal/engine/designer-blueprint-workbench-panel-C2MoZwKA.js +0 -3548
- package/dist/_internal/engine/designer-element/api/designer-element-guard.d.ts +0 -13
- package/dist/_internal/engine/designer-element/api/designer-element-scene.d.ts +0 -14
- package/dist/_internal/engine/designer-left-panel-groups-dom-WMsH33zw.js +0 -573
- package/dist/_internal/engine/host-resource-selection-5Cf_gclK.js +0 -2188
- package/dist/_internal/renderer/style-rules.d.ts +0 -9
- package/dist/contrast-CZFqj1I5.js.map +0 -1
- package/dist/dataset-port-CUsMmX2x.js +0 -65
- package/dist/dataset-port-CUsMmX2x.js.map +0 -1
- package/dist/designer-Byw45cUM.js.map +0 -1
- package/dist/designer-blueprint-workbench-panel-C2MoZwKA-CbXkv78O.js +0 -3517
- package/dist/designer-blueprint-workbench-panel-C2MoZwKA-CbXkv78O.js.map +0 -1
- package/dist/designer-dataset-controller-CPytVNBK-DWL3SRTP.js.map +0 -1
- package/dist/designer-left-panel-groups-dom-WMsH33zw-B9pl8loh.js +0 -557
- package/dist/designer-left-panel-groups-dom-WMsH33zw-B9pl8loh.js.map +0 -1
- package/dist/designer-ui-primitives-CH4RNiMa-BNXQwJPZ.js.map +0 -1
- package/dist/dist-BHTClwId.js.map +0 -1
- package/dist/dist-DfAV2jGI.js +0 -2185
- package/dist/dist-DfAV2jGI.js.map +0 -1
- package/dist/editor-descriptor-schema-Be30Wv8w.js.map +0 -1
- package/dist/host-resource-selection-5Cf_gclK-Sv4Z8UXS.js.map +0 -1
- package/dist/manager-B2CZ2b5I.js.map +0 -1
- package/dist/material-BPlvEmDi.js +0 -12
- package/dist/material-manifest-bsGl6vZZ.js.map +0 -1
- package/dist/material-schema-CtxTkCP2.js +0 -267
- package/dist/material-schema-CtxTkCP2.js.map +0 -1
- package/dist/migrate-document-BJUN7NPv.js +0 -436
- package/dist/migrate-document-BJUN7NPv.js.map +0 -1
- package/dist/parse-BQw3u9_4.js +0 -1126
- package/dist/parse-BQw3u9_4.js.map +0 -1
- package/dist/plugin-B9Xxtw7G.js.map +0 -1
- package/dist/plugin-package-BT-pCoTt.js +0 -174
- package/dist/plugin-package-BT-pCoTt.js.map +0 -1
- package/dist/runtime-dispatch-Dt9fhcI5.js +0 -360
- package/dist/runtime-dispatch-Dt9fhcI5.js.map +0 -1
- package/dist/schema-C38FI_z2.js +0 -541
- package/dist/schema-C38FI_z2.js.map +0 -1
- package/dist/text-BVzTcUas.js.map +0 -1
|
@@ -1,358 +1,95 @@
|
|
|
1
1
|
import { i as e, r as t, t as n } from "./image-url-D6mUcjY1.js";
|
|
2
|
-
import { t as r } from "./parse-
|
|
2
|
+
import { t as r } from "./parse-AOTE9WnD.js";
|
|
3
3
|
import { i, r as a } from "./read-data-value-WmMKWshv.js";
|
|
4
|
+
import { c as o, n as s, s as c, u as l } from "./theme-CcBXf4Ay.js";
|
|
4
5
|
import "./authoring-EcyK2YVN.js";
|
|
5
|
-
import {
|
|
6
|
-
import { t as
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { A as u, C as d, O as f, S as p, T as m, _ as h, a as g, d as _, i as v, j as y, k as b, l as x, m as S, n as C, p as w, r as T, s as E, t as D, u as O, v as k, w as ee } from "./designer-field-primitives-KBZuWN_D-B3h4jpYe.js";
|
|
7
|
+
import { t as te } from "./fragment-Y6YnW6wy.js";
|
|
8
|
+
import { i as ne, t as re } from "./material-theme-C91eus78.js";
|
|
9
|
+
//#region ../engine/dist/host-resource-selection-xo2mLCD4.js
|
|
10
|
+
function ie(e) {
|
|
9
11
|
return Math.round(e * 100) / 100;
|
|
10
12
|
}
|
|
11
|
-
function
|
|
13
|
+
function ae(e) {
|
|
12
14
|
let t = Math.round(e);
|
|
13
15
|
return Object.is(t, -0) ? 0 : t;
|
|
14
16
|
}
|
|
15
|
-
function
|
|
17
|
+
function oe(e) {
|
|
16
18
|
return Math.max(-1e6, Math.min(1e6, e));
|
|
17
19
|
}
|
|
18
|
-
function
|
|
20
|
+
function se(e) {
|
|
19
21
|
return Math.max(1, Math.min(1e6, e));
|
|
20
22
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
function w(e, t) {
|
|
28
|
-
let n = e.ownerDocument, r = n.createElement("div");
|
|
29
|
-
if (r.className = o("designer-empty", t.className), t.tone === "success" && (r.dataset.tone = "success"), t.role !== void 0 && r.setAttribute("role", t.role), t.live !== void 0 && (r.ariaLive = t.live), t.icon !== void 0) {
|
|
30
|
-
let e = n.createElement("span");
|
|
31
|
-
e.className = "designer-empty-icon", e.setAttribute("aria-hidden", "true"), e.innerHTML = c(t.icon), r.appendChild(e);
|
|
32
|
-
}
|
|
33
|
-
let i = n.createElement("p");
|
|
34
|
-
if (i.className = "designer-empty-title", i.textContent = t.title, r.appendChild(i), t.hint !== void 0) {
|
|
35
|
-
let e = n.createElement("p");
|
|
36
|
-
e.className = "designer-empty-hint", e.textContent = t.hint, r.appendChild(e);
|
|
37
|
-
}
|
|
38
|
-
let a = [];
|
|
39
|
-
if (t.actions !== void 0 && t.actions.length > 0) {
|
|
40
|
-
let e = n.createElement("div");
|
|
41
|
-
e.className = "designer-empty-actions";
|
|
42
|
-
for (let r of t.actions) {
|
|
43
|
-
let t = f(n, {
|
|
44
|
-
className: "designer-empty-action",
|
|
45
|
-
text: r.label,
|
|
46
|
-
...r.ariaLabel === void 0 ? {} : { ariaLabel: r.ariaLabel },
|
|
47
|
-
...r.variant === void 0 ? {} : { variant: r.variant }
|
|
48
|
-
});
|
|
49
|
-
for (let [e, n] of Object.entries(r.dataset ?? {})) t.dataset[e] = n;
|
|
50
|
-
e.appendChild(t), a.push(t);
|
|
51
|
-
}
|
|
52
|
-
r.appendChild(e);
|
|
53
|
-
}
|
|
54
|
-
return e.appendChild(r), {
|
|
55
|
-
element: r,
|
|
56
|
-
actionButtons: a
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
function T(e, t) {
|
|
60
|
-
let n = e.ownerDocument, r = t.collapsible ?? !0, i = n.createElement(r ? "details" : "section");
|
|
61
|
-
i.className = o("designer-panel-section designer-inspector-section", t.className), r && (i.open = t.open ?? !0, i.classList.add("designer-inspector-disclosure")), t.advanced === !0 && (i.dataset.inspectorAdvanced = "true");
|
|
62
|
-
let a = n.createElement(r ? "summary" : "h3");
|
|
63
|
-
if (a.className = "designer-panel-section-title designer-inspector-section-title", r && a.classList.add("designer-inspector-section-summary", "designer-panel-section-summary"), a.textContent = t.title, r) {
|
|
64
|
-
let e = n.createElement("span");
|
|
65
|
-
e.className = "designer-panel-section-disclosure designer-inspector-section-disclosure", e.setAttribute("aria-hidden", "true"), e.innerHTML = c("chevron-down"), a.appendChild(e);
|
|
66
|
-
}
|
|
67
|
-
i.appendChild(a);
|
|
68
|
-
let s = null;
|
|
69
|
-
if (t.actions !== void 0 && t.actions.length > 0) {
|
|
70
|
-
s = n.createElement("div"), s.className = "designer-panel-section-actions";
|
|
71
|
-
for (let e of t.actions) s.appendChild(e);
|
|
72
|
-
r && s.addEventListener("click", (e) => e.stopPropagation()), i.appendChild(s);
|
|
23
|
+
var ce = "#000000", A = /* @__PURE__ */ new Map(), j = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map();
|
|
24
|
+
function le(e, t) {
|
|
25
|
+
if (A.size >= 32) {
|
|
26
|
+
let e = A.keys().next().value;
|
|
27
|
+
e !== void 0 && (A.delete(e), j.delete(e), M.delete(e), N.delete(e));
|
|
73
28
|
}
|
|
74
|
-
|
|
75
|
-
element: i,
|
|
76
|
-
title: a,
|
|
77
|
-
actions: s
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
function E(e, t) {
|
|
81
|
-
return typeof e == "string" && /\S/.test(e) && !/[\u0000-\u001f\u007f-\u009f]/u.test(e) && [...e].length <= t;
|
|
82
|
-
}
|
|
83
|
-
var D = /* @__PURE__ */ new Set([
|
|
84
|
-
"materialType",
|
|
85
|
-
"name",
|
|
86
|
-
"position"
|
|
87
|
-
]), O = /* @__PURE__ */ new Set(["x", "y"]), k = 256;
|
|
88
|
-
function ee(e) {
|
|
89
|
-
return e?.defaultData === void 0 ? null : {
|
|
90
|
-
type: "static",
|
|
91
|
-
value: e.defaultData,
|
|
92
|
-
...e.staticData?.kind === "tabular" ? { binding: e.staticData.defaultBinding } : {}
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
function te(e, t, n) {
|
|
96
|
-
let r = t.replace(/[^A-Za-z0-9]+/g, "-"), i = e.components.length + 1, a = new Set(e.components.map((e) => e.id));
|
|
97
|
-
if (n !== void 0) for (let e of n) a.add(e);
|
|
98
|
-
for (; a.has(`${r}-${i}`);) i++;
|
|
99
|
-
return `${r}-${i}`;
|
|
100
|
-
}
|
|
101
|
-
function ne(e, t) {
|
|
102
|
-
let n = e.components.map((e) => e.zIndex);
|
|
103
|
-
return t !== void 0 && n.push(...t), n.reduce((e, t) => Math.max(e, t), -1) + 1;
|
|
104
|
-
}
|
|
105
|
-
function re(e, t, n) {
|
|
106
|
-
return {
|
|
107
|
-
id: n.id ?? te(e, t.type),
|
|
108
|
-
type: t.type,
|
|
109
|
-
name: n.name ?? t.name,
|
|
110
|
-
parentId: n.parentId ?? null,
|
|
111
|
-
position: n.position,
|
|
112
|
-
size: t.defaultSize,
|
|
113
|
-
rotation: 0,
|
|
114
|
-
zIndex: n.zIndex ?? ne(e),
|
|
115
|
-
status: {
|
|
116
|
-
locked: !1,
|
|
117
|
-
hidden: !1
|
|
118
|
-
},
|
|
119
|
-
props: t.defaultProps,
|
|
120
|
-
style: t.defaultStyle,
|
|
121
|
-
dataSource: n.dataSource === void 0 ? ee(t) : n.dataSource
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
function ie(e, t, n) {
|
|
125
|
-
return {
|
|
126
|
-
x: y(Math.max(0, Math.min(n.x, Math.max(0, e.canvas.width - t.defaultSize.width)))),
|
|
127
|
-
y: y(Math.max(0, Math.min(n.y, Math.max(0, e.canvas.height - t.defaultSize.height))))
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
function ae(e) {
|
|
131
|
-
if (!le(e) || !ue(e, D)) return A("AUTHORING_PAYLOAD_INVALID", "Component insertion intent must be a strict object.");
|
|
132
|
-
if (!t(e.materialType)) return A("AUTHORING_SOURCE_INVALID", "Component insertion materialType must be a canonical material type.", ["materialType"]);
|
|
133
|
-
if (e.name !== void 0 && !E(e.name, k)) return A("AUTHORING_PAYLOAD_INVALID", `Component name must contain 1 to ${k} code points without control characters.`, ["name"]);
|
|
134
|
-
let n = oe(e.position);
|
|
135
|
-
return n !== void 0 && "diagnostics" in n ? n : {
|
|
136
|
-
ok: !0,
|
|
137
|
-
value: {
|
|
138
|
-
materialType: e.materialType,
|
|
139
|
-
...e.name === void 0 ? {} : { name: e.name },
|
|
140
|
-
...n === void 0 ? {} : { position: n }
|
|
141
|
-
},
|
|
142
|
-
diagnostics: []
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
function oe(e) {
|
|
146
|
-
if (e !== void 0) return !le(e) || !ue(e, O) || !ce(e.x) || !ce(e.y) ? A("AUTHORING_PAYLOAD_INVALID", "Component insertion position must be finite canvas coordinates.", ["position"]) : {
|
|
147
|
-
x: e.x,
|
|
148
|
-
y: e.y
|
|
149
|
-
};
|
|
150
|
-
}
|
|
151
|
-
function se(e, t) {
|
|
152
|
-
return e === void 0 || e.type !== t.materialType || e.libraryVisible === !1 ? A("AUTHORING_SOURCE_INVALID", "Component material is not available in the configured catalog.", ["materialType"]) : {
|
|
153
|
-
ok: !0,
|
|
154
|
-
value: e,
|
|
155
|
-
diagnostics: []
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
function ce(e) {
|
|
159
|
-
return typeof e == "number" && Number.isFinite(e);
|
|
160
|
-
}
|
|
161
|
-
function le(e) {
|
|
162
|
-
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
29
|
+
A.set(e, t);
|
|
163
30
|
}
|
|
164
31
|
function ue(e, t) {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
return {
|
|
169
|
-
ok: !1,
|
|
170
|
-
diagnostics: [{
|
|
171
|
-
severity: "error",
|
|
172
|
-
code: e,
|
|
173
|
-
path: n,
|
|
174
|
-
message: t
|
|
175
|
-
}]
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
var de = "application/x-base-screen-host-resource", fe = 8192, pe = /* @__PURE__ */ new Set([
|
|
179
|
-
"materialType",
|
|
180
|
-
"dataSource",
|
|
181
|
-
"name"
|
|
182
|
-
]), me = 256, he = /(url|token|headers?)/i, ge = /^\s*(?:[a-z][a-z\d+.-]*:\/\/|https?:|data:|blob:|file:|javascript:|\.{0,2}\/)/i;
|
|
183
|
-
function _e(e) {
|
|
184
|
-
let n = Ee(e);
|
|
185
|
-
if (!n.ok) return n;
|
|
186
|
-
if (e = n.value, !we(e) || !Te(e, pe)) return j("AUTHORING_PAYLOAD_INVALID", "Host resource authoring intent must be a strict object.");
|
|
187
|
-
if (!t(e.materialType)) return j("AUTHORING_SOURCE_INVALID", "Host resource materialType must be a canonical material type.", ["materialType"]);
|
|
188
|
-
if (e.name !== void 0 && !E(e.name, me)) return j("AUTHORING_PAYLOAD_INVALID", `Host resource name must contain 1 to ${me} code points without control characters.`, ["name"]);
|
|
189
|
-
if (Ce(e)) return j("AUTHORING_SOURCE_INVALID", "Host resource intent must not contain URLs, tokens, or headers.");
|
|
190
|
-
let i = r(e.dataSource, { componentType: e.materialType });
|
|
191
|
-
if (!i.ok) return j("AUTHORING_PAYLOAD_INVALID", "Host resource dataSource does not match the canonical document contract.", ["dataSource"]);
|
|
192
|
-
let a = i.value;
|
|
193
|
-
return a?.type === "host-resource" ? {
|
|
194
|
-
ok: !0,
|
|
195
|
-
value: {
|
|
196
|
-
materialType: e.materialType,
|
|
197
|
-
dataSource: a,
|
|
198
|
-
...e.name === void 0 ? {} : { name: e.name }
|
|
199
|
-
},
|
|
200
|
-
diagnostics: []
|
|
201
|
-
} : j("AUTHORING_PAYLOAD_INVALID", "Host resource dataSource must use type \"host-resource\".", ["dataSource", "type"]);
|
|
202
|
-
}
|
|
203
|
-
function ve(e) {
|
|
204
|
-
if (typeof e != "string" || e.length === 0) return j("AUTHORING_PAYLOAD_INVALID", "Host resource drag payload must be nonempty JSON.");
|
|
205
|
-
if (De(e) > 8192) return j("AUTHORING_LIMIT_EXCEEDED", "Host resource drag payload exceeds its byte limit.");
|
|
206
|
-
try {
|
|
207
|
-
return _e(JSON.parse(e));
|
|
208
|
-
} catch {
|
|
209
|
-
return j("AUTHORING_PAYLOAD_INVALID", "Host resource drag payload is not valid JSON.");
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
function ye(e, t) {
|
|
213
|
-
let n = _e(t);
|
|
214
|
-
if (!n.ok) return n;
|
|
215
|
-
let r = JSON.stringify(n.value);
|
|
216
|
-
if (De(r) > 8192) return j("AUTHORING_LIMIT_EXCEEDED", "Host resource drag payload exceeds 8 KiB.");
|
|
217
|
-
try {
|
|
218
|
-
return e.setData(de, r), e.effectAllowed = "copy", {
|
|
219
|
-
ok: !0,
|
|
220
|
-
value: null,
|
|
221
|
-
diagnostics: []
|
|
222
|
-
};
|
|
223
|
-
} catch {
|
|
224
|
-
return j("AUTHORING_PAYLOAD_INVALID", "Host resource drag payload could not be written.");
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
function be(e, t) {
|
|
228
|
-
return e === void 0 || e.type !== t.materialType || e.libraryVisible === !1 ? j("AUTHORING_SOURCE_INVALID", "Host resource material is not available in the configured catalog.", ["materialType"]) : e.dataCapabilities.includes("host-resource") ? {
|
|
229
|
-
ok: !0,
|
|
230
|
-
value: e,
|
|
231
|
-
diagnostics: []
|
|
232
|
-
} : j("AUTHORING_SOURCE_INVALID", "Host resource material does not declare the host-resource capability.", ["materialType"]);
|
|
233
|
-
}
|
|
234
|
-
function xe(e, t, n, r) {
|
|
235
|
-
return re(e, t, {
|
|
236
|
-
position: ie(e, t, r),
|
|
237
|
-
...n.name === void 0 ? {} : { name: n.name },
|
|
238
|
-
dataSource: n.dataSource
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
function Se(e, t, n) {
|
|
242
|
-
return ie(e, t, {
|
|
243
|
-
x: n.x - t.defaultSize.width / 2,
|
|
244
|
-
y: n.y - t.defaultSize.height / 2
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
function Ce(e) {
|
|
248
|
-
return typeof e == "string" ? ge.test(e) : Array.isArray(e) ? e.some(Ce) : we(e) ? Object.entries(e).some(([e, t]) => he.test(e) || Ce(t)) : !1;
|
|
249
|
-
}
|
|
250
|
-
function we(e) {
|
|
251
|
-
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
252
|
-
}
|
|
253
|
-
function Te(e, t) {
|
|
254
|
-
return Object.keys(e).every((e) => t.has(e));
|
|
255
|
-
}
|
|
256
|
-
function Ee(t) {
|
|
257
|
-
try {
|
|
258
|
-
let n = e(t, {
|
|
259
|
-
maxBytes: fe,
|
|
260
|
-
maxStringBytes: fe
|
|
261
|
-
});
|
|
262
|
-
return n.ok ? n : n.diagnostics.some((e) => e.code === "JSON_LIMIT_EXCEEDED") ? j("AUTHORING_LIMIT_EXCEEDED", "Host resource authoring intent exceeds its JSON limits.") : j("AUTHORING_PAYLOAD_INVALID", "Host resource authoring intent is not JSON-safe.");
|
|
263
|
-
} catch {
|
|
264
|
-
return j("AUTHORING_PAYLOAD_INVALID", "Host resource authoring intent is not JSON-safe.");
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
function De(e) {
|
|
268
|
-
let t = 0;
|
|
269
|
-
for (let n of e) {
|
|
270
|
-
let e = n.codePointAt(0) ?? 0;
|
|
271
|
-
t += e <= 127 ? 1 : e <= 2047 ? 2 : e <= 65535 ? 3 : 4;
|
|
32
|
+
if (j.size >= 32) {
|
|
33
|
+
let e = j.keys().next().value;
|
|
34
|
+
e !== void 0 && j.delete(e);
|
|
272
35
|
}
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
function j(e, t, n = []) {
|
|
276
|
-
return {
|
|
277
|
-
ok: !1,
|
|
278
|
-
diagnostics: [{
|
|
279
|
-
severity: "error",
|
|
280
|
-
code: e,
|
|
281
|
-
path: n,
|
|
282
|
-
message: t
|
|
283
|
-
}]
|
|
284
|
-
};
|
|
36
|
+
j.set(e, t);
|
|
285
37
|
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
if (M.size >= 32) {
|
|
38
|
+
function de(e, t, n) {
|
|
39
|
+
if (!M.has(e) && M.size >= 32) {
|
|
289
40
|
let e = M.keys().next().value;
|
|
290
|
-
e !== void 0 &&
|
|
291
|
-
}
|
|
292
|
-
M.set(e, t);
|
|
293
|
-
}
|
|
294
|
-
function Ae(e, t) {
|
|
295
|
-
if (N.size >= 32) {
|
|
296
|
-
let e = N.keys().next().value;
|
|
297
|
-
e !== void 0 && N.delete(e);
|
|
298
|
-
}
|
|
299
|
-
N.set(e, t);
|
|
300
|
-
}
|
|
301
|
-
function je(e, t, n) {
|
|
302
|
-
if (!P.has(e) && P.size >= 32) {
|
|
303
|
-
let e = P.keys().next().value;
|
|
304
|
-
e !== void 0 && P.delete(e);
|
|
41
|
+
e !== void 0 && M.delete(e);
|
|
305
42
|
}
|
|
306
|
-
|
|
43
|
+
M.set(e, {
|
|
307
44
|
hue: t,
|
|
308
45
|
color: n.toLowerCase()
|
|
309
46
|
});
|
|
310
47
|
}
|
|
311
|
-
function
|
|
312
|
-
if (!
|
|
313
|
-
let e =
|
|
314
|
-
e !== void 0 &&
|
|
48
|
+
function fe(e, t, n, r) {
|
|
49
|
+
if (!N.has(e) && N.size >= 32) {
|
|
50
|
+
let e = N.keys().next().value;
|
|
51
|
+
e !== void 0 && N.delete(e);
|
|
315
52
|
}
|
|
316
|
-
|
|
53
|
+
N.set(e, {
|
|
317
54
|
saturation: t,
|
|
318
55
|
value: n,
|
|
319
56
|
color: r.toLowerCase()
|
|
320
57
|
});
|
|
321
58
|
}
|
|
322
|
-
function
|
|
323
|
-
return
|
|
59
|
+
function pe(e) {
|
|
60
|
+
return A.get(e);
|
|
324
61
|
}
|
|
325
|
-
function
|
|
326
|
-
return
|
|
62
|
+
function me(e) {
|
|
63
|
+
return j.get(e);
|
|
327
64
|
}
|
|
328
|
-
function
|
|
329
|
-
return
|
|
65
|
+
function he(e) {
|
|
66
|
+
return M.get(e);
|
|
330
67
|
}
|
|
331
|
-
function
|
|
332
|
-
return
|
|
68
|
+
function ge(e) {
|
|
69
|
+
return N.get(e);
|
|
333
70
|
}
|
|
334
|
-
var
|
|
335
|
-
function
|
|
71
|
+
var _e = "#ffffff", ve = /^(?:#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})|transparent)$/i;
|
|
72
|
+
function ye(e) {
|
|
336
73
|
let t = {
|
|
337
|
-
solid:
|
|
74
|
+
solid: Ae(e) ? e : ce,
|
|
338
75
|
stops: [{
|
|
339
|
-
color:
|
|
76
|
+
color: ce,
|
|
340
77
|
position: 0
|
|
341
78
|
}, {
|
|
342
|
-
color:
|
|
79
|
+
color: _e,
|
|
343
80
|
position: 100
|
|
344
81
|
}],
|
|
345
82
|
angle: 90,
|
|
346
83
|
x: 50,
|
|
347
84
|
y: 50
|
|
348
|
-
}, n =
|
|
85
|
+
}, n = De(e, "linear-gradient");
|
|
349
86
|
if (n !== void 0) return {
|
|
350
87
|
mode: "linear-gradient",
|
|
351
88
|
...t,
|
|
352
89
|
angle: n.angle,
|
|
353
90
|
stops: n.stops
|
|
354
91
|
};
|
|
355
|
-
let r =
|
|
92
|
+
let r = De(e, "radial-gradient");
|
|
356
93
|
return r === void 0 ? {
|
|
357
94
|
mode: "solid",
|
|
358
95
|
...t
|
|
@@ -364,17 +101,17 @@ function ze(e) {
|
|
|
364
101
|
stops: r.stops
|
|
365
102
|
};
|
|
366
103
|
}
|
|
367
|
-
function
|
|
104
|
+
function be(e) {
|
|
368
105
|
if (e.mode === "solid") return e.solid;
|
|
369
106
|
let t = e.stops.map((e) => `${e.color} ${e.position}%`).join(", ");
|
|
370
107
|
return e.mode === "linear-gradient" ? `linear-gradient(${e.angle}deg, ${t})` : `radial-gradient(circle at ${e.x}% ${e.y}%, ${t})`;
|
|
371
108
|
}
|
|
372
|
-
function
|
|
109
|
+
function xe(e) {
|
|
373
110
|
if (e.stops.length >= 8) return;
|
|
374
|
-
let t =
|
|
111
|
+
let t = ke(e.stops);
|
|
375
112
|
if (t === void 0) return;
|
|
376
113
|
let n = [...e.stops], r = {
|
|
377
|
-
color:
|
|
114
|
+
color: _e,
|
|
378
115
|
position: t.position
|
|
379
116
|
};
|
|
380
117
|
return n.splice(t.index, 0, r), {
|
|
@@ -382,15 +119,15 @@ function Be(e) {
|
|
|
382
119
|
stops: n
|
|
383
120
|
};
|
|
384
121
|
}
|
|
385
|
-
function
|
|
122
|
+
function Se(e, t) {
|
|
386
123
|
if (!(e.stops.length <= 2 || e.stops[t] === void 0)) return {
|
|
387
124
|
...e,
|
|
388
125
|
stops: e.stops.filter((e, n) => n !== t)
|
|
389
126
|
};
|
|
390
127
|
}
|
|
391
|
-
function
|
|
392
|
-
if (t !== "solid" && n === "solid" &&
|
|
393
|
-
let n =
|
|
128
|
+
function Ce(e, t, n, r = 0) {
|
|
129
|
+
if (t !== "solid" && n === "solid" && je(e.stops)) {
|
|
130
|
+
let n = Te(e.solid);
|
|
394
131
|
if (n !== void 0) return {
|
|
395
132
|
...e,
|
|
396
133
|
mode: t,
|
|
@@ -398,7 +135,7 @@ function He(e, t, n, r = 0) {
|
|
|
398
135
|
};
|
|
399
136
|
}
|
|
400
137
|
if (t === "solid" && n !== "solid") {
|
|
401
|
-
let t =
|
|
138
|
+
let t = we(e, r);
|
|
402
139
|
if (t !== void 0) return {
|
|
403
140
|
...e,
|
|
404
141
|
mode: "solid",
|
|
@@ -410,15 +147,15 @@ function He(e, t, n, r = 0) {
|
|
|
410
147
|
mode: t
|
|
411
148
|
};
|
|
412
149
|
}
|
|
413
|
-
function
|
|
150
|
+
function we(e, t) {
|
|
414
151
|
if (e.stops.length === 0) return;
|
|
415
152
|
let n = Math.min(Math.max(Number.isInteger(t) ? t : 0, 0), e.stops.length - 1), r = e.stops[n]?.color;
|
|
416
|
-
return r !== void 0 && r.toLowerCase() !== "transparent" &&
|
|
153
|
+
return r !== void 0 && r.toLowerCase() !== "transparent" && Ae(r) ? r : void 0;
|
|
417
154
|
}
|
|
418
|
-
function
|
|
419
|
-
let t =
|
|
155
|
+
function Te(e) {
|
|
156
|
+
let t = Me(e);
|
|
420
157
|
if (t === void 0) return;
|
|
421
|
-
let n = t.alpha === void 0 ? "" : t.alpha, r = `${
|
|
158
|
+
let n = t.alpha === void 0 ? "" : t.alpha, r = `${Pe(t.r, t.g, t.b)}${n}`, i = `${Fe(t, 255, .45)}${n}`, a = i === r ? `${Fe(t, 0, .35)}${n}` : i;
|
|
422
159
|
return [{
|
|
423
160
|
color: r,
|
|
424
161
|
position: 0
|
|
@@ -427,14 +164,14 @@ function We(e) {
|
|
|
427
164
|
position: 100
|
|
428
165
|
}];
|
|
429
166
|
}
|
|
430
|
-
function
|
|
167
|
+
function Ee(e) {
|
|
431
168
|
return e === "solid" || e === "linear-gradient" || e === "radial-gradient";
|
|
432
169
|
}
|
|
433
|
-
function
|
|
170
|
+
function De(e, t) {
|
|
434
171
|
if (e === void 0) return;
|
|
435
172
|
let n = t === "linear-gradient" ? e.match(/^linear-gradient\((\d+(?:\.\d+)?)deg,\s*(.+)\)$/i) : null;
|
|
436
173
|
if (n != null) {
|
|
437
|
-
let e =
|
|
174
|
+
let e = Oe(n[2]);
|
|
438
175
|
if (e === void 0) return;
|
|
439
176
|
let t = Number(n[1]);
|
|
440
177
|
return Number.isFinite(t) && t >= 0 && t <= 360 ? {
|
|
@@ -444,7 +181,7 @@ function Ke(e, t) {
|
|
|
444
181
|
}
|
|
445
182
|
let r = t === "radial-gradient" ? e.match(/^radial-gradient\(circle at (\d+(?:\.\d+)?)% (\d+(?:\.\d+)?)%,\s*(.+)\)$/i) : null;
|
|
446
183
|
if (r != null) {
|
|
447
|
-
let e =
|
|
184
|
+
let e = Oe(r[3]);
|
|
448
185
|
if (e === void 0) return;
|
|
449
186
|
let t = Number(r[1]), n = Number(r[2]);
|
|
450
187
|
return Number.isFinite(t) && Number.isFinite(n) && t >= 0 && t <= 100 && n >= 0 && n <= 100 ? {
|
|
@@ -454,7 +191,7 @@ function Ke(e, t) {
|
|
|
454
191
|
} : void 0;
|
|
455
192
|
}
|
|
456
193
|
}
|
|
457
|
-
function
|
|
194
|
+
function Oe(e) {
|
|
458
195
|
let t = e.split(",").map((e) => e.trim());
|
|
459
196
|
if (t.length < 2 || t.length > 8) return;
|
|
460
197
|
let n = [];
|
|
@@ -470,7 +207,7 @@ function qe(e) {
|
|
|
470
207
|
}
|
|
471
208
|
if (n.every((e, t) => t === 0 || n[t - 1].position < e.position)) return n;
|
|
472
209
|
}
|
|
473
|
-
function
|
|
210
|
+
function ke(e) {
|
|
474
211
|
let t = [
|
|
475
212
|
0,
|
|
476
213
|
...e.map((e) => e.position),
|
|
@@ -491,13 +228,13 @@ function Je(e) {
|
|
|
491
228
|
position: n.position
|
|
492
229
|
};
|
|
493
230
|
}
|
|
494
|
-
function
|
|
495
|
-
return e !== void 0 &&
|
|
231
|
+
function Ae(e) {
|
|
232
|
+
return e !== void 0 && ve.test(e);
|
|
496
233
|
}
|
|
497
|
-
function
|
|
498
|
-
return e.length === 2 && e[0]?.color === "#000000" && e[0]?.position === 0 && e[1]?.color ===
|
|
234
|
+
function je(e) {
|
|
235
|
+
return e.length === 2 && e[0]?.color === "#000000" && e[0]?.position === 0 && e[1]?.color === _e && e[1]?.position === 100;
|
|
499
236
|
}
|
|
500
|
-
function
|
|
237
|
+
function Me(e) {
|
|
501
238
|
if (e === void 0) return;
|
|
502
239
|
let t = e.toLowerCase().match(/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/);
|
|
503
240
|
if (t == null) return;
|
|
@@ -515,40 +252,40 @@ function Xe(e) {
|
|
|
515
252
|
alpha: o
|
|
516
253
|
};
|
|
517
254
|
}
|
|
518
|
-
function
|
|
255
|
+
function Ne(e, t, n) {
|
|
519
256
|
return Math.round(e + (t - e) * n);
|
|
520
257
|
}
|
|
521
|
-
function
|
|
258
|
+
function Pe(e, t, n) {
|
|
522
259
|
return `#${[
|
|
523
260
|
e,
|
|
524
261
|
t,
|
|
525
262
|
n
|
|
526
263
|
].map((e) => e.toString(16).padStart(2, "0")).join("")}`;
|
|
527
264
|
}
|
|
528
|
-
function
|
|
529
|
-
return
|
|
265
|
+
function Fe(e, t, n) {
|
|
266
|
+
return Pe(Ne(e.r, t, n), Ne(e.g, t, n), Ne(e.b, t, n));
|
|
530
267
|
}
|
|
531
|
-
function
|
|
268
|
+
function Ie(e, t) {
|
|
532
269
|
let n = e.style;
|
|
533
270
|
n !== void 0 && (n.left = `${t}%`);
|
|
534
271
|
}
|
|
535
|
-
function
|
|
272
|
+
function Le(e, t) {
|
|
536
273
|
e.style?.setProperty?.("--designer-color-palette-stop-color", t);
|
|
537
274
|
}
|
|
538
|
-
function
|
|
275
|
+
function Re(e, t, n, r) {
|
|
539
276
|
let i = n === 0 ? 0 : t[n - 1].position + 1, a = n === t.length - 1 ? 100 : t[n + 1].position - 1, o = n === r;
|
|
540
277
|
e.dataset.colorPaletteStopMin = String(i), e.dataset.colorPaletteStopMax = String(a), e.dataset.colorPaletteStopSelected = String(o), e.setAttribute("aria-valuemin", String(i)), e.setAttribute("aria-valuemax", String(a)), e.setAttribute("aria-valuenow", String(t[n].position)), e.setAttribute("aria-pressed", String(o));
|
|
541
278
|
let s = e.className.split(/\s+/).filter((e) => e.length > 0 && e !== "is-selected");
|
|
542
279
|
o && s.push("is-selected"), e.className = s.join(" ");
|
|
543
280
|
}
|
|
544
|
-
function
|
|
281
|
+
function P(e) {
|
|
545
282
|
return [...e.querySelectorAll("[data-color-palette-stop-handle]")];
|
|
546
283
|
}
|
|
547
|
-
function
|
|
284
|
+
function F(e) {
|
|
548
285
|
let t = [];
|
|
549
286
|
for (let n of e) {
|
|
550
287
|
let e = n.dataset.colorPaletteStopColor, r = Number(n.dataset.colorPaletteStopPosition);
|
|
551
|
-
if (!
|
|
288
|
+
if (!Ae(e) || !Number.isInteger(r) || r < 0 || r > 100) return;
|
|
552
289
|
t.push({
|
|
553
290
|
color: e,
|
|
554
291
|
position: r
|
|
@@ -556,88 +293,88 @@ function z(e) {
|
|
|
556
293
|
}
|
|
557
294
|
return t.every((e, n) => n === 0 || t[n - 1].position < e.position) ? t : void 0;
|
|
558
295
|
}
|
|
559
|
-
function
|
|
560
|
-
return
|
|
296
|
+
function I(e, t) {
|
|
297
|
+
return ze(Number(e.dataset.colorPaletteSelectedStop), t);
|
|
561
298
|
}
|
|
562
|
-
function
|
|
299
|
+
function ze(e, t) {
|
|
563
300
|
return e !== void 0 && Number.isInteger(e) && e >= 0 && e < t ? e : 0;
|
|
564
301
|
}
|
|
565
|
-
function
|
|
302
|
+
function Be(e, t) {
|
|
566
303
|
for (let n = 0; n < t.length; n++) {
|
|
567
304
|
let r = e[n], i = t[n];
|
|
568
305
|
if (r?.color !== i.color || r.position !== i.position) return n;
|
|
569
306
|
}
|
|
570
307
|
return Math.max(0, t.length - 1);
|
|
571
308
|
}
|
|
572
|
-
function
|
|
573
|
-
let r =
|
|
574
|
-
return
|
|
309
|
+
function Ve(e, t, n) {
|
|
310
|
+
let r = p(e, { appearance: "color" });
|
|
311
|
+
return He(r, t), r.dataset.colorPaletteField = n, r;
|
|
575
312
|
}
|
|
576
|
-
function
|
|
313
|
+
function He(e, t) {
|
|
577
314
|
if (t.toLowerCase() === "transparent") {
|
|
578
|
-
e.value =
|
|
315
|
+
e.value = ce, delete e.dataset.colorPaletteAlpha, e.dataset.colorPaletteTransparent = "true";
|
|
579
316
|
return;
|
|
580
317
|
}
|
|
581
|
-
let n =
|
|
582
|
-
e.value = n === void 0 ?
|
|
318
|
+
let n = Me(t);
|
|
319
|
+
e.value = n === void 0 ? ce : Pe(n.r, n.g, n.b), n?.alpha === void 0 ? delete e.dataset.colorPaletteAlpha : e.dataset.colorPaletteAlpha = n.alpha, delete e.dataset.colorPaletteTransparent;
|
|
583
320
|
}
|
|
584
|
-
function
|
|
321
|
+
function Ue(e) {
|
|
585
322
|
if (e.dataset?.colorPaletteTransparent === "true") return "transparent";
|
|
586
323
|
let t = e.dataset?.colorPaletteAlpha;
|
|
587
324
|
return t === void 0 || t === "ff" ? e.value : `${e.value}${t}`;
|
|
588
325
|
}
|
|
589
|
-
function
|
|
326
|
+
function We(e) {
|
|
590
327
|
let t = e.trim();
|
|
591
328
|
if (t.toLowerCase() === "transparent") return "transparent";
|
|
592
|
-
let n =
|
|
593
|
-
return n === void 0 ? void 0 : `${
|
|
329
|
+
let n = Me(t);
|
|
330
|
+
return n === void 0 ? void 0 : `${Pe(n.r, n.g, n.b)}${n.alpha ?? ""}`;
|
|
594
331
|
}
|
|
595
|
-
function
|
|
332
|
+
function Ge(e) {
|
|
596
333
|
return e === "solid-value" || e === "stop-value";
|
|
597
334
|
}
|
|
598
|
-
function
|
|
599
|
-
e.setAttribute("aria-invalid", String(
|
|
335
|
+
function Ke(e) {
|
|
336
|
+
e.setAttribute("aria-invalid", String(We(e.value) === void 0));
|
|
600
337
|
}
|
|
601
|
-
function
|
|
602
|
-
return e !== null &&
|
|
338
|
+
function qe(e) {
|
|
339
|
+
return e !== null && We(e.value) !== void 0;
|
|
603
340
|
}
|
|
604
|
-
function
|
|
605
|
-
let t =
|
|
341
|
+
function Je(e) {
|
|
342
|
+
let t = Me(e);
|
|
606
343
|
return t?.alpha === void 0 ? 100 : Math.round(Number.parseInt(t.alpha, 16) * 100 / 255);
|
|
607
344
|
}
|
|
608
|
-
function
|
|
345
|
+
function Ye(e) {
|
|
609
346
|
return Math.round(Math.min(100, Math.max(0, e)) * 255 / 100).toString(16).padStart(2, "0");
|
|
610
347
|
}
|
|
611
|
-
function
|
|
612
|
-
e.value =
|
|
348
|
+
function L(e, t) {
|
|
349
|
+
e.value = Ue(t).toUpperCase(), e.setAttribute("aria-invalid", "false");
|
|
613
350
|
}
|
|
614
|
-
function
|
|
615
|
-
let r =
|
|
616
|
-
r.setAttribute("aria-label",
|
|
351
|
+
function Xe(e, t, n) {
|
|
352
|
+
let r = Ve(e, t, n);
|
|
353
|
+
r.setAttribute("aria-label", d.propertiesPanel.gradientStopColor);
|
|
617
354
|
let i = e.createElement("span");
|
|
618
355
|
i.className = "designer-color-palette-color-control";
|
|
619
|
-
let a =
|
|
620
|
-
return a.dataset.colorPaletteField = n === "solid" ? "solid-value" : "stop-value", a.setAttribute("aria-label",
|
|
621
|
-
delete r.dataset.colorPaletteTransparent,
|
|
356
|
+
let a = p(e, { className: "designer-color-palette-color-value" });
|
|
357
|
+
return a.dataset.colorPaletteField = n === "solid" ? "solid-value" : "stop-value", a.setAttribute("aria-label", d.propertiesPanel.gradientStopHexValue), a.setAttribute("autocomplete", "off"), a.setAttribute("spellcheck", "false"), L(a, r), r.addEventListener("input", () => {
|
|
358
|
+
delete r.dataset.colorPaletteTransparent, L(a, r);
|
|
622
359
|
}), i.appendChild(r), i.appendChild(a), {
|
|
623
360
|
element: i,
|
|
624
361
|
input: r,
|
|
625
362
|
value: a
|
|
626
363
|
};
|
|
627
364
|
}
|
|
628
|
-
function
|
|
365
|
+
function Ze(e, t, n) {
|
|
629
366
|
let r = e.createElement("span");
|
|
630
367
|
r.className = "designer-color-palette-alpha";
|
|
631
368
|
let i = e.createElement("span");
|
|
632
|
-
i.className = "designer-color-palette-alpha-label", i.textContent =
|
|
633
|
-
let a =
|
|
369
|
+
i.className = "designer-color-palette-alpha-label", i.textContent = d.propertiesPanel.gradientStopOpacity;
|
|
370
|
+
let a = p(e, {
|
|
634
371
|
appearance: "range",
|
|
635
372
|
className: "designer-color-palette-alpha-input",
|
|
636
373
|
min: 0,
|
|
637
374
|
max: 100,
|
|
638
375
|
step: 1,
|
|
639
|
-
value: String(
|
|
640
|
-
ariaLabel:
|
|
376
|
+
value: String(Je(t)),
|
|
377
|
+
ariaLabel: d.propertiesPanel.gradientStopOpacity
|
|
641
378
|
});
|
|
642
379
|
a.dataset.colorPaletteField = n;
|
|
643
380
|
let o = e.createElement("span");
|
|
@@ -648,8 +385,8 @@ function ht(e, t, n) {
|
|
|
648
385
|
input: a
|
|
649
386
|
};
|
|
650
387
|
}
|
|
651
|
-
function
|
|
652
|
-
let a =
|
|
388
|
+
function Qe(e, t, n, r, i) {
|
|
389
|
+
let a = p(e, {
|
|
653
390
|
appearance: "number",
|
|
654
391
|
min: r,
|
|
655
392
|
max: i,
|
|
@@ -658,8 +395,8 @@ function gt(e, t, n, r, i) {
|
|
|
658
395
|
});
|
|
659
396
|
return a.dataset.colorPaletteField = n, a;
|
|
660
397
|
}
|
|
661
|
-
function
|
|
662
|
-
let s =
|
|
398
|
+
function $e(e, t, n, r, i, a, o = t) {
|
|
399
|
+
let s = Qe(e, n, r, i, a);
|
|
663
400
|
s.setAttribute("aria-label", t);
|
|
664
401
|
let c = e.createElement("span");
|
|
665
402
|
c.className = "designer-color-palette-field-inline";
|
|
@@ -669,13 +406,13 @@ function _t(e, t, n, r, i, a, o = t) {
|
|
|
669
406
|
input: s
|
|
670
407
|
};
|
|
671
408
|
}
|
|
672
|
-
function
|
|
673
|
-
return e.mode === "solid" ? e.solid.toUpperCase() : e.mode === "linear-gradient" ?
|
|
409
|
+
function et(e) {
|
|
410
|
+
return e.mode === "solid" ? e.solid.toUpperCase() : e.mode === "linear-gradient" ? d.propertiesPanel.colorPickerLinearSummary(e.stops.length) : d.propertiesPanel.colorPickerRadialSummary(e.stops.length);
|
|
674
411
|
}
|
|
675
|
-
function
|
|
676
|
-
let t = e.querySelector("[data-color-palette-field=\"mode\"]:checked")?.value, n =
|
|
677
|
-
if (n === void 0 || i === void 0 || !
|
|
678
|
-
let c =
|
|
412
|
+
function R(e) {
|
|
413
|
+
let t = e.querySelector("[data-color-palette-field=\"mode\"]:checked")?.value, n = Ee(t) ? t : Ee(e.dataset.colorPaletteMode) ? e.dataset.colorPaletteMode : void 0, r = e.querySelector("[data-color-palette-field=\"solid\"]"), i = r === null ? void 0 : Ue(r), a = e.querySelector("[data-color-palette-field=\"solid-value\"]"), o = e.querySelector("[data-color-palette-field=\"stop-value\"]"), s = F(P(e));
|
|
414
|
+
if (n === void 0 || i === void 0 || !Ae(i) || !qe(a) || !qe(o) || s === void 0 || s.length < 2 || s.length > 8) return;
|
|
415
|
+
let c = tt(e, "angle"), l = tt(e, "x"), u = tt(e, "y");
|
|
679
416
|
if (c !== void 0 && l !== void 0 && u !== void 0) return {
|
|
680
417
|
mode: n,
|
|
681
418
|
solid: i,
|
|
@@ -685,16 +422,42 @@ function H(e) {
|
|
|
685
422
|
y: u
|
|
686
423
|
};
|
|
687
424
|
}
|
|
688
|
-
function
|
|
425
|
+
function tt(e, t) {
|
|
689
426
|
let n = Number(e.querySelector(`[data-color-palette-field="${t}"]`)?.value);
|
|
690
427
|
if (!Number.isFinite(n)) return;
|
|
691
428
|
let [r, i] = t === "angle" ? [0, 360] : [0, 100];
|
|
692
429
|
return n >= r && n <= i ? n : void 0;
|
|
693
430
|
}
|
|
694
|
-
|
|
431
|
+
var nt = /* @__PURE__ */ new WeakMap(), rt = /* @__PURE__ */ new WeakSet();
|
|
432
|
+
function it(e, t) {
|
|
433
|
+
nt.set(e, t);
|
|
434
|
+
}
|
|
435
|
+
function at(e) {
|
|
436
|
+
return nt.get(e) ?? [];
|
|
437
|
+
}
|
|
438
|
+
function ot(e, t) {
|
|
439
|
+
if (e === void 0 || !e.startsWith("theme:")) return;
|
|
440
|
+
let n = e.slice(6);
|
|
441
|
+
return t.find((e) => e.slot === n);
|
|
442
|
+
}
|
|
443
|
+
function st(e, t) {
|
|
444
|
+
rt.add(e);
|
|
445
|
+
try {
|
|
446
|
+
t();
|
|
447
|
+
} finally {
|
|
448
|
+
rt.delete(e);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
function ct(e, t) {
|
|
452
|
+
let n = e.dataset.colorPaletteThemeSlot;
|
|
453
|
+
if (n === void 0 || t.mode !== "solid") return;
|
|
454
|
+
let r = at(e).find((e) => e.slot === n);
|
|
455
|
+
if (r !== void 0) return rt.has(e) || e.dataset.colorPaletteThemeSolid === t.solid ? r : void 0;
|
|
456
|
+
}
|
|
457
|
+
function z(e, t, n) {
|
|
695
458
|
return Math.min(n, Math.max(t, e));
|
|
696
459
|
}
|
|
697
|
-
function
|
|
460
|
+
function lt(e) {
|
|
698
461
|
if (e.trim().toLowerCase() === "transparent") return {
|
|
699
462
|
r: 0,
|
|
700
463
|
g: 0,
|
|
@@ -716,29 +479,29 @@ function bt(e) {
|
|
|
716
479
|
a: Number.parseInt(r.slice(6, 8), 16) / 255
|
|
717
480
|
};
|
|
718
481
|
}
|
|
719
|
-
function
|
|
482
|
+
function ut(e, t = e.a < .999) {
|
|
720
483
|
let n = [
|
|
721
484
|
e.r,
|
|
722
485
|
e.g,
|
|
723
486
|
e.b
|
|
724
|
-
].map((e) => Math.round(
|
|
725
|
-
return t && n.push(Math.round(
|
|
487
|
+
].map((e) => Math.round(z(e, 0, 255)).toString(16).padStart(2, "0"));
|
|
488
|
+
return t && n.push(Math.round(z(e.a, 0, 1) * 255).toString(16).padStart(2, "0")), `#${n.join("")}`;
|
|
726
489
|
}
|
|
727
|
-
function
|
|
728
|
-
let t =
|
|
490
|
+
function B(e) {
|
|
491
|
+
let t = z(e.r, 0, 255) / 255, n = z(e.g, 0, 255) / 255, r = z(e.b, 0, 255) / 255, i = Math.max(t, n, r), a = i - Math.min(t, n, r), o = 0;
|
|
729
492
|
return a !== 0 && (i === t && (o = 60 * ((n - r) / a % 6)), i === n && (o = 60 * ((r - t) / a + 2)), i === r && (o = 60 * ((t - n) / a + 4))), {
|
|
730
493
|
h: o < 0 ? o + 360 : o,
|
|
731
494
|
s: i === 0 ? 0 : a / i * 100,
|
|
732
495
|
v: i * 100,
|
|
733
|
-
a:
|
|
496
|
+
a: z(e.a, 0, 1)
|
|
734
497
|
};
|
|
735
498
|
}
|
|
736
|
-
function
|
|
737
|
-
let n =
|
|
738
|
-
return n.s > 0 && n.v > 0 ? n.h :
|
|
499
|
+
function dt(e, t = 0) {
|
|
500
|
+
let n = B(e);
|
|
501
|
+
return n.s > 0 && n.v > 0 ? n.h : z(t, 0, 360);
|
|
739
502
|
}
|
|
740
|
-
function
|
|
741
|
-
let t = (e.h % 360 + 360) % 360, n =
|
|
503
|
+
function ft(e) {
|
|
504
|
+
let t = (e.h % 360 + 360) % 360, n = z(e.s, 0, 100) / 100, r = z(e.v, 0, 100) / 100, i = r * n, a = i * (1 - Math.abs(t / 60 % 2 - 1)), o = r - i, [s, c, l] = t < 60 ? [
|
|
742
505
|
i,
|
|
743
506
|
a,
|
|
744
507
|
0
|
|
@@ -767,26 +530,26 @@ function Ct(e) {
|
|
|
767
530
|
r: Math.round((s + o) * 255),
|
|
768
531
|
g: Math.round((c + o) * 255),
|
|
769
532
|
b: Math.round((l + o) * 255),
|
|
770
|
-
a:
|
|
533
|
+
a: z(e.a, 0, 1)
|
|
771
534
|
};
|
|
772
535
|
}
|
|
773
|
-
function
|
|
774
|
-
return
|
|
536
|
+
function V(e) {
|
|
537
|
+
return ut(e.color);
|
|
775
538
|
}
|
|
776
|
-
function
|
|
777
|
-
let n =
|
|
539
|
+
function pt(e, t) {
|
|
540
|
+
let n = ut({
|
|
778
541
|
...t.color,
|
|
779
542
|
a: 1
|
|
780
543
|
}, !1);
|
|
781
|
-
e.setAttribute("style", `--designer-fill-hue:${t.hueValue};--designer-fill-saturation:${t.planeSaturation};--designer-fill-value:${t.planeValue};--designer-fill-color:${
|
|
544
|
+
e.setAttribute("style", `--designer-fill-hue:${t.hueValue};--designer-fill-saturation:${t.planeSaturation};--designer-fill-value:${t.planeValue};--designer-fill-color:${V(t)};--designer-fill-opaque:${n}`), t.plane.setAttribute("aria-valuetext", d.propertiesPanel.colorPickerPlaneValue(Math.round(t.planeSaturation), Math.round(t.planeValue))), t.hue.value = String(Math.round(t.hueValue)), t.alpha.value = String(Math.round(t.color.a * 100)), t.channels.hex.value = ut(t.color, !1), t.channels.r.value = String(Math.round(t.color.r)), t.channels.g.value = String(Math.round(t.color.g)), t.channels.b.value = String(Math.round(t.color.b)), t.channels.a.value = String(Math.round(t.color.a * 100));
|
|
782
545
|
}
|
|
783
|
-
function
|
|
546
|
+
function mt(e, t, n) {
|
|
784
547
|
let r = (n, r) => {
|
|
785
548
|
let i = t.plane.getBoundingClientRect();
|
|
786
549
|
if (i.width <= 0 || i.height <= 0) return;
|
|
787
|
-
let a =
|
|
788
|
-
|
|
789
|
-
...
|
|
550
|
+
let a = z((n.clientX - i.left) / i.width * 100, 0, 100), o = z(100 - (n.clientY - i.top) / i.height * 100, 0, 100);
|
|
551
|
+
H(e, t, ft({
|
|
552
|
+
...B(t.color),
|
|
790
553
|
h: t.hueValue,
|
|
791
554
|
s: a,
|
|
792
555
|
v: o
|
|
@@ -806,9 +569,9 @@ function Tt(e, t, n) {
|
|
|
806
569
|
}), t.plane.addEventListener("pointerup", (e) => {
|
|
807
570
|
i === e.pointerId && (r(e, !0), a(e.pointerId));
|
|
808
571
|
}), t.plane.addEventListener("pointercancel", (e) => {
|
|
809
|
-
i === e.pointerId && (t.callbacks.change(
|
|
572
|
+
i === e.pointerId && (t.callbacks.change(V(t)), a(e.pointerId));
|
|
810
573
|
}), t.plane.addEventListener("lostpointercapture", (e) => {
|
|
811
|
-
i === e.pointerId && (i = void 0, t.callbacks.change(
|
|
574
|
+
i === e.pointerId && (i = void 0, t.callbacks.change(V(t)));
|
|
812
575
|
}), t.plane.addEventListener("keydown", (n) => {
|
|
813
576
|
let r = n;
|
|
814
577
|
if (![
|
|
@@ -818,8 +581,8 @@ function Tt(e, t, n) {
|
|
|
818
581
|
"ArrowDown"
|
|
819
582
|
].includes(r.key)) return;
|
|
820
583
|
n.preventDefault();
|
|
821
|
-
let i = r.shiftKey ? 10 : 1, a =
|
|
822
|
-
|
|
584
|
+
let i = r.shiftKey ? 10 : 1, a = B(t.color), o = t.planeSaturation + (r.key === "ArrowRight" ? i : r.key === "ArrowLeft" ? -i : 0), s = t.planeValue + (r.key === "ArrowUp" ? i : r.key === "ArrowDown" ? -i : 0);
|
|
585
|
+
H(e, t, ft({
|
|
823
586
|
...a,
|
|
824
587
|
h: t.hueValue,
|
|
825
588
|
s: o,
|
|
@@ -829,16 +592,16 @@ function Tt(e, t, n) {
|
|
|
829
592
|
v: s
|
|
830
593
|
});
|
|
831
594
|
});
|
|
832
|
-
for (let n of [t.hue, t.alpha]) n.addEventListener("input", () =>
|
|
833
|
-
for (let n of Object.values(t.channels)) n.addEventListener("change", () =>
|
|
595
|
+
for (let n of [t.hue, t.alpha]) n.addEventListener("input", () => ht(e, t, !1)), n.addEventListener("change", () => t.callbacks.change(V(t)));
|
|
596
|
+
for (let n of Object.values(t.channels)) n.addEventListener("change", () => gt(e, t, n));
|
|
834
597
|
for (let r of n) r.addEventListener("click", () => {
|
|
835
|
-
let n =
|
|
836
|
-
n !== void 0 &&
|
|
598
|
+
let n = lt(r.dataset.fillColorQuick ?? "");
|
|
599
|
+
n !== void 0 && H(e, t, n, !0);
|
|
837
600
|
});
|
|
838
601
|
}
|
|
839
|
-
function
|
|
840
|
-
let r =
|
|
841
|
-
|
|
602
|
+
function ht(e, t, n) {
|
|
603
|
+
let r = B(t.color), i = Number(t.hue.value);
|
|
604
|
+
H(e, t, ft({
|
|
842
605
|
...r,
|
|
843
606
|
h: i,
|
|
844
607
|
s: t.planeSaturation,
|
|
@@ -846,9 +609,9 @@ function Et(e, t, n) {
|
|
|
846
609
|
a: Number(t.alpha.value) / 100
|
|
847
610
|
}), n, i);
|
|
848
611
|
}
|
|
849
|
-
function
|
|
612
|
+
function gt(e, t, n) {
|
|
850
613
|
let r = n.dataset.fillColorChannel, i;
|
|
851
|
-
if (r === "hex" && (i =
|
|
614
|
+
if (r === "hex" && (i = lt(n.value)), r === "r" || r === "g" || r === "b" || r === "a") {
|
|
852
615
|
let e = Number(n.value), a = r === "a" ? 100 : 255;
|
|
853
616
|
Number.isFinite(e) && e >= 0 && e <= a && (i = r === "a" ? {
|
|
854
617
|
...t.color,
|
|
@@ -859,51 +622,51 @@ function Dt(e, t, n) {
|
|
|
859
622
|
});
|
|
860
623
|
}
|
|
861
624
|
if (i === void 0) {
|
|
862
|
-
n.setAttribute("aria-invalid", "true"), t.message.textContent =
|
|
625
|
+
n.setAttribute("aria-invalid", "true"), t.message.textContent = d.propertiesPanel.colorPickerHexInvalid;
|
|
863
626
|
return;
|
|
864
627
|
}
|
|
865
|
-
n.removeAttribute("aria-invalid"), t.message.textContent = "",
|
|
628
|
+
n.removeAttribute("aria-invalid"), t.message.textContent = "", H(e, t, i, !0);
|
|
866
629
|
}
|
|
867
|
-
function
|
|
630
|
+
function H(e, t, n, r, i, a) {
|
|
868
631
|
if (t.color = {
|
|
869
|
-
r:
|
|
870
|
-
g:
|
|
871
|
-
b:
|
|
872
|
-
a:
|
|
873
|
-
}, t.hueValue = i === void 0 ?
|
|
874
|
-
let e =
|
|
632
|
+
r: z(n.r, 0, 255),
|
|
633
|
+
g: z(n.g, 0, 255),
|
|
634
|
+
b: z(n.b, 0, 255),
|
|
635
|
+
a: z(n.a, 0, 1)
|
|
636
|
+
}, t.hueValue = i === void 0 ? dt(t.color, t.hueValue) : z(i, 0, 360), a === void 0) {
|
|
637
|
+
let e = B(t.color);
|
|
875
638
|
t.planeSaturation = e.s, t.planeValue = e.v;
|
|
876
|
-
} else t.planeSaturation =
|
|
877
|
-
t.callbacks.hueChange?.(t.hueValue,
|
|
878
|
-
}
|
|
879
|
-
var
|
|
880
|
-
"#2483ff",
|
|
881
|
-
"#39c5bb",
|
|
882
|
-
"#00c9a7",
|
|
883
|
-
"#7c6cff",
|
|
884
|
-
"#f0b94b",
|
|
885
|
-
"#ff765c",
|
|
886
|
-
"#ed5f82",
|
|
887
|
-
"#d9e0e8",
|
|
888
|
-
"#18222e"
|
|
889
|
-
],
|
|
890
|
-
function
|
|
639
|
+
} else t.planeSaturation = z(a.s, 0, 100), t.planeValue = z(a.v, 0, 100);
|
|
640
|
+
t.callbacks.hueChange?.(t.hueValue, V(t)), t.callbacks.planeChange?.(t.planeSaturation, t.planeValue, V(t)), pt(e, t), t.callbacks.input(V(t)), r && t.callbacks.change(V(t));
|
|
641
|
+
}
|
|
642
|
+
var _t = [
|
|
643
|
+
["blue", "#2483ff"],
|
|
644
|
+
["teal", "#39c5bb"],
|
|
645
|
+
["mint", "#00c9a7"],
|
|
646
|
+
["violet", "#7c6cff"],
|
|
647
|
+
["amber", "#f0b94b"],
|
|
648
|
+
["coral", "#ff765c"],
|
|
649
|
+
["rose", "#ed5f82"],
|
|
650
|
+
["silver", "#d9e0e8"],
|
|
651
|
+
["ink", "#18222e"]
|
|
652
|
+
], vt = /* @__PURE__ */ new WeakMap();
|
|
653
|
+
function yt(e, t, n, r, i) {
|
|
891
654
|
let a = e.createElement("section");
|
|
892
655
|
a.className = "designer-fill-color-picker", a.dataset.designerFillColorPicker = "";
|
|
893
656
|
let o = e.createElement("button");
|
|
894
|
-
o.type = "button", o.className = "designer-fill-color-plane", o.setAttribute("aria-label",
|
|
657
|
+
o.type = "button", o.className = "designer-fill-color-plane", o.setAttribute("aria-label", d.propertiesPanel.colorPickerPlane);
|
|
895
658
|
let s = e.createElement("span");
|
|
896
659
|
s.className = "designer-fill-color-plane-thumb", o.appendChild(s), a.appendChild(o);
|
|
897
660
|
let c = e.createElement("div");
|
|
898
661
|
c.className = "designer-fill-color-slider-row";
|
|
899
|
-
let
|
|
900
|
-
|
|
901
|
-
let
|
|
902
|
-
f.className = "designer-fill-color-hue-track", f.appendChild(
|
|
903
|
-
let
|
|
904
|
-
|
|
662
|
+
let l = e.createElement("div");
|
|
663
|
+
l.className = "designer-fill-color-sliders";
|
|
664
|
+
let u = St(e, "designer-fill-color-hue", 0, 360, d.propertiesPanel.colorPickerHue), f = e.createElement("label");
|
|
665
|
+
f.className = "designer-fill-color-hue-track", f.appendChild(u);
|
|
666
|
+
let m = St(e, "designer-fill-color-alpha", 0, 100, d.propertiesPanel.gradientStopOpacity), h = e.createElement("label");
|
|
667
|
+
h.className = "designer-fill-color-alpha-track designer-fill-color-checkerboard", h.appendChild(m), l.appendChild(f), l.appendChild(h);
|
|
905
668
|
let g = e.createElement("span");
|
|
906
|
-
g.className = "designer-fill-color-current designer-fill-color-checkerboard", g.setAttribute("aria-hidden", "true"), c.appendChild(
|
|
669
|
+
g.className = "designer-fill-color-current designer-fill-color-checkerboard", g.setAttribute("aria-hidden", "true"), c.appendChild(l), c.appendChild(g), a.appendChild(c);
|
|
907
670
|
let _ = e.createElement("div");
|
|
908
671
|
_.className = "designer-fill-color-channel-grid";
|
|
909
672
|
let v = {};
|
|
@@ -916,7 +679,7 @@ function jt(e, t, n, r, i) {
|
|
|
916
679
|
]) {
|
|
917
680
|
let n = e.createElement("label");
|
|
918
681
|
n.className = `designer-fill-color-channel designer-fill-color-channel-${t}`;
|
|
919
|
-
let r =
|
|
682
|
+
let r = p(e, {
|
|
920
683
|
type: t === "hex" ? "text" : "number",
|
|
921
684
|
ariaLabel: t === "hex" ? "Hex" : t.toUpperCase()
|
|
922
685
|
});
|
|
@@ -930,51 +693,53 @@ function jt(e, t, n, r, i) {
|
|
|
930
693
|
let b = e.createElement("section");
|
|
931
694
|
b.className = "designer-fill-color-quick";
|
|
932
695
|
let x = e.createElement("span");
|
|
933
|
-
x.textContent =
|
|
696
|
+
x.textContent = d.propertiesPanel.colorPickerQuickColors, b.appendChild(x);
|
|
934
697
|
let S = e.createElement("div"), C = [];
|
|
935
|
-
for (let t of
|
|
936
|
-
let
|
|
937
|
-
|
|
698
|
+
for (let [t, n] of _t) {
|
|
699
|
+
let r = e.createElement("button");
|
|
700
|
+
r.type = "button", r.className = "designer-fill-color-swatch", r.dataset.fillColorQuick = n, r.setAttribute("style", `--designer-fill-swatch:${n}`);
|
|
701
|
+
let i = d.propertiesPanel.colorPickerQuickColor(d.propertiesPanel.colorPickerQuickColorNames[t], n.toUpperCase());
|
|
702
|
+
r.setAttribute("aria-label", i), r.setAttribute("data-tip", i), S.appendChild(r), C.push(r);
|
|
938
703
|
}
|
|
939
704
|
b.appendChild(S), a.appendChild(b);
|
|
940
|
-
let w =
|
|
705
|
+
let w = lt(t) ?? {
|
|
941
706
|
r: 0,
|
|
942
707
|
g: 0,
|
|
943
708
|
b: 0,
|
|
944
709
|
a: 1
|
|
945
|
-
}, T =
|
|
710
|
+
}, T = B(w), E = {
|
|
946
711
|
color: w,
|
|
947
|
-
hueValue: r === void 0 ?
|
|
948
|
-
planeSaturation:
|
|
949
|
-
planeValue:
|
|
712
|
+
hueValue: r === void 0 ? dt(w) : z(r, 0, 360),
|
|
713
|
+
planeSaturation: z(i?.s ?? T.s, 0, 100),
|
|
714
|
+
planeValue: z(i?.v ?? T.v, 0, 100),
|
|
950
715
|
callbacks: n,
|
|
951
716
|
plane: o,
|
|
952
|
-
hue:
|
|
953
|
-
alpha:
|
|
717
|
+
hue: u,
|
|
718
|
+
alpha: m,
|
|
954
719
|
channels: v,
|
|
955
720
|
message: y,
|
|
956
721
|
controls: [
|
|
957
722
|
o,
|
|
958
|
-
|
|
959
|
-
|
|
723
|
+
u,
|
|
724
|
+
m,
|
|
960
725
|
...Object.values(v),
|
|
961
726
|
...C
|
|
962
727
|
]
|
|
963
728
|
};
|
|
964
|
-
return
|
|
729
|
+
return vt.set(a, E), mt(a, E, C), pt(a, E), a;
|
|
965
730
|
}
|
|
966
|
-
function
|
|
967
|
-
let n =
|
|
731
|
+
function bt(e, t) {
|
|
732
|
+
let n = vt.get(e), r = lt(t);
|
|
968
733
|
if (n === void 0 || r === void 0) return;
|
|
969
|
-
let i =
|
|
970
|
-
n.hueValue =
|
|
734
|
+
let i = B(r);
|
|
735
|
+
n.hueValue = dt(r, n.hueValue), n.planeSaturation = i.s, n.planeValue = i.v, n.color = r, n.message.textContent = "", pt(e, n);
|
|
971
736
|
}
|
|
972
|
-
function
|
|
973
|
-
let n =
|
|
737
|
+
function xt(e, t) {
|
|
738
|
+
let n = vt.get(e);
|
|
974
739
|
if (n !== void 0) for (let e of n.controls) e.disabled !== t && (e.disabled = t);
|
|
975
740
|
}
|
|
976
|
-
function
|
|
977
|
-
let a =
|
|
741
|
+
function St(e, t, n, r, i) {
|
|
742
|
+
let a = p(e, {
|
|
978
743
|
appearance: "range",
|
|
979
744
|
className: t,
|
|
980
745
|
max: r,
|
|
@@ -983,194 +748,195 @@ function Pt(e, t, n, r, i) {
|
|
|
983
748
|
});
|
|
984
749
|
return a.setAttribute("aria-label", i), a;
|
|
985
750
|
}
|
|
986
|
-
var
|
|
987
|
-
function
|
|
988
|
-
return
|
|
751
|
+
var Ct = /* @__PURE__ */ new WeakSet();
|
|
752
|
+
function wt(e) {
|
|
753
|
+
return Ct.has(e);
|
|
989
754
|
}
|
|
990
|
-
function
|
|
991
|
-
let n =
|
|
755
|
+
function U(e, t = !0) {
|
|
756
|
+
let n = R(e);
|
|
992
757
|
if (n === void 0) return;
|
|
993
|
-
let r =
|
|
994
|
-
i !== null && (i.setAttribute("aria-label",
|
|
995
|
-
let
|
|
996
|
-
|
|
758
|
+
let r = be(n), i = e.querySelector("[data-color-palette-action=\"toggle\"]"), a = e.querySelector("[data-color-palette-trigger-swatch]"), o = e.querySelector("[data-color-palette-trigger-value]"), s = ct(e, n), c = s === void 0 ? r : `${d.propertiesPanel.colorPickerSlotValue(s.group, s.label)} ${r}`;
|
|
759
|
+
i !== null && (i.setAttribute("aria-label", d.propertiesPanel.colorPickerTrigger(c)), i.setAttribute("data-tip", c)), a !== null && a.setAttribute("style", `--designer-color-palette-value:${r}`), o !== null && (o.textContent = s === void 0 ? et(n) : d.propertiesPanel.colorPickerSlotValue(s.group, s.label));
|
|
760
|
+
for (let t of e.querySelectorAll("[data-color-palette-theme-slot]")) t.setAttribute("aria-pressed", String(t.dataset.colorPaletteThemeSlot === s?.slot));
|
|
761
|
+
let l = e.querySelector("[data-designer-fill-color-picker]");
|
|
762
|
+
l !== null && t && bt(l, Tt(n, e));
|
|
997
763
|
}
|
|
998
|
-
function
|
|
999
|
-
return e.mode === "solid" ? e.solid : e.stops[
|
|
764
|
+
function Tt(e, t) {
|
|
765
|
+
return e.mode === "solid" ? e.solid : e.stops[I(t, e.stops.length)]?.color ?? e.solid;
|
|
1000
766
|
}
|
|
1001
|
-
function
|
|
767
|
+
function Et(e, t, n) {
|
|
1002
768
|
let r = e.dataset.colorPaletteMode, i = r === "solid" ? "solid-value" : "stop-value", a = e.querySelector(`[data-color-palette-field="${i}"]`), o = e.querySelector(`[data-color-palette-field="${r === "solid" ? "solid" : "stop-color"}"]`);
|
|
1003
769
|
if (a !== null && o !== null) {
|
|
1004
|
-
|
|
770
|
+
Ct.add(e);
|
|
1005
771
|
try {
|
|
1006
|
-
a.value = t,
|
|
772
|
+
a.value = t, kt(e, a, i), o.dispatchEvent(new Event(n, { bubbles: !0 }));
|
|
1007
773
|
} finally {
|
|
1008
|
-
|
|
774
|
+
Ct.delete(e);
|
|
1009
775
|
}
|
|
1010
776
|
}
|
|
1011
777
|
}
|
|
1012
|
-
function
|
|
1013
|
-
let n =
|
|
778
|
+
function Dt(e, t) {
|
|
779
|
+
let n = P(e);
|
|
1014
780
|
if (!Number.isInteger(t) || n[t] === void 0) return;
|
|
1015
|
-
let r =
|
|
781
|
+
let r = F(n);
|
|
1016
782
|
if (r === void 0) return;
|
|
1017
783
|
e.dataset.colorPaletteSelectedStop = String(t);
|
|
1018
784
|
let i = e.dataset.colorPaletteKey;
|
|
1019
|
-
i !== void 0 &&
|
|
1020
|
-
for (let e = 0; e < n.length; e++)
|
|
785
|
+
i !== void 0 && ue(i, t);
|
|
786
|
+
for (let e = 0; e < n.length; e++) Re(n[e], r, e, t);
|
|
1021
787
|
let a = e.querySelector("[data-color-palette-stop-editor]"), o = e.querySelector("[data-color-palette-field=\"stop-color\"]"), s = e.querySelector("[data-color-palette-field=\"stop-position\"]"), c = e.querySelector("[data-color-palette-action=\"remove-stop\"]");
|
|
1022
788
|
if (a !== null && (a.dataset.colorPaletteStopEditor = String(t)), o !== null) {
|
|
1023
|
-
o.dataset.colorPaletteStopIndex = String(t),
|
|
789
|
+
o.dataset.colorPaletteStopIndex = String(t), He(o, r[t].color);
|
|
1024
790
|
let n = o.closest(".designer-color-palette-color-control")?.querySelector(".designer-color-palette-color-value");
|
|
1025
|
-
n != null && (n.dataset.colorPaletteStopIndex = String(t),
|
|
791
|
+
n != null && (n.dataset.colorPaletteStopIndex = String(t), L(n, o));
|
|
1026
792
|
let i = e.querySelector("[data-color-palette-field=\"stop-alpha\"]");
|
|
1027
793
|
if (i !== null) {
|
|
1028
|
-
i.dataset.colorPaletteStopIndex = String(t), i.value = String(
|
|
794
|
+
i.dataset.colorPaletteStopIndex = String(t), i.value = String(Je(r[t].color));
|
|
1029
795
|
let e = i.closest(".designer-color-palette-alpha")?.querySelector(".designer-color-palette-alpha-value");
|
|
1030
796
|
e != null && (e.textContent = `${i.value}%`);
|
|
1031
797
|
}
|
|
1032
798
|
}
|
|
1033
|
-
s !== null && (s.dataset.colorPaletteStopIndex = String(t), s.value = String(r[t].position), s.min = String(t === 0 ? 0 : r[t - 1].position + 1), s.max = String(t === r.length - 1 ? 100 : r[t + 1].position - 1)), c !== null && (c.dataset.colorPaletteStopIndex = String(t)),
|
|
799
|
+
s !== null && (s.dataset.colorPaletteStopIndex = String(t), s.value = String(r[t].position), s.min = String(t === 0 ? 0 : r[t - 1].position + 1), s.max = String(t === r.length - 1 ? 100 : r[t + 1].position - 1)), c !== null && (c.dataset.colorPaletteStopIndex = String(t)), U(e);
|
|
1034
800
|
}
|
|
1035
|
-
function
|
|
801
|
+
function Ot(e, t, n) {
|
|
1036
802
|
let r = n === "solid-alpha" ? e.querySelector("[data-color-palette-field=\"solid\"]") : e.querySelector("[data-color-palette-field=\"stop-color\"]");
|
|
1037
803
|
if (r == null) return;
|
|
1038
|
-
delete r.dataset.colorPaletteTransparent, r.dataset.colorPaletteAlpha =
|
|
804
|
+
delete r.dataset.colorPaletteTransparent, r.dataset.colorPaletteAlpha = Ye(Number(t.value));
|
|
1039
805
|
let i = r.closest(".designer-color-palette-color-control")?.querySelector(".designer-color-palette-color-value");
|
|
1040
|
-
i != null &&
|
|
806
|
+
i != null && L(i, r), n === "stop-alpha" && At(e, r), Lt(e);
|
|
1041
807
|
}
|
|
1042
|
-
function
|
|
1043
|
-
let r =
|
|
808
|
+
function kt(e, t, n) {
|
|
809
|
+
let r = We(t.value);
|
|
1044
810
|
if (r === void 0) {
|
|
1045
|
-
|
|
811
|
+
Ke(t);
|
|
1046
812
|
return;
|
|
1047
813
|
}
|
|
1048
814
|
let i = n === "solid-value" ? e.querySelector("[data-color-palette-field=\"solid\"]") : e.querySelector("[data-color-palette-field=\"stop-color\"]");
|
|
1049
815
|
if (i == null) return;
|
|
1050
|
-
|
|
816
|
+
He(i, r), L(t, i);
|
|
1051
817
|
let a = n === "solid-value" ? "solid-alpha" : "stop-alpha", o = e.querySelector(`[data-color-palette-field="${a}"]`);
|
|
1052
818
|
if (o !== null) {
|
|
1053
|
-
o.value = String(
|
|
819
|
+
o.value = String(Je(r));
|
|
1054
820
|
let e = o.closest(".designer-color-palette-alpha")?.querySelector(".designer-color-palette-alpha-value");
|
|
1055
821
|
e != null && (e.textContent = `${o.value}%`);
|
|
1056
822
|
}
|
|
1057
|
-
n === "stop-value" &&
|
|
823
|
+
n === "stop-value" && At(e, i), Lt(e);
|
|
1058
824
|
}
|
|
1059
|
-
function
|
|
1060
|
-
let n = Number(t.dataset.colorPaletteStopIndex), r =
|
|
825
|
+
function At(e, t) {
|
|
826
|
+
let n = Number(t.dataset.colorPaletteStopIndex), r = P(e)[n];
|
|
1061
827
|
if (!Number.isInteger(n) || r === void 0) return;
|
|
1062
|
-
let i =
|
|
1063
|
-
|
|
828
|
+
let i = Ue(t);
|
|
829
|
+
Ae(i) && (r.dataset.colorPaletteStopColor = i, Le(r, i));
|
|
1064
830
|
}
|
|
1065
|
-
function
|
|
1066
|
-
let r = Number(t.dataset.colorPaletteStopIndex), i =
|
|
831
|
+
function jt(e, t, n) {
|
|
832
|
+
let r = Number(t.dataset.colorPaletteStopIndex), i = P(e), a = i[r];
|
|
1067
833
|
if (!Number.isInteger(r) || a === void 0) return;
|
|
1068
834
|
if (n === "stop-color") {
|
|
1069
|
-
|
|
835
|
+
At(e, t);
|
|
1070
836
|
return;
|
|
1071
837
|
}
|
|
1072
838
|
let o = Number(t.value), s = Number(t.min), c = Number(t.max);
|
|
1073
839
|
if (!Number.isInteger(o) || o < s || o > c) return;
|
|
1074
|
-
a.dataset.colorPaletteStopPosition = String(o),
|
|
1075
|
-
let l =
|
|
1076
|
-
if (l !== void 0) for (let t = 0; t < i.length; t++)
|
|
840
|
+
a.dataset.colorPaletteStopPosition = String(o), Ie(a, o);
|
|
841
|
+
let l = F(i);
|
|
842
|
+
if (l !== void 0) for (let t = 0; t < i.length; t++) Re(i[t], l, t, I(e, l.length));
|
|
1077
843
|
}
|
|
1078
|
-
function
|
|
844
|
+
function Mt(e, t) {
|
|
1079
845
|
let n = e.closest("[data-designer-color-palette]");
|
|
1080
846
|
if (n === null) return;
|
|
1081
847
|
let r = Number(e.dataset.colorPaletteStopHandle);
|
|
1082
848
|
if (!Number.isInteger(r)) return;
|
|
1083
|
-
t.preventDefault(), t.stopPropagation(),
|
|
849
|
+
t.preventDefault(), t.stopPropagation(), Dt(n, r), e.setPointerCapture?.(t.pointerId);
|
|
1084
850
|
let i = !1, a = (e) => {
|
|
1085
|
-
i =
|
|
851
|
+
i = Pt(n, r, e.clientX) || i;
|
|
1086
852
|
}, o = (t) => {
|
|
1087
|
-
e.removeEventListener("pointermove", a), e.removeEventListener("pointerup", o), e.removeEventListener("pointercancel", o), e.hasPointerCapture?.(t.pointerId) && e.releasePointerCapture(t.pointerId), i &&
|
|
853
|
+
e.removeEventListener("pointermove", a), e.removeEventListener("pointerup", o), e.removeEventListener("pointercancel", o), e.hasPointerCapture?.(t.pointerId) && e.releasePointerCapture(t.pointerId), i && It(n);
|
|
1088
854
|
};
|
|
1089
855
|
e.addEventListener("pointermove", a), e.addEventListener("pointerup", o), e.addEventListener("pointercancel", o);
|
|
1090
856
|
}
|
|
1091
|
-
function
|
|
857
|
+
function Nt(e, t) {
|
|
1092
858
|
let n = e.closest("[data-designer-color-palette]");
|
|
1093
859
|
if (n === null) return;
|
|
1094
|
-
let r = Number(e.dataset.colorPaletteStopHandle), i = Number(e.dataset.colorPaletteStopPosition), a =
|
|
860
|
+
let r = Number(e.dataset.colorPaletteStopHandle), i = Number(e.dataset.colorPaletteStopPosition), a = F(P(n));
|
|
1095
861
|
if (!Number.isInteger(r) || !Number.isInteger(i) || a === void 0) return;
|
|
1096
862
|
let o = r === 0 ? 0 : a[r - 1].position + 1, s = r === a.length - 1 ? 100 : a[r + 1].position - 1, c = t.shiftKey ? 10 : 1, l = t.key === "ArrowLeft" || t.key === "ArrowDown" ? i - c : t.key === "ArrowRight" || t.key === "ArrowUp" ? i + c : t.key === "Home" ? o : t.key === "End" ? s : void 0;
|
|
1097
|
-
l !== void 0 && (t.preventDefault(), t.stopPropagation(),
|
|
863
|
+
l !== void 0 && (t.preventDefault(), t.stopPropagation(), Dt(n, r), Ft(n, r, Math.min(Math.max(l, o), s)) && It(n));
|
|
1098
864
|
}
|
|
1099
|
-
function
|
|
865
|
+
function Pt(e, t, n) {
|
|
1100
866
|
let r = e.querySelector("[data-color-palette-stop-slider]");
|
|
1101
867
|
if (r === null) return !1;
|
|
1102
868
|
let i = r.getBoundingClientRect();
|
|
1103
869
|
if (i.width <= 0) return !1;
|
|
1104
|
-
let a = Math.round((n - i.left) / i.width * 100), o =
|
|
870
|
+
let a = Math.round((n - i.left) / i.width * 100), o = F(P(e));
|
|
1105
871
|
if (o === void 0 || o[t] === void 0) return !1;
|
|
1106
872
|
let s = t === 0 ? 0 : o[t - 1].position + 1, c = t === o.length - 1 ? 100 : o[t + 1].position - 1;
|
|
1107
|
-
return
|
|
873
|
+
return Ft(e, t, Math.min(Math.max(a, s), c));
|
|
1108
874
|
}
|
|
1109
|
-
function
|
|
1110
|
-
let r =
|
|
875
|
+
function Ft(e, t, n) {
|
|
876
|
+
let r = P(e), i = r[t];
|
|
1111
877
|
if (i === void 0 || Number(i.dataset.colorPaletteStopPosition) === n) return !1;
|
|
1112
|
-
i.dataset.colorPaletteStopPosition = String(n),
|
|
878
|
+
i.dataset.colorPaletteStopPosition = String(n), Ie(i, n);
|
|
1113
879
|
let a = e.querySelector("[data-color-palette-field=\"stop-position\"]");
|
|
1114
880
|
a !== null && Number(a.dataset.colorPaletteStopIndex) === t && (a.value = String(n));
|
|
1115
|
-
let o =
|
|
881
|
+
let o = F(r);
|
|
1116
882
|
if (o === void 0) return !1;
|
|
1117
|
-
for (let e = 0; e < r.length; e++)
|
|
1118
|
-
return
|
|
883
|
+
for (let e = 0; e < r.length; e++) Re(r[e], o, e, t);
|
|
884
|
+
return Lt(e), !0;
|
|
1119
885
|
}
|
|
1120
|
-
function
|
|
886
|
+
function It(e) {
|
|
1121
887
|
e.querySelector("[data-color-palette-field=\"stop-position\"]")?.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
1122
888
|
}
|
|
1123
|
-
function
|
|
1124
|
-
let t =
|
|
1125
|
-
t !== void 0 && n !== null &&
|
|
889
|
+
function Lt(e) {
|
|
890
|
+
let t = R(e), n = e.querySelector(".designer-color-palette-preview");
|
|
891
|
+
t !== void 0 && n !== null && Rt(n, t), t !== void 0 && U(e, !Ct.has(e));
|
|
1126
892
|
}
|
|
1127
|
-
function
|
|
893
|
+
function Rt(e, t) {
|
|
1128
894
|
let n = e.style;
|
|
1129
|
-
n !== void 0 && (n.background =
|
|
895
|
+
n !== void 0 && (n.background = be({
|
|
1130
896
|
...t,
|
|
1131
897
|
mode: t.mode === "solid" ? "linear-gradient" : t.mode
|
|
1132
898
|
}));
|
|
1133
899
|
}
|
|
1134
|
-
function
|
|
900
|
+
function zt(e, t, n, r) {
|
|
1135
901
|
t.replaceChildren();
|
|
1136
|
-
let i = t.ownerDocument, a = Math.min(Math.max(r, 0), n.stops.length - 1), o = e.dataset.colorPaletteKey, s = n.mode === "solid" ? n.solid : n.stops[a].color, c = o === void 0 ? void 0 :
|
|
1137
|
-
s:
|
|
1138
|
-
v:
|
|
1139
|
-
} : void 0, p =
|
|
902
|
+
let i = t.ownerDocument, a = Math.min(Math.max(r, 0), n.stops.length - 1), o = e.dataset.colorPaletteKey, s = n.mode === "solid" ? n.solid : n.stops[a].color, c = o === void 0 ? void 0 : he(o), l = c?.color === s.toLowerCase() ? c.hue : void 0, u = o === void 0 ? void 0 : ge(o), f = u?.color === s.toLowerCase() ? {
|
|
903
|
+
s: u.saturation,
|
|
904
|
+
v: u.value
|
|
905
|
+
} : void 0, p = Xe(i, n.solid, "solid"), m = p.input, h = p.value;
|
|
1140
906
|
m.className += " designer-color-palette-solid";
|
|
1141
|
-
let g =
|
|
907
|
+
let g = Ze(i, n.solid, "solid-alpha"), _ = i.createElement("div");
|
|
1142
908
|
_.className = "designer-color-palette-solid-field", _.appendChild(p.element), _.appendChild(g.element), t.appendChild(_);
|
|
1143
909
|
let v = i.createElement("div");
|
|
1144
910
|
v.className = "designer-color-palette-gradient";
|
|
1145
911
|
let y = i.createElement("div");
|
|
1146
|
-
y.className = "designer-color-palette-preview",
|
|
1147
|
-
let b =
|
|
912
|
+
y.className = "designer-color-palette-preview", Rt(y, n), v.appendChild(Bt(i, y, n, a));
|
|
913
|
+
let b = Vt(i, n, a), x = Ze(i, n.stops[a].color, "stop-alpha");
|
|
1148
914
|
x.input.dataset.colorPaletteStopIndex = String(a);
|
|
1149
915
|
let S = i.createElement("div");
|
|
1150
916
|
S.className = "designer-color-palette-tools";
|
|
1151
|
-
let C =
|
|
917
|
+
let C = Ht(i, "add-stop", d.propertiesPanel.gradientAddStop, "plus");
|
|
1152
918
|
C.disabled = n.stops.length >= 8, S.appendChild(C);
|
|
1153
|
-
let w =
|
|
919
|
+
let w = Ht(i, "remove-stop", d.propertiesPanel.gradientRemoveStop, "trash");
|
|
1154
920
|
w.disabled = n.stops.length <= 2, w.dataset.colorPaletteStopIndex = String(a), S.appendChild(w);
|
|
1155
921
|
let T = i.createElement("div");
|
|
1156
922
|
T.className = "designer-color-palette-parameters";
|
|
1157
|
-
let E =
|
|
923
|
+
let E = $e(i, d.propertiesPanel.gradientAngle, n.angle, "angle", 0, 360);
|
|
1158
924
|
E.input.className += " designer-color-palette-linear", E.element.className += " designer-color-palette-linear", T.appendChild(E.element);
|
|
1159
|
-
let D =
|
|
925
|
+
let D = $e(i, d.propertiesPanel.gradientCenterX, n.x, "x", 0, 100, d.propertiesPanel.x);
|
|
1160
926
|
D.input.className += " designer-color-palette-radial", D.element.className += " designer-color-palette-radial", T.appendChild(D.element);
|
|
1161
|
-
let O =
|
|
927
|
+
let O = $e(i, d.propertiesPanel.gradientCenterY, n.y, "y", 0, 100, d.propertiesPanel.y);
|
|
1162
928
|
O.input.className += " designer-color-palette-radial", O.element.className += " designer-color-palette-radial", T.appendChild(O.element);
|
|
1163
929
|
let k = i.createElement("div");
|
|
1164
|
-
return k.className = "designer-color-palette-stop-bar", k.appendChild(b.element), k.appendChild(x.element), k.appendChild(T), k.appendChild(S), v.appendChild(k), t.appendChild(v), t.appendChild(
|
|
1165
|
-
input: (t) =>
|
|
1166
|
-
change: (t) =>
|
|
930
|
+
return k.className = "designer-color-palette-stop-bar", k.appendChild(b.element), k.appendChild(x.element), k.appendChild(T), k.appendChild(S), v.appendChild(k), t.appendChild(v), t.appendChild(yt(i, s, {
|
|
931
|
+
input: (t) => Et(e, t, "input"),
|
|
932
|
+
change: (t) => Et(e, t, "change"),
|
|
1167
933
|
hueChange: (e, t) => {
|
|
1168
|
-
o !== void 0 &&
|
|
934
|
+
o !== void 0 && de(o, e, t);
|
|
1169
935
|
},
|
|
1170
936
|
planeChange: (e, t, n) => {
|
|
1171
|
-
o !== void 0 &&
|
|
937
|
+
o !== void 0 && fe(o, e, t, n);
|
|
1172
938
|
}
|
|
1173
|
-
},
|
|
939
|
+
}, l, f)), {
|
|
1174
940
|
solid: m,
|
|
1175
941
|
solidValue: h,
|
|
1176
942
|
solidAlpha: g.input,
|
|
@@ -1187,21 +953,21 @@ function Zt(e, t, n, r) {
|
|
|
1187
953
|
]
|
|
1188
954
|
};
|
|
1189
955
|
}
|
|
1190
|
-
function
|
|
956
|
+
function Bt(e, t, n, r) {
|
|
1191
957
|
let i = e.createElement("div");
|
|
1192
958
|
i.className = "designer-color-palette-stop-slider", i.dataset.colorPaletteStopSlider = "", i.appendChild(t);
|
|
1193
959
|
for (let t = 0; t < n.stops.length; t++) {
|
|
1194
960
|
let a = n.stops[t], o = e.createElement("button");
|
|
1195
|
-
o.type = "button", o.className = "designer-color-palette-stop-handle", o.dataset.colorPaletteStopHandle = String(t), o.dataset.colorPaletteStopColor = a.color, o.dataset.colorPaletteStopPosition = String(a.position),
|
|
961
|
+
o.type = "button", o.className = "designer-color-palette-stop-handle", o.dataset.colorPaletteStopHandle = String(t), o.dataset.colorPaletteStopColor = a.color, o.dataset.colorPaletteStopPosition = String(a.position), Le(o, a.color), o.setAttribute("aria-label", `${d.propertiesPanel.gradientStopPosition} ${t + 1}`), Re(o, n.stops, t, r), Ie(o, a.position), o.addEventListener("pointerdown", (e) => Mt(o, e)), o.addEventListener("keydown", (e) => Nt(o, e)), i.appendChild(o);
|
|
1196
962
|
}
|
|
1197
963
|
return i;
|
|
1198
964
|
}
|
|
1199
|
-
function
|
|
965
|
+
function Vt(e, t, n) {
|
|
1200
966
|
let r = t.stops[n], i = e.createElement("div");
|
|
1201
967
|
i.className = "designer-color-palette-stop-editor", i.dataset.colorPaletteStopEditor = String(n);
|
|
1202
|
-
let a =
|
|
968
|
+
let a = Xe(e, r.color, "stop-color"), o = a.input, s = a.value;
|
|
1203
969
|
o.dataset.colorPaletteStopIndex = String(n), s.dataset.colorPaletteStopIndex = String(n), i.appendChild(a.element);
|
|
1204
|
-
let c =
|
|
970
|
+
let c = $e(e, d.propertiesPanel.gradientStopPosition, r.position, "stop-position", n === 0 ? 0 : t.stops[n - 1].position + 1, n === t.stops.length - 1 ? 100 : t.stops[n + 1].position - 1);
|
|
1205
971
|
return c.input.dataset.colorPaletteStopIndex = String(n), i.appendChild(c.element), {
|
|
1206
972
|
element: i,
|
|
1207
973
|
color: o,
|
|
@@ -1209,142 +975,142 @@ function $t(e, t, n) {
|
|
|
1209
975
|
position: c.input
|
|
1210
976
|
};
|
|
1211
977
|
}
|
|
1212
|
-
function
|
|
1213
|
-
let i =
|
|
978
|
+
function Ht(e, t, n, r) {
|
|
979
|
+
let i = ee(e, {
|
|
1214
980
|
className: "designer-color-palette-action",
|
|
1215
981
|
icon: r,
|
|
1216
982
|
label: n
|
|
1217
983
|
});
|
|
1218
984
|
return i.dataset.colorPaletteAction = t, i;
|
|
1219
985
|
}
|
|
1220
|
-
var
|
|
1221
|
-
function
|
|
986
|
+
var Ut = 6, W = 8, Wt = 280, Gt = 560, Kt = 120, G = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap(), Jt = /* @__PURE__ */ new WeakSet(), Yt = /* @__PURE__ */ new WeakSet(), K = /* @__PURE__ */ new WeakMap(), Xt = /* @__PURE__ */ new WeakMap();
|
|
987
|
+
function q(e, t) {
|
|
1222
988
|
let n = e.ownerDocument, r = e.dataset.colorPaletteKey;
|
|
1223
989
|
if (t) {
|
|
1224
|
-
let t =
|
|
1225
|
-
t !== void 0 && t !== e && (
|
|
1226
|
-
} else
|
|
1227
|
-
|
|
990
|
+
let t = G.get(n);
|
|
991
|
+
t !== void 0 && t !== e && (ln(n), sn(t, !1)), G.set(n, e), r !== void 0 && qt.set(n, r), cn(e);
|
|
992
|
+
} else G.get(n) === e && (G.delete(n), ln(n), r !== void 0 && qt.get(n) === r && qt.delete(n));
|
|
993
|
+
sn(e, t);
|
|
1228
994
|
}
|
|
1229
|
-
function
|
|
995
|
+
function Zt(e) {
|
|
1230
996
|
let t = e.dataset.colorPaletteKey;
|
|
1231
|
-
t !== void 0 &&
|
|
997
|
+
t !== void 0 && qt.get(e.ownerDocument) === t && q(e, !0);
|
|
1232
998
|
}
|
|
1233
|
-
function
|
|
1234
|
-
|
|
999
|
+
function Qt(e) {
|
|
1000
|
+
pn(e, () => {
|
|
1235
1001
|
let t = e.querySelector("[data-color-palette-field=\"mode\"]:checked"), n = e.querySelector("[data-color-palette-action=\"close\"]");
|
|
1236
1002
|
(t ?? n)?.focus();
|
|
1237
1003
|
});
|
|
1238
1004
|
}
|
|
1239
|
-
function
|
|
1240
|
-
if (
|
|
1241
|
-
|
|
1005
|
+
function $t(e) {
|
|
1006
|
+
if (Jt.has(e)) return;
|
|
1007
|
+
Jt.add(e);
|
|
1242
1008
|
let t = e;
|
|
1243
1009
|
t.addEventListener?.("pointerdown", (t) => {
|
|
1244
|
-
|
|
1245
|
-
let n =
|
|
1246
|
-
n !== void 0 && r !== null && !i.includes(n) && !n.contains(r) && (
|
|
1247
|
-
}, !0), t.addEventListener?.("pointerup", (t) =>
|
|
1010
|
+
an(e);
|
|
1011
|
+
let n = G.get(e), r = t.target, i = t.composedPath?.() ?? [];
|
|
1012
|
+
n !== void 0 && r !== null && !i.includes(n) && !n.contains(r) && (en(e, t), q(n, !1));
|
|
1013
|
+
}, !0), t.addEventListener?.("pointerup", (t) => tn(e, t), !0), t.addEventListener?.("pointercancel", (t) => nn(e, t), !0);
|
|
1248
1014
|
for (let n of [
|
|
1249
1015
|
"click",
|
|
1250
1016
|
"auxclick",
|
|
1251
1017
|
"contextmenu"
|
|
1252
|
-
]) t.addEventListener?.(n, (t) =>
|
|
1018
|
+
]) t.addEventListener?.(n, (t) => rn(e, t), !0);
|
|
1253
1019
|
t.addEventListener?.("keydown", (t) => {
|
|
1254
|
-
let n = t, r =
|
|
1255
|
-
n.key === "Escape" && r !== void 0 && (n.preventDefault(),
|
|
1020
|
+
let n = t, r = G.get(e);
|
|
1021
|
+
n.key === "Escape" && r !== void 0 && (n.preventDefault(), q(r, !1), r.querySelector("[data-color-palette-action=\"toggle\"]")?.focus());
|
|
1256
1022
|
}, !0), t.addEventListener?.("scroll", (t) => {
|
|
1257
|
-
let n =
|
|
1023
|
+
let n = G.get(e);
|
|
1258
1024
|
if (n === void 0) return;
|
|
1259
1025
|
let r = n.querySelector("[data-color-palette-popover]"), i = t.composedPath?.() ?? [];
|
|
1260
1026
|
if (r !== null && (i.includes(r) || r.contains(t.target))) return;
|
|
1261
1027
|
let a = n.closest("[data-inspector-pane]");
|
|
1262
1028
|
if (a !== null && (i.includes(a) || a.contains(t.target))) {
|
|
1263
|
-
|
|
1029
|
+
dn(n);
|
|
1264
1030
|
return;
|
|
1265
1031
|
}
|
|
1266
|
-
|
|
1032
|
+
q(n, !1);
|
|
1267
1033
|
}, !0), e.defaultView?.addEventListener("resize", () => {
|
|
1268
|
-
let t =
|
|
1269
|
-
t !== void 0 &&
|
|
1034
|
+
let t = G.get(e);
|
|
1035
|
+
t !== void 0 && dn(t);
|
|
1270
1036
|
});
|
|
1271
1037
|
}
|
|
1272
|
-
function
|
|
1038
|
+
function en(e, t) {
|
|
1273
1039
|
let n = {
|
|
1274
1040
|
pointerId: t.pointerId,
|
|
1275
1041
|
released: !1
|
|
1276
1042
|
};
|
|
1277
|
-
|
|
1043
|
+
K.set(e, n), on(t);
|
|
1278
1044
|
}
|
|
1279
|
-
function
|
|
1280
|
-
let n =
|
|
1045
|
+
function tn(e, t) {
|
|
1046
|
+
let n = K.get(e);
|
|
1281
1047
|
if (n === void 0 || n.pointerId !== t.pointerId) return;
|
|
1282
|
-
n.released = !0,
|
|
1048
|
+
n.released = !0, on(t);
|
|
1283
1049
|
let r = e.defaultView;
|
|
1284
1050
|
r != null && (n.clearTimer = r.setTimeout(() => {
|
|
1285
|
-
|
|
1051
|
+
K.get(e) === n && K.delete(e);
|
|
1286
1052
|
}, 0));
|
|
1287
1053
|
}
|
|
1288
|
-
function
|
|
1289
|
-
let n =
|
|
1290
|
-
n !== void 0 && n.pointerId === t.pointerId && (
|
|
1054
|
+
function nn(e, t) {
|
|
1055
|
+
let n = K.get(e);
|
|
1056
|
+
n !== void 0 && n.pointerId === t.pointerId && (on(t), an(e));
|
|
1291
1057
|
}
|
|
1292
|
-
function
|
|
1293
|
-
let n =
|
|
1294
|
-
n === void 0 || !n.released || (
|
|
1058
|
+
function rn(e, t) {
|
|
1059
|
+
let n = K.get(e);
|
|
1060
|
+
n === void 0 || !n.released || (on(t), an(e));
|
|
1295
1061
|
}
|
|
1296
|
-
function
|
|
1297
|
-
let t =
|
|
1298
|
-
t?.clearTimer !== void 0 && e.defaultView?.clearTimeout(t.clearTimer),
|
|
1062
|
+
function an(e) {
|
|
1063
|
+
let t = K.get(e);
|
|
1064
|
+
t?.clearTimer !== void 0 && e.defaultView?.clearTimeout(t.clearTimer), K.delete(e);
|
|
1299
1065
|
}
|
|
1300
|
-
function
|
|
1066
|
+
function on(e) {
|
|
1301
1067
|
e.preventDefault(), e.stopImmediatePropagation();
|
|
1302
1068
|
}
|
|
1303
|
-
function
|
|
1069
|
+
function sn(e, t) {
|
|
1304
1070
|
e.dataset.colorPaletteOpen = String(t);
|
|
1305
1071
|
let n = e.querySelector("[data-color-palette-action=\"toggle\"]"), r = e.querySelector("[data-color-palette-popover]");
|
|
1306
|
-
n !== null && n.setAttribute("aria-expanded", String(t)), r !== null && (r.hidden = !t, t && (
|
|
1307
|
-
|
|
1072
|
+
n !== null && n.setAttribute("aria-expanded", String(t)), r !== null && (r.hidden = !t, t && (un(e), pn(e, () => {
|
|
1073
|
+
cn(e), un(e);
|
|
1308
1074
|
})));
|
|
1309
1075
|
}
|
|
1310
|
-
function
|
|
1076
|
+
function cn(e) {
|
|
1311
1077
|
let t = e.ownerDocument, n = e.closest("[data-inspector-pane]");
|
|
1312
|
-
if (
|
|
1078
|
+
if (Xt.get(t)?.target === n || (ln(t), n === null)) return;
|
|
1313
1079
|
let r = () => {
|
|
1314
|
-
|
|
1080
|
+
G.get(t) === e && dn(e);
|
|
1315
1081
|
};
|
|
1316
|
-
n.addEventListener("scroll", r),
|
|
1082
|
+
n.addEventListener("scroll", r), Xt.set(t, {
|
|
1317
1083
|
target: n,
|
|
1318
1084
|
listener: r
|
|
1319
1085
|
});
|
|
1320
1086
|
}
|
|
1321
|
-
function
|
|
1322
|
-
let t =
|
|
1323
|
-
t !== void 0 && (t.target.removeEventListener("scroll", t.listener),
|
|
1087
|
+
function ln(e) {
|
|
1088
|
+
let t = Xt.get(e);
|
|
1089
|
+
t !== void 0 && (t.target.removeEventListener("scroll", t.listener), Xt.delete(e));
|
|
1324
1090
|
}
|
|
1325
|
-
function
|
|
1091
|
+
function un(e) {
|
|
1326
1092
|
if (e.dataset.colorPaletteOpen !== "true") return;
|
|
1327
|
-
let t = e.querySelector("[data-color-palette-action=\"toggle\"]"), n = e.querySelector("[data-color-palette-popover]"), r =
|
|
1093
|
+
let t = e.querySelector("[data-color-palette-action=\"toggle\"]"), n = e.querySelector("[data-color-palette-popover]"), r = fn(t), i = n?.style;
|
|
1328
1094
|
if (r === void 0 || n === null || i === void 0) return;
|
|
1329
1095
|
let a = e.ownerDocument.defaultView, o = a?.innerWidth ?? e.ownerDocument.documentElement?.clientWidth ?? 0, s = a?.innerHeight ?? e.ownerDocument.documentElement?.clientHeight ?? 0;
|
|
1330
1096
|
if (o <= 0 || s <= 0) return;
|
|
1331
|
-
let c =
|
|
1332
|
-
top: Math.max(
|
|
1333
|
-
right: Math.min(o -
|
|
1334
|
-
bottom: Math.min(s -
|
|
1335
|
-
left: Math.max(
|
|
1336
|
-
}, u = Math.max(0, l.right - l.left), d = Math.min(
|
|
1097
|
+
let c = fn(e.closest("[data-inspector-pane]")), l = {
|
|
1098
|
+
top: Math.max(W, c?.top ?? W),
|
|
1099
|
+
right: Math.min(o - W, c?.right ?? o - W),
|
|
1100
|
+
bottom: Math.min(s - W, c?.bottom ?? s - W),
|
|
1101
|
+
left: Math.max(W, c?.left ?? W)
|
|
1102
|
+
}, u = Math.max(0, l.right - l.left), d = Math.min(Wt, u);
|
|
1337
1103
|
if (d <= 0) return;
|
|
1338
|
-
let f =
|
|
1104
|
+
let f = mn(r.right - d, l.left, l.right - d);
|
|
1339
1105
|
i.width = `${Math.round(d)}px`, i.left = `${Math.round(f)}px`;
|
|
1340
|
-
let p = Math.min(
|
|
1106
|
+
let p = Math.min(Gt, Math.max(n.scrollHeight, fn(n)?.height ?? 0)), m = Math.max(0, l.bottom - r.bottom - Ut), h = Math.max(0, r.top - l.top - Ut), g = m < p && h > m, _ = Math.min(Gt, Math.max(Kt, g ? h : m)), v = Math.min(p, _), y = g ? Math.max(l.top, r.top - Ut - v) : Math.min(l.bottom - v, r.bottom + Ut);
|
|
1341
1107
|
n.dataset.colorPalettePlacement = g ? "top" : "bottom", i.top = `${Math.round(y)}px`, i.maxHeight = `${Math.round(_)}px`;
|
|
1342
1108
|
}
|
|
1343
|
-
function
|
|
1344
|
-
if (
|
|
1345
|
-
|
|
1109
|
+
function dn(e) {
|
|
1110
|
+
if (Yt.has(e)) return;
|
|
1111
|
+
Yt.add(e);
|
|
1346
1112
|
let t = () => {
|
|
1347
|
-
|
|
1113
|
+
Yt.delete(e), G.get(e.ownerDocument) === e && un(e);
|
|
1348
1114
|
}, n = e.ownerDocument.defaultView;
|
|
1349
1115
|
if (n?.requestAnimationFrame !== void 0) {
|
|
1350
1116
|
n.requestAnimationFrame(t);
|
|
@@ -1356,11 +1122,11 @@ function Cn(e) {
|
|
|
1356
1122
|
}
|
|
1357
1123
|
t();
|
|
1358
1124
|
}
|
|
1359
|
-
function
|
|
1125
|
+
function fn(e) {
|
|
1360
1126
|
let t = e?.getBoundingClientRect;
|
|
1361
1127
|
if (typeof t == "function") return t.call(e);
|
|
1362
1128
|
}
|
|
1363
|
-
function
|
|
1129
|
+
function pn(e, t) {
|
|
1364
1130
|
let n = e.ownerDocument.defaultView;
|
|
1365
1131
|
if (n?.requestAnimationFrame !== void 0) {
|
|
1366
1132
|
n.requestAnimationFrame(() => {
|
|
@@ -1372,78 +1138,80 @@ function Tn(e, t) {
|
|
|
1372
1138
|
e.dataset.colorPaletteOpen === "true" && t();
|
|
1373
1139
|
});
|
|
1374
1140
|
}
|
|
1375
|
-
function
|
|
1141
|
+
function mn(e, t, n) {
|
|
1376
1142
|
return Math.min(Math.max(e, t), n);
|
|
1377
1143
|
}
|
|
1378
|
-
function
|
|
1379
|
-
let n =
|
|
1144
|
+
function hn(e, t) {
|
|
1145
|
+
let n = h(e, { className: "designer-color-palette-trigger" });
|
|
1380
1146
|
n.dataset.colorPaletteAction = "toggle", n.setAttribute("aria-haspopup", "dialog"), n.setAttribute("aria-controls", t), n.setAttribute("aria-expanded", "false");
|
|
1381
1147
|
let r = e.createElement("span");
|
|
1382
1148
|
r.className = "designer-color-palette-trigger-swatch designer-fill-color-checkerboard", r.dataset.colorPaletteTriggerSwatch = "", r.setAttribute("aria-hidden", "true");
|
|
1383
1149
|
let i = e.createElement("span");
|
|
1384
1150
|
i.className = "designer-color-palette-trigger-value", i.dataset.colorPaletteTriggerValue = "";
|
|
1385
1151
|
let a = e.createElement("span");
|
|
1386
|
-
return a.className = "designer-color-palette-trigger-caret", a.innerHTML =
|
|
1152
|
+
return a.className = "designer-color-palette-trigger-caret", a.innerHTML = S("chevron-down"), n.appendChild(r), n.appendChild(i), n.appendChild(a), n;
|
|
1387
1153
|
}
|
|
1388
|
-
function
|
|
1154
|
+
function gn(e) {
|
|
1389
1155
|
let t = [...e.querySelectorAll("[data-color-palette-field]")].some((e) => e.disabled), n = e.querySelector("[data-color-palette-action=\"toggle\"]");
|
|
1390
1156
|
n !== null && n.disabled !== t && (n.disabled = t);
|
|
1391
1157
|
let r = e.querySelector("[data-designer-fill-color-picker]");
|
|
1392
|
-
r !== null &&
|
|
1393
|
-
}
|
|
1394
|
-
function
|
|
1395
|
-
let i = r.allowGradient !== !1, a =
|
|
1396
|
-
|
|
1397
|
-
let
|
|
1398
|
-
|
|
1399
|
-
let
|
|
1400
|
-
|
|
1401
|
-
let
|
|
1402
|
-
|
|
1403
|
-
let
|
|
1158
|
+
r !== null && xt(r, t), t && q(e, !1);
|
|
1159
|
+
}
|
|
1160
|
+
function _n(e, t, n, r = {}) {
|
|
1161
|
+
let i = r.allowGradient !== !1, a = r.themeSlots ?? [], o = ot(t, a), s = o === void 0 ? t : o.color, c = ye(s), l = i ? c : bn(c), u = n === void 0 ? void 0 : pe(n), f = u !== void 0 && be(u) === s ? u : l, p = i ? f : bn(f), m = ze(n === void 0 ? void 0 : me(n), p.stops.length), h = e.createElement("div");
|
|
1162
|
+
h.className = "designer-color-palette", h.dataset.designerColorPalette = "", h.dataset.colorPaletteMode = p.mode, h.dataset.colorPaletteSelectedStop = String(m), h.dataset.colorPaletteOpen = "false", n !== void 0 && (h.dataset.colorPaletteKey = n), a.length > 0 && it(h, a), o !== void 0 && p.mode === "solid" && (h.dataset.colorPaletteThemeSlot = o.slot, h.dataset.colorPaletteThemeSolid = p.solid);
|
|
1163
|
+
let g = Math.random().toString(36).slice(2), _ = `designer-color-popover-${g}`, v = hn(e, _);
|
|
1164
|
+
h.appendChild(v);
|
|
1165
|
+
let y = e.createElement("section");
|
|
1166
|
+
y.id = _, y.className = "designer-color-popover", y.dataset.colorPalettePopover = "", n !== void 0 && (y.dataset.designerScrollScope = `color-palette:${n}`), y.hidden = !0, y.setAttribute("role", "dialog"), y.setAttribute("aria-label", d.propertiesPanel.colorPickerTitle);
|
|
1167
|
+
let b = e.createElement("div");
|
|
1168
|
+
b.className = "designer-color-popover-toolbar";
|
|
1169
|
+
let x = ee(e, {
|
|
1404
1170
|
className: "designer-color-popover-close",
|
|
1405
1171
|
icon: "close",
|
|
1406
|
-
label:
|
|
1172
|
+
label: d.propertiesPanel.colorPickerClose
|
|
1407
1173
|
});
|
|
1408
|
-
|
|
1409
|
-
let
|
|
1410
|
-
|
|
1411
|
-
let
|
|
1174
|
+
x.dataset.colorPaletteAction = "close";
|
|
1175
|
+
let C = e.createElement("div");
|
|
1176
|
+
C.className = "designer-color-palette-modes", C.setAttribute("role", "radiogroup");
|
|
1177
|
+
let w = `designer-color-mode-${g}`, T = [];
|
|
1412
1178
|
if (i) {
|
|
1413
1179
|
for (let [t, n, r] of [
|
|
1414
1180
|
[
|
|
1415
1181
|
"solid",
|
|
1416
|
-
|
|
1182
|
+
d.propertiesPanel.backgroundSolid,
|
|
1417
1183
|
"color-solid"
|
|
1418
1184
|
],
|
|
1419
1185
|
[
|
|
1420
1186
|
"linear-gradient",
|
|
1421
|
-
|
|
1187
|
+
d.propertiesPanel.backgroundLinear,
|
|
1422
1188
|
"color-linear"
|
|
1423
1189
|
],
|
|
1424
1190
|
[
|
|
1425
1191
|
"radial-gradient",
|
|
1426
|
-
|
|
1192
|
+
d.propertiesPanel.backgroundRadial,
|
|
1427
1193
|
"color-radial"
|
|
1428
1194
|
]
|
|
1429
1195
|
]) {
|
|
1430
1196
|
let i = e.createElement("label");
|
|
1431
1197
|
i.className = "designer-color-palette-mode", i.setAttribute("data-tip", n);
|
|
1432
1198
|
let a = e.createElement("input");
|
|
1433
|
-
a.type = "radio", a.name =
|
|
1199
|
+
a.type = "radio", a.name = w, a.value = t, a.checked = p.mode === t, a.dataset.colorPaletteField = "mode", a.setAttribute("aria-label", n);
|
|
1434
1200
|
let o = e.createElement("span");
|
|
1435
|
-
o.className = "designer-color-palette-mode-icon", o.setAttribute("aria-hidden", "true"), o.innerHTML =
|
|
1201
|
+
o.className = "designer-color-palette-mode-icon", o.setAttribute("aria-hidden", "true"), o.innerHTML = S(r), i.appendChild(a), i.appendChild(o), C.appendChild(i), T.push(a);
|
|
1436
1202
|
}
|
|
1437
|
-
|
|
1203
|
+
b.appendChild(C);
|
|
1438
1204
|
}
|
|
1439
|
-
|
|
1440
|
-
let
|
|
1441
|
-
|
|
1442
|
-
let { solid:
|
|
1443
|
-
|
|
1205
|
+
b.appendChild(x), y.appendChild(b);
|
|
1206
|
+
let E = e.createElement("div");
|
|
1207
|
+
E.className = "designer-color-palette-fields";
|
|
1208
|
+
let { solid: D, solidValue: O, solidAlpha: k, stops: te, gradientInputs: ne } = zt(h, E, p, m);
|
|
1209
|
+
y.appendChild(E);
|
|
1210
|
+
for (let t of vn(e, a)) y.appendChild(t);
|
|
1211
|
+
h.appendChild(y), h.addEventListener("click", (e) => {
|
|
1444
1212
|
let t = e.target, n = t?.closest?.("[data-color-palette-stop-handle]");
|
|
1445
1213
|
if (n != null) {
|
|
1446
|
-
|
|
1214
|
+
Dt(h, Number(n.dataset.colorPaletteStopHandle));
|
|
1447
1215
|
return;
|
|
1448
1216
|
}
|
|
1449
1217
|
let r = t?.closest?.("[data-color-palette-action]");
|
|
@@ -1451,85 +1219,119 @@ function kn(e, t, n, r = {}) {
|
|
|
1451
1219
|
let i = r.dataset.colorPaletteAction;
|
|
1452
1220
|
if (i === "toggle") {
|
|
1453
1221
|
if (!r.disabled) {
|
|
1454
|
-
let t =
|
|
1455
|
-
|
|
1222
|
+
let t = h.dataset.colorPaletteOpen !== "true";
|
|
1223
|
+
q(h, t), t && e.detail === 0 && Qt(h);
|
|
1456
1224
|
}
|
|
1457
1225
|
return;
|
|
1458
1226
|
}
|
|
1227
|
+
if (i === "theme") {
|
|
1228
|
+
yn(h, r.dataset.colorPaletteThemeSlot);
|
|
1229
|
+
return;
|
|
1230
|
+
}
|
|
1459
1231
|
if (i === "close") {
|
|
1460
|
-
|
|
1232
|
+
q(h, !1), v.focus?.();
|
|
1461
1233
|
return;
|
|
1462
1234
|
}
|
|
1463
|
-
(i === "add-stop" || i === "remove-stop") &&
|
|
1464
|
-
}),
|
|
1235
|
+
(i === "add-stop" || i === "remove-stop") && Sn(h, i, Number(r.dataset.colorPaletteStopIndex));
|
|
1236
|
+
}), h.addEventListener("change", (e) => {
|
|
1465
1237
|
let t = e.target, n = t?.dataset?.colorPaletteField;
|
|
1466
|
-
if (
|
|
1467
|
-
|
|
1238
|
+
if (Ge(n)) {
|
|
1239
|
+
kt(h, t, n), U(h);
|
|
1468
1240
|
return;
|
|
1469
1241
|
}
|
|
1470
|
-
if (n !== "mode" || !
|
|
1471
|
-
let r =
|
|
1242
|
+
if (n !== "mode" || !Ee(t?.value)) return;
|
|
1243
|
+
let r = R(h);
|
|
1472
1244
|
if (r === void 0) return;
|
|
1473
|
-
let i =
|
|
1474
|
-
|
|
1475
|
-
}),
|
|
1245
|
+
let i = wn(h), a = I(h, r.stops.length), o = Ee(h.dataset.colorPaletteMode) ? h.dataset.colorPaletteMode : r.mode, s = Ce(r, t.value, o, a);
|
|
1246
|
+
h.dataset.colorPaletteMode = s.mode, zt(h, E, s, a), Tn(h, i), U(h, !1), gn(h);
|
|
1247
|
+
}), h.addEventListener("input", (e) => {
|
|
1476
1248
|
let t = e.target;
|
|
1477
|
-
if (t?.dataset === void 0 || t.value === void 0 ||
|
|
1249
|
+
if (t?.dataset === void 0 || t.value === void 0 || wt(h)) return;
|
|
1478
1250
|
let n = t.dataset.colorPaletteField;
|
|
1479
|
-
if (
|
|
1480
|
-
|
|
1251
|
+
if (Ge(n)) {
|
|
1252
|
+
Ke(t);
|
|
1481
1253
|
return;
|
|
1482
1254
|
}
|
|
1483
1255
|
if (n === "solid-alpha" || n === "stop-alpha") {
|
|
1484
|
-
|
|
1256
|
+
Ot(h, t, n), U(h);
|
|
1485
1257
|
return;
|
|
1486
1258
|
}
|
|
1487
|
-
(n === "solid" || n === "stop-position" || n === "stop-color" || n === "angle" || n === "x" || n === "y") && ((n === "stop-position" || n === "stop-color") &&
|
|
1488
|
-
}),
|
|
1259
|
+
(n === "solid" || n === "stop-position" || n === "stop-color" || n === "angle" || n === "x" || n === "y") && ((n === "stop-position" || n === "stop-color") && jt(h, t, n), Lt(h), U(h));
|
|
1260
|
+
}), h.addEventListener("keydown", (e) => {
|
|
1489
1261
|
let t = e;
|
|
1490
|
-
t.key === "Escape" &&
|
|
1491
|
-
}),
|
|
1492
|
-
let
|
|
1493
|
-
return
|
|
1262
|
+
t.key === "Escape" && h.dataset.colorPaletteOpen === "true" && (t.preventDefault(), q(h, !1), v.focus?.());
|
|
1263
|
+
}), $t(e), U(h, !1), Zt(h);
|
|
1264
|
+
let re = e.defaultView?.MutationObserver;
|
|
1265
|
+
return re !== void 0 && new re(() => gn(h)).observe(h, {
|
|
1494
1266
|
attributes: !0,
|
|
1495
1267
|
subtree: !0,
|
|
1496
1268
|
attributeFilter: ["disabled"]
|
|
1497
1269
|
}), {
|
|
1498
|
-
element:
|
|
1270
|
+
element: h,
|
|
1499
1271
|
controls: [
|
|
1500
|
-
T,
|
|
1501
|
-
E,
|
|
1502
1272
|
D,
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
...
|
|
1273
|
+
O,
|
|
1274
|
+
k,
|
|
1275
|
+
...te,
|
|
1276
|
+
...ne,
|
|
1277
|
+
...T
|
|
1506
1278
|
]
|
|
1507
1279
|
};
|
|
1508
1280
|
}
|
|
1509
|
-
function
|
|
1510
|
-
|
|
1281
|
+
function vn(e, t) {
|
|
1282
|
+
let n = [];
|
|
1283
|
+
for (let r of ["theme", "status"]) {
|
|
1284
|
+
let i = t.filter((e) => e.group === r);
|
|
1285
|
+
if (i.length === 0) continue;
|
|
1286
|
+
let a = e.createElement("section");
|
|
1287
|
+
a.className = "designer-fill-color-quick designer-color-palette-theme", a.dataset.colorPaletteThemeGroup = r;
|
|
1288
|
+
let o = e.createElement("span");
|
|
1289
|
+
o.textContent = d.propertiesPanel.colorPickerSlotGroup(r), a.appendChild(o);
|
|
1290
|
+
let s = e.createElement("div");
|
|
1291
|
+
for (let t of i) {
|
|
1292
|
+
let n = e.createElement("button");
|
|
1293
|
+
n.type = "button", n.className = "designer-fill-color-swatch", n.dataset.colorPaletteAction = "theme", n.dataset.colorPaletteThemeSlot = t.slot, n.setAttribute("style", `--designer-fill-swatch:${t.color}`);
|
|
1294
|
+
let i = d.propertiesPanel.colorPickerSlotValue(r, t.label);
|
|
1295
|
+
n.setAttribute("aria-label", i), n.setAttribute("data-tip", i), n.setAttribute("aria-pressed", "false"), s.appendChild(n);
|
|
1296
|
+
}
|
|
1297
|
+
a.appendChild(s), n.push(a);
|
|
1298
|
+
}
|
|
1299
|
+
return n;
|
|
1300
|
+
}
|
|
1301
|
+
function yn(e, t) {
|
|
1302
|
+
if (e.dataset.colorPaletteMode !== "solid") return;
|
|
1303
|
+
let n = at(e).find((e) => e.slot === t);
|
|
1304
|
+
if (n === void 0) return;
|
|
1305
|
+
e.dataset.colorPaletteThemeSlot = n.slot, delete e.dataset.colorPaletteThemeSolid, st(e, () => Et(e, n.color, "change"));
|
|
1306
|
+
let r = R(e);
|
|
1307
|
+
r !== void 0 && r.mode === "solid" && (e.dataset.colorPaletteThemeSolid = r.solid), U(e);
|
|
1308
|
+
}
|
|
1309
|
+
function bn(e) {
|
|
1310
|
+
return e.mode === "solid" ? e : Ce(e, "solid", e.mode, 0);
|
|
1511
1311
|
}
|
|
1512
|
-
function
|
|
1312
|
+
function xn(e) {
|
|
1513
1313
|
let t = e?.closest?.("[data-designer-color-palette]");
|
|
1514
1314
|
if (t == null) return;
|
|
1515
|
-
let n =
|
|
1315
|
+
let n = R(t);
|
|
1516
1316
|
if (n === void 0) return;
|
|
1517
1317
|
let r = t.dataset.colorPaletteKey;
|
|
1518
|
-
|
|
1318
|
+
r !== void 0 && (le(r, n), ue(r, I(t, n.stops.length)));
|
|
1319
|
+
let i = ct(t, n);
|
|
1320
|
+
return i === void 0 ? be(n) : `theme:${i.slot}`;
|
|
1519
1321
|
}
|
|
1520
|
-
function
|
|
1521
|
-
let r =
|
|
1322
|
+
function Sn(e, t, n) {
|
|
1323
|
+
let r = R(e);
|
|
1522
1324
|
if (r === void 0) return !1;
|
|
1523
|
-
let i = t === "add-stop" ?
|
|
1325
|
+
let i = t === "add-stop" ? xe(r) : Se(r, n);
|
|
1524
1326
|
if (i === void 0) return !1;
|
|
1525
1327
|
let a = e.querySelector(".designer-color-palette-fields");
|
|
1526
1328
|
if (a === null) return !1;
|
|
1527
|
-
let o =
|
|
1528
|
-
e.dataset.colorPaletteMode = i.mode, e.dataset.colorPaletteSelectedStop = String(c),
|
|
1329
|
+
let o = wn(e), s = I(e, r.stops.length), c = t === "add-stop" ? Be(r.stops, i.stops) : s === n ? Math.min(n, i.stops.length - 1) : s > n ? s - 1 : s;
|
|
1330
|
+
e.dataset.colorPaletteMode = i.mode, e.dataset.colorPaletteSelectedStop = String(c), zt(e, a, i, c), Tn(e, o), U(e, !1), gn(e);
|
|
1529
1331
|
let l = e.querySelector("[data-color-palette-field=\"solid\"], [data-color-palette-field=\"stop-position\"]");
|
|
1530
1332
|
return l !== null && typeof l.dispatchEvent == "function" && l.dispatchEvent(new Event("change", { bubbles: !0 })), !0;
|
|
1531
1333
|
}
|
|
1532
|
-
var
|
|
1334
|
+
var Cn = [
|
|
1533
1335
|
"prop",
|
|
1534
1336
|
"style",
|
|
1535
1337
|
"descriptorFieldId",
|
|
@@ -1538,147 +1340,365 @@ var Nn = [
|
|
|
1538
1340
|
"descriptorControl",
|
|
1539
1341
|
"descriptorProjection"
|
|
1540
1342
|
];
|
|
1541
|
-
function
|
|
1343
|
+
function wn(e) {
|
|
1542
1344
|
let t = e.querySelector("[data-color-palette-field=\"solid\"]");
|
|
1543
|
-
return t === null ? {} : Object.fromEntries(
|
|
1345
|
+
return t === null ? {} : Object.fromEntries(Cn.flatMap((e) => {
|
|
1544
1346
|
let n = t.dataset[e];
|
|
1545
1347
|
return n === void 0 ? [] : [[e, n]];
|
|
1546
1348
|
}));
|
|
1547
1349
|
}
|
|
1548
|
-
function
|
|
1549
|
-
for (let n of e.querySelectorAll("[data-color-palette-field]")) for (let e of
|
|
1350
|
+
function Tn(e, t) {
|
|
1351
|
+
for (let n of e.querySelectorAll("[data-color-palette-field]")) for (let e of Cn) {
|
|
1550
1352
|
let r = t[e];
|
|
1551
1353
|
r !== void 0 && (n.dataset[e] = r);
|
|
1552
1354
|
}
|
|
1553
1355
|
}
|
|
1554
|
-
function
|
|
1555
|
-
|
|
1356
|
+
function En(e, t) {
|
|
1357
|
+
let n = e.ownerDocument.createElement("span");
|
|
1358
|
+
n.className = O("designer-badge", t.className), n.textContent = t.text, n.dataset.tone = t.tone ?? "neutral", t.title !== void 0 && (n.title = t.title), t.ariaLabel !== void 0 && n.setAttribute("aria-label", t.ariaLabel);
|
|
1359
|
+
for (let [e, r] of Object.entries(t.dataset ?? {})) n.dataset[e] = r;
|
|
1360
|
+
return e.appendChild(n), n;
|
|
1556
1361
|
}
|
|
1557
|
-
function
|
|
1558
|
-
let n = e.createElement(
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1362
|
+
function Dn(e, t) {
|
|
1363
|
+
let n = e.ownerDocument, r = n.createElement("div");
|
|
1364
|
+
if (r.className = O("designer-empty", t.className), t.tone === "success" && (r.dataset.tone = "success"), t.role !== void 0 && r.setAttribute("role", t.role), t.live !== void 0 && (r.ariaLive = t.live), t.icon !== void 0) {
|
|
1365
|
+
let e = n.createElement("span");
|
|
1366
|
+
e.className = "designer-empty-icon", e.setAttribute("aria-hidden", "true"), e.innerHTML = S(t.icon), r.appendChild(e);
|
|
1367
|
+
}
|
|
1368
|
+
let i = n.createElement("p");
|
|
1369
|
+
if (i.className = "designer-empty-title", i.textContent = t.title, r.appendChild(i), t.hint !== void 0) {
|
|
1370
|
+
let e = n.createElement("p");
|
|
1371
|
+
e.className = "designer-empty-hint", e.textContent = t.hint, r.appendChild(e);
|
|
1372
|
+
}
|
|
1373
|
+
let a = [];
|
|
1374
|
+
if (t.actions !== void 0 && t.actions.length > 0) {
|
|
1375
|
+
let e = n.createElement("div");
|
|
1376
|
+
e.className = "designer-empty-actions";
|
|
1377
|
+
for (let r of t.actions) {
|
|
1378
|
+
let t = h(n, {
|
|
1379
|
+
className: "designer-empty-action",
|
|
1380
|
+
text: r.label,
|
|
1381
|
+
...r.ariaLabel === void 0 ? {} : { ariaLabel: r.ariaLabel },
|
|
1382
|
+
...r.variant === void 0 ? {} : { variant: r.variant }
|
|
1383
|
+
});
|
|
1384
|
+
for (let [e, n] of Object.entries(r.dataset ?? {})) t.dataset[e] = n;
|
|
1385
|
+
e.appendChild(t), a.push(t);
|
|
1386
|
+
}
|
|
1387
|
+
r.appendChild(e);
|
|
1388
|
+
}
|
|
1389
|
+
return e.appendChild(r), {
|
|
1390
|
+
element: r,
|
|
1391
|
+
actionButtons: a
|
|
1392
|
+
};
|
|
1393
|
+
}
|
|
1394
|
+
function On(e, t) {
|
|
1395
|
+
let n = e.ownerDocument, r = t.collapsible ?? !0, i = n.createElement(r ? "details" : "section");
|
|
1396
|
+
i.className = O("designer-panel-section designer-inspector-section", t.className), r && (i.open = t.open ?? !0, i.classList.add("designer-inspector-disclosure")), t.advanced === !0 && (i.dataset.inspectorAdvanced = "true"), t.key !== void 0 && (i.dataset.inspectorSearchKey = t.key);
|
|
1397
|
+
let a = n.createElement(r ? "summary" : "h3");
|
|
1398
|
+
if (a.className = "designer-panel-section-title designer-inspector-section-title", r && a.classList.add("designer-inspector-section-summary", "designer-panel-section-summary"), a.textContent = t.title, t.summary !== void 0 && t.summary !== "") {
|
|
1399
|
+
let e = n.createElement("span");
|
|
1400
|
+
e.className = "designer-inspector-section-meta", e.textContent = t.summary, a.appendChild(e);
|
|
1401
|
+
}
|
|
1402
|
+
if (r) {
|
|
1403
|
+
let e = n.createElement("span");
|
|
1404
|
+
e.className = "designer-panel-section-disclosure designer-inspector-section-disclosure", e.setAttribute("aria-hidden", "true"), e.innerHTML = S("chevron-down"), a.appendChild(e);
|
|
1405
|
+
}
|
|
1406
|
+
i.appendChild(a);
|
|
1407
|
+
let o = null;
|
|
1408
|
+
if (t.actions !== void 0 && t.actions.length > 0) {
|
|
1409
|
+
o = n.createElement("div"), o.className = "designer-panel-section-actions";
|
|
1410
|
+
for (let e of t.actions) o.appendChild(e);
|
|
1411
|
+
r && o.addEventListener("click", (e) => e.stopPropagation()), i.appendChild(o);
|
|
1412
|
+
}
|
|
1413
|
+
return e.appendChild(i), {
|
|
1414
|
+
element: i,
|
|
1415
|
+
title: a,
|
|
1416
|
+
actions: o
|
|
1417
|
+
};
|
|
1418
|
+
}
|
|
1419
|
+
var kn = /* @__PURE__ */ new Set([
|
|
1420
|
+
"materialType",
|
|
1421
|
+
"name",
|
|
1422
|
+
"position"
|
|
1423
|
+
]), An = /* @__PURE__ */ new Set(["x", "y"]), jn = 256;
|
|
1424
|
+
function Mn(e) {
|
|
1425
|
+
return e?.defaultData === void 0 ? null : {
|
|
1426
|
+
type: "static",
|
|
1427
|
+
value: e.defaultData,
|
|
1428
|
+
...e.staticData?.kind === "tabular" ? { binding: e.staticData.defaultBinding } : {}
|
|
1564
1429
|
};
|
|
1565
1430
|
}
|
|
1566
|
-
function
|
|
1567
|
-
let
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1431
|
+
function Nn(e, t, n) {
|
|
1432
|
+
let r = t.replace(/[^A-Za-z0-9]+/g, "-"), i = e.components.length + 1, a = new Set(e.components.map((e) => e.id));
|
|
1433
|
+
if (n !== void 0) for (let e of n) a.add(e);
|
|
1434
|
+
for (; a.has(`${r}-${i}`);) i++;
|
|
1435
|
+
return `${r}-${i}`;
|
|
1436
|
+
}
|
|
1437
|
+
function Pn(e, t) {
|
|
1438
|
+
let n = e.components.map((e) => e.zIndex);
|
|
1439
|
+
return t !== void 0 && n.push(...t), n.reduce((e, t) => Math.max(e, t), -1) + 1;
|
|
1440
|
+
}
|
|
1441
|
+
function Fn(e, t, n) {
|
|
1442
|
+
return {
|
|
1443
|
+
id: n.id ?? Nn(e, t.type),
|
|
1444
|
+
type: t.type,
|
|
1445
|
+
name: n.name ?? t.name,
|
|
1446
|
+
parentId: n.parentId ?? null,
|
|
1447
|
+
position: n.position,
|
|
1448
|
+
size: t.defaultSize,
|
|
1449
|
+
rotation: 0,
|
|
1450
|
+
zIndex: n.zIndex ?? Pn(e),
|
|
1451
|
+
status: {
|
|
1452
|
+
locked: !1,
|
|
1453
|
+
hidden: !1
|
|
1454
|
+
},
|
|
1455
|
+
props: t.defaultProps,
|
|
1456
|
+
style: re(t, e.theme),
|
|
1457
|
+
dataSource: n.dataSource === void 0 ? Mn(t) : n.dataSource
|
|
1458
|
+
};
|
|
1459
|
+
}
|
|
1460
|
+
function In(e, t, n) {
|
|
1461
|
+
return {
|
|
1462
|
+
x: ie(Math.max(0, Math.min(n.x, Math.max(0, e.canvas.width - t.defaultSize.width)))),
|
|
1463
|
+
y: ie(Math.max(0, Math.min(n.y, Math.max(0, e.canvas.height - t.defaultSize.height))))
|
|
1464
|
+
};
|
|
1465
|
+
}
|
|
1466
|
+
function Ln(e) {
|
|
1467
|
+
if (!Vn(e) || !Hn(e, kn)) return Un("AUTHORING_PAYLOAD_INVALID", "Component insertion intent must be a strict object.");
|
|
1468
|
+
if (!t(e.materialType)) return Un("AUTHORING_SOURCE_INVALID", "Component insertion materialType must be a canonical material type.", ["materialType"]);
|
|
1469
|
+
if (e.name !== void 0 && !te(e.name, jn)) return Un("AUTHORING_PAYLOAD_INVALID", `Component name must contain 1 to ${jn} code points without control characters.`, ["name"]);
|
|
1470
|
+
let n = Rn(e.position);
|
|
1471
|
+
return n !== void 0 && "diagnostics" in n ? n : {
|
|
1472
|
+
ok: !0,
|
|
1473
|
+
value: {
|
|
1474
|
+
materialType: e.materialType,
|
|
1475
|
+
...e.name === void 0 ? {} : { name: e.name },
|
|
1476
|
+
...n === void 0 ? {} : { position: n }
|
|
1477
|
+
},
|
|
1478
|
+
diagnostics: []
|
|
1479
|
+
};
|
|
1480
|
+
}
|
|
1481
|
+
function Rn(e) {
|
|
1482
|
+
if (e !== void 0) return !Vn(e) || !Hn(e, An) || !Bn(e.x) || !Bn(e.y) ? Un("AUTHORING_PAYLOAD_INVALID", "Component insertion position must be finite canvas coordinates.", ["position"]) : {
|
|
1483
|
+
x: e.x,
|
|
1484
|
+
y: e.y
|
|
1572
1485
|
};
|
|
1573
1486
|
}
|
|
1574
1487
|
function zn(e, t) {
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
let i = e.createElement("span");
|
|
1580
|
-
if (i.className = o("designer-field-label-text", t.labelClassName), i.textContent = t.label, r.appendChild(i), t.hint !== void 0) {
|
|
1581
|
-
let n = e.createElement("span");
|
|
1582
|
-
n.className = "designer-field-hint", n.textContent = t.hint, r.appendChild(n);
|
|
1583
|
-
}
|
|
1584
|
-
n.appendChild(r);
|
|
1585
|
-
let a = t.control === "switch" ? u(e, {
|
|
1586
|
-
...t.ariaLabel === void 0 ? {} : { ariaLabel: t.ariaLabel },
|
|
1587
|
-
...t.checked === void 0 ? {} : { checked: t.checked },
|
|
1588
|
-
...t.disabled === void 0 ? {} : { disabled: t.disabled }
|
|
1589
|
-
}) : g(e, {
|
|
1590
|
-
...t.ariaLabel === void 0 ? {} : { ariaLabel: t.ariaLabel },
|
|
1591
|
-
...t.checked === void 0 ? {} : { checked: t.checked },
|
|
1592
|
-
...t.disabled === void 0 ? {} : { disabled: t.disabled }
|
|
1593
|
-
});
|
|
1594
|
-
return n.appendChild(a), {
|
|
1595
|
-
field: n,
|
|
1596
|
-
input: a
|
|
1488
|
+
return e === void 0 || e.type !== t.materialType || e.libraryVisible === !1 ? Un("AUTHORING_SOURCE_INVALID", "Component material is not available in the configured catalog.", ["materialType"]) : {
|
|
1489
|
+
ok: !0,
|
|
1490
|
+
value: e,
|
|
1491
|
+
diagnostics: []
|
|
1597
1492
|
};
|
|
1598
1493
|
}
|
|
1599
|
-
function Bn(e
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1494
|
+
function Bn(e) {
|
|
1495
|
+
return typeof e == "number" && Number.isFinite(e);
|
|
1496
|
+
}
|
|
1497
|
+
function Vn(e) {
|
|
1498
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1499
|
+
}
|
|
1500
|
+
function Hn(e, t) {
|
|
1501
|
+
return Object.keys(e).every((e) => t.has(e));
|
|
1502
|
+
}
|
|
1503
|
+
function Un(e, t, n = []) {
|
|
1504
|
+
return {
|
|
1505
|
+
ok: !1,
|
|
1506
|
+
diagnostics: [{
|
|
1507
|
+
severity: "error",
|
|
1508
|
+
code: e,
|
|
1509
|
+
path: n,
|
|
1510
|
+
message: t
|
|
1511
|
+
}]
|
|
1512
|
+
};
|
|
1513
|
+
}
|
|
1514
|
+
var Wn = "application/x-base-screen-host-resource", Gn = 8192, Kn = /* @__PURE__ */ new Set([
|
|
1515
|
+
"materialType",
|
|
1516
|
+
"dataSource",
|
|
1517
|
+
"name"
|
|
1518
|
+
]), qn = 256, Jn = /(url|token|headers?)/i, Yn = /^\s*(?:[a-z][a-z\d+.-]*:\/\/|https?:|data:|blob:|file:|javascript:|\.{0,2}\/)/i;
|
|
1519
|
+
function Xn(e) {
|
|
1520
|
+
let n = ar(e);
|
|
1521
|
+
if (!n.ok) return n;
|
|
1522
|
+
if (e = n.value, !rr(e) || !ir(e, Kn)) return J("AUTHORING_PAYLOAD_INVALID", "Host resource authoring intent must be a strict object.");
|
|
1523
|
+
if (!t(e.materialType)) return J("AUTHORING_SOURCE_INVALID", "Host resource materialType must be a canonical material type.", ["materialType"]);
|
|
1524
|
+
if (e.name !== void 0 && !te(e.name, qn)) return J("AUTHORING_PAYLOAD_INVALID", `Host resource name must contain 1 to ${qn} code points without control characters.`, ["name"]);
|
|
1525
|
+
if (nr(e)) return J("AUTHORING_SOURCE_INVALID", "Host resource intent must not contain URLs, tokens, or headers.");
|
|
1526
|
+
let i = r(e.dataSource, { componentType: e.materialType });
|
|
1527
|
+
if (!i.ok) return J("AUTHORING_PAYLOAD_INVALID", "Host resource dataSource does not match the canonical document contract.", ["dataSource"]);
|
|
1528
|
+
let a = i.value;
|
|
1529
|
+
return a?.type === "host-resource" ? {
|
|
1530
|
+
ok: !0,
|
|
1531
|
+
value: {
|
|
1532
|
+
materialType: e.materialType,
|
|
1533
|
+
dataSource: a,
|
|
1534
|
+
...e.name === void 0 ? {} : { name: e.name }
|
|
1535
|
+
},
|
|
1536
|
+
diagnostics: []
|
|
1537
|
+
} : J("AUTHORING_PAYLOAD_INVALID", "Host resource dataSource must use type \"host-resource\".", ["dataSource", "type"]);
|
|
1538
|
+
}
|
|
1539
|
+
function Zn(e) {
|
|
1540
|
+
if (typeof e != "string" || e.length === 0) return J("AUTHORING_PAYLOAD_INVALID", "Host resource drag payload must be nonempty JSON.");
|
|
1541
|
+
if (or(e) > 8192) return J("AUTHORING_LIMIT_EXCEEDED", "Host resource drag payload exceeds its byte limit.");
|
|
1542
|
+
try {
|
|
1543
|
+
return Xn(JSON.parse(e));
|
|
1544
|
+
} catch {
|
|
1545
|
+
return J("AUTHORING_PAYLOAD_INVALID", "Host resource drag payload is not valid JSON.");
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
function Qn(e, t) {
|
|
1549
|
+
let n = Xn(t);
|
|
1550
|
+
if (!n.ok) return n;
|
|
1551
|
+
let r = JSON.stringify(n.value);
|
|
1552
|
+
if (or(r) > 8192) return J("AUTHORING_LIMIT_EXCEEDED", "Host resource drag payload exceeds 8 KiB.");
|
|
1553
|
+
try {
|
|
1554
|
+
return e.setData(Wn, r), e.effectAllowed = "copy", {
|
|
1555
|
+
ok: !0,
|
|
1556
|
+
value: null,
|
|
1557
|
+
diagnostics: []
|
|
1558
|
+
};
|
|
1559
|
+
} catch {
|
|
1560
|
+
return J("AUTHORING_PAYLOAD_INVALID", "Host resource drag payload could not be written.");
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
function $n(e, t) {
|
|
1564
|
+
return e === void 0 || e.type !== t.materialType || e.libraryVisible === !1 ? J("AUTHORING_SOURCE_INVALID", "Host resource material is not available in the configured catalog.", ["materialType"]) : e.dataCapabilities.includes("host-resource") ? {
|
|
1565
|
+
ok: !0,
|
|
1566
|
+
value: e,
|
|
1567
|
+
diagnostics: []
|
|
1568
|
+
} : J("AUTHORING_SOURCE_INVALID", "Host resource material does not declare the host-resource capability.", ["materialType"]);
|
|
1569
|
+
}
|
|
1570
|
+
function er(e, t, n, r) {
|
|
1571
|
+
return Fn(e, t, {
|
|
1572
|
+
position: In(e, t, r),
|
|
1573
|
+
...n.name === void 0 ? {} : { name: n.name },
|
|
1574
|
+
dataSource: n.dataSource
|
|
1607
1575
|
});
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
max: t.max,
|
|
1614
|
-
min: t.min,
|
|
1615
|
-
step: t.step,
|
|
1616
|
-
value: t.value
|
|
1576
|
+
}
|
|
1577
|
+
function tr(e, t, n) {
|
|
1578
|
+
return In(e, t, {
|
|
1579
|
+
x: n.x - t.defaultSize.width / 2,
|
|
1580
|
+
y: n.y - t.defaultSize.height / 2
|
|
1617
1581
|
});
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1582
|
+
}
|
|
1583
|
+
function nr(e) {
|
|
1584
|
+
return typeof e == "string" ? Yn.test(e) : Array.isArray(e) ? e.some(nr) : rr(e) ? Object.entries(e).some(([e, t]) => Jn.test(e) || nr(t)) : !1;
|
|
1585
|
+
}
|
|
1586
|
+
function rr(e) {
|
|
1587
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1588
|
+
}
|
|
1589
|
+
function ir(e, t) {
|
|
1590
|
+
return Object.keys(e).every((e) => t.has(e));
|
|
1591
|
+
}
|
|
1592
|
+
function ar(t) {
|
|
1593
|
+
try {
|
|
1594
|
+
let n = e(t, {
|
|
1595
|
+
maxBytes: Gn,
|
|
1596
|
+
maxStringBytes: Gn
|
|
1597
|
+
});
|
|
1598
|
+
return n.ok ? n : n.diagnostics.some((e) => e.code === "JSON_LIMIT_EXCEEDED") ? J("AUTHORING_LIMIT_EXCEEDED", "Host resource authoring intent exceeds its JSON limits.") : J("AUTHORING_PAYLOAD_INVALID", "Host resource authoring intent is not JSON-safe.");
|
|
1599
|
+
} catch {
|
|
1600
|
+
return J("AUTHORING_PAYLOAD_INVALID", "Host resource authoring intent is not JSON-safe.");
|
|
1631
1601
|
}
|
|
1602
|
+
}
|
|
1603
|
+
function or(e) {
|
|
1604
|
+
let t = 0;
|
|
1605
|
+
for (let n of e) {
|
|
1606
|
+
let e = n.codePointAt(0) ?? 0;
|
|
1607
|
+
t += e <= 127 ? 1 : e <= 2047 ? 2 : e <= 65535 ? 3 : 4;
|
|
1608
|
+
}
|
|
1609
|
+
return t;
|
|
1610
|
+
}
|
|
1611
|
+
function J(e, t, n = []) {
|
|
1632
1612
|
return {
|
|
1633
|
-
|
|
1634
|
-
|
|
1613
|
+
ok: !1,
|
|
1614
|
+
diagnostics: [{
|
|
1615
|
+
severity: "error",
|
|
1616
|
+
code: e,
|
|
1617
|
+
path: n,
|
|
1618
|
+
message: t
|
|
1619
|
+
}]
|
|
1635
1620
|
};
|
|
1636
1621
|
}
|
|
1637
|
-
function
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1622
|
+
function sr(e) {
|
|
1623
|
+
return s.flatMap((t) => {
|
|
1624
|
+
let n = o(e, t);
|
|
1625
|
+
return n === void 0 ? [] : [{
|
|
1626
|
+
slot: t,
|
|
1627
|
+
label: d.propertiesPanel.themeSlots[t],
|
|
1628
|
+
color: n,
|
|
1629
|
+
group: c(t) ? "status" : "theme"
|
|
1630
|
+
}];
|
|
1645
1631
|
});
|
|
1646
|
-
s.min = String(t.min), s.max = String(t.max), s.step = String(r), s.dataset.flush = "true";
|
|
1647
|
-
let c = (e, n) => {
|
|
1648
|
-
let r = Un(e, t.min, t.max);
|
|
1649
|
-
s.value = String(r), u(), n && Wn(s);
|
|
1650
|
-
}, l = () => n.getRootNode?.()?.activeElement ?? e.activeElement ?? null, u = () => {
|
|
1651
|
-
let e = Number(s.value), n = Number.isFinite(e) ? e : t.min, r = i.disabled, o = a.disabled;
|
|
1652
|
-
i.disabled = n <= t.min, a.disabled = n >= t.max, i.disabled && !r && l() === i && a.focus({ preventScroll: !0 }), a.disabled && !o && l() === a && i.focus({ preventScroll: !0 });
|
|
1653
|
-
};
|
|
1654
|
-
return i.addEventListener("click", () => c(Number(s.value) - r, !0)), a.addEventListener("click", () => c(Number(s.value) + r, !0)), s.addEventListener("input", () => {
|
|
1655
|
-
let e = Number(s.value);
|
|
1656
|
-
Number.isFinite(e) && u();
|
|
1657
|
-
}), s.addEventListener("change", () => {
|
|
1658
|
-
let e = Number(s.value);
|
|
1659
|
-
c(Number.isFinite(e) ? e : t.min, !1);
|
|
1660
|
-
}), s.addEventListener("blur", () => c(Number(s.value), !1)), n.append(i, s, a), u(), {
|
|
1661
|
-
element: n,
|
|
1662
|
-
input: s
|
|
1663
|
-
};
|
|
1664
1632
|
}
|
|
1665
|
-
function
|
|
1666
|
-
|
|
1667
|
-
|
|
1633
|
+
function cr(e, t) {
|
|
1634
|
+
return typeof e == "string" ? l(e, t) ?? e : e;
|
|
1635
|
+
}
|
|
1636
|
+
var lr = 64, Y = /* @__PURE__ */ new Map();
|
|
1637
|
+
function ur(e) {
|
|
1638
|
+
let t = [];
|
|
1639
|
+
for (let n of e) {
|
|
1640
|
+
let e = n.control === "color", r = t[t.length - 1];
|
|
1641
|
+
r !== void 0 && r.color === e ? r.fields.push(n) : t.push({
|
|
1642
|
+
color: e,
|
|
1643
|
+
fields: [n]
|
|
1644
|
+
});
|
|
1645
|
+
}
|
|
1646
|
+
return t;
|
|
1647
|
+
}
|
|
1648
|
+
function dr(e) {
|
|
1649
|
+
return e >= 3;
|
|
1668
1650
|
}
|
|
1669
|
-
function
|
|
1670
|
-
|
|
1651
|
+
function fr(e, t) {
|
|
1652
|
+
let n = Y.get(e), r = t.find((e) => e.key === n);
|
|
1653
|
+
return r === void 0 ? t[0] : r;
|
|
1654
|
+
}
|
|
1655
|
+
function pr(e, t) {
|
|
1656
|
+
for (Y.delete(e), Y.set(e, t); Y.size > lr;) {
|
|
1657
|
+
let e = Y.keys().next();
|
|
1658
|
+
if (e.done === !0) break;
|
|
1659
|
+
Y.delete(e.value);
|
|
1660
|
+
}
|
|
1671
1661
|
}
|
|
1672
|
-
function
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1662
|
+
function mr(e, t) {
|
|
1663
|
+
let n = typeof t == "string" ? t.trim() : "";
|
|
1664
|
+
n !== "" && (n.includes("gradient(") ? e.style.background = n : e.style.backgroundColor = n);
|
|
1665
|
+
}
|
|
1666
|
+
function hr(e, t) {
|
|
1667
|
+
if (!dr(t.entries.length)) return;
|
|
1668
|
+
let n = e.ownerDocument, r = n.createElement("div");
|
|
1669
|
+
r.className = "designer-color-group", r.dataset.designerColorGroup = t.groupKey;
|
|
1670
|
+
let i = n.createElement("div");
|
|
1671
|
+
i.className = "designer-color-group-band";
|
|
1672
|
+
let a = n.createElement("div");
|
|
1673
|
+
a.className = "designer-color-group-editor";
|
|
1674
|
+
let o = [], s = fr(t.groupKey, t.entries), c = () => {
|
|
1675
|
+
for (let { entry: e, card: n } of o) {
|
|
1676
|
+
let r = e.key === s?.key;
|
|
1677
|
+
n.setAttribute("aria-pressed", String(r)), r ? (delete n.dataset.inspectorSearchKind, delete n.dataset.inspectorSearchKey, delete n.dataset.inspectorSearchText) : (n.dataset.inspectorSearchKind = "field", n.dataset.inspectorSearchKey = `${t.groupKey}:${e.key}`, n.dataset.inspectorSearchText = e.label);
|
|
1678
|
+
}
|
|
1679
|
+
a.replaceChildren(), s !== void 0 && t.renderField(a, s);
|
|
1680
|
+
};
|
|
1681
|
+
for (let e of t.entries) {
|
|
1682
|
+
let r = n.createElement("button");
|
|
1683
|
+
r.type = "button", r.className = "designer-color-group-card", r.dataset.colorGroupKey = e.key;
|
|
1684
|
+
let a = n.createElement("span");
|
|
1685
|
+
a.className = "designer-color-group-swatch designer-fill-color-checkerboard", a.setAttribute("aria-hidden", "true");
|
|
1686
|
+
let l = n.createElement("span");
|
|
1687
|
+
l.className = "designer-color-group-fill", l.setAttribute("aria-hidden", "true"), mr(l, e.value), a.append(l);
|
|
1688
|
+
let u = n.createElement("span");
|
|
1689
|
+
u.className = "designer-color-group-name", u.textContent = e.label, r.append(a, u), r.addEventListener("click", () => {
|
|
1690
|
+
s = e, pr(t.groupKey, e.key), c();
|
|
1691
|
+
}), i.append(r), o.push({
|
|
1692
|
+
entry: e,
|
|
1693
|
+
card: r
|
|
1694
|
+
});
|
|
1695
|
+
}
|
|
1696
|
+
r.append(i, a), e.append(r), c();
|
|
1677
1697
|
}
|
|
1678
|
-
function
|
|
1679
|
-
let
|
|
1680
|
-
if (
|
|
1681
|
-
let i = typeof r == "number" && Number.isFinite(r) ? r : Number(r), a = t.min ?? (n?.kind === "number" ? n.minimum : void 0) ?? 0, o = t.max ?? (n?.kind === "number" ? n.maximum : void 0) ?? 100, s =
|
|
1698
|
+
function gr(e, t, n, r, i, a) {
|
|
1699
|
+
let o = t.control;
|
|
1700
|
+
if (o === "stepper") {
|
|
1701
|
+
let i = typeof r == "number" && Number.isFinite(r) ? r : Number(r), a = t.min ?? (n?.kind === "number" ? n.minimum : void 0) ?? 0, o = t.max ?? (n?.kind === "number" ? n.maximum : void 0) ?? 100, s = g(e, {
|
|
1682
1702
|
value: Number.isFinite(i) ? i : a,
|
|
1683
1703
|
min: a,
|
|
1684
1704
|
max: o,
|
|
@@ -1690,8 +1710,8 @@ function Gn(e, t, n, r, i) {
|
|
|
1690
1710
|
valueTarget: s.input
|
|
1691
1711
|
};
|
|
1692
1712
|
}
|
|
1693
|
-
if (
|
|
1694
|
-
let n =
|
|
1713
|
+
if (o === "boolean") {
|
|
1714
|
+
let n = k(e, {
|
|
1695
1715
|
ariaLabel: t.label,
|
|
1696
1716
|
checked: r === !0
|
|
1697
1717
|
});
|
|
@@ -1700,19 +1720,62 @@ function Gn(e, t, n, r, i) {
|
|
|
1700
1720
|
valueTarget: n
|
|
1701
1721
|
};
|
|
1702
1722
|
}
|
|
1703
|
-
|
|
1704
|
-
|
|
1723
|
+
let s = n?.kind === "enum" && y(n.values);
|
|
1724
|
+
if ((o === "segmented" || o === "select" && s) && n?.kind === "enum") {
|
|
1725
|
+
let i = n.values.some((e) => e === r) ? String(r) : String(n.values[0]), a = w(e, {
|
|
1726
|
+
ariaLabel: t.label,
|
|
1727
|
+
className: "designer-segmented-native",
|
|
1728
|
+
options: n.values.map((e) => ({
|
|
1729
|
+
label: String(e),
|
|
1730
|
+
selected: String(e) === i,
|
|
1731
|
+
value: String(e)
|
|
1732
|
+
})),
|
|
1733
|
+
value: i
|
|
1734
|
+
}), o = f(e, {
|
|
1735
|
+
ariaLabel: t.label,
|
|
1736
|
+
selection: "radio",
|
|
1737
|
+
selected: i,
|
|
1738
|
+
options: n.values.map((e) => {
|
|
1739
|
+
let t = s ? x[String(e)] : void 0;
|
|
1740
|
+
return {
|
|
1741
|
+
value: String(e),
|
|
1742
|
+
label: String(e),
|
|
1743
|
+
...t === void 0 ? {} : {
|
|
1744
|
+
icon: t,
|
|
1745
|
+
ariaLabel: String(e)
|
|
1746
|
+
}
|
|
1747
|
+
};
|
|
1748
|
+
})
|
|
1749
|
+
});
|
|
1750
|
+
for (let [e, t] of o.buttons) t.addEventListener("click", () => {
|
|
1751
|
+
if (a.value !== e) {
|
|
1752
|
+
a.value = e;
|
|
1753
|
+
for (let [t, n] of o.buttons) n.ariaChecked = String(t === e), n.tabIndex = t === e ? 0 : -1;
|
|
1754
|
+
a.dispatchEvent(new Event("change", {
|
|
1755
|
+
bubbles: !0,
|
|
1756
|
+
composed: !0
|
|
1757
|
+
}));
|
|
1758
|
+
}
|
|
1759
|
+
});
|
|
1760
|
+
let c = e.createElement("span");
|
|
1761
|
+
return c.className = "designer-descriptor-segmented", c.append(o.element, a), {
|
|
1762
|
+
element: c,
|
|
1763
|
+
valueTarget: a
|
|
1764
|
+
};
|
|
1765
|
+
}
|
|
1766
|
+
if (o === "select" && n?.kind === "enum") {
|
|
1767
|
+
let t = w(e, { options: n.values.map((e) => ({
|
|
1705
1768
|
label: String(e),
|
|
1706
1769
|
selected: r === e,
|
|
1707
1770
|
value: String(e)
|
|
1708
1771
|
})) });
|
|
1709
1772
|
return {
|
|
1710
|
-
element:
|
|
1773
|
+
element: D(t).element,
|
|
1711
1774
|
valueTarget: t
|
|
1712
1775
|
};
|
|
1713
1776
|
}
|
|
1714
|
-
if (
|
|
1715
|
-
let t =
|
|
1777
|
+
if (o === "color") {
|
|
1778
|
+
let t = p(e, {
|
|
1716
1779
|
appearance: "color",
|
|
1717
1780
|
value: typeof r == "string" ? r : ""
|
|
1718
1781
|
});
|
|
@@ -1721,19 +1784,19 @@ function Gn(e, t, n, r, i) {
|
|
|
1721
1784
|
valueTarget: t
|
|
1722
1785
|
};
|
|
1723
1786
|
}
|
|
1724
|
-
if (
|
|
1725
|
-
let t =
|
|
1787
|
+
if (o === "json") {
|
|
1788
|
+
let t = b(e);
|
|
1726
1789
|
return t.value = JSON.stringify(r), {
|
|
1727
1790
|
element: t,
|
|
1728
1791
|
valueTarget: t
|
|
1729
1792
|
};
|
|
1730
1793
|
}
|
|
1731
|
-
if (
|
|
1794
|
+
if (o === "field-selector") {
|
|
1732
1795
|
if (i.length > 0) {
|
|
1733
|
-
let n =
|
|
1796
|
+
let n = w(e, {
|
|
1734
1797
|
ariaLabel: t.label,
|
|
1735
1798
|
options: [{
|
|
1736
|
-
label:
|
|
1799
|
+
label: d.descriptor.noField,
|
|
1737
1800
|
selected: r === void 0 || r === "",
|
|
1738
1801
|
value: ""
|
|
1739
1802
|
}, ...i.map((e) => ({
|
|
@@ -1743,49 +1806,225 @@ function Gn(e, t, n, r, i) {
|
|
|
1743
1806
|
}))]
|
|
1744
1807
|
});
|
|
1745
1808
|
return {
|
|
1746
|
-
element:
|
|
1809
|
+
element: D(n).element,
|
|
1747
1810
|
valueTarget: n
|
|
1748
1811
|
};
|
|
1749
1812
|
}
|
|
1750
|
-
let n =
|
|
1813
|
+
let n = p(e, { value: typeof r == "string" ? r : "" });
|
|
1751
1814
|
return {
|
|
1752
1815
|
element: n,
|
|
1753
1816
|
valueTarget: n
|
|
1754
1817
|
};
|
|
1755
1818
|
}
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
...
|
|
1760
|
-
...
|
|
1819
|
+
if (o === "spacing") return wr(e, t, n, r, a);
|
|
1820
|
+
let c = o === "number" || o === "unit-number", l = p(e, {
|
|
1821
|
+
appearance: c ? "number" : "text",
|
|
1822
|
+
...c && t.max !== void 0 ? { max: t.max } : {},
|
|
1823
|
+
...c && t.min !== void 0 ? { min: t.min } : {},
|
|
1824
|
+
...c && t.step !== void 0 ? { step: t.step } : {},
|
|
1761
1825
|
value: String(r ?? "")
|
|
1762
1826
|
});
|
|
1827
|
+
if (c && t.unit !== void 0 && t.unit !== "") {
|
|
1828
|
+
let n = e.createElement("span");
|
|
1829
|
+
n.className = "designer-unit-input";
|
|
1830
|
+
let r = e.createElement("span");
|
|
1831
|
+
return r.className = "designer-unit-input-suffix", r.setAttribute("aria-hidden", "true"), r.textContent = t.unit, n.append(l, r), {
|
|
1832
|
+
element: n,
|
|
1833
|
+
valueTarget: l
|
|
1834
|
+
};
|
|
1835
|
+
}
|
|
1763
1836
|
return {
|
|
1764
|
-
element:
|
|
1765
|
-
valueTarget:
|
|
1837
|
+
element: l,
|
|
1838
|
+
valueTarget: l
|
|
1839
|
+
};
|
|
1840
|
+
}
|
|
1841
|
+
function _r(e, t, n, r) {
|
|
1842
|
+
if (t.control !== "number") return;
|
|
1843
|
+
let i = t.min ?? (n?.kind === "number" ? n.minimum : void 0), a = t.max ?? (n?.kind === "number" ? n.maximum : void 0);
|
|
1844
|
+
if (i === void 0 || a === void 0 || !E(i, a)) return;
|
|
1845
|
+
let o = typeof r != "number" || !Number.isFinite(r), s = o ? i : r, c = t.step ?? (Number.isInteger(i) && Number.isInteger(a) ? 1 : .01), l = m(e, {
|
|
1846
|
+
ariaLabel: t.label,
|
|
1847
|
+
min: i,
|
|
1848
|
+
max: a,
|
|
1849
|
+
step: c,
|
|
1850
|
+
value: o ? "" : String(s),
|
|
1851
|
+
rangeValue: String(s),
|
|
1852
|
+
numberClassName: "designer-field-range-value",
|
|
1853
|
+
...o ? {
|
|
1854
|
+
placeholder: d.inspectorUi.autoValue,
|
|
1855
|
+
empty: !0
|
|
1856
|
+
} : {},
|
|
1857
|
+
forwardRangeChange: !0
|
|
1858
|
+
});
|
|
1859
|
+
if (t.unit === void 0 || t.unit === "") return {
|
|
1860
|
+
element: l.range,
|
|
1861
|
+
trailing: l.number,
|
|
1862
|
+
valueTarget: l.number
|
|
1863
|
+
};
|
|
1864
|
+
let u = e.createElement("label");
|
|
1865
|
+
return u.className = "designer-geo-field designer-field-range-reading", u.dataset.symbol = t.unit, u.appendChild(l.number), {
|
|
1866
|
+
element: l.range,
|
|
1867
|
+
trailing: u,
|
|
1868
|
+
valueTarget: l.number
|
|
1766
1869
|
};
|
|
1767
1870
|
}
|
|
1768
|
-
|
|
1871
|
+
var vr = [
|
|
1872
|
+
"top",
|
|
1873
|
+
"right",
|
|
1874
|
+
"bottom",
|
|
1875
|
+
"left"
|
|
1876
|
+
], yr = 64, X = /* @__PURE__ */ new Map();
|
|
1877
|
+
function br(e) {
|
|
1878
|
+
let t = typeof e == "object" && e && !Array.isArray(e) ? e : {}, n = (e) => {
|
|
1879
|
+
let n = t[e];
|
|
1880
|
+
return typeof n == "number" && Number.isFinite(n) ? n : 0;
|
|
1881
|
+
};
|
|
1882
|
+
return {
|
|
1883
|
+
top: n("top"),
|
|
1884
|
+
right: n("right"),
|
|
1885
|
+
bottom: n("bottom"),
|
|
1886
|
+
left: n("left")
|
|
1887
|
+
};
|
|
1888
|
+
}
|
|
1889
|
+
function xr(e) {
|
|
1890
|
+
return e.top === e.right && e.right === e.bottom && e.bottom === e.left;
|
|
1891
|
+
}
|
|
1892
|
+
function Sr(e, t) {
|
|
1893
|
+
if (e !== void 0) {
|
|
1894
|
+
let t = X.get(e);
|
|
1895
|
+
if (t !== void 0) return t;
|
|
1896
|
+
}
|
|
1897
|
+
return xr(t);
|
|
1898
|
+
}
|
|
1899
|
+
function Cr(e, t) {
|
|
1900
|
+
if (e !== void 0) for (X.delete(e), X.set(e, t); X.size > yr;) {
|
|
1901
|
+
let e = X.keys().next();
|
|
1902
|
+
if (e.done === !0) break;
|
|
1903
|
+
X.delete(e.value);
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1906
|
+
function wr(e, t, n, r, i) {
|
|
1907
|
+
let a = br(r), o = Sr(i, a), s = e.createElement("div");
|
|
1908
|
+
s.className = "designer-spacing-scope", s.setAttribute("role", "group"), s.setAttribute("aria-label", t.label);
|
|
1909
|
+
let c = e.createElement("div");
|
|
1910
|
+
c.className = "designer-spacing-frame";
|
|
1911
|
+
let l = e.createElement("div");
|
|
1912
|
+
l.className = "designer-spacing", c.appendChild(l);
|
|
1913
|
+
let u = p(e, { type: "hidden" }), f = e.createElement("button");
|
|
1914
|
+
f.type = "button", f.className = "designer-spacing-toggle";
|
|
1915
|
+
let m = t.unit === void 0 || t.unit === "" ? void 0 : e.createElement("span");
|
|
1916
|
+
m !== void 0 && (m.className = "designer-spacing-unit", m.setAttribute("aria-hidden", "true"), m.textContent = t.unit ?? "");
|
|
1917
|
+
let h = (e) => {
|
|
1918
|
+
let r = n?.kind === "object" ? n.properties[e] : void 0;
|
|
1919
|
+
return {
|
|
1920
|
+
minimum: t.min ?? (r?.kind === "number" ? r.minimum : void 0) ?? 0,
|
|
1921
|
+
maximum: t.max ?? (r?.kind === "number" ? r.maximum : void 0)
|
|
1922
|
+
};
|
|
1923
|
+
}, g = () => {
|
|
1924
|
+
u.value = JSON.stringify(a);
|
|
1925
|
+
}, _ = () => {
|
|
1926
|
+
g(), u.dispatchEvent(new Event("change", {
|
|
1927
|
+
bubbles: !0,
|
|
1928
|
+
composed: !0
|
|
1929
|
+
}));
|
|
1930
|
+
}, v = (n, r) => {
|
|
1931
|
+
let i = h(n), o = p(e, {
|
|
1932
|
+
appearance: "number",
|
|
1933
|
+
ariaLabel: r.ariaLabel,
|
|
1934
|
+
value: String(a[n]),
|
|
1935
|
+
min: i.minimum,
|
|
1936
|
+
...i.maximum === void 0 ? {} : { max: i.maximum },
|
|
1937
|
+
...t.step === void 0 ? {} : { step: t.step }
|
|
1938
|
+
});
|
|
1939
|
+
return o.className += " designer-spacing-input", o.dataset.inspectorSearchKey = `descriptor-field-${t.id}-${r.key}`, o.addEventListener("input", () => {
|
|
1940
|
+
let e = Number(o.value);
|
|
1941
|
+
Number.isFinite(e) && (r.linked ? a = {
|
|
1942
|
+
top: e,
|
|
1943
|
+
right: e,
|
|
1944
|
+
bottom: e,
|
|
1945
|
+
left: e
|
|
1946
|
+
} : a[n] = e, g());
|
|
1947
|
+
}), o.addEventListener("change", () => {
|
|
1948
|
+
let e = Number(o.value), t = Math.min(Math.max(Number.isFinite(e) ? e : 0, i.minimum), i.maximum ?? Infinity);
|
|
1949
|
+
r.linked ? a = {
|
|
1950
|
+
top: t,
|
|
1951
|
+
right: t,
|
|
1952
|
+
bottom: t,
|
|
1953
|
+
left: t
|
|
1954
|
+
} : a[n] = t, o.value = String(t), _();
|
|
1955
|
+
}), o;
|
|
1956
|
+
}, y = () => {
|
|
1957
|
+
for (let t of vr) {
|
|
1958
|
+
let n = d.descriptor.spacingSides[t], r = e.createElement("label");
|
|
1959
|
+
r.className = `designer-spacing-cell designer-spacing-cell-${t}`;
|
|
1960
|
+
let i = e.createElement("span");
|
|
1961
|
+
i.className = "designer-spacing-dir", i.setAttribute("aria-hidden", "true"), i.textContent = n.short, r.append(i, v(t, {
|
|
1962
|
+
key: t,
|
|
1963
|
+
ariaLabel: n.label,
|
|
1964
|
+
linked: !1
|
|
1965
|
+
})), l.appendChild(r);
|
|
1966
|
+
}
|
|
1967
|
+
}, b = () => {
|
|
1968
|
+
let n = d.descriptor, r = e.createElement("label");
|
|
1969
|
+
r.className = "designer-spacing-cell designer-spacing-cell-all";
|
|
1970
|
+
let i = e.createElement("span");
|
|
1971
|
+
i.className = "designer-spacing-dir", i.setAttribute("aria-hidden", "true"), i.textContent = n.spacingAllSides, r.append(i, v("top", {
|
|
1972
|
+
key: "all",
|
|
1973
|
+
ariaLabel: `${t.label} ${n.spacingAllSides}`,
|
|
1974
|
+
linked: !0
|
|
1975
|
+
})), l.appendChild(r);
|
|
1976
|
+
}, x = () => {
|
|
1977
|
+
l.dataset.spacingMode = o ? "linked" : "split", f.setAttribute("aria-pressed", String(o)), f.setAttribute("aria-label", o ? d.descriptor.spacingUnlink : d.descriptor.spacingLink), f.dataset.tip = o ? d.descriptor.spacingUnlink : d.descriptor.spacingLinkHint, f.innerHTML = S(o ? "link" : "unlink"), l.replaceChildren(), o ? b() : y(), g();
|
|
1978
|
+
};
|
|
1979
|
+
return f.addEventListener("click", () => {
|
|
1980
|
+
if (o) {
|
|
1981
|
+
o = !1, Cr(i, !1), x();
|
|
1982
|
+
return;
|
|
1983
|
+
}
|
|
1984
|
+
let e = a.top;
|
|
1985
|
+
a = {
|
|
1986
|
+
top: e,
|
|
1987
|
+
right: e,
|
|
1988
|
+
bottom: e,
|
|
1989
|
+
left: e
|
|
1990
|
+
}, o = !0, Cr(i, !0), x(), _();
|
|
1991
|
+
}), s.append(c, ...m === void 0 ? [] : [m], u), x(), {
|
|
1992
|
+
element: s,
|
|
1993
|
+
valueTarget: u,
|
|
1994
|
+
labelAction: f
|
|
1995
|
+
};
|
|
1996
|
+
}
|
|
1997
|
+
function Tr(e, t) {
|
|
1769
1998
|
let n = e.target === "interaction" ? e.projection ?? "props" : e.target, r = n === "props" ? t.manifest.propsSchema : n === "style" ? t.manifest.styleSchema : void 0;
|
|
1770
|
-
return r === void 0 ? void 0 :
|
|
1999
|
+
return r === void 0 ? void 0 : ne(e.path, r);
|
|
1771
2000
|
}
|
|
1772
|
-
function
|
|
2001
|
+
function Er(e, t) {
|
|
1773
2002
|
e.dataset.descriptorFieldId = t.id, e.dataset.descriptorTarget = t.target, e.dataset.descriptorPath = JSON.stringify(t.path), e.dataset.descriptorControl = t.control, t.projection !== void 0 && (e.dataset.descriptorProjection = t.projection);
|
|
2003
|
+
let n = Dr(t);
|
|
2004
|
+
n !== void 0 && (n.target === "props" ? e.dataset.prop = n.name : e.dataset.style = n.name);
|
|
2005
|
+
}
|
|
2006
|
+
function Dr(e) {
|
|
2007
|
+
let t = e.target === "interaction" ? e.projection : e.target;
|
|
2008
|
+
if ((t === "props" || t === "style") && e.path.length === 1 && typeof e.path[0] == "string") return {
|
|
2009
|
+
target: t,
|
|
2010
|
+
name: e.path[0]
|
|
2011
|
+
};
|
|
1774
2012
|
}
|
|
1775
|
-
function
|
|
2013
|
+
function Or(e) {
|
|
1776
2014
|
let t = e.document?.components.find((t) => t.id === e.interaction.focusedComponentId), n = t === void 0 ? void 0 : e.catalog?.get(t.type)?.manifest;
|
|
1777
2015
|
return t === void 0 || n === void 0 ? void 0 : {
|
|
1778
2016
|
component: t,
|
|
1779
2017
|
manifest: n,
|
|
1780
2018
|
datasetFields: e.getDatasetFields?.() ?? [],
|
|
1781
|
-
inspectorControls: e.inspectorControls
|
|
2019
|
+
inspectorControls: e.inspectorControls,
|
|
2020
|
+
theme: e.document?.theme
|
|
1782
2021
|
};
|
|
1783
2022
|
}
|
|
1784
|
-
function
|
|
1785
|
-
return e.when === void 0 || e.when.length === 0 || e.when.every((n) =>
|
|
2023
|
+
function kr(e, t) {
|
|
2024
|
+
return e.when === void 0 || e.when.length === 0 || e.when.every((n) => Ar(n, e, t));
|
|
1786
2025
|
}
|
|
1787
|
-
function
|
|
1788
|
-
let r = Z(t, e.path, n), i = r !== void 0;
|
|
2026
|
+
function Ar(e, t, n) {
|
|
2027
|
+
let r = e.target === "props" ? Mr(n.component.props, e.path) : e.target === "style" ? Mr(n.component.style, e.path) : Z(t, e.path, n), i = r !== void 0;
|
|
1789
2028
|
switch (e.operator) {
|
|
1790
2029
|
case "exists": return i;
|
|
1791
2030
|
case "not-exists": return !i;
|
|
@@ -1797,9 +2036,9 @@ function Xn(e, t, n) {
|
|
|
1797
2036
|
}
|
|
1798
2037
|
function Z(e, t, n) {
|
|
1799
2038
|
let r = e.target === "interaction" ? e.projection ?? "props" : e.target;
|
|
1800
|
-
return r === "props" ?
|
|
2039
|
+
return r === "props" ? Mr(n.component.props, t) : r === "style" ? Mr(n.component.style, t) : jr(n.component.dataSource, t);
|
|
1801
2040
|
}
|
|
1802
|
-
function
|
|
2041
|
+
function jr(e, t) {
|
|
1803
2042
|
let n = t[0];
|
|
1804
2043
|
if (n === "params") {
|
|
1805
2044
|
let n = e?.type === "host-resource" || e?.type === "dataset" ? e.params[String(t[1])] : void 0;
|
|
@@ -1814,7 +2053,7 @@ function Zn(e, t) {
|
|
|
1814
2053
|
return typeof a == "number" ? i[a] : i;
|
|
1815
2054
|
}
|
|
1816
2055
|
}
|
|
1817
|
-
function
|
|
2056
|
+
function Mr(e, t) {
|
|
1818
2057
|
if (e === void 0) return;
|
|
1819
2058
|
let n = e;
|
|
1820
2059
|
for (let e of t) {
|
|
@@ -1829,42 +2068,42 @@ function Qn(e, t) {
|
|
|
1829
2068
|
}
|
|
1830
2069
|
return n;
|
|
1831
2070
|
}
|
|
1832
|
-
function
|
|
1833
|
-
return
|
|
2071
|
+
function Nr(e, t) {
|
|
2072
|
+
return Tr(e, t);
|
|
1834
2073
|
}
|
|
1835
|
-
function
|
|
2074
|
+
function Pr(e, t, n) {
|
|
1836
2075
|
let r = e.ownerDocument, i = r.createElement("div");
|
|
1837
2076
|
i.className = "designer-descriptor-array";
|
|
1838
|
-
let a =
|
|
2077
|
+
let a = C(r, {
|
|
1839
2078
|
label: t.label,
|
|
1840
2079
|
tagName: "span"
|
|
1841
2080
|
});
|
|
1842
2081
|
i.appendChild(a);
|
|
1843
2082
|
let o = r.createElement("ol");
|
|
1844
2083
|
o.className = "designer-descriptor-array-list";
|
|
1845
|
-
let s = Z(t, t.path, n), c = Array.isArray(s) ? s : [],
|
|
2084
|
+
let s = Z(t, t.path, n), c = Array.isArray(s) ? s : [], l = Nr(t, n), u = l?.kind === "array" ? l.maxItems : void 0;
|
|
1846
2085
|
for (let e = 0; e < c.length; e++) {
|
|
1847
2086
|
let i = r.createElement("li");
|
|
1848
2087
|
i.className = "designer-descriptor-array-item";
|
|
1849
|
-
let a =
|
|
1850
|
-
if (t.itemFields !== void 0 && a) for (let r of t.itemFields)
|
|
1851
|
-
else
|
|
2088
|
+
let a = Ir(c[e]);
|
|
2089
|
+
if (t.itemFields !== void 0 && a) for (let r of t.itemFields) Lr(i, t, r, e, n);
|
|
2090
|
+
else Lr(i, t, {
|
|
1852
2091
|
id: t.id,
|
|
1853
2092
|
target: t.target,
|
|
1854
2093
|
...t.projection === void 0 ? {} : { projection: t.projection },
|
|
1855
2094
|
path: [e],
|
|
1856
|
-
label: t.itemLabel ??
|
|
1857
|
-
control:
|
|
2095
|
+
label: t.itemLabel ?? d.descriptor.item(e + 1),
|
|
2096
|
+
control: Fr(l)
|
|
1858
2097
|
}, e, n);
|
|
1859
2098
|
let s = r.createElement("span");
|
|
1860
|
-
s.className = "designer-descriptor-array-actions", t.control === "reorderable-array" && (s.appendChild(
|
|
2099
|
+
s.className = "designer-descriptor-array-actions", t.control === "reorderable-array" && (s.appendChild(Br(r, d.descriptor.moveUp, "move-up", t, e, e === 0)), s.appendChild(Br(r, d.descriptor.moveDown, "move-down", t, e, e === c.length - 1))), s.appendChild(Br(r, d.descriptor.removeItem, "remove", t, e, t.control === "array")), i.appendChild(s), o.appendChild(i);
|
|
1861
2100
|
}
|
|
1862
2101
|
i.appendChild(o);
|
|
1863
|
-
let f =
|
|
1864
|
-
i.appendChild(
|
|
2102
|
+
let f = u === void 0 || c.length < u;
|
|
2103
|
+
i.appendChild(Br(r, d.descriptor.addItem, "add", t, c.length, !f)), e.appendChild(i);
|
|
1865
2104
|
}
|
|
1866
|
-
function
|
|
1867
|
-
if (e?.kind === "array") return
|
|
2105
|
+
function Fr(e) {
|
|
2106
|
+
if (e?.kind === "array") return Fr(e.items);
|
|
1868
2107
|
switch (e?.kind) {
|
|
1869
2108
|
case "number": return "number";
|
|
1870
2109
|
case "boolean": return "boolean";
|
|
@@ -1873,41 +2112,41 @@ function tr(e) {
|
|
|
1873
2112
|
default: return "text";
|
|
1874
2113
|
}
|
|
1875
2114
|
}
|
|
1876
|
-
function
|
|
2115
|
+
function Ir(e) {
|
|
1877
2116
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1878
2117
|
}
|
|
1879
|
-
function
|
|
1880
|
-
let a = e.ownerDocument, o =
|
|
2118
|
+
function Lr(e, t, n, r, i) {
|
|
2119
|
+
let a = e.ownerDocument, o = C(a, {
|
|
1881
2120
|
label: n.label,
|
|
1882
2121
|
...n.control === "color" ? { tagName: "span" } : {}
|
|
1883
|
-
}), s =
|
|
2122
|
+
}), s = Rr(i, t, r, n.path), c = gr(a, n, zr(t, n, i), s, i.datasetFields), l = c.valueTarget;
|
|
1884
2123
|
l.dataset.descriptorFieldId = n.id, l.dataset.descriptorTarget = n.target, l.dataset.descriptorPath = JSON.stringify([
|
|
1885
2124
|
...t.path,
|
|
1886
2125
|
r,
|
|
1887
2126
|
...n.path
|
|
1888
|
-
]), l.dataset.descriptorControl = n.control, o.appendChild(c.element),
|
|
2127
|
+
]), l.dataset.descriptorControl = n.control, o.appendChild(c.element), u(o, l, `descriptor-${t.id}-${r}-${n.id}`), e.appendChild(o);
|
|
1889
2128
|
}
|
|
1890
|
-
function
|
|
2129
|
+
function Rr(e, t, n, r) {
|
|
1891
2130
|
let i = Z(t, t.path, e);
|
|
1892
2131
|
if (!Array.isArray(i)) return;
|
|
1893
2132
|
let a = i[n];
|
|
1894
|
-
if (!(typeof a != "object" || !a || Array.isArray(a))) return
|
|
2133
|
+
if (!(typeof a != "object" || !a || Array.isArray(a))) return Mr(a, r);
|
|
1895
2134
|
}
|
|
1896
|
-
function
|
|
1897
|
-
let r =
|
|
2135
|
+
function zr(e, t, n) {
|
|
2136
|
+
let r = Nr(e, n);
|
|
1898
2137
|
if (r?.kind !== "array") return;
|
|
1899
2138
|
let i = r.items;
|
|
1900
|
-
return i.kind === "object" ?
|
|
2139
|
+
return i.kind === "object" ? ne(t.path, i) : i;
|
|
1901
2140
|
}
|
|
1902
|
-
function
|
|
1903
|
-
let o =
|
|
2141
|
+
function Br(e, t, n, r, i, a) {
|
|
2142
|
+
let o = h(e, {
|
|
1904
2143
|
disabled: a,
|
|
1905
2144
|
text: t
|
|
1906
2145
|
});
|
|
1907
2146
|
return o.dataset.descriptorArrayPath = JSON.stringify(r.path), o.dataset.descriptorArrayAction = n, o.dataset.descriptorArrayIndex = String(i), o.dataset.descriptorFieldId = r.id, o;
|
|
1908
2147
|
}
|
|
1909
|
-
function
|
|
1910
|
-
let r = e.ownerDocument, i =
|
|
2148
|
+
function Vr(e, t, n) {
|
|
2149
|
+
let r = e.ownerDocument, i = C(r, {
|
|
1911
2150
|
label: t.label,
|
|
1912
2151
|
tagName: "span"
|
|
1913
2152
|
});
|
|
@@ -1915,13 +2154,13 @@ function sr(e, t, n) {
|
|
|
1915
2154
|
let a = t.tagName === void 0 ? void 0 : n.inspectorControls?.getByTagName(t.tagName);
|
|
1916
2155
|
if (a === void 0) {
|
|
1917
2156
|
let n = r.createElement("span");
|
|
1918
|
-
n.className = "designer-descriptor-unsupported", n.dataset.descriptorUnsupported = t.id, n.textContent =
|
|
2157
|
+
n.className = "designer-descriptor-unsupported", n.dataset.descriptorUnsupported = t.id, n.textContent = d.descriptor.unsupportedControl;
|
|
1919
2158
|
let a = r.createElement("span");
|
|
1920
2159
|
a.className = "designer-field-control", a.appendChild(n), i.appendChild(a), e.appendChild(i);
|
|
1921
2160
|
return;
|
|
1922
2161
|
}
|
|
1923
2162
|
let o = new a.constructor();
|
|
1924
|
-
o.dataset.descriptorCustomOwner = a.pluginId,
|
|
2163
|
+
o.dataset.descriptorCustomOwner = a.pluginId, Er(o, t), o.model = {
|
|
1925
2164
|
value: Z(t, t.path, n),
|
|
1926
2165
|
componentId: n.component.id,
|
|
1927
2166
|
componentType: n.component.type,
|
|
@@ -1935,7 +2174,7 @@ function sr(e, t, n) {
|
|
|
1935
2174
|
}
|
|
1936
2175
|
e.appendChild(i);
|
|
1937
2176
|
}
|
|
1938
|
-
function
|
|
2177
|
+
function Hr(e, t, n) {
|
|
1939
2178
|
let r = e.ownerDocument, i = r.createElement("section");
|
|
1940
2179
|
i.className = "designer-inspector-section", i.dataset.inspectorSearchKind = "section", i.dataset.inspectorSearchKey = `descriptor-section-${t.id}`, i.dataset.inspectorSearchText = `${t.label} ${t.help ?? ""}`, i.dataset.inspectorPreferenceContext = n.component.type, t.advanced === !0 && (i.dataset.inspectorAdvanced = "true");
|
|
1941
2180
|
let a = r.createElement("details");
|
|
@@ -1943,79 +2182,136 @@ function cr(e, t, n) {
|
|
|
1943
2182
|
let o = r.createElement("summary");
|
|
1944
2183
|
o.className = "designer-descriptor-group-summary", o.textContent = t.label;
|
|
1945
2184
|
let s = r.createElement("span");
|
|
1946
|
-
if (s.className = "designer-panel-section-disclosure designer-inspector-section-disclosure", s.innerHTML =
|
|
2185
|
+
if (s.className = "designer-panel-section-disclosure designer-inspector-section-disclosure", s.innerHTML = S("chevron-down"), o.appendChild(s), a.appendChild(o), t.help !== void 0) {
|
|
1947
2186
|
let e = r.createElement("p");
|
|
1948
2187
|
e.className = "designer-descriptor-help", e.textContent = t.help, a.appendChild(e);
|
|
1949
2188
|
}
|
|
1950
|
-
let
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
2189
|
+
let c = r.createElement("div");
|
|
2190
|
+
c.className = "designer-descriptor-fields", Ur(c, t.fields.filter((e) => kr(e, n)), n, `${n.component.id}:${t.id}`), a.appendChild(c), i.appendChild(a), e.appendChild(i);
|
|
2191
|
+
}
|
|
2192
|
+
function Ur(e, t, n, r) {
|
|
2193
|
+
for (let i of ur(t)) {
|
|
2194
|
+
if (i.color && dr(i.fields.length)) {
|
|
2195
|
+
hr(e, {
|
|
2196
|
+
groupKey: r,
|
|
2197
|
+
entries: i.fields.map((e) => ({
|
|
2198
|
+
key: e.id,
|
|
2199
|
+
label: e.label,
|
|
2200
|
+
value: cr(Z(e, e.path, n), n.theme)
|
|
2201
|
+
})),
|
|
2202
|
+
renderField: (e, t) => {
|
|
2203
|
+
let r = i.fields.find((e) => e.id === t.key);
|
|
2204
|
+
r !== void 0 && Wr(e, r, n);
|
|
2205
|
+
}
|
|
2206
|
+
});
|
|
2207
|
+
continue;
|
|
2208
|
+
}
|
|
2209
|
+
for (let t of i.fields) Wr(e, t, n);
|
|
2210
|
+
}
|
|
1954
2211
|
}
|
|
1955
|
-
function
|
|
2212
|
+
function Wr(e, t, n) {
|
|
1956
2213
|
if (t.control === "group") {
|
|
1957
|
-
|
|
2214
|
+
Yr(e, t, n);
|
|
1958
2215
|
return;
|
|
1959
2216
|
}
|
|
1960
2217
|
if (t.control === "custom") {
|
|
1961
|
-
|
|
2218
|
+
Vr(e, t, n);
|
|
1962
2219
|
return;
|
|
1963
2220
|
}
|
|
1964
2221
|
if (t.control === "array" || t.control === "repeatable-array" || t.control === "reorderable-array") {
|
|
1965
|
-
|
|
2222
|
+
Pr(e, t, n);
|
|
2223
|
+
return;
|
|
2224
|
+
}
|
|
2225
|
+
let r = Tr(t, n), i = Z(t, t.path, n), a = e.ownerDocument;
|
|
2226
|
+
if (t.control === "boolean") {
|
|
2227
|
+
Kr(e, t, i === !0);
|
|
1966
2228
|
return;
|
|
1967
2229
|
}
|
|
1968
|
-
let
|
|
2230
|
+
let o = t.control === "color" ? _n(a, typeof i == "string" ? i : void 0, `${n.component.id}:descriptor:${t.id}`, {
|
|
2231
|
+
allowGradient: t.allowGradient === !0,
|
|
2232
|
+
...Qr(t) ? { themeSlots: sr(n.theme) } : {}
|
|
2233
|
+
}) : void 0, s = o !== void 0 || t.control === "json", c = Gr(t, i, n), l = c !== void 0, { field: d, control: f, labelText: p } = v(a, {
|
|
1969
2234
|
label: t.label,
|
|
1970
|
-
tagName: o === void 0 ? "label" : "span",
|
|
2235
|
+
tagName: o === void 0 && t.control !== "spacing" && !l ? "label" : "span",
|
|
1971
2236
|
stacked: s
|
|
1972
2237
|
});
|
|
1973
|
-
|
|
1974
|
-
let
|
|
1975
|
-
if (
|
|
1976
|
-
for (let e of o.controls) qn(e, t);
|
|
1977
|
-
l.appendChild(o.element);
|
|
1978
|
-
} else qn(u.valueTarget, t), l.appendChild(u.element);
|
|
1979
|
-
if (t.help !== void 0) {
|
|
2238
|
+
qr(d, t);
|
|
2239
|
+
let m = o === void 0 ? _r(a, t, r, i) ?? gr(a, t, r, i, n.datasetFields, `${n.component.id}:descriptor:${t.id}`) : void 0;
|
|
2240
|
+
if (m?.labelAction !== void 0) {
|
|
1980
2241
|
let e = a.createElement("span");
|
|
1981
|
-
e.className = "designer-
|
|
2242
|
+
e.className = "designer-spacing-label-text", e.textContent = t.label, p.className += " designer-spacing-label", p.textContent = "", p.append(e, m.labelAction);
|
|
1982
2243
|
}
|
|
1983
|
-
m(
|
|
2244
|
+
l && m !== void 0 && m.valueTarget.tagName.toLowerCase() === "input" && T(p, m.valueTarget, t.label, c);
|
|
2245
|
+
let h = m === void 0 ? o.controls[0] : m.valueTarget;
|
|
2246
|
+
if (m === void 0) {
|
|
2247
|
+
for (let e of o.controls) Er(e, t);
|
|
2248
|
+
f.appendChild(o.element);
|
|
2249
|
+
} else Er(m.valueTarget, t), f.appendChild(m.element), m.trailing !== void 0 && f.appendChild(m.trailing);
|
|
2250
|
+
Jr(d, t), u(d, h, `descriptor-${t.id}`), e.appendChild(d);
|
|
2251
|
+
}
|
|
2252
|
+
function Gr(e, t, n) {
|
|
2253
|
+
if (e.control !== "number" && e.control !== "unit-number" || typeof t != "number" || !Number.isFinite(t)) return;
|
|
2254
|
+
let [r] = e.path;
|
|
2255
|
+
if (e.path.length !== 1 || typeof r != "string") return;
|
|
2256
|
+
let i = e.target === "interaction" ? e.projection : e.target, a = n.manifest, o = i === "props" ? a.propsSchema : i === "style" ? a.styleSchema : void 0;
|
|
2257
|
+
if (o?.properties[r]?.kind !== "number") return;
|
|
2258
|
+
let s = (i === "props" ? a.defaultProps : a.defaultStyle)?.[r];
|
|
2259
|
+
return typeof s == "number" ? s === t ? void 0 : String(s) : o.required.includes(r) ? void 0 : "";
|
|
2260
|
+
}
|
|
2261
|
+
function Kr(e, t, n) {
|
|
2262
|
+
let { field: r, input: i } = _(e.ownerDocument, {
|
|
2263
|
+
label: t.label,
|
|
2264
|
+
checked: n
|
|
2265
|
+
});
|
|
2266
|
+
qr(r, t), Er(i, t), Jr(r, t), u(r, i, `descriptor-${t.id}`), e.appendChild(r);
|
|
2267
|
+
}
|
|
2268
|
+
function qr(e, t) {
|
|
2269
|
+
e.dataset.inspectorSearchKind = "field", e.dataset.inspectorSearchKey = `descriptor-field-${t.id}`;
|
|
2270
|
+
let n = t.keywords?.join(" ") ?? "";
|
|
2271
|
+
e.dataset.inspectorSearchText = `${t.label} ${t.help ?? ""} ${n}`, t.advanced === !0 && (e.dataset.inspectorAdvanced = "true");
|
|
2272
|
+
}
|
|
2273
|
+
function Jr(e, t) {
|
|
2274
|
+
if (t.help === void 0) return;
|
|
2275
|
+
let n = e.ownerDocument.createElement("span");
|
|
2276
|
+
n.className = "designer-descriptor-help", n.textContent = t.help, e.appendChild(n);
|
|
1984
2277
|
}
|
|
1985
|
-
function
|
|
2278
|
+
function Yr(e, t, n) {
|
|
1986
2279
|
let r = e.ownerDocument, i = r.createElement("fieldset");
|
|
1987
2280
|
i.className = "designer-descriptor-group";
|
|
1988
2281
|
let a = r.createElement("legend");
|
|
1989
2282
|
a.textContent = t.label, i.appendChild(a);
|
|
1990
|
-
for (let e of
|
|
2283
|
+
for (let e of Xr(n, t)) kr(e, n) && Wr(i, e, n);
|
|
1991
2284
|
e.appendChild(i);
|
|
1992
2285
|
}
|
|
1993
|
-
function
|
|
2286
|
+
function Xr(e, t) {
|
|
1994
2287
|
let n = [
|
|
1995
2288
|
"appearance",
|
|
1996
2289
|
"data",
|
|
1997
2290
|
"interaction"
|
|
1998
2291
|
], r = [];
|
|
1999
|
-
for (let i of n) for (let n of e.manifest.editorDescriptor?.[i] ?? []) for (let e of n.fields) e.id !== t.id &&
|
|
2292
|
+
for (let i of n) for (let n of e.manifest.editorDescriptor?.[i] ?? []) for (let e of n.fields) e.id !== t.id && Zr(e.path, t.path) && r.push(e);
|
|
2000
2293
|
return r;
|
|
2001
2294
|
}
|
|
2002
|
-
function
|
|
2295
|
+
function Zr(e, t) {
|
|
2003
2296
|
return e.length > t.length && t.every((t, n) => t === e[n]);
|
|
2004
2297
|
}
|
|
2005
|
-
function
|
|
2298
|
+
function Qr(e) {
|
|
2299
|
+
return e.target === "style" || e.target === "interaction" && e.projection === "style";
|
|
2300
|
+
}
|
|
2301
|
+
function $r(e, t, n) {
|
|
2006
2302
|
if (e === void 0 || t === void 0 || t.length === 0) return;
|
|
2007
|
-
let r =
|
|
2008
|
-
if (r !== void 0) for (let n of t)
|
|
2303
|
+
let r = Or(n);
|
|
2304
|
+
if (r !== void 0) for (let n of t) Hr(e, n, r);
|
|
2009
2305
|
}
|
|
2010
|
-
var
|
|
2306
|
+
var ei = "base-screen-host-resource-selection-request", ti = /* @__PURE__ */ new Set([
|
|
2011
2307
|
"requestId",
|
|
2012
2308
|
"selection",
|
|
2013
2309
|
"backgroundImageFit"
|
|
2014
|
-
]),
|
|
2015
|
-
function
|
|
2310
|
+
]), ni = 8192;
|
|
2311
|
+
function ri(e) {
|
|
2016
2312
|
return e !== void 0 && e.hostResourceSelection === !0 && e.dataCapabilities.includes("host-resource");
|
|
2017
2313
|
}
|
|
2018
|
-
function
|
|
2314
|
+
function ii(e) {
|
|
2019
2315
|
return {
|
|
2020
2316
|
requestId: e.requestId,
|
|
2021
2317
|
instanceId: e.instanceId,
|
|
@@ -2024,21 +2320,21 @@ function vr(e) {
|
|
|
2024
2320
|
current: e.current
|
|
2025
2321
|
};
|
|
2026
2322
|
}
|
|
2027
|
-
function
|
|
2323
|
+
function ai(e) {
|
|
2028
2324
|
return e.disposed ? $("AUTHORING_EXPIRED", ["requestId"], "Designer is unloaded or disposed; the host resource selection session has expired.") : e.pendingKind === "host-resource-selection" ? {
|
|
2029
2325
|
ok: !0,
|
|
2030
2326
|
value: null,
|
|
2031
2327
|
diagnostics: []
|
|
2032
2328
|
} : $("AUTHORING_REQUEST_INVALID", ["requestId"], "Host resource selection session is missing or no longer current.");
|
|
2033
2329
|
}
|
|
2034
|
-
function
|
|
2035
|
-
let t =
|
|
2330
|
+
function oi(e) {
|
|
2331
|
+
let t = li(e);
|
|
2036
2332
|
if (!t.ok) return t;
|
|
2037
2333
|
let n = t.value;
|
|
2038
|
-
if (!
|
|
2334
|
+
if (!ui(n) || !Object.keys(n).every((e) => ti.has(e))) return Q("Host resource selection commit must be a strict object.");
|
|
2039
2335
|
let r = n.requestId;
|
|
2040
2336
|
if (typeof r != "string" || r.length === 0 || r.length > 128) return Q("Host resource selection requestId is invalid.", ["requestId"]);
|
|
2041
|
-
let i =
|
|
2337
|
+
let i = ci(n.selection);
|
|
2042
2338
|
if (!i.ok) return i;
|
|
2043
2339
|
let a;
|
|
2044
2340
|
if (n.backgroundImageFit !== void 0) {
|
|
@@ -2055,7 +2351,7 @@ function br(e) {
|
|
|
2055
2351
|
diagnostics: []
|
|
2056
2352
|
};
|
|
2057
2353
|
}
|
|
2058
|
-
function
|
|
2354
|
+
function si(e, t) {
|
|
2059
2355
|
if (t.kind === "canvas-background") {
|
|
2060
2356
|
let t = e.canvas.backgroundImage;
|
|
2061
2357
|
return typeof t == "string" && t.length > 0 ? {
|
|
@@ -2079,8 +2375,8 @@ function xr(e, t) {
|
|
|
2079
2375
|
resourceId: s.resourceId
|
|
2080
2376
|
} : { kind: "other" };
|
|
2081
2377
|
}
|
|
2082
|
-
function
|
|
2083
|
-
return !
|
|
2378
|
+
function ci(e) {
|
|
2379
|
+
return !ui(e) || typeof e.kind != "string" ? Q("Host resource selection is invalid.", ["selection"]) : e.kind === "url" ? !di(e, ["kind", "url"]) || typeof e.url != "string" ? Q("Host resource URL selection is invalid.", ["selection"]) : n(e.url) ? {
|
|
2084
2380
|
ok: !0,
|
|
2085
2381
|
value: {
|
|
2086
2382
|
kind: "url",
|
|
@@ -2092,7 +2388,7 @@ function Sr(e) {
|
|
|
2092
2388
|
"resourceType",
|
|
2093
2389
|
"resourceId",
|
|
2094
2390
|
"params"
|
|
2095
|
-
].includes(e)) || typeof e.resourceType != "string" || e.resourceType.length === 0 || typeof e.resourceId != "string" || e.resourceId.length === 0 ? Q("Host resource identity selection is invalid.", ["selection"]) : e.params !== void 0 && (!
|
|
2391
|
+
].includes(e)) || typeof e.resourceType != "string" || e.resourceType.length === 0 || typeof e.resourceId != "string" || e.resourceId.length === 0 ? Q("Host resource identity selection is invalid.", ["selection"]) : e.params !== void 0 && (!ui(e.params) || Array.isArray(e.params)) ? Q("Host resource selection params must be an object.", ["selection", "params"]) : nr(e) ? $("AUTHORING_SOURCE_INVALID", ["selection"], "Host resource selection must not contain URLs, tokens, or headers.") : {
|
|
2096
2392
|
ok: !0,
|
|
2097
2393
|
value: {
|
|
2098
2394
|
kind: "host-resource",
|
|
@@ -2103,21 +2399,21 @@ function Sr(e) {
|
|
|
2103
2399
|
diagnostics: []
|
|
2104
2400
|
} : Q("Host resource selection kind is invalid.", ["selection", "kind"]);
|
|
2105
2401
|
}
|
|
2106
|
-
function
|
|
2402
|
+
function li(t) {
|
|
2107
2403
|
try {
|
|
2108
2404
|
let n = e(t, {
|
|
2109
|
-
maxBytes:
|
|
2110
|
-
maxStringBytes:
|
|
2405
|
+
maxBytes: ni,
|
|
2406
|
+
maxStringBytes: ni
|
|
2111
2407
|
});
|
|
2112
2408
|
return n.ok ? n : n.diagnostics.some((e) => e.code === "JSON_LIMIT_EXCEEDED") ? $("AUTHORING_LIMIT_EXCEEDED", [], "Host resource selection commit exceeds its JSON limits.") : Q("Host resource selection commit is not JSON-safe.");
|
|
2113
2409
|
} catch {
|
|
2114
2410
|
return Q("Host resource selection commit is not JSON-safe.");
|
|
2115
2411
|
}
|
|
2116
2412
|
}
|
|
2117
|
-
function
|
|
2413
|
+
function ui(e) {
|
|
2118
2414
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
2119
2415
|
}
|
|
2120
|
-
function
|
|
2416
|
+
function di(e, t) {
|
|
2121
2417
|
let n = Object.keys(e);
|
|
2122
2418
|
return n.length === t.length && n.every((e) => t.includes(e));
|
|
2123
2419
|
}
|
|
@@ -2136,6 +2432,6 @@ function $(e, t, n) {
|
|
|
2136
2432
|
};
|
|
2137
2433
|
}
|
|
2138
2434
|
//#endregion
|
|
2139
|
-
export {
|
|
2435
|
+
export { er as A, Dn as C, oe as D, ai as E, _n as M, Ln as N, oi as O, ri as S, ae as T, se as _, Wn as a, $n as b, be as c, Zn as d, In as f, ii as g, ie as h, Nn as i, ye as j, ei as k, En as l, Xn as m, On as n, Pn as o, zn as p, xn as r, Fn as s, Qn as t, Mn as u, si as v, tr as w, hr as x, $r as y };
|
|
2140
2436
|
|
|
2141
|
-
//# sourceMappingURL=host-resource-selection-
|
|
2437
|
+
//# sourceMappingURL=host-resource-selection-xo2mLCD4-BR5XCcim.js.map
|