base-screen 0.3.0 → 0.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (424) hide show
  1. package/README.md +5 -2
  2. package/dist/_internal/contracts/diagnostics/material-error.d.ts +1 -1
  3. package/dist/_internal/contracts/diagnostics/material-error.js +1 -1
  4. package/dist/_internal/contracts/document/blueprint-graph.d.ts +3 -3
  5. package/dist/_internal/contracts/document/blueprint-graph.js +4 -4
  6. package/dist/_internal/contracts/document/component-states.d.ts +1 -1
  7. package/dist/_internal/contracts/document/component-states.js +1 -1
  8. package/dist/_internal/contracts/document/image-url.js +1 -1
  9. package/dist/_internal/contracts/document/json-schema.js +1 -1
  10. package/dist/_internal/contracts/document/limits.d.ts +5 -5
  11. package/dist/_internal/contracts/document/limits.js +5 -5
  12. package/dist/_internal/contracts/document/references.js +3 -3
  13. package/dist/_internal/contracts/document/schema.d.ts +9 -2
  14. package/dist/_internal/contracts/document/schema.js +4 -4
  15. package/dist/_internal/contracts/document/sub-canvas.d.ts +2 -2
  16. package/dist/_internal/contracts/document/sub-canvas.js +2 -2
  17. package/dist/_internal/contracts/document/theme.d.ts +2 -2
  18. package/dist/_internal/contracts/document/theme.js +2 -2
  19. package/dist/_internal/contracts/document/validate-blueprint.d.ts +1 -1
  20. package/dist/_internal/contracts/document/validate-blueprint.js +1 -1
  21. package/dist/_internal/contracts/document/validate-component.js +2 -2
  22. package/dist/_internal/contracts/document/validate-data-source.js +2 -2
  23. package/dist/_internal/contracts/document/validate-sub-canvas.d.ts +1 -1
  24. package/dist/_internal/contracts/document/validate-sub-canvas.js +1 -1
  25. package/dist/_internal/contracts/document/validate-value-ref.js +6 -1
  26. package/dist/_internal/contracts/index.d.ts +1 -1
  27. package/dist/_internal/contracts/migration/blueprint-graph-migration.d.ts +1 -1
  28. package/dist/_internal/contracts/migration/migrate-document.js +2 -2
  29. package/dist/_internal/contracts/push/delivery.d.ts +1 -1
  30. package/dist/_internal/contracts/push/delivery.js +1 -1
  31. package/dist/_internal/contracts/push/level-scale.d.ts +1 -1
  32. package/dist/_internal/contracts/push/level-scale.js +1 -1
  33. package/dist/_internal/contracts/screen-document.schema.json +15 -3
  34. package/dist/_internal/contracts/types/diagnostics.d.ts +1 -1
  35. package/dist/_internal/contracts/types/document.d.ts +21 -19
  36. package/dist/_internal/contracts/types/execution.d.ts +3 -3
  37. package/dist/_internal/contracts/types/host.d.ts +23 -5
  38. package/dist/_internal/contracts/types/host.js +1 -1
  39. package/dist/_internal/contracts/types/push.d.ts +3 -3
  40. package/dist/_internal/contracts/types/variable.d.ts +3 -3
  41. package/dist/_internal/contracts/variable/parse.js +5 -1
  42. package/dist/_internal/core/blueprint/runtime-compile.d.ts +1 -1
  43. package/dist/_internal/core/blueprint/runtime-compile.js +1 -1
  44. package/dist/_internal/core/blueprint/runtime-dispatch.js +1 -1
  45. package/dist/_internal/core/blueprint/runtime-simulate.d.ts +57 -0
  46. package/dist/_internal/core/blueprint/runtime-simulate.js +177 -0
  47. package/dist/_internal/core/blueprint/runtime-types.d.ts +4 -4
  48. package/dist/_internal/core/blueprint/runtime.d.ts +1 -0
  49. package/dist/_internal/core/blueprint/runtime.js +1 -0
  50. package/dist/_internal/core/commands/apply-collection-commands.d.ts +32 -0
  51. package/dist/_internal/core/commands/apply-collection-commands.js +174 -0
  52. package/dist/_internal/core/commands/apply-component-commands.d.ts +1 -1
  53. package/dist/_internal/core/commands/apply-component-commands.js +2 -2
  54. package/dist/_internal/core/commands/apply.js +15 -2
  55. package/dist/_internal/core/commands/parse-command.js +12 -0
  56. package/dist/_internal/core/commands/types.d.ts +33 -5
  57. package/dist/_internal/core/data/data-candidates.d.ts +38 -0
  58. package/dist/_internal/core/data/data-candidates.js +186 -0
  59. package/dist/_internal/core/data/data-source-dependents.d.ts +1 -1
  60. package/dist/_internal/core/data/data-source-dependents.js +1 -1
  61. package/dist/_internal/core/data/dataset-profile.d.ts +71 -0
  62. package/dist/_internal/core/data/dataset-profile.js +170 -0
  63. package/dist/_internal/core/data/host-dataset.d.ts +2 -2
  64. package/dist/_internal/core/data/host-dataset.js +2 -2
  65. package/dist/_internal/core/data/sample-values.d.ts +25 -0
  66. package/dist/_internal/core/data/sample-values.js +45 -0
  67. package/dist/_internal/core/data/value-ref.d.ts +2 -2
  68. package/dist/_internal/core/data/value-ref.js +1 -1
  69. package/dist/_internal/core/diff/screen-diff.js +6 -0
  70. package/dist/_internal/core/index.d.ts +7 -1
  71. package/dist/_internal/core/index.js +7 -1
  72. package/dist/_internal/core/state/state-preset.d.ts +32 -0
  73. package/dist/_internal/core/state/state-preset.js +37 -0
  74. package/dist/_internal/core/validation/layout-audit.d.ts +17 -0
  75. package/dist/_internal/core/validation/layout-audit.js +228 -0
  76. package/dist/_internal/core/validation/legibility.d.ts +9 -0
  77. package/dist/_internal/core/validation/legibility.js +33 -0
  78. package/dist/_internal/core/validation/validate-semantics.js +1 -1
  79. package/dist/_internal/engine/browser/controllers/blueprint/designer-blueprint-canvas-bridge.d.ts +1 -1
  80. package/dist/_internal/engine/browser/controllers/dataset/designer-data-source-authoring.d.ts +1 -1
  81. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-catalog-controller.d.ts +21 -0
  82. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-controller-context.d.ts +7 -2
  83. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-draft-controller.d.ts +7 -2
  84. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-effective-value.d.ts +1 -1
  85. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-surface-controller.d.ts +1 -1
  86. package/dist/_internal/engine/browser/controllers/dataset/designer-update-policy-authoring.d.ts +1 -1
  87. package/dist/_internal/engine/browser/controllers/designer-artboard-controller.d.ts +1 -1
  88. package/dist/_internal/engine/browser/controllers/designer-canvas-runtime-controller.d.ts +2 -2
  89. package/dist/_internal/engine/browser/controllers/designer-change-controller.d.ts +27 -0
  90. package/dist/_internal/engine/browser/controllers/designer-command-palette-controller.d.ts +1 -1
  91. package/dist/_internal/engine/browser/controllers/designer-intent-controller.d.ts +5 -0
  92. package/dist/_internal/engine/browser/controllers/designer-page-preview-controller.d.ts +1 -1
  93. package/dist/_internal/engine/browser/controllers/designer-popup-preview-controller.d.ts +1 -1
  94. package/dist/_internal/engine/browser/controllers/designer-reference-layer-controller.d.ts +1 -1
  95. package/dist/_internal/engine/browser/controllers/designer-text-edit-controller.d.ts +2 -2
  96. package/dist/_internal/engine/browser/controllers/designer-viewport-controller.d.ts +7 -1
  97. package/dist/_internal/engine/browser/controllers/gesture/designer-drag-gesture.d.ts +6 -1
  98. package/dist/_internal/engine/browser/controllers/gesture/designer-gesture-callbacks.d.ts +1 -1
  99. package/dist/_internal/engine/browser/controllers/panel/designer-component-states-controller.d.ts +1 -1
  100. package/dist/_internal/engine/browser/controllers/panel/designer-panel-controller-callbacks.d.ts +6 -6
  101. package/dist/_internal/engine/browser/controllers/panel/designer-panel-property-controller.d.ts +7 -0
  102. package/dist/_internal/engine/browser/controllers/variables/designer-variable-catalog-controller.d.ts +9 -1
  103. package/dist/_internal/engine/browser/controllers/variables/designer-variable-editor-controller.d.ts +6 -1
  104. package/dist/_internal/engine/browser/controllers/variables/designer-variables-controller.d.ts +16 -1
  105. package/dist/_internal/engine/browser/controllers/workbench/designer-workbench-controller.d.ts +2 -0
  106. package/dist/_internal/engine/browser/controllers/workbench/designer-workbench-tabs-controller.d.ts +2 -0
  107. package/dist/_internal/engine/browser/dom/blueprint/designer-blueprint-inspector-configuration.d.ts +1 -1
  108. package/dist/_internal/engine/browser/dom/change/designer-change-dom.d.ts +21 -5
  109. package/dist/_internal/engine/browser/dom/color/designer-color-palette-model.d.ts +3 -3
  110. package/dist/_internal/engine/browser/dom/color/designer-color-palette-types.d.ts +2 -2
  111. package/dist/_internal/engine/browser/dom/color/designer-color-theme-slots.d.ts +1 -1
  112. package/dist/_internal/engine/browser/dom/dataset/designer-data-group-dom.d.ts +1 -1
  113. package/dist/_internal/engine/browser/dom/dataset/designer-data-panel-notice.d.ts +1 -1
  114. package/dist/_internal/engine/browser/dom/dataset/designer-data-section-diff.d.ts +4 -6
  115. package/dist/_internal/engine/browser/dom/dataset/designer-data-state.d.ts +1 -1
  116. package/dist/_internal/engine/browser/dom/dataset/designer-dataset-authoring-dom.d.ts +1 -1
  117. package/dist/_internal/engine/browser/dom/dataset/designer-dataset-catalog-dom.d.ts +1 -1
  118. package/dist/_internal/engine/browser/dom/dataset/designer-dataset-sections.d.ts +1 -1
  119. package/dist/_internal/engine/browser/dom/dataset/designer-dataset-types.d.ts +11 -4
  120. package/dist/_internal/engine/browser/dom/descriptor/designer-descriptor-control-dom.d.ts +1 -1
  121. package/dist/_internal/engine/browser/dom/descriptor/designer-descriptor-model.d.ts +1 -1
  122. package/dist/_internal/engine/browser/dom/designer-field-primitives.d.ts +1 -1
  123. package/dist/_internal/engine/browser/dom/designer-icons.d.ts +2 -0
  124. package/dist/_internal/engine/browser/dom/designer-text-edit-dom.d.ts +2 -2
  125. package/dist/_internal/engine/browser/dom/designer-variable-inspector-dom.d.ts +7 -0
  126. package/dist/_internal/engine/browser/dom/designer-variables-dom.d.ts +5 -1
  127. package/dist/_internal/engine/browser/dom/designer-variables-editor-dom.d.ts +30 -1
  128. package/dist/_internal/engine/browser/dom/designer-variables-toolbar-dom.d.ts +4 -2
  129. package/dist/_internal/engine/browser/dom/intent/designer-intent-reference-picker-dom.d.ts +2 -0
  130. package/dist/_internal/engine/browser/dom/material-library/designer-material-library-dom.d.ts +1 -1
  131. package/dist/_internal/engine/browser/dom/menu/designer-menu-model.d.ts +3 -3
  132. package/dist/_internal/engine/browser/dom/menu/designer-plugin-command-menu.d.ts +5 -2
  133. package/dist/_internal/engine/browser/dom/panel/designer-canvas-transactions.d.ts +1 -1
  134. package/dist/_internal/engine/browser/dom/panel/designer-component-states-dom.d.ts +2 -2
  135. package/dist/_internal/engine/browser/dom/panel/designer-multi-selection-dom.d.ts +1 -1
  136. package/dist/_internal/engine/browser/dom/panel/designer-panel-primitives.d.ts +2 -2
  137. package/dist/_internal/engine/browser/dom/panel/designer-property-transactions.d.ts +1 -1
  138. package/dist/_internal/engine/browser/dom/value-ref/designer-value-ref-picker-dom.d.ts +1 -1
  139. package/dist/_internal/engine/browser/dom/value-ref/designer-value-ref-picker-mount.d.ts +1 -1
  140. package/dist/_internal/engine/browser/dom/value-ref/designer-value-ref-summary-dom.d.ts +1 -1
  141. package/dist/_internal/engine/browser/dom/value-ref/designer-value-ref-types.d.ts +6 -4
  142. package/dist/_internal/engine/browser/viewport/designer-canvas-aids-types.d.ts +3 -3
  143. package/dist/_internal/engine/browser/viewport/designer-canvas-aids.d.ts +5 -3
  144. package/dist/_internal/engine/browser/viewport/designer-canvas-measurements.d.ts +2 -14
  145. package/dist/_internal/engine/browser/viewport/designer-guide-overlay-nodes.d.ts +2 -0
  146. package/dist/_internal/engine/browser/viewport/designer-snap-tuning.d.ts +14 -0
  147. package/dist/_internal/engine/common/observability/designer-metrics.d.ts +1 -1
  148. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-capabilities.d.ts +1 -1
  149. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-graph.d.ts +5 -5
  150. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-model.d.ts +1 -1
  151. package/dist/_internal/engine/common/operations/blueprint/designer-blueprint-protocol-types.d.ts +2 -2
  152. package/dist/_internal/engine/common/operations/canvas/canvas-background-image.d.ts +1 -1
  153. package/dist/_internal/engine/common/operations/catalog/designer-catalog-refresh.d.ts +1 -1
  154. package/dist/_internal/engine/common/operations/change/designer-change-events.d.ts +2 -0
  155. package/dist/_internal/engine/common/operations/change/designer-change-proposal.d.ts +35 -2
  156. package/dist/_internal/engine/common/operations/designer-clipboard.d.ts +5 -1
  157. package/dist/_internal/engine/common/operations/designer-text-edit-operations.d.ts +1 -1
  158. package/dist/_internal/engine/common/operations/designer-variable-operations.d.ts +3 -3
  159. package/dist/_internal/engine/common/operations/display/designer-target-display.d.ts +2 -2
  160. package/dist/_internal/engine/common/operations/element/designer-element-operation-types.d.ts +1 -1
  161. package/dist/_internal/engine/common/operations/intent/designer-parameter-intent.d.ts +1 -1
  162. package/dist/_internal/engine/common/operations/material-component/material-component-fragment-extract.d.ts +2 -2
  163. package/dist/_internal/engine/common/operations/material-library/material-library-fragments.d.ts +1 -1
  164. package/dist/_internal/engine/common/operations/material-library/material-library-grouping.d.ts +1 -1
  165. package/dist/_internal/engine/common/operations/plugin/designer-plugin-commands.d.ts +2 -0
  166. package/dist/_internal/engine/common/operations/selection/designer-multi-selection-operations.d.ts +9 -9
  167. package/dist/_internal/engine/common/operations/style/designer-component-states.d.ts +12 -7
  168. package/dist/_internal/engine/common/operations/style/designer-material-appearance.d.ts +1 -1
  169. package/dist/_internal/engine/common/session/designer-artboard.d.ts +1 -1
  170. package/dist/_internal/engine/common/session/designer-session.d.ts +1 -1
  171. package/dist/_internal/engine/common/ui-text/designer-blueprint-ui-text.d.ts +3 -3
  172. package/dist/_internal/engine/common/ui-text/designer-ui-text.d.ts +127 -70
  173. package/dist/_internal/engine/{designer-blueprint-workbench-panel-CJ3iZo5v.js → designer-blueprint-workbench-panel-DVvKcSvJ.js} +269 -349
  174. package/dist/_internal/engine/{designer-dataset-controller-CrfOg2Ys.js → designer-dataset-controller-bSR5OB6n.js} +1512 -1348
  175. package/dist/_internal/engine/designer-element/api/designer-element-catalog.d.ts +2 -2
  176. package/dist/_internal/engine/designer-element/api/designer-element-change.d.ts +24 -0
  177. package/dist/_internal/engine/designer-element/api/designer-element-configuration-types.d.ts +4 -4
  178. package/dist/_internal/engine/designer-element/api/designer-element-fragment-save.d.ts +2 -2
  179. package/dist/_internal/engine/designer-element/api/designer-element-host-resource-selection.d.ts +1 -1
  180. package/dist/_internal/engine/designer-element/base-screen-designer-element.d.ts +21 -9
  181. package/dist/_internal/engine/designer-element/designer-element-public-api.d.ts +2 -1
  182. package/dist/_internal/engine/designer-element/runtime/designer-element-plugin-commands.d.ts +3 -3
  183. package/dist/_internal/engine/designer-element/runtime/designer-element-rendering.d.ts +3 -3
  184. package/dist/_internal/engine/designer-element/runtime/designer-element-runtime.d.ts +4 -1
  185. package/dist/_internal/engine/designer-element/runtime/designer-element-sample-data.d.ts +23 -0
  186. package/dist/_internal/engine/designer-element/runtime/designer-element-state.d.ts +7 -7
  187. package/dist/_internal/engine/{designer-field-primitives-KBZuWN_D.js → designer-field-primitives-C_StzrUa.js} +240 -180
  188. package/dist/_internal/engine/{designer-left-panel-groups-dom-N2OHOWjl.js → designer-left-panel-groups-dom-DBpI3Nc2.js} +19 -19
  189. package/dist/_internal/engine/{host-resource-selection-xo2mLCD4.js → host-resource-selection-BCRU23WQ.js} +446 -446
  190. package/dist/_internal/engine/index.js +5477 -4677
  191. package/dist/_internal/host-kit/index.d.ts +1 -0
  192. package/dist/_internal/host-kit/index.js +1 -0
  193. package/dist/_internal/host-kit/intent/index.d.ts +17 -0
  194. package/dist/_internal/host-kit/intent/index.js +14 -0
  195. package/dist/_internal/host-kit/intent/intent-behavior.d.ts +59 -0
  196. package/dist/_internal/host-kit/intent/intent-behavior.js +812 -0
  197. package/dist/_internal/host-kit/intent/intent-block.d.ts +66 -0
  198. package/dist/_internal/host-kit/intent/intent-block.js +438 -0
  199. package/dist/_internal/host-kit/intent/intent-catalog.d.ts +108 -0
  200. package/dist/_internal/host-kit/intent/intent-catalog.js +60 -0
  201. package/dist/_internal/host-kit/intent/intent-compile-types.d.ts +222 -0
  202. package/dist/_internal/host-kit/intent/intent-compile-types.js +10 -0
  203. package/dist/_internal/host-kit/intent/intent-compile.d.ts +35 -0
  204. package/dist/_internal/host-kit/intent/intent-compile.js +465 -0
  205. package/dist/_internal/host-kit/intent/intent-data-check.d.ts +50 -0
  206. package/dist/_internal/host-kit/intent/intent-data-check.js +163 -0
  207. package/dist/_internal/host-kit/intent/intent-data-context.d.ts +53 -0
  208. package/dist/_internal/host-kit/intent/intent-data-context.js +200 -0
  209. package/dist/_internal/host-kit/intent/intent-dataset.d.ts +52 -0
  210. package/dist/_internal/host-kit/intent/intent-dataset.js +125 -0
  211. package/dist/_internal/host-kit/intent/intent-format.d.ts +33 -0
  212. package/dist/_internal/host-kit/intent/intent-format.js +94 -0
  213. package/dist/_internal/host-kit/intent/intent-freeform.d.ts +48 -0
  214. package/dist/_internal/host-kit/intent/intent-freeform.js +412 -0
  215. package/dist/_internal/host-kit/intent/intent-kpi-bind.d.ts +29 -0
  216. package/dist/_internal/host-kit/intent/intent-kpi-bind.js +59 -0
  217. package/dist/_internal/host-kit/intent/intent-layout.d.ts +102 -0
  218. package/dist/_internal/host-kit/intent/intent-layout.js +264 -0
  219. package/dist/_internal/host-kit/intent/intent-parse.d.ts +41 -0
  220. package/dist/_internal/host-kit/intent/intent-parse.js +931 -0
  221. package/dist/_internal/host-kit/intent/intent-prepare.d.ts +55 -0
  222. package/dist/_internal/host-kit/intent/intent-prepare.js +156 -0
  223. package/dist/_internal/host-kit/intent/intent-session.d.ts +202 -0
  224. package/dist/_internal/host-kit/intent/intent-session.js +1001 -0
  225. package/dist/_internal/host-kit/intent/intent-stream.d.ts +28 -0
  226. package/dist/_internal/host-kit/intent/intent-stream.js +183 -0
  227. package/dist/_internal/host-kit/intent/intent-style.d.ts +37 -0
  228. package/dist/_internal/host-kit/intent/intent-style.js +77 -0
  229. package/dist/_internal/host-kit/intent/intent-types.d.ts +277 -0
  230. package/dist/_internal/host-kit/intent/intent-types.js +10 -0
  231. package/dist/_internal/host-kit/push-result.d.ts +1 -1
  232. package/dist/_internal/host-kit/push-result.js +1 -1
  233. package/dist/_internal/host-kit/sse-subscribe.d.ts +1 -1
  234. package/dist/_internal/host-kit/sse-subscribe.js +1 -1
  235. package/dist/_internal/host-kit/subscription-hub.d.ts +3 -3
  236. package/dist/_internal/host-kit/subscription-hub.js +1 -1
  237. package/dist/_internal/material/base-material.d.ts +3 -3
  238. package/dist/_internal/material/chart.js +34 -12
  239. package/dist/_internal/material/editor-descriptor.d.ts +3 -3
  240. package/dist/_internal/material/table.js +52 -21
  241. package/dist/_internal/plugin-core/contracts.d.ts +18 -16
  242. package/dist/_internal/plugin-core/contracts.js +1 -0
  243. package/dist/_internal/plugin-core/contribution-kind.d.ts +5 -5
  244. package/dist/_internal/plugin-core/contribution-kind.js +14 -6
  245. package/dist/_internal/plugin-core/editor/editor-descriptor-inference.d.ts +1 -1
  246. package/dist/_internal/plugin-core/editor/editor-descriptor-inference.js +2 -2
  247. package/dist/_internal/plugin-core/editor/editor-descriptor-items.d.ts +1 -1
  248. package/dist/_internal/plugin-core/editor/editor-descriptor-items.js +1 -1
  249. package/dist/_internal/plugin-core/editor/editor-descriptor-model.d.ts +2 -2
  250. package/dist/_internal/plugin-core/editor/editor-descriptor.js +1 -1
  251. package/dist/_internal/plugin-core/fragment/fragment.d.ts +4 -4
  252. package/dist/_internal/plugin-core/fragment/fragment.js +1 -1
  253. package/dist/_internal/plugin-core/material/material-manifest-fields.js +1 -1
  254. package/dist/_internal/plugin-core/material/material-manifest.js +1 -1
  255. package/dist/_internal/plugin-core/material/material-theme.d.ts +2 -2
  256. package/dist/_internal/plugin-core/material/material-theme.js +2 -2
  257. package/dist/_internal/plugin-manager/contribution-kind-plan.d.ts +5 -1
  258. package/dist/_internal/plugin-manager/contribution-kind-plan.js +20 -12
  259. package/dist/_internal/plugin-manager/manager.js +47 -30
  260. package/dist/_internal/plugin-manager/resolver.js +7 -13
  261. package/dist/_internal/plugin-manager/types.d.ts +2 -2
  262. package/dist/_internal/plugin-sdk/authoring-finding.d.ts +3 -3
  263. package/dist/_internal/plugin-sdk/fragment-audit.d.ts +6 -6
  264. package/dist/_internal/plugin-sdk/fragment-audit.js +8 -8
  265. package/dist/_internal/plugin-sdk/fragment-definition.d.ts +3 -3
  266. package/dist/_internal/plugin-sdk/fragment-definition.js +3 -3
  267. package/dist/_internal/plugin-sdk/index.d.ts +6 -0
  268. package/dist/_internal/plugin-sdk/index.js +6 -0
  269. package/dist/_internal/plugin-sdk/material-config-groups.d.ts +2 -2
  270. package/dist/_internal/plugin-sdk/material-definition.d.ts +5 -1
  271. package/dist/_internal/plugin-sdk/material-definition.js +3 -3
  272. package/dist/_internal/plugin-sdk/material-editor-audit.d.ts +9 -8
  273. package/dist/_internal/plugin-sdk/material-editor-audit.js +19 -11
  274. package/dist/_internal/plugin-sdk/material-isolated-csp.d.ts +38 -0
  275. package/dist/_internal/plugin-sdk/material-isolated-csp.js +67 -0
  276. package/dist/_internal/plugin-sdk/material-isolated-runtime.d.ts +22 -0
  277. package/dist/_internal/plugin-sdk/material-isolated-runtime.js +262 -0
  278. package/dist/_internal/plugin-sdk/material-isolated.d.ts +94 -0
  279. package/dist/_internal/plugin-sdk/material-isolated.js +1044 -0
  280. package/dist/_internal/plugin-sdk/material-package.d.ts +3 -3
  281. package/dist/_internal/plugin-sdk/material-package.js +7 -7
  282. package/dist/_internal/plugin-sdk/material-rendered-element.d.ts +22 -7
  283. package/dist/_internal/plugin-sdk/material-rendered-element.js +103 -10
  284. package/dist/_internal/plugin-sdk/material-spec-audit.d.ts +20 -10
  285. package/dist/_internal/plugin-sdk/material-spec-audit.js +108 -22
  286. package/dist/_internal/plugin-sdk/material-spec.d.ts +81 -16
  287. package/dist/_internal/plugin-sdk/material-spec.js +241 -42
  288. package/dist/_internal/plugin-sdk/material-style-keys.d.ts +6 -6
  289. package/dist/_internal/plugin-sdk/material-style-keys.js +7 -7
  290. package/dist/_internal/plugin-sdk/material-template-audit.d.ts +12 -0
  291. package/dist/_internal/plugin-sdk/material-template-audit.js +302 -0
  292. package/dist/_internal/plugin-sdk/material-template-expression.d.ts +98 -0
  293. package/dist/_internal/plugin-sdk/material-template-expression.js +549 -0
  294. package/dist/_internal/plugin-sdk/material-template-render.d.ts +32 -0
  295. package/dist/_internal/plugin-sdk/material-template-render.js +579 -0
  296. package/dist/_internal/plugin-sdk/material-template.d.ts +185 -0
  297. package/dist/_internal/plugin-sdk/material-template.js +879 -0
  298. package/dist/_internal/plugin-sdk/plugin-package.d.ts +2 -2
  299. package/dist/_internal/plugin-sdk/plugin-package.js +3 -3
  300. package/dist/_internal/plugin-sdk/plugin-registration.d.ts +2 -5
  301. package/dist/_internal/plugin-sdk/plugin-registration.js +3 -3
  302. package/dist/_internal/renderer/renderer/renderer-candidates.d.ts +1 -1
  303. package/dist/_internal/renderer/renderer/renderer-component-states.d.ts +1 -1
  304. package/dist/_internal/renderer/renderer/renderer-effective-style.d.ts +1 -1
  305. package/dist/_internal/renderer/renderer/renderer-material-dom.d.ts +1 -1
  306. package/dist/_internal/renderer/renderer/renderer-state.d.ts +2 -2
  307. package/dist/_internal/renderer/renderer/renderer-theme.d.ts +1 -1
  308. package/dist/_internal/renderer/renderer/renderer-types.d.ts +1 -1
  309. package/dist/_internal/renderer/renderer/renderer.d.ts +5 -5
  310. package/dist/_internal/renderer/resource/data-source-runtime.d.ts +3 -3
  311. package/dist/_internal/renderer/resource/push-window.d.ts +1 -1
  312. package/dist/_internal/renderer/resource/request-coordinator.d.ts +1 -1
  313. package/dist/_internal/renderer/resource/source-query-port.d.ts +3 -3
  314. package/dist/_internal/renderer/sub-canvas-layer.d.ts +2 -2
  315. package/dist/_internal/renderer/viewer/viewer-configuration.d.ts +1 -1
  316. package/dist/_internal/renderer/viewer/viewer.d.ts +3 -3
  317. package/dist/auto-register.js +10 -10
  318. package/dist/contracts.js +5 -5
  319. package/dist/contracts.js.map +1 -1
  320. package/dist/contrast-DRPezUIl.js +131 -0
  321. package/dist/contrast-DRPezUIl.js.map +1 -0
  322. package/dist/core.js +156 -136
  323. package/dist/core.js.map +1 -1
  324. package/dist/dataset-port-D993nOlT.js.map +1 -1
  325. package/dist/dataset-profile-Dk6xdtsM.js +261 -0
  326. package/dist/dataset-profile-Dk6xdtsM.js.map +1 -0
  327. package/dist/{designer-3Tb0EIDV.js → designer-DzBm8tXS.js} +2 -2
  328. package/dist/{designer-3Tb0EIDV.js.map → designer-DzBm8tXS.js.map} +1 -1
  329. package/dist/designer-auto-register.js +5 -5
  330. package/dist/{designer-blueprint-workbench-panel-CJ3iZo5v-BebifP4x.js → designer-blueprint-workbench-panel-DVvKcSvJ-CkRMBKZA.js} +452 -531
  331. package/dist/designer-blueprint-workbench-panel-DVvKcSvJ-CkRMBKZA.js.map +1 -0
  332. package/dist/{designer-dataset-controller-CrfOg2Ys-DhKUEJJe.js → designer-dataset-controller-bSR5OB6n-DfUP24S6.js} +1355 -1191
  333. package/dist/designer-dataset-controller-bSR5OB6n-DfUP24S6.js.map +1 -0
  334. package/dist/{designer-field-primitives-KBZuWN_D-B3h4jpYe.js → designer-field-primitives-C_StzrUa-QZpcn0yX.js} +241 -181
  335. package/dist/designer-field-primitives-C_StzrUa-QZpcn0yX.js.map +1 -0
  336. package/dist/{designer-left-panel-groups-dom-N2OHOWjl-D8CzGwbF.js → designer-left-panel-groups-dom-DBpI3Nc2-D8kYJLCg.js} +18 -18
  337. package/dist/{designer-left-panel-groups-dom-N2OHOWjl-D8CzGwbF.js.map → designer-left-panel-groups-dom-DBpI3Nc2-D8kYJLCg.js.map} +1 -1
  338. package/dist/designer.js +5 -5
  339. package/dist/{dist-6GRboBs-.js → dist-B2bW2Tru.js} +4 -4
  340. package/dist/{dist-6GRboBs-.js.map → dist-B2bW2Tru.js.map} +1 -1
  341. package/dist/{dist-BjLjFUy1.js → dist-YCmniYuO.js} +5636 -4838
  342. package/dist/dist-YCmniYuO.js.map +1 -0
  343. package/dist/engine.js +5 -5
  344. package/dist/{fragment-Y6YnW6wy.js → fragment-B-oP0Fru.js} +3 -3
  345. package/dist/fragment-B-oP0Fru.js.map +1 -0
  346. package/dist/host-kit.js +4388 -187
  347. package/dist/host-kit.js.map +1 -1
  348. package/dist/{host-resource-selection-xo2mLCD4-BR5XCcim.js → host-resource-selection-BCRU23WQ-Cedz0d14.js} +208 -208
  349. package/dist/host-resource-selection-BCRU23WQ-Cedz0d14.js.map +1 -0
  350. package/dist/image-url-D6mUcjY1.js.map +1 -1
  351. package/dist/index.js +10 -10
  352. package/dist/legibility-CS28ivEz.js +12 -0
  353. package/dist/legibility-CS28ivEz.js.map +1 -0
  354. package/dist/{level-scale-BzUjE31V.js → level-scale-CwHqFEVd.js} +2 -2
  355. package/dist/level-scale-CwHqFEVd.js.map +1 -0
  356. package/dist/{manager-Ch0RTu_i.js → manager-BcvdcZjM.js} +230 -210
  357. package/dist/manager-BcvdcZjM.js.map +1 -0
  358. package/dist/{material-UbSfiuZq.js → material-ReRzBIbb.js} +2 -2
  359. package/dist/{material-UbSfiuZq.js.map → material-ReRzBIbb.js.map} +1 -1
  360. package/dist/material-auto-register.js +1 -1
  361. package/dist/{material-definition-BeW34dJr.js → material-definition-BcjFM-B-.js} +9 -9
  362. package/dist/material-definition-BcjFM-B-.js.map +1 -0
  363. package/dist/material-manifest-B1XatGPx.js.map +1 -1
  364. package/dist/material-theme-C91eus78.js.map +1 -1
  365. package/dist/material.js +2 -2
  366. package/dist/{migrate-document-D3HhCVlZ.js → migrate-document-BM888PtC.js} +2 -2
  367. package/dist/migrate-document-BM888PtC.js.map +1 -0
  368. package/dist/{parse-B1OD1teS.js → parse-1U_-Qtn4.js} +4 -4
  369. package/dist/parse-1U_-Qtn4.js.map +1 -0
  370. package/dist/{parse-AOTE9WnD.js → parse-Ji7kE9ZT.js} +9 -4
  371. package/dist/parse-Ji7kE9ZT.js.map +1 -0
  372. package/dist/{parse-parts-BNrpdG5o.js → parse-parts-qzl4suzk.js} +2 -2
  373. package/dist/{parse-parts-BNrpdG5o.js.map → parse-parts-qzl4suzk.js.map} +1 -1
  374. package/dist/{plugin-DHgh9uHh.js → plugin-BH-4oNvT.js} +63 -55
  375. package/dist/plugin-BH-4oNvT.js.map +1 -0
  376. package/dist/plugin-core.js +2 -2
  377. package/dist/plugin-manager.js +1 -1
  378. package/dist/plugin-package-Cj-3iLv3.js +4369 -0
  379. package/dist/plugin-package-Cj-3iLv3.js.map +1 -0
  380. package/dist/{plugin-registration-rsmb4GvS.js → plugin-registration-C9_IxTxc.js} +9 -9
  381. package/dist/{plugin-registration-rsmb4GvS.js.map → plugin-registration-C9_IxTxc.js.map} +1 -1
  382. package/dist/plugin-sdk.js +6 -6
  383. package/dist/{plugins-DGRHgREK.js → plugins-CwATlfr0.js} +2 -2
  384. package/dist/{plugins-DGRHgREK.js.map → plugins-CwATlfr0.js.map} +1 -1
  385. package/dist/plugins.js +8 -8
  386. package/dist/renderer.js +1 -1
  387. package/dist/{runtime-dispatch-BfnRDtMe.js → runtime-dispatch-C0gyIrTv.js} +2 -2
  388. package/dist/runtime-dispatch-C0gyIrTv.js.map +1 -0
  389. package/dist/runtime-simulate-aSYO9yDX.js +147 -0
  390. package/dist/runtime-simulate-aSYO9yDX.js.map +1 -0
  391. package/dist/{src-Bm7u11mN-_0u6cMEw.js → src-Bm7u11mN-DFLnFQSk.js} +39 -39
  392. package/dist/{src-Bm7u11mN-_0u6cMEw.js.map → src-Bm7u11mN-DFLnFQSk.js.map} +1 -1
  393. package/dist/state-preset-DtpygJOH.js +22 -0
  394. package/dist/state-preset-DtpygJOH.js.map +1 -0
  395. package/dist/{text-BNksUr5J.js → text-DfKom8EG.js} +88 -35
  396. package/dist/text-DfKom8EG.js.map +1 -0
  397. package/dist/theme-CcBXf4Ay.js.map +1 -1
  398. package/dist/{value-ref-BG_MV9C-.js → value-ref-XkLuckGV.js} +2 -2
  399. package/dist/{value-ref-BG_MV9C-.js.map → value-ref-XkLuckGV.js.map} +1 -1
  400. package/dist/{viewer-CrJupI8I-D9dVcNw4.js → viewer-CrJupI8I-CeQS58mA.js} +5 -5
  401. package/dist/{viewer-CrJupI8I-D9dVcNw4.js.map → viewer-CrJupI8I-CeQS58mA.js.map} +1 -1
  402. package/dist/viewer-auto-register.js +2 -2
  403. package/dist/viewer.js +2 -2
  404. package/dist/{viewport-CiCKeAQH.js → viewport-BNIRWjiT.js} +354 -155
  405. package/dist/viewport-BNIRWjiT.js.map +1 -0
  406. package/package.json +12 -12
  407. package/dist/designer-blueprint-workbench-panel-CJ3iZo5v-BebifP4x.js.map +0 -1
  408. package/dist/designer-dataset-controller-CrfOg2Ys-DhKUEJJe.js.map +0 -1
  409. package/dist/designer-field-primitives-KBZuWN_D-B3h4jpYe.js.map +0 -1
  410. package/dist/dist-BjLjFUy1.js.map +0 -1
  411. package/dist/fragment-Y6YnW6wy.js.map +0 -1
  412. package/dist/host-resource-selection-xo2mLCD4-BR5XCcim.js.map +0 -1
  413. package/dist/level-scale-BzUjE31V.js.map +0 -1
  414. package/dist/manager-Ch0RTu_i.js.map +0 -1
  415. package/dist/material-definition-BeW34dJr.js.map +0 -1
  416. package/dist/migrate-document-D3HhCVlZ.js.map +0 -1
  417. package/dist/parse-AOTE9WnD.js.map +0 -1
  418. package/dist/parse-B1OD1teS.js.map +0 -1
  419. package/dist/plugin-DHgh9uHh.js.map +0 -1
  420. package/dist/plugin-package-Dr5ro6h6.js +0 -1221
  421. package/dist/plugin-package-Dr5ro6h6.js.map +0 -1
  422. package/dist/runtime-dispatch-BfnRDtMe.js.map +0 -1
  423. package/dist/text-BNksUr5J.js.map +0 -1
  424. package/dist/viewport-CiCKeAQH.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { i as e, m as t } from "./image-url-D6mUcjY1.js";
