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.
Files changed (429) hide show
  1. package/README.md +3 -12
  2. package/dist/_internal/contracts/document/blueprint-capabilities.d.ts +9 -1
  3. package/dist/_internal/contracts/document/blueprint-capabilities.js +16 -0
  4. package/dist/_internal/contracts/document/blueprint-graph.d.ts +68 -0
  5. package/dist/_internal/contracts/document/blueprint-graph.js +424 -0
  6. package/dist/_internal/contracts/document/blueprint-strict.d.ts +3 -1
  7. package/dist/_internal/contracts/document/blueprint-strict.js +77 -91
  8. package/dist/_internal/contracts/document/component-states.d.ts +54 -0
  9. package/dist/_internal/contracts/document/component-states.js +171 -0
  10. package/dist/_internal/contracts/document/json-schema.js +49 -17
  11. package/dist/_internal/contracts/document/limits.d.ts +40 -8
  12. package/dist/_internal/contracts/document/limits.js +40 -8
  13. package/dist/_internal/contracts/document/parse-parts.d.ts +12 -0
  14. package/dist/_internal/contracts/document/parse-parts.js +56 -0
  15. package/dist/_internal/contracts/document/parse.js +1 -1
  16. package/dist/_internal/contracts/document/references.js +108 -41
  17. package/dist/_internal/contracts/document/schema.d.ts +525 -186
  18. package/dist/_internal/contracts/document/schema.js +234 -95
  19. package/dist/_internal/contracts/document/sub-canvas.d.ts +27 -0
  20. package/dist/_internal/contracts/document/sub-canvas.js +38 -0
  21. package/dist/_internal/contracts/document/theme.d.ts +22 -0
  22. package/dist/_internal/contracts/document/theme.js +65 -0
  23. package/dist/_internal/contracts/document/validate-blueprint.d.ts +7 -0
  24. package/dist/_internal/contracts/document/validate-blueprint.js +223 -25
  25. package/dist/_internal/contracts/document/validate-component.d.ts +2 -0
  26. package/dist/_internal/contracts/document/validate-component.js +111 -54
  27. package/dist/_internal/contracts/document/validate-data-source.js +84 -9
  28. package/dist/_internal/contracts/document/validate-sub-canvas.d.ts +9 -0
  29. package/dist/_internal/contracts/document/validate-sub-canvas.js +92 -0
  30. package/dist/_internal/contracts/document/validate-theme.d.ts +4 -0
  31. package/dist/_internal/contracts/document/validate-theme.js +20 -0
  32. package/dist/_internal/contracts/document/validate.js +19 -2
  33. package/dist/_internal/contracts/index.d.ts +11 -4
  34. package/dist/_internal/contracts/index.js +8 -2
  35. package/dist/_internal/contracts/migration/blueprint-graph-migration.d.ts +21 -0
  36. package/dist/_internal/contracts/migration/blueprint-graph-migration.js +328 -0
  37. package/dist/_internal/contracts/migration/migrate-document.d.ts +2 -1
  38. package/dist/_internal/contracts/migration/migrate-document.js +11 -3
  39. package/dist/_internal/contracts/push/delivery.d.ts +16 -0
  40. package/dist/_internal/contracts/push/delivery.js +70 -0
  41. package/dist/_internal/contracts/push/level-scale.d.ts +7 -0
  42. package/dist/_internal/contracts/push/level-scale.js +91 -0
  43. package/dist/_internal/contracts/screen-document.schema.json +1056 -383
  44. package/dist/_internal/contracts/types/document.d.ts +277 -76
  45. package/dist/_internal/contracts/types/execution.d.ts +12 -2
  46. package/dist/_internal/contracts/types/execution.js +0 -5
  47. package/dist/_internal/contracts/types/host.d.ts +35 -1
  48. package/dist/_internal/contracts/types/host.js +7 -1
  49. package/dist/_internal/contracts/types/push.d.ts +86 -0
  50. package/dist/_internal/contracts/types/push.js +1 -0
  51. package/dist/_internal/contracts/types/variable.d.ts +5 -0
  52. package/dist/_internal/contracts/variable/parse.js +30 -1
  53. package/dist/_internal/core/blueprint/runtime-compile.d.ts +4 -0
  54. package/dist/_internal/core/blueprint/runtime-compile.js +45 -21
  55. package/dist/_internal/core/blueprint/runtime-dispatch.js +270 -156
  56. package/dist/_internal/core/blueprint/runtime-types.d.ts +112 -6
  57. package/dist/_internal/core/blueprint/runtime.d.ts +1 -1
  58. package/dist/_internal/core/commands/apply-component-commands.d.ts +5 -0
  59. package/dist/_internal/core/commands/apply-component-commands.js +74 -2
  60. package/dist/_internal/core/commands/apply.js +63 -3
  61. package/dist/_internal/core/commands/parse-command.js +12 -0
  62. package/dist/_internal/core/commands/types.d.ts +28 -3
  63. package/dist/_internal/core/diff/screen-diff.js +1 -1
  64. package/dist/_internal/core/index.d.ts +1 -1
  65. package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-canvas-bridge-helpers.d.ts +1 -1
  66. package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-canvas-bridge.d.ts +11 -1
  67. package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-panels-controller.d.ts +18 -4
  68. package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-timer-scheduler.d.ts +21 -0
  69. package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-workbench-panel.d.ts +8 -1
  70. package/dist/_internal/engine/browser/controllers/dataset/designer-data-source-authoring.d.ts +25 -1
  71. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-controller-context.d.ts +6 -2
  72. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-draft-controller.d.ts +8 -0
  73. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-surface-controller.d.ts +14 -0
  74. package/dist/_internal/engine/browser/controllers/dataset/designer-update-policy-authoring.d.ts +52 -0
  75. package/dist/_internal/engine/browser/controllers/designer-artboard-controller.d.ts +80 -0
  76. package/dist/_internal/engine/browser/controllers/designer-canvas-runtime-controller.d.ts +21 -3
  77. package/dist/_internal/engine/browser/controllers/designer-change-controller.d.ts +2 -0
  78. package/dist/_internal/engine/browser/controllers/designer-command-palette-controller.d.ts +2 -0
  79. package/dist/_internal/engine/browser/controllers/designer-notification-controller.d.ts +7 -0
  80. package/dist/_internal/engine/browser/controllers/designer-page-preview-controller.d.ts +34 -0
  81. package/dist/_internal/engine/browser/controllers/designer-popup-preview-controller.d.ts +40 -0
  82. package/dist/_internal/engine/browser/controllers/designer-preview-controller.d.ts +1 -3
  83. package/dist/_internal/engine/browser/controllers/designer-reference-layer-controller.d.ts +45 -0
  84. package/dist/_internal/engine/browser/controllers/designer-viewport-controller.d.ts +10 -0
  85. package/dist/_internal/engine/browser/controllers/gesture/designer-gesture-callbacks.d.ts +5 -1
  86. package/dist/_internal/engine/browser/controllers/gesture/designer-gesture-controller.d.ts +2 -0
  87. package/dist/_internal/engine/browser/controllers/gesture/designer-gesture-environment.d.ts +18 -7
  88. package/dist/_internal/engine/browser/controllers/gesture/designer-group-editing-controller.d.ts +8 -1
  89. package/dist/_internal/engine/browser/controllers/layers/designer-layers-controller.d.ts +11 -0
  90. package/dist/_internal/engine/browser/controllers/panel/designer-component-states-controller.d.ts +26 -0
  91. package/dist/_internal/engine/browser/controllers/panel/designer-inspector-focus.d.ts +30 -0
  92. package/dist/_internal/engine/browser/controllers/panel/designer-panel-controller-callbacks.d.ts +23 -6
  93. package/dist/_internal/engine/browser/controllers/panel/designer-panel-controller.d.ts +2 -2
  94. package/dist/_internal/engine/browser/controllers/panel/designer-panel-material-controller.d.ts +4 -0
  95. package/dist/_internal/engine/browser/controllers/panel/designer-panel-property-controller.d.ts +2 -0
  96. package/dist/_internal/engine/browser/controllers/workbench/designer-snap-controller.d.ts +5 -1
  97. package/dist/_internal/engine/browser/controllers/workbench/designer-workbench-controller.d.ts +7 -1
  98. package/dist/_internal/engine/browser/dom/blueprint/designer-blueprint-inspector-configuration.d.ts +12 -0
  99. package/dist/_internal/engine/browser/dom/blueprint/designer-blueprint-library-dom.d.ts +18 -2
  100. package/dist/_internal/engine/browser/dom/change/designer-change-dom.d.ts +1 -0
  101. package/dist/_internal/engine/browser/dom/color/designer-color-palette-dom.d.ts +1 -0
  102. package/dist/_internal/engine/browser/dom/color/designer-color-palette-theme.d.ts +10 -0
  103. package/dist/_internal/engine/browser/dom/color/designer-color-palette-types.d.ts +13 -0
  104. package/dist/_internal/engine/browser/dom/color/designer-color-theme-slots.d.ts +10 -0
  105. package/dist/_internal/engine/browser/dom/dataset/designer-dataset-types.d.ts +17 -6
  106. package/dist/_internal/engine/browser/dom/descriptor/designer-descriptor-control-dom.d.ts +17 -1
  107. package/dist/_internal/engine/browser/dom/descriptor/designer-descriptor-model.d.ts +2 -0
  108. package/dist/_internal/engine/browser/dom/designer-field-primitives.d.ts +43 -1
  109. package/dist/_internal/engine/browser/dom/designer-icons.d.ts +2 -0
  110. package/dist/_internal/engine/browser/dom/designer-select-dom.d.ts +2 -0
  111. package/dist/_internal/engine/browser/dom/designer-ui-primitives.d.ts +5 -0
  112. package/dist/_internal/engine/browser/dom/layers/designer-layers-model.d.ts +28 -0
  113. package/dist/_internal/engine/browser/dom/material-library/designer-material-library-dom.d.ts +18 -2
  114. package/dist/_internal/engine/browser/dom/material-library/designer-material-library-group-view.d.ts +1 -0
  115. package/dist/_internal/engine/browser/dom/menu/designer-menu-model.d.ts +4 -2
  116. package/dist/_internal/engine/browser/dom/panel/designer-canvas-properties-dom.d.ts +10 -2
  117. package/dist/_internal/engine/browser/dom/panel/designer-canvas-transactions.d.ts +5 -1
  118. package/dist/_internal/engine/browser/dom/panel/designer-chrome-primitives.d.ts +12 -0
  119. package/dist/_internal/engine/browser/dom/panel/designer-color-group-dom.d.ts +45 -0
  120. package/dist/_internal/engine/browser/dom/panel/designer-component-properties-dom.d.ts +4 -3
  121. package/dist/_internal/engine/browser/dom/panel/designer-component-states-dom.d.ts +22 -0
  122. package/dist/_internal/engine/browser/dom/panel/designer-panel-primitives.d.ts +18 -2
  123. package/dist/_internal/engine/browser/dom/workspace/designer-workspace-template.d.ts +13 -0
  124. package/dist/_internal/engine/browser/dom/workspace/designer-workspace.d.ts +2 -1
  125. package/dist/_internal/engine/browser/viewport/designer-canvas-aids-types.d.ts +8 -2
  126. package/dist/_internal/engine/browser/viewport/designer-canvas-aids.d.ts +14 -4
  127. package/dist/_internal/engine/browser/viewport/designer-canvas-coordinates.d.ts +7 -0
  128. package/dist/_internal/engine/browser/viewport/designer-canvas-measurements.d.ts +12 -1
  129. package/dist/_internal/engine/browser/viewport/designer-canvas-snap-alignment-index.d.ts +27 -0
  130. package/dist/_internal/engine/browser/viewport/designer-canvas-snap-geometry.d.ts +13 -2
  131. package/dist/_internal/engine/browser/viewport/designer-canvas-snap-preview.d.ts +1 -1
  132. package/dist/_internal/engine/browser/viewport/designer-canvas-snap-spacing.d.ts +12 -0
  133. package/dist/_internal/engine/browser/viewport/designer-guide-overlay-nodes.d.ts +2 -0
  134. package/dist/_internal/engine/common/observability/designer-metrics.d.ts +1 -1
  135. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-geometry.d.ts +12 -0
  136. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-graph.d.ts +203 -0
  137. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-model-types.d.ts +6 -2
  138. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-model.d.ts +58 -7
  139. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-protocol-types.d.ts +131 -51
  140. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-value-sources.d.ts +7 -3
  141. package/dist/_internal/engine/common/operations/catalog/designer-catalog-refresh.d.ts +13 -1
  142. package/dist/_internal/engine/common/operations/designer-operation-registry.d.ts +5 -1
  143. package/dist/_internal/engine/common/operations/designer-variable-operations.d.ts +8 -0
  144. package/dist/_internal/engine/common/operations/element/designer-element-operation-types.d.ts +8 -0
  145. package/dist/_internal/engine/common/operations/host-resource/host-resource-authoring.d.ts +1 -1
  146. package/dist/_internal/engine/common/operations/material-component/material-component-fragment-extract.d.ts +34 -0
  147. package/dist/_internal/engine/common/operations/material-component/material-component-fragment.d.ts +24 -41
  148. package/dist/_internal/engine/common/operations/material-component/material-component.d.ts +1 -1
  149. package/dist/_internal/engine/common/operations/material-library/material-library-fragments.d.ts +46 -0
  150. package/dist/_internal/engine/common/operations/material-library/material-library-grouping.d.ts +11 -0
  151. package/dist/_internal/engine/common/operations/selection/designer-group.d.ts +16 -4
  152. package/dist/_internal/engine/common/operations/selection/designer-multi-selection-operations.d.ts +4 -3
  153. package/dist/_internal/engine/common/operations/selection/designer-selection-actions.d.ts +6 -0
  154. package/dist/_internal/engine/common/operations/selection/designer-selection.d.ts +8 -0
  155. package/dist/_internal/engine/common/operations/style/designer-component-states.d.ts +62 -0
  156. package/dist/_internal/engine/common/operations/style/designer-material-appearance.d.ts +30 -0
  157. package/dist/_internal/engine/common/session/designer-artboard.d.ts +40 -0
  158. package/dist/_internal/engine/common/session/designer-session.d.ts +21 -0
  159. package/dist/_internal/engine/common/ui-text/designer-blueprint-ui-text.d.ts +169 -0
  160. package/dist/_internal/engine/common/ui-text/designer-ui-text.d.ts +422 -88
  161. package/dist/_internal/engine/designer-blueprint-workbench-panel-CJ3iZo5v.js +2872 -0
  162. package/dist/_internal/engine/{designer-dataset-controller-CPytVNBK.js → designer-dataset-controller-CrfOg2Ys.js} +1764 -1507
  163. package/dist/_internal/engine/designer-element/api/designer-element-catalog.d.ts +4 -3
  164. package/dist/_internal/engine/designer-element/api/designer-element-configuration-types.d.ts +11 -8
  165. package/dist/_internal/engine/designer-element/api/designer-element-fragment-save.d.ts +16 -0
  166. package/dist/_internal/engine/designer-element/api/designer-element-host-properties.d.ts +0 -5
  167. package/dist/_internal/engine/designer-element/api/designer-element-insert-component-fragment.d.ts +9 -2
  168. package/dist/_internal/engine/designer-element/api/designer-element-material-library-fragments.d.ts +17 -0
  169. package/dist/_internal/engine/designer-element/api/designer-element-project.d.ts +0 -1
  170. package/dist/_internal/engine/designer-element/base-screen-designer-element.d.ts +24 -24
  171. package/dist/_internal/engine/designer-element/designer-element-public-api.d.ts +5 -5
  172. package/dist/_internal/engine/designer-element/runtime/designer-element-guards.d.ts +0 -2
  173. package/dist/_internal/engine/designer-element/runtime/designer-element-host.d.ts +6 -7
  174. package/dist/_internal/engine/designer-element/runtime/designer-element-rendering.d.ts +11 -1
  175. package/dist/_internal/engine/designer-element/runtime/designer-element-runtime.d.ts +15 -14
  176. package/dist/_internal/engine/designer-element/runtime/designer-element-state.d.ts +29 -10
  177. package/dist/_internal/engine/{designer-ui-primitives-CH4RNiMa.js → designer-field-primitives-KBZuWN_D.js} +876 -346
  178. package/dist/_internal/engine/designer-left-panel-groups-dom-N2OHOWjl.js +1282 -0
  179. package/dist/_internal/engine/host-resource-selection-xo2mLCD4.js +2482 -0
  180. package/dist/_internal/engine/host-tokens.css +12 -12
  181. package/dist/_internal/engine/index.js +8643 -6102
  182. package/dist/_internal/host-kit/index.d.ts +2 -0
  183. package/dist/_internal/host-kit/index.js +2 -0
  184. package/dist/_internal/host-kit/push-result.d.ts +5 -0
  185. package/dist/_internal/host-kit/push-result.js +8 -0
  186. package/dist/_internal/host-kit/sse-subscribe.d.ts +59 -0
  187. package/dist/_internal/host-kit/sse-subscribe.js +253 -0
  188. package/dist/_internal/host-kit/subscription-hub.d.ts +41 -0
  189. package/dist/_internal/host-kit/subscription-hub.js +179 -0
  190. package/dist/_internal/material/base-material.d.ts +1 -0
  191. package/dist/_internal/material/chart.d.ts +4 -0
  192. package/dist/_internal/material/chart.js +101 -58
  193. package/dist/_internal/material/container.js +19 -33
  194. package/dist/_internal/material/{base-material-BArgjOeL.js → editor-descriptor-DJZYygOa.js} +49 -20
  195. package/dist/_internal/material/editor-descriptor.d.ts +18 -0
  196. package/dist/_internal/material/image.js +30 -34
  197. package/dist/_internal/material/rule.js +29 -42
  198. package/dist/_internal/material/shapes.js +57 -74
  199. package/dist/_internal/material/table.d.ts +4 -0
  200. package/dist/_internal/material/table.js +118 -71
  201. package/dist/_internal/material/text.js +40 -68
  202. package/dist/_internal/plugin-core/contracts.d.ts +38 -49
  203. package/dist/_internal/plugin-core/contribution-kind.js +47 -2
  204. package/dist/_internal/plugin-core/editor/editor-ai-description.d.ts +3 -0
  205. package/dist/_internal/plugin-core/editor/editor-ai-description.js +124 -0
  206. package/dist/_internal/plugin-core/editor/editor-descriptor-conditions.js +5 -0
  207. package/dist/_internal/plugin-core/editor/editor-descriptor-inference.d.ts +32 -0
  208. package/dist/_internal/plugin-core/editor/editor-descriptor-inference.js +83 -0
  209. package/dist/_internal/plugin-core/editor/editor-descriptor-items.d.ts +6 -0
  210. package/dist/_internal/plugin-core/editor/editor-descriptor-items.js +41 -12
  211. package/dist/_internal/plugin-core/editor/editor-descriptor-model.d.ts +24 -1
  212. package/dist/_internal/plugin-core/editor/editor-descriptor-model.js +6 -1
  213. package/dist/_internal/plugin-core/editor/editor-descriptor-schema.js +21 -0
  214. package/dist/_internal/plugin-core/editor/editor-descriptor-sections.js +5 -7
  215. package/dist/_internal/plugin-core/editor/editor-descriptor.d.ts +1 -0
  216. package/dist/_internal/plugin-core/editor/editor-descriptor.js +55 -2
  217. package/dist/_internal/plugin-core/fragment/fragment.d.ts +96 -0
  218. package/dist/_internal/plugin-core/fragment/fragment.js +535 -0
  219. package/dist/_internal/plugin-core/index.d.ts +7 -4
  220. package/dist/_internal/plugin-core/index.js +5 -2
  221. package/dist/_internal/plugin-core/material/material-manifest.js +14 -2
  222. package/dist/_internal/plugin-core/material/material-schema.d.ts +9 -0
  223. package/dist/_internal/plugin-core/material/material-schema.js +31 -1
  224. package/dist/_internal/plugin-core/material/material-theme.d.ts +25 -0
  225. package/dist/_internal/plugin-core/material/material-theme.js +77 -0
  226. package/dist/_internal/plugin-core/material/material-validation-constants.js +2 -0
  227. package/dist/_internal/plugin-core/material/material.d.ts +1 -1
  228. package/dist/_internal/plugin-core/material/material.js +1 -1
  229. package/dist/_internal/plugin-manager/contribution-kind-plan.d.ts +2 -1
  230. package/dist/_internal/plugin-manager/contribution-kind-plan.js +6 -0
  231. package/dist/_internal/plugin-manager/contributions.js +10 -0
  232. package/dist/_internal/plugin-sdk/authoring-finding.d.ts +19 -0
  233. package/dist/_internal/plugin-sdk/authoring-finding.js +12 -0
  234. package/dist/_internal/plugin-sdk/fragment-audit.d.ts +14 -0
  235. package/dist/_internal/plugin-sdk/fragment-audit.js +170 -0
  236. package/dist/_internal/plugin-sdk/fragment-definition.d.ts +11 -0
  237. package/dist/_internal/plugin-sdk/fragment-definition.js +16 -0
  238. package/dist/_internal/plugin-sdk/index.d.ts +9 -0
  239. package/dist/_internal/plugin-sdk/index.js +9 -0
  240. package/dist/_internal/plugin-sdk/material-config-groups.d.ts +44 -0
  241. package/dist/_internal/plugin-sdk/material-config-groups.js +80 -0
  242. package/dist/_internal/plugin-sdk/material-editor-audit.d.ts +24 -0
  243. package/dist/_internal/plugin-sdk/material-editor-audit.js +160 -0
  244. package/dist/_internal/plugin-sdk/material-rendered-element.d.ts +69 -0
  245. package/dist/_internal/plugin-sdk/material-rendered-element.js +165 -0
  246. package/dist/_internal/plugin-sdk/material-spec-audit.d.ts +22 -0
  247. package/dist/_internal/plugin-sdk/material-spec-audit.js +184 -0
  248. package/dist/_internal/plugin-sdk/material-spec.d.ts +114 -0
  249. package/dist/_internal/plugin-sdk/material-spec.js +635 -0
  250. package/dist/_internal/plugin-sdk/material-style-keys.d.ts +17 -0
  251. package/dist/_internal/plugin-sdk/material-style-keys.js +82 -0
  252. package/dist/_internal/renderer/index.d.ts +2 -0
  253. package/dist/_internal/renderer/index.js +1745 -616
  254. package/dist/_internal/renderer/renderer/renderer-component-states.d.ts +34 -0
  255. package/dist/_internal/renderer/renderer/renderer-effective-style.d.ts +12 -6
  256. package/dist/_internal/renderer/renderer/renderer-material-dom.d.ts +19 -3
  257. package/dist/_internal/renderer/renderer/renderer-mounted-material.d.ts +11 -10
  258. package/dist/_internal/renderer/renderer/renderer-state.d.ts +17 -1
  259. package/dist/_internal/renderer/renderer/renderer-theme.d.ts +11 -0
  260. package/dist/_internal/renderer/renderer/renderer-types.d.ts +15 -5
  261. package/dist/_internal/renderer/renderer/renderer.d.ts +30 -9
  262. package/dist/_internal/renderer/resource/data-source-runtime.d.ts +25 -2
  263. package/dist/_internal/renderer/resource/push-window.d.ts +43 -0
  264. package/dist/_internal/renderer/resource/source-query-port.d.ts +8 -1
  265. package/dist/_internal/renderer/sub-canvas-layer.d.ts +83 -0
  266. package/dist/_internal/renderer/viewer/viewer-blueprint-timer-scheduler.d.ts +23 -0
  267. package/dist/_internal/renderer/viewer/viewer-configuration-guards.d.ts +0 -1
  268. package/dist/_internal/renderer/viewer/viewer-configuration.d.ts +6 -3
  269. package/dist/_internal/renderer/viewer/viewer-stale-style.d.ts +3 -0
  270. package/dist/_internal/renderer/viewer/viewer-variable-controller.d.ts +2 -0
  271. package/dist/_internal/renderer/viewer/viewer.d.ts +18 -7
  272. package/dist/_internal/sdk/auto-register.js +7 -7
  273. package/dist/_internal/sdk/designer-auto-register.js +3 -3
  274. package/dist/_internal/sdk/designer.d.ts +1 -1
  275. package/dist/_internal/sdk/designer.js +8 -8
  276. package/dist/_internal/sdk/host-tokens.css +12 -12
  277. package/dist/_internal/sdk/index.d.ts +1 -1
  278. package/dist/_internal/sdk/index.js +6 -6
  279. package/dist/auto-register.js +11 -11
  280. package/dist/auto-register.js.map +1 -1
  281. package/dist/contracts.js +73 -43
  282. package/dist/contracts.js.map +1 -1
  283. package/dist/core.js +151 -23
  284. package/dist/core.js.map +1 -1
  285. package/dist/{data-contracts-BFld0hw_.js → data-contracts-CnnB5KC9.js} +2 -2
  286. package/dist/{data-contracts-BFld0hw_.js.map → data-contracts-CnnB5KC9.js.map} +1 -1
  287. package/dist/dataset-port-D993nOlT.js +182 -0
  288. package/dist/dataset-port-D993nOlT.js.map +1 -0
  289. package/dist/{designer-Byw45cUM.js → designer-3Tb0EIDV.js} +3 -3
  290. package/dist/designer-3Tb0EIDV.js.map +1 -0
  291. package/dist/designer-auto-register.js +6 -6
  292. package/dist/designer-auto-register.js.map +1 -1
  293. package/dist/designer-blueprint-workbench-panel-CJ3iZo5v-BebifP4x.js +2852 -0
  294. package/dist/designer-blueprint-workbench-panel-CJ3iZo5v-BebifP4x.js.map +1 -0
  295. package/dist/{designer-dataset-controller-CPytVNBK-DWL3SRTP.js → designer-dataset-controller-CrfOg2Ys-DhKUEJJe.js} +1487 -1232
  296. package/dist/designer-dataset-controller-CrfOg2Ys-DhKUEJJe.js.map +1 -0
  297. package/dist/{designer-ui-primitives-CH4RNiMa-BNXQwJPZ.js → designer-field-primitives-KBZuWN_D-B3h4jpYe.js} +871 -343
  298. package/dist/designer-field-primitives-KBZuWN_D-B3h4jpYe.js.map +1 -0
  299. package/dist/designer-left-panel-groups-dom-N2OHOWjl-D8CzGwbF.js +1265 -0
  300. package/dist/designer-left-panel-groups-dom-N2OHOWjl-D8CzGwbF.js.map +1 -0
  301. package/dist/designer.js +5 -5
  302. package/dist/dist-6GRboBs-.js +3305 -0
  303. package/dist/dist-6GRboBs-.js.map +1 -0
  304. package/dist/{dist-BHTClwId.js → dist-BjLjFUy1.js} +8564 -6030
  305. package/dist/dist-BjLjFUy1.js.map +1 -0
  306. package/dist/engine.js +5 -4
  307. package/dist/fragment-Y6YnW6wy.js +393 -0
  308. package/dist/fragment-Y6YnW6wy.js.map +1 -0
  309. package/dist/host-kit.js +297 -3
  310. package/dist/host-kit.js.map +1 -1
  311. package/dist/{host-resource-selection-5Cf_gclK-Sv4Z8UXS.js → host-resource-selection-xo2mLCD4-BR5XCcim.js} +1233 -937
  312. package/dist/host-resource-selection-xo2mLCD4-BR5XCcim.js.map +1 -0
  313. package/dist/host-tokens.css +12 -12
  314. package/dist/index.js +10 -10
  315. package/dist/level-scale-BzUjE31V.js +139 -0
  316. package/dist/level-scale-BzUjE31V.js.map +1 -0
  317. package/dist/{manager-B2CZ2b5I.js → manager-Ch0RTu_i.js} +20 -10
  318. package/dist/manager-Ch0RTu_i.js.map +1 -0
  319. package/dist/material-UbSfiuZq.js +12 -0
  320. package/dist/{material-BPlvEmDi.js.map → material-UbSfiuZq.js.map} +1 -1
  321. package/dist/material-auto-register.js +6 -6
  322. package/dist/material-auto-register.js.map +1 -1
  323. package/dist/{material-definition-B9xCZcD-.js → material-definition-BeW34dJr.js} +2 -2
  324. package/dist/{material-definition-B9xCZcD-.js.map → material-definition-BeW34dJr.js.map} +1 -1
  325. package/dist/{material-manifest-bsGl6vZZ.js → material-manifest-B1XatGPx.js} +222 -137
  326. package/dist/material-manifest-B1XatGPx.js.map +1 -0
  327. package/dist/material-schema-CLoDx-Tl.js +203 -0
  328. package/dist/material-schema-CLoDx-Tl.js.map +1 -0
  329. package/dist/{editor-descriptor-schema-Be30Wv8w.js → material-theme-C91eus78.js} +90 -28
  330. package/dist/material-theme-C91eus78.js.map +1 -0
  331. package/dist/material-validation-utils-ku_6Xxk2.js +125 -0
  332. package/dist/material-validation-utils-ku_6Xxk2.js.map +1 -0
  333. package/dist/material.js +3 -3
  334. package/dist/migrate-document-D3HhCVlZ.js +768 -0
  335. package/dist/migrate-document-D3HhCVlZ.js.map +1 -0
  336. package/dist/parse-AOTE9WnD.js +2308 -0
  337. package/dist/parse-AOTE9WnD.js.map +1 -0
  338. package/dist/{parse-B0hwp_yj.js → parse-B1OD1teS.js} +69 -61
  339. package/dist/{parse-B0hwp_yj.js.map → parse-B1OD1teS.js.map} +1 -1
  340. package/dist/parse-parts-BNrpdG5o.js +42 -0
  341. package/dist/parse-parts-BNrpdG5o.js.map +1 -0
  342. package/dist/{plugin-B9Xxtw7G.js → plugin-DHgh9uHh.js} +140 -94
  343. package/dist/plugin-DHgh9uHh.js.map +1 -0
  344. package/dist/plugin-core.js +93 -8
  345. package/dist/plugin-core.js.map +1 -0
  346. package/dist/plugin-manager.js +1 -1
  347. package/dist/plugin-package-Dr5ro6h6.js +1221 -0
  348. package/dist/plugin-package-Dr5ro6h6.js.map +1 -0
  349. package/dist/{plugin-registration-BjS_CXJU.js → plugin-registration-rsmb4GvS.js} +4 -4
  350. package/dist/{plugin-registration-BjS_CXJU.js.map → plugin-registration-rsmb4GvS.js.map} +1 -1
  351. package/dist/plugin-sdk.js +6 -6
  352. package/dist/{plugins-B9bwk-t6.js → plugins-DGRHgREK.js} +2 -2
  353. package/dist/{plugins-B9bwk-t6.js.map → plugins-DGRHgREK.js.map} +1 -1
  354. package/dist/plugins.js +8 -8
  355. package/dist/renderer.js +1 -1
  356. package/dist/runtime-dispatch-BfnRDtMe.js +479 -0
  357. package/dist/runtime-dispatch-BfnRDtMe.js.map +1 -0
  358. package/dist/{src-Bm7u11mN-BMeb9fvV.js → src-Bm7u11mN-_0u6cMEw.js} +60 -60
  359. package/dist/{src-Bm7u11mN-BMeb9fvV.js.map → src-Bm7u11mN-_0u6cMEw.js.map} +1 -1
  360. package/dist/{text-BVzTcUas.js → text-BNksUr5J.js} +401 -360
  361. package/dist/text-BNksUr5J.js.map +1 -0
  362. package/dist/theme-CcBXf4Ay.js +48 -0
  363. package/dist/theme-CcBXf4Ay.js.map +1 -0
  364. package/dist/{value-ref-y4_YKUP5.js → value-ref-BG_MV9C-.js} +2 -2
  365. package/dist/{value-ref-y4_YKUP5.js.map → value-ref-BG_MV9C-.js.map} +1 -1
  366. package/dist/{viewer-CrJupI8I-DZZfdHXr.js → viewer-CrJupI8I-D9dVcNw4.js} +5 -5
  367. package/dist/{viewer-CrJupI8I-DZZfdHXr.js.map → viewer-CrJupI8I-D9dVcNw4.js.map} +1 -1
  368. package/dist/viewer-auto-register.js +2 -2
  369. package/dist/viewer.js +2 -2
  370. package/dist/{contrast-CZFqj1I5.js → viewport-CiCKeAQH.js} +369 -411
  371. package/dist/viewport-CiCKeAQH.js.map +1 -0
  372. package/package.json +11 -11
  373. package/dist/_internal/contracts/document/blueprint-relations.d.ts +0 -16
  374. package/dist/_internal/contracts/document/blueprint-relations.js +0 -196
  375. package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-panel-mutations.d.ts +0 -5
  376. package/dist/_internal/engine/browser/controllers/designer-guard-controller.d.ts +0 -27
  377. package/dist/_internal/engine/browser/controllers/designer-scene-controller.d.ts +0 -47
  378. package/dist/_internal/engine/browser/controllers/panel/designer-style-rules-controller.d.ts +0 -12
  379. package/dist/_internal/engine/browser/dom/guard/designer-contrast-measure.d.ts +0 -24
  380. package/dist/_internal/engine/browser/dom/guard/designer-guard-dom.d.ts +0 -15
  381. package/dist/_internal/engine/browser/dom/workspace/designer-canvas-hint-dom.d.ts +0 -6
  382. package/dist/_internal/engine/browser/viewport/designer-canvas-snap-index.d.ts +0 -9
  383. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-connection.d.ts +0 -14
  384. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-mutation-helpers.d.ts +0 -20
  385. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-mutations.d.ts +0 -15
  386. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-node-ids.d.ts +0 -12
  387. package/dist/_internal/engine/common/operations/designer-name-validation.d.ts +0 -2
  388. package/dist/_internal/engine/common/operations/scene/designer-scene.d.ts +0 -55
  389. package/dist/_internal/engine/common/operations/style/designer-host-conditional-style.d.ts +0 -21
  390. package/dist/_internal/engine/common/operations/style/designer-style-rules.d.ts +0 -25
  391. package/dist/_internal/engine/common/validation/designer-guard.d.ts +0 -49
  392. package/dist/_internal/engine/designer-blueprint-workbench-panel-C2MoZwKA.js +0 -3548
  393. package/dist/_internal/engine/designer-element/api/designer-element-guard.d.ts +0 -13
  394. package/dist/_internal/engine/designer-element/api/designer-element-scene.d.ts +0 -14
  395. package/dist/_internal/engine/designer-left-panel-groups-dom-WMsH33zw.js +0 -573
  396. package/dist/_internal/engine/host-resource-selection-5Cf_gclK.js +0 -2188
  397. package/dist/_internal/renderer/style-rules.d.ts +0 -9
  398. package/dist/contrast-CZFqj1I5.js.map +0 -1
  399. package/dist/dataset-port-CUsMmX2x.js +0 -65
  400. package/dist/dataset-port-CUsMmX2x.js.map +0 -1
  401. package/dist/designer-Byw45cUM.js.map +0 -1
  402. package/dist/designer-blueprint-workbench-panel-C2MoZwKA-CbXkv78O.js +0 -3517
  403. package/dist/designer-blueprint-workbench-panel-C2MoZwKA-CbXkv78O.js.map +0 -1
  404. package/dist/designer-dataset-controller-CPytVNBK-DWL3SRTP.js.map +0 -1
  405. package/dist/designer-left-panel-groups-dom-WMsH33zw-B9pl8loh.js +0 -557
  406. package/dist/designer-left-panel-groups-dom-WMsH33zw-B9pl8loh.js.map +0 -1
  407. package/dist/designer-ui-primitives-CH4RNiMa-BNXQwJPZ.js.map +0 -1
  408. package/dist/dist-BHTClwId.js.map +0 -1
  409. package/dist/dist-DfAV2jGI.js +0 -2185
  410. package/dist/dist-DfAV2jGI.js.map +0 -1
  411. package/dist/editor-descriptor-schema-Be30Wv8w.js.map +0 -1
  412. package/dist/host-resource-selection-5Cf_gclK-Sv4Z8UXS.js.map +0 -1
  413. package/dist/manager-B2CZ2b5I.js.map +0 -1
  414. package/dist/material-BPlvEmDi.js +0 -12
  415. package/dist/material-manifest-bsGl6vZZ.js.map +0 -1
  416. package/dist/material-schema-CtxTkCP2.js +0 -267
  417. package/dist/material-schema-CtxTkCP2.js.map +0 -1
  418. package/dist/migrate-document-BJUN7NPv.js +0 -436
  419. package/dist/migrate-document-BJUN7NPv.js.map +0 -1
  420. package/dist/parse-BQw3u9_4.js +0 -1126
  421. package/dist/parse-BQw3u9_4.js.map +0 -1
  422. package/dist/plugin-B9Xxtw7G.js.map +0 -1
  423. package/dist/plugin-package-BT-pCoTt.js +0 -174
  424. package/dist/plugin-package-BT-pCoTt.js.map +0 -1
  425. package/dist/runtime-dispatch-Dt9fhcI5.js +0 -360
  426. package/dist/runtime-dispatch-Dt9fhcI5.js.map +0 -1
  427. package/dist/schema-C38FI_z2.js +0 -541
  428. package/dist/schema-C38FI_z2.js.map +0 -1
  429. package/dist/text-BVzTcUas.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewport-CiCKeAQH.js","names":[],"sources":["../../core/dist/data/data-source-dependents.js","../../core/dist/internal/diagnostics.js","../../core/dist/validation/invariant-error.js","../../core/dist/internal/preconditions.js","../../core/dist/geometry/bounds.js","../../core/dist/validation/validate-semantics.js","../../core/dist/internal/document.js","../../core/dist/commands/command-input.js","../../core/dist/commands/command-result.js","../../core/dist/commands/apply-component-commands.js","../../core/dist/commands/apply-data-source-command.js","../../core/dist/commands/apply-variable-command.js","../../core/dist/commands/apply.js","../../core/dist/commands/parse-command.js","../../core/dist/diff/screen-diff.js","../../core/dist/geometry/component-bounds.js","../../core/dist/geometry/alignment.js","../../core/dist/geometry/validation.js","../../core/dist/geometry/hit-testing.js","../../core/dist/hierarchy/query.js","../../core/dist/history/history.js","../../core/dist/state/interaction.js","../../core/dist/state/viewport.js"],"sourcesContent":["/**\n * 引用了指定数据源实例的组件 id(按文档顺序)。\n *\n * 实例结果变化时,读它的组件必须重投影:值不在组件上,而在「实例 + 取值引用」这条链上,\n * 因此「组件被 patch」不是唯一的重绘判据。这里只读组件 `dataValue`:旧 `dataSource`\n * 四形态没有文档级实例,随 T05 消失。\n *\n * @param document 读取哪份文档的组件(通常取命令执行后的文档)。\n * @param dataSourceIds 本次发生变化的实例 id。\n */\nexport function componentsReferencingDataSources(document, dataSourceIds) {\n const targets = new Set(dataSourceIds);\n if (targets.size === 0)\n return [];\n const affected = [];\n for (const component of document.components) {\n const ref = component.dataValue;\n if (ref?.kind !== 'data-source-field')\n continue;\n if (targets.has(ref.dataSourceId))\n affected.push(component.id);\n }\n return affected;\n}\n//# sourceMappingURL=data-source-dependents.js.map","import { sortScreenDiagnostics, } from '@base-screen/contracts';\n/** 诊断规范序由 Contracts 独占定义(compareScreenDiagnostics),本包不再自行排序。 */\nexport function sortDiagnostics(diagnostics) {\n return sortScreenDiagnostics(diagnostics);\n}\n/**\n * Prepend path segments to a diagnostic, preserving severity, code, and message.\n * Used by transaction to prefix command diagnostics with `['commands', index]`.\n */\nexport function prefixDiagnostic(diagnostic, prefix) {\n return {\n severity: diagnostic.severity,\n code: diagnostic.code,\n path: [...prefix, ...diagnostic.path],\n message: diagnostic.message,\n };\n}\n//# sourceMappingURL=diagnostics.js.map","export class ScreenCoreInvariantError extends Error {\n name = 'ScreenCoreInvariantError';\n diagnostics;\n constructor(diagnostics) {\n super('Screen document failed Core semantic validation.');\n this.diagnostics = diagnostics;\n }\n}\n//# sourceMappingURL=invariant-error.js.map","export function assertFinite(value, name) {\n if (!Number.isFinite(value)) {\n throw new RangeError(`${name} must be a finite number.`);\n }\n}\nexport function normalizeZero(value) {\n return Object.is(value, -0) ? 0 : value;\n}\nexport function normalizePoint(point) {\n return {\n x: normalizeZero(point.x),\n y: normalizeZero(point.y),\n };\n}\n//# sourceMappingURL=preconditions.js.map","import { normalizeZero } from '../internal/preconditions.js';\n/**\n * Compute the axis-aligned bounds of a component after rotation around its\n * center. Component position is the top-left corner in canvas coordinates.\n * Rotation is in degrees, applied clockwise around the component center.\n *\n * Returns `null` when the result would not be finite or would have\n * non-positive width/height. Public geometry APIs throw `RangeError` for\n * such inputs; validation surfaces them as `CORE_GEOMETRY_INVALID` diagnostics.\n */\nexport function computeComponentBounds(component) {\n const { position: { x, y }, size: { width, height }, rotation, } = component;\n if (!Number.isFinite(x) ||\n !Number.isFinite(y) ||\n !Number.isFinite(width) ||\n !Number.isFinite(height) ||\n !Number.isFinite(rotation) ||\n x < -1_000_000 ||\n x > 1_000_000 ||\n y < -1_000_000 ||\n y > 1_000_000 ||\n width <= 0 ||\n height <= 0 ||\n width > 1_000_000 ||\n height > 1_000_000 ||\n rotation < -180 ||\n rotation >= 180) {\n return null;\n }\n const centerX = x + width / 2;\n const centerY = y + height / 2;\n const halfWidth = width / 2;\n const halfHeight = height / 2;\n const theta = (rotation * Math.PI) / 180;\n const cosTheta = Math.cos(theta);\n const sinTheta = Math.sin(theta);\n const corners = [\n { x: -halfWidth, y: -halfHeight },\n { x: halfWidth, y: -halfHeight },\n { x: halfWidth, y: halfHeight },\n { x: -halfWidth, y: halfHeight },\n ];\n let minX = Number.POSITIVE_INFINITY;\n let minY = Number.POSITIVE_INFINITY;\n let maxX = Number.NEGATIVE_INFINITY;\n let maxY = Number.NEGATIVE_INFINITY;\n for (const corner of corners) {\n const dx = corner.x;\n const dy = corner.y;\n const rotatedX = dx * cosTheta - dy * sinTheta;\n const rotatedY = dx * sinTheta + dy * cosTheta;\n const absoluteX = centerX + rotatedX;\n const absoluteY = centerY + rotatedY;\n if (!Number.isFinite(absoluteX) || !Number.isFinite(absoluteY)) {\n return null;\n }\n if (absoluteX < minX) {\n minX = absoluteX;\n }\n if (absoluteX > maxX) {\n maxX = absoluteX;\n }\n if (absoluteY < minY) {\n minY = absoluteY;\n }\n if (absoluteY > maxY) {\n maxY = absoluteY;\n }\n }\n const boundsWidth = maxX - minX;\n const boundsHeight = maxY - minY;\n if (!Number.isFinite(boundsWidth) ||\n !Number.isFinite(boundsHeight) ||\n boundsWidth <= 0 ||\n boundsHeight <= 0) {\n return null;\n }\n return {\n left: normalizeZero(minX),\n top: normalizeZero(minY),\n right: normalizeZero(maxX),\n bottom: normalizeZero(maxY),\n };\n}\n//# sourceMappingURL=bounds.js.map","import { computeComponentBounds } from '../geometry/bounds.js';\nimport { buildComponentIndex, getAncestorDepth } from '../hierarchy/hierarchy.js';\nimport { sortDiagnostics } from '../internal/diagnostics.js';\n/**\n * Maximum ancestor depth allowed for any component in a Core-valid document.\n * A root has depth 0; a child of a root has depth 1; and so on.\n */\nconst MAX_ANCESTOR_DEPTH = 256;\n/**\n * Validate Core semantic invariants on a canonical ScreenDocument.\n *\n * Contracts is responsible for structural validation (fields, primitives, JSON\n * boundary, resource limits, id uniqueness, parent existence, self-reference,\n * parent cycles, and canonical numeric ranges). Core only verifies the\n * additional domain invariants listed in Spec §10:\n *\n * - No component has an ancestor chain deeper than 256.\n * - Every component's rotated bounds are finite with positive width and height.\n * - Sibling `(zIndex, document order)` ordering is stable (same zIndex legal).\n * - Parent relation does not introduce local coordinate interpretation.\n *\n * The last two are structural guarantees of the canonical document and have no\n * additional runtime check beyond what Contracts and the painter-order\n * algorithm already enforce. The function returns an empty array when the\n * document satisfies all Core invariants.\n *\n * Diagnostics are sorted by path, code, then message, matching Contracts'\n * ordering rules. Consumers must rely only on code and path; message text is\n * not a stable contract.\n *\n * 空结果(合法文档)按引用缓存:canonical 文档不可变,同一引用的「通过」结论恒定。\n * 事务路径在同一文档上多次断言(apply 入口、finalize、history commit)时,\n * 命中缓存将 O(n×depth) 的重复扫描降为 O(1);WeakMap 随文档引用回收。\n * 非空诊断不缓存:失败路径每次返回全新数组,调用方无法通过持有/变更旧数组\n * 影响后续调用。\n */\nconst validSemanticsCache = new WeakSet();\nexport function validateScreenDocumentSemantics(document) {\n if (validSemanticsCache.has(document))\n return EMPTY_DIAGNOSTICS;\n const diagnostics = computeScreenDocumentSemantics(document);\n if (diagnostics.length === 0)\n validSemanticsCache.add(document);\n return diagnostics;\n}\nconst EMPTY_DIAGNOSTICS = [];\nfunction computeScreenDocumentSemantics(document) {\n const index = buildComponentIndex(document);\n const diagnostics = [];\n for (let position = 0; position < document.components.length; position++) {\n const component = document.components[position];\n const depth = getAncestorDepth(index, component.id);\n if (depth > MAX_ANCESTOR_DEPTH) {\n diagnostics.push({\n severity: 'error',\n code: 'CORE_INVARIANT_VIOLATION',\n path: ['components', position, 'parentId'],\n message: `Component ancestor depth ${depth} exceeds the maximum of ${MAX_ANCESTOR_DEPTH}.`,\n });\n }\n const bounds = computeComponentBounds(component);\n if (bounds === null) {\n diagnostics.push({\n severity: 'error',\n code: 'CORE_GEOMETRY_INVALID',\n path: ['components', position],\n message: 'Component rotated bounds must be finite with positive width and height.',\n });\n }\n }\n return sortDiagnostics(diagnostics);\n}\n//# sourceMappingURL=validate-semantics.js.map","import { parseScreenDocument } from '@base-screen/contracts';\nimport { ScreenCoreInvariantError } from '../validation/invariant-error.js';\nimport { validateScreenDocumentSemantics } from '../validation/validate-semantics.js';\nexport function assertCoreValidDocument(document) {\n const diagnostics = validateScreenDocumentSemantics(document);\n if (diagnostics.length > 0) {\n throw new ScreenCoreInvariantError(diagnostics);\n }\n}\nexport function parseCandidateDocument(candidate, base) {\n const parsed = parseScreenDocument(candidate, base);\n if (!parsed.ok) {\n return { ok: false, diagnostics: parsed.diagnostics };\n }\n const semanticDiagnostics = validateScreenDocumentSemantics(parsed.value);\n if (semanticDiagnostics.length > 0) {\n return { ok: false, diagnostics: semanticDiagnostics };\n }\n return { ok: true, document: parsed.value };\n}\n//# sourceMappingURL=document.js.map","export function canonicalTargetIds(document, componentIds) {\n const unique = new Set(componentIds);\n const ids = new Set(document.components.map((component) => component.id));\n if ([...unique].some((id) => !ids.has(id))) {\n return undefined;\n }\n return document.components.filter((component) => unique.has(component.id)).map(({ id }) => id);\n}\nexport function patchDocument(base, patch) {\n return { ...base, ...patch };\n}\nexport function isExactPatch(value, allowed) {\n return isRecord(value) && Object.keys(value).every((key) => allowed.has(key));\n}\nexport function isStatusOnlyPatch(value) {\n return isRecord(value) && Object.keys(value).length === 1 && value.status !== undefined;\n}\nexport function isRecord(value) {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\nexport function isStringArray(value) {\n return Array.isArray(value) && value.every((item) => typeof item === 'string');\n}\n//# sourceMappingURL=command-input.js.map","import { sortDiagnostics } from '../internal/diagnostics.js';\nimport { parseCandidateDocument } from '../internal/document.js';\nexport function finalizeScreenCommand(original, candidate, changedComponentIds) {\n // candidate 由 original 经引用共享派生:以 original 为 base,未变更部分\n // 跳过克隆与结构校验,仅完整校验新增/变更的值。\n const parsed = parseCandidateDocument(candidate, original);\n if (!parsed.ok) {\n return screenCommandFailure(original, parsed.diagnostics);\n }\n return screenCommandSuccess(parsed.document, changedComponentIds);\n}\nexport function screenCommandSuccess(document, changedComponentIds) {\n return { ok: true, document, changedComponentIds, diagnostics: [] };\n}\nexport function screenCommandFailure(document, diagnostics) {\n return {\n ok: false,\n document,\n diagnostics: sortDiagnostics(Array.isArray(diagnostics) ? diagnostics : [diagnostics]),\n };\n}\nexport function invalidScreenCommand(message, path) {\n return [screenCommandDiagnostic('CORE_COMMAND_INVALID', path, message)];\n}\nexport function screenCommandDiagnostic(code, path, message) {\n return { severity: 'error', code, path, message };\n}\n//# sourceMappingURL=command-result.js.map","import { screenJsonEquals } from '@base-screen/contracts';\nimport { buildComponentIndex, getAncestorIds, getDescendantIds, isEffectiveLocked, } from '../hierarchy/hierarchy.js';\nimport { canonicalTargetIds, isExactPatch, isRecord, isStatusOnlyPatch, isStringArray, patchDocument, } from './command-input.js';\nimport { finalizeScreenCommand, invalidScreenCommand, screenCommandDiagnostic, screenCommandFailure, screenCommandSuccess, } from './command-result.js';\nconst COMPONENT_PATCH_FIELDS = new Set([\n 'name',\n 'position',\n 'size',\n 'rotation',\n 'zIndex',\n 'status',\n 'props',\n 'style',\n 'states',\n 'dataSource',\n 'dataValue',\n 'dataBinding',\n 'belowSubCanvas',\n]);\nexport function applyAddComponentCommand(document, component) {\n if (!isRecord(component)) {\n return screenCommandFailure(document, invalidScreenCommand('Component must be an object.', ['component']));\n }\n const index = buildComponentIndex(document);\n if (typeof component.id !== 'string') {\n return screenCommandFailure(document, invalidScreenCommand('Component id must be a string.', ['component', 'id']));\n }\n if (index.byId.has(component.id)) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_INVALID', ['component', 'id'], 'Component id already exists.'));\n }\n if (component.parentId !== null && !index.byId.has(component.parentId)) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_PARENT_INVALID', ['component', 'parentId'], 'Component parent does not exist.'));\n }\n if (component.parentId !== null && isEffectiveLocked(index, component.parentId)) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_TARGET_LOCKED', ['component', 'parentId'], 'Component parent is locked.'));\n }\n return finalizeScreenCommand(document, { ...document, components: [...document.components, component] }, [component.id]);\n}\nexport function applyUpdateComponentsCommand(document, componentIds, patch) {\n if (!isStringArray(componentIds)) {\n return screenCommandFailure(document, invalidScreenCommand('Component ids must be a string array.', ['componentIds']));\n }\n if (!isExactPatch(patch, COMPONENT_PATCH_FIELDS) || Object.keys(patch).length === 0) {\n return screenCommandFailure(document, invalidScreenCommand('Component patch must contain known fields.', ['patch']));\n }\n const targets = canonicalTargetIds(document, componentIds);\n if (targets === undefined) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_TARGET_MISSING', ['componentIds'], 'One or more components do not exist.'));\n }\n if (targets.length === 0) {\n return screenCommandSuccess(document, []);\n }\n const index = buildComponentIndex(document);\n const locked = targets.find((id) => isEffectiveLocked(index, id));\n if (locked !== undefined && !isStatusOnlyPatch(patch)) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_TARGET_LOCKED', ['componentIds'], `Component \"${locked}\" is locked.`));\n }\n const targetSet = new Set(targets);\n const components = document.components.map((component) => {\n if (!targetSet.has(component.id))\n return component;\n const next = patchDocument(component, patch);\n // `dataValue: null` 表示清除取值引用;保留 null 键会被严格解析视为与 dataSource 并存。\n if ('dataValue' in patch && patch.dataValue === null) {\n delete next.dataValue;\n }\n if ('belowSubCanvas' in patch && patch.belowSubCanvas === null) {\n delete next.belowSubCanvas;\n }\n if ('states' in patch && patch.states === null) {\n delete next.states;\n }\n return next;\n });\n const changed = targets.filter((id) => {\n const entry = index.byId.get(id);\n return !screenJsonEquals(entry.component, components[entry.index]);\n });\n if (changed.length === 0) {\n return screenCommandSuccess(document, []);\n }\n return finalizeScreenCommand(document, { ...document, components }, changed);\n}\nexport function applyRemoveComponentsCommand(document, componentIds) {\n if (!isStringArray(componentIds)) {\n return screenCommandFailure(document, invalidScreenCommand('Component ids must be a string array.', ['componentIds']));\n }\n const targets = canonicalTargetIds(document, componentIds);\n if (targets === undefined) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_TARGET_MISSING', ['componentIds'], 'One or more components do not exist.'));\n }\n if (targets.length === 0) {\n return screenCommandSuccess(document, []);\n }\n const index = buildComponentIndex(document);\n const removed = new Set();\n for (const target of targets) {\n removed.add(target);\n for (const descendant of getDescendantIds(index, target)) {\n removed.add(descendant);\n }\n }\n // 按文档序收集被移除组件(即后续 changed),锁检查只遍历该集合:\n // 首个命中与原先全量扫描的首个命中一致(诊断消息保持文档序)。\n const changed = document.components\n .filter((component) => removed.has(component.id))\n .map(({ id }) => id);\n const locked = changed.find((id) => isEffectiveLocked(index, id));\n if (locked !== undefined) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_TARGET_LOCKED', ['componentIds'], `Component \"${locked}\" is locked.`));\n }\n return finalizeScreenCommand(document, {\n ...document,\n components: document.components.filter((component) => !removed.has(component.id)),\n }, changed);\n}\nexport function applyReparentComponentsCommand(document, componentIds, parentId) {\n if (!isStringArray(componentIds) || (parentId !== null && typeof parentId !== 'string')) {\n return screenCommandFailure(document, invalidScreenCommand('Reparent command fields are invalid.', []));\n }\n const targets = canonicalTargetIds(document, componentIds);\n if (targets === undefined) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_TARGET_MISSING', ['componentIds'], 'One or more components do not exist.'));\n }\n if (targets.length === 0) {\n return screenCommandSuccess(document, []);\n }\n const index = buildComponentIndex(document);\n // 判定「是否为另一 target 的后代」改走祖先链:id 的祖先命中 targets 即为内层,\n // 等价于原先对每个 target 展开 descendants 的 O(n²×d) 扫描,降为 O(n×depth)。\n const targetSet = new Set(targets);\n const outerTargets = targets.filter((id) => !getAncestorIds(index, id).some((ancestor) => targetSet.has(ancestor)));\n if (parentId !== null && !index.byId.has(parentId)) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_PARENT_INVALID', ['parentId'], 'New parent does not exist.'));\n }\n const descendants = new Set();\n for (const target of outerTargets) {\n descendants.add(target);\n for (const descendant of getDescendantIds(index, target)) {\n descendants.add(descendant);\n }\n }\n if (parentId !== null && descendants.has(parentId)) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_PARENT_INVALID', ['parentId'], 'New parent cannot be a target or descendant.'));\n }\n const lockedTarget = outerTargets.find((id) => isEffectiveLocked(index, id));\n if (lockedTarget !== undefined || (parentId !== null && isEffectiveLocked(index, parentId))) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_TARGET_LOCKED', [], 'Reparenting crosses a locked component boundary.'));\n }\n const changed = outerTargets.filter((id) => index.byId.get(id).component.parentId !== parentId);\n if (changed.length === 0) {\n return screenCommandSuccess(document, []);\n }\n const changedSet = new Set(changed);\n return finalizeScreenCommand(document, {\n ...document,\n // 画布归属只写在根组件上(ADR-0109):挂到某个父组件下时随之摘掉 `canvasId` / `belowSubCanvas`。\n components: document.components.map((component) => {\n if (!changedSet.has(component.id))\n return component;\n if (parentId === null)\n return { ...component, parentId };\n const { canvasId: _canvasId, belowSubCanvas: _below, ...rest } = component;\n return { ...rest, parentId };\n }),\n }, changed);\n}\n/**\n * 跨画布移动根组件(ADR-0109 §2.2)。目标画布 `null` = 主画布;子组件随根组件,传子组件 id 失败关闭。\n * 移入弹框时把位置夹进面板(尺寸大于面板时贴左上角),坐标系差异由作者面另行提示。\n */\nexport function applyMoveComponentsCommand(document, componentIds, canvasId) {\n if (!isStringArray(componentIds) || (canvasId !== null && typeof canvasId !== 'string')) {\n return screenCommandFailure(document, invalidScreenCommand('Move command fields are invalid.', []));\n }\n const target = canvasId === null\n ? undefined\n : (document.subCanvases ?? []).find((candidate) => candidate.id === canvasId);\n if (canvasId !== null && target === undefined) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_TARGET_MISSING', ['canvasId'], 'Target sub canvas does not exist.'));\n }\n const targets = canonicalTargetIds(document, componentIds);\n if (targets === undefined) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_TARGET_MISSING', ['componentIds'], 'One or more components do not exist.'));\n }\n if (targets.length === 0)\n return screenCommandSuccess(document, []);\n const index = buildComponentIndex(document);\n const nonRoot = targets.find((id) => index.byId.get(id).component.parentId !== null);\n if (nonRoot !== undefined) {\n return screenCommandFailure(document, invalidScreenCommand('Only root components can move between canvases.', ['componentIds']));\n }\n const locked = targets.find((id) => isEffectiveLocked(index, id));\n if (locked !== undefined) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_TARGET_LOCKED', ['componentIds'], `Component \"${locked}\" is locked.`));\n }\n const targetSet = new Set(targets);\n const changed = [];\n const components = document.components.map((component) => {\n if (!targetSet.has(component.id))\n return component;\n if ((component.canvasId ?? null) === canvasId)\n return component;\n const { canvasId: _canvasId, belowSubCanvas: _below, ...rest } = component;\n let next = canvasId === null\n ? { ...rest, ...(component.belowSubCanvas === true ? { belowSubCanvas: true } : {}) }\n : { ...rest, canvasId };\n if (target?.display === 'popup') {\n const x = clamp(component.position.x, 0, Math.max(0, target.width - component.size.width));\n const y = clamp(component.position.y, 0, Math.max(0, target.height - component.size.height));\n if (x !== component.position.x || y !== component.position.y) {\n next = { ...next, position: { x, y } };\n }\n }\n changed.push(component.id);\n return next;\n });\n if (changed.length === 0)\n return screenCommandSuccess(document, []);\n return finalizeScreenCommand(document, { ...document, components }, changed);\n}\nfunction clamp(value, min, max) {\n return Math.min(max, Math.max(min, value));\n}\n//# sourceMappingURL=apply-component-commands.js.map","import { screenJsonEquals, } from '@base-screen/contracts';\nimport { componentsReferencingDataSources } from '../data/data-source-dependents.js';\nimport { finalizeScreenCommand, invalidScreenCommand, screenCommandFailure, screenCommandSuccess, } from './command-result.js';\n/**\n * 整组替换文档级数据源实例。\n *\n * 结构共享:新集合里与旧集合**同 id 且内容相等**的实例按引用复用旧对象,因此下游\n * 「引用未变」的短路判据(`getNetChangedComponentIds`、历史快照 diff)仍然成立,\n * 不会因为一次整组替换把全部实例判成变更。\n *\n * 变更组件 = 引用了本次被改写实例的组件:值不在组件上,而在「实例 + 取值引用」这条链上,\n * 所以实例变了,读它的组件必须重投影。\n *\n * @param document 当前文档。\n * @param dataSources 新的实例集合(未校验的原始值,交由 `finalizeScreenCommand` 解析)。\n */\nexport function applyReplaceDataSourcesCommand(document, dataSources) {\n if (!Array.isArray(dataSources)) {\n return screenCommandFailure(document, invalidScreenCommand('Data sources must be an array.', ['dataSources']));\n }\n const previous = document.dataSources ?? [];\n const previousById = new Map(previous.map((instance) => [instance.id, instance]));\n const next = dataSources.map((instance) => {\n const id = readInstanceId(instance);\n if (id === undefined)\n return instance;\n const before = previousById.get(id);\n return before !== undefined && screenJsonEquals(before, instance) ? before : instance;\n });\n if (isSameInstances(previous, next)) {\n return screenCommandSuccess(document, []);\n }\n const finalized = finalizeScreenCommand(document, { ...document, dataSources: next }, []);\n if (!finalized.ok)\n return finalized;\n const dependents = componentsReferencingDataSources(finalized.document, changedDataSourceIds(previous, finalized.document.dataSources ?? []));\n return { ...finalized, changedComponentIds: dependents };\n}\n/**\n * 两侧集合里内容不相等的实例 id(新增、删除、改写都算变更)。\n *\n * 命令级 `changedComponentIds` 与事务级「净变更组件」共用这一条判据,避免两处口径不同。\n */\nexport function changedDataSourceIds(before, after) {\n const beforeById = new Map(before.map((instance) => [instance.id, instance]));\n const afterById = new Map(after.map((instance) => [instance.id, instance]));\n const changed = [];\n for (const [id, instance] of beforeById) {\n const next = afterById.get(id);\n if (next === undefined || !screenJsonEquals(instance, next))\n changed.push(id);\n }\n for (const id of afterById.keys()) {\n if (!beforeById.has(id))\n changed.push(id);\n }\n return changed;\n}\n/** 引用相等即「没变」:上面已对未变实例做结构共享。 */\nfunction isSameInstances(before, after) {\n return (before.length === after.length && after.every((instance, index) => instance === before[index]));\n}\nfunction readInstanceId(instance) {\n if (instance === null || typeof instance !== 'object' || Array.isArray(instance)) {\n return undefined;\n }\n const id = instance.id;\n return typeof id === 'string' ? id : undefined;\n}\n//# sourceMappingURL=apply-data-source-command.js.map","import { isScreenComponentId, isScreenVariableName, } from '@base-screen/contracts';\nimport { isRecord } from './command-input.js';\nimport { finalizeScreenCommand, invalidScreenCommand, screenCommandDiagnostic, screenCommandFailure, screenCommandSuccess, } from './command-result.js';\nconst RENAME_VARIABLE_FIELDS = new Set(['type', 'variableId', 'nextName']);\n/**\n * Renames only the author-facing label. Canonical references use the immutable variable id,\n * so a rename is atomic without rewriting component data or Blueprint expressions.\n */\nexport function applyRenameVariableCommand(document, command) {\n if (!isRecord(command) ||\n Object.keys(command).some((key) => !RENAME_VARIABLE_FIELDS.has(key)) ||\n command.type !== 'rename-variable' ||\n typeof command.variableId !== 'string' ||\n typeof command.nextName !== 'string') {\n return screenCommandFailure(document, invalidScreenCommand('Rename variable command is invalid.', []));\n }\n if (!isScreenComponentId(command.variableId)) {\n return screenCommandFailure(document, invalidScreenCommand('Variable id is invalid.', ['variableId']));\n }\n if (!isScreenVariableName(command.nextName)) {\n return screenCommandFailure(document, invalidScreenCommand('Next variable name is invalid.', ['nextName']));\n }\n const target = document.variables.find((variable) => variable.id === command.variableId);\n if (target === undefined) {\n return screenCommandFailure(document, screenCommandDiagnostic('CORE_COMMAND_TARGET_MISSING', ['variableId'], 'Variable target does not exist.'));\n }\n if (target.name === command.nextName)\n return screenCommandSuccess(document, []);\n if (document.variables.some((variable) => variable.name === command.nextName)) {\n return screenCommandFailure(document, invalidScreenCommand('Next variable name is already in use.', ['nextName']));\n }\n const variables = document.variables.map((variable) => variable === target ? { ...variable, name: command.nextName } : variable);\n return finalizeScreenCommand(document, { ...document, variables }, []);\n}\n//# sourceMappingURL=apply-variable-command.js.map","import { isScreenThemeSlot, SCREEN_CANVAS_FIELDS, SCREEN_THEME_BASE_SLOTS, screenJsonEquals, } from '@base-screen/contracts';\nimport { componentsReferencingDataSources } from '../data/data-source-dependents.js';\nimport { prefixDiagnostic, sortDiagnostics } from '../internal/diagnostics.js';\nimport { assertCoreValidDocument } from '../internal/document.js';\nimport { applyAddComponentCommand, applyMoveComponentsCommand, applyRemoveComponentsCommand, applyReparentComponentsCommand, applyUpdateComponentsCommand, } from './apply-component-commands.js';\nimport { applyReplaceDataSourcesCommand, changedDataSourceIds, } from './apply-data-source-command.js';\nimport { applyRenameVariableCommand } from './apply-variable-command.js';\nimport { isExactPatch, isRecord } from './command-input.js';\nimport { finalizeScreenCommand, invalidScreenCommand, screenCommandDiagnostic, screenCommandFailure, screenCommandSuccess, } from './command-result.js';\n// canvas patch 字段白名单来自契约(`SCREEN_CANVAS_FIELDS`)而不是这里再抄一份:\n// 抄一份的代价是契约新增字段时这里静默拒绝,且没有任何测试会红(ADR-0043:可选字段在\n// patch 中值为 null 表示删除该字段——canvas 全部字段均不可空,null 无歧义)。\nconst CANVAS_FIELDS = new Set(SCREEN_CANVAS_FIELDS);\nexport function applyScreenDocumentCommand(document, command) {\n assertCoreValidDocument(document);\n return applyValidatedCommand(document, command);\n}\nexport function applyScreenDocumentTransaction(document, transaction) {\n assertCoreValidDocument(document);\n if (!isRecord(transaction) || !Array.isArray(transaction.commands)) {\n return {\n ok: false,\n document,\n failedCommandIndex: 0,\n diagnostics: invalidScreenCommand('Transaction commands must be an array.', ['commands']),\n };\n }\n if (transaction.commands.length > 1000) {\n return {\n ok: false,\n document,\n failedCommandIndex: 0,\n diagnostics: [\n screenCommandDiagnostic('CORE_COMMAND_LIMIT_EXCEEDED', ['commands'], 'Transaction exceeds 1000 commands.'),\n ],\n };\n }\n let current = document;\n for (let index = 0; index < transaction.commands.length; index++) {\n // 事务入口已断言语义,后续命令的输入来自上一命令 finalize 的已校验输出,\n // 无需逐命令重复全量断言。\n const result = applyValidatedCommand(current, transaction.commands[index]);\n if (!result.ok) {\n return {\n ok: false,\n document,\n failedCommandIndex: index,\n diagnostics: sortDiagnostics(result.diagnostics.map((item) => prefixDiagnostic(item, ['commands', index]))),\n };\n }\n current = result.document;\n }\n return {\n ok: true,\n document: current,\n changedComponentIds: getNetChangedComponentIds(document, current),\n diagnostics: [],\n };\n}\nfunction applyValidatedCommand(document, command) {\n if (!isRecord(command) || typeof command.type !== 'string') {\n return screenCommandFailure(document, invalidScreenCommand('Command must be an object with a known type.', []));\n }\n switch (command.type) {\n case 'update-canvas':\n return applyCanvas(document, command.patch);\n case 'add-component':\n return applyAddComponentCommand(document, command.component);\n case 'update-components':\n return applyUpdateComponentsCommand(document, command.componentIds, command.patch);\n case 'remove-components':\n return applyRemoveComponentsCommand(document, command.componentIds);\n case 'reparent-components':\n return applyReparentComponentsCommand(document, command.componentIds, command.parentId);\n case 'replace-blueprint':\n return applyBlueprint(document, command.blueprint);\n case 'replace-data-sources':\n return applyReplaceDataSourcesCommand(document, command.dataSources);\n case 'replace-variables':\n return applyVariables(document, command.variables);\n case 'replace-sub-canvases':\n return applySubCanvases(document, command.subCanvases, command.startCanvasId);\n case 'move-components':\n return applyMoveComponentsCommand(document, command.componentIds, command.canvasId);\n case 'rename-variable':\n return applyRenameVariableCommand(document, command);\n case 'update-theme':\n return applyTheme(document, command.patch);\n default:\n return screenCommandFailure(document, invalidScreenCommand('Command type is not supported.', ['type']));\n }\n}\nfunction applyCanvas(document, patch) {\n if (!isExactPatch(patch, CANVAS_FIELDS)) {\n return screenCommandFailure(document, invalidScreenCommand('Canvas patch contains an unknown or invalid field.', ['patch']));\n }\n if (Object.keys(patch).length === 0) {\n return screenCommandSuccess(document, []);\n }\n // null 值表示删除字段(canvas 字段均不可空,无歧义);其余值合并。\n const canvas = { ...document.canvas };\n for (const [key, value] of Object.entries(patch)) {\n if (value === null) {\n delete canvas[key];\n }\n else {\n canvas[key] = value;\n }\n }\n if (screenJsonEquals(document.canvas, canvas)) {\n return screenCommandSuccess(document, []);\n }\n return finalizeScreenCommand(document, { ...document, canvas }, []);\n}\nfunction applyTheme(document, patch) {\n if (!isRecord(patch)) {\n return screenCommandFailure(document, invalidScreenCommand('Theme patch must be an object of slot colors.', ['patch']));\n }\n for (const [key, value] of Object.entries(patch)) {\n if (!isScreenThemeSlot(key) ||\n typeof value !== 'string' ||\n value.trim() === '' ||\n value.length > 64) {\n return screenCommandFailure(document, invalidScreenCommand('Theme patch keys must be palette slots with color strings.', [\n 'patch',\n key,\n ]));\n }\n }\n const palette = { ...document.theme?.palette, ...patch };\n // 色板要么不存在、要么六个基础色位齐全:半套色板会让 theme: 引用解析到空洞。\n // 状态色位(ADR-0110 §2.6.4)可省略,省略时取内置默认色。\n if (SCREEN_THEME_BASE_SLOTS.some((slot) => typeof palette[slot] !== 'string')) {\n return screenCommandFailure(document, invalidScreenCommand('Theme patch must complete all palette slots.', ['patch']));\n }\n const theme = { palette };\n if (screenJsonEquals(document.theme, theme))\n return screenCommandSuccess(document, []);\n return finalizeScreenCommand(document, { ...document, theme }, []);\n}\nfunction applyVariables(document, variables) {\n if (!Array.isArray(variables)) {\n return screenCommandFailure(document, invalidScreenCommand('Variables must be an array.', ['variables']));\n }\n if (screenJsonEquals(document.variables, variables)) {\n return screenCommandSuccess(document, []);\n }\n return finalizeScreenCommand(document, { ...document, variables }, []);\n}\nfunction applySubCanvases(document, subCanvases, startCanvasId) {\n if (!Array.isArray(subCanvases)) {\n return screenCommandFailure(document, invalidScreenCommand('Sub canvases must be an array.', ['subCanvases']));\n }\n if (startCanvasId !== undefined && startCanvasId !== null && typeof startCanvasId !== 'string') {\n return screenCommandFailure(document, invalidScreenCommand('startCanvasId must be a string or null.', ['startCanvasId']));\n }\n const next = { ...document };\n if (subCanvases.length === 0)\n delete next.subCanvases;\n else\n next.subCanvases = subCanvases;\n if (startCanvasId === null)\n delete next.startCanvasId;\n else if (typeof startCanvasId === 'string')\n next.startCanvasId = startCanvasId;\n else if (\n // 缺省保持原值;原起始页已不是页面(被删 / 改为弹框)时随之去掉,免得整份文档校验失败。\n document.startCanvasId !== undefined &&\n !subCanvases.some((canvas) => isRecord(canvas) && canvas.id === document.startCanvasId && canvas.display === 'page')) {\n delete next.startCanvasId;\n }\n if (screenJsonEquals(document.subCanvases ?? [], subCanvases) &&\n next.startCanvasId === document.startCanvasId) {\n return screenCommandSuccess(document, []);\n }\n return finalizeScreenCommand(document, next, []);\n}\nfunction applyBlueprint(document, blueprint) {\n if (!isRecord(blueprint) || !Array.isArray(blueprint.nodes) || !Array.isArray(blueprint.edges)) {\n return screenCommandFailure(document, invalidScreenCommand('Blueprint must be a canonical object.', ['blueprint']));\n }\n if (screenJsonEquals(document.blueprint, blueprint))\n return screenCommandSuccess(document, []);\n return finalizeScreenCommand(document, { ...document, blueprint }, []);\n}\nfunction getNetChangedComponentIds(before, after) {\n const afterById = new Map(after.components.map((component) => [component.id, component]));\n const beforeById = new Map(before.components.map((component) => [component.id, component]));\n // 命令路径结构共享:未变更组件在 before/after 中是同一引用(screenJsonEquals(x, x) 恒真)。\n // 先按引用短路,仅对引用变化(真正被命令改写)的少数组件做深比较,\n // 语义与全量深比较完全一致,成本从 O(n×fields) 降为 O(changed×fields)。\n const current = after.components\n .filter((component) => beforeById.get(component.id) !== component &&\n !screenJsonEquals(beforeById.get(component.id), component))\n .map(({ id }) => id);\n const removed = before.components\n .filter((component) => !afterById.has(component.id))\n .map(({ id }) => id);\n // 实例结果变化时,读它的组件也必须重投影:值在「实例 + 取值引用」这条链上,\n // 而不是挂在组件上,因此「组件被 patch」不是唯一的重绘判据。\n const changed = new Set([...current, ...removed]);\n const affected = componentsReferencingDataSources(after, changedDataSourceIds(before.dataSources ?? [], after.dataSources ?? []));\n const dependents = affected.filter((id) => !changed.has(id));\n return dependents.length === 0 ? [...changed] : [...changed, ...dependents];\n}\n//# sourceMappingURL=apply.js.map","import { parseScreenJsonValue } from '@base-screen/contracts';\nimport { isRecord } from './command-input.js';\nimport { invalidScreenCommand } from './command-result.js';\nconst COMMAND_TYPES = new Set([\n 'update-canvas',\n 'add-component',\n 'update-components',\n 'remove-components',\n 'reparent-components',\n 'replace-blueprint',\n 'replace-data-sources',\n 'replace-variables',\n 'replace-sub-canvases',\n 'move-components',\n 'rename-variable',\n 'update-theme',\n]);\nconst COMMAND_FIELDS = {\n 'update-canvas': new Set(['type', 'patch']),\n 'add-component': new Set(['type', 'component']),\n 'update-components': new Set(['type', 'componentIds', 'patch']),\n 'remove-components': new Set(['type', 'componentIds']),\n 'reparent-components': new Set(['type', 'componentIds', 'parentId']),\n 'replace-blueprint': new Set(['type', 'blueprint']),\n 'replace-data-sources': new Set(['type', 'dataSources']),\n 'replace-variables': new Set(['type', 'variables']),\n 'replace-sub-canvases': new Set(['type', 'subCanvases', 'startCanvasId']),\n 'move-components': new Set(['type', 'componentIds', 'canvasId']),\n 'rename-variable': new Set(['type', 'variableId', 'nextName']),\n 'update-theme': new Set(['type', 'patch']),\n};\n/** 可缺省的命令字段(其余字段必填)。 */\nconst OPTIONAL_FIELDS = {\n 'replace-sub-canvases': new Set(['startCanvasId']),\n};\nconst MAX_COMMAND_BYTES = 256 * 1024;\nexport function parseScreenDocumentCommand(input) {\n const parsed = parseScreenJsonValue(input, { maxBytes: MAX_COMMAND_BYTES });\n if (!parsed.ok) {\n return parsed;\n }\n if (!isRecord(parsed.value) || typeof parsed.value.type !== 'string') {\n return {\n ok: false,\n diagnostics: invalidScreenCommand('Command must be an object with a known type.', []),\n };\n }\n const type = parsed.value.type;\n if (!COMMAND_TYPES.has(type)) {\n return {\n ok: false,\n diagnostics: invalidScreenCommand('Command type is not supported.', ['type']),\n };\n }\n const allowed = COMMAND_FIELDS[type];\n for (const key of Object.keys(parsed.value)) {\n if (!allowed.has(key)) {\n return {\n ok: false,\n diagnostics: invalidScreenCommand('Command contains an unknown field.', [key]),\n };\n }\n }\n for (const field of allowed) {\n if (OPTIONAL_FIELDS[type]?.has(field) === true)\n continue;\n if (!Object.hasOwn(parsed.value, field)) {\n return {\n ok: false,\n diagnostics: invalidScreenCommand('Command field is required.', [field]),\n };\n }\n }\n return { ok: true, value: parsed.value, diagnostics: [] };\n}\n//# sourceMappingURL=parse-command.js.map","const MAX_VALUE_LENGTH = 80;\n/**\n * 文档级 diff:按组件 id 对齐,给出属性级差异行。\n *\n * 放在 core 而不是 engine:工具面与设计器要用同一份实现,否则会出现两套口径。\n * 只比较文档本身,不关心它是怎么产生的。\n */\nexport function diffScreenDocuments(before, after) {\n const beforeById = new Map(before.components.map((component) => [component.id, component]));\n const afterById = new Map(after.components.map((component) => [component.id, component]));\n const rows = [];\n for (const component of after.components) {\n const previous = beforeById.get(component.id);\n if (previous === undefined) {\n rows.push({\n componentId: component.id,\n componentName: component.name,\n kind: 'added',\n entries: [],\n });\n continue;\n }\n const entries = diffComponent(previous, component);\n if (entries.length > 0) {\n rows.push({\n componentId: component.id,\n componentName: component.name,\n kind: 'changed',\n entries,\n });\n }\n }\n for (const component of before.components) {\n if (afterById.has(component.id))\n continue;\n rows.push({\n componentId: component.id,\n componentName: component.name,\n kind: 'removed',\n entries: [],\n });\n }\n return rows;\n}\nfunction diffComponent(before, after) {\n const entries = [];\n compareValue('name', before.name, after.name, entries);\n compareValue('position.x', before.position.x, after.position.x, entries);\n compareValue('position.y', before.position.y, after.position.y, entries);\n compareValue('size.width', before.size.width, after.size.width, entries);\n compareValue('size.height', before.size.height, after.size.height, entries);\n compareValue('rotation', before.rotation, after.rotation, entries);\n compareValue('zIndex', before.zIndex, after.zIndex, entries);\n diffObject('props', before.props, after.props, entries);\n diffObject('style', before.style, after.style, entries);\n compareValue('dataValue', before.dataValue ?? null, after.dataValue ?? null, entries);\n compareValue('dataSource', before.dataSource ?? null, after.dataSource ?? null, entries);\n compareValue('states', before.states ?? null, after.states ?? null, entries);\n return entries;\n}\nfunction diffObject(prefix, before, after, entries) {\n const keys = [...new Set([...Object.keys(before), ...Object.keys(after)])].sort();\n for (const key of keys) {\n compareValue(`${prefix}.${key}`, before[key], after[key], entries);\n }\n}\nfunction compareValue(path, before, after, entries) {\n const beforeJson = stableJson(before);\n if (beforeJson === stableJson(after))\n return;\n entries.push({ path, before: formatValue(beforeJson), after: formatValue(stableJson(after)) });\n}\nfunction stableJson(value) {\n if (value === undefined)\n return 'null';\n return JSON.stringify(value) ?? 'null';\n}\nfunction formatValue(json) {\n return json.length > MAX_VALUE_LENGTH ? `${json.slice(0, MAX_VALUE_LENGTH - 1)}…` : json;\n}\n//# sourceMappingURL=screen-diff.js.map","import { normalizeZero } from '../internal/preconditions.js';\nimport { computeComponentBounds } from './bounds.js';\nexport function getScreenComponentBounds(component) {\n const bounds = computeComponentBounds(component);\n if (bounds === null) {\n throw new RangeError('Component geometry must be finite with positive dimensions.');\n }\n return bounds;\n}\nexport function getScreenSelectionBounds(components) {\n if (components.length === 0) {\n return null;\n }\n const first = getScreenComponentBounds(components[0]);\n let left = first.left;\n let top = first.top;\n let right = first.right;\n let bottom = first.bottom;\n for (let index = 1; index < components.length; index++) {\n const bounds = getScreenComponentBounds(components[index]);\n left = Math.min(left, bounds.left);\n top = Math.min(top, bounds.top);\n right = Math.max(right, bounds.right);\n bottom = Math.max(bottom, bounds.bottom);\n }\n return {\n left: normalizeZero(left),\n top: normalizeZero(top),\n right: normalizeZero(right),\n bottom: normalizeZero(bottom),\n };\n}\n//# sourceMappingURL=component-bounds.js.map","import { buildComponentIndex, isEffectiveHidden, isEffectiveLocked, } from '../hierarchy/hierarchy.js';\nimport { normalizeZero } from '../internal/preconditions.js';\nimport { getScreenComponentBounds } from './component-bounds.js';\nexport function calculateScreenAlignment(components, axis, mode) {\n if (axis !== 'x' && axis !== 'y') {\n throw new RangeError('Alignment axis must be x or y.');\n }\n if (mode !== 'start' && mode !== 'center' && mode !== 'end') {\n throw new RangeError('Alignment mode must be start, center, or end.');\n }\n const visible = getVisibleComponents(components);\n if (visible.length < 2) {\n return [];\n }\n const fixed = visible.filter(({ locked }) => locked);\n const candidates = fixed.length > 0 ? fixed : visible;\n const starts = candidates.map(({ bounds }) => axisStart(bounds, axis));\n const ends = candidates.map(({ bounds }) => axisEnd(bounds, axis));\n // start 对齐到最左/最上,end 对齐到最右/最下;center 对齐到选区并集的中心。\n const reference = mode === 'start'\n ? Math.min(...starts)\n : mode === 'end'\n ? Math.max(...ends)\n : (Math.min(...starts) + Math.max(...ends)) / 2;\n return visible\n .filter(({ locked }) => !locked)\n .map(({ component, bounds }) => ({\n componentId: component.id,\n delta: deltaForAxis(axis, reference - axisValue(bounds, axis, mode)),\n }))\n .filter(({ delta }) => delta.x !== 0 || delta.y !== 0)\n .sort(compareDelta);\n}\nexport function calculateScreenDistribution(components, axis) {\n if (axis !== 'x' && axis !== 'y') {\n throw new RangeError('Distribution axis must be x or y.');\n }\n const items = [...getVisibleComponents(components)].sort((left, right) => {\n const byStart = axisStart(left.bounds, axis) - axisStart(right.bounds, axis);\n return byStart !== 0 ? byStart : compareStrings(left.component.id, right.component.id);\n });\n if (items.length < 2) {\n return [];\n }\n const fixedIndices = new Set([0, items.length - 1]);\n for (let index = 0; index < items.length; index++) {\n if (items[index].locked) {\n fixedIndices.add(index);\n }\n }\n const orderedFixed = [...fixedIndices].sort((left, right) => left - right);\n const deltas = [];\n for (let fixedIndex = 1; fixedIndex < orderedFixed.length; fixedIndex++) {\n const startIndex = orderedFixed[fixedIndex - 1];\n const endIndex = orderedFixed[fixedIndex];\n const moving = items.slice(startIndex + 1, endIndex);\n if (moving.length === 0) {\n continue;\n }\n const start = items[startIndex];\n const end = items[endIndex];\n const available = axisStart(end.bounds, axis) - axisEnd(start.bounds, axis);\n const movingSize = moving.reduce((total, item) => total + axisSize(item.bounds, axis), 0);\n const gap = (available - movingSize) / (moving.length + 1);\n let cursor = axisEnd(start.bounds, axis) + gap;\n for (const item of moving) {\n const delta = cursor - axisStart(item.bounds, axis);\n if (delta !== 0) {\n deltas.push({ componentId: item.component.id, delta: deltaForAxis(axis, delta) });\n }\n cursor += axisSize(item.bounds, axis) + gap;\n }\n }\n return deltas.sort(compareDelta);\n}\nfunction getVisibleComponents(components) {\n const document = { components };\n const index = buildComponentIndex(document);\n return components\n .filter((component) => !isEffectiveHidden(index, component.id))\n .map((component) => ({\n component,\n bounds: getScreenComponentBounds(component),\n locked: isEffectiveLocked(index, component.id),\n }));\n}\nfunction axisStart(bounds, axis) {\n return axis === 'x' ? bounds.left : bounds.top;\n}\nfunction axisEnd(bounds, axis) {\n return axis === 'x' ? bounds.right : bounds.bottom;\n}\nfunction axisSize(bounds, axis) {\n return axisEnd(bounds, axis) - axisStart(bounds, axis);\n}\nfunction axisValue(bounds, axis, mode) {\n const start = axisStart(bounds, axis);\n if (mode === 'start') {\n return start;\n }\n const end = axisEnd(bounds, axis);\n return mode === 'end' ? end : start + (end - start) / 2;\n}\nfunction deltaForAxis(axis, value) {\n return axis === 'x' ? { x: normalizeZero(value), y: 0 } : { x: 0, y: normalizeZero(value) };\n}\nfunction compareDelta(left, right) {\n return compareStrings(left.componentId, right.componentId);\n}\nfunction compareStrings(left, right) {\n return left < right ? -1 : left > right ? 1 : 0;\n}\n//# sourceMappingURL=alignment.js.map","import { assertFinite } from '../internal/preconditions.js';\nexport function assertPoint(point, name) {\n if (point === null || typeof point !== 'object') {\n throw new RangeError(`${name} must be a finite point.`);\n }\n assertFinite(point.x, `${name}.x`);\n assertFinite(point.y, `${name}.y`);\n}\nexport function assertRect(rect) {\n if (rect === null || typeof rect !== 'object') {\n throw new RangeError('Rectangle must be an object.');\n }\n assertFinite(rect.x, 'rect.x');\n assertFinite(rect.y, 'rect.y');\n assertFinite(rect.width, 'rect.width');\n assertFinite(rect.height, 'rect.height');\n if (rect.width <= 0 || rect.height <= 0) {\n throw new RangeError('Rectangle dimensions must be positive.');\n }\n}\nexport function assertViewport(viewport) {\n if (viewport === null || typeof viewport !== 'object' || viewport.offset === null) {\n throw new RangeError('Viewport must contain a zoom and finite offset.');\n }\n if (viewport.zoom < 0.05 || viewport.zoom > 64) {\n throw new RangeError('Viewport zoom must be from 0.05 through 64.');\n }\n assertFinite(viewport.zoom, 'viewport.zoom');\n assertPoint(viewport.offset, 'viewport.offset');\n}\n//# sourceMappingURL=validation.js.map","import { buildComponentIndex, getPainterOrder, isEffectiveHidden } from '../hierarchy/hierarchy.js';\nimport { assertCoreValidDocument } from '../internal/document.js';\nimport { normalizePoint } from '../internal/preconditions.js';\nimport { getScreenComponentBounds } from './component-bounds.js';\nimport { assertPoint, assertRect } from './validation.js';\nexport function hitTestScreenComponents(document, point, options = {}) {\n assertCoreValidDocument(document);\n assertPoint(point, 'point');\n const minimumThickness = options.minimumThickness ?? 0;\n if (!Number.isFinite(minimumThickness) || minimumThickness < 0) {\n throw new RangeError('Hit test minimumThickness must be a non-negative finite number.');\n }\n const index = buildComponentIndex(document);\n const byId = index.byId;\n return [...getPainterOrder(document)].reverse().filter((id) => {\n const component = byId.get(id)?.component;\n return (component !== undefined &&\n !isEffectiveHidden(index, id) &&\n pointInComponent(point, component, minimumThickness));\n });\n}\nexport function queryScreenComponentsInRect(document, rect, mode) {\n assertCoreValidDocument(document);\n assertRect(rect);\n if (mode !== 'intersect' && mode !== 'contain') {\n throw new RangeError('Query mode must be intersect or contain.');\n }\n const index = buildComponentIndex(document);\n return document.components\n .filter((component) => {\n if (isEffectiveHidden(index, component.id)) {\n return false;\n }\n const corners = getComponentCorners(component);\n return mode === 'contain'\n ? corners.every((corner) => pointInRect(corner, rect))\n : rotatedRectIntersectsRect(corners, rect);\n })\n .map(({ id }) => id);\n}\nfunction pointInComponent(point, component, minimumThickness) {\n const width = component.size.width;\n const height = component.size.height;\n // 薄轴上的命中带以中心为轴加宽,厚轴不受影响;判断仍在组件局部坐标系里做,\n // 所以旋转后的命中带与组件本身同向。\n const padX = Math.max(0, minimumThickness - width) / 2;\n const padY = Math.max(0, minimumThickness - height) / 2;\n const centerX = component.position.x + width / 2;\n const centerY = component.position.y + height / 2;\n const radians = (-component.rotation * Math.PI) / 180;\n const cos = Math.cos(radians);\n const sin = Math.sin(radians);\n const x = (point.x - centerX) * cos - (point.y - centerY) * sin + width / 2;\n const y = (point.x - centerX) * sin + (point.y - centerY) * cos + height / 2;\n return x >= -padX && x <= width + padX && y >= -padY && y <= height + padY;\n}\nfunction getComponentCorners(component) {\n getScreenComponentBounds(component);\n const centerX = component.position.x + component.size.width / 2;\n const centerY = component.position.y + component.size.height / 2;\n const halfWidth = component.size.width / 2;\n const halfHeight = component.size.height / 2;\n const radians = (component.rotation * Math.PI) / 180;\n const cos = Math.cos(radians);\n const sin = Math.sin(radians);\n return [\n { x: -halfWidth, y: -halfHeight },\n { x: halfWidth, y: -halfHeight },\n { x: halfWidth, y: halfHeight },\n { x: -halfWidth, y: halfHeight },\n ].map(({ x, y }) => normalizePoint({\n x: centerX + x * cos - y * sin,\n y: centerY + x * sin + y * cos,\n }));\n}\nfunction rotatedRectIntersectsRect(corners, rect) {\n if (corners.some((corner) => pointInRect(corner, rect))) {\n return true;\n }\n const rectCorners = [\n { x: rect.x, y: rect.y },\n { x: rect.x + rect.width, y: rect.y },\n { x: rect.x + rect.width, y: rect.y + rect.height },\n { x: rect.x, y: rect.y + rect.height },\n ];\n if (rectCorners.some((corner) => pointInPolygon(corner, corners))) {\n return true;\n }\n for (let index = 0; index < corners.length; index++) {\n const a = corners[index];\n const b = corners[(index + 1) % corners.length];\n for (let rectIndex = 0; rectIndex < rectCorners.length; rectIndex++) {\n const c = rectCorners[rectIndex];\n const d = rectCorners[(rectIndex + 1) % rectCorners.length];\n if (segmentsIntersect(a, b, c, d)) {\n return true;\n }\n }\n }\n return false;\n}\nfunction pointInPolygon(point, corners) {\n let hasPositive = false;\n let hasNegative = false;\n for (let index = 0; index < corners.length; index++) {\n const start = corners[index];\n const end = corners[(index + 1) % corners.length];\n const cross = (end.x - start.x) * (point.y - start.y) - (end.y - start.y) * (point.x - start.x);\n hasPositive ||= cross > 0;\n hasNegative ||= cross < 0;\n }\n return !(hasPositive && hasNegative);\n}\nfunction segmentsIntersect(a, b, c, d) {\n const cross = (first, second, third) => (second.x - first.x) * (third.y - first.y) - (second.y - first.y) * (third.x - first.x);\n const abC = cross(a, b, c);\n const abD = cross(a, b, d);\n const cdA = cross(c, d, a);\n const cdB = cross(c, d, b);\n if (abC === 0 && pointOnSegment(c, a, b)) {\n return true;\n }\n if (abD === 0 && pointOnSegment(d, a, b)) {\n return true;\n }\n if (cdA === 0 && pointOnSegment(a, c, d)) {\n return true;\n }\n if (cdB === 0 && pointOnSegment(b, c, d)) {\n return true;\n }\n return abC > 0 !== abD > 0 && cdA > 0 !== cdB > 0;\n}\nfunction pointOnSegment(point, start, end) {\n return (point.x >= Math.min(start.x, end.x) &&\n point.x <= Math.max(start.x, end.x) &&\n point.y >= Math.min(start.y, end.y) &&\n point.y <= Math.max(start.y, end.y));\n}\nfunction pointInRect(point, rect) {\n return (point.x >= rect.x &&\n point.x <= rect.x + rect.width &&\n point.y >= rect.y &&\n point.y <= rect.y + rect.height);\n}\n//# sourceMappingURL=hit-testing.js.map","import { buildComponentIndex, isEffectiveHidden, isEffectiveLocked } from './hierarchy.js';\nexport function isScreenComponentEffectivelyHidden(document, componentId) {\n return isEffectiveHidden(buildComponentIndex(document), componentId);\n}\nexport function isScreenComponentEffectivelyLocked(document, componentId) {\n return isEffectiveLocked(buildComponentIndex(document), componentId);\n}\n//# sourceMappingURL=query.js.map","import { assertCoreValidDocument } from '../internal/document.js';\nexport function createScreenHistory(document) {\n assertCoreValidDocument(document);\n return { past: [], present: document, future: [] };\n}\nexport function commitScreenHistory(history, document, limit = 100, provenance) {\n assertHistory(history);\n assertCoreValidDocument(document);\n assertHistoryLimit(limit);\n if (document === history.present) {\n return history;\n }\n const past = [\n ...history.past,\n {\n before: history.present,\n after: document,\n ...(provenance === undefined ? {} : { provenance }),\n },\n ];\n return {\n past: past.length > limit ? past.slice(past.length - limit) : past,\n present: document,\n future: [],\n };\n}\nexport function undoScreenHistory(history) {\n assertHistory(history);\n const entry = history.past.at(-1);\n if (entry === undefined) {\n return history;\n }\n return {\n past: history.past.slice(0, -1),\n present: entry.before,\n future: [copyEntry(entry), ...history.future],\n };\n}\nexport function redoScreenHistory(history) {\n assertHistory(history);\n const entry = history.future[0];\n if (entry === undefined) {\n return history;\n }\n return {\n past: [...history.past, copyEntry(entry)],\n present: entry.after,\n future: history.future.slice(1),\n };\n}\n/**\n * 指针式回退:把当前状态移到任意历史节点,不删除任何节点。\n *\n * 被跳过的节点整体进入 future(保持顺序),因此「回退本身」可以再走回来——\n * 一次 redo 前进一格,或再次调用本函数回到原处。\n */\nexport function revertScreenHistory(history, targetIndex) {\n assertHistory(history);\n if (!Number.isInteger(targetIndex) || targetIndex < 0 || targetIndex > history.past.length) {\n throw new RangeError('History revert target must be an integer from 0 through past.length.');\n }\n const target = targetIndex === 0 ? history.past[0]?.before : history.past[targetIndex - 1]?.after;\n if (target === undefined || target === history.present) {\n return history;\n }\n return {\n past: history.past.slice(0, targetIndex),\n present: target,\n future: [...history.past.slice(targetIndex), ...history.future],\n };\n}\n/**\n * 历史节点列表:0 表示初始状态,其余按提交顺序编号,携带来源标注。\n *\n * `future` 里的节点同样列出,因此界面能画出「前进栈」:撤销与回退都不删节点,\n * 用户看得到自己退到了哪一格、还能往哪走。`position` 只相对于当前指针,\n * 不代表节点是否可编辑。\n */\nexport function readScreenHistoryNodes(history) {\n assertHistory(history);\n const current = history.past.length;\n const nodes = [{ index: 0, position: current === 0 ? 'current' : 'past' }];\n history.past.forEach((entry, position) => {\n const index = position + 1;\n nodes.push({\n index,\n position: index === current ? 'current' : 'past',\n ...(entry.provenance === undefined ? {} : { provenance: entry.provenance }),\n });\n });\n history.future.forEach((entry, offset) => {\n nodes.push({\n index: current + offset + 1,\n position: 'future',\n ...(entry.provenance === undefined ? {} : { provenance: entry.provenance }),\n });\n });\n return nodes;\n}\n/** 复制条目时保留来源标注:撤销后再重做,历史不能丢掉「谁改的」。 */\nfunction copyEntry(entry) {\n return {\n before: entry.before,\n after: entry.after,\n ...(entry.provenance === undefined ? {} : { provenance: entry.provenance }),\n };\n}\nfunction assertHistory(history) {\n if (typeof history.present !== 'object' ||\n history.present === null ||\n !Array.isArray(history.past) ||\n !Array.isArray(history.future)) {\n throw new TypeError('Screen history state is corrupted.');\n }\n}\nfunction assertHistoryLimit(limit) {\n if (!Number.isInteger(limit) || limit < 1 || limit > 1000) {\n throw new RangeError('History limit must be an integer from 1 through 1000.');\n }\n}\n//# sourceMappingURL=history.js.map","import { buildComponentIndex, isEffectiveHidden } from '../hierarchy/hierarchy.js';\nimport { assertCoreValidDocument } from '../internal/document.js';\nexport function reduceScreenInteraction(state, action, document) {\n assertCoreValidDocument(document);\n const selection = canonicalSelection(state.selectedComponentIds, document);\n if (action === null || typeof action !== 'object') {\n return normalize(state, selection, state.focusedComponentId);\n }\n switch (action.type) {\n case 'replace-selection':\n return normalize(state, Array.isArray(action.componentIds)\n ? canonicalSelection(action.componentIds, document)\n : selection, action.focusedComponentId);\n case 'toggle-selection': {\n if (typeof action.componentId !== 'string') {\n return normalize(state, selection, state.focusedComponentId);\n }\n const id = canonicalSelection([action.componentId], document)[0];\n if (id === undefined) {\n return normalize(state, selection, state.focusedComponentId);\n }\n const next = selection.includes(id)\n ? selection.filter((selected) => selected !== id)\n : canonicalSelection([...selection, id], document);\n return normalize(state, next, next.includes(id) ? id : state.focusedComponentId);\n }\n case 'clear-selection':\n return normalize(state, [], null);\n case 'reconcile-document':\n return normalize(state, selection, state.focusedComponentId);\n default:\n return normalize(state, selection, state.focusedComponentId);\n }\n}\nfunction canonicalSelection(ids, document) {\n const requested = new Set(ids.filter((id) => typeof id === 'string'));\n const index = buildComponentIndex(document);\n return document.components\n .filter((component) => requested.has(component.id) && !isEffectiveHidden(index, component.id))\n .map(({ id }) => id);\n}\nfunction normalize(original, selectedComponentIds, focusedComponentId) {\n const focus = typeof focusedComponentId === 'string' && selectedComponentIds.includes(focusedComponentId)\n ? focusedComponentId\n : null;\n if (original.focusedComponentId === focus &&\n original.selectedComponentIds.length === selectedComponentIds.length &&\n original.selectedComponentIds.every((id, index) => id === selectedComponentIds[index])) {\n return original;\n }\n return { selectedComponentIds, focusedComponentId: focus };\n}\n//# sourceMappingURL=interaction.js.map","import { normalizeZero } from '../internal/preconditions.js';\nconst INITIAL_VIEWPORT = { zoom: 1, offset: { x: 0, y: 0 } };\nexport function reduceScreenViewport(state, action) {\n if (!isViewportState(state) || action === null || typeof action !== 'object') {\n return state;\n }\n switch (action.type) {\n case 'reset':\n return state.zoom === 1 && state.offset.x === 0 && state.offset.y === 0\n ? state\n : INITIAL_VIEWPORT;\n case 'pan-by':\n if (!isPoint(action.delta)) {\n return state;\n }\n return withViewport(state, state.zoom, {\n x: state.offset.x + action.delta.x,\n y: state.offset.y + action.delta.y,\n });\n case 'set-offset':\n return isPoint(action.offset) ? withViewport(state, state.zoom, action.offset) : state;\n case 'set-zoom':\n if (!isZoom(action.zoom) || !isPoint(action.anchor)) {\n return state;\n }\n const canvasX = (action.anchor.x - state.offset.x) / state.zoom;\n const canvasY = (action.anchor.y - state.offset.y) / state.zoom;\n return withViewport(state, action.zoom, {\n x: action.anchor.x - canvasX * action.zoom,\n y: action.anchor.y - canvasY * action.zoom,\n });\n default:\n return state;\n }\n}\nfunction withViewport(state, zoom, offset) {\n if (!Number.isFinite(offset.x) || !Number.isFinite(offset.y)) {\n return state;\n }\n const next = { x: normalizeZero(offset.x), y: normalizeZero(offset.y) };\n if (state.zoom === zoom && state.offset.x === next.x && state.offset.y === next.y) {\n return state;\n }\n return { zoom: normalizeZero(zoom), offset: next };\n}\nfunction isViewportState(value) {\n return isZoom(value.zoom) && isPoint(value.offset);\n}\nfunction isZoom(value) {\n return typeof value === 'number' && Number.isFinite(value) && value >= 0.05 && value <= 64;\n}\nfunction isPoint(value) {\n return (value !== null &&\n typeof value === 'object' &&\n typeof value.x === 'number' &&\n typeof value.y === 'number' &&\n Number.isFinite(value.x) &&\n Number.isFinite(value.y));\n}\n//# sourceMappingURL=viewport.js.map"],"mappings":";;;;;;AAUA,SAAgB,EAAiC,GAAU,GAAe;CACtE,IAAM,IAAU,IAAI,IAAI,CAAa;CACrC,IAAI,EAAQ,SAAS,GACjB,OAAO,CAAC;CACZ,IAAM,IAAW,CAAC;CAClB,KAAK,IAAM,KAAa,EAAS,YAAY;EACzC,IAAM,IAAM,EAAU;EAClB,GAAK,SAAS,uBAEd,EAAQ,IAAI,EAAI,YAAY,KAC5B,EAAS,KAAK,EAAU,EAAE;CAClC;CACA,OAAO;AACX;;;ACrBA,SAAgB,EAAgB,GAAa;CACzC,OAAO,EAAsB,CAAW;AAC5C;AAKA,SAAgB,EAAiB,GAAY,GAAQ;CACjD,OAAO;EACH,UAAU,EAAW;EACrB,MAAM,EAAW;EACjB,MAAM,CAAC,GAAG,GAAQ,GAAG,EAAW,IAAI;EACpC,SAAS,EAAW;CACxB;AACJ;;;AChBA,IAAa,IAAb,cAA8C,MAAM;CAChD,OAAO;CACP;CACA,YAAY,GAAa;EAErB,AADA,MAAM,kDAAkD,GACxD,KAAK,cAAc;CACvB;AACJ;;;ACPA,SAAgB,EAAa,GAAO,GAAM;CACtC,IAAI,CAAC,OAAO,SAAS,CAAK,GACtB,MAAU,WAAW,GAAG,EAAK,0BAA0B;AAE/D;AACA,SAAgB,EAAc,GAAO;CACjC,OAAO,OAAO,GAAG,GAAO,EAAE,IAAI,IAAI;AACtC;AACA,S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AAO,GAAO,EAAM,IAAI,KAAK,EAAQ,EAAM,MAAM;AACrD;AACA,SAAS,GAAO,GAAO;CACnB,OAAO,OAAO,KAAU,YAAY,OAAO,SAAS,CAAK,KAAK,KAAS,OAAQ,KAAS;AAC5F;AACA,SAAS,EAAQ,GAAO;CACpB,OACI,OAAO,KAAU,cADb,KAEJ,OAAO,EAAM,KAAM,YACnB,OAAO,EAAM,KAAM,YACnB,OAAO,SAAS,EAAM,CAAC,KACvB,OAAO,SAAS,EAAM,CAAC;AAC/B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "base-screen",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "大屏设计器基座:Viewer / Designer / 物料 / 插件 / 宿主接入辅助,单包分发、按子路径引入",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -45,16 +45,16 @@
