base-screen 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/dist/_internal/contracts/document/schema.d.ts +7 -0
  2. package/dist/_internal/contracts/document/schema.js +1 -1
  3. package/dist/_internal/contracts/document/validate-value-ref.js +6 -1
  4. package/dist/_internal/contracts/screen-document.schema.json +15 -3
  5. package/dist/_internal/contracts/types/diagnostics.d.ts +1 -1
  6. package/dist/_internal/contracts/types/document.d.ts +3 -1
  7. package/dist/_internal/core/blueprint/runtime-simulate.d.ts +57 -0
  8. package/dist/_internal/core/blueprint/runtime-simulate.js +177 -0
  9. package/dist/_internal/core/blueprint/runtime.d.ts +1 -0
  10. package/dist/_internal/core/blueprint/runtime.js +1 -0
  11. package/dist/_internal/core/commands/apply-collection-commands.d.ts +32 -0
  12. package/dist/_internal/core/commands/apply-collection-commands.js +174 -0
  13. package/dist/_internal/core/commands/apply.js +13 -0
  14. package/dist/_internal/core/commands/parse-command.js +12 -0
  15. package/dist/_internal/core/commands/types.d.ts +29 -1
  16. package/dist/_internal/core/data/data-candidates.d.ts +38 -0
  17. package/dist/_internal/core/data/data-candidates.js +186 -0
  18. package/dist/_internal/core/data/dataset-profile.d.ts +71 -0
  19. package/dist/_internal/core/data/dataset-profile.js +170 -0
  20. package/dist/_internal/core/data/sample-values.d.ts +25 -0
  21. package/dist/_internal/core/data/sample-values.js +45 -0
  22. package/dist/_internal/core/diff/screen-diff.js +6 -0
  23. package/dist/_internal/core/index.d.ts +7 -1
  24. package/dist/_internal/core/index.js +7 -1
  25. package/dist/_internal/core/state/state-preset.d.ts +32 -0
  26. package/dist/_internal/core/state/state-preset.js +37 -0
  27. package/dist/_internal/core/validation/layout-audit.d.ts +17 -0
  28. package/dist/_internal/core/validation/layout-audit.js +228 -0
  29. package/dist/_internal/core/validation/legibility.d.ts +9 -0
  30. package/dist/_internal/core/validation/legibility.js +33 -0
  31. package/dist/_internal/engine/browser/controllers/dataset/designer-dataset-draft-controller.d.ts +6 -1
  32. package/dist/_internal/engine/browser/controllers/designer-change-controller.d.ts +27 -0
  33. package/dist/_internal/engine/browser/dom/change/designer-change-dom.d.ts +21 -5
  34. package/dist/_internal/engine/browser/dom/dataset/designer-data-section-diff.d.ts +4 -6
  35. package/dist/_internal/engine/browser/dom/value-ref/designer-value-ref-types.d.ts +2 -0
  36. package/dist/_internal/engine/browser/viewport/designer-canvas-aids-types.d.ts +3 -3
  37. package/dist/_internal/engine/browser/viewport/designer-canvas-aids.d.ts +5 -3
  38. package/dist/_internal/engine/browser/viewport/designer-canvas-measurements.d.ts +2 -14
  39. package/dist/_internal/engine/browser/viewport/designer-guide-overlay-nodes.d.ts +2 -0
  40. package/dist/_internal/engine/browser/viewport/designer-snap-tuning.d.ts +14 -0
  41. package/dist/_internal/engine/common/operations/change/designer-change-events.d.ts +2 -0
  42. package/dist/_internal/engine/common/operations/change/designer-change-proposal.d.ts +35 -2
  43. package/dist/_internal/engine/common/operations/display/designer-target-display.d.ts +2 -2
  44. package/dist/_internal/engine/common/operations/style/designer-component-states.d.ts +7 -2
  45. package/dist/_internal/engine/common/ui-text/designer-ui-text.d.ts +42 -2
  46. package/dist/_internal/engine/{designer-blueprint-workbench-panel-CJ3iZo5v.js → designer-blueprint-workbench-panel-BWSglfAb.js} +210 -290
  47. package/dist/_internal/engine/{designer-dataset-controller-CrfOg2Ys.js → designer-dataset-controller-DdbY4ILC.js} +619 -561
  48. package/dist/_internal/engine/designer-element/api/designer-element-change.d.ts +24 -0
  49. package/dist/_internal/engine/designer-element/base-screen-designer-element.d.ts +12 -0
  50. package/dist/_internal/engine/designer-element/designer-element-public-api.d.ts +2 -1
  51. package/dist/_internal/engine/designer-element/runtime/designer-element-rendering.d.ts +1 -1
  52. package/dist/_internal/engine/designer-element/runtime/designer-element-runtime.d.ts +4 -1
  53. package/dist/_internal/engine/designer-element/runtime/designer-element-sample-data.d.ts +23 -0
  54. package/dist/_internal/engine/{designer-field-primitives-KBZuWN_D.js → designer-field-primitives-Crn464Qg.js} +44 -3
  55. package/dist/_internal/engine/{designer-left-panel-groups-dom-N2OHOWjl.js → designer-left-panel-groups-dom-DFdLWxxY.js} +2 -2
  56. package/dist/_internal/engine/{host-resource-selection-xo2mLCD4.js → host-resource-selection-CWrPLVOc.js} +2 -2
  57. package/dist/_internal/engine/index.js +4742 -4360
  58. package/dist/_internal/host-kit/index.d.ts +1 -0
  59. package/dist/_internal/host-kit/index.js +1 -0
  60. package/dist/_internal/host-kit/intent/index.d.ts +16 -0
  61. package/dist/_internal/host-kit/intent/index.js +13 -0
  62. package/dist/_internal/host-kit/intent/intent-behavior.d.ts +59 -0
  63. package/dist/_internal/host-kit/intent/intent-behavior.js +812 -0
  64. package/dist/_internal/host-kit/intent/intent-block.d.ts +59 -0
  65. package/dist/_internal/host-kit/intent/intent-block.js +359 -0
  66. package/dist/_internal/host-kit/intent/intent-catalog.d.ts +105 -0
  67. package/dist/_internal/host-kit/intent/intent-catalog.js +60 -0
  68. package/dist/_internal/host-kit/intent/intent-compile-types.d.ts +222 -0
  69. package/dist/_internal/host-kit/intent/intent-compile-types.js +10 -0
  70. package/dist/_internal/host-kit/intent/intent-compile.d.ts +35 -0
  71. package/dist/_internal/host-kit/intent/intent-compile.js +465 -0
  72. package/dist/_internal/host-kit/intent/intent-data-check.d.ts +50 -0
  73. package/dist/_internal/host-kit/intent/intent-data-check.js +163 -0
  74. package/dist/_internal/host-kit/intent/intent-data-context.d.ts +53 -0
  75. package/dist/_internal/host-kit/intent/intent-data-context.js +200 -0
  76. package/dist/_internal/host-kit/intent/intent-dataset.d.ts +52 -0
  77. package/dist/_internal/host-kit/intent/intent-dataset.js +125 -0
  78. package/dist/_internal/host-kit/intent/intent-format.d.ts +33 -0
  79. package/dist/_internal/host-kit/intent/intent-format.js +94 -0
  80. package/dist/_internal/host-kit/intent/intent-kpi-bind.d.ts +29 -0
  81. package/dist/_internal/host-kit/intent/intent-kpi-bind.js +59 -0
  82. package/dist/_internal/host-kit/intent/intent-layout.d.ts +102 -0
  83. package/dist/_internal/host-kit/intent/intent-layout.js +264 -0
  84. package/dist/_internal/host-kit/intent/intent-parse.d.ts +39 -0
  85. package/dist/_internal/host-kit/intent/intent-parse.js +930 -0
  86. package/dist/_internal/host-kit/intent/intent-prepare.d.ts +52 -0
  87. package/dist/_internal/host-kit/intent/intent-prepare.js +104 -0
  88. package/dist/_internal/host-kit/intent/intent-session.d.ts +202 -0
  89. package/dist/_internal/host-kit/intent/intent-session.js +1001 -0
  90. package/dist/_internal/host-kit/intent/intent-stream.d.ts +28 -0
  91. package/dist/_internal/host-kit/intent/intent-stream.js +183 -0
  92. package/dist/_internal/host-kit/intent/intent-style.d.ts +37 -0
  93. package/dist/_internal/host-kit/intent/intent-style.js +77 -0
  94. package/dist/_internal/host-kit/intent/intent-types.d.ts +234 -0
  95. package/dist/_internal/host-kit/intent/intent-types.js +10 -0
  96. package/dist/_internal/material/chart.js +34 -12
  97. package/dist/_internal/material/table.js +52 -21
  98. package/dist/_internal/plugin-sdk/index.d.ts +6 -0
  99. package/dist/_internal/plugin-sdk/index.js +6 -0
  100. package/dist/_internal/plugin-sdk/material-isolated-csp.d.ts +38 -0
  101. package/dist/_internal/plugin-sdk/material-isolated-csp.js +67 -0
  102. package/dist/_internal/plugin-sdk/material-isolated-runtime.d.ts +22 -0
  103. package/dist/_internal/plugin-sdk/material-isolated-runtime.js +262 -0
  104. package/dist/_internal/plugin-sdk/material-isolated.d.ts +94 -0
  105. package/dist/_internal/plugin-sdk/material-isolated.js +1024 -0
  106. package/dist/_internal/plugin-sdk/material-rendered-element.d.ts +10 -2
  107. package/dist/_internal/plugin-sdk/material-rendered-element.js +71 -7
  108. package/dist/_internal/plugin-sdk/material-spec-audit.d.ts +2 -0
  109. package/dist/_internal/plugin-sdk/material-spec-audit.js +26 -6
  110. package/dist/_internal/plugin-sdk/material-spec.d.ts +20 -0
  111. package/dist/_internal/plugin-sdk/material-spec.js +78 -3
  112. package/dist/_internal/plugin-sdk/material-template-audit.d.ts +12 -0
  113. package/dist/_internal/plugin-sdk/material-template-audit.js +302 -0
  114. package/dist/_internal/plugin-sdk/material-template-expression.d.ts +98 -0
  115. package/dist/_internal/plugin-sdk/material-template-expression.js +549 -0
  116. package/dist/_internal/plugin-sdk/material-template-render.d.ts +32 -0
  117. package/dist/_internal/plugin-sdk/material-template-render.js +579 -0
  118. package/dist/_internal/plugin-sdk/material-template.d.ts +185 -0
  119. package/dist/_internal/plugin-sdk/material-template.js +879 -0
  120. package/dist/auto-register.js +10 -10
  121. package/dist/contracts.js +5 -5
  122. package/dist/contrast-DRPezUIl.js +131 -0
  123. package/dist/contrast-DRPezUIl.js.map +1 -0
  124. package/dist/core.js +156 -136
  125. package/dist/core.js.map +1 -1
  126. package/dist/dataset-profile-Dk6xdtsM.js +261 -0
  127. package/dist/dataset-profile-Dk6xdtsM.js.map +1 -0
  128. package/dist/{designer-3Tb0EIDV.js → designer-CFOvOmLn.js} +2 -2
  129. package/dist/{designer-3Tb0EIDV.js.map → designer-CFOvOmLn.js.map} +1 -1
  130. package/dist/designer-auto-register.js +5 -5
  131. package/dist/{designer-blueprint-workbench-panel-CJ3iZo5v-BebifP4x.js → designer-blueprint-workbench-panel-BWSglfAb-ktaj6Ci9.js} +452 -531
  132. package/dist/designer-blueprint-workbench-panel-BWSglfAb-ktaj6Ci9.js.map +1 -0
  133. package/dist/{designer-dataset-controller-CrfOg2Ys-DhKUEJJe.js → designer-dataset-controller-DdbY4ILC-CMdGdGbr.js} +862 -804
  134. package/dist/designer-dataset-controller-DdbY4ILC-CMdGdGbr.js.map +1 -0
  135. package/dist/{designer-field-primitives-KBZuWN_D-B3h4jpYe.js → designer-field-primitives-Crn464Qg-Bi7q8s5J.js} +45 -4
  136. package/dist/designer-field-primitives-Crn464Qg-Bi7q8s5J.js.map +1 -0
  137. package/dist/{designer-left-panel-groups-dom-N2OHOWjl-D8CzGwbF.js → designer-left-panel-groups-dom-DFdLWxxY-BarlWMLY.js} +4 -4
  138. package/dist/{designer-left-panel-groups-dom-N2OHOWjl-D8CzGwbF.js.map → designer-left-panel-groups-dom-DFdLWxxY-BarlWMLY.js.map} +1 -1
  139. package/dist/designer.js +5 -5
  140. package/dist/{dist-6GRboBs-.js → dist-B2bW2Tru.js} +4 -4
  141. package/dist/{dist-6GRboBs-.js.map → dist-B2bW2Tru.js.map} +1 -1
  142. package/dist/{dist-BjLjFUy1.js → dist-CHK9BTXX.js} +3833 -3453
  143. package/dist/dist-CHK9BTXX.js.map +1 -0
  144. package/dist/engine.js +5 -5
  145. package/dist/{fragment-Y6YnW6wy.js → fragment-B-oP0Fru.js} +3 -3
  146. package/dist/{fragment-Y6YnW6wy.js.map → fragment-B-oP0Fru.js.map} +1 -1
  147. package/dist/host-kit.js +3963 -187
  148. package/dist/host-kit.js.map +1 -1
  149. package/dist/{host-resource-selection-xo2mLCD4-BR5XCcim.js → host-resource-selection-CWrPLVOc-DPDq3jau.js} +5 -5
  150. package/dist/{host-resource-selection-xo2mLCD4-BR5XCcim.js.map → host-resource-selection-CWrPLVOc-DPDq3jau.js.map} +1 -1
  151. package/dist/index.js +10 -10
  152. package/dist/legibility-CS28ivEz.js +12 -0
  153. package/dist/legibility-CS28ivEz.js.map +1 -0
  154. package/dist/{level-scale-BzUjE31V.js → level-scale-CwHqFEVd.js} +2 -2
  155. package/dist/{level-scale-BzUjE31V.js.map → level-scale-CwHqFEVd.js.map} +1 -1
  156. package/dist/{manager-Ch0RTu_i.js → manager-CeB4Jnr9.js} +3 -3
  157. package/dist/{manager-Ch0RTu_i.js.map → manager-CeB4Jnr9.js.map} +1 -1
  158. package/dist/{material-UbSfiuZq.js → material-DeVkzSoT.js} +2 -2
  159. package/dist/{material-UbSfiuZq.js.map → material-DeVkzSoT.js.map} +1 -1
  160. package/dist/material-auto-register.js +1 -1
  161. package/dist/material.js +2 -2
  162. package/dist/{migrate-document-D3HhCVlZ.js → migrate-document-BM888PtC.js} +2 -2
  163. package/dist/{migrate-document-D3HhCVlZ.js.map → migrate-document-BM888PtC.js.map} +1 -1
  164. package/dist/{parse-AOTE9WnD.js → parse-Ji7kE9ZT.js} +9 -4
  165. package/dist/parse-Ji7kE9ZT.js.map +1 -0
  166. package/dist/{parse-B1OD1teS.js → parse-aZat9tAS.js} +3 -3
  167. package/dist/{parse-B1OD1teS.js.map → parse-aZat9tAS.js.map} +1 -1
  168. package/dist/{parse-parts-BNrpdG5o.js → parse-parts-qzl4suzk.js} +2 -2
  169. package/dist/{parse-parts-BNrpdG5o.js.map → parse-parts-qzl4suzk.js.map} +1 -1
  170. package/dist/{plugin-DHgh9uHh.js → plugin-CstHQ5ws.js} +4 -4
  171. package/dist/{plugin-DHgh9uHh.js.map → plugin-CstHQ5ws.js.map} +1 -1
  172. package/dist/plugin-core.js +2 -2
  173. package/dist/plugin-manager.js +1 -1
  174. package/dist/plugin-package-DWifuHi1.js +4206 -0
  175. package/dist/plugin-package-DWifuHi1.js.map +1 -0
  176. package/dist/{plugin-registration-rsmb4GvS.js → plugin-registration-DTwBvnHX.js} +2 -2
  177. package/dist/{plugin-registration-rsmb4GvS.js.map → plugin-registration-DTwBvnHX.js.map} +1 -1
  178. package/dist/plugin-sdk.js +6 -6
  179. package/dist/{plugins-DGRHgREK.js → plugins-QDL0yIql.js} +2 -2
  180. package/dist/{plugins-DGRHgREK.js.map → plugins-QDL0yIql.js.map} +1 -1
  181. package/dist/plugins.js +8 -8
  182. package/dist/renderer.js +1 -1
  183. package/dist/{runtime-dispatch-BfnRDtMe.js → runtime-dispatch-C0gyIrTv.js} +2 -2
  184. package/dist/{runtime-dispatch-BfnRDtMe.js.map → runtime-dispatch-C0gyIrTv.js.map} +1 -1
  185. package/dist/runtime-simulate-aSYO9yDX.js +147 -0
  186. package/dist/runtime-simulate-aSYO9yDX.js.map +1 -0
  187. package/dist/{src-Bm7u11mN-_0u6cMEw.js → src-Bm7u11mN-Bi1hDVkh.js} +39 -39
  188. package/dist/{src-Bm7u11mN-_0u6cMEw.js.map → src-Bm7u11mN-Bi1hDVkh.js.map} +1 -1
  189. package/dist/state-preset-DtpygJOH.js +22 -0
  190. package/dist/state-preset-DtpygJOH.js.map +1 -0
  191. package/dist/{text-BNksUr5J.js → text-BSTz0pFQ.js} +87 -34
  192. package/dist/text-BSTz0pFQ.js.map +1 -0
  193. package/dist/{value-ref-BG_MV9C-.js → value-ref-XkLuckGV.js} +2 -2
  194. package/dist/{value-ref-BG_MV9C-.js.map → value-ref-XkLuckGV.js.map} +1 -1
  195. package/dist/{viewer-CrJupI8I-D9dVcNw4.js → viewer-CrJupI8I-BJiz1cvW.js} +4 -4
  196. package/dist/{viewer-CrJupI8I-D9dVcNw4.js.map → viewer-CrJupI8I-BJiz1cvW.js.map} +1 -1
  197. package/dist/viewer-auto-register.js +2 -2
  198. package/dist/viewer.js +2 -2
  199. package/dist/{viewport-CiCKeAQH.js → viewport-BNIRWjiT.js} +354 -155
  200. package/dist/viewport-BNIRWjiT.js.map +1 -0
  201. package/package.json +12 -12
  202. package/dist/designer-blueprint-workbench-panel-CJ3iZo5v-BebifP4x.js.map +0 -1
  203. package/dist/designer-dataset-controller-CrfOg2Ys-DhKUEJJe.js.map +0 -1
  204. package/dist/designer-field-primitives-KBZuWN_D-B3h4jpYe.js.map +0 -1
  205. package/dist/dist-BjLjFUy1.js.map +0 -1
  206. package/dist/parse-AOTE9WnD.js.map +0 -1
  207. package/dist/plugin-package-Dr5ro6h6.js +0 -1221
  208. package/dist/plugin-package-Dr5ro6h6.js.map +0 -1
  209. package/dist/text-BNksUr5J.js.map +0 -1
  210. package/dist/viewport-CiCKeAQH.js.map +0 -1
