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
@@ -0,0 +1,28 @@
1
+ import type { IntentCatalog } from './intent-catalog.js';
2
+ import type { IntentSkeleton, IntentStreamFrame } from './intent-compile-types.js';
3
+ import type { ScreenIntent } from './intent-types.js';
4
+ /**
5
+ * 模型给的骨架:区域写法 `{ regions: [...] }` 或平铺写法 `{ kpis: n, blocks: [{ type, span }] }`。
6
+ * 骨架里的 `type` 必须在目录里(数据型与否由物料声明决定);任何一处不合法就整份不接受,
7
+ * 返回 undefined——此时不推任何帧,等整份输出写完走常规路径。
8
+ */
9
+ export declare function parseIntentSkeleton(raw: unknown, catalog: IntentCatalog): IntentSkeleton | undefined;
10
+ export interface IntentStreamHead {
11
+ readonly title: string;
12
+ readonly subtitle: string;
13
+ readonly style?: string;
14
+ readonly layout: unknown;
15
+ }
16
+ export interface IntentStreamAssembler {
17
+ /** 骨架:标题、副标题、风格与版面。接受返回 true;已经接受过或不合法返回 false。 */
18
+ skeleton(head: IntentStreamHead): boolean;
19
+ /** 一个写完的指标或块;`path` 是模型原文里的位置路径。内容有变化返回 true。 */
20
+ item(path: string, value: unknown): boolean;
21
+ /** 当前一帧的编译输入;骨架还没到时为 undefined。 */
22
+ frame(): {
23
+ readonly intent: ScreenIntent;
24
+ readonly stream: IntentStreamFrame;
25
+ } | undefined;
26
+ }
27
+ export declare function createIntentStreamAssembler(catalog: IntentCatalog): IntentStreamAssembler;
28
+ //# sourceMappingURL=intent-stream.d.ts.map
@@ -0,0 +1,183 @@
1
+ import { flatSkeleton } from './intent-compile-types.js';
2
+ import { clampText, parseIntentBlock, parseIntentKpi } from './intent-parse.js';
3
+ /**
4
+ * 流式落稿的宿主侧装配(ADR-0113 §2.8)。
5
+ *
6
+ * 后端只做增量扫描:骨架写完推 `skeleton`,之后每写完一个指标或块推一条 `item`。这里把它们接成
7
+ * 编译器吃的 `ScreenIntent` + `IntentStreamFrame`——宿主每收到一条事件,就用 `frame()` 编一帧。
8
+ * 骨架一经接受就不再变(几何从第一帧起不变);内容逐项解析,坏的那一格留着占位,由最终结果的
9
+ * 整份解析与修复回环去处理。
10
+ */
11
+ const MAX_REGIONS = 6;
12
+ const MAX_ITEMS = 8;
13
+ const FLAT_MAX_KPIS = 5;
14
+ const FLAT_MAX_BLOCKS = 4;
15
+ const SPLIT_RATIOS = new Set(['wide-narrow', 'even']);
16
+ const RAIL_SIDES = new Set(['left', 'right']);
17
+ /**
18
+ * 模型给的骨架:区域写法 `{ regions: [...] }` 或平铺写法 `{ kpis: n, blocks: [{ type, span }] }`。
19
+ * 骨架里的 `type` 必须在目录里(数据型与否由物料声明决定);任何一处不合法就整份不接受,
20
+ * 返回 undefined——此时不推任何帧,等整份输出写完走常规路径。
21
+ */
22
+ export function parseIntentSkeleton(raw, catalog) {
23
+ const layout = asRecord(raw);
24
+ if (layout === null)
25
+ return undefined;
26
+ if (Array.isArray(layout.regions)) {
27
+ if (layout.regions.length < 1 || layout.regions.length > MAX_REGIONS)
28
+ return undefined;
29
+ const regions = [];
30
+ for (const item of layout.regions) {
31
+ const region = readRegion(item, catalog);
32
+ if (region === undefined)
33
+ return undefined;
34
+ regions.push(region);
35
+ }
36
+ return { regions };
37
+ }
38
+ const kpis = layout.kpis;
39
+ if (typeof kpis !== 'number' || !Number.isInteger(kpis) || kpis < 1 || kpis > FLAT_MAX_KPIS) {
40
+ return undefined;
41
+ }
42
+ const blocks = readSlots(layout.blocks, catalog, FLAT_MAX_BLOCKS);
43
+ return blocks === undefined ? undefined : flatSkeleton(kpis, blocks);
44
+ }
45
+ function readRegion(raw, catalog) {
46
+ const region = asRecord(raw);
47
+ if (region === null)
48
+ return undefined;
49
+ if (region.kind === 'band') {
50
+ const count = region.count;
51
+ if (typeof count !== 'number' || !Number.isInteger(count) || count < 1 || count > MAX_ITEMS) {
52
+ return undefined;
53
+ }
54
+ return { kind: 'band', count };
55
+ }
56
+ if (region.kind === 'grid') {
57
+ const slots = readSlots(region.blocks ?? region.slots, catalog, MAX_ITEMS);
58
+ return slots === undefined ? undefined : { kind: 'grid', slots };
59
+ }
60
+ if (region.kind === 'split') {
61
+ const ratio = region.ratio === undefined ? 'wide-narrow' : region.ratio;
62
+ const railSide = region.railSide === undefined ? 'right' : region.railSide;
63
+ if (typeof ratio !== 'string' || !SPLIT_RATIOS.has(ratio))
64
+ return undefined;
65
+ if (typeof railSide !== 'string' || !RAIL_SIDES.has(railSide))
66
+ return undefined;
67
+ const main = readSlots(region.main, catalog, MAX_ITEMS);
68
+ const rail = readSlots(region.rail, catalog, MAX_ITEMS);
69
+ if (main === undefined || rail === undefined)
70
+ return undefined;
71
+ return {
72
+ kind: 'split',
73
+ ratio: ratio,
74
+ railSide: railSide,
75
+ main: main.map((slot) => ({ data: slot.data })),
76
+ rail: rail.map((slot) => ({ data: slot.data })),
77
+ };
78
+ }
79
+ return undefined;
80
+ }
81
+ function readSlots(raw, catalog, max) {
82
+ if (!Array.isArray(raw) || raw.length < 1 || raw.length > max)
83
+ return undefined;
84
+ const slots = [];
85
+ for (const item of raw) {
86
+ const slot = asRecord(item);
87
+ const type = typeof slot?.type === 'string' ? slot.type.trim() : '';
88
+ const material = catalog.materials.find((candidate) => candidate.type === type);
89
+ if (slot === null || material === undefined || material.children === true)
90
+ return undefined;
91
+ // `span` 缺省为 1:侧栏与主区里的块不排栅格,模型可以不写。
92
+ const span = slot.span === undefined ? 1 : slot.span;
93
+ if (typeof span !== 'number' || !Number.isFinite(span))
94
+ return undefined;
95
+ slots.push({
96
+ span: Math.min(4, Math.max(1, Math.round(span))),
97
+ data: material.data === 'tabular',
98
+ });
99
+ }
100
+ return slots;
101
+ }
102
+ export function createIntentStreamAssembler(catalog) {
103
+ let head;
104
+ let skeleton;
105
+ const kpis = {};
106
+ const blocks = {};
107
+ const slotPaths = { kpis: new Set(), blocks: new Set() };
108
+ const gridPaths = new Set();
109
+ const register = (value) => {
110
+ for (const [position, region] of value.regions.entries()) {
111
+ const path = value.flat === true ? (region.kind === 'band' ? 'kpis' : 'blocks') : `regions[${position}]`;
112
+ const at = (part, index) => value.flat === true ? `${path}[${index}]` : `${path}.${part}[${index}]`;
113
+ if (region.kind === 'band') {
114
+ for (let i = 0; i < region.count; i += 1)
115
+ slotPaths.kpis.add(at('items', i));
116
+ }
117
+ else if (region.kind === 'grid') {
118
+ for (let i = 0; i < region.slots.length; i += 1) {
119
+ slotPaths.blocks.add(at('blocks', i));
120
+ gridPaths.add(at('blocks', i));
121
+ }
122
+ }
123
+ else {
124
+ for (let i = 0; i < region.main.length; i += 1)
125
+ slotPaths.blocks.add(at('main', i));
126
+ for (let i = 0; i < region.rail.length; i += 1)
127
+ slotPaths.blocks.add(at('rail', i));
128
+ }
129
+ }
130
+ };
131
+ return {
132
+ skeleton(input) {
133
+ if (head !== undefined)
134
+ return false;
135
+ const parsed = parseIntentSkeleton(input.layout, catalog);
136
+ if (parsed === undefined || input.title.trim() === '' || input.subtitle.trim() === '') {
137
+ return false;
138
+ }
139
+ head = input;
140
+ skeleton = parsed;
141
+ register(parsed);
142
+ return true;
143
+ },
144
+ item(path, value) {
145
+ if (skeleton === undefined)
146
+ return false;
147
+ if (slotPaths.kpis.has(path)) {
148
+ const parsed = parseIntentKpi(value, path);
149
+ if (parsed.value === undefined || path in kpis)
150
+ return false;
151
+ kpis[path] = parsed.value;
152
+ return true;
153
+ }
154
+ if (slotPaths.blocks.has(path)) {
155
+ const parsed = parseIntentBlock(value, catalog, path, { grid: gridPaths.has(path) });
156
+ if (parsed.value === undefined || path in blocks)
157
+ return false;
158
+ blocks[path] = parsed.value;
159
+ return true;
160
+ }
161
+ return false;
162
+ },
163
+ frame() {
164
+ if (head === undefined || skeleton === undefined)
165
+ return undefined;
166
+ return {
167
+ intent: {
168
+ title: clampText(head.title.trim(), 20),
169
+ subtitle: clampText(head.subtitle.trim(), 40),
170
+ ...(head.style === undefined || head.style === '' ? {} : { style: head.style }),
171
+ regions: [],
172
+ },
173
+ stream: { skeleton, kpis: { ...kpis }, blocks: { ...blocks } },
174
+ };
175
+ },
176
+ };
177
+ }
178
+ function asRecord(value) {
179
+ return typeof value === 'object' && value !== null && !Array.isArray(value)
180
+ ? value
181
+ : null;
182
+ }
183
+ //# sourceMappingURL=intent-stream.js.map
@@ -0,0 +1,37 @@
1
+ /**
2
+ * 风格预设:模型只能从这里挑一个名字,颜色全部由宿主决定。
3
+ *
4
+ * 为什么不让模型直接写颜色:AGENTS.md 规定视觉由宿主统一决定,任意颜色会绕过设计系统,
5
+ * 也容易出现低对比度、不可读的配色。预设把「风格可变」与「颜色可控」分开:风格是模型的选择,
6
+ * 颜色是宿主保证过对比度的成套色板。
7
+ *
8
+ * 每套预设都必须满足 `WCAG AA`(正文 ≥ 4.5:1)。改色板后要重算对比度,
9
+ * 见 `tests/examples/agent-style-contrast.test.ts`,不达标的预设不能合入。
10
+ */
11
+ export declare const INTENT_STYLE_PRESET_IDS: readonly ['deep-tech', 'light-biz', 'warm-care', 'ink-finance'];
12
+ export type IntentStylePresetId = (typeof INTENT_STYLE_PRESET_IDS)[number];
13
+ export interface IntentStylePalette {
14
+ /** 画布底色。 */
15
+ readonly canvas: string;
16
+ /** 指标卡 / 面板的底色。 */
17
+ readonly card: string;
18
+ /** 标题与数值等主文字。 */
19
+ readonly text: string;
20
+ /** 副标题、说明、轴标签等次要文字。 */
21
+ readonly muted: string;
22
+ /** 差值、强调数字。 */
23
+ readonly accent: string;
24
+ /** 页脚等弱化文字。 */
25
+ readonly footer: string;
26
+ }
27
+ export interface IntentStylePreset {
28
+ readonly id: IntentStylePresetId;
29
+ /** 给模型看的中文描述,用于在提示词里让模型按主题挑选。 */
30
+ readonly label: string;
31
+ readonly palette: IntentStylePalette;
32
+ }
33
+ export declare const INTENT_STYLE_PRESETS: Readonly<Record<IntentStylePresetId, IntentStylePreset>>;
34
+ export declare const DEFAULT_INTENT_STYLE: IntentStylePresetId;
35
+ /** 把模型给的风格名映射到预设;未知或缺省时回退到默认预设,不报错。 */
36
+ export declare function resolveIntentStyle(value?: unknown): IntentStylePreset;
37
+ //# sourceMappingURL=intent-style.d.ts.map
@@ -0,0 +1,77 @@
1
+ /**
2
+ * 风格预设:模型只能从这里挑一个名字,颜色全部由宿主决定。
3
+ *
4
+ * 为什么不让模型直接写颜色:AGENTS.md 规定视觉由宿主统一决定,任意颜色会绕过设计系统,
5
+ * 也容易出现低对比度、不可读的配色。预设把「风格可变」与「颜色可控」分开:风格是模型的选择,
6
+ * 颜色是宿主保证过对比度的成套色板。
7
+ *
8
+ * 每套预设都必须满足 `WCAG AA`(正文 ≥ 4.5:1)。改色板后要重算对比度,
9
+ * 见 `tests/examples/agent-style-contrast.test.ts`,不达标的预设不能合入。
10
+ */
11
+ export const INTENT_STYLE_PRESET_IDS = [
12
+ 'deep-tech',
13
+ 'light-biz',
14
+ 'warm-care',
15
+ 'ink-finance',
16
+ ];
17
+ export const INTENT_STYLE_PRESETS = {
18
+ 'deep-tech': {
19
+ id: 'deep-tech',
20
+ label: '深色科技(深蓝底、冷色强调,适合监控、实时、指挥类)',
21
+ palette: {
22
+ canvas: '#0b1020',
23
+ card: '#141b24',
24
+ text: '#e9eef5',
25
+ muted: '#c6d3e4',
26
+ accent: '#4fcb6f',
27
+ footer: '#8a97a8',
28
+ },
29
+ },
30
+ 'light-biz': {
31
+ id: 'light-biz',
32
+ label: '浅色商务(浅灰底、白卡片、蓝色强调,适合经营分析、财务、报表类)',
33
+ palette: {
34
+ canvas: '#f4f6fa',
35
+ card: '#ffffff',
36
+ text: '#0f172a',
37
+ muted: '#4a5a70',
38
+ accent: '#1a63c4',
39
+ footer: '#5b6b82',
40
+ },
41
+ },
42
+ 'warm-care': {
43
+ id: 'warm-care',
44
+ label: '暖色人文(深棕底、暖色强调,适合医疗、民生、服务类)',
45
+ palette: {
46
+ canvas: '#1f1a17',
47
+ card: '#2a221e',
48
+ text: '#f6efe8',
49
+ muted: '#d9c7b5',
50
+ accent: '#f0a04b',
51
+ footer: '#b3a291',
52
+ },
53
+ },
54
+ 'ink-finance': {
55
+ id: 'ink-finance',
56
+ label: '墨黑金(黑底、金色强调,适合高管看板、汇总、战略类)',
57
+ palette: {
58
+ canvas: '#0e1116',
59
+ card: '#171c24',
60
+ text: '#eef1f5',
61
+ muted: '#b8c2d1',
62
+ accent: '#e8b84a',
63
+ footer: '#8f9aab',
64
+ },
65
+ },
66
+ };
67
+ export const DEFAULT_INTENT_STYLE = 'deep-tech';
68
+ /** 把模型给的风格名映射到预设;未知或缺省时回退到默认预设,不报错。 */
69
+ export function resolveIntentStyle(value) {
70
+ if (typeof value === 'string') {
71
+ const match = INTENT_STYLE_PRESET_IDS.find((id) => id === value.trim());
72
+ if (match !== undefined)
73
+ return INTENT_STYLE_PRESETS[match];
74
+ }
75
+ return INTENT_STYLE_PRESETS[DEFAULT_INTENT_STYLE];
76
+ }
77
+ //# sourceMappingURL=intent-style.js.map
@@ -0,0 +1,234 @@
1
+ /**
2
+ * 意图层 IR(ADR-0113 §2.2):模型产出的「这屏讲什么、怎么分区、每块用什么」。
3
+ *
4
+ * 宿主侧格式,不进 `contracts`,也没有版本字段:演进靠加可选键。IR 不含像素——几何由布局求解器
5
+ * 按区域与顺序算出;数值只能是模型给的示例数据、或对宿主数据集的引用,不是画面上的真实数值。
6
+ *
7
+ * 每个解析出的指标与块带 `origin`:它在**模型原文**里的路径(如 `blocks[2]`、`regions[1].main[0]`)。
8
+ * 丢弃坏项之后下标会前移,只有 `origin` 能让修复提示和来源表指回模型自己写的那一处。
9
+ */
10
+ /** 指标的增减量:`direction` 决定涨跌的好坏,颜色由编译器按它取状态色位。 */
11
+ export interface IntentKpiDelta {
12
+ readonly value: number;
13
+ /** `percent` 百分比变化;`point` 百分点;`absolute` 与指标同单位的绝对变化。 */
14
+ readonly unit: 'percent' | 'point' | 'absolute';
15
+ readonly direction: 'up-good' | 'down-good' | 'neutral';
16
+ }
17
+ /**
18
+ * 指标卡读数据集的一个字段(ADR-0114 D4)。结果只能有一行:文本物料只读第一行。
19
+ * 有 `bind` 时模型不得写 `value` / `delta`——真实数值配示例增减量比整张示例卡更误导。
20
+ */
21
+ export interface IntentKpiBind {
22
+ readonly datasetId: string;
23
+ readonly field: string;
24
+ readonly params?: Readonly<Record<string, string | number | boolean>>;
25
+ }
26
+ /**
27
+ * 一条阈值状态(ADR-0115 D2 状态来源 threshold):数值满足 `op value` 时切到 `tone` 的外观。
28
+ * 规则按顺序判定、第一条命中即停,所以严重的写在前面。
29
+ */
30
+ export interface IntentStateRule {
31
+ readonly op: 'gt' | 'gte' | 'lt' | 'lte' | 'eq' | 'neq';
32
+ readonly value: number | string;
33
+ readonly tone: 'success' | 'warning' | 'danger' | 'info';
34
+ /** 状态名(「过载」「偏低」);缺省按 tone 取默认名。 */
35
+ readonly label?: string;
36
+ }
37
+ /**
38
+ * 指标卡的状态(ADR-0115 D1 / D2):只对绑定了数据集字段的指标卡编译——示例数值不是真实数据,
39
+ * 按它判定阈值没有意义(`AGENT_STATE_NEEDS_DATA`)。
40
+ */
41
+ export interface IntentKpiStates {
42
+ readonly rules: readonly IntentStateRule[];
43
+ /** 阈值是模型补的(用户没说具体数):提案理由里提示用户核对(`INTENT_STATE_SUGGESTED`)。 */
44
+ readonly suggested?: boolean;
45
+ /**
46
+ * 状态来源(ADR-0115 D2):缺省为 `threshold`(按 `rules` 判定);`level-scale` 表示按宿主为该字段
47
+ * 声明的分级表生成(ADR-0110 §2.6.3 的同一套规则),此时 `rules` 为空。宿主没给分级表时不编译、
48
+ * 写进理由(`AGENT_STATE_LEVEL_SCALE_UNAVAILABLE`)。
49
+ */
50
+ readonly source?: 'threshold' | 'level-scale';
51
+ }
52
+ /**
53
+ * 句柄(ADR-0115 D1):模型给块 / 指标卡起的短名,联动按它(或按标题)指向组件。
54
+ * 小写字母开头,字母、数字、连字符,至多 32 字符。
55
+ */
56
+ export type IntentKey = string;
57
+ export interface IntentKpi {
58
+ readonly label: string;
59
+ /** `null` 表示没有数据(确定性兜底的占位),编译器画「—」而不是 0。 */
60
+ readonly value: number | null;
61
+ /** 「%」「万元」「人次」;不含数量级,万 / 亿由编译器折算。 */
62
+ readonly unit?: string;
63
+ /** 小数位 0–3;缺省时由编译器按数量级决定。 */
64
+ readonly precision?: number;
65
+ readonly delta?: IntentKpiDelta;
66
+ /** 读数据集字段;有它时 `value` 为 `null`、没有 `delta` / `precision`。 */
67
+ readonly bind?: IntentKpiBind;
68
+ /** 联动引用用的句柄。 */
69
+ readonly key?: IntentKey;
70
+ /** 阈值状态;只在 `bind` 存在时编译。 */
71
+ readonly states?: IntentKpiStates;
72
+ readonly origin: string;
73
+ /**
74
+ * 稳定标识(会话里用):编译出的组件 id 与层级按它分段,而不是按当前位置。
75
+ * 删掉一块之后,后面的块位置前移、几何要变,但组件 id 不能跟着漂——未变的组件才能原样保留,
76
+ * 用户改过的内容才能对得上。缺省时用位置路径。
77
+ */
78
+ readonly ident?: string;
79
+ }
80
+ export interface IntentTableColumn {
81
+ readonly id: string;
82
+ readonly label: string;
83
+ readonly type: 'string' | 'number' | 'boolean';
84
+ }
85
+ export interface IntentTable {
86
+ readonly columns: readonly IntentTableColumn[];
87
+ readonly rows: readonly Readonly<Record<string, string | number | boolean>>[];
88
+ }
89
+ /**
90
+ * 块的取值。模型面向的写法仍是平铺字段(`table` / `datasetId` / `text` / `assetId`),
91
+ * 解析时归一成这里的判别联合:下游不再逐个字段猜。
92
+ */
93
+ export type IntentBind = {
94
+ readonly kind: 'table';
95
+ readonly table: IntentTable;
96
+ } | {
97
+ readonly kind: 'dataset';
98
+ readonly datasetId: string;
99
+ /** 角色 id → 字段 id(ADR-0114 D4);缺省时编译器按列类型分配(阶段 2 的行为)。 */
100
+ readonly fields?: Readonly<Record<string, readonly string[]>>;
101
+ /** 查询参数;与数据集声明的默认值合并,取值须合法。 */
102
+ readonly params?: Readonly<Record<string, string | number | boolean>>;
103
+ } | {
104
+ readonly kind: 'text';
105
+ readonly text: string;
106
+ } | {
107
+ readonly kind: 'asset';
108
+ readonly assetId: string;
109
+ } | {
110
+ readonly kind: 'none';
111
+ };
112
+ export interface IntentBlock {
113
+ /** 目录里真实存在的物料 type。 */
114
+ readonly type: string;
115
+ readonly title: string;
116
+ readonly note?: string;
117
+ /** 四列栅格里占几列,1–4;只在 `grid` 区域里有意义,其他区域固定为 1。 */
118
+ readonly span: number;
119
+ readonly bind: IntentBind;
120
+ readonly props?: Readonly<Record<string, string | number | boolean>>;
121
+ /** 目录里没有用户要的物料、用了替代品时,模型写明「本来要的是什么」,编译器据此说明缺口。 */
122
+ readonly substituteFor?: string;
123
+ /** 由本轮候选表展开而来时的候选编号(`c3`):提案理由与评测据此统计。 */
124
+ readonly candidate?: string;
125
+ /** 联动引用用的句柄。 */
126
+ readonly key?: IntentKey;
127
+ readonly origin: string;
128
+ /** 稳定标识,见 `IntentKpi.ident`。 */
129
+ readonly ident?: string;
130
+ }
131
+ /** 一排等宽的小卡(指标条)。 */
132
+ export interface IntentBand {
133
+ readonly kind: 'band';
134
+ readonly items: readonly IntentKpi[];
135
+ /** 区域在模型原文里的路径:`regions[1]`;平铺写法的指标带为 `kpis`。容量冲突的诊断靠它指回模型写的那一处。 */
136
+ readonly origin: string;
137
+ }
138
+ /** 四列栅格:块按顺序排,同一行 span 之和不超过 4。 */
139
+ export interface IntentGrid {
140
+ readonly kind: 'grid';
141
+ readonly blocks: readonly IntentBlock[];
142
+ /** `regions[2]`;平铺写法的栅格为 `blocks`。 */
143
+ readonly origin: string;
144
+ }
145
+ /** 主区 + 侧栏:侧栏里的块纵向堆叠。 */
146
+ export interface IntentSplit {
147
+ readonly kind: 'split';
148
+ /** `wide-narrow` 主区宽、侧栏窄;`even` 两栏等宽。缺省 `wide-narrow`。 */
149
+ readonly ratio: 'wide-narrow' | 'even';
150
+ /** 侧栏在哪一侧,缺省 `right`。 */
151
+ readonly railSide: 'left' | 'right';
152
+ readonly main: readonly IntentBlock[];
153
+ readonly rail: readonly IntentBlock[];
154
+ readonly origin: string;
155
+ }
156
+ export type IntentRegion = IntentBand | IntentGrid | IntentSplit;
157
+ /**
158
+ * 联动(ADR-0115 D2):一个块的事件驱动另一些块。`from` / `to` 写块或指标卡的 `key`,或它的标题。
159
+ *
160
+ * - `filter`:点了来源块,把事件里的一个值写进目标块数据集的查询参数(只经数据集参数,不做前端过滤)。
161
+ * 编译器推出一个变量承接这个值,目标实例的参数改为引用该变量;`field` 是来源行里的字段
162
+ * (表格 / 滚动表的 `rowClick`),图表点击取横轴值、页签取选中值、数字类取数值时可省略。
163
+ * - `show`:点了来源块,显示 / 隐藏 / 切换目标块;`show` 模式的目标初始隐藏。
164
+ */
165
+ export type IntentInteraction = {
166
+ readonly kind: 'filter';
167
+ readonly from: string;
168
+ readonly event: string;
169
+ readonly field?: string;
170
+ readonly to: readonly string[];
171
+ readonly param: string;
172
+ /** 再点同一项恢复原来的取值(ADR-0115 D2):编译成蓝图条件分支。 */
173
+ readonly reset?: true;
174
+ readonly origin: string;
175
+ } | {
176
+ readonly kind: 'show';
177
+ readonly from: string;
178
+ readonly event: string;
179
+ readonly to: readonly string[];
180
+ readonly mode: 'show' | 'hide' | 'toggle';
181
+ readonly origin: string;
182
+ } | {
183
+ /**
184
+ * 设状态(ADR-0115 D2):点来源 → 把目标指标切到它某个已声明的状态(按状态名或色调找),
185
+ * `reset` 表示恢复按判定显示。目标必须是本屏声明了 `states` 的指标。
186
+ */
187
+ readonly kind: 'state';
188
+ readonly from: string;
189
+ readonly event: string;
190
+ readonly to: readonly string[];
191
+ readonly state: string;
192
+ readonly origin: string;
193
+ };
194
+ export interface ScreenIntent {
195
+ readonly title: string;
196
+ readonly subtitle: string;
197
+ /** 风格预设 id;是否认得由编译器判断,不认得回退默认预设。 */
198
+ readonly style?: string;
199
+ /** 区域按从上到下的顺序。 */
200
+ readonly regions: readonly IntentRegion[];
201
+ /** 联动(ADR-0115);变量由编译器推出,模型不写。 */
202
+ readonly interactions?: readonly IntentInteraction[];
203
+ }
204
+ /**
205
+ * 解析诊断。
206
+ *
207
+ * - `error`:这一项被丢弃或降级,值得请模型修一次(进修复回环);
208
+ * - `warning`:这一项被收敛后保留(截断、裁行、丢未声明的参数),如实告诉用户即可。
209
+ *
210
+ * `path` 是模型原文里的路径,空串表示整份输出。诊断码沿用阶段 1 已面向用户的 `AGENT_*`,
211
+ * 区域层新增的用 `INTENT_*`;`message` 是给开发者的英文,面向用户的文案由宿主按码映射。
212
+ */
213
+ export interface IntentDiagnostic {
214
+ readonly severity: 'error' | 'warning';
215
+ readonly code: string;
216
+ readonly path: string;
217
+ readonly message: string;
218
+ /**
219
+ * 给宿主拼用户可读文案用的结构化细节(英文 `message` 不面向用户)。
220
+ * `INTENT_BLOCK_SUBSTITUTED`:`wanted`(模型写明本来要的)与 `used`(实际用的物料名)。
221
+ */
222
+ readonly detail?: Readonly<Record<string, string | number>>;
223
+ }
224
+ export interface IntentParseResult {
225
+ /** `undefined` 表示整份不可用(诊断里有整份级的 error),调用方走失败路径。 */
226
+ readonly intent: ScreenIntent | undefined;
227
+ readonly diagnostics: readonly IntentDiagnostic[];
228
+ }
229
+ /** 单项解析(流式逐项出帧时用)。 */
230
+ export interface IntentItemResult<T> {
231
+ readonly value: T | undefined;
232
+ readonly diagnostics: readonly IntentDiagnostic[];
233
+ }
234
+ //# sourceMappingURL=intent-types.d.ts.map
@@ -0,0 +1,10 @@
1
+ /**
2
+ * 意图层 IR(ADR-0113 §2.2):模型产出的「这屏讲什么、怎么分区、每块用什么」。
3
+ *
4
+ * 宿主侧格式,不进 `contracts`,也没有版本字段:演进靠加可选键。IR 不含像素——几何由布局求解器
5
+ * 按区域与顺序算出;数值只能是模型给的示例数据、或对宿主数据集的引用,不是画面上的真实数值。
6
+ *
7
+ * 每个解析出的指标与块带 `origin`:它在**模型原文**里的路径(如 `blocks[2]`、`regions[1].main[0]`)。
8
+ * 丢弃坏项之后下标会前移,只有 `origin` 能让修复提示和来源表指回模型自己写的那一处。
9
+ */
10
+ //# sourceMappingURL=intent-types.js.map
@@ -128,19 +128,41 @@ var s = r({
128
128
  rotate: !0,
129
129
  children: !1
130
130
  }
131
- }, { appearance: [{
132
- id: "text",
133
- label: "文字",
134
- fields: [n("color", "文字色", "color")]
135
131
  }, {
136
- id: "surface",
137
- label: "填充与描边",
138
- fields: [
139
- n("backgroundColor", "背景色", "color", { allowGradient: !0 }),
140
- n("gridColor", "网格色", "color"),
141
- n("lineWidth", "线宽", "number")
142
- ]
143
- }] }), c = [
132
+ events: [{
133
+ name: "pointClick",
134
+ label: "点击数据点",
135
+ hint: "负载带系列、点序号与该点的维度值 x、度量值 y。",
136
+ payloadSchema: {
137
+ kind: "object",
138
+ properties: {
139
+ seriesId: { kind: "string" },
140
+ pointIndex: { kind: "number" },
141
+ x: { kind: "string" },
142
+ y: { kind: "number" }
143
+ },
144
+ required: [
145
+ "seriesId",
146
+ "pointIndex",
147
+ "x",
148
+ "y"
149
+ ]
150
+ }
151
+ }],
152
+ appearance: [{
153
+ id: "text",
154
+ label: "文字",
155
+ fields: [n("color", "文字色", "color")]
156
+ }, {
157
+ id: "surface",
158
+ label: "填充与描边",
159
+ fields: [
160
+ n("backgroundColor", "背景色", "color", { allowGradient: !0 }),
161
+ n("gridColor", "网格色", "color"),
162
+ n("lineWidth", "线宽", "number")
163
+ ]
164
+ }]
165
+ }), c = [
144
166
  "#38bdf8",
145
167
  "#f97316",
146
168
  "#a78bfa",