45
45
  }
46
46
  },
47
47
  "devDependencies": {
48
- "@base-screen/host-kit": "^0.1.0",
49
- "@base-screen/contracts": "^0.1.0",
50
- "@base-screen/core": "^0.1.0",
51
- "@base-screen/plugin-core": "^0.1.0",
52
- "@base-screen/engine": "^0.1.0",
53
- "@base-screen/material": "^0.1.0",
54
- "@base-screen/sdk": "^0.1.1",
55
- "@base-screen/renderer": "^0.1.0",
56
- "@base-screen/plugin-sdk": "^0.1.0",
57
- "@base-screen/plugin-manager": "^0.1.0"
48
+ "@base-screen/contracts": "^0.2.0",
49
+ "@base-screen/host-kit": "^0.2.0",
50
+ "@base-screen/material": "^0.2.0",
51
+ "@base-screen/engine": "^0.2.0",
52
+ "@base-screen/plugin-sdk": "^0.2.0",
53
+ "@base-screen/core": "^0.2.0",
54
+ "@base-screen/plugin-core": "^0.2.0",
55
+ "@base-screen/plugin-manager": "^0.2.0",
56
+ "@base-screen/renderer": "^0.2.0",
57
+ "@base-screen/sdk": "^0.2.0"
58
58
  },