@@ -1,11 +1,14 @@
1
1
  export type { ScreenCanvas, ScreenComponentNode, ScreenComponentStatus, ScreenDiagnostic, ScreenDocument, ScreenJsonObject, ScreenPosition, ScreenSize, ScreenStaticDataSource, ScreenStaticVariable, ScreenVariable, } from '../contracts/index.js';
2
- export { compileScreenBlueprint, dispatchScreenBlueprintEvent, SCREEN_BLUEPRINT_COMPONENT_VISIBILITY_CAPABILITY, type ScreenBlueprintActionTrace, type ScreenBlueprintCanvasEffect, type ScreenBlueprintCanvasEvent, type ScreenBlueprintCanvasVisibilityActionTrace, type ScreenBlueprintComponentStateActionTrace, type ScreenBlueprintComponentStateEvent, type ScreenBlueprintComponentVisibilityActionTrace, type ScreenBlueprintConditionTrace, type ScreenBlueprintDispatchResult, type ScreenBlueprintEmitHostEventActionTrace, type ScreenBlueprintEvent, type ScreenBlueprintHostActionTrace, type ScreenBlueprintPageChangedEvent, type ScreenBlueprintPageNavigationActionTrace, type ScreenBlueprintPlan, type ScreenBlueprintRuleTrace, type ScreenBlueprintSetVariableActionTrace, type ScreenBlueprintStateEffect, type ScreenBlueprintTraceResult, type ScreenBlueprintVisibilityEffect, traceScreenBlueprintEvent, } from './blueprint/runtime.js';
2
+ export { compileScreenBlueprint, dispatchScreenBlueprintEvent, SCREEN_BLUEPRINT_COMPONENT_VISIBILITY_CAPABILITY, SCREEN_BLUEPRINT_SIMULATION_MAX_DEPTH, type ScreenBlueprintActionTrace, type ScreenBlueprintCanvasEffect, type ScreenBlueprintCanvasEvent, type ScreenBlueprintCanvasVisibilityActionTrace, type ScreenBlueprintComponentStateActionTrace, type ScreenBlueprintComponentStateEvent, type ScreenBlueprintComponentVisibilityActionTrace, type ScreenBlueprintConditionTrace, type ScreenBlueprintDispatchResult, type ScreenBlueprintEmitHostEventActionTrace, type ScreenBlueprintEvent, type ScreenBlueprintHostActionTrace, type ScreenBlueprintPageChangedEvent, type ScreenBlueprintPageNavigationActionTrace, type ScreenBlueprintPlan, type ScreenBlueprintRuleTrace, type ScreenBlueprintSetVariableActionTrace, type ScreenBlueprintSimulation, type ScreenBlueprintSimulationDispatch, type ScreenBlueprintSimulationOptions, type ScreenBlueprintSimulationParamChange, type ScreenBlueprintStateEffect, type ScreenBlueprintTraceResult, type ScreenBlueprintVisibilityEffect, simulateScreenBlueprint, traceScreenBlueprintEvent, } from './blueprint/runtime.js';
3
3
  export { applyScreenDocumentCommand, applyScreenDocumentTransaction } from './commands/apply.js';
