base-screen 0.4.0 → 0.4.2
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 +5 -2
- package/dist/_internal/contracts/diagnostics/material-error.d.ts +1 -1
- package/dist/_internal/contracts/diagnostics/material-error.js +1 -1
- package/dist/_internal/contracts/document/blueprint-graph.d.ts +3 -3
- package/dist/_internal/contracts/document/blueprint-graph.js +4 -4
- package/dist/_internal/contracts/document/component-states.d.ts +1 -1
- package/dist/_internal/contracts/document/component-states.js +1 -1
- package/dist/_internal/contracts/document/image-url.js +1 -1
- package/dist/_internal/contracts/document/json-schema.js +1 -1
- package/dist/_internal/contracts/document/limits.d.ts +5 -5
- package/dist/_internal/contracts/document/limits.js +5 -5
- package/dist/_internal/contracts/document/references.js +3 -3
- package/dist/_internal/contracts/document/schema.d.ts +2 -2
- package/dist/_internal/contracts/document/schema.js +3 -3
- package/dist/_internal/contracts/document/sub-canvas.d.ts +2 -2
- package/dist/_internal/contracts/document/sub-canvas.js +2 -2
- package/dist/_internal/contracts/document/theme.d.ts +2 -2
- package/dist/_internal/contracts/document/theme.js +2 -2
- package/dist/_internal/contracts/document/validate-blueprint.d.ts +1 -1
- package/dist/_internal/contracts/document/validate-blueprint.js +1 -1
- package/dist/_internal/contracts/document/validate-component.js +2 -2
- package/dist/_internal/contracts/document/validate-data-source.js +2 -2
- package/dist/_internal/contracts/document/validate-sub-canvas.d.ts +1 -1
- package/dist/_internal/contracts/document/validate-sub-canvas.js +1 -1
- package/dist/_internal/contracts/document/validate-value-ref.js +1 -1
- package/dist/_internal/contracts/index.d.ts +1 -1
- package/dist/_internal/contracts/migration/blueprint-graph-migration.d.ts +1 -1
- package/dist/_internal/contracts/migration/migrate-document.js +2 -2
- package/dist/_internal/contracts/push/delivery.d.ts +1 -1
- package/dist/_internal/contracts/push/delivery.js +1 -1
- package/dist/_internal/contracts/push/level-scale.d.ts +1 -1
- package/dist/_internal/contracts/push/level-scale.js +1 -1
- package/dist/_internal/contracts/types/document.d.ts +19 -19
- package/dist/_internal/contracts/types/execution.d.ts +3 -3
- package/dist/_internal/contracts/types/host.d.ts +23 -5
- package/dist/_internal/contracts/types/host.js +1 -1
- package/dist/_internal/contracts/types/push.d.ts +3 -3
- package/dist/_internal/contracts/types/variable.d.ts +3 -3
- package/dist/_internal/contracts/variable/parse.js +5 -1
- package/dist/_internal/core/blueprint/runtime-compile.d.ts +1 -1
- package/dist/_internal/core/blueprint/runtime-compile.js +1 -1
- package/dist/_internal/core/blueprint/runtime-dispatch.js +1 -1
- package/dist/_internal/core/blueprint/runtime-simulate.d.ts +1 -1
- package/dist/_internal/core/blueprint/runtime-simulate.js +1 -1
- package/dist/_internal/core/blueprint/runtime-types.d.ts +4 -4
- package/dist/_internal/core/commands/apply-collection-commands.d.ts +1 -1
- package/dist/_internal/core/commands/apply-collection-commands.js +1 -1
- package/dist/_internal/core/commands/apply-component-commands.d.ts +1 -1
- package/dist/_internal/core/commands/apply-component-commands.js +2 -2
- package/dist/_internal/core/commands/apply.js +2 -2
- package/dist/_internal/core/commands/types.d.ts +5 -5
- package/dist/_internal/core/data/data-candidates.d.ts +1 -1
- package/dist/_internal/core/data/data-candidates.js +1 -1
- package/dist/_internal/core/data/data-source-dependents.d.ts +1 -1
- package/dist/_internal/core/data/data-source-dependents.js +1 -1
- package/dist/_internal/core/data/dataset-profile.d.ts +2 -2
- package/dist/_internal/core/data/dataset-profile.js +2 -2
- package/dist/_internal/core/data/host-dataset.d.ts +2 -2
- package/dist/_internal/core/data/host-dataset.js +2 -2
- package/dist/_internal/core/data/sample-values.d.ts +1 -1
- package/dist/_internal/core/data/sample-values.js +1 -1
- package/dist/_internal/core/data/value-ref.d.ts +2 -2
- package/dist/_internal/core/data/value-ref.js +1 -1
- package/dist/_internal/core/state/state-preset.d.ts +1 -1
- package/dist/_internal/core/validation/layout-audit.d.ts +2 -2
- package/dist/_internal/core/validation/layout-audit.js +1 -1
- package/dist/_internal/core/validation/legibility.js +1 -1
- package/dist/_internal/core/validation/validate-semantics.js +1 -1
- package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-canvas-bridge.d.ts +1 -1
- package/dist/_internal/engine/browser/controllers/dataset/designer-data-source-authoring.d.ts +1 -1
- package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-catalog-controller.d.ts +21 -0
- package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-controller-context.d.ts +7 -2
- package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-draft-controller.d.ts +1 -1
- package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-effective-value.d.ts +1 -1
- package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-surface-controller.d.ts +1 -1
- package/dist/_internal/engine/browser/controllers/dataset/designer-update-policy-authoring.d.ts +1 -1
- package/dist/_internal/engine/browser/controllers/designer-artboard-controller.d.ts +1 -1
- package/dist/_internal/engine/browser/controllers/designer-canvas-runtime-controller.d.ts +2 -2
- package/dist/_internal/engine/browser/controllers/designer-change-controller.d.ts +3 -3
- package/dist/_internal/engine/browser/controllers/designer-command-palette-controller.d.ts +1 -1
- package/dist/_internal/engine/browser/controllers/designer-intent-controller.d.ts +5 -0
- package/dist/_internal/engine/browser/controllers/designer-page-preview-controller.d.ts +1 -1
- package/dist/_internal/engine/browser/controllers/designer-popup-preview-controller.d.ts +1 -1
- package/dist/_internal/engine/browser/controllers/designer-reference-layer-controller.d.ts +1 -1
- package/dist/_internal/engine/browser/controllers/designer-text-edit-controller.d.ts +2 -2
- package/dist/_internal/engine/browser/controllers/designer-viewport-controller.d.ts +7 -1
- package/dist/_internal/engine/browser/controllers/gesture/designer-drag-gesture.d.ts +6 -1
- package/dist/_internal/engine/browser/controllers/gesture/designer-gesture-callbacks.d.ts +1 -1
- package/dist/_internal/engine/browser/controllers/panel/designer-component-states-controller.d.ts +1 -1
- package/dist/_internal/engine/browser/controllers/panel/designer-panel-controller-callbacks.d.ts +6 -6
- package/dist/_internal/engine/browser/controllers/panel/designer-panel-property-controller.d.ts +7 -0
- package/dist/_internal/engine/browser/controllers/variables/designer-variable-catalog-controller.d.ts +9 -1
- package/dist/_internal/engine/browser/controllers/variables/designer-variable-editor-controller.d.ts +6 -1
- package/dist/_internal/engine/browser/controllers/variables/designer-variables-controller.d.ts +16 -1
- package/dist/_internal/engine/browser/controllers/workbench/designer-workbench-controller.d.ts +2 -0
- package/dist/_internal/engine/browser/controllers/workbench/designer-workbench-tabs-controller.d.ts +2 -0
- package/dist/_internal/engine/browser/dom/blueprint/designer-blueprint-inspector-configuration.d.ts +1 -1
- package/dist/_internal/engine/browser/dom/change/designer-change-dom.d.ts +1 -1
- package/dist/_internal/engine/browser/dom/color/designer-color-palette-model.d.ts +3 -3
- package/dist/_internal/engine/browser/dom/color/designer-color-palette-types.d.ts +2 -2
- package/dist/_internal/engine/browser/dom/color/designer-color-theme-slots.d.ts +1 -1
- package/dist/_internal/engine/browser/dom/dataset/designer-data-group-dom.d.ts +1 -1
- package/dist/_internal/engine/browser/dom/dataset/designer-data-panel-notice.d.ts +1 -1
- package/dist/_internal/engine/browser/dom/dataset/designer-data-state.d.ts +1 -1
- package/dist/_internal/engine/browser/dom/dataset/designer-dataset-authoring-dom.d.ts +1 -1
- package/dist/_internal/engine/browser/dom/dataset/designer-dataset-catalog-dom.d.ts +1 -1
- package/dist/_internal/engine/browser/dom/dataset/designer-dataset-sections.d.ts +1 -1
- package/dist/_internal/engine/browser/dom/dataset/designer-dataset-types.d.ts +11 -4
- package/dist/_internal/engine/browser/dom/descriptor/designer-descriptor-control-dom.d.ts +1 -1
- package/dist/_internal/engine/browser/dom/descriptor/designer-descriptor-model.d.ts +1 -1
- package/dist/_internal/engine/browser/dom/designer-field-primitives.d.ts +1 -1
- package/dist/_internal/engine/browser/dom/designer-icons.d.ts +2 -0
- package/dist/_internal/engine/browser/dom/designer-text-edit-dom.d.ts +2 -2
- package/dist/_internal/engine/browser/dom/designer-variable-inspector-dom.d.ts +7 -0
- package/dist/_internal/engine/browser/dom/designer-variables-dom.d.ts +5 -1
- package/dist/_internal/engine/browser/dom/designer-variables-editor-dom.d.ts +30 -1
- package/dist/_internal/engine/browser/dom/designer-variables-toolbar-dom.d.ts +4 -2
- package/dist/_internal/engine/browser/dom/intent/designer-intent-reference-picker-dom.d.ts +2 -0
- package/dist/_internal/engine/browser/dom/material-library/designer-material-library-dom.d.ts +1 -1
- package/dist/_internal/engine/browser/dom/menu/designer-menu-model.d.ts +3 -3
- package/dist/_internal/engine/browser/dom/menu/designer-plugin-command-menu.d.ts +5 -2
- package/dist/_internal/engine/browser/dom/panel/designer-canvas-transactions.d.ts +1 -1
- package/dist/_internal/engine/browser/dom/panel/designer-component-states-dom.d.ts +2 -2
- package/dist/_internal/engine/browser/dom/panel/designer-multi-selection-dom.d.ts +1 -1
- package/dist/_internal/engine/browser/dom/panel/designer-panel-primitives.d.ts +2 -2
- package/dist/_internal/engine/browser/dom/panel/designer-property-transactions.d.ts +1 -1
- package/dist/_internal/engine/browser/dom/value-ref/designer-value-ref-picker-dom.d.ts +1 -1
- package/dist/_internal/engine/browser/dom/value-ref/designer-value-ref-picker-mount.d.ts +1 -1
- package/dist/_internal/engine/browser/dom/value-ref/designer-value-ref-summary-dom.d.ts +1 -1
- package/dist/_internal/engine/browser/dom/value-ref/designer-value-ref-types.d.ts +4 -4
- package/dist/_internal/engine/common/observability/designer-metrics.d.ts +1 -1
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-capabilities.d.ts +1 -1
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-graph.d.ts +5 -5
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-model.d.ts +1 -1
- package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-protocol-types.d.ts +2 -2
- package/dist/_internal/engine/common/operations/canvas/canvas-background-image.d.ts +1 -1
- package/dist/_internal/engine/common/operations/catalog/designer-catalog-refresh.d.ts +1 -1
- package/dist/_internal/engine/common/operations/change/designer-change-events.d.ts +1 -1
- package/dist/_internal/engine/common/operations/change/designer-change-proposal.d.ts +4 -4
- package/dist/_internal/engine/common/operations/designer-clipboard.d.ts +5 -1
- package/dist/_internal/engine/common/operations/designer-text-edit-operations.d.ts +1 -1
- package/dist/_internal/engine/common/operations/designer-variable-operations.d.ts +3 -3
- package/dist/_internal/engine/common/operations/element/designer-element-operation-types.d.ts +1 -1
- package/dist/_internal/engine/common/operations/intent/designer-parameter-intent.d.ts +1 -1
- package/dist/_internal/engine/common/operations/material-component/material-component-fragment-extract.d.ts +2 -2
- package/dist/_internal/engine/common/operations/material-library/material-library-fragments.d.ts +1 -1
- package/dist/_internal/engine/common/operations/material-library/material-library-grouping.d.ts +1 -1
- package/dist/_internal/engine/common/operations/plugin/designer-plugin-commands.d.ts +2 -0
- package/dist/_internal/engine/common/operations/selection/designer-multi-selection-operations.d.ts +9 -9
- package/dist/_internal/engine/common/operations/style/designer-component-states.d.ts +6 -6
- package/dist/_internal/engine/common/operations/style/designer-material-appearance.d.ts +1 -1
- package/dist/_internal/engine/common/session/designer-artboard.d.ts +1 -1
- package/dist/_internal/engine/common/session/designer-session.d.ts +1 -1
- package/dist/_internal/engine/common/ui-text/designer-blueprint-ui-text.d.ts +3 -3
- package/dist/_internal/engine/common/ui-text/designer-ui-text.d.ts +85 -68
- package/dist/_internal/engine/{designer-blueprint-workbench-panel-BWSglfAb.js → designer-blueprint-workbench-panel-DVvKcSvJ.js} +70 -70
- package/dist/_internal/engine/{designer-dataset-controller-DdbY4ILC.js → designer-dataset-controller-bSR5OB6n.js} +1461 -1355
- package/dist/_internal/engine/designer-element/api/designer-element-catalog.d.ts +2 -2
- package/dist/_internal/engine/designer-element/api/designer-element-change.d.ts +2 -2
- package/dist/_internal/engine/designer-element/api/designer-element-configuration-types.d.ts +4 -4
- package/dist/_internal/engine/designer-element/api/designer-element-fragment-save.d.ts +2 -2
- package/dist/_internal/engine/designer-element/api/designer-element-host-resource-selection.d.ts +1 -1
- package/dist/_internal/engine/designer-element/base-screen-designer-element.d.ts +10 -10
- package/dist/_internal/engine/designer-element/runtime/designer-element-plugin-commands.d.ts +3 -3
- package/dist/_internal/engine/designer-element/runtime/designer-element-rendering.d.ts +2 -2
- package/dist/_internal/engine/designer-element/runtime/designer-element-sample-data.d.ts +1 -1
- package/dist/_internal/engine/designer-element/runtime/designer-element-state.d.ts +7 -7
- package/dist/_internal/engine/{designer-field-primitives-Crn464Qg.js → designer-field-primitives-C_StzrUa.js} +197 -178
- package/dist/_internal/engine/{designer-left-panel-groups-dom-DFdLWxxY.js → designer-left-panel-groups-dom-DBpI3Nc2.js} +19 -19
- package/dist/_internal/engine/{host-resource-selection-CWrPLVOc.js → host-resource-selection-BCRU23WQ.js} +446 -446
- package/dist/_internal/engine/index.js +3665 -3247
- package/dist/_internal/host-kit/index.d.ts +1 -1
- package/dist/_internal/host-kit/index.js +1 -1
- package/dist/_internal/host-kit/intent/index.d.ts +2 -1
- package/dist/_internal/host-kit/intent/index.js +1 -0
- package/dist/_internal/host-kit/intent/intent-behavior.d.ts +5 -5
- package/dist/_internal/host-kit/intent/intent-behavior.js +7 -7
- package/dist/_internal/host-kit/intent/intent-block.d.ts +11 -4
- package/dist/_internal/host-kit/intent/intent-block.js +87 -8
- package/dist/_internal/host-kit/intent/intent-catalog.d.ts +9 -6
- package/dist/_internal/host-kit/intent/intent-catalog.js +1 -1
- package/dist/_internal/host-kit/intent/intent-compile-types.d.ts +10 -10
- package/dist/_internal/host-kit/intent/intent-compile.d.ts +1 -1
- package/dist/_internal/host-kit/intent/intent-compile.js +4 -4
- package/dist/_internal/host-kit/intent/intent-data-check.d.ts +4 -4
- package/dist/_internal/host-kit/intent/intent-data-context.d.ts +7 -7
- package/dist/_internal/host-kit/intent/intent-data-context.js +2 -2
- package/dist/_internal/host-kit/intent/intent-dataset.d.ts +4 -4
- package/dist/_internal/host-kit/intent/intent-dataset.js +2 -2
- package/dist/_internal/host-kit/intent/intent-format.d.ts +2 -2
- package/dist/_internal/host-kit/intent/intent-format.js +2 -2
- package/dist/_internal/host-kit/intent/intent-freeform.d.ts +48 -0
- package/dist/_internal/host-kit/intent/intent-freeform.js +412 -0
- package/dist/_internal/host-kit/intent/intent-kpi-bind.d.ts +2 -2
- package/dist/_internal/host-kit/intent/intent-layout.d.ts +2 -2
- package/dist/_internal/host-kit/intent/intent-layout.js +2 -2
- package/dist/_internal/host-kit/intent/intent-parse.d.ts +2 -0
- package/dist/_internal/host-kit/intent/intent-parse.js +13 -12
- package/dist/_internal/host-kit/intent/intent-prepare.d.ts +7 -4
- package/dist/_internal/host-kit/intent/intent-prepare.js +54 -2
- package/dist/_internal/host-kit/intent/intent-session.d.ts +6 -6
- package/dist/_internal/host-kit/intent/intent-session.js +4 -4
- package/dist/_internal/host-kit/intent/intent-stream.js +2 -2
- package/dist/_internal/host-kit/intent/intent-style.d.ts +1 -1
- package/dist/_internal/host-kit/intent/intent-style.js +1 -1
- package/dist/_internal/host-kit/intent/intent-types.d.ts +55 -12
- package/dist/_internal/host-kit/intent/intent-types.js +1 -1
- package/dist/_internal/host-kit/push-result.d.ts +1 -1
- package/dist/_internal/host-kit/push-result.js +1 -1
- package/dist/_internal/host-kit/sse-subscribe.d.ts +1 -1
- package/dist/_internal/host-kit/sse-subscribe.js +1 -1
- package/dist/_internal/host-kit/subscription-hub.d.ts +3 -3
- package/dist/_internal/host-kit/subscription-hub.js +1 -1
- package/dist/_internal/material/base-material.d.ts +3 -3
- package/dist/_internal/material/editor-descriptor.d.ts +3 -3
- package/dist/_internal/plugin-core/contracts.d.ts +18 -16
- package/dist/_internal/plugin-core/contracts.js +1 -0
- package/dist/_internal/plugin-core/contribution-kind.d.ts +5 -5
- package/dist/_internal/plugin-core/contribution-kind.js +14 -6
- package/dist/_internal/plugin-core/editor/editor-descriptor-inference.d.ts +1 -1
- package/dist/_internal/plugin-core/editor/editor-descriptor-inference.js +2 -2
- package/dist/_internal/plugin-core/editor/editor-descriptor-items.d.ts +1 -1
- package/dist/_internal/plugin-core/editor/editor-descriptor-items.js +1 -1
- package/dist/_internal/plugin-core/editor/editor-descriptor-model.d.ts +2 -2
- package/dist/_internal/plugin-core/editor/editor-descriptor.js +1 -1
- package/dist/_internal/plugin-core/fragment/fragment.d.ts +4 -4
- package/dist/_internal/plugin-core/fragment/fragment.js +1 -1
- package/dist/_internal/plugin-core/material/material-manifest-fields.js +1 -1
- package/dist/_internal/plugin-core/material/material-manifest.js +1 -1
- package/dist/_internal/plugin-core/material/material-theme.d.ts +2 -2
- package/dist/_internal/plugin-core/material/material-theme.js +2 -2
- package/dist/_internal/plugin-manager/contribution-kind-plan.d.ts +5 -1
- package/dist/_internal/plugin-manager/contribution-kind-plan.js +20 -12
- package/dist/_internal/plugin-manager/manager.js +47 -30
- package/dist/_internal/plugin-manager/resolver.js +7 -13
- package/dist/_internal/plugin-manager/types.d.ts +2 -2
- package/dist/_internal/plugin-sdk/authoring-finding.d.ts +3 -3
- package/dist/_internal/plugin-sdk/fragment-audit.d.ts +6 -6
- package/dist/_internal/plugin-sdk/fragment-audit.js +8 -8
- package/dist/_internal/plugin-sdk/fragment-definition.d.ts +3 -3
- package/dist/_internal/plugin-sdk/fragment-definition.js +3 -3
- package/dist/_internal/plugin-sdk/material-config-groups.d.ts +2 -2
- package/dist/_internal/plugin-sdk/material-definition.d.ts +5 -1
- package/dist/_internal/plugin-sdk/material-definition.js +3 -3
- package/dist/_internal/plugin-sdk/material-editor-audit.d.ts +9 -8
- package/dist/_internal/plugin-sdk/material-editor-audit.js +19 -11
- package/dist/_internal/plugin-sdk/material-isolated-csp.d.ts +1 -1
- package/dist/_internal/plugin-sdk/material-isolated-csp.js +1 -1
- package/dist/_internal/plugin-sdk/material-isolated-runtime.d.ts +3 -3
- package/dist/_internal/plugin-sdk/material-isolated-runtime.js +3 -3
- package/dist/_internal/plugin-sdk/material-isolated.d.ts +9 -9
- package/dist/_internal/plugin-sdk/material-isolated.js +28 -8
- package/dist/_internal/plugin-sdk/material-package.d.ts +3 -3
- package/dist/_internal/plugin-sdk/material-package.js +7 -7
- package/dist/_internal/plugin-sdk/material-rendered-element.d.ts +13 -6
- package/dist/_internal/plugin-sdk/material-rendered-element.js +36 -7
- package/dist/_internal/plugin-sdk/material-spec-audit.d.ts +19 -11
- package/dist/_internal/plugin-sdk/material-spec-audit.js +85 -19
- package/dist/_internal/plugin-sdk/material-spec.d.ts +66 -21
- package/dist/_internal/plugin-sdk/material-spec.js +166 -42
- package/dist/_internal/plugin-sdk/material-style-keys.d.ts +6 -6
- package/dist/_internal/plugin-sdk/material-style-keys.js +7 -7
- package/dist/_internal/plugin-sdk/material-template-audit.d.ts +1 -1
- package/dist/_internal/plugin-sdk/material-template-audit.js +3 -3
- package/dist/_internal/plugin-sdk/material-template-expression.d.ts +3 -3
- package/dist/_internal/plugin-sdk/material-template-expression.js +2 -2
- package/dist/_internal/plugin-sdk/material-template-render.d.ts +1 -1
- package/dist/_internal/plugin-sdk/material-template.d.ts +6 -6
- package/dist/_internal/plugin-sdk/material-template.js +2 -2
- package/dist/_internal/plugin-sdk/plugin-package.d.ts +2 -2
- package/dist/_internal/plugin-sdk/plugin-package.js +3 -3
- package/dist/_internal/plugin-sdk/plugin-registration.d.ts +2 -5
- package/dist/_internal/plugin-sdk/plugin-registration.js +3 -3
- package/dist/_internal/renderer/renderer/renderer-candidates.d.ts +1 -1
- package/dist/_internal/renderer/renderer/renderer-component-states.d.ts +1 -1
- package/dist/_internal/renderer/renderer/renderer-effective-style.d.ts +1 -1
- package/dist/_internal/renderer/renderer/renderer-material-dom.d.ts +1 -1
- package/dist/_internal/renderer/renderer/renderer-state.d.ts +2 -2
- package/dist/_internal/renderer/renderer/renderer-theme.d.ts +1 -1
- package/dist/_internal/renderer/renderer/renderer-types.d.ts +1 -1
- package/dist/_internal/renderer/renderer/renderer.d.ts +5 -5
- package/dist/_internal/renderer/resource/data-source-runtime.d.ts +3 -3
- package/dist/_internal/renderer/resource/push-window.d.ts +1 -1
- package/dist/_internal/renderer/resource/request-coordinator.d.ts +1 -1
- package/dist/_internal/renderer/resource/source-query-port.d.ts +3 -3
- package/dist/_internal/renderer/sub-canvas-layer.d.ts +2 -2
- package/dist/_internal/renderer/viewer/viewer-configuration.d.ts +1 -1
- package/dist/_internal/renderer/viewer/viewer.d.ts +3 -3
- package/dist/auto-register.js +9 -9
- package/dist/contracts.js +1 -1
- package/dist/contracts.js.map +1 -1
- package/dist/core.js.map +1 -1
- package/dist/dataset-port-D993nOlT.js.map +1 -1
- package/dist/dataset-profile-Dk6xdtsM.js.map +1 -1
- package/dist/{designer-CFOvOmLn.js → designer-DzBm8tXS.js} +2 -2
- package/dist/{designer-CFOvOmLn.js.map → designer-DzBm8tXS.js.map} +1 -1
- package/dist/designer-auto-register.js +5 -5
- package/dist/{designer-blueprint-workbench-panel-BWSglfAb-ktaj6Ci9.js → designer-blueprint-workbench-panel-DVvKcSvJ-CkRMBKZA.js} +111 -111
- package/dist/designer-blueprint-workbench-panel-DVvKcSvJ-CkRMBKZA.js.map +1 -0
- package/dist/{designer-dataset-controller-DdbY4ILC-CMdGdGbr.js → designer-dataset-controller-bSR5OB6n-DfUP24S6.js} +1052 -946
- package/dist/designer-dataset-controller-bSR5OB6n-DfUP24S6.js.map +1 -0
- package/dist/{designer-field-primitives-Crn464Qg-Bi7q8s5J.js → designer-field-primitives-C_StzrUa-QZpcn0yX.js} +198 -179
- package/dist/designer-field-primitives-C_StzrUa-QZpcn0yX.js.map +1 -0
- package/dist/{designer-left-panel-groups-dom-DFdLWxxY-BarlWMLY.js → designer-left-panel-groups-dom-DBpI3Nc2-D8kYJLCg.js} +17 -17
- package/dist/{designer-left-panel-groups-dom-DFdLWxxY-BarlWMLY.js.map → designer-left-panel-groups-dom-DBpI3Nc2-D8kYJLCg.js.map} +1 -1
- package/dist/designer.js +5 -5
- package/dist/{dist-CHK9BTXX.js → dist-YCmniYuO.js} +4801 -4383
- package/dist/dist-YCmniYuO.js.map +1 -0
- package/dist/engine.js +4 -4
- package/dist/fragment-B-oP0Fru.js.map +1 -1
- package/dist/host-kit.js +979 -554
- package/dist/host-kit.js.map +1 -1
- package/dist/{host-resource-selection-CWrPLVOc-DPDq3jau.js → host-resource-selection-BCRU23WQ-Cedz0d14.js} +206 -206
- package/dist/host-resource-selection-BCRU23WQ-Cedz0d14.js.map +1 -0
- package/dist/image-url-D6mUcjY1.js.map +1 -1
- package/dist/index.js +9 -9
- package/dist/legibility-CS28ivEz.js.map +1 -1
- package/dist/level-scale-CwHqFEVd.js.map +1 -1
- package/dist/{manager-CeB4Jnr9.js → manager-BcvdcZjM.js} +230 -210
- package/dist/manager-BcvdcZjM.js.map +1 -0
- package/dist/{material-DeVkzSoT.js → material-ReRzBIbb.js} +2 -2
- package/dist/{material-DeVkzSoT.js.map → material-ReRzBIbb.js.map} +1 -1
- package/dist/material-auto-register.js +1 -1
- package/dist/{material-definition-BeW34dJr.js → material-definition-BcjFM-B-.js} +9 -9
- package/dist/material-definition-BcjFM-B-.js.map +1 -0
- package/dist/material-manifest-B1XatGPx.js.map +1 -1
- package/dist/material-theme-C91eus78.js.map +1 -1
- package/dist/material.js +2 -2
- package/dist/migrate-document-BM888PtC.js.map +1 -1
- package/dist/{parse-aZat9tAS.js → parse-1U_-Qtn4.js} +2 -2
- package/dist/parse-1U_-Qtn4.js.map +1 -0
- package/dist/parse-Ji7kE9ZT.js.map +1 -1
- package/dist/{plugin-CstHQ5ws.js → plugin-BH-4oNvT.js} +60 -52
- package/dist/plugin-BH-4oNvT.js.map +1 -0
- package/dist/plugin-core.js +1 -1
- package/dist/plugin-manager.js +1 -1
- package/dist/{plugin-package-DWifuHi1.js → plugin-package-Cj-3iLv3.js} +2068 -1905
- package/dist/plugin-package-Cj-3iLv3.js.map +1 -0
- package/dist/{plugin-registration-DTwBvnHX.js → plugin-registration-C9_IxTxc.js} +9 -9
- package/dist/{plugin-registration-DTwBvnHX.js.map → plugin-registration-C9_IxTxc.js.map} +1 -1
- package/dist/plugin-sdk.js +6 -6
- package/dist/{plugins-QDL0yIql.js → plugins-CwATlfr0.js} +2 -2
- package/dist/{plugins-QDL0yIql.js.map → plugins-CwATlfr0.js.map} +1 -1
- package/dist/plugins.js +8 -8
- package/dist/runtime-dispatch-C0gyIrTv.js.map +1 -1
- package/dist/runtime-simulate-aSYO9yDX.js.map +1 -1
- package/dist/{src-Bm7u11mN-Bi1hDVkh.js → src-Bm7u11mN-DFLnFQSk.js} +19 -19
- package/dist/{src-Bm7u11mN-Bi1hDVkh.js.map → src-Bm7u11mN-DFLnFQSk.js.map} +1 -1
- package/dist/{text-BSTz0pFQ.js → text-DfKom8EG.js} +2 -2
- package/dist/{text-BSTz0pFQ.js.map → text-DfKom8EG.js.map} +1 -1
- package/dist/theme-CcBXf4Ay.js.map +1 -1
- package/dist/value-ref-XkLuckGV.js.map +1 -1
- package/dist/{viewer-CrJupI8I-BJiz1cvW.js → viewer-CrJupI8I-CeQS58mA.js} +4 -4
- package/dist/{viewer-CrJupI8I-BJiz1cvW.js.map → viewer-CrJupI8I-CeQS58mA.js.map} +1 -1
- package/dist/viewer-auto-register.js +1 -1
- package/dist/viewer.js +1 -1
- package/dist/viewport-BNIRWjiT.js.map +1 -1
- package/package.json +13 -13
- package/dist/designer-blueprint-workbench-panel-BWSglfAb-ktaj6Ci9.js.map +0 -1
- package/dist/designer-dataset-controller-DdbY4ILC-CMdGdGbr.js.map +0 -1
- package/dist/designer-field-primitives-Crn464Qg-Bi7q8s5J.js.map +0 -1
- package/dist/dist-CHK9BTXX.js.map +0 -1
- package/dist/host-resource-selection-CWrPLVOc-DPDq3jau.js.map +0 -1
- package/dist/manager-CeB4Jnr9.js.map +0 -1
- package/dist/material-definition-BeW34dJr.js.map +0 -1
- package/dist/parse-aZat9tAS.js.map +0 -1
- package/dist/plugin-CstHQ5ws.js.map +0 -1
- package/dist/plugin-package-DWifuHi1.js.map +0 -1
|
@@ -2,14 +2,14 @@ import type { CompileSink } from './intent-block.js';
|
|
|
2
2
|
import type { IntentCatalogMaterial } from './intent-catalog.js';
|
|
3
3
|
import type { IntentReferenceDataset, IntentReferenceParameter } from './intent-compile-types.js';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* 引用数据集落成文档级数据源实例。
|
|
6
6
|
*
|
|
7
7
|
* 运行时取数前按定义求值参数(contracts `evaluateScreenDatasetParameters`):没给的回落
|
|
8
8
|
* `defaultValue`,必填又没有默认值的让整次查询失败(`HOST_DATASET_PARAMETER_INVALID`)。
|
|
9
9
|
* 所以这里:
|
|
10
10
|
* - 有默认值的参数显式写进实例(与设计器手工新建实例的做法一致,提案里也看得到实际取值);
|
|
11
11
|
* - 必填又没有默认值的参数,编译器不替用户挑值,返回缺失清单,调用方跳过该块;
|
|
12
|
-
* - 同一数据集 +
|
|
12
|
+
* - 同一数据集 + 同一组参数只建一个实例(实例共享),id 按首次出现的顺序派生。
|
|
13
13
|
*/
|
|
14
14
|
export type DatasetInlineParams = Readonly<Record<string, {
|
|
15
15
|
readonly kind: 'inline';
|
|
@@ -28,7 +28,7 @@ export type DatasetParamResolution = {
|
|
|
28
28
|
/**
|
|
29
29
|
* 按参数声明顺序求出实例参数;顺序固定,实例共享键因此稳定。
|
|
30
30
|
*
|
|
31
|
-
* `given`
|
|
31
|
+
* `given` 是模型照用户指令填的取值:覆盖默认值,但必须是声明过的参数、
|
|
32
32
|
* 类型对得上、落在 `allowedValues` 里,否则整块判 `invalid`(进修复回环)。编译器不替用户挑值。
|
|
33
33
|
*/
|
|
34
34
|
export declare function resolveDatasetParams(dataset: IntentReferenceDataset, given?: Readonly<Record<string, string | number | boolean>>): DatasetParamResolution;
|
|
@@ -41,7 +41,7 @@ export type DatasetFieldResolution = {
|
|
|
41
41
|
readonly message: string;
|
|
42
42
|
};
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* 校验模型显式写的绑定(字段闸):角色必须是物料声明过的,字段必须是 describe
|
|
45
45
|
* 返回过的,数量在上下限内,类型满足角色的 `valueTypes`(目录带了才校验)。必填角色不能漏。
|
|
46
46
|
*/
|
|
47
47
|
export declare function resolveDatasetFields(material: IntentCatalogMaterial, dataset: IntentReferenceDataset, fields: Readonly<Record<string, readonly string[]>>): DatasetFieldResolution;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 按参数声明顺序求出实例参数;顺序固定,实例共享键因此稳定。
|
|
3
3
|
*
|
|
4
|
-
* `given`
|
|
4
|
+
* `given` 是模型照用户指令填的取值:覆盖默认值,但必须是声明过的参数、
|
|
5
5
|
* 类型对得上、落在 `allowedValues` 里,否则整块判 `invalid`(进修复回环)。编译器不替用户挑值。
|
|
6
6
|
*/
|
|
7
7
|
export function resolveDatasetParams(dataset, given = {}) {
|
|
@@ -39,7 +39,7 @@ function validParamValue(parameter, value) {
|
|
|
39
39
|
return parameter.allowedValues === undefined || parameter.allowedValues.includes(value);
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
42
|
+
* 校验模型显式写的绑定(字段闸):角色必须是物料声明过的,字段必须是 describe
|
|
43
43
|
* 返回过的,数量在上下限内,类型满足角色的 `valueTypes`(目录带了才校验)。必填角色不能漏。
|
|
44
44
|
*/
|
|
45
45
|
export function resolveDatasetFields(material, dataset, fields) {
|
|
@@ -11,7 +11,7 @@ export type IntentLanguage = 'zh' | 'en';
|
|
|
11
11
|
/** 标题与副标题里没有任何中日韩字符,就按英文屏处理。 */
|
|
12
12
|
export declare function detectIntentLanguage(...texts: readonly string[]): IntentLanguage;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* 指标数值的统一格式:万 / 亿折算、千分位、小数位、单位间距都在这里,
|
|
15
15
|
* 模型只给数字。百分号紧贴数字,其余单位与数字之间留一个空格(「28.6 万件」「23.7 天」「92.5%」)。
|
|
16
16
|
* 英文屏不折算到万:不到一百万写全(`286,000 cases`),百万以上用 M / B(`1.2M units`)。
|
|
17
17
|
*/
|
|
@@ -26,7 +26,7 @@ export declare function formatKpiDelta(kpi: KpiValueInput & {
|
|
|
26
26
|
/** 显示出来是零:百分比 / 百分点保留一位小数后为零;绝对值只有恰好为零。 */
|
|
27
27
|
export declare function deltaIsZero(delta: IntentKpiDelta): boolean;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* 增减量的颜色只取主题状态色位(`theme:<slot>`),不写固定色值:
|
|
30
30
|
* 增为好且在增、减为好且在减 → success;反过来 → danger;neutral 或没变化 → 次要文字色。
|
|
31
31
|
*/
|
|
32
32
|
export declare function deltaColor(delta: IntentKpiDelta, palette: IntentStylePalette): string;
|
|
@@ -7,7 +7,7 @@ export function detectIntentLanguage(...texts) {
|
|
|
7
7
|
return /[⺀-鿿豈--]/.test(texts.join('')) ? 'zh' : 'en';
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* 指标数值的统一格式:万 / 亿折算、千分位、小数位、单位间距都在这里,
|
|
11
11
|
* 模型只给数字。百分号紧贴数字,其余单位与数字之间留一个空格(「28.6 万件」「23.7 天」「92.5%」)。
|
|
12
12
|
* 英文屏不折算到万:不到一百万写全(`286,000 cases`),百万以上用 M / B(`1.2M units`)。
|
|
13
13
|
*/
|
|
@@ -69,7 +69,7 @@ export function deltaIsZero(delta) {
|
|
|
69
69
|
return delta.unit === 'absolute' ? false : Number(Math.abs(delta.value).toFixed(1)) === 0;
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
72
|
+
* 增减量的颜色只取主题状态色位(`theme:<slot>`),不写固定色值:
|
|
73
73
|
* 增为好且在增、减为好且在减 → success;反过来 → danger;neutral 或没变化 → 次要文字色。
|
|
74
74
|
*/
|
|
75
75
|
export function deltaColor(delta, palette) {
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type IntentCatalog } from './intent-catalog.js';
|
|
2
|
+
import type { CompiledScreenDocument, IntentCompileOutcome, IntentReferences } from './intent-compile-types.js';
|
|
3
|
+
import type { IntentDiagnostic, IntentFreeform } from './intent-types.js';
|
|
4
|
+
export interface FreeformParseOptions {
|
|
5
|
+
readonly catalog: IntentCatalog;
|
|
6
|
+
}
|
|
7
|
+
export interface FreeformParseResult {
|
|
8
|
+
/** 原文是不是自由版面写法(有 items 数组);false 时交给区域解析。 */
|
|
9
|
+
readonly matched: boolean;
|
|
10
|
+
readonly intent: IntentFreeform | undefined;
|
|
11
|
+
readonly diagnostics: readonly IntentDiagnostic[];
|
|
12
|
+
}
|
|
13
|
+
/** 模型原文 → 自由版面 IR。只做形状收敛,不因单项坏掉整份。 */
|
|
14
|
+
export declare function parseFreeformIntent(input: unknown, options: FreeformParseOptions): FreeformParseResult;
|
|
15
|
+
export interface CompileFreeformIntentInput {
|
|
16
|
+
readonly intent: IntentFreeform;
|
|
17
|
+
readonly catalog: IntentCatalog;
|
|
18
|
+
readonly references?: IntentReferences;
|
|
19
|
+
readonly mode?: 'llm' | 'deterministic';
|
|
20
|
+
}
|
|
21
|
+
/** 流式落稿的头部:标题、副标题与画布底色;items 之后逐项到达。 */
|
|
22
|
+
export interface FreeformStreamHead {
|
|
23
|
+
readonly title: string;
|
|
24
|
+
readonly subtitle: string;
|
|
25
|
+
readonly canvas?: {
|
|
26
|
+
readonly backgroundColor?: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface FreeformStreamAssembler {
|
|
30
|
+
readonly skeleton: (head: FreeformStreamHead) => void;
|
|
31
|
+
/** 收一项已写完的 `items[i]`;路径不认识时返回 false。 */
|
|
32
|
+
readonly item: (path: string, value: unknown) => boolean;
|
|
33
|
+
/** 把当前已到达的元素编译成一帧;一项都没到或编译失败时返回 undefined。 */
|
|
34
|
+
readonly frame: () => CompiledScreenDocument | undefined;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* 参考图还原的流式装配:模型每写完一个 item 就编一帧。
|
|
38
|
+
*
|
|
39
|
+
* 组件 id 由 item 下标决定、几何来自绝对坐标,所以新 item 只会追加组件,
|
|
40
|
+
* 已落组件的几何与样式不变——宿主可以用同一套差量草案逐帧扩展。
|
|
41
|
+
*/
|
|
42
|
+
export declare function createFreeformStreamAssembler(input: {
|
|
43
|
+
readonly catalog: IntentCatalog;
|
|
44
|
+
readonly references?: IntentReferences;
|
|
45
|
+
}): FreeformStreamAssembler;
|
|
46
|
+
/** 自由版面 → 文档草稿。几何直接用模型给的坐标,不再经过布局求解器。 */
|
|
47
|
+
export declare function compileFreeformIntent(input: CompileFreeformIntentInput): IntentCompileOutcome;
|
|
48
|
+
//# sourceMappingURL=intent-freeform.d.ts.map
|
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
import { parseCssColor, resolveScreenFontFloorPx } from '@base-screen/core';
|
|
2
|
+
import { compileBlock, sanitizeBlockStyle, sanitizeProps, tokenStyle, } from './intent-block.js';
|
|
3
|
+
import { pickShellMaterial, pickSurfaceMaterial, pickTextMaterial, } from './intent-catalog.js';
|
|
4
|
+
import { parseIntentBlock, readIntentRoot } from './intent-parse.js';
|
|
5
|
+
import { resolveIntentStyle } from './intent-style.js';
|
|
6
|
+
/**
|
|
7
|
+
* 参考图还原:绝对定位的自由版面。
|
|
8
|
+
*
|
|
9
|
+
* 模型读图后给出每个 item 的像素坐标、尺寸与颜色;这里负责把每一项收敛成合法组件:
|
|
10
|
+
* 坐标夹进画布、样式只保留物料声明过的键、数据仍走与区域写法同一套绑定与校验。
|
|
11
|
+
* 解析仍与区域写法共用 `parseIntentBlock`——目录校验、表格裁剪、数据集参数只有一份口径。
|
|
12
|
+
*/
|
|
13
|
+
const WIDTH = 1920;
|
|
14
|
+
const HEIGHT = 1080;
|
|
15
|
+
const MAX_ITEMS = 40;
|
|
16
|
+
/** 组件最小边长:小于它的项在画布上没有可读性。 */
|
|
17
|
+
const MIN_ITEM = 8;
|
|
18
|
+
/** `compileBlock` 会在内容盒四周内缩 16:非文字项把盒子向外放 16,内容就落回原位。 */
|
|
19
|
+
const BLOCK_INSET = 16;
|
|
20
|
+
/** 字号下限与区域编译器一致(1920 宽为 16px)。 */
|
|
21
|
+
const FONT_FLOOR_PX = resolveScreenFontFloorPx(WIDTH);
|
|
22
|
+
/** 模型原文 → 自由版面 IR。只做形状收敛,不因单项坏掉整份。 */
|
|
23
|
+
export function parseFreeformIntent(input, options) {
|
|
24
|
+
const root = readIntentRoot(input);
|
|
25
|
+
if (root === undefined || !Array.isArray(root.items)) {
|
|
26
|
+
return { matched: false, intent: undefined, diagnostics: [] };
|
|
27
|
+
}
|
|
28
|
+
const diagnostics = [];
|
|
29
|
+
const title = clamp(readString(root.title), 20) || '参考图大屏';
|
|
30
|
+
const subtitle = clamp(readString(root.subtitle), 40) || '按参考图还原';
|
|
31
|
+
const canvas = isRecord(root.canvas) ? root.canvas : {};
|
|
32
|
+
const backgroundColor = typeof canvas.backgroundColor === 'string' ? canvas.backgroundColor.trim() : undefined;
|
|
33
|
+
const rawItems = root.items;
|
|
34
|
+
if (rawItems.length > MAX_ITEMS) {
|
|
35
|
+
diagnostics.push({
|
|
36
|
+
severity: 'warning',
|
|
37
|
+
code: 'INTENT_ITEMS_TRIMMED',
|
|
38
|
+
path: 'items',
|
|
39
|
+
message: `Only the first ${MAX_ITEMS} items are kept.`,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
const items = [];
|
|
43
|
+
for (const [index, raw] of rawItems.slice(0, MAX_ITEMS).entries()) {
|
|
44
|
+
const path = `items[${index}]`;
|
|
45
|
+
if (!isRecord(raw)) {
|
|
46
|
+
diagnostics.push({
|
|
47
|
+
severity: 'error',
|
|
48
|
+
code: 'AGENT_BLOCK_INVALID',
|
|
49
|
+
path,
|
|
50
|
+
message: 'An item must be an object.',
|
|
51
|
+
});
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
const geometry = readGeometry(raw, path, diagnostics);
|
|
55
|
+
if (geometry === undefined)
|
|
56
|
+
continue;
|
|
57
|
+
// 目录校验、表格裁剪、数据集参数、素材身份校验都复用块解析:两份口径迟早会漂移。
|
|
58
|
+
const block = parseIntentBlock({ ...raw, span: 1 }, options.catalog, path, { grid: false });
|
|
59
|
+
diagnostics.push(...block.diagnostics);
|
|
60
|
+
if (block.value === undefined)
|
|
61
|
+
continue;
|
|
62
|
+
const style = readStyle(raw.style);
|
|
63
|
+
items.push({
|
|
64
|
+
type: block.value.type,
|
|
65
|
+
...geometry,
|
|
66
|
+
bind: block.value.bind,
|
|
67
|
+
...(block.value.props === undefined ? {} : { props: block.value.props }),
|
|
68
|
+
...(block.value.title === '' ? {} : { title: block.value.title }),
|
|
69
|
+
...(block.value.note === undefined ? {} : { note: block.value.note }),
|
|
70
|
+
...(block.value.substituteFor === undefined
|
|
71
|
+
? {}
|
|
72
|
+
: { substituteFor: block.value.substituteFor }),
|
|
73
|
+
...(style === undefined ? {} : { style }),
|
|
74
|
+
origin: path,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if (items.length === 0) {
|
|
78
|
+
diagnostics.push({
|
|
79
|
+
severity: 'error',
|
|
80
|
+
code: 'AGENT_BLOCKS_ALL_INVALID',
|
|
81
|
+
path: '',
|
|
82
|
+
message: 'At least one usable item is required.',
|
|
83
|
+
});
|
|
84
|
+
return { matched: true, intent: undefined, diagnostics };
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
matched: true,
|
|
88
|
+
intent: {
|
|
89
|
+
kind: 'freeform',
|
|
90
|
+
title,
|
|
91
|
+
subtitle,
|
|
92
|
+
canvas: { ...(backgroundColor === undefined ? {} : { backgroundColor }) },
|
|
93
|
+
items,
|
|
94
|
+
},
|
|
95
|
+
diagnostics,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* 参考图还原的流式装配:模型每写完一个 item 就编一帧。
|
|
100
|
+
*
|
|
101
|
+
* 组件 id 由 item 下标决定、几何来自绝对坐标,所以新 item 只会追加组件,
|
|
102
|
+
* 已落组件的几何与样式不变——宿主可以用同一套差量草案逐帧扩展。
|
|
103
|
+
*/
|
|
104
|
+
export function createFreeformStreamAssembler(input) {
|
|
105
|
+
let head;
|
|
106
|
+
const items = new Map();
|
|
107
|
+
return {
|
|
108
|
+
skeleton(next) {
|
|
109
|
+
head = next;
|
|
110
|
+
},
|
|
111
|
+
item(path, value) {
|
|
112
|
+
if (head === undefined)
|
|
113
|
+
return false;
|
|
114
|
+
const match = /^items\[(\d+)\]$/.exec(path);
|
|
115
|
+
if (match === null)
|
|
116
|
+
return false;
|
|
117
|
+
items.set(Number(match[1]), value);
|
|
118
|
+
return true;
|
|
119
|
+
},
|
|
120
|
+
frame() {
|
|
121
|
+
if (head === undefined || items.size === 0)
|
|
122
|
+
return undefined;
|
|
123
|
+
const ordered = [...items.entries()]
|
|
124
|
+
.sort(([left], [right]) => left - right)
|
|
125
|
+
.map(([, value]) => value);
|
|
126
|
+
const parsed = parseFreeformIntent({
|
|
127
|
+
title: head.title,
|
|
128
|
+
subtitle: head.subtitle,
|
|
129
|
+
...(head.canvas === undefined ? {} : { canvas: head.canvas }),
|
|
130
|
+
items: ordered,
|
|
131
|
+
}, { catalog: input.catalog });
|
|
132
|
+
if (parsed.intent === undefined)
|
|
133
|
+
return undefined;
|
|
134
|
+
const outcome = compileFreeformIntent({
|
|
135
|
+
intent: parsed.intent,
|
|
136
|
+
catalog: input.catalog,
|
|
137
|
+
...(input.references === undefined ? {} : { references: input.references }),
|
|
138
|
+
});
|
|
139
|
+
return outcome.ok ? outcome.value.document : undefined;
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/** 自由版面 → 文档草稿。几何直接用模型给的坐标,不再经过布局求解器。 */
|
|
144
|
+
export function compileFreeformIntent(input) {
|
|
145
|
+
const { intent, catalog, references } = input;
|
|
146
|
+
const palette = resolveIntentStyle(undefined).palette;
|
|
147
|
+
const sink = { diagnostics: [], warnings: [], dataSources: [] };
|
|
148
|
+
const components = [];
|
|
149
|
+
const sources = {};
|
|
150
|
+
const used = new Set();
|
|
151
|
+
const textMaterial = pickTextMaterial(catalog);
|
|
152
|
+
const surfaceMaterial = pickSurfaceMaterial(catalog);
|
|
153
|
+
const shellMaterial = pickShellMaterial(catalog);
|
|
154
|
+
let imageCount = 0;
|
|
155
|
+
let shellId = null;
|
|
156
|
+
let currentIndex = 0;
|
|
157
|
+
let currentZ = 0;
|
|
158
|
+
let step = 0;
|
|
159
|
+
const push = (material, name, box, extra = {}) => {
|
|
160
|
+
const id = `agent-free-${currentIndex}-${step}`;
|
|
161
|
+
step += 1;
|
|
162
|
+
sources[id] = intent.items[currentIndex]?.origin ?? '';
|
|
163
|
+
components.push({
|
|
164
|
+
id,
|
|
165
|
+
type: material.type,
|
|
166
|
+
name,
|
|
167
|
+
parentId: extra.parentId === undefined ? shellId : extra.parentId,
|
|
168
|
+
position: { x: Math.round(box.x), y: Math.round(box.y) },
|
|
169
|
+
size: {
|
|
170
|
+
width: Math.max(1, Math.round(box.width)),
|
|
171
|
+
height: Math.max(1, Math.round(box.height)),
|
|
172
|
+
},
|
|
173
|
+
rotation: 0,
|
|
174
|
+
zIndex: currentZ + step,
|
|
175
|
+
status: { locked: false, hidden: false },
|
|
176
|
+
props: { ...material.defaults.props, ...extra.props },
|
|
177
|
+
// 必须从物料默认样式起步:不少物料的 styleSchema 把字号 / 字重 / 对齐列为必填,
|
|
178
|
+
// 只写模型给的覆盖会因缺键被渲染器整份拒绝。
|
|
179
|
+
style: legibleStyle({
|
|
180
|
+
...material.defaults.style,
|
|
181
|
+
...withDefaults(material, textMaterial, surfaceMaterial, palette, extra.style),
|
|
182
|
+
}),
|
|
183
|
+
dataSource: null,
|
|
184
|
+
dataValue: extra.dataValue ?? null,
|
|
185
|
+
...(extra.dataBinding === undefined ? {} : { dataBinding: extra.dataBinding }),
|
|
186
|
+
});
|
|
187
|
+
used.add(material.type);
|
|
188
|
+
return id;
|
|
189
|
+
};
|
|
190
|
+
const pushText = (name, value, box, token = {}) => {
|
|
191
|
+
if (textMaterial === undefined || value === '')
|
|
192
|
+
return;
|
|
193
|
+
push(textMaterial, name, box, {
|
|
194
|
+
style: tokenStyle(textMaterial, { color: palette.text, ...token }),
|
|
195
|
+
dataValue: { kind: 'inline', value },
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
const beginShell = (name, box) => {
|
|
199
|
+
if (shellMaterial === undefined)
|
|
200
|
+
return;
|
|
201
|
+
shellId = push(shellMaterial, name, box, { parentId: null });
|
|
202
|
+
};
|
|
203
|
+
const endShell = () => {
|
|
204
|
+
shellId = null;
|
|
205
|
+
};
|
|
206
|
+
const context = {
|
|
207
|
+
catalog,
|
|
208
|
+
textMaterial,
|
|
209
|
+
references,
|
|
210
|
+
palette,
|
|
211
|
+
push,
|
|
212
|
+
pushText,
|
|
213
|
+
beginShell,
|
|
214
|
+
endShell,
|
|
215
|
+
};
|
|
216
|
+
const target = { sink, onAsset: () => (imageCount += 1) };
|
|
217
|
+
for (const [index, item] of intent.items.entries()) {
|
|
218
|
+
currentIndex = index;
|
|
219
|
+
currentZ = (item.z ?? index) * 10;
|
|
220
|
+
step = 0;
|
|
221
|
+
const material = catalog.materials.find((entry) => entry.type === item.type);
|
|
222
|
+
if (material === undefined)
|
|
223
|
+
continue;
|
|
224
|
+
if (item.bind.kind === 'text') {
|
|
225
|
+
// 纯文字与色块不需要外壳与内缩:坐标就是内容盒,读图的位置才不会被推移。
|
|
226
|
+
push(material, item.title?.trim() || material.name, exactBox(item), {
|
|
227
|
+
style: sanitizeBlockStyle(material, item.style),
|
|
228
|
+
props: sanitizeProps(material, item.props),
|
|
229
|
+
dataValue: { kind: 'inline', value: item.bind.text },
|
|
230
|
+
});
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
if (item.bind.kind === 'none' && material.data === 'none') {
|
|
234
|
+
push(material, item.title?.trim() || material.name, exactBox(item), {
|
|
235
|
+
style: sanitizeBlockStyle(material, item.style),
|
|
236
|
+
props: sanitizeProps(material, item.props),
|
|
237
|
+
});
|
|
238
|
+
continue;
|
|
239
|
+
}
|
|
240
|
+
// 数据 / 素材型:交给块编译器落绑定;盒子向外放 16,块内缩之后内容回到 item 的坐标。
|
|
241
|
+
const block = {
|
|
242
|
+
type: item.type,
|
|
243
|
+
title: item.title ?? '',
|
|
244
|
+
span: 1,
|
|
245
|
+
bind: item.bind,
|
|
246
|
+
...(item.note === undefined ? {} : { note: item.note }),
|
|
247
|
+
...(item.props === undefined ? {} : { props: item.props }),
|
|
248
|
+
...(item.substituteFor === undefined ? {} : { substituteFor: item.substituteFor }),
|
|
249
|
+
...(item.style === undefined ? {} : { style: item.style }),
|
|
250
|
+
origin: item.origin,
|
|
251
|
+
};
|
|
252
|
+
compileBlock(block, paddedBox(item), context, target);
|
|
253
|
+
}
|
|
254
|
+
const background = intent.canvas.backgroundColor;
|
|
255
|
+
const validBackground = background !== undefined && parseCssColor(background) !== undefined
|
|
256
|
+
? background
|
|
257
|
+
: palette.canvas;
|
|
258
|
+
if (background !== undefined && parseCssColor(background) === undefined) {
|
|
259
|
+
sink.warnings.push({
|
|
260
|
+
severity: 'warning',
|
|
261
|
+
code: 'INTENT_CANVAS_COLOR_INVALID',
|
|
262
|
+
path: 'canvas.backgroundColor',
|
|
263
|
+
message: `"${background}" is not a CSS color; the style palette background was used instead.`,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
if (components.length === 0) {
|
|
267
|
+
return {
|
|
268
|
+
ok: false,
|
|
269
|
+
diagnostics: [
|
|
270
|
+
{
|
|
271
|
+
severity: 'error',
|
|
272
|
+
code: 'AGENT_CATALOG_UNUSABLE',
|
|
273
|
+
path: '',
|
|
274
|
+
message: 'No item could be compiled into a component.',
|
|
275
|
+
},
|
|
276
|
+
],
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
return {
|
|
280
|
+
ok: true,
|
|
281
|
+
value: {
|
|
282
|
+
imageCount,
|
|
283
|
+
materials: [...used],
|
|
284
|
+
warnings: sink.warnings,
|
|
285
|
+
sources,
|
|
286
|
+
behaviors: [],
|
|
287
|
+
document: {
|
|
288
|
+
canvas: { width: WIDTH, height: HEIGHT, backgroundColor: validBackground },
|
|
289
|
+
components,
|
|
290
|
+
variables: [],
|
|
291
|
+
...(sink.dataSources.length === 0 ? {} : { dataSources: sink.dataSources }),
|
|
292
|
+
blueprint: { nodes: [], edges: [] },
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
// ---------------------------------------------------------------------------
|
|
298
|
+
// 解析辅助
|
|
299
|
+
// ---------------------------------------------------------------------------
|
|
300
|
+
function readGeometry(raw, path, diagnostics) {
|
|
301
|
+
const x = numberValue(raw.x);
|
|
302
|
+
const y = numberValue(raw.y);
|
|
303
|
+
const width = numberValue(raw.w ?? raw.width);
|
|
304
|
+
const height = numberValue(raw.h ?? raw.height);
|
|
305
|
+
if (x === undefined || y === undefined || width === undefined || height === undefined) {
|
|
306
|
+
diagnostics.push({
|
|
307
|
+
severity: 'error',
|
|
308
|
+
code: 'AGENT_ITEM_GEOMETRY_INVALID',
|
|
309
|
+
path,
|
|
310
|
+
message: 'An item needs numeric x, y, w and h in pixels.',
|
|
311
|
+
});
|
|
312
|
+
return undefined;
|
|
313
|
+
}
|
|
314
|
+
const left = clampNumber(Math.round(x), 0, WIDTH - MIN_ITEM);
|
|
315
|
+
const top = clampNumber(Math.round(y), 0, HEIGHT - MIN_ITEM);
|
|
316
|
+
const right = clampNumber(Math.round(width), MIN_ITEM, WIDTH - left);
|
|
317
|
+
const bottom = clampNumber(Math.round(height), MIN_ITEM, HEIGHT - top);
|
|
318
|
+
if (left !== Math.round(x) || top !== Math.round(y)) {
|
|
319
|
+
diagnostics.push({
|
|
320
|
+
severity: 'warning',
|
|
321
|
+
code: 'INTENT_ITEM_CLAMPED',
|
|
322
|
+
path,
|
|
323
|
+
message: 'The item position was clamped into the canvas.',
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
if (right !== Math.round(width) || bottom !== Math.round(height)) {
|
|
327
|
+
diagnostics.push({
|
|
328
|
+
severity: 'warning',
|
|
329
|
+
code: 'INTENT_ITEM_CLAMPED',
|
|
330
|
+
path,
|
|
331
|
+
message: 'The item size was clamped to stay inside the canvas.',
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
const z = numberValue(raw.z);
|
|
335
|
+
return {
|
|
336
|
+
x: left,
|
|
337
|
+
y: top,
|
|
338
|
+
width: right,
|
|
339
|
+
height: bottom,
|
|
340
|
+
...(z === undefined ? {} : { z: clampNumber(Math.round(z), 0, 9999) }),
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
function readStyle(raw) {
|
|
344
|
+
const style = isRecord(raw) ? raw : undefined;
|
|
345
|
+
if (style === undefined)
|
|
346
|
+
return undefined;
|
|
347
|
+
const output = {};
|
|
348
|
+
const fontSize = numberValue(style.fontSize);
|
|
349
|
+
if (fontSize !== undefined)
|
|
350
|
+
output.fontSize = fontSize;
|
|
351
|
+
if (typeof style.fontWeight === 'string' || typeof style.fontWeight === 'number') {
|
|
352
|
+
output.fontWeight = style.fontWeight;
|
|
353
|
+
}
|
|
354
|
+
for (const key of ['color', 'fill', 'backgroundColor', 'align', 'textAlign']) {
|
|
355
|
+
const value = style[key];
|
|
356
|
+
if (typeof value === 'string' && value.trim() !== '')
|
|
357
|
+
output[key] = value.trim();
|
|
358
|
+
}
|
|
359
|
+
const lineSpacing = numberValue(style.lineSpacing);
|
|
360
|
+
if (lineSpacing !== undefined)
|
|
361
|
+
output.lineSpacing = lineSpacing;
|
|
362
|
+
return Object.keys(output).length === 0 ? undefined : output;
|
|
363
|
+
}
|
|
364
|
+
/** 文字色 / 底板填充的兜底:模型没写时才用预设,写了就照图。 */
|
|
365
|
+
function withDefaults(material, textMaterial, surfaceMaterial, palette, style) {
|
|
366
|
+
const output = { ...style };
|
|
367
|
+
if (material.type === textMaterial?.type &&
|
|
368
|
+
output.color === undefined &&
|
|
369
|
+
'color' in material.defaults.style) {
|
|
370
|
+
output.color = palette.text;
|
|
371
|
+
}
|
|
372
|
+
if (material.type === surfaceMaterial?.type &&
|
|
373
|
+
output.fill === undefined &&
|
|
374
|
+
'fill' in material.defaults.style) {
|
|
375
|
+
output.fill = palette.card;
|
|
376
|
+
}
|
|
377
|
+
return output;
|
|
378
|
+
}
|
|
379
|
+
/** 与区域编译器同一条可读性兜底:物料默认字号小于下限时抬上来。 */
|
|
380
|
+
function legibleStyle(style) {
|
|
381
|
+
const size = style.fontSize;
|
|
382
|
+
return typeof size === 'number' && size < FONT_FLOOR_PX
|
|
383
|
+
? { ...style, fontSize: FONT_FLOOR_PX }
|
|
384
|
+
: style;
|
|
385
|
+
}
|
|
386
|
+
function exactBox(item) {
|
|
387
|
+
return { x: item.x, y: item.y, width: item.width, height: item.height };
|
|
388
|
+
}
|
|
389
|
+
/** 数据 / 素材块:把盒子向外放一圈,块编译器内缩 16 之后内容正好回到原位。 */
|
|
390
|
+
function paddedBox(item) {
|
|
391
|
+
const x = Math.max(0, item.x - BLOCK_INSET);
|
|
392
|
+
const y = Math.max(0, item.y - BLOCK_INSET);
|
|
393
|
+
const right = Math.min(WIDTH, item.x + item.width + BLOCK_INSET);
|
|
394
|
+
const bottom = Math.min(HEIGHT, item.y + item.height + BLOCK_INSET);
|
|
395
|
+
return { x, y, width: Math.max(MIN_ITEM, right - x), height: Math.max(MIN_ITEM, bottom - y) };
|
|
396
|
+
}
|
|
397
|
+
function readString(value) {
|
|
398
|
+
return typeof value === 'string' ? value.trim() : '';
|
|
399
|
+
}
|
|
400
|
+
function clamp(text, max) {
|
|
401
|
+
return text.slice(0, max);
|
|
402
|
+
}
|
|
403
|
+
function numberValue(value) {
|
|
404
|
+
return typeof value === 'number' && Number.isFinite(value) ? value : undefined;
|
|
405
|
+
}
|
|
406
|
+
function clampNumber(value, min, max) {
|
|
407
|
+
return Math.min(max, Math.max(min, value));
|
|
408
|
+
}
|
|
409
|
+
function isRecord(value) {
|
|
410
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
411
|
+
}
|
|
412
|
+
//# sourceMappingURL=intent-freeform.js.map
|
|
@@ -5,10 +5,10 @@ import type { IntentLanguage } from './intent-format.js';
|
|
|
5
5
|
import type { IntentStylePalette } from './intent-style.js';
|
|
6
6
|
import type { IntentKpi } from './intent-types.js';
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* 绑定数据集字段的指标卡。
|
|
9
9
|
*
|
|
10
10
|
* - 数值组件是文本物料,`dataValue` 读数据源实例结果,`dataBinding` 把字段交给它的唯一角色;
|
|
11
|
-
* - 文本物料只读结果第一行、也不按字段的 `unit` / `format`
|
|
11
|
+
* - 文本物料只读结果第一行、也不按字段的 `unit` / `format` 格式化(②),所以单位并进名称
|
|
12
12
|
* (「OEE(%)」),数值显示原值,不带增减量;
|
|
13
13
|
* - 绑不上(数据集不在本轮引用、字段不存在、结果多于一行、缺参数、目录里的文本物料不收这类字段)时
|
|
14
14
|
* 返回 false:调用方按占位卡画「—」,原因记 warning,能修的进修复回环。
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Box } from './intent-compile-types.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* 布局求解器:区域序列 + 每格的内容量 → 像素矩形,或容量冲突。
|
|
4
4
|
*
|
|
5
5
|
* 一个纯函数,只读骨架里已有的量(指标个数、每块占几列、是不是数据型),不测字体、不依赖异步资源
|
|
6
|
-
*
|
|
6
|
+
* (「无抖动」)。骨架不变,几何就不变——流式落稿靠这条把全部位置一次算定。
|
|
7
7
|
*
|
|
8
8
|
* 装不下就报 `LAYOUT_CAPACITY_EXCEEDED`(带哪个区域、差多少像素),不硬塞:否则「5 块 + 指标带」在
|
|
9
9
|
* 1080 高里会被压成 20px 行高的表格,而不是请模型减块。
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 布局求解器:区域序列 + 每格的内容量 → 像素矩形,或容量冲突。
|
|
3
3
|
*
|
|
4
4
|
* 一个纯函数,只读骨架里已有的量(指标个数、每块占几列、是不是数据型),不测字体、不依赖异步资源
|
|
5
|
-
*
|
|
5
|
+
* (「无抖动」)。骨架不变,几何就不变——流式落稿靠这条把全部位置一次算定。
|
|
6
6
|
*
|
|
7
7
|
* 装不下就报 `LAYOUT_CAPACITY_EXCEEDED`(带哪个区域、差多少像素),不硬塞:否则「5 块 + 指标带」在
|
|
8
8
|
* 1080 高里会被压成 20px 行高的表格,而不是请模型减块。
|
|
@@ -36,4 +36,6 @@ export declare function parseIntentBlock(raw: unknown, catalog: IntentCatalog, o
|
|
|
36
36
|
* 不合格的项直接丢掉。
|
|
37
37
|
*/
|
|
38
38
|
export declare function parseScreenIntentInteractions(raw: readonly unknown[], start?: number): IntentInteraction[];
|
|
39
|
+
/** 读模型原文的 JSON 对象:容忍代码块围栏;解析失败或不是对象时返回 undefined。 */
|
|
40
|
+
export declare function readIntentRoot(input: unknown): Record<string, unknown> | undefined;
|
|
39
41
|
//# sourceMappingURL=intent-parse.d.ts.map
|