59
59
  "exports": {
60
60
  ".": {
@@ -1,16 +0,0 @@
1
- import type { ScreenBlueprint, ScreenBlueprintBehaviorRelation, ScreenBlueprintRelation, ScreenBlueprintRelationEffect, ScreenBlueprintRelationTarget, ScreenBlueprintRule } from '../types/document.js';
2
- export type ScreenBlueprintRelationCategory = 'interaction' | 'data' | 'exit' | 'semantic';
3
- /**
4
- * 关系 → 派生规则的唯一权威。
5
- *
6
- * 连续相同 `source + event + condition` 的行为关系合并成一条规则;动作顺序等于关系顺序。
7
- * 规则 id 取组内首条关系 id,不持久化。语义关系不产生规则。
8
- */
9
- export declare function deriveScreenBlueprintRules(blueprint: ScreenBlueprint): readonly ScreenBlueprintRule[];
10
- /** 效果类型决定目标端点的种类;Zod、引用校验与引擎连接共用这一判定。 */
11
- export declare function screenBlueprintEffectTargetKind(effect: ScreenBlueprintRelationEffect): ScreenBlueprintRelationTarget['kind'];
12
- /** 面向作者面的四类关系:交互联动、数据共享、业务出口、语义关联。 */
13
- export declare function readScreenBlueprintRelationCategory(relation: ScreenBlueprintRelation): ScreenBlueprintRelationCategory;
14
- /** 行为关系派生出的能力集合;`requiredCapabilities` 作为宿主附加门禁并入。 */
15
- export declare function relationCapabilities(relation: ScreenBlueprintBehaviorRelation): readonly string[];
16
- //# sourceMappingURL=blueprint-relations.d.ts.map
@@ -1,196 +0,0 @@
1
- import { serializeCanonicalJson } from '../json/canonical.js';
2
- import { SCREEN_BLUEPRINT_CAPABILITIES } from './blueprint-capabilities.js';
3
- const derivedRuleCache = new WeakMap();
4
- /**
5
- * 关系 → 派生规则的唯一权威。
6
- *
7
- * 连续相同 `source + event + condition` 的行为关系合并成一条规则;动作顺序等于关系顺序。
8
- * 规则 id 取组内首条关系 id,不持久化。语义关系不产生规则。
9
- */
10
- export function deriveScreenBlueprintRules(blueprint) {
11
- const cached = derivedRuleCache.get(blueprint);
12
- if (cached !== undefined)
13
- return cached;
14
- const rules = [];
15
- let previousGroupKey;
16
- for (const relation of blueprint.relations) {
17
- if (relation.type !== 'behavior')
18
- continue;
19
- const groupKey = behaviorRelationGroupKey(relation);
20
- let rule = rules[rules.length - 1];
21
- if (rule === undefined || previousGroupKey !== groupKey) {
22
- rule = {
23
- id: relation.id,
24
- trigger: triggerOf(relation),
25
- ...(relation.condition === undefined ? {} : { condition: relation.condition }),
26
- actions: [],
27
- relationIds: [],
28
- capabilities: new Set(),
29
- };
30
- rules.push(rule);
31
- previousGroupKey = groupKey;
32
- }
33
- rule.relationIds.push(relation.id);
34
- rule.actions.push(actionOf(relation));
35
- for (const capability of relationCapabilities(relation))
36
- rule.capabilities.add(capability);
37
- }
38
- const derived = rules.map((rule) => ({
39
- id: rule.id,
40
- trigger: rule.trigger,
41
- ...(rule.condition === undefined ? {} : { condition: rule.condition }),
42
- actions: rule.actions,
43
- relationIds: rule.relationIds,
44
- requiredCapabilities: [...rule.capabilities].sort(),
45
- }));
46
- derivedRuleCache.set(blueprint, derived);
47
- return derived;
48
- }
49
- /** 效果类型决定目标端点的种类;Zod、引用校验与引擎连接共用这一判定。 */
50
- export function screenBlueprintEffectTargetKind(effect) {
51
- switch (effect.type) {
52
- case 'component-visibility':
53
- case 'request-component-data':
54
- return 'component';
55
- case 'set-variable':
56
- case 'request-variable':
57
- return 'variable';
58
- case 'emit-host-event':
59
- case 'host-action':
60
- return 'host';
61
- }
62
- }
63
- /** 面向作者面的四类关系:交互联动、数据共享、业务出口、语义关联。 */
64
- export function readScreenBlueprintRelationCategory(relation) {
65
- if (relation.type === 'semantic')
66
- return 'semantic';
67
- switch (relation.effect.type) {
68
- case 'component-visibility':
69
- case 'request-component-data':
70
- return 'interaction';
71
- case 'set-variable':
72
- case 'request-variable':
73
- return 'data';
74
- case 'emit-host-event':
75
- case 'host-action':
76
- return 'exit';
77
- }
78
- }
79
- /** 行为关系派生出的能力集合;`requiredCapabilities` 作为宿主附加门禁并入。 */
80
- export function relationCapabilities(relation) {
81
- const capabilities = new Set([
82
- relation.source.kind === 'component'
83
- ? SCREEN_BLUEPRINT_CAPABILITIES.materialEvent
84
- : SCREEN_BLUEPRINT_CAPABILITIES.variableEvent,
85
- ]);
86
- if (relation.condition !== undefined) {
87
- capabilities.add(SCREEN_BLUEPRINT_CAPABILITIES.condition);
88
- collectExpressionCapabilities(relation.condition.left, capabilities);
89
- if (relation.condition.right !== undefined) {
90
- collectExpressionCapabilities(relation.condition.right, capabilities);
91
- }
92
- }
93
- const effect = relation.effect;
94
- if (effect.type === 'set-variable') {
95
- capabilities.add(SCREEN_BLUEPRINT_CAPABILITIES.setVariable);
96
- collectExpressionCapabilities(effect.value, capabilities);
97
- }
98
- else if (effect.type === 'emit-host-event') {
99
- capabilities.add(SCREEN_BLUEPRINT_CAPABILITIES.emitHostEvent);
100
- collectExpressionCapabilities(effect.payload, capabilities);
101
- }
102
- else if (effect.type === 'component-visibility') {
103
- capabilities.add(SCREEN_BLUEPRINT_CAPABILITIES.componentVisibility);
104
- }
105
- else if (effect.type === 'host-action') {
106
- collectExpressionCapabilities(effect.payload, capabilities);
107
- }
108
- else if (effect.type === 'request-variable') {
109
- capabilities.add(SCREEN_BLUEPRINT_CAPABILITIES.requestVariable);
110
- }
111
- else if (effect.type === 'request-component-data') {
112
- capabilities.add(SCREEN_BLUEPRINT_CAPABILITIES.requestComponentData);
113
- }
114
- for (const capability of relation.requiredCapabilities ?? [])
115
- capabilities.add(capability);
116
- return [...capabilities];
117
- }
118
- function behaviorRelationGroupKey(relation) {
119
- const source = relation.source.kind === 'component'
120
- ? `component:${relation.source.componentId}`
121
- : `variable:${relation.source.variableId}`;
122
- const condition = relation.condition === undefined
123
- ? 'null'
124
- : serializeCanonicalJson(relation.condition);
125
- return `${source}\u0000${relation.source.event.eventName}\u0000${condition}`;
126
- }
127
- function triggerOf(relation) {
128
- if (relation.source.kind === 'component') {
129
- return {
130
- type: 'material-event',
131
- componentId: relation.source.componentId,
132
- eventName: relation.source.event.eventName,
133
- };
134
- }
135
- return {
136
- type: 'variable-event',
137
- variableId: relation.source.variableId,
138
- eventName: relation.source.event.eventName,
139
- };
140
- }
141
- function actionOf(relation) {
142
- const target = relation.target;
143
- const effect = relation.effect;
144
- switch (effect.type) {
145
- case 'component-visibility':
146
- if (target.kind !== 'component')
147
- throw unexpectedTarget(relation, 'component');
148
- return {
149
- type: 'component-visibility',
150
- componentId: target.componentId,
151
- operation: effect.operation,
152
- ...(effect.transition === undefined ? {} : { transition: effect.transition }),
153
- };
154
- case 'request-component-data':
155
- if (target.kind !== 'component')
156
- throw unexpectedTarget(relation, 'component');
157
- return { type: 'request-component-data', componentId: target.componentId };
158
- case 'set-variable':
159
- if (target.kind !== 'variable')
160
- throw unexpectedTarget(relation, 'variable');
161
- return { type: 'set-variable', variableId: target.variableId, value: effect.value };
162
- case 'request-variable':
163
- if (target.kind !== 'variable')
164
- throw unexpectedTarget(relation, 'variable');
165
- return { type: 'request-variable', variableId: target.variableId };
166
- case 'emit-host-event':
167
- if (target.kind !== 'host')
168
- throw unexpectedTarget(relation, 'host');
169
- return { type: 'emit-host-event', eventName: effect.eventName, payload: effect.payload };
170
- case 'host-action':
171
- if (target.kind !== 'host')
172
- throw unexpectedTarget(relation, 'host');
173
- return { type: 'host-action', actionId: effect.actionId, payload: effect.payload };
174
- }
175
- }
176
- function unexpectedTarget(relation, expected) {
177
- return new Error(`Blueprint relation "${relation.id}" effect "${relation.effect.type}" requires a ${expected} target.`);
178
- }
179
- function collectExpressionCapabilities(expression, capabilities) {
180
- if (expression.kind === 'event-payload') {
181
- capabilities.add(SCREEN_BLUEPRINT_CAPABILITIES.eventPayload);
182
- }
183
- else if (expression.kind === 'variable') {
184
- capabilities.add(SCREEN_BLUEPRINT_CAPABILITIES.variable);
185
- }
186
- else if (expression.kind === 'array') {
187
- for (const item of expression.items)
188
- collectExpressionCapabilities(item, capabilities);
189
- }
190
- else if (expression.kind === 'object') {
191
- for (const item of Object.values(expression.properties)) {
192
- collectExpressionCapabilities(item, capabilities);
193
- }
194
- }
195
- }
196
- //# sourceMappingURL=blueprint-relations.js.map
@@ -1,5 +0,0 @@
1
- import { type ScreenBlueprintBehaviorRelation, type ScreenBlueprintCondition, type ScreenBlueprintRelationEffect, type ScreenDocument, type ScreenParseResult } from '../../../../contracts/index.js';
2
- import type { BaseScreenMaterialCatalog } from '../../../../plugin-core/index.js';
3
- export declare function isDesignerBlueprintConditionOperator(value: string): value is ScreenBlueprintCondition['operator'];
4
- export declare function updateDesignerBlueprintEffectFromTarget(target: Element, document: ScreenDocument, relation: ScreenBlueprintBehaviorRelation, catalog?: BaseScreenMaterialCatalog): ScreenParseResult<ScreenBlueprintRelationEffect | null>;
5
- //# sourceMappingURL=designer-blueprint-panel-mutations.d.ts.map
@@ -1,27 +0,0 @@
1
- import type { ScreenDocument } from '../../../contracts/index.js';
2
- import type { DesignerMetricName } from '../../common/observability/designer-metrics.js';
3
- import { type DesignerGuardSnapshot } from '../../common/validation/designer-guard.js';
4
- export declare class DesignerGuardController {
5
- #private;
6
- connect(strip: HTMLButtonElement, popover: HTMLElement, canvas: HTMLElement, content: HTMLElement): void;
7
- release(): void;
8
- setApplyHandler(handler: (componentId: string, color: string) => boolean): void;
9
- setChangeHandler(handler: (result: DesignerGuardSnapshot) => void): void;
10
- setMetricHandler(handler: (name: DesignerMetricName) => void): void;
11
- /** 关掉守卫只停止测量与展示,不写入任何东西;重新打开会立刻补一次测量。 */
12
- setEnabled(enabled: boolean): void;
13
- get enabled(): boolean;
14
- readResult(): DesignerGuardSnapshot;
15
- schedule(document: ScreenDocument): void;
16
- /** 立即测量并刷新:文档或主题变化后由宿主调用。 */
17
- refresh(document: ScreenDocument): void;
18
- onClick(target: Element): boolean;
19
- onKeyDown(event: KeyboardEvent): boolean;
20
- /** 预览修复:只覆盖这些文本节点的内联颜色,不动文档。 */
21
- private preview;
22
- private applyFix;
23
- private clearPreview;
24
- private close;
25
- private render;
26
- }
27
- //# sourceMappingURL=designer-guard-controller.d.ts.map
@@ -1,47 +0,0 @@
1
- import type { ScreenDocument } from '../../../contracts/index.js';
2
- import type { ScreenTransactionProvenance } from '../../../core/index.js';
3
- import { type DesignerSceneDescriptor, type DesignerSceneHandler, type DesignerScenePreview } from '../../common/operations/scene/designer-scene.js';
4
- export interface DesignerSceneGhostHandlers {
5
- readonly render: (document: ScreenDocument) => boolean;
6
- readonly clear: () => void;
7
- }
8
- export interface DesignerSceneContext {
9
- readonly getDocument: () => ScreenDocument | undefined;
10
- /** 有待决草案时不允许场景预览:两处「未写入」提示不能同时存在。 */
11
- readonly canPreview: () => boolean;
12
- readonly notify: (message: string, tone: 'success' | 'error') => void;
13
- readonly apply: (commands: DesignerScenePreview['commands'], provenance: ScreenTransactionProvenance) => boolean;
14
- readonly applied: (sceneId: string, label: string) => void;
15
- /** 预览已就绪(尚未写入);用于发出度量事件,缺省时什么也不做。 */
16
- readonly previewed?: (sceneId: string) => void;
17
- }
18
- /**
19
- * 场景切换:宿主定义场景,引擎提供左栏切换与画布预览。
20
- *
21
- * 选场景只向宿主请求命令,在文档副本上整批试算后挂到幽灵层,显示「场景预览 · 未写入」;
22
- * 应用时才走一次普通事务(带 provenance),因此可撤销、可回退。宿主未提供处理器时
23
- * 场景不可用,不伪造内容;有待决草案时拒绝切换,避免两条未写入提示互相矛盾。
24
- */
25
- export declare class DesignerSceneController {
26
- #private;
27
- connect(block: HTMLElement, list: HTMLElement, count: HTMLElement, note: HTMLElement, bar: HTMLElement, barName: HTMLElement): void;
28
- release(): void;
29
- setContext(context: DesignerSceneContext): void;
30
- setInstanceId(instanceId: string): void;
31
- setGhostHandlers(handlers: DesignerSceneGhostHandlers): void;
32
- setHandler(handler: DesignerSceneHandler | undefined): void;
33
- setScenes(scenes: readonly DesignerSceneDescriptor[] | undefined, activeId?: string): void;
34
- setActiveScene(sceneId: string | undefined): void;
35
- get activeSceneId(): string | undefined;
36
- get previewing(): boolean;
37
- /** 新的变更提案到达前调用:场景预览让位,避免两条「未写入」提示同时存在。 */
38
- cancelPreview(silent?: boolean): boolean;
39
- request(sceneId: string): Promise<boolean>;
40
- apply(): boolean;
41
- onClick(target: Element): boolean;
42
- onKeyDown(event: KeyboardEvent): boolean;
43
- private render;
44
- private focusSceneRow;
45
- private renderRows;
46
- }
47
- //# sourceMappingURL=designer-scene-controller.d.ts.map
@@ -1,12 +0,0 @@
1
- import type { ScreenDiagnostic, ScreenDocument, ScreenParseResult } from '../../../../contracts/index.js';
2
- import type { ScreenDocumentTransaction } from '../../../../core/index.js';
3
- import type { BaseScreenMaterialCatalog } from '../../../../plugin-core/index.js';
4
- export interface DesignerStyleRulesCallbacks {
5
- readonly getDocument: () => ScreenDocument | undefined;
6
- readonly getCatalog: () => BaseScreenMaterialCatalog | undefined;
7
- readonly executeTransaction: (transaction: ScreenDocumentTransaction) => ScreenParseResult<ScreenDocument>;
8
- readonly emitDiagnostics: (diagnostics: readonly ScreenDiagnostic[]) => void;
9
- }
10
- export declare function handleDesignerStyleRuleClick(target: Element, callbacks: DesignerStyleRulesCallbacks): boolean;
11
- export declare function handleDesignerStyleRuleChange(target: Element, callbacks: DesignerStyleRulesCallbacks): boolean;
12
- //# sourceMappingURL=designer-style-rules-controller.d.ts.map
@@ -1,24 +0,0 @@
1
- import type { ScreenComponentNode } from '../../../../contracts/index.js';
2
- import { type RgbColor } from '../../../../core/index.js';
3
- import type { DesignerContrastSample } from '../../../common/validation/designer-guard.js';
4
- export interface DesignerContrastMeasurement {
5
- readonly samples: readonly DesignerContrastSample[];
6
- /** 参与测量的文本元素,按组件聚合:修复预览只改这些节点的渲染。 */
7
- readonly textElements: ReadonlyMap<string, readonly HTMLElement[]>;
8
- readonly truncated: boolean;
9
- }
10
- export interface DesignerContrastMeasureInput {
11
- /** 画布内容层:物料宿主元素带 `data-base-screen-component-id`。 */
12
- readonly content: HTMLElement;
13
- /** 画布底色(已合成到不透明),用作背景合成的起点。 */
14
- readonly baseBackground: RgbColor;
15
- readonly components: ReadonlyMap<string, ScreenComponentNode>;
16
- }
17
- /**
18
- * 从真实渲染测量文本颜色与有效背景。
19
- *
20
- * 只测量「颜色确实由文档样式驱动」的组件:measured 文本色与 `style.color` 不一致时
21
- * (条件样式、物料内部硬编码、渐变文字),样本仍参与判定,但标记为不可自动修复。
22
- */
23
- export declare function measureCanvasContrast(input: DesignerContrastMeasureInput): DesignerContrastMeasurement;
24
- //# sourceMappingURL=designer-contrast-measure.d.ts.map