4
4
  export { parseScreenDocumentCommand } from './commands/parse-command.js';
5
5
  export type { ScreenCanvasPatch, ScreenCommandResult, ScreenComponentPatch, ScreenDocumentCommand, ScreenDocumentTransaction, ScreenTransactionFailure, ScreenTransactionProvenance, ScreenTransactionResult, ScreenTransactionSource, ScreenTransactionSuccess, } from './commands/types.js';
6
+ export { type EnumerateScreenDataCandidatesOptions, enumerateScreenDataCandidates, SCREEN_CATEGORY_MAX, SCREEN_PROPORTION_MAX, type ScreenCandidateMaterial, type ScreenDataCandidate, type ScreenDataFact, } from './data/data-candidates.js';
6
7
  export { componentsReferencingDataSources } from './data/data-source-dependents.js';
8
+ export { profileScreenDataset, SCREEN_PROFILE_MAX_FIELDS, SCREEN_PROFILE_MAX_ROWS, type ScreenDatasetProfile, type ScreenFieldKind, type ScreenFieldProfile, type ScreenParameterProfile, type ScreenTimeGranularity, } from './data/dataset-profile.js';
7
9
  export type { ScreenDataBindingRole, ScreenDataBindingValidation, ScreenHostResourceBindingValidation, ScreenHostResourceParameterEvaluation, } from './data/host-dataset.js';
8
10
  export { evaluateScreenHostResourceParameters, extractScreenHostResourceVariableDependencies, validateScreenDataBinding, validateScreenHostResourceBinding, } from './data/host-dataset.js';
11
+ export { listSampleValueRefs, type ScreenSampleValueRef } from './data/sample-values.js';
9
12
  export type { ScreenValueRefDependencies, ScreenValueRefEnvironment, ScreenValueRefEvaluation, ScreenValueRefFailureReason, } from './data/value-ref.js';
10
13
  export { collectScreenValueRefDependencies, evaluateScreenValueRef, } from './data/value-ref.js';
11
14
  export * from './diff/screen-diff.js';