2
- import { b as n, f as r, n as i, y as a } from "./parse-AOTE9WnD.js";
2
+ import { b as n, f as r, n as i, y as a } from "./parse-Ji7kE9ZT.js";
3
3
  import { t as o } from "./equality-DjZ9cv4u.js";
4
4
  import { o as s, t as c } from "./theme-CcBXf4Ay.js";
5
5
  import { c as l, i as u, l as d, n as f, o as p, r as m, t as h } from "./hierarchy-BQZrZWbC.js";
@@ -44,7 +44,7 @@ function b(e, t) {
44
44
  function x(e) {
45
45
  return Object.is(e, -0) ? 0 : e;
46
46
  }
47
- function S(e) {
47
+ function ee(e) {
48
48
  return {
49
49
  x: x(e.x),
50
50
  y: x(e.y)
@@ -52,7 +52,7 @@ function S(e) {
52
52
  }
53
53
  //#endregion
54
54
  //#region ../core/dist/geometry/bounds.js
55
- function ee(e) {
55
+ function S(e) {
56
56
  let { position: { x: t, y: n }, size: { width: r, height: i }, rotation: a } = e;
57
57
  if (!Number.isFinite(t) || !Number.isFinite(n) || !Number.isFinite(r) || !Number.isFinite(i) || !Number.isFinite(a) || t < -1e6 || t > 1e6 || n < -1e6 || n > 1e6 || r <= 0 || i <= 0 || r > 1e6 || i > 1e6 || a < -180 || a >= 180) return null;
58
58
  let o = t + r / 2, s = n + i / 2, c = r / 2, l = i / 2, u = a * Math.PI / 180, d = Math.cos(u), f = Math.sin(u), p = [
@@ -108,7 +108,7 @@ function re(e) {
108
108
  "parentId"
109
109
  ],
110
110
  message: `Component ancestor depth ${a} exceeds the maximum of ${te}.`
111
- }), ee(i) === null && n.push({
111
+ }), S(i) === null && n.push({
112
112
  severity: "error",
113
113
  code: "CORE_GEOMETRY_INVALID",
114
114
  path: ["components", r],
@@ -195,8 +195,130 @@ function N(e, t, n) {
195
195
  };
196
196
  }
197
197
  //#endregion
198
+ //#region ../core/dist/commands/apply-collection-commands.js
199
+ function ce(e, t) {
200
+ if (!Array.isArray(t) || t.length === 0) return j(e, M("Data sources to add must be a non-empty array.", ["dataSources"]));
201
+ let n = P(t, new Set((e.dataSources ?? []).map((e) => e.id)));
202
+ if (n !== void 0) return j(e, M("Data source id already exists.", [
203
+ "dataSources",
204
+ n,
205
+ "id"
206
+ ]));
207
+ let r = k(e, {
208
+ ...e,
209
+ dataSources: [...e.dataSources ?? [], ...t]
210
+ }, []);
211
+ if (!r.ok) return r;
212
+ let i = t.map((e) => e.id);
213
+ return {
214
+ ...r,
215
+ changedComponentIds: g(r.document, i)
216
+ };
217
+ }
218
+ function le(e, t, n) {
219
+ if (typeof t != "string" || !a(t)) return j(e, M("Data source id is invalid.", ["dataSourceId"]));
220
+ if (!D(n) || Object.keys(n).length === 0) return j(e, M("Params patch must be a non-empty object.", ["params"]));
221
+ let r = e.dataSources ?? [], i = r.findIndex((e) => e.id === t), s = r[i];
222
+ if (s === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["dataSourceId"], "Data source target does not exist."));
223
+ let c = { ...s.params };
224
+ for (let [e, t] of Object.entries(n)) t === null ? delete c[e] : c[e] = t;
225
+ if (o(s.params, c)) return A(e, []);
226
+ let l = r.map((e, t) => t === i ? {
227
+ ...e,
228
+ params: c
229
+ } : e), u = k(e, {
230
+ ...e,
231
+ dataSources: l
232
+ }, []);
233
+ return u.ok ? {
234
+ ...u,
235
+ changedComponentIds: g(u.document, [t])
236
+ } : u;
237
+ }
238
+ function ue(e, t) {
239
+ if (!Array.isArray(t) || t.length === 0) return j(e, M("Variables to add must be a non-empty array.", ["variables"]));
240
+ let n = P(t, new Set(e.variables.map((e) => e.id)));
241
+ return n === void 0 ? k(e, {
242
+ ...e,
243
+ variables: [...e.variables, ...t]
244
+ }, []) : j(e, M("Variable id already exists.", [
245
+ "variables",
246
+ n,
247
+ "id"
248
+ ]));
249
+ }
250
+ function de(e, t) {
251
+ let n = F(t);
252
+ if (n === void 0) return j(e, M("Variable ids must be a non-empty array of ids.", ["variableIds"]));
253
+ let r = new Set(e.variables.map((e) => e.id)), i = n.findIndex((e) => !r.has(e));
254
+ if (i >= 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["variableIds", i], "Variable target does not exist."));
255
+ let a = new Set(n);
256
+ return k(e, {
257
+ ...e,
258
+ variables: e.variables.filter((e) => !a.has(e.id))
259
+ }, []);
260
+ }
261
+ function fe(e, t, n) {
262
+ if (!Array.isArray(t) || !Array.isArray(n) || t.length + n.length === 0) return j(e, M("Blueprint nodes and edges must be arrays, not both empty.", []));
263
+ let r = P(t, new Set(e.blueprint.nodes.map((e) => e.id)));
264
+ if (r !== void 0) return j(e, M("Blueprint node id already exists.", [
265
+ "nodes",
266
+ r,
267
+ "id"
268
+ ]));
269
+ let i = P(n, new Set(e.blueprint.edges.map((e) => e.id)));
270
+ if (i !== void 0) return j(e, M("Blueprint edge id already exists.", [
271
+ "edges",
272
+ i,
273
+ "id"
274
+ ]));
275
+ let a = {
276
+ ...e.blueprint,
277
+ nodes: [...e.blueprint.nodes, ...t],
278
+ edges: [...e.blueprint.edges, ...n]
279
+ };
280
+ return k(e, {
281
+ ...e,
282
+ blueprint: a
283
+ }, []);
284
+ }
285
+ function pe(e, t, n) {
286
+ let r = F(t, !0), i = F(n, !0);
287
+ if (r === void 0 || i === void 0 || r.length + i.length === 0) return j(e, M("Blueprint node and edge ids must be arrays, not both empty.", []));
288
+ let a = new Set(e.blueprint.nodes.map((e) => e.id)), o = r.findIndex((e) => !a.has(e));
289
+ if (o >= 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["nodeIds", o], "Blueprint node does not exist."));
290
+ let s = new Set(e.blueprint.edges.map((e) => e.id)), c = i.findIndex((e) => !s.has(e));
291
+ if (c >= 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["edgeIds", c], "Blueprint edge does not exist."));
292
+ let l = new Set(r), u = new Set(i), d = (e) => l.has(e.from.node) || l.has(e.to.node), f = e.blueprint.layout, p = {
293
+ ...e.blueprint,
294
+ nodes: e.blueprint.nodes.filter((e) => !l.has(e.id)),
295
+ edges: e.blueprint.edges.filter((e) => !u.has(e.id) && !d(e)),
296
+ ...f === void 0 ? {} : { layout: {
297
+ ...f,
298
+ nodes: f.nodes.filter((e) => !l.has(e.id))
299
+ } }
300
+ };
301
+ return k(e, {
302
+ ...e,
303
+ blueprint: p
304
+ }, []);
305
+ }
306
+ function P(e, t) {
307
+ let n = new Set(t);
308
+ for (let [t, r] of e.entries()) {
309
+ let e = D(r) && typeof r.id == "string" ? r.id : void 0;
310
+ if (e === void 0 || n.has(e)) return t;
311
+ n.add(e);
312
+ }
313
+ }
314
+ function F(e, t = !1) {
315
+ if (!Array.isArray(e) || !t && e.length === 0 || e.some((e) => typeof e != "string")) return;
316
+ let n = e;
317
+ return new Set(n).size === n.length ? n : void 0;
318
+ }
319
+ //#endregion
198
320
  //#region ../core/dist/commands/apply-component-commands.js
199
- var ce = /* @__PURE__ */ new Set([
321
+ var me = /* @__PURE__ */ new Set([
200
322
  "name",
201
323
  "position",
202
324
  "size",
@@ -211,7 +333,7 @@ var ce = /* @__PURE__ */ new Set([
211
333
  "dataBinding",
212
334
  "belowSubCanvas"
213
335
  ]);
214
- function le(e, t) {
336
+ function he(e, t) {
215
337
  if (!D(t)) return j(e, M("Component must be an object.", ["component"]));
216
338
  let n = h(e);
217
339
  return typeof t.id == "string" ? n.byId.has(t.id) ? j(e, N("CORE_COMMAND_INVALID", ["component", "id"], "Component id already exists.")) : t.parentId !== null && !n.byId.has(t.parentId) ? j(e, N("CORE_COMMAND_PARENT_INVALID", ["component", "parentId"], "Component parent does not exist.")) : t.parentId !== null && d(n, t.parentId) ? j(e, N("CORE_COMMAND_TARGET_LOCKED", ["component", "parentId"], "Component parent is locked.")) : k(e, {
@@ -219,9 +341,9 @@ function le(e, t) {
219
341
  components: [...e.components, t]
220
342
  }, [t.id]) : j(e, M("Component id must be a string.", ["component", "id"]));
221
343
  }
222
- function ue(e, t, n) {
344
+ function ge(e, t, n) {
223
345
  if (!O(t)) return j(e, M("Component ids must be a string array.", ["componentIds"]));
224
- if (!oe(n, ce) || Object.keys(n).length === 0) return j(e, M("Component patch must contain known fields.", ["patch"]));
346
+ if (!oe(n, me) || Object.keys(n).length === 0) return j(e, M("Component patch must contain known fields.", ["patch"]));
225
347
  let r = E(e, t);
226
348
  if (r === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["componentIds"], "One or more components do not exist."));
227
349
  if (r.length === 0) return A(e, []);
@@ -240,7 +362,7 @@ function ue(e, t, n) {
240
362
  components: c
241
363
  }, l);
242
364
  }
243
- function de(e, t) {
365
+ function _e(e, t) {
244
366
  if (!O(t)) return j(e, M("Component ids must be a string array.", ["componentIds"]));
245
367
  let n = E(e, t);
246
368
  if (n === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["componentIds"], "One or more components do not exist."));
@@ -256,7 +378,7 @@ function de(e, t) {
256
378
  components: e.components.filter((e) => !i.has(e.id))
257
379
  }, a) : j(e, N("CORE_COMMAND_TARGET_LOCKED", ["componentIds"], `Component "${o}" is locked.`));
258
380
  }
259
- function fe(e, t, n) {
381
+ function ve(e, t, n) {
260
382
  if (!O(t) || n !== null && typeof n != "string") return j(e, M("Reparent command fields are invalid.", []));
261
383
  let r = E(e, t);
262
384
  if (r === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["componentIds"], "One or more components do not exist."));
@@ -289,7 +411,7 @@ function fe(e, t, n) {
289
411
  })
290
412
  }, c);
291
413
  }
292
- function pe(e, t, n) {
414
+ function ye(e, t, n) {
293
415
  if (!O(t) || n !== null && typeof n != "string") return j(e, M("Move command fields are invalid.", []));
294
416
  let r = n === null ? void 0 : (e.subCanvases ?? []).find((e) => e.id === n);
295
417
  if (n !== null && r === void 0) return j(e, N("CORE_COMMAND_TARGET_MISSING", ["canvasId"], "Target sub canvas does not exist."));
@@ -310,7 +432,7 @@ function pe(e, t, n) {
310
432
  canvasId: n
311
433
  };
312
434
  if (r?.display === "popup") {
313
- let t = P(e.position.x, 0, Math.max(0, r.width - e.size.width)), n = P(e.position.y, 0, Math.max(0, r.height - e.size.height));
435
+ let t = I(e.position.x, 0, Math.max(0, r.width - e.size.width)), n = I(e.position.y, 0, Math.max(0, r.height - e.size.height));
314
436
  (t !== e.position.x || n !== e.position.y) && (o = {
315
437
  ...o,
316
438
  position: {
@@ -326,32 +448,32 @@ function pe(e, t, n) {
326
448
  components: l
327
449
  }, c);
328
450
  }
329
- function P(e, t, n) {
451
+ function I(e, t, n) {
330
452
  return Math.min(n, Math.max(t, e));
331
453
  }
332
454
  //#endregion
333
455
  //#region ../core/dist/commands/apply-data-source-command.js
334
- function me(e, t) {
456
+ function be(e, t) {
335
457
  if (!Array.isArray(t)) return j(e, M("Data sources must be an array.", ["dataSources"]));
336
458
  let n = e.dataSources ?? [], r = new Map(n.map((e) => [e.id, e])), i = t.map((e) => {
337
- let t = ge(e);
459
+ let t = Se(e);
338
460
  if (t === void 0) return e;
339
461
  let n = r.get(t);
340
462
  return n !== void 0 && o(n, e) ? n : e;
341
463
  });
342
- if (he(n, i)) return A(e, []);
464
+ if (xe(n, i)) return A(e, []);
343
465
  let a = k(e, {
344
466
  ...e,
345
467
  dataSources: i
346
468
  }, []);
347
469
  if (!a.ok) return a;
348
- let s = g(a.document, F(n, a.document.dataSources ?? []));
470
+ let s = g(a.document, L(n, a.document.dataSources ?? []));
349
471
  return {
350
472
  ...a,
351
473
  changedComponentIds: s
352
474
  };
353
475
  }
354
- function F(e, t) {
476
+ function L(e, t) {
355
477
  let n = new Map(e.map((e) => [e.id, e])), r = new Map(t.map((e) => [e.id, e])), i = [];
356
478
  for (let [e, t] of n) {
357
479
  let n = r.get(e);
@@ -360,23 +482,23 @@ function F(e, t) {
360
482
  for (let e of r.keys()) n.has(e) || i.push(e);
361
483
  return i;
362
484
  }
363
- function he(e, t) {
485
+ function xe(e, t) {
364
486
  return e.length === t.length && t.every((t, n) => t === e[n]);
365
487
  }
366
- function ge(e) {
488
+ function Se(e) {
367
489
  if (typeof e != "object" || !e || Array.isArray(e)) return;
368
490
  let t = e.id;
369
491
  return typeof t == "string" ? t : void 0;
370
492
  }
371
493
  //#endregion
372
494
  //#region ../core/dist/commands/apply-variable-command.js
373
- var _e = /* @__PURE__ */ new Set([
495
+ var Ce = /* @__PURE__ */ new Set([
374
496
  "type",
375
497
  "variableId",
376
498
  "nextName"
377
499
  ]);
378
- function ve(e, t) {
379
- if (!D(t) || Object.keys(t).some((e) => !_e.has(e)) || t.type !== "rename-variable" || typeof t.variableId != "string" || typeof t.nextName != "string") return j(e, M("Rename variable command is invalid.", []));
500
+ function we(e, t) {
501
+ if (!D(t) || Object.keys(t).some((e) => !Ce.has(e)) || t.type !== "rename-variable" || typeof t.variableId != "string" || typeof t.nextName != "string") return j(e, M("Rename variable command is invalid.", []));
380
502
  if (!a(t.variableId)) return j(e, M("Variable id is invalid.", ["variableId"]));
381
503
  if (!n(t.nextName)) return j(e, M("Next variable name is invalid.", ["nextName"]));
382
504
  let r = e.variables.find((e) => e.id === t.variableId);
@@ -394,11 +516,11 @@ function ve(e, t) {
394
516
  }
395
517
  //#endregion
396
518
  //#region ../core/dist/commands/apply.js
397
- var ye = new Set(r);
398
- function be(e, t) {
399
- return T(e), I(e, t);
519
+ var Te = new Set(r);
520
+ function Ee(e, t) {
521
+ return T(e), R(e, t);
400
522
  }
401
- function xe(e, t) {
523
+ function De(e, t) {
402
524
  if (T(e), !D(t) || !Array.isArray(t.commands)) return {
403
525
  ok: !1,
404
526
  document: e,
@@ -413,7 +535,7 @@ function xe(e, t) {
413
535
  };
414
536
  let n = e;
415
537
  for (let r = 0; r < t.commands.length; r++) {
416
- let i = I(n, t.commands[r]);
538
+ let i = R(n, t.commands[r]);
417
539
  if (!i.ok) return {
418
540
  ok: !1,
419
541
  document: e,
@@ -425,30 +547,36 @@ function xe(e, t) {
425
547
  return {
426
548
  ok: !0,
427
549
  document: n,
428
- changedComponentIds: De(e, n),
550
+ changedComponentIds: Ne(e, n),
429
551
  diagnostics: []
430
552
  };
431
553
  }
432
- function I(e, t) {
554
+ function R(e, t) {
433
555
  if (!D(t) || typeof t.type != "string") return j(e, M("Command must be an object with a known type.", []));
434
556
  switch (t.type) {
435
- case "update-canvas": return Se(e, t.patch);
436
- case "add-component": return le(e, t.component);
437
- case "update-components": return ue(e, t.componentIds, t.patch);
438
- case "remove-components": return de(e, t.componentIds);
439
- case "reparent-components": return fe(e, t.componentIds, t.parentId);
440
- case "replace-blueprint": return Ee(e, t.blueprint);
441
- case "replace-data-sources": return me(e, t.dataSources);
442
- case "replace-variables": return we(e, t.variables);
443
- case "replace-sub-canvases": return Te(e, t.subCanvases, t.startCanvasId);
444
- case "move-components": return pe(e, t.componentIds, t.canvasId);
445
- case "rename-variable": return ve(e, t);
446
- case "update-theme": return Ce(e, t.patch);
557
+ case "update-canvas": return Oe(e, t.patch);
558
+ case "add-component": return he(e, t.component);
559
+ case "update-components": return ge(e, t.componentIds, t.patch);
560
+ case "remove-components": return _e(e, t.componentIds);
561
+ case "reparent-components": return ve(e, t.componentIds, t.parentId);
562
+ case "replace-blueprint": return Me(e, t.blueprint);
563
+ case "replace-data-sources": return be(e, t.dataSources);
564
+ case "replace-variables": return Ae(e, t.variables);
565
+ case "replace-sub-canvases": return je(e, t.subCanvases, t.startCanvasId);
566
+ case "move-components": return ye(e, t.componentIds, t.canvasId);
567
+ case "rename-variable": return we(e, t);
568
+ case "update-theme": return ke(e, t.patch);
569
+ case "add-data-sources": return ce(e, t.dataSources);
570
+ case "update-data-source-params": return le(e, t.dataSourceId, t.params);
571
+ case "add-variables": return ue(e, t.variables);
572
+ case "remove-variables": return de(e, t.variableIds);
573
+ case "add-blueprint-elements": return fe(e, t.nodes, t.edges);
574
+ case "remove-blueprint-elements": return pe(e, t.nodeIds, t.edgeIds);
447
575
  default: return j(e, M("Command type is not supported.", ["type"]));
448
576
  }
449
577
  }
450
- function Se(e, t) {
451
- if (!oe(t, ye)) return j(e, M("Canvas patch contains an unknown or invalid field.", ["patch"]));
578
+ function Oe(e, t) {
579
+ if (!oe(t, Te)) return j(e, M("Canvas patch contains an unknown or invalid field.", ["patch"]));
452
580
  if (Object.keys(t).length === 0) return A(e, []);
453
581
  let n = { ...e.canvas };
454
582
  for (let [e, r] of Object.entries(t)) r === null ? delete n[e] : n[e] = r;
@@ -457,7 +585,7 @@ function Se(e, t) {
457
585
  canvas: n
458
586
  }, []);
459
587
  }
460
- function Ce(e, t) {
588
+ function ke(e, t) {
461
589
  if (!D(t)) return j(e, M("Theme patch must be an object of slot colors.", ["patch"]));
462
590
  for (let [n, r] of Object.entries(t)) if (!s(n) || typeof r != "string" || r.trim() === "" || r.length > 64) return j(e, M("Theme patch keys must be palette slots with color strings.", ["patch", n]));
463
591
  let n = {
@@ -471,31 +599,31 @@ function Ce(e, t) {
471
599
  theme: r
472
600
  }, []);
473
601
  }
474
- function we(e, t) {
602
+ function Ae(e, t) {
475
603
  return Array.isArray(t) ? o(e.variables, t) ? A(e, []) : k(e, {
476
604
  ...e,
477
605
  variables: t
478
606
  }, []) : j(e, M("Variables must be an array.", ["variables"]));
479
607
  }
480
- function Te(e, t, n) {
608
+ function je(e, t, n) {
481
609
  if (!Array.isArray(t)) return j(e, M("Sub canvases must be an array.", ["subCanvases"]));
482
610
  if (n != null && typeof n != "string") return j(e, M("startCanvasId must be a string or null.", ["startCanvasId"]));
483
611
  let r = { ...e };
484
612
  return t.length === 0 ? delete r.subCanvases : r.subCanvases = t, n === null ? delete r.startCanvasId : typeof n == "string" ? r.startCanvasId = n : e.startCanvasId !== void 0 && !t.some((t) => D(t) && t.id === e.startCanvasId && t.display === "page") && delete r.startCanvasId, o(e.subCanvases ?? [], t) && r.startCanvasId === e.startCanvasId ? A(e, []) : k(e, r, []);
485
613
  }
486
- function Ee(e, t) {
614
+ function Me(e, t) {
487
615
  return !D(t) || !Array.isArray(t.nodes) || !Array.isArray(t.edges) ? j(e, M("Blueprint must be a canonical object.", ["blueprint"])) : o(e.blueprint, t) ? A(e, []) : k(e, {
488
616
  ...e,
489
617
  blueprint: t
490
618
  }, []);
491
619
  }
492
- function De(e, t) {
493
- let n = new Map(t.components.map((e) => [e.id, e])), r = new Map(e.components.map((e) => [e.id, e])), i = t.components.filter((e) => r.get(e.id) !== e && !o(r.get(e.id), e)).map(({ id: e }) => e), a = e.components.filter((e) => !n.has(e.id)).map(({ id: e }) => e), s = /* @__PURE__ */ new Set([...i, ...a]), c = g(t, F(e.dataSources ?? [], t.dataSources ?? [])).filter((e) => !s.has(e));
620
+ function Ne(e, t) {
621
+ let n = new Map(t.components.map((e) => [e.id, e])), r = new Map(e.components.map((e) => [e.id, e])), i = t.components.filter((e) => r.get(e.id) !== e && !o(r.get(e.id), e)).map(({ id: e }) => e), a = e.components.filter((e) => !n.has(e.id)).map(({ id: e }) => e), s = /* @__PURE__ */ new Set([...i, ...a]), c = g(t, L(e.dataSources ?? [], t.dataSources ?? [])).filter((e) => !s.has(e));
494
622
  return c.length === 0 ? [...s] : [...s, ...c];
495
623
  }
496
624
  //#endregion
497
625
  //#region ../core/dist/commands/parse-command.js
498
- var Oe = /* @__PURE__ */ new Set([
626
+ var Pe = /* @__PURE__ */ new Set([
499
627
  "update-canvas",
500
628
  "add-component",
501
629
  "update-components",
@@ -507,8 +635,14 @@ var Oe = /* @__PURE__ */ new Set([
507
635
  "replace-sub-canvases",
508
636
  "move-components",
509
637
  "rename-variable",
510
- "update-theme"
511
- ]), ke = {
638
+ "update-theme",
639
+ "add-data-sources",
640
+ "update-data-source-params",
641
+ "add-variables",
642
+ "remove-variables",
643
+ "add-blueprint-elements",
644
+ "remove-blueprint-elements"
645
+ ]), Fe = {
512
646
  "update-canvas": /* @__PURE__ */ new Set(["type", "patch"]),
513
647
  "add-component": /* @__PURE__ */ new Set(["type", "component"]),
514
648
  "update-components": /* @__PURE__ */ new Set([
@@ -540,26 +674,44 @@ var Oe = /* @__PURE__ */ new Set([
540
674
  "variableId",
541
675
  "nextName"
542
676
  ]),
543
- "update-theme": /* @__PURE__ */ new Set(["type", "patch"])
544
- }, Ae = { "replace-sub-canvases": /* @__PURE__ */ new Set(["startCanvasId"]) }, je = 262144;
545
- function Me(t) {
546
- let n = e(t, { maxBytes: je });
677
+ "update-theme": /* @__PURE__ */ new Set(["type", "patch"]),
678
+ "add-data-sources": /* @__PURE__ */ new Set(["type", "dataSources"]),
679
+ "update-data-source-params": /* @__PURE__ */ new Set([
680
+ "type",
681
+ "dataSourceId",
682
+ "params"
683
+ ]),
684
+ "add-variables": /* @__PURE__ */ new Set(["type", "variables"]),
685
+ "remove-variables": /* @__PURE__ */ new Set(["type", "variableIds"]),
686
+ "add-blueprint-elements": /* @__PURE__ */ new Set([
687
+ "type",
688
+ "nodes",
689
+ "edges"
690
+ ]),
691
+ "remove-blueprint-elements": /* @__PURE__ */ new Set([
692
+ "type",
693
+ "nodeIds",
694
+ "edgeIds"
695
+ ])
696
+ }, Ie = { "replace-sub-canvases": /* @__PURE__ */ new Set(["startCanvasId"]) }, Le = 262144;
697
+ function Re(t) {
698
+ let n = e(t, { maxBytes: Le });
547
699
  if (!n.ok) return n;
548
700
  if (!D(n.value) || typeof n.value.type != "string") return {
549
701
  ok: !1,
550
702
  diagnostics: M("Command must be an object with a known type.", [])
551
703
  };
552
704
  let r = n.value.type;
553
- if (!Oe.has(r)) return {
705
+ if (!Pe.has(r)) return {
554
706
  ok: !1,
555
707
  diagnostics: M("Command type is not supported.", ["type"])
556
708
  };
557
- let i = ke[r];
709
+ let i = Fe[r];
558
710
  for (let e of Object.keys(n.value)) if (!i.has(e)) return {
559
711
  ok: !1,
560
712
  diagnostics: M("Command contains an unknown field.", [e])
561
713
  };
562
- for (let e of i) if (Ae[r]?.has(e) !== !0 && !Object.hasOwn(n.value, e)) return {
714
+ for (let e of i) if (Ie[r]?.has(e) !== !0 && !Object.hasOwn(n.value, e)) return {
563
715
  ok: !1,
564
716
  diagnostics: M("Command field is required.", [e])
565
717
  };
@@ -570,9 +722,56 @@ function Me(t) {
570
722
  };
571
723
  }
572
724
  //#endregion
725
+ //#region ../core/dist/data/sample-values.js
726
+ function ze(e) {
727
+ let t = [];
728
+ return e.components.forEach((e, n) => {
729
+ z(e.dataValue) && t.push({
730
+ path: [
731
+ "components",
732
+ n,
733
+ "dataValue"
734
+ ],
735
+ owner: {
736
+ kind: "component",
737
+ id: e.id
738
+ }
739
+ });
740
+ }), (e.dataSources ?? []).forEach((e, n) => {
741
+ for (let [r, i] of Object.entries(e.params)) z(i) && t.push({
742
+ path: [
743
+ "dataSources",
744
+ n,
745
+ "params",
746
+ r
747
+ ],
748
+ owner: {
749
+ kind: "data-source-param",
750
+ id: e.id,
751
+ param: r
752
+ }
753
+ });
754
+ }), e.variables.forEach((e, n) => {
755
+ z("value" in e ? e.value : void 0) && t.push({
756
+ path: [
757
+ "variables",
758
+ n,
759
+ "value"
760
+ ],
761
+ owner: {
762
+ kind: "variable",
763
+ id: e.id
764
+ }
765
+ });
766
+ }), t;
767
+ }
768
+ function z(e) {
769
+ return typeof e == "object" && !!e && e.kind === "inline" && e.sample === !0;
770
+ }
771
+ //#endregion
573
772
  //#region ../core/dist/diff/screen-diff.js
574
- var Ne = 80;
575
- function Pe(e, t) {
773
+ var Be = 80;
774
+ function Ve(e, t) {
576
775
  let n = new Map(e.components.map((e) => [e.id, e])), r = new Map(t.components.map((e) => [e.id, e])), i = [];
577
776
  for (let e of t.components) {
578
777
  let t = n.get(e.id);
@@ -585,7 +784,7 @@ function Pe(e, t) {
585
784
  });
586
785
  continue;
587
786
  }
588
- let r = Fe(t, e);
787
+ let r = He(t, e);
589
788
  r.length > 0 && i.push({
590
789
  componentId: e.id,
591
790
  componentName: e.name,
@@ -601,40 +800,40 @@ function Pe(e, t) {
601
800
  });
602
801
  return i;
603
802
  }
604
- function Fe(e, t) {
803
+ function He(e, t) {
605
804
  let n = [];
606
- return L("name", e.name, t.name, n), L("position.x", e.position.x, t.position.x, n), L("position.y", e.position.y, t.position.y, n), L("size.width", e.size.width, t.size.width, n), L("size.height", e.size.height, t.size.height, n), L("rotation", e.rotation, t.rotation, n), L("zIndex", e.zIndex, t.zIndex, n), Ie("props", e.props, t.props, n), Ie("style", e.style, t.style, n), L("dataValue", e.dataValue ?? null, t.dataValue ?? null, n), L("dataSource", e.dataSource ?? null, t.dataSource ?? null, n), L("states", e.states ?? null, t.states ?? null, n), n;
805
+ return V("type", e.type, t.type, n), V("name", e.name, t.name, n), V("parentId", e.parentId, t.parentId, n), V("position.x", e.position.x, t.position.x, n), V("position.y", e.position.y, t.position.y, n), V("size.width", e.size.width, t.size.width, n), V("size.height", e.size.height, t.size.height, n), V("rotation", e.rotation, t.rotation, n), V("zIndex", e.zIndex, t.zIndex, n), V("status", e.status, t.status, n), B("props", e.props, t.props, n), B("style", e.style, t.style, n), V("dataValue", e.dataValue ?? null, t.dataValue ?? null, n), V("dataSource", e.dataSource ?? null, t.dataSource ?? null, n), V("dataBinding", e.dataBinding ?? null, t.dataBinding ?? null, n), V("states", e.states ?? null, t.states ?? null, n), V("canvasId", e.canvasId, t.canvasId, n), V("belowSubCanvas", e.belowSubCanvas, t.belowSubCanvas, n), n;
607
806
  }
608
- function Ie(e, t, n, r) {
807
+ function B(e, t, n, r) {
609
808
  let i = [.../* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(n)])].sort();
610
- for (let a of i) L(`${e}.${a}`, t[a], n[a], r);
809
+ for (let a of i) V(`${e}.${a}`, t[a], n[a], r);
611
810
  }
612
- function L(e, t, n, r) {
613
- let i = R(t);
614
- i !== R(n) && r.push({
811
+ function V(e, t, n, r) {
812
+ let i = H(t);
813
+ i !== H(n) && r.push({
615
814
  path: e,
616
- before: Le(i),
617
- after: Le(R(n))
815
+ before: U(i),
816
+ after: U(H(n))
618
817
  });
619
818
  }
620
- function R(e) {
819
+ function H(e) {
621
820
  return e === void 0 ? "null" : JSON.stringify(e) ?? "null";
622
821
  }
623
- function Le(e) {
624
- return e.length > Ne ? `${e.slice(0, 79)}…` : e;
822
+ function U(e) {
823
+ return e.length > Be ? `${e.slice(0, 79)}…` : e;
625
824
  }
626
825
  //#endregion
627
826
  //#region ../core/dist/geometry/component-bounds.js
628
- function z(e) {
629
- let t = ee(e);
827
+ function W(e) {
828
+ let t = S(e);
630
829
  if (t === null) throw RangeError("Component geometry must be finite with positive dimensions.");
631
830
  return t;
632
831
  }
633
- function Re(e) {
832
+ function Ue(e) {
634
833
  if (e.length === 0) return null;
635
- let t = z(e[0]), n = t.left, r = t.top, i = t.right, a = t.bottom;
834
+ let t = W(e[0]), n = t.left, r = t.top, i = t.right, a = t.bottom;
636
835
  for (let t = 1; t < e.length; t++) {
637
- let o = z(e[t]);
836
+ let o = W(e[t]);
638
837
  n = Math.min(n, o.left), r = Math.min(r, o.top), i = Math.max(i, o.right), a = Math.max(a, o.bottom);
639
838
  }
640
839
  return {
@@ -646,22 +845,22 @@ function Re(e) {
646
845
  }
647
846
  //#endregion
648
847
  //#region ../core/dist/geometry/alignment.js
649
- function ze(e, t, n) {
848
+ function We(e, t, n) {
650
849
  if (t !== "x" && t !== "y") throw RangeError("Alignment axis must be x or y.");
651
850
  if (n !== "start" && n !== "center" && n !== "end") throw RangeError("Alignment mode must be start, center, or end.");
652
- let r = Ve(e);
851
+ let r = Ke(e);
653
852
  if (r.length < 2) return [];
654
- let i = r.filter(({ locked: e }) => e), a = i.length > 0 ? i : r, o = a.map(({ bounds: e }) => B(e, t)), s = a.map(({ bounds: e }) => V(e, t)), c = n === "start" ? Math.min(...o) : n === "end" ? Math.max(...s) : (Math.min(...o) + Math.max(...s)) / 2;
853
+ let i = r.filter(({ locked: e }) => e), a = i.length > 0 ? i : r, o = a.map(({ bounds: e }) => G(e, t)), s = a.map(({ bounds: e }) => K(e, t)), c = n === "start" ? Math.min(...o) : n === "end" ? Math.max(...s) : (Math.min(...o) + Math.max(...s)) / 2;
655
854
  return r.filter(({ locked: e }) => !e).map(({ component: e, bounds: r }) => ({
656
855
  componentId: e.id,
657
- delta: U(t, c - He(r, t, n))
658
- })).filter(({ delta: e }) => e.x !== 0 || e.y !== 0).sort(W);
856
+ delta: Ye(t, c - Je(r, t, n))
857
+ })).filter(({ delta: e }) => e.x !== 0 || e.y !== 0).sort(Xe);
659
858
  }
660
- function Be(e, t) {
859
+ function Ge(e, t) {
661
860
  if (t !== "x" && t !== "y") throw RangeError("Distribution axis must be x or y.");
662
- let n = [...Ve(e)].sort((e, n) => {
663
- let r = B(e.bounds, t) - B(n.bounds, t);
664
- return r === 0 ? G(e.component.id, n.component.id) : r;
861
+ let n = [...Ke(e)].sort((e, n) => {
862
+ let r = G(e.bounds, t) - G(n.bounds, t);
863
+ return r === 0 ? Ze(e.component.id, n.component.id) : r;
665
864
  });
666
865
  if (n.length < 2) return [];
667
866
  let r = /* @__PURE__ */ new Set([0, n.length - 1]);
@@ -670,41 +869,41 @@ function Be(e, t) {
670
869
  for (let e = 1; e < i.length; e++) {
671
870
  let r = i[e - 1], o = i[e], s = n.slice(r + 1, o);
672
871
  if (s.length === 0) continue;
673
- let c = n[r], l = n[o], u = (B(l.bounds, t) - V(c.bounds, t) - s.reduce((e, n) => e + H(n.bounds, t), 0)) / (s.length + 1), d = V(c.bounds, t) + u;
872
+ let c = n[r], l = n[o], u = (G(l.bounds, t) - K(c.bounds, t) - s.reduce((e, n) => e + qe(n.bounds, t), 0)) / (s.length + 1), d = K(c.bounds, t) + u;
674
873
  for (let e of s) {
675
- let n = d - B(e.bounds, t);
874
+ let n = d - G(e.bounds, t);
676
875
  n !== 0 && a.push({
677
876
  componentId: e.component.id,
678
- delta: U(t, n)
679
- }), d += H(e.bounds, t) + u;
877
+ delta: Ye(t, n)
878
+ }), d += qe(e.bounds, t) + u;
680
879
  }
681
880
  }
682
- return a.sort(W);
881
+ return a.sort(Xe);
683
882
  }
684
- function Ve(e) {
883
+ function Ke(e) {
685
884
  let t = h({ components: e });
686
885
  return e.filter((e) => !l(t, e.id)).map((e) => ({
687
886
  component: e,
688
- bounds: z(e),
887
+ bounds: W(e),
689
888
  locked: d(t, e.id)
690
889
  }));
691
890
  }
692
- function B(e, t) {
891
+ function G(e, t) {
693
892
  return t === "x" ? e.left : e.top;
694
893
  }
695
- function V(e, t) {
894
+ function K(e, t) {
696
895
  return t === "x" ? e.right : e.bottom;
697
896
  }
698
- function H(e, t) {
699
- return V(e, t) - B(e, t);
897
+ function qe(e, t) {
898
+ return K(e, t) - G(e, t);
700
899
  }
701
- function He(e, t, n) {
702
- let r = B(e, t);
900
+ function Je(e, t, n) {
901
+ let r = G(e, t);
703
902
  if (n === "start") return r;
704
- let i = V(e, t);
903
+ let i = K(e, t);
705
904
  return n === "end" ? i : r + (i - r) / 2;
706
905
  }
707
- function U(e, t) {
906
+ function Ye(e, t) {
708
907
  return e === "x" ? {
709
908
  x: x(t),
710
909
  y: 0
@@ -713,54 +912,54 @@ function U(e, t) {
713
912
  y: x(t)
714
913
  };
715
914
  }
716
- function W(e, t) {
717
- return G(e.componentId, t.componentId);
915
+ function Xe(e, t) {
916
+ return Ze(e.componentId, t.componentId);
718
917
  }
719
- function G(e, t) {
918
+ function Ze(e, t) {
720
919
  return e < t ? -1 : +(e > t);
721
920
  }
722
921
  //#endregion
723
922
  //#region ../core/dist/geometry/validation.js
724
- function K(e, t) {
923
+ function q(e, t) {
725
924
  if (typeof e != "object" || !e) throw RangeError(`${t} must be a finite point.`);
726
925
  b(e.x, `${t}.x`), b(e.y, `${t}.y`);
727
926
  }
728
- function Ue(e) {
927
+ function Qe(e) {
729
928
  if (typeof e != "object" || !e) throw RangeError("Rectangle must be an object.");
730
929
  if (b(e.x, "rect.x"), b(e.y, "rect.y"), b(e.width, "rect.width"), b(e.height, "rect.height"), e.width <= 0 || e.height <= 0) throw RangeError("Rectangle dimensions must be positive.");
731
930
  }
732
- function We(e) {
931
+ function $e(e) {
733
932
  if (typeof e != "object" || !e || e.offset === null) throw RangeError("Viewport must contain a zoom and finite offset.");
734
933
  if (e.zoom < .05 || e.zoom > 64) throw RangeError("Viewport zoom must be from 0.05 through 64.");
735
- b(e.zoom, "viewport.zoom"), K(e.offset, "viewport.offset");
934
+ b(e.zoom, "viewport.zoom"), q(e.offset, "viewport.offset");
736
935
  }
737
936
  //#endregion
738
937
  //#region ../core/dist/geometry/hit-testing.js
739
- function Ge(e, t, n = {}) {
740
- T(e), K(t, "point");
938
+ function et(e, t, n = {}) {
939
+ T(e), q(t, "point");
741
940
  let r = n.minimumThickness ?? 0;
742
941
  if (!Number.isFinite(r) || r < 0) throw RangeError("Hit test minimumThickness must be a non-negative finite number.");
743
942
  let i = h(e), a = i.byId;
744
943
  return [...p(e)].reverse().filter((e) => {
745
944
  let n = a.get(e)?.component;
746
- return n !== void 0 && !l(i, e) && qe(t, n, r);
945
+ return n !== void 0 && !l(i, e) && nt(t, n, r);
747
946
  });
748
947
  }
749
- function Ke(e, t, n) {
750
- if (T(e), Ue(t), n !== "intersect" && n !== "contain") throw RangeError("Query mode must be intersect or contain.");
948
+ function tt(e, t, n) {
949
+ if (T(e), Qe(t), n !== "intersect" && n !== "contain") throw RangeError("Query mode must be intersect or contain.");
751
950
  let r = h(e);
752
951
  return e.components.filter((e) => {
753
952
  if (l(r, e.id)) return !1;
754
- let i = Je(e);
755
- return n === "contain" ? i.every((e) => J(e, t)) : Ye(i, t);
953
+ let i = rt(e);
954
+ return n === "contain" ? i.every((e) => st(e, t)) : it(i, t);
756
955
  }).map(({ id: e }) => e);
757
956
  }
758
- function qe(e, t, n) {
957
+ function nt(e, t, n) {
759
958
  let r = t.size.width, i = t.size.height, a = Math.max(0, n - r) / 2, o = Math.max(0, n - i) / 2, s = t.position.x + r / 2, c = t.position.y + i / 2, l = -t.rotation * Math.PI / 180, u = Math.cos(l), d = Math.sin(l), f = (e.x - s) * u - (e.y - c) * d + r / 2, p = (e.x - s) * d + (e.y - c) * u + i / 2;
760
959
  return f >= -a && f <= r + a && p >= -o && p <= i + o;
761
960
  }
762
- function Je(e) {
763
- z(e);
961
+ function rt(e) {
962
+ W(e);
764
963
  let t = e.position.x + e.size.width / 2, n = e.position.y + e.size.height / 2, r = e.size.width / 2, i = e.size.height / 2, a = e.rotation * Math.PI / 180, o = Math.cos(a), s = Math.sin(a);
765
964
  return [
766
965
  {
@@ -779,13 +978,13 @@ function Je(e) {
779
978
  x: -r,
780
979
  y: i
781
980
  }
782
- ].map(({ x: e, y: r }) => S({
981
+ ].map(({ x: e, y: r }) => ee({
783
982
  x: t + e * o - r * s,
784
983
  y: n + e * s + r * o
785
984
  }));
786
985
  }
787
- function Ye(e, t) {
788
- if (e.some((e) => J(e, t))) return !0;
986
+ function it(e, t) {
987
+ if (e.some((e) => st(e, t))) return !0;
789
988
  let n = [
790
989
  {
791
990
  x: t.x,
@@ -804,17 +1003,17 @@ function Ye(e, t) {
804
1003
  y: t.y + t.height
805
1004
  }
806
1005
  ];
807
- if (n.some((t) => Xe(t, e))) return !0;
1006
+ if (n.some((t) => at(t, e))) return !0;
808
1007
  for (let t = 0; t < e.length; t++) {
809
1008
  let r = e[t], i = e[(t + 1) % e.length];
810
1009
  for (let e = 0; e < n.length; e++) {
811
1010
  let t = n[e], a = n[(e + 1) % n.length];
812
- if (Ze(r, i, t, a)) return !0;
1011
+ if (ot(r, i, t, a)) return !0;
813
1012
  }
814
1013
  }
815
1014
  return !1;
816
1015
  }
817
- function Xe(e, t) {
1016
+ function at(e, t) {
818
1017
  let n = !1, r = !1;
819
1018
  for (let i = 0; i < t.length; i++) {
820
1019
  let a = t[i], o = t[(i + 1) % t.length], s = (o.x - a.x) * (e.y - a.y) - (o.y - a.y) * (e.x - a.x);
@@ -822,35 +1021,35 @@ function Xe(e, t) {
822
1021
  }
823
1022
  return !(n && r);
824
1023
  }
825
- function Ze(e, t, n, r) {
1024
+ function ot(e, t, n, r) {
826
1025
  let i = (e, t, n) => (t.x - e.x) * (n.y - e.y) - (t.y - e.y) * (n.x - e.x), a = i(e, t, n), o = i(e, t, r), s = i(n, r, e), c = i(n, r, t);
827
- return a === 0 && q(n, e, t) || o === 0 && q(r, e, t) || s === 0 && q(e, n, r) || c === 0 && q(t, n, r) ? !0 : a > 0 != o > 0 && s > 0 != c > 0;
1026
+ return a === 0 && J(n, e, t) || o === 0 && J(r, e, t) || s === 0 && J(e, n, r) || c === 0 && J(t, n, r) ? !0 : a > 0 != o > 0 && s > 0 != c > 0;
828
1027
  }
829
- function q(e, t, n) {
1028
+ function J(e, t, n) {
830
1029
  return e.x >= Math.min(t.x, n.x) && e.x <= Math.max(t.x, n.x) && e.y >= Math.min(t.y, n.y) && e.y <= Math.max(t.y, n.y);
831
1030
  }
832
- function J(e, t) {
1031
+ function st(e, t) {
833
1032
  return e.x >= t.x && e.x <= t.x + t.width && e.y >= t.y && e.y <= t.y + t.height;
834
1033
  }
835
1034
  //#endregion
836
1035
  //#region ../core/dist/hierarchy/query.js
837
- function Qe(e, t) {
1036
+ function ct(e, t) {
838
1037
  return l(h(e), t);
839
1038
  }
840
- function $e(e, t) {
1039
+ function lt(e, t) {
841
1040
  return d(h(e), t);
842
1041
  }
843
1042
  //#endregion
844
1043
  //#region ../core/dist/history/history.js
845
- function et(e) {
1044
+ function ut(e) {
846
1045
  return T(e), {
847
1046
  past: [],
848
1047
  present: e,
849
1048
  future: []
850
1049
  };
851
1050
  }
852
- function tt(e, t, n = 100, r) {
853
- if (Y(e), T(t), st(n), t === e.present) return e;
1051
+ function dt(e, t, n = 100, r) {
1052
+ if (Y(e), T(t), _t(n), t === e.present) return e;
854
1053
  let i = [...e.past, {
855
1054
  before: e.present,
856
1055
  after: t,
@@ -862,25 +1061,25 @@ function tt(e, t, n = 100, r) {
862
1061
  future: []
863
1062
  };
864
1063
  }
865
- function nt(e) {
1064
+ function ft(e) {
866
1065
  Y(e);
867
1066
  let t = e.past.at(-1);
868
1067
  return t === void 0 ? e : {
869
1068
  past: e.past.slice(0, -1),
870
1069
  present: t.before,
871
- future: [ot(t), ...e.future]
1070
+ future: [gt(t), ...e.future]
872
1071
  };
873
1072
  }
874
- function rt(e) {
1073
+ function pt(e) {
875
1074
  Y(e);
876
1075
  let t = e.future[0];
877
1076
  return t === void 0 ? e : {
878
- past: [...e.past, ot(t)],
1077
+ past: [...e.past, gt(t)],
879
1078
  present: t.after,
880
1079
  future: e.future.slice(1)
881
1080
  };
882
1081
  }
883
- function it(e, t) {
1082
+ function mt(e, t) {
884
1083
  if (Y(e), !Number.isInteger(t) || t < 0 || t > e.past.length) throw RangeError("History revert target must be an integer from 0 through past.length.");
885
1084
  let n = t === 0 ? e.past[0]?.before : e.past[t - 1]?.after;
886
1085
  return n === void 0 || n === e.present ? e : {
@@ -889,7 +1088,7 @@ function it(e, t) {
889
1088
  future: [...e.past.slice(t), ...e.future]
890
1089
  };
891
1090
  }
892
- function at(e) {
1091
+ function ht(e) {
893
1092
  Y(e);
894
1093
  let t = e.past.length, n = [{
895
1094
  index: 0,
@@ -910,7 +1109,7 @@ function at(e) {
910
1109
  });
911
1110
  }), n;
912
1111
  }
913
- function ot(e) {
1112
+ function gt(e) {
914
1113
  return {
915
1114
  before: e.before,
916
1115
  after: e.after,
@@ -920,12 +1119,12 @@ function ot(e) {
920
1119
  function Y(e) {
921
1120
  if (typeof e.present != "object" || e.present === null || !Array.isArray(e.past) || !Array.isArray(e.future)) throw TypeError("Screen history state is corrupted.");
922
1121
  }
923
- function st(e) {
1122
+ function _t(e) {
924
1123
  if (!Number.isInteger(e) || e < 1 || e > 1e3) throw RangeError("History limit must be an integer from 1 through 1000.");
925
1124
  }
926
1125
  //#endregion
927
1126
  //#region ../core/dist/state/interaction.js
928
- function ct(e, t, n) {
1127
+ function vt(e, t, n) {
929
1128
  T(n);
930
1129
  let r = X(e.selectedComponentIds, n);
931
1130
  if (typeof t != "object" || !t) return Z(e, r, e.focusedComponentId);
@@ -956,24 +1155,24 @@ function Z(e, t, n) {
956
1155
  }
957
1156
  //#endregion
958
1157
  //#region ../core/dist/state/viewport.js
959
- var lt = {
1158
+ var yt = {
960
1159
  zoom: 1,
961
1160
  offset: {
962
1161
  x: 0,
963
1162
  y: 0
964
1163
  }
965
1164
  };
966
- function ut(e, t) {
967
- if (!dt(e) || typeof t != "object" || !t) return e;
1165
+ function bt(e, t) {
1166
+ if (!xt(e) || typeof t != "object" || !t) return e;
968
1167
  switch (t.type) {
969
- case "reset": return e.zoom === 1 && e.offset.x === 0 && e.offset.y === 0 ? e : lt;
1168
+ case "reset": return e.zoom === 1 && e.offset.x === 0 && e.offset.y === 0 ? e : yt;
970
1169
  case "pan-by": return $(t.delta) ? Q(e, e.zoom, {
971
1170
  x: e.offset.x + t.delta.x,
972
1171
  y: e.offset.y + t.delta.y
973
1172
  }) : e;
974
1173
  case "set-offset": return $(t.offset) ? Q(e, e.zoom, t.offset) : e;
975
1174
  case "set-zoom":
976
- if (!ft(t.zoom) || !$(t.anchor)) return e;
1175
+ if (!St(t.zoom) || !$(t.anchor)) return e;
977
1176
  let n = (t.anchor.x - e.offset.x) / e.zoom, r = (t.anchor.y - e.offset.y) / e.zoom;
978
1177
  return Q(e, t.zoom, {
979
1178
  x: t.anchor.x - n * t.zoom,
@@ -993,16 +1192,16 @@ function Q(e, t, n) {
993
1192
  offset: r
994
1193
  };
995
1194
  }
996
- function dt(e) {
997
- return ft(e.zoom) && $(e.offset);
1195
+ function xt(e) {
1196
+ return St(e.zoom) && $(e.offset);
998
1197
  }
999
- function ft(e) {
1198
+ function St(e) {
1000
1199
  return typeof e == "number" && Number.isFinite(e) && e >= .05 && e <= 64;
1001
1200
  }
1002
1201
  function $(e) {
1003
1202
  return typeof e == "object" && !!e && typeof e.x == "number" && typeof e.y == "number" && Number.isFinite(e.x) && Number.isFinite(e.y);
1004
1203
  }
1005
1204
  //#endregion
1006
- export { w as C, g as D, y as E, xe as S, S as T, z as _, at as a, Me as b, nt as c, Ge as d, Ke as f, Be as g, ze as h, et as i, Qe as l, We as m, ct as n, rt as o, K as p, tt as r, it as s, ut as t, $e as u, Re as v, b as w, be as x, Pe as y };
1205
+ export { De as C, ee as D, b as E, y as O, Ee as S, S as T, W as _, ht as a, ze as b, ft as c, et as d, tt as f, Ge as g, We as h, ut as i, g as k, ct as l, $e as m, vt as n, pt as o, q as p, dt as r, mt as s, bt as t, lt as u, Ue as v, w, Re as x, Ve as y };
1007
1206
 
1008
- //# sourceMappingURL=viewport-CiCKeAQH.js.map
1207
+ //# sourceMappingURL=viewport-BNIRWjiT.js.map