@@ -20,9 +23,12 @@ export { commitScreenHistory, createScreenHistory, readScreenHistoryNodes, redoS
20
23
  export { deleteScreenJsonPath, getScreenJsonPath, insertScreenJsonArrayItem, moveScreenJsonArrayItem, removeScreenJsonArrayItem, setScreenJsonArrayItem, setScreenJsonPath, } from './json/path-update.js';
21
24
  export type { ScreenInteractionAction, ScreenInteractionState } from './state/interaction.js';
22
25
  export { reduceScreenInteraction } from './state/interaction.js';
26
+ export { type ScreenStatePresetField, type ScreenStatePresetSource, screenStatePresetStyle, } from './state/state-preset.js';
23
27
  export type { ScreenViewportAction, ScreenViewportState } from './state/viewport.js';
24
28
  export { reduceScreenViewport } from './state/viewport.js';
25
29
  export * from './validation/contrast.js';
26
30
  export { ScreenCoreInvariantError } from './validation/invariant-error.js';
31
+ export { auditScreenLayout, type ScreenLayoutAuditOptions, } from './validation/layout-audit.js';
32
+ export { computeMinimumLegibleFontPx, resolveScreenFontFloorPx } from './validation/legibility.js';
27
33
  export { validateScreenDocumentSemantics } from './validation/validate-semantics.js';
28
34
  //# sourceMappingURL=index.d.ts.map
@@ -1,8 +1,11 @@
1
- export { compileScreenBlueprint, dispatchScreenBlueprintEvent, SCREEN_BLUEPRINT_COMPONENT_VISIBILITY_CAPABILITY, traceScreenBlueprintEvent, } from './blueprint/runtime.js';
1
+ export { compileScreenBlueprint, dispatchScreenBlueprintEvent, SCREEN_BLUEPRINT_COMPONENT_VISIBILITY_CAPABILITY, SCREEN_BLUEPRINT_SIMULATION_MAX_DEPTH, simulateScreenBlueprint, traceScreenBlueprintEvent, } from './blueprint/runtime.js';
2
2
  export { applyScreenDocumentCommand, applyScreenDocumentTransaction } from './commands/apply.js';
3
3
  export { parseScreenDocumentCommand } from './commands/parse-command.js';
4
+ export { enumerateScreenDataCandidates, SCREEN_CATEGORY_MAX, SCREEN_PROPORTION_MAX, } from './data/data-candidates.js';
4
5
  export { componentsReferencingDataSources } from './data/data-source-dependents.js';
6
+ export { profileScreenDataset, SCREEN_PROFILE_MAX_FIELDS, SCREEN_PROFILE_MAX_ROWS, } from './data/dataset-profile.js';
5
7
  export { evaluateScreenHostResourceParameters, extractScreenHostResourceVariableDependencies, validateScreenDataBinding, validateScreenHostResourceBinding, } from './data/host-dataset.js';
8
+ export { listSampleValueRefs } from './data/sample-values.js';
6
9
  export { collectScreenValueRefDependencies, evaluateScreenValueRef, } from './data/value-ref.js';
7
10
  export * from './diff/screen-diff.js';
8
11
  export { calculateScreenAlignment, calculateScreenDistribution, canvasPointToViewport, chooseScreenSnapCandidate, getScreenComponentBounds, getScreenSelectionBounds, hitTestScreenComponents, queryScreenComponentsInRect, viewportPointToCanvas, } from './geometry/geometry.js';
@@ -11,8 +14,11 @@ export { isScreenComponentEffectivelyHidden, isScreenComponentEffectivelyLocked,
11
14
  export { commitScreenHistory, createScreenHistory, readScreenHistoryNodes, redoScreenHistory, revertScreenHistory, undoScreenHistory, } from './history/history.js';
12
15
  export { deleteScreenJsonPath, getScreenJsonPath, insertScreenJsonArrayItem, moveScreenJsonArrayItem, removeScreenJsonArrayItem, setScreenJsonArrayItem, setScreenJsonPath, } from './json/path-update.js';
13
16
  export { reduceScreenInteraction } from './state/interaction.js';
17
+ export { screenStatePresetStyle, } from './state/state-preset.js';
14
18
  export { reduceScreenViewport } from './state/viewport.js';
15
19
  export * from './validation/contrast.js';
16
20
  export { ScreenCoreInvariantError } from './validation/invariant-error.js';
21
+ export { auditScreenLayout, } from './validation/layout-audit.js';
22
+ export { computeMinimumLegibleFontPx, resolveScreenFontFloorPx } from './validation/legibility.js';
17
23
  export { validateScreenDocumentSemantics } from './validation/validate-semantics.js';
18
24
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,32 @@
1
+ import { type ScreenJsonObject, type ScreenLevelTone } from '../../contracts/index.js';
2
+ /**
3
+ * 组件状态的外观预置(ADR-0110 §2.6.3,ADR-0115 D8 下沉):给一个语义色调,算出状态要覆盖的样式键。
4
+ *
5
+ * 原先只在 engine(「按分级生成状态」)里;智能体生成阈值状态也要同一套规则,否则同一个物料在两处
6
+ * 生成的状态外观不一样。core 不认识物料清单与编辑器描述符,所以入参是摊平后的键表——由 engine 从
7
+ * manifest 的外观区读出来(`readDesignerStatePresetSource`),或由宿主随目录上送。
8
+ *
9
+ * 规则:
10
+ * - 清单显式声明了 `statePresetKeys` 时只用它:字符串键写语义色引用,布尔键只在 `danger` 时开;
11
+ * - 否则推断:外观区里的颜色键,取第一个不是描边 / 发光 / 阴影 / 背景的当主色,描边色跟着变;
12
+ * `danger` 时再打开发光开关、发光色也写语义色。
13
+ */
14
+ /** 外观区开放编辑的一个顶层 style 键。 */
15
+ export interface ScreenStatePresetField {
16
+ readonly key: string;
17
+ /** style schema 里的类型(`string` / `number` / `boolean` / `enum` …)。 */
18
+ readonly kind: string;
19
+ /** 检查器控件是颜色。 */
20
+ readonly color?: boolean;
21
+ }
22
+ export interface ScreenStatePresetSource {
23
+ /** 清单的 `statePresetKeys` 与各键的 schema 类型;有它时只用它。 */
24
+ readonly declared?: readonly {
25
+ readonly key: string;
26
+ readonly kind: string;
27
+ }[];
28
+ /** 外观区的 style 键(按外观区顺序)。 */
29
+ readonly fields: readonly ScreenStatePresetField[];
30
+ }
31
+ export declare function screenStatePresetStyle(source: ScreenStatePresetSource, tone: ScreenLevelTone): ScreenJsonObject;
32
+ //# sourceMappingURL=state-preset.d.ts.map
@@ -0,0 +1,37 @@
1
+ import { screenThemeRef, } from '@base-screen/contracts';
2
+ const NOT_MAIN = /border|stroke|glow|shadow|background/i;
3
+ const BORDER = /border|stroke/i;
4
+ const GLOW = /glow/i;
5
+ const GLOW_COLOR = /glow|shadow/i;
6
+ export function screenStatePresetStyle(source, tone) {
7
+ const style = {};
8
+ const ref = screenThemeRef(tone);
9
+ if (source.declared !== undefined) {
10
+ for (const { key, kind } of source.declared) {
11
+ if (kind === 'string')
12
+ style[key] = ref;
13
+ else if (kind === 'boolean' && tone === 'danger')
14
+ style[key] = true;
15
+ }
16
+ return style;
17
+ }
18
+ const colors = source.fields
19
+ .filter((field) => field.color === true && field.kind === 'string')
20
+ .map((field) => field.key);
21
+ const main = colors.find((key) => !NOT_MAIN.test(key)) ?? colors[0];
22
+ if (main !== undefined)
23
+ style[main] = ref;
24
+ const border = colors.find((key) => BORDER.test(key));
25
+ if (border !== undefined)
26
+ style[border] = ref;
27
+ if (tone === 'danger') {
28
+ const glow = source.fields.find((field) => GLOW.test(field.key) && field.kind === 'boolean');
29
+ const glowColor = colors.find((key) => GLOW_COLOR.test(key));
30
+ if (glow !== undefined)
31
+ style[glow.key] = true;
32
+ if (glowColor !== undefined)
33
+ style[glowColor] = ref;
34
+ }
35
+ return style;
36
+ }
37
+ //# sourceMappingURL=state-preset.js.map
@@ -0,0 +1,17 @@
1
+ import type { ScreenDiagnostic, ScreenDiagnosticSeverity, ScreenDocument, ScreenTargetDisplayProfile } from '../../contracts/index.js';
2
+ export interface ScreenLayoutAuditOptions {
3
+ /** 只审计这些组件(智能体本轮产出的);缺省审计全部组件。重叠与背景仍参照整份文档。 */
4
+ readonly componentIds?: readonly string[];
5
+ /** 目标屏参数:给了就用观距换算字号下限,否则按画布宽度取默认下限。 */
6
+ readonly targetDisplay?: ScreenTargetDisplayProfile;
7
+ /** 智能体产物一律是 `error`(ADR-0112 §2.2);手工编辑的调用方可降为 `warning` 只作提示。 */
8
+ readonly severity?: ScreenDiagnosticSeverity;
9
+ }
10
+ /**
11
+ * 生成产物的静态版面审计(ADR-0112 §2.2):字号下限、越界、重叠、对比度四条,纯函数,不测量渲染结果。
12
+ *
13
+ * 只约束智能体产物:由宿主的生成回环调用,设计器不据此阻断手工编辑。判定都按「能静态确定才判」,
14
+ * 背景无法静态确定时跳过对比度,不猜。
15
+ */
16
+ export declare function auditScreenLayout(document: ScreenDocument, options?: ScreenLayoutAuditOptions): readonly ScreenDiagnostic[];
17
+ //# sourceMappingURL=layout-audit.d.ts.map
@@ -0,0 +1,228 @@
1
+ import { computeComponentBounds } from '../geometry/bounds.js';
2
+ import { buildComponentIndex, getPainterOrder } from '../hierarchy/hierarchy.js';
3
+ import { contrastRatio, minimumContrastRatio, parseCssColor } from './contrast.js';
4
+ import { resolveScreenFontFloorPx } from './legibility.js';
5
+ /** 重叠判定:相交面积超过较小者的 10%。 */
6
+ const OVERLAP_RATIO = 0.1;
7
+ /**
8
+ * 生成产物的静态版面审计(ADR-0112 §2.2):字号下限、越界、重叠、对比度四条,纯函数,不测量渲染结果。
9
+ *
10
+ * 只约束智能体产物:由宿主的生成回环调用,设计器不据此阻断手工编辑。判定都按「能静态确定才判」,
11
+ * 背景无法静态确定时跳过对比度,不猜。
12
+ */
13
+ export function auditScreenLayout(document, options = {}) {
14
+ const severity = options.severity ?? 'error';
15
+ const index = buildComponentIndex(document);
16
+ const scope = options.componentIds === undefined ? undefined : new Set(options.componentIds);
17
+ const inScope = (id) => scope === undefined || scope.has(id);
18
+ const fontFloor = resolveScreenFontFloorPx(document.canvas.width, options.targetDisplay);
19
+ const painter = getPainterOrder(document);
20
+ const paintRank = new Map(painter.map((id, rank) => [id, rank]));
21
+ const containers = new Set(document.components.flatMap((component) => component.parentId === null ? [] : [component.parentId]));
22
+ const canvasOf = (component) => {
23
+ let current = component;
24
+ while (current !== undefined && current.parentId !== null) {
25
+ current = index.byId.get(current.parentId)?.component;
26
+ }
27
+ return current?.canvasId ?? '';
28
+ };
29
+ const frames = canvasFrames(document);
30
+ const bounds = new Map();
31
+ for (const component of document.components) {
32
+ const box = computeComponentBounds(component);
33
+ if (box !== null)
34
+ bounds.set(component.id, box);
35
+ }
36
+ const diagnostics = [];
37
+ const at = (component, ...rest) => [
38
+ 'components',
39
+ index.byId.get(component.id)?.index ?? -1,
40
+ ...rest,
41
+ ];
42
+ for (const component of document.components) {
43
+ if (!inScope(component.id) || component.status.hidden)
44
+ continue;
45
+ const box = bounds.get(component.id);
46
+ const frame = frames.get(canvasOf(component));
47
+ const fontSize = numeric(component.style.fontSize);
48
+ if (fontSize !== undefined && fontSize < fontFloor - 1e-9) {
49
+ diagnostics.push({
50
+ severity,
51
+ code: 'LAYOUT_FONT_TOO_SMALL',
52
+ path: at(component, 'style', 'fontSize'),
53
+ message: `Font size ${fontSize}px is below the legible minimum of ${round1(fontFloor)}px.`,
54
+ });
55
+ }
56
+ if (box !== undefined && frame !== undefined && outside(box, frame)) {
57
+ diagnostics.push({
58
+ severity,
59
+ code: 'LAYOUT_OUT_OF_BOUNDS',
60
+ path: at(component, 'position'),
61
+ message: `Component geometry leaves its ${frame.width}x${frame.height} canvas.`,
62
+ });
63
+ }
64
+ if (fontSize !== undefined && box !== undefined) {
65
+ const color = colorOf(component.style.color);
66
+ const background = color === undefined
67
+ ? undefined
68
+ : staticBackground(component, box, document, bounds, paintRank, canvasOf, frame);
69
+ if (color !== undefined && background !== undefined) {
70
+ const required = minimumContrastRatio(fontSize, fontWeight(component.style.fontWeight));
71
+ const ratio = contrastRatio(color, background);
72
+ if (ratio < required) {
73
+ diagnostics.push({
74
+ severity,
75
+ code: 'LAYOUT_CONTRAST_LOW',
76
+ path: at(component, 'style', 'color'),
77
+ message: `Text contrast ${round1(ratio)}:1 is below the required ${required}:1.`,
78
+ });
79
+ }
80
+ }
81
+ }
82
+ }
83
+ // 重叠:同一父级、同一画布下两个非容器组件「部分相交」。一方完整包住另一方是有意的叠放
84
+ // (卡片底板上的标题),不算碰撞。
85
+ const siblings = new Map();
86
+ for (const component of document.components) {
87
+ if (component.status.hidden || containers.has(component.id))
88
+ continue;
89
+ if (!bounds.has(component.id))
90
+ continue;
91
+ const key = `${canvasOf(component)}\u0000${component.parentId ?? ''}`;
92
+ const group = siblings.get(key);
93
+ if (group === undefined)
94
+ siblings.set(key, [component]);
95
+ else
96
+ group.push(component);
97
+ }
98
+ for (const group of siblings.values()) {
99
+ for (let a = 0; a < group.length; a++) {
100
+ for (let b = a + 1; b < group.length; b++) {
101
+ const first = group[a];
102
+ const second = group[b];
103
+ if (!inScope(first.id) && !inScope(second.id))
104
+ continue;
105
+ const boxA = bounds.get(first.id);
106
+ const boxB = bounds.get(second.id);
107
+ if (contains(boxA, boxB) || contains(boxB, boxA))
108
+ continue;
109
+ const overlap = intersectionArea(boxA, boxB);
110
+ const smaller = Math.min(area(boxA), area(boxB));
111
+ if (smaller > 0 && overlap > smaller * OVERLAP_RATIO) {
112
+ const reported = inScope(second.id) ? second : first;
113
+ const other = reported === second ? first : second;
114
+ diagnostics.push({
115
+ severity,
116
+ code: 'LAYOUT_OVERLAP',
117
+ path: at(reported, 'position'),
118
+ message: `Component overlaps "${other.id}" by ${Math.round((overlap / smaller) * 100)}% of the smaller area.`,
119
+ });
120
+ }
121
+ }
122
+ }
123
+ }
124
+ return diagnostics;
125
+ }
126
+ function canvasFrames(document) {
127
+ const main = document.canvas;
128
+ const mainBackground = main.backgroundImage === undefined &&
129
+ (main.background === undefined || main.background.type === 'solid')
130
+ ? colorOf(main.background?.type === 'solid' ? main.background.color : main.backgroundColor)
131
+ : undefined;
132
+ const frames = new Map([
133
+ ['', { width: main.width, height: main.height, background: mainBackground }],
134
+ ]);
135
+ for (const sub of document.subCanvases ?? []) {
136
+ const solid = sub.background === undefined || sub.background.type === 'solid'
137
+ ? colorOf(sub.background?.type === 'solid' ? sub.background.color : sub.backgroundColor)
138
+ : undefined;
139
+ if (sub.display === 'popup') {
140
+ frames.set(sub.id, { width: sub.width, height: sub.height, background: solid });
141
+ }
142
+ else {
143
+ // 页面缺省透出主画布背景。
144
+ const background = sub.backgroundColor === undefined && sub.background === undefined ? mainBackground : solid;
145
+ frames.set(sub.id, { width: main.width, height: main.height, background });
146
+ }
147
+ }
148
+ return frames;
149
+ }
150
+ /**
151
+ * 能静态确定的背景色:组件自身的不透明底色;否则取下方最近一个「完整包住它、底色不透明」的组件;
152
+ * 下方有部分相交的组件(谁在下面说不清)或底色不是纯色时返回 undefined。没有任何组件垫底时取画布底色。
153
+ */
154
+ function staticBackground(component, box, document, bounds, paintRank, canvasOf, frame) {
155
+ const own = surfaceColor(component);
156
+ if (own !== null)
157
+ return own;
158
+ const rank = paintRank.get(component.id) ?? -1;
159
+ const canvas = canvasOf(component);
160
+ const below = document.components
161
+ .filter((other) => other.id !== component.id &&
162
+ !other.status.hidden &&
163
+ (paintRank.get(other.id) ?? -1) < rank &&
164
+ canvasOf(other) === canvas)
165
+ .sort((a, b) => (paintRank.get(b.id) ?? -1) - (paintRank.get(a.id) ?? -1));
166
+ for (const other of below) {
167
+ const otherBox = bounds.get(other.id);
168
+ if (otherBox === undefined || intersectionArea(box, otherBox) <= 0)
169
+ continue;
170
+ if (!contains(otherBox, box))
171
+ return undefined;
172
+ const color = surfaceColor(other);
173
+ // 包住它的组件没有可判定的底色(透明、半透明、图片、渐变):继续往下找会猜,直接放弃。
174
+ return color === null ? undefined : color;
175
+ }
176
+ return frame?.background;
177
+ }
178
+ /** 组件的不透明纯色底:`backgroundColor` 或形状的 `fill`。`null` 表示没有底色,`undefined` 表示有但判不了。 */
179
+ function surfaceColor(component) {
180
+ const raw = component.style.backgroundColor ?? component.style.fill;
181
+ if (raw === undefined || raw === null || raw === '' || raw === 'transparent')
182
+ return null;
183
+ if (component.style.backgroundImage !== undefined)
184
+ return undefined;
185
+ const opacity = numeric(component.style.opacity);
186
+ if (opacity !== undefined && opacity < 1)
187
+ return undefined;
188
+ return colorOf(raw);
189
+ }
190
+ function colorOf(value) {
191
+ return typeof value === 'string' ? parseCssColor(value) : undefined;
192
+ }
193
+ function numeric(value) {
194
+ return typeof value === 'number' && Number.isFinite(value) ? value : undefined;
195
+ }
196
+ function fontWeight(value) {
197
+ if (typeof value === 'number' && Number.isFinite(value))
198
+ return value;
199
+ if (value === 'bold' || value === 'bolder')
200
+ return 700;
201
+ if (typeof value === 'string') {
202
+ const parsed = Number(value);
203
+ if (Number.isFinite(parsed))
204
+ return parsed;
205
+ }
206
+ return 400;
207
+ }
208
+ function outside(box, frame) {
209
+ return box.left < 0 || box.top < 0 || box.right > frame.width || box.bottom > frame.height;
210
+ }
211
+ function contains(outer, inner) {
212
+ return (outer.left <= inner.left &&
213
+ outer.top <= inner.top &&
214
+ outer.right >= inner.right &&
215
+ outer.bottom >= inner.bottom);
216
+ }
217
+ function area(box) {
218
+ return Math.max(0, box.right - box.left) * Math.max(0, box.bottom - box.top);
219
+ }
220
+ function intersectionArea(a, b) {
221
+ const width = Math.min(a.right, b.right) - Math.max(a.left, b.left);
222
+ const height = Math.min(a.bottom, b.bottom) - Math.max(a.top, b.top);
223
+ return width > 0 && height > 0 ? width * height : 0;
224
+ }
225
+ function round1(value) {
226
+ return Math.round(value * 10) / 10;
227
+ }
228
+ //# sourceMappingURL=layout-audit.js.map
@@ -0,0 +1,9 @@
1
+ import type { ScreenTargetDisplayProfile } from '../../contracts/index.js';
2
+ /** 最小可读字号:观距决定字高,点间距把毫米换回逻辑像素。缺参数时返回 null,不做猜测。 */
3
+ export declare function computeMinimumLegibleFontPx(profile: ScreenTargetDisplayProfile): number | null;
4
+ /**
5
+ * 生成产物的字号下限:有目标屏参数时用 `computeMinimumLegibleFontPx`,否则按画布宽度换算默认值。
6
+ * 静态审计(`auditScreenLayout`)与渲染探针共用这一个口径。
7
+ */
8
+ export declare function resolveScreenFontFloorPx(canvasWidth: number, targetDisplay?: ScreenTargetDisplayProfile): number;
9
+ //# sourceMappingURL=legibility.d.ts.map
@@ -0,0 +1,33 @@
1
+ /**
2
+ * 可读性下限的判定依据:字高(cap height)不小于观距的 1/200;字号(em)约等于字高的 1.5 倍。
3
+ *
4
+ * 放在 core 而不是 engine:示例后端与 MCP 工具面只能加载 contracts 与 core,生成产物的硬校验
5
+ * (ADR-0112 §2.2)与设计器的目标屏面板必须用同一份换算。
6
+ */
7
+ const LEGIBLE_CAP_TO_DISTANCE = 1 / 200;
8
+ const FONT_SIZE_TO_CAP = 1.5;
9
+ /** 没有目标屏参数时的默认下限:1920 宽画布上 16px,按画布宽度等比换算。 */
10
+ const DEFAULT_FONT_FLOOR_PX = 16;
11
+ const DEFAULT_FONT_FLOOR_CANVAS_WIDTH = 1920;
12
+ /** 最小可读字号:观距决定字高,点间距把毫米换回逻辑像素。缺参数时返回 null,不做猜测。 */
13
+ export function computeMinimumLegibleFontPx(profile) {
14
+ const distanceM = profile.viewingDistanceM;
15
+ const pitch = profile.pixelPitchMm;
16
+ if (distanceM === undefined || !(distanceM > 0) || pitch === undefined || !(pitch > 0)) {
17
+ return null;
18
+ }
19
+ const capMm = distanceM * 1000 * LEGIBLE_CAP_TO_DISTANCE;
20
+ return (capMm * FONT_SIZE_TO_CAP) / pitch;
21
+ }
22
+ /**
23
+ * 生成产物的字号下限:有目标屏参数时用 `computeMinimumLegibleFontPx`,否则按画布宽度换算默认值。
24
+ * 静态审计(`auditScreenLayout`)与渲染探针共用这一个口径。
25
+ */
26
+ export function resolveScreenFontFloorPx(canvasWidth, targetDisplay) {
27
+ const fromDisplay = targetDisplay === undefined ? null : computeMinimumLegibleFontPx(targetDisplay);
28
+ if (fromDisplay !== null)
29
+ return fromDisplay;
30
+ const width = Number.isFinite(canvasWidth) && canvasWidth > 0 ? canvasWidth : 0;
31
+ return (DEFAULT_FONT_FLOOR_PX * width) / DEFAULT_FONT_FLOOR_CANVAS_WIDTH;
32
+ }
33
+ //# sourceMappingURL=legibility.js.map
@@ -47,7 +47,11 @@ export declare function autoMatchDatasetBindings(context: DesignerDatasetControl
47
47
  export declare function setDatasetParameterValueRef(context: DesignerDatasetControllerContext, name: string, ref: ScreenValueRef): void;
48
48
  export declare function updateDatasetParameterValue(context: DesignerDatasetControllerContext, target: HTMLInputElement | HTMLTextAreaElement): void;
49
49
  export declare function updateDatasetBindingSelect(context: DesignerDatasetControllerContext, target: HTMLSelectElement): void;
50
- export declare function markDatasetDraftChanged(context: DesignerDatasetControllerContext, _sections?: readonly DesignerDataSectionKey[], restoreFocus?: () => void): void;
50
+ interface MarkDatasetDraftChangedOptions {
51
+ /** 变量选择器已打开时,blur 提交的内联值只更新草稿状态,不重建正在承载选择器的段。 */
52
+ readonly deferSurfaceWhilePickerOpen?: boolean;
53
+ }
54
+ export declare function markDatasetDraftChanged(context: DesignerDatasetControllerContext, _sections?: readonly DesignerDataSectionKey[], restoreFocus?: () => void, options?: MarkDatasetDraftChangedOptions): void;
51
55
  /**
52
56
  * 段换完之后把焦点还给同一个控件。工作台打开时以工作台那份为准,避免把焦点打进模态框背后。
53
57
  * 数字输入框不支持 setSelectionRange(会抛 InvalidStateError),只有文本类才挪光标。
@@ -63,4 +67,5 @@ export declare function availableModes(context: DesignerDatasetControllerContext
63
67
  * 事务被拒时把工作台退回文档里的策略,避免「下拉显示 A、文档仍是 B」。
64
68
  */
65
69
  export declare function commitAuthoringUpdatePolicy(context: DesignerDatasetControllerContext): void;
70
+ export {};
66
71
  //# sourceMappingURL=designer-dataset-draft-controller.d.ts.map
@@ -4,6 +4,7 @@ import type { DesignerMetricName } from '../../common/observability/designer-met
4
4
  import type { BaseScreenDesignerChangeStateDetail } from '../../common/operations/change/designer-change-events.js';
5
5
  import { type DesignerChangeProposal, type DesignerChangeProposalInput } from '../../common/operations/change/designer-change-proposal.js';
6
6
  import type { DesignerReviewMeta } from '../../common/operations/change/designer-review.js';
7
+ import { type DesignerChangeMarks } from '../dom/change/designer-change-dom.js';
7
8
  export interface DesignerChangeGhostHandlers {
8
9
  readonly render: (document: ScreenDocument) => boolean;
9
10
  readonly clear: () => void;
@@ -38,6 +39,18 @@ export declare class DesignerChangeController {
38
39
  /** 历史段读 core 的节点列表;回退只移动指针,由 session 执行。 */
39
40
  setHistoryControls(reader: () => readonly ScreenHistoryNode[], revert: (index: number) => void): void;
40
41
  get pending(): DesignerChangeProposal | undefined;
42
+ get streaming(): boolean;
43
+ /** 以「生成中」挂出骨架草案(ADR-0112 §2.5);与 submit 同样不替换已有草案。 */
44
+ beginStream(proposal: DesignerChangeProposal, input: DesignerChangeProposalInput): boolean;
45
+ /**
46
+ * 生成中替换为追加了命令的新一版草案:挂载失败时保留上一版,不留半张画面。
47
+ * 只接受同一份草案(同 id)且仍在生成中。
48
+ */
49
+ extendStream(proposal: DesignerChangeProposal, input: DesignerChangeProposalInput): boolean;
50
+ /** 结束生成:草案变为可采纳,单元照常拆分(ADR-0111 D1)。 */
51
+ finishStream(id: string): boolean;
52
+ /** 当前草案的原始入参:追加命令时以它为底。 */
53
+ get pendingInput(): DesignerChangeProposalInput | undefined;
41
54
  get paneMode(): RightPaneMode;
42
55
  get reviewing(): boolean;
43
56
  /** 进入评审态:只读画布、强制切到智能体页签,逐条批准/驳回。 */
@@ -65,6 +78,11 @@ export declare class DesignerChangeController {
65
78
  onClick(target: Element): boolean;
66
79
  onKeyDown(event: KeyboardEvent): boolean;
67
80
  private mountGhost;
81
+ /**
82
+ * 草案期间的会话标记:受影响的旧组件在内容层隐藏(几何不变,不占命中),被移除的留轮廓;
83
+ * 子集草案里只为定位而挂的未受影响祖先在草案层隐藏,避免它的底色盖住旧画布上的兄弟组件。
84
+ */
85
+ private changeMarks;
68
86
  /** 用剩余命令重新编译;失效时移除幽灵层,但保留明确的就地反馈。 */
69
87
  private rebuild;
70
88
  private clearDraft;
@@ -74,5 +92,14 @@ export declare class DesignerChangeController {
74
92
  */
75
93
  private render;
76
94
  }
95
+ /**
96
+ * 草案期间的会话标记(ADR-0111 §2.2)。
97
+ *
98
+ * 隐藏范围取 `affectedComponentIds` 而不是组件 diff:只改数据源时,读它的组件在 diff 里没有行,
99
+ * 但草案层会按新值重画它们,旧组件不隐藏就又叠画了。新增组件在内容层本来就没有,不用隐藏。
100
+ * 整屏替换不画逐组件轮廓:几乎每个旧组件都被移除,轮廓会铺满并压住新版面;被移除的组件
101
+ * 已在提案区的只读清单里逐个列出。
102
+ */
103
+ export declare function designerChangeMarks(proposal: DesignerChangeProposal, ghostFull: boolean): DesignerChangeMarks;
77
104
  export {};
78
105
  //# sourceMappingURL=designer-change-controller.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { ScreenIntentScope } from '../../../../contracts/index.js';
1
+ import { type ScreenIntentScope } from '../../../../contracts/index.js';
2
2
  import type { ScreenHistoryNode } from '../../../../core/index.js';
3
3
  import type { DesignerChangeProposal } from '../../../common/operations/change/designer-change-proposal.js';
4
4
  export type DesignerChangeFeedback = {
@@ -18,12 +18,12 @@ export type DesignerChangeFeedback = {
18
18
  * 实测 662px 条里只剩 186px(约 14 字)。所以标题单行截断后补原生 `title`,
19
19
  * 不用 `data-tip`:那是短标签气泡,几十字的主题会被撑成一条横条。
20
20
  */
21
- export declare function draftBarMarkup(proposal: DesignerChangeProposal, comparing: boolean, paneOpen?: boolean): string;
21
+ export declare function draftBarMarkup(proposal: DesignerChangeProposal, comparing: boolean, paneOpen?: boolean, streaming?: boolean): string;
22
22
  /**
23
23
  * 提案区(智能体页签):按「可独立采纳的单元」分组,每条能单独采纳或忽略;全部采纳需要二次确认。
24
24
  * 没有提案时给三张起点牌(从指标树 / 模板 / 一句话起),而不是空白。
25
25
  */
26
- export declare function changePaneMarkup(proposal: DesignerChangeProposal | undefined, confirmAll: boolean, review?: DesignerReviewPane, history?: readonly ScreenHistoryNode[], feedback?: DesignerChangeFeedback, intentScope?: ScreenIntentScope): string;
26
+ export declare function changePaneMarkup(proposal: DesignerChangeProposal | undefined, confirmAll: boolean, review?: DesignerReviewPane, history?: readonly ScreenHistoryNode[], feedback?: DesignerChangeFeedback, intentScope?: ScreenIntentScope, streaming?: boolean): string;
27
27
  export interface DesignerReviewPane {
28
28
  readonly reviewing: boolean;
29
29
  readonly meta: {
@@ -32,8 +32,24 @@ export interface DesignerReviewPane {
32
32
  };
33
33
  readonly total: number;
34
34
  }
35
- export declare function renderDraftBar(bar: HTMLElement, proposal: DesignerChangeProposal, comparing: boolean, paneOpen?: boolean): void;
36
- export declare function renderChangePane(pane: HTMLElement, proposal: DesignerChangeProposal | undefined, confirmAll: boolean, review?: DesignerReviewPane, history?: readonly ScreenHistoryNode[], feedback?: DesignerChangeFeedback, intentScope?: ScreenIntentScope): void;
35
+ export declare function renderDraftBar(bar: HTMLElement, proposal: DesignerChangeProposal, comparing: boolean, paneOpen?: boolean, streaming?: boolean): void;
36
+ /** 草案期间的会话标记(ADR-0111 §2.2):只改显示,不写文档、不进历史、不影响导出与渲染器。 */
37
+ export interface DesignerChangeMarks {
38
+ /** 内容层中被修改或被移除的旧组件:隐藏,几何不变、不占命中。 */
39
+ readonly supersededIds: readonly string[];
40
+ /** 被移除的旧组件:在草案层原位画虚线轮廓与「将移除」标记。 */
41
+ readonly removedIds: readonly string[];
42
+ /** 子集草案里只为定位而挂、本身未受影响的祖先:在草案层隐藏。 */
43
+ readonly ghostHiddenIds: readonly string[];
44
+ }
45
+ /**
46
+ * 把标记写进草案层:一个 style 节点承载两条隐藏规则(按组件 id 选择,渲染器重建元素后依然生效),
47
+ * 一个轮廓层承载移除标记。`marks` 为空时全部撤掉。
48
+ */
49
+ export declare function renderChangeMarks(ghost: HTMLElement, marks: DesignerChangeMarks | undefined): void;
50
+ /** 子集草案不画画布背景:未受影响的组件与旧画布底色要透过草案层可见。 */
51
+ export declare function clearGhostCanvasBackground(ghost: HTMLElement | undefined): void;
52
+ export declare function renderChangePane(pane: HTMLElement, proposal: DesignerChangeProposal | undefined, confirmAll: boolean, review?: DesignerReviewPane, history?: readonly ScreenHistoryNode[], feedback?: DesignerChangeFeedback, intentScope?: ScreenIntentScope, streaming?: boolean): void;
37
53
  /** 右栏页签的待决计数:只改文本,不重建页签,避免焦点丢失。 */
38
54
  export declare function renderChangeCount(count: HTMLElement, units: number): void;
39
55
  //# sourceMappingURL=designer-change-dom.d.ts.map
@@ -32,12 +32,10 @@ export declare function requiredDataSections(model: DesignerDataPanelModel): rea
32
32
  */
33
33
  export declare function sectionContentKey(key: DesignerDataSectionId, model: DesignerDataPanelModel): string;
34
34
  /**
35
- * 按段集合 diff 同步面板。
36
- *
37
- * 三条规则:
38
- * 1. 段集合与顺序以 `requiredDataSections` 为准:缺的建、多的删;
39
- * 2. 两端都有的段**只在内容键变化时**替换——键没变就完全不碰,节点身份、光标、IME 组合态都靠它;
40
- * 3. 焦点按逻辑地址四级回落(同段同控件 → 同段首个可聚焦 → 同段容器 → 面板根),绝不落到 body。
35
+ * 段同步可能被控件 blur / change 再入:例如切到变量时,旧内联输入框失焦会先提交一次草稿,
36
+ * 其事件处理器再次调用本函数。直接递归会让内层先删掉外层手里的 `existing`,回到外层时
37
+ * `replaceWith` 就会抛 NotFoundError。这里把内层模型记成 pending,先让当前 DOM 遍历完整结束,
38
+ * 再用最新模型补一轮;连续多跳最多同步跑 4 轮,仍未稳定则排到微任务,避免无限递归。
41
39
  */
42
40
  export declare function syncDatasetSections(root: HTMLElement, model: DesignerDataPanelModel): void;
43
41
  /**
@@ -81,6 +81,8 @@ export interface DesignerValueRefPickerOptions {
81
81
  readonly onCreateVariable?: () => void;
82
82
  readonly onManage?: () => void;
83
83
  readonly onSelect: (ref: ScreenValueRef) => void;
84
+ /** 浮层开合时同步到真正可见的入口;内部 trigger 在行内模式可能不挂进 DOM。 */
85
+ readonly onOpenChange?: (open: boolean, restoreFocus: boolean) => void;
84
86
  }
85
87
  /** 触发器的可见摘要:徽标 + 名称。 */
86
88
  export interface DesignerValueRefSummary {
@@ -16,7 +16,7 @@ export interface DesignerSnapPoint {
16
16
  readonly snappedY?: number | undefined;
17
17
  }
18
18
  /**
19
- * 选区对齐轨道上的可视间距:`axis` 表示长度方向,`position` 表示正交坐标。
19
+ * 选区周边的可视间距:`axis` 表示长度方向,`position` 表示正交坐标。
20
20
  * 例如 `axis: 'y'` 从 `from` 到 `to` 的竖线位于 `position` 的 x 坐标。
21
21
  */
22
22
  export interface DesignerCanvasMeasurement {
@@ -25,7 +25,7 @@ export interface DesignerCanvasMeasurement {
25
25
  readonly from: number;
26
26
  readonly position: number;
27
27
  readonly to: number;
28
- /** `equal`:与同排其它间距精确相等的等间距标注;缺省为对齐轨道上的普通间距。 */
28
+ /** `equal`:与同排其它间距精确相等的等间距标注;缺省为选区四侧最近的一段间距。 */
29
29
  readonly kind?: 'equal' | undefined;
30
30
  }
31
31
  export type DesignerSnapPreview = DesignerSnapPoint & Pick<DesignerSnapTranslation, 'guides' | 'measurements'>;
@@ -51,7 +51,7 @@ export interface DesignerSnapTranslation {
51
51
  readonly snappedY?: number | undefined;
52
52
  /** 吸附后与最终几何精确重合的对齐线(每个坐标一条)。 */
53
53
  readonly guides?: DesignerSnapGuides | undefined;
54
- /** 选区对齐轨道上的相邻组件间距,仅作为覆盖层视觉反馈。 */
54
+ /** 选区四侧最近间距(kind 缺省)或等间距标注,仅作为覆盖层视觉反馈。 */
55
55
  readonly measurements?: readonly DesignerCanvasMeasurement[] | undefined;
56
56
  }
57
57
  /** 单个轴向的吸附会话状态:记录当前吸附的目标与选区锚点,供后续帧做阈值内保持与同锚点跟随。 */
@@ -2,20 +2,22 @@ import { type DesignerCanvasAidsState, type DesignerSelectionSnapBounds, type De
2
2
  import { DesignerAlignmentIndex } from './designer-canvas-snap-alignment-index.js';
3
3
  import type { DesignerSnapCandidates } from './designer-canvas-snap-candidates.js';
4
4
  import type { DesignerSpacingIndex } from './designer-canvas-snap-spacing.js';
5
+ import type { DesignerSnapTuning } from './designer-snap-tuning.js';
5
6
  export * from './designer-canvas-aids-types.js';
6
7
  export { type DesignerRulerMark, type DesignerRulerOptions, getDesignerRulerMarks, } from './designer-canvas-ruler.js';
7
8
  export { DesignerAlignmentIndex } from './designer-canvas-snap-alignment-index.js';
8
9
  export { collectDesignerSnapCandidates, type DesignerSnapCandidate, type DesignerSnapCandidates, } from './designer-canvas-snap-candidates.js';
9
10
  export { DesignerSpacingIndex } from './designer-canvas-snap-spacing.js';
11
+ export { type DesignerSnapTuning, resolveDesignerSnapTuning } from './designer-snap-tuning.js';
10
12
  type DesignerSnapTargets = DesignerSnapCandidates | DesignerAlignmentIndex;
11
13
  type DesignerSnapCoordinates = {
12
14
  readonly x: number;
13
15
  readonly y: number;
14
16
  };
15
- export declare function snapDesignerCanvasPoint(point: DesignerSnapCoordinates, state: DesignerCanvasAidsState, candidates?: DesignerSnapTargets, zoom?: number, session?: DesignerSnapSession): DesignerSnapPoint;
16
- export declare function snapDesignerSelectionTranslation(bounds: DesignerSelectionSnapBounds, translation: DesignerSnapCoordinates, state: DesignerCanvasAidsState, candidates?: DesignerSnapTargets, zoom?: number, session?: DesignerSnapSession, spacing?: DesignerSpacingIndex): DesignerSnapTranslation;
17
+ export declare function snapDesignerCanvasPoint(point: DesignerSnapCoordinates, state: DesignerCanvasAidsState, candidates?: DesignerSnapTargets, zoom?: number, session?: DesignerSnapSession, tuning?: DesignerSnapTuning): DesignerSnapPoint;
18
+ export declare function snapDesignerSelectionTranslation(bounds: DesignerSelectionSnapBounds, translation: DesignerSnapCoordinates, state: DesignerCanvasAidsState, candidates?: DesignerSnapTargets, zoom?: number, session?: DesignerSnapSession, spacing?: DesignerSpacingIndex, tuning?: DesignerSnapTuning): DesignerSnapTranslation;
17
19
  /** Phase two alone, for geometry another step produced (resize, drawing a new component). */
18
- export declare function collectDesignerAlignmentGuides(bounds: DesignerSelectionSnapBounds, state: DesignerCanvasAidsState, candidates?: DesignerSnapTargets, zoom?: number): DesignerSnapGuides | undefined;
20
+ export declare function collectDesignerAlignmentGuides(bounds: DesignerSelectionSnapBounds, state: DesignerCanvasAidsState, candidates?: DesignerSnapTargets, zoom?: number, tuning?: DesignerSnapTuning): DesignerSnapGuides | undefined;
19
21
  /**
20
22
  * Reach for guides and marks on the final geometry: snapping may move it by up to the threshold,
21
23
  * so allow that much more, or a target that won the snap could lose its guide.