@elastic/isomer-sdk 0.1.0 → 0.2.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 (222) hide show
  1. package/README.md +13 -2
  2. package/dist/author/authored_fields.d.ts +61 -11
  3. package/dist/author/authored_fields.d.ts.map +1 -1
  4. package/dist/author/authored_fields.js +73 -29
  5. package/dist/author/authored_fields.js.map +1 -1
  6. package/dist/author/authoring_input.d.ts +7 -0
  7. package/dist/author/authoring_input.d.ts.map +1 -0
  8. package/dist/author/authoring_input.js +60 -0
  9. package/dist/author/authoring_input.js.map +1 -0
  10. package/dist/author/authoring_model.d.ts +27 -0
  11. package/dist/author/authoring_model.d.ts.map +1 -0
  12. package/dist/author/authoring_model.js +98 -0
  13. package/dist/author/authoring_model.js.map +1 -0
  14. package/dist/author/declarations.d.ts +13 -0
  15. package/dist/author/declarations.d.ts.map +1 -0
  16. package/dist/author/declarations.js +277 -0
  17. package/dist/author/declarations.js.map +1 -0
  18. package/dist/author/index.d.ts +3 -1
  19. package/dist/author/index.d.ts.map +1 -1
  20. package/dist/author/index.js +3 -1
  21. package/dist/author/index.js.map +1 -1
  22. package/dist/author/jsx_shim.d.ts +6 -5
  23. package/dist/author/jsx_shim.d.ts.map +1 -1
  24. package/dist/author/jsx_shim.js +28 -111
  25. package/dist/author/jsx_shim.js.map +1 -1
  26. package/dist/author/schema_to_typescript.d.ts +37 -0
  27. package/dist/author/schema_to_typescript.d.ts.map +1 -0
  28. package/dist/author/schema_to_typescript.js +286 -0
  29. package/dist/author/schema_to_typescript.js.map +1 -0
  30. package/dist/cjs/author/authored_fields.js +77 -33
  31. package/dist/cjs/author/authored_fields.js.map +1 -1
  32. package/dist/cjs/author/authoring_input.js +64 -0
  33. package/dist/cjs/author/authoring_input.js.map +1 -0
  34. package/dist/cjs/author/authoring_model.js +104 -0
  35. package/dist/cjs/author/authoring_model.js.map +1 -0
  36. package/dist/cjs/author/declarations.js +281 -0
  37. package/dist/cjs/author/declarations.js.map +1 -0
  38. package/dist/cjs/author/index.js +6 -1
  39. package/dist/cjs/author/index.js.map +1 -1
  40. package/dist/cjs/author/jsx_shim.js +31 -114
  41. package/dist/cjs/author/jsx_shim.js.map +1 -1
  42. package/dist/cjs/author/schema_to_typescript.js +295 -0
  43. package/dist/cjs/author/schema_to_typescript.js.map +1 -0
  44. package/dist/cjs/composition/body_node_base.js +11 -4
  45. package/dist/cjs/composition/body_node_base.js.map +1 -1
  46. package/dist/cjs/composition/error.js +1 -0
  47. package/dist/cjs/composition/error.js.map +1 -1
  48. package/dist/cjs/composition/index.js +2 -1
  49. package/dist/cjs/composition/index.js.map +1 -1
  50. package/dist/cjs/define/frame.js +2 -3
  51. package/dist/cjs/define/frame.js.map +1 -1
  52. package/dist/cjs/define/index.js +7 -1
  53. package/dist/cjs/define/index.js.map +1 -1
  54. package/dist/cjs/define/primitive_example.js +26 -0
  55. package/dist/cjs/define/primitive_example.js.map +1 -0
  56. package/dist/cjs/define/primitive_icon.js +17 -0
  57. package/dist/cjs/define/primitive_icon.js.map +1 -0
  58. package/dist/cjs/define/primitive_module.js +14 -3
  59. package/dist/cjs/define/primitive_module.js.map +1 -1
  60. package/dist/cjs/define/slack_assets.js.map +1 -1
  61. package/dist/cjs/entries/index.js +7 -2
  62. package/dist/cjs/entries/index.js.map +1 -1
  63. package/dist/cjs/entries/slack.js +1 -2
  64. package/dist/cjs/entries/slack.js.map +1 -1
  65. package/dist/cjs/pack/capabilities.js +17 -11
  66. package/dist/cjs/pack/capabilities.js.map +1 -1
  67. package/dist/cjs/pack/compose.js +4 -1
  68. package/dist/cjs/pack/compose.js.map +1 -1
  69. package/dist/cjs/pack/index.js.map +1 -1
  70. package/dist/cjs/pack/primitive_pack.js +14 -2
  71. package/dist/cjs/pack/primitive_pack.js.map +1 -1
  72. package/dist/cjs/render/anchors.js +1 -1
  73. package/dist/cjs/render/anchors.js.map +1 -1
  74. package/dist/cjs/render/html/envelope.js.map +1 -1
  75. package/dist/cjs/render/layout_check.js.map +1 -1
  76. package/dist/cjs/render/markdown/builder.js +14 -8
  77. package/dist/cjs/render/markdown/builder.js.map +1 -1
  78. package/dist/cjs/render/markdown/format.js +30 -12
  79. package/dist/cjs/render/markdown/format.js.map +1 -1
  80. package/dist/cjs/render/primitive_dispatch.js +11 -25
  81. package/dist/cjs/render/primitive_dispatch.js.map +1 -1
  82. package/dist/cjs/render/slack/format.js +1 -601
  83. package/dist/cjs/render/slack/format.js.map +1 -1
  84. package/dist/cjs/render/slack/index.js +1 -2
  85. package/dist/cjs/render/slack/index.js.map +1 -1
  86. package/dist/cjs/render/slack/markdown_content.js +166 -115
  87. package/dist/cjs/render/slack/markdown_content.js.map +1 -1
  88. package/dist/cjs/testing/conformance.js +40 -24
  89. package/dist/cjs/testing/conformance.js.map +1 -1
  90. package/dist/cjs/testing/icon.js +248 -0
  91. package/dist/cjs/testing/icon.js.map +1 -0
  92. package/dist/cjs/testing/index.js +3 -1
  93. package/dist/cjs/testing/index.js.map +1 -1
  94. package/dist/cjs/testing/registration.js +5 -3
  95. package/dist/cjs/testing/registration.js.map +1 -1
  96. package/dist/cjs/validate/authoring_schema.js +17 -1
  97. package/dist/cjs/validate/authoring_schema.js.map +1 -1
  98. package/dist/cjs/validate/index.js +2 -1
  99. package/dist/cjs/validate/index.js.map +1 -1
  100. package/dist/cjs/validate/validation.js +2 -45
  101. package/dist/cjs/validate/validation.js.map +1 -1
  102. package/dist/composition/body_node_base.d.ts +7 -6
  103. package/dist/composition/body_node_base.d.ts.map +1 -1
  104. package/dist/composition/body_node_base.js +10 -3
  105. package/dist/composition/body_node_base.js.map +1 -1
  106. package/dist/composition/error.d.ts +1 -0
  107. package/dist/composition/error.d.ts.map +1 -1
  108. package/dist/composition/error.js +1 -0
  109. package/dist/composition/error.js.map +1 -1
  110. package/dist/composition/index.d.ts +1 -1
  111. package/dist/composition/index.d.ts.map +1 -1
  112. package/dist/composition/index.js +1 -1
  113. package/dist/composition/index.js.map +1 -1
  114. package/dist/define/frame.d.ts +9 -20
  115. package/dist/define/frame.d.ts.map +1 -1
  116. package/dist/define/frame.js +2 -3
  117. package/dist/define/frame.js.map +1 -1
  118. package/dist/define/index.d.ts +3 -1
  119. package/dist/define/index.d.ts.map +1 -1
  120. package/dist/define/index.js +3 -1
  121. package/dist/define/index.js.map +1 -1
  122. package/dist/define/primitive_example.d.ts +30 -0
  123. package/dist/define/primitive_example.d.ts.map +1 -0
  124. package/dist/define/primitive_example.js +21 -0
  125. package/dist/define/primitive_example.js.map +1 -0
  126. package/dist/define/primitive_icon.d.ts +11 -0
  127. package/dist/define/primitive_icon.d.ts.map +1 -0
  128. package/dist/define/primitive_icon.js +14 -0
  129. package/dist/define/primitive_icon.js.map +1 -0
  130. package/dist/define/primitive_module.d.ts +38 -24
  131. package/dist/define/primitive_module.d.ts.map +1 -1
  132. package/dist/define/primitive_module.js +14 -3
  133. package/dist/define/primitive_module.js.map +1 -1
  134. package/dist/define/slack_assets.d.ts +1 -1
  135. package/dist/define/slack_assets.d.ts.map +1 -1
  136. package/dist/define/slack_assets.js.map +1 -1
  137. package/dist/entries/index.d.ts +3 -3
  138. package/dist/entries/index.d.ts.map +1 -1
  139. package/dist/entries/index.js +2 -2
  140. package/dist/entries/index.js.map +1 -1
  141. package/dist/entries/slack.d.ts +1 -1
  142. package/dist/entries/slack.d.ts.map +1 -1
  143. package/dist/entries/slack.js +1 -1
  144. package/dist/entries/slack.js.map +1 -1
  145. package/dist/pack/capabilities.d.ts +24 -10
  146. package/dist/pack/capabilities.d.ts.map +1 -1
  147. package/dist/pack/capabilities.js +17 -11
  148. package/dist/pack/capabilities.js.map +1 -1
  149. package/dist/pack/compose.d.ts +4 -1
  150. package/dist/pack/compose.d.ts.map +1 -1
  151. package/dist/pack/compose.js +4 -1
  152. package/dist/pack/compose.js.map +1 -1
  153. package/dist/pack/index.d.ts +1 -1
  154. package/dist/pack/index.d.ts.map +1 -1
  155. package/dist/pack/index.js +1 -1
  156. package/dist/pack/index.js.map +1 -1
  157. package/dist/pack/primitive_pack.d.ts +11 -2
  158. package/dist/pack/primitive_pack.d.ts.map +1 -1
  159. package/dist/pack/primitive_pack.js +12 -1
  160. package/dist/pack/primitive_pack.js.map +1 -1
  161. package/dist/render/anchors.d.ts +2 -2
  162. package/dist/render/anchors.d.ts.map +1 -1
  163. package/dist/render/anchors.js +1 -1
  164. package/dist/render/anchors.js.map +1 -1
  165. package/dist/render/html/envelope.d.ts +3 -3
  166. package/dist/render/html/envelope.js.map +1 -1
  167. package/dist/render/layout_check.d.ts +1 -1
  168. package/dist/render/layout_check.d.ts.map +1 -1
  169. package/dist/render/layout_check.js.map +1 -1
  170. package/dist/render/markdown/builder.d.ts +2 -4
  171. package/dist/render/markdown/builder.d.ts.map +1 -1
  172. package/dist/render/markdown/builder.js +14 -7
  173. package/dist/render/markdown/builder.js.map +1 -1
  174. package/dist/render/markdown/format.d.ts +7 -0
  175. package/dist/render/markdown/format.d.ts.map +1 -1
  176. package/dist/render/markdown/format.js +27 -11
  177. package/dist/render/markdown/format.js.map +1 -1
  178. package/dist/render/primitive_dispatch.d.ts +6 -6
  179. package/dist/render/primitive_dispatch.d.ts.map +1 -1
  180. package/dist/render/primitive_dispatch.js +12 -26
  181. package/dist/render/primitive_dispatch.js.map +1 -1
  182. package/dist/render/slack/format.d.ts +0 -25
  183. package/dist/render/slack/format.d.ts.map +1 -1
  184. package/dist/render/slack/format.js +1 -599
  185. package/dist/render/slack/format.js.map +1 -1
  186. package/dist/render/slack/index.d.ts +1 -1
  187. package/dist/render/slack/index.d.ts.map +1 -1
  188. package/dist/render/slack/index.js +1 -1
  189. package/dist/render/slack/index.js.map +1 -1
  190. package/dist/render/slack/markdown_content.d.ts +10 -4
  191. package/dist/render/slack/markdown_content.d.ts.map +1 -1
  192. package/dist/render/slack/markdown_content.js +163 -113
  193. package/dist/render/slack/markdown_content.js.map +1 -1
  194. package/dist/testing/conformance.d.ts +19 -14
  195. package/dist/testing/conformance.d.ts.map +1 -1
  196. package/dist/testing/conformance.js +40 -24
  197. package/dist/testing/conformance.js.map +1 -1
  198. package/dist/testing/icon.d.ts +11 -0
  199. package/dist/testing/icon.d.ts.map +1 -0
  200. package/dist/testing/icon.js +244 -0
  201. package/dist/testing/icon.js.map +1 -0
  202. package/dist/testing/index.d.ts +2 -1
  203. package/dist/testing/index.d.ts.map +1 -1
  204. package/dist/testing/index.js +1 -0
  205. package/dist/testing/index.js.map +1 -1
  206. package/dist/testing/registration.d.ts +1 -1
  207. package/dist/testing/registration.d.ts.map +1 -1
  208. package/dist/testing/registration.js +6 -4
  209. package/dist/testing/registration.js.map +1 -1
  210. package/dist/validate/authoring_schema.d.ts +6 -0
  211. package/dist/validate/authoring_schema.d.ts.map +1 -1
  212. package/dist/validate/authoring_schema.js +15 -0
  213. package/dist/validate/authoring_schema.js.map +1 -1
  214. package/dist/validate/index.d.ts +1 -1
  215. package/dist/validate/index.d.ts.map +1 -1
  216. package/dist/validate/index.js +1 -1
  217. package/dist/validate/index.js.map +1 -1
  218. package/dist/validate/validation.d.ts +1 -11
  219. package/dist/validate/validation.d.ts.map +1 -1
  220. package/dist/validate/validation.js +3 -46
  221. package/dist/validate/validation.js.map +1 -1
  222. package/package.json +3 -2
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0; you may not use this file except in compliance with the Elastic License
5
+ * 2.0.
6
+ */
7
+ const isPrimitiveExample = (entry) => !('type' in entry) && 'node' in entry;
8
+ const normalize = (entry) => {
9
+ if (!isPrimitiveExample(entry)) {
10
+ return { node: entry };
11
+ }
12
+ const { name, description, node } = entry;
13
+ return description === undefined
14
+ ? { name, node }
15
+ : { name, description, node };
16
+ };
17
+ /** A definition's examples, bare or named, as {@link NormalizedPrimitiveExample}s. */
18
+ export const primitiveExamples = ({ examples, }) => examples.map(normalize);
19
+ /** A definition's example nodes, without names. */
20
+ export const exampleNodes = ({ examples, }) => examples.map((entry) => normalize(entry).node);
21
+ //# sourceMappingURL=primitive_example.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitive_example.js","sourceRoot":"","sources":["../../src/define/primitive_example.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAqCH,MAAM,kBAAkB,GAAG,CACzB,KAAuC,EACZ,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,MAAM,IAAI,KAAK,CAAC;AAEtE,MAAM,SAAS,GAAG,CAChB,KAAuC,EACX,EAAE;IAC9B,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACzB,CAAC;IACD,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAC1C,OAAO,WAAW,KAAK,SAAS;QAC9B,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE;QAChB,CAAC,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;AAClC,CAAC,CAAC;AAEF,sFAAsF;AACtF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAmC,EAClE,QAAQ,GACI,EAAqD,EAAE,CACnE,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAsD,CAAC;AAE/E,mDAAmD;AACnD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAmC,EAC7D,QAAQ,GACI,EAAyB,EAAE,CACvC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,IAAI,CAA0B,CAAC","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nimport type { PrimitiveNode } from '../composition/node';\n\n/** A published example with a name hosts can list it by. */\nexport interface PrimitiveExample<TNode extends PrimitiveNode = PrimitiveNode> {\n /** Short and unique within the primitive, such as `Warning tone`. */\n name: string;\n /** What the example demonstrates. */\n description?: string;\n node: TNode;\n /** Never set: an entry is a bare node exactly when it has a `type`. */\n type?: never;\n}\n\n/** An entry of `examples` read as one shape; `name` is absent for a bare node. */\nexport interface NormalizedPrimitiveExample<\n TNode extends PrimitiveNode = PrimitiveNode,\n> {\n name?: string;\n description?: string;\n node: TNode;\n}\n\n/** The node type an `examples` entry holds. */\nexport type ExampleNode<TEntry> =\n TEntry extends PrimitiveExample<infer TNode> ? TNode : TEntry;\n\ninterface WithExamples {\n readonly examples: readonly (PrimitiveNode | PrimitiveExample)[];\n}\n\n/** Distributes over a union of definitions, so a mixed registry keeps every node type. */\ntype NodeOf<TDefinition extends WithExamples> = ExampleNode<\n TDefinition['examples'][number]\n>;\n\nconst isPrimitiveExample = (\n entry: PrimitiveNode | PrimitiveExample\n): entry is PrimitiveExample => !('type' in entry) && 'node' in entry;\n\nconst normalize = (\n entry: PrimitiveNode | PrimitiveExample\n): NormalizedPrimitiveExample => {\n if (!isPrimitiveExample(entry)) {\n return { node: entry };\n }\n const { name, description, node } = entry;\n return description === undefined\n ? { name, node }\n : { name, description, node };\n};\n\n/** A definition's examples, bare or named, as {@link NormalizedPrimitiveExample}s. */\nexport const primitiveExamples = <TDefinition extends WithExamples>({\n examples,\n}: TDefinition): NormalizedPrimitiveExample<NodeOf<TDefinition>>[] =>\n examples.map(normalize) as NormalizedPrimitiveExample<NodeOf<TDefinition>>[];\n\n/** A definition's example nodes, without names. */\nexport const exampleNodes = <TDefinition extends WithExamples>({\n examples,\n}: TDefinition): NodeOf<TDefinition>[] =>\n examples.map((entry) => normalize(entry).node) as NodeOf<TDefinition>[];\n"]}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * A 16×16 glyph a host shows beside the primitive: static SVG, inlinable without a renderer.
3
+ *
4
+ * Colours go through {@link ICON_VARS}, optionally with a `currentColor` or hex fallback; `assertPackIconsValid` from `./testing` enforces the rules.
5
+ */
6
+ export interface PrimitiveIcon {
7
+ svg: string;
8
+ }
9
+ /** The colour slots an icon may paint with, which a host sets per theme and mode. */
10
+ export declare const ICON_VARS: readonly ["--isomer-icon-accent", "--isomer-icon-bg", "--isomer-icon-fg", "--isomer-icon-muted"];
11
+ //# sourceMappingURL=primitive_icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitive_icon.d.ts","sourceRoot":"","sources":["../../src/define/primitive_icon.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,qFAAqF;AACrF,eAAO,MAAM,SAAS,kGAKZ,CAAC"}
@@ -0,0 +1,14 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0; you may not use this file except in compliance with the Elastic License
5
+ * 2.0.
6
+ */
7
+ /** The colour slots an icon may paint with, which a host sets per theme and mode. */
8
+ export const ICON_VARS = [
9
+ '--isomer-icon-accent',
10
+ '--isomer-icon-bg',
11
+ '--isomer-icon-fg',
12
+ '--isomer-icon-muted',
13
+ ];
14
+ //# sourceMappingURL=primitive_icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitive_icon.js","sourceRoot":"","sources":["../../src/define/primitive_icon.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,qFAAqF;AACrF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,sBAAsB;IACtB,kBAAkB;IAClB,kBAAkB;IAClB,qBAAqB;CACb,CAAC","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\n/**\n * A 16×16 glyph a host shows beside the primitive: static SVG, inlinable without a renderer.\n *\n * Colours go through {@link ICON_VARS}, optionally with a `currentColor` or hex fallback; `assertPackIconsValid` from `./testing` enforces the rules.\n */\nexport interface PrimitiveIcon {\n svg: string;\n}\n\n/** The colour slots an icon may paint with, which a host sets per theme and mode. */\nexport const ICON_VARS = [\n '--isomer-icon-accent',\n '--isomer-icon-bg',\n '--isomer-icon-fg',\n '--isomer-icon-muted',\n] as const;\n"]}
@@ -5,6 +5,8 @@ import { type ChildNodeRef, type SurfaceName } from '../composition/body_node_ba
5
5
  import type { PrimitiveNode } from '../composition/node.js';
6
6
  import type { ValidationError } from '../composition/validation_error.js';
7
7
  import type { MarkdownContent } from './markdown_content.js';
8
+ import type { PrimitiveExample } from './primitive_example.js';
9
+ import type { PrimitiveIcon } from './primitive_icon.js';
8
10
  import type { SlackAssetCollector } from './slack_assets.js';
9
11
  import type { SlackBlock } from './slack_blocks.js';
10
12
  export type { PrimitiveNode };
@@ -12,10 +14,13 @@ export type { PrimitiveNode };
12
14
  * A primitive's entry in the catalog the authoring prompt is built from.
13
15
  *
14
16
  * Written for the model rather than for a developer: `useWhen` and `avoidWhen`
15
- * are what steer it away from reaching for the wrong primitive.
17
+ * are what steer it away from reaching for the wrong primitive. `name` is the
18
+ * one host-facing field, and the prompt never prints it.
16
19
  */
17
20
  export interface PrimitiveCatalogEntry {
18
21
  type: string;
22
+ /** Short name a host shows for the primitive, e.g. `Stat group`. Absent means the host derives one from `type`. */
23
+ name?: string;
19
24
  /** One line on what the primitive is for, in the model's voice. */
20
25
  purpose: string;
21
26
  /** Situations that call for this primitive. Phrase each as a user intent, not a shape. */
@@ -53,7 +58,7 @@ export interface PrimitiveRenderContext {
53
58
  * still answer the question on its own. See `docs/rendering.md`.
54
59
  */
55
60
  enhancements?: ReadonlySet<string>;
56
- /** Turns on `nodeAnchor` outside an HTML surface render, on the React and `svg` surfaces; inside one, the surface decides. */
61
+ /** Turns on `nodeAnchor` outside an HTML surface render, on the React and `snapshot` surfaces; inside one, the surface decides. */
57
62
  anchors?: boolean;
58
63
  /** Raises an interaction for the host to route. Absent means render non-interactively. */
59
64
  onEvent?: (event: ActionEventRef) => void;
@@ -127,9 +132,9 @@ export interface SurfaceMap<T extends PackTypes = DefaultPackTypes> {
127
132
  scope: RenderScope<T>;
128
133
  /**
129
134
  * The frame's resolved palette, when this render is reached through the
130
- * `svg` surface. A bare `react`/`html` render has no {@link Frame} to
135
+ * `snapshot` surface. A bare `react`/`html` render has no {@link Frame} to
131
136
  * resolve one from, so it is absent there — a pack that needs a
132
- * literal color outside `svg` still goes through `context`.
137
+ * literal color outside `snapshot` still goes through `context`.
133
138
  */
134
139
  theme?: T['theme'];
135
140
  };
@@ -139,9 +144,9 @@ export interface SurfaceMap<T extends PackTypes = DefaultPackTypes> {
139
144
  * Identical to `react`, and served by the same renderer: an image backend
140
145
  * lays out the pack's DOM tree and stylesheet rather than a second tree
141
146
  * authored for it. The surface stays separate so a node can be hidden from
142
- * images alone, and so a {@link Frame} has something to draw inside.
147
+ * snapshots alone, and so a {@link Frame} has something to draw inside.
143
148
  */
144
- svg: {
149
+ snapshot: {
145
150
  env: {
146
151
  context: T['context'];
147
152
  scope: RenderScope<T>;
@@ -156,12 +161,12 @@ export interface SurfaceMap<T extends PackTypes = DefaultPackTypes> {
156
161
  };
157
162
  output: string;
158
163
  };
159
- /** A string is printed as written; content from `md` is escaped where it lands. */
164
+ /** Content built with `md`, escaped where it lands; authored Markdown source goes through `md.authored`. */
160
165
  markdown: {
161
166
  env: {
162
167
  scope: RenderScope<T>;
163
168
  };
164
- output: string | MarkdownContent;
169
+ output: MarkdownContent;
165
170
  };
166
171
  /**
167
172
  * Returns one payload or several, so a primitive need not wrap a single
@@ -193,12 +198,12 @@ export interface RenderScope<T extends PackTypes = DefaultPackTypes> {
193
198
  collectStyles(node: PrimitiveNode, styles: PrimitiveStyleCollector, context: PrimitiveStyleCollectionContext): void;
194
199
  renderText(node: PrimitiveNode): string;
195
200
  renderMarkdown(node: PrimitiveNode): string;
196
- /** A child as content, for a container building with `md`; a string result is printed as written. */
201
+ /** A child as content, for a container building with `md`. */
197
202
  renderMarkdownContent(node: PrimitiveNode): MarkdownContent;
198
203
  /** Empty when the node is hidden from `slack`, `sanitize` drops it, or its renderer returns nothing; a node with no `slack` renderer degrades through its markdown. */
199
204
  renderSlack(node: PrimitiveNode, collector?: T['slackCollector']): readonly T['slackBlock'][];
200
- /** `0` when the node is hidden from `svg` or its primitive declares no `metrics.svgHeight`. */
201
- estimateSvgHeight(node: PrimitiveNode): number;
205
+ /** `0` when the node is hidden from `snapshot` or its primitive declares no `metrics.snapshotHeight`. */
206
+ estimateSnapshotHeight(node: PrimitiveNode): number;
202
207
  /** Appends schema failures under `path` to `errors`, each naming `node`'s type. */
203
208
  validate(node: PrimitiveNode, path: string, errors: ValidationError[]): void;
204
209
  }
@@ -215,15 +220,17 @@ export type Renderer<TNode extends PrimitiveNode, S extends SurfaceName, T exten
215
220
  *
216
221
  * Only `slack`, and even that stays optional per primitive: the dispatcher
217
222
  * converts the mandatory markdown to Block Kit, so a missing Slack renderer
218
- * degrades rather than disappearing. `svg` is not here because no primitive
223
+ * degrades rather than disappearing. `snapshot` is not here because no primitive
219
224
  * implements it — the surface reuses `react`.
220
225
  */
221
- export type OptionalSurface = Extract<SurfaceName, 'slack'>;
226
+ export declare const OPTIONAL_SURFACES: readonly ["slack"];
227
+ /** One of the {@link OPTIONAL_SURFACES}. */
228
+ export type OptionalSurface = (typeof OPTIONAL_SURFACES)[number];
222
229
  /**
223
230
  * One renderer per surface a primitive implements.
224
231
  *
225
232
  * `react`, `text`, and `markdown` are always required: those three are what
226
- * make "every composition degrades" true. `react` serves the `svg` surface
233
+ * make "every composition degrades" true. `react` serves the `snapshot` surface
227
234
  * too, so targeting images costs a primitive nothing.
228
235
  *
229
236
  * `slack` is declared method-style deliberately: method parameters are checked
@@ -241,7 +248,7 @@ export interface Renderers<TNode extends PrimitiveNode, T extends PackTypes = De
241
248
  }): string;
242
249
  markdown(node: TNode, env: {
243
250
  scope: RenderScope<T>;
244
- }): string | MarkdownContent;
251
+ }): MarkdownContent;
245
252
  slack?(node: TNode, env: {
246
253
  collector?: T['slackCollector'];
247
254
  scope: RenderScope<T>;
@@ -250,12 +257,12 @@ export interface Renderers<TNode extends PrimitiveNode, T extends PackTypes = De
250
257
  /**
251
258
  * Measurements a frame can ask of a node before drawing it.
252
259
  *
253
- * `svgHeight` is optional, so a frame that sums node heights sizes short when
254
- * it is missing — the missing `svgHeight` validation warning reports the gap.
260
+ * `snapshotHeight` is optional. The height estimate is `0` when it is missing, so
261
+ * a frame that sums node heights sizes short.
255
262
  */
256
263
  export interface PrimitiveMetrics<TNode extends PrimitiveNode> {
257
264
  /** The node's drawn height in pixels at the frame's width. */
258
- svgHeight?: (node: TNode) => number;
265
+ snapshotHeight?: (node: TNode) => number;
259
266
  }
260
267
  /**
261
268
  * Every primitive's schema is an object schema, because {@link definePrimitive}
@@ -292,8 +299,14 @@ export interface PrimitiveDefinition<TNode extends PrimitiveNode, T extends Pack
292
299
  type: TNode['type'];
293
300
  /** How the authoring prompt describes this primitive to the model. */
294
301
  catalog: PrimitiveCatalogEntry;
295
- /** Driven by the conformance harness. The catalog `example` is what the prompt shows. */
296
- examples: readonly TNode[];
302
+ /** Host-facing glyph, never shown to the model. Absent means the host supplies its own. */
303
+ icon?: PrimitiveIcon;
304
+ /**
305
+ * Driven by the conformance harness, bare or named; read them with
306
+ * `exampleNodes` or `primitiveExamples`. The catalog `example` is what the
307
+ * prompt shows.
308
+ */
309
+ examples: readonly (TNode | PrimitiveExample<TNode>)[];
297
310
  /**
298
311
  * This primitive on its own. A container declares
299
312
  * {@link PrimitiveDefinition.schemaFor} as well, and uses
@@ -310,7 +323,7 @@ export interface PrimitiveDefinition<TNode extends PrimitiveNode, T extends Pack
310
323
  * exactly one union.
311
324
  */
312
325
  schemaFor?: (bodyNodeSchema: ZodType<unknown>) => PrimitiveSchema;
313
- /** One function per surface; `react` serves `svg` as well. */
326
+ /** One function per surface; `react` serves `snapshot` as well. */
314
327
  renderers: Renderers<TNode, T>;
315
328
  /** Sizing a frame can ask for before drawing. Absent means it cannot be measured. */
316
329
  metrics?: PrimitiveMetrics<TNode>;
@@ -353,12 +366,13 @@ export interface PrimitiveDefinition<TNode extends PrimitiveNode, T extends Pack
353
366
  export interface AnyPrimitiveDefinition {
354
367
  type: string;
355
368
  catalog: PrimitiveCatalogEntry;
356
- examples: readonly PrimitiveNode[];
369
+ icon?: PrimitiveIcon;
370
+ examples: readonly (PrimitiveNode | PrimitiveExample)[];
357
371
  schema: PrimitiveSchema;
358
372
  schemaFor?: (bodyNodeSchema: ZodType<unknown>) => PrimitiveSchema;
359
373
  renderers: Record<'react' | 'text' | 'markdown', unknown> & Partial<Record<'slack', unknown>>;
360
374
  metrics?: {
361
- svgHeight?: unknown;
375
+ snapshotHeight?: unknown;
362
376
  };
363
377
  sanitize?: unknown;
364
378
  children?: unknown;
@@ -372,7 +386,7 @@ export declare const bodyNodeIdSchema: z.ZodString;
372
386
  /** The `surfaces` allowlist on a node. Absent means every surface; empty is rejected. */
373
387
  export declare const bodyNodeSurfacesSchema: z.ZodArray<z.ZodEnum<{
374
388
  react: "react";
375
- svg: "svg";
389
+ snapshot: "snapshot";
376
390
  text: "text";
377
391
  markdown: "markdown";
378
392
  slack: "slack";
@@ -1 +1 @@
1
- {"version":3,"file":"primitive_module.d.ts","sourceRoot":"","sources":["../../src/define/primitive_module.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,CAAC,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,KAAK,CAAC;AAEtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,WAAW,EACjB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,C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AC,OAAO,sBAAsB,CAAC,QAAQ,CAAC,CAAC;CAC9D,CACF,GACD,eAAe,CAAC"}
@@ -5,10 +5,21 @@
5
5
  * 2.0.
6
6
  */
7
7
  import { z } from 'zod';
8
- import { BODY_NODE_SURFACES, } from '../composition/body_node_base.js';
8
+ import { SURFACE_NAMES, } from '../composition/body_node_base.js';
9
9
  import { ISOMER_ERROR_CODES, IsomerError } from '../composition/error.js';
10
10
  import { formatZodIssues, oneOf } from './zod_format.js';
11
11
  import { requiredString } from './zod_helpers.js';
12
+ /**
13
+ * The surface a pack may declare beyond the mandatory three.
14
+ *
15
+ * Only `slack`, and even that stays optional per primitive: the dispatcher
16
+ * converts the mandatory markdown to Block Kit, so a missing Slack renderer
17
+ * degrades rather than disappearing. `snapshot` is not here because no primitive
18
+ * implements it — the surface reuses `react`.
19
+ */
20
+ export const OPTIONAL_SURFACES = [
21
+ 'slack',
22
+ ];
12
23
  /** Parses `node` against `schema`, appending path-prefixed messages to `errors`. */
13
24
  export const validateWithSchema = (schema, node, path, errors) => {
14
25
  const result = schema.safeParse(node, { reportInput: true });
@@ -20,8 +31,8 @@ export const validateWithSchema = (schema, node, path, errors) => {
20
31
  export const bodyNodeIdSchema = requiredString('must be a non-empty string');
21
32
  /** The `surfaces` allowlist on a node. Absent means every surface; empty is rejected. */
22
33
  export const bodyNodeSurfacesSchema = z
23
- .array(z.enum(BODY_NODE_SURFACES, {
24
- error: () => oneOf(BODY_NODE_SURFACES),
34
+ .array(z.enum(SURFACE_NAMES, {
35
+ error: () => oneOf(SURFACE_NAMES),
25
36
  }))
26
37
  .min(1, { error: 'must contain at least one surface' });
27
38
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"primitive_module.js","sourceRoot":"","sources":["../../src/define/primitive_module.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,CAAC,EAAgC,MAAM,KAAK,CAAC;AAGtD,OAAO,EACL,kBAAkB,GAGnB,MAAM,+BAA+B,CAAC;AACv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,SAAS,CAAC;IAC1B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CACrB,MAAe,EACU,EAAE;IAC3B,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,CAC5C,CAAC,KAAK,EAAE,EAAE,CACR,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAC1E,CAAC;IACF,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,IAAI,WAAW,CACnB,kBAAkB,CAAC,mBAAmB,EACtC,wDAAwD,QAAQ,6BAA6B,CAC9F,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC5C,OAAO,CACL,MAAM,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,CACtC,CAAC;AAC/B,CAAC,CAAC","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nimport type { ReactNode } from 'react';\nimport { z, type ZodObject, type ZodType } from 'zod';\n\nimport type { ActionEventRef } from '../composition/action_event';\nimport {\n BODY_NODE_SURFACES,\n type ChildNodeRef,\n type SurfaceName,\n} from '../composition/body_node_base';\nimport { ISOMER_ERROR_CODES, IsomerError } from '../composition/error';\nimport type { PrimitiveNode } from '../composition/node';\nimport type { ValidationError } from '../composition/validation_error';\n\nimport type { MarkdownContent } from './markdown_content';\nimport type { SlackAssetCollector } from './slack_assets';\nimport type { SlackBlock } from './slack_blocks';\nimport { formatZodIssues, oneOf } from './zod_format';\nimport { requiredString } from './zod_helpers';\n\nexport type { PrimitiveNode };\n\n/**\n * A primitive's entry in the catalog the authoring prompt is built from.\n *\n * Written for the model rather than for a developer: `useWhen` and `avoidWhen`\n * are what steer it away from reaching for the wrong primitive.\n */\nexport interface PrimitiveCatalogEntry {\n type: string;\n /** One line on what the primitive is for, in the model's voice. */\n purpose: string;\n /** Situations that call for this primitive. Phrase each as a user intent, not a shape. */\n useWhen: string[];\n /** Situations that look like a fit but are not, naming the primitive to reach for instead. */\n avoidWhen: string[];\n /** A node literal the authoring prompt inlines under this primitive. */\n example: unknown;\n}\n\n/** A style a renderer asks for by name, resolved to a class by the host's adapter. */\nexport interface StyleHandle {\n /** Stable lookup key. The adapter's map is keyed on this. */\n key: string;\n /** Debug-facing label, which an adapter may fold into a generated class name. */\n readableName: string;\n}\n\n/** Dotted path into a pack's theme tokens, e.g. `colors.text.subdued`. */\nexport type ThemeTokenPath = string;\n\n/**\n * The sdk's own render context, and {@link DefaultPackTypes.context}.\n *\n * A pack with real theme tokens or a richer style-handle type declares its\n * own context in its {@link PackTypes}; {@link StyledRenderContext} is the\n * sdk's own extension. The bag is what lets a pack narrow without\n * re-declaring everything that mentions a context.\n */\nexport interface PrimitiveRenderContext {\n /**\n * The progressive enhancements this render may assume, by id. A set rather\n * than a field per feature so adding an enhancement costs no plumbing:\n * containers forward the whole context, and a renderer asks\n * `context.enhancements?.has('tableSort')`.\n *\n * Empty or absent is the baseline every host can render, so a renderer must\n * still answer the question on its own. See `docs/rendering.md`.\n */\n enhancements?: ReadonlySet<string>;\n /** Turns on `nodeAnchor` outside an HTML surface render, on the React and `svg` surfaces; inside one, the surface decides. */\n anchors?: boolean;\n /** Raises an interaction for the host to route. Absent means render non-interactively. */\n onEvent?: (event: ActionEventRef) => void;\n}\n\n/**\n * The render-context argument, optional only when omitting it is sound.\n *\n * The sdk's own {@link PrimitiveRenderContext} has no required field, so `{}`\n * is a complete value and a caller may leave it out. A pack that narrows the\n * context with a required member makes the argument mandatory.\n */\nexport type ReactContextArg<TContext> =\n Record<string, never> extends TContext\n ? [context?: TContext]\n : [context: TContext];\n\n/**\n * {@link PrimitiveRenderContext} plus the CSS-in-JS hooks an HTML style adapter\n * supplies. A pack that styles differently uses its own `TContext` instead.\n */\nexport interface StyledRenderContext extends PrimitiveRenderContext {\n /** Resolves handles to a `className`. Absent means the host supplies no styling. */\n resolveClassName?: (...handles: StyleHandle[]) => string;\n /** Resolves a theme token to a CSS variable reference. Absent means inline the literal value. */\n cssVarRef?: (path: ThemeTokenPath) => `var(--${string})`;\n}\n\n/** Passed to a primitive's style collector so it can vary CSS by layout mode. */\nexport interface PrimitiveStyleCollectionContext {\n /** The render fills its container rather than sitting at a fixed width. */\n fluid?: boolean;\n}\n\n/** A pack's collected styles, opaque to the SDK. */\nexport type PrimitiveStyleCollector = object;\n\n/**\n * The types a pack binds once and writes every primitive against: the palette\n * its frames supply, the context its `react` renderers receive, the collector\n * its `collectStyles` hooks mutate, and the Slack payload and collector types.\n *\n * Extend {@link DefaultPackTypes} and narrow only what the pack needs:\n *\n * ```ts\n * interface SlidesPackTypes extends DefaultPackTypes {\n * theme: SlideTheme;\n * context: SlideRenderContext;\n * }\n * ```\n */\nexport interface PackTypes {\n theme: unknown;\n context: unknown;\n collector: PrimitiveStyleCollector;\n slackBlock: unknown;\n slackCollector: unknown;\n}\n\n/** {@link PackTypes} as the sdk itself binds them, and the default everywhere. */\nexport interface DefaultPackTypes extends PackTypes {\n theme: unknown;\n context: PrimitiveRenderContext;\n collector: PrimitiveStyleCollector;\n slackBlock: SlackBlock;\n slackCollector: SlackAssetCollector;\n}\n\n/**\n * Each surface's renderer signature: the env bag it receives beyond the node,\n * and what it returns.\n *\n * Written out per surface rather than derived through an indexed access. A bag\n * is additive: a new extra on a surface is not an arity break. {@link Renderer}\n * indexes this table for the dispatcher cast; {@link Renderers} does not.\n */\nexport interface SurfaceMap<T extends PackTypes = DefaultPackTypes> {\n react: {\n env: {\n context: T['context'];\n scope: RenderScope<T>;\n /**\n * The frame's resolved palette, when this render is reached through the\n * `svg` surface. A bare `react`/`html` render has no {@link Frame} to\n * resolve one from, so it is absent there — a pack that needs a\n * literal color outside `svg` still goes through `context`.\n */\n theme?: T['theme'];\n };\n output: ReactNode;\n };\n /**\n * Identical to `react`, and served by the same renderer: an image backend\n * lays out the pack's DOM tree and stylesheet rather than a second tree\n * authored for it. The surface stays separate so a node can be hidden from\n * images alone, and so a {@link Frame} has something to draw inside.\n */\n svg: {\n env: {\n context: T['context'];\n scope: RenderScope<T>;\n /** The frame's resolved palette for this render's mode; see `react.env.theme`. */\n theme?: T['theme'];\n };\n output: ReactNode;\n };\n text: {\n env: {\n scope: RenderScope<T>;\n };\n output: string;\n };\n /** A string is printed as written; content from `md` is escaped where it lands. */\n markdown: {\n env: {\n scope: RenderScope<T>;\n };\n output: string | MarkdownContent;\n };\n /**\n * Returns one payload or several, so a primitive need not wrap a single\n * payload in an array.\n */\n slack: {\n env: {\n collector?: T['slackCollector'];\n scope: RenderScope<T>;\n };\n output: T['slackBlock'] | readonly T['slackBlock'][];\n };\n}\n\n/**\n * The dispatcher a renderer is given so a container can recurse into a child\n * owned by another pack. Erased to {@link PrimitiveNode}: a heterogeneous\n * inventory has no single node type to name.\n *\n * Passed as `scope` on every renderer's env bag. The dispatcher's own named\n * methods stay positional.\n */\nexport interface RenderScope<T extends PackTypes = DefaultPackTypes> {\n readonly definitions: readonly AnyPrimitiveDefinition[];\n /** Throws for an unknown node type; a missing primitive is a bug, not a degradation. */\n getDefinition(node: PrimitiveNode): AnyPrimitiveDefinition;\n /** `undefined` when the node is hidden from `surface`, `sanitize` drops it, or its primitive declares no renderer for `surface`. */\n renderOn<S extends SurfaceName>(\n surface: S,\n node: PrimitiveNode,\n extras: Omit<SurfaceMap<T>[S]['env'], 'scope'>\n ): SurfaceMap<T>[S]['output'] | undefined;\n renderReact(node: PrimitiveNode, context?: T['context']): ReactNode;\n collectStyles(\n node: PrimitiveNode,\n styles: PrimitiveStyleCollector,\n context: PrimitiveStyleCollectionContext\n ): void;\n renderText(node: PrimitiveNode): string;\n renderMarkdown(node: PrimitiveNode): string;\n /** A child as content, for a container building with `md`; a string result is printed as written. */\n renderMarkdownContent(node: PrimitiveNode): MarkdownContent;\n /** Empty when the node is hidden from `slack`, `sanitize` drops it, or its renderer returns nothing; a node with no `slack` renderer degrades through its markdown. */\n renderSlack(\n node: PrimitiveNode,\n collector?: T['slackCollector']\n ): readonly T['slackBlock'][];\n /** `0` when the node is hidden from `svg` or its primitive declares no `metrics.svgHeight`. */\n estimateSvgHeight(node: PrimitiveNode): number;\n /** Appends schema failures under `path` to `errors`, each naming `node`'s type. */\n validate(node: PrimitiveNode, path: string, errors: ValidationError[]): void;\n}\n\n/**\n * One surface's renderer for one node type, per {@link SurfaceMap}.\n *\n * Indexes the env bag. Do not use this to type the renderers map: the\n * written-out signatures on {@link Renderers} are what keep the bags checked\n * per surface.\n */\nexport type Renderer<\n TNode extends PrimitiveNode,\n S extends SurfaceName,\n T extends PackTypes = DefaultPackTypes,\n> = (node: TNode, env: SurfaceMap<T>[S]['env']) => SurfaceMap<T>[S]['output'];\n\n/**\n * The surface a pack may declare beyond the mandatory three.\n *\n * Only `slack`, and even that stays optional per primitive: the dispatcher\n * converts the mandatory markdown to Block Kit, so a missing Slack renderer\n * degrades rather than disappearing. `svg` is not here because no primitive\n * implements it — the surface reuses `react`.\n */\nexport type OptionalSurface = Extract<SurfaceName, 'slack'>;\n\n/**\n * One renderer per surface a primitive implements.\n *\n * `react`, `text`, and `markdown` are always required: those three are what\n * make \"every composition degrades\" true. `react` serves the `svg` surface\n * too, so targeting images costs a primitive nothing.\n *\n * `slack` is declared method-style deliberately: method parameters are checked\n * bivariantly, which is what lets a pack narrow the collector's node type.\n */\nexport interface Renderers<\n TNode extends PrimitiveNode,\n T extends PackTypes = DefaultPackTypes,\n> {\n react(\n node: TNode,\n env: {\n context: T['context'];\n scope: RenderScope<T>;\n /** See {@link SurfaceMap.react}'s `env.theme`. */\n theme?: T['theme'];\n }\n ): ReactNode;\n text(\n node: TNode,\n env: {\n scope: RenderScope<T>;\n }\n ): string;\n markdown(\n node: TNode,\n env: {\n scope: RenderScope<T>;\n }\n ): string | MarkdownContent;\n slack?(\n node: TNode,\n env: {\n collector?: T['slackCollector'];\n scope: RenderScope<T>;\n }\n ): T['slackBlock'] | readonly T['slackBlock'][];\n}\n\n/**\n * Measurements a frame can ask of a node before drawing it.\n *\n * `svgHeight` is optional, so a frame that sums node heights sizes short when\n * it is missing — the missing `svgHeight` validation warning reports the gap.\n */\nexport interface PrimitiveMetrics<TNode extends PrimitiveNode> {\n /** The node's drawn height in pixels at the frame's width. */\n svgHeight?: (node: TNode) => number;\n}\n\n/**\n * Every primitive's schema is an object schema, because {@link definePrimitive}\n * extends it with `id` and `surfaces` and the composition builds a\n * `z.discriminatedUnion('type', …)` over them. Typed as `ZodObject` rather\n * than `ZodType<unknown>` so a union or intersection schema is a compile\n * error at the definition, not a runtime failure at the first `.extend()`.\n * Zod 4 types `z.object().superRefine(…)` as a `ZodObject` and preserves the\n * refinement through `.extend()`, so top-level refinements are unaffected.\n */\nexport type PrimitiveSchema = ZodObject;\n\n/**\n * The child-ref shape a primitive definition's own `children` returns.\n *\n * {@link ChildNodeRef} stays erased (`node: unknown`) because\n * `createChildNodeWalker` mixes children from every primitive type in the\n * runtime into one map and cannot name a single node type for them. A single\n * definition has no such excuse: its `children` should not type-check\n * against `unknown` and let something that is not a {@link PrimitiveNode} —\n * `null`, for instance — silently disappear from every tree walk.\n */\nexport interface PrimitiveChildRef extends ChildNodeRef {\n node: PrimitiveNode;\n}\n\n/**\n * One primitive: its node type, schema, catalog entry, and a renderer per\n * surface. The unit of vocabulary, and what {@link definePrimitive} takes.\n *\n * `T` is the pack's {@link PackTypes}, bound once with\n * {@link definePrimitiveFor} so each primitive names only `TNode`.\n */\nexport interface PrimitiveDefinition<\n TNode extends PrimitiveNode,\n T extends PackTypes = DefaultPackTypes,\n TSchema extends PrimitiveSchema = PrimitiveSchema,\n> {\n /** The node's discriminant, and the key this primitive occupies in an inventory. */\n type: TNode['type'];\n /** How the authoring prompt describes this primitive to the model. */\n catalog: PrimitiveCatalogEntry;\n /** Driven by the conformance harness. The catalog `example` is what the prompt shows. */\n examples: readonly TNode[];\n /**\n * This primitive on its own. A container declares\n * {@link PrimitiveDefinition.schemaFor} as well, and uses\n * {@link unresolvedBodyNodeSchema} in the child slot here.\n */\n schema: TSchema;\n /**\n * A container's schema, bound to the body-node union of the composition it is\n * being built into.\n *\n * Declaring the shape and letting each composition supply its own union is\n * what lets one primitive appear in two runtimes with different inventories:\n * `z.lazy` memoizes per instance, and an instance built here belongs to\n * exactly one union.\n */\n schemaFor?: (bodyNodeSchema: ZodType<unknown>) => PrimitiveSchema;\n /** One function per surface; `react` serves `svg` as well. */\n renderers: Renderers<TNode, T>;\n /** Sizing a frame can ask for before drawing. Absent means it cannot be measured. */\n metrics?: PrimitiveMetrics<TNode>;\n /**\n * Render-time URL trust, the second of the two layers in `validate/url.ts`.\n *\n * Returning `null` drops the node. Applied even to an unvalidated node, so a\n * renderer invoked directly still cannot emit an unsafe URL.\n */\n sanitize?: (node: TNode) => TNode | null;\n /**\n * Nested nodes, for containers, in the order the `react` renderer draws\n * them; `findNodeElementPairs` relies on it. Absent means a leaf.\n */\n children?: (node: TNode) => readonly PrimitiveChildRef[];\n /**\n * True when this node produces surface output of its own, not only via\n * {@link PrimitiveDefinition.children}. A non-empty `children` result is\n * otherwise the complete source of rendered content, so a hybrid container\n * that still owns string fields returns true to keep rendering when every\n * nested node is hidden from the surface.\n */\n hasOwnContent?: (node: TNode) => boolean;\n /** Contributes this node's CSS by mutating `styles`, once per node per render. */\n collectStyles?: (\n node: TNode,\n env: { styles: T['collector']; context: PrimitiveStyleCollectionContext }\n ) => void;\n}\n\n/**\n * {@link PrimitiveDefinition} with every type parameter erased, and the form an\n * inventory is stored in.\n *\n * A heterogeneous pack has no single `TNode` to be generic over, so the\n * renderers degrade to `unknown` here.\n *\n * Each field carries the same contract as its {@link PrimitiveDefinition}\n * counterpart; only the types are erased.\n */\nexport interface AnyPrimitiveDefinition {\n type: string;\n catalog: PrimitiveCatalogEntry;\n examples: readonly PrimitiveNode[];\n schema: PrimitiveSchema;\n schemaFor?: (bodyNodeSchema: ZodType<unknown>) => PrimitiveSchema;\n renderers: Record<'react' | 'text' | 'markdown', unknown> &\n Partial<Record<'slack', unknown>>;\n metrics?: {\n svgHeight?: unknown;\n };\n sanitize?: unknown;\n children?: unknown;\n hasOwnContent?: unknown;\n collectStyles?: unknown;\n}\n\n/** Parses `node` against `schema`, appending path-prefixed messages to `errors`. */\nexport const validateWithSchema = (\n schema: PrimitiveSchema,\n node: unknown,\n path: string,\n errors: ValidationError[]\n): void => {\n const result = schema.safeParse(node, { reportInput: true });\n if (!result.success) {\n errors.push(...formatZodIssues(result.error.issues, path));\n }\n};\n\n/** The `id` every node may carry, unique within a composition. */\nexport const bodyNodeIdSchema = requiredString('must be a non-empty string');\n\n/** The `surfaces` allowlist on a node. Absent means every surface; empty is rejected. */\nexport const bodyNodeSurfacesSchema = z\n .array(\n z.enum(BODY_NODE_SURFACES as [SurfaceName, ...SurfaceName[]], {\n error: () => oneOf(BODY_NODE_SURFACES),\n })\n )\n .min(1, { error: 'must contain at least one surface' });\n\n/**\n * The child slot in a container's standalone {@link PrimitiveDefinition.schema},\n * where no body-node union is available.\n *\n * Deliberately permissive rather than `z.unknown()`: it still rejects a child\n * that is not a node at all, which is the error worth catching without an\n * inventory. Anything that depends on *which* types are legal — the validator,\n * the parser, the JSON Schema projection — goes through\n * {@link PrimitiveDefinition.schemaFor} and sees the real union.\n */\nexport const unresolvedBodyNodeSchema = z.looseObject({\n type: requiredString('must be a non-empty string'),\n});\n\n/**\n * Declares one primitive, extending its schema with the `id` and `surfaces`\n * fields every node carries, and closing it to unknown keys so a node is held\n * to the same rule as the composition root and the JSON Schema an agent reads.\n * A schema with its own catchall (`z.looseObject`) keeps it.\n *\n * A pack normally calls the form {@link definePrimitiveFor} binds to its own\n * {@link PackTypes}, so each primitive names only `TNode`.\n */\nexport const definePrimitive = <\n TNode extends PrimitiveNode,\n T extends PackTypes = DefaultPackTypes,\n TSchema extends PrimitiveSchema = PrimitiveSchema,\n>(\n definition: PrimitiveDefinition<TNode, T, TSchema>\n): PrimitiveDefinition<TNode, T, WithNodeFields<TSchema>> => {\n const { schemaFor } = definition;\n return {\n ...definition,\n schema: withNodeFields(definition.schema),\n // Both forms get the node fields, or a container would accept `id` and\n // `surfaces` standalone and reject them inside a composition.\n ...(schemaFor\n ? {\n schemaFor: (bodyNodeSchema: ZodType<unknown>) =>\n withNodeFields(schemaFor(bodyNodeSchema)),\n }\n : {}),\n };\n};\n\n/**\n * {@link definePrimitive} bound to one pack's {@link PackTypes}.\n *\n * ```ts\n * const define = definePrimitiveFor<SlidesPackTypes>();\n * export const note = define({ type: 'note', … });\n * ```\n */\nexport const definePrimitiveFor =\n <T extends PackTypes>() =>\n <\n TNode extends PrimitiveNode,\n TSchema extends PrimitiveSchema = PrimitiveSchema,\n >(\n definition: PrimitiveDefinition<TNode, T, TSchema>\n ): PrimitiveDefinition<TNode, T, WithNodeFields<TSchema>> =>\n definePrimitive<TNode, T, TSchema>(definition);\n\n/**\n * `.extend()` on a generic `ZodObject` widens the shape to `any`, so the\n * return type is rebuilt from `TSchema`'s shape. The brand on a field schema\n * stays on that same object at runtime.\n */\nexport type WithNodeFields<TSchema extends PrimitiveSchema> =\n TSchema extends ZodObject<infer Shape>\n ? ZodObject<\n Shape & {\n id: ReturnType<typeof bodyNodeIdSchema.optional>;\n surfaces: ReturnType<typeof bodyNodeSurfacesSchema.optional>;\n }\n >\n : PrimitiveSchema;\n\n// Marks the field schemas `definePrimitive` adds. A schema derived from a\n// defined one shares them by reference, and `Symbol.for` matches across ESM and\n// CommonJS copies of the SDK.\nconst NODE_FIELD = Symbol.for('elastic.isomer.node_field');\n\nconst nodeField = <T extends ZodType>(schema: T): T =>\n Object.defineProperty(schema, NODE_FIELD, { value: true });\n\nconst NODE_FIELDS = {\n id: nodeField(bodyNodeIdSchema.optional()),\n surfaces: nodeField(bodyNodeSurfacesSchema.optional()),\n};\n\nconst isNodeField = (schema: unknown): boolean => {\n let current = schema;\n while (current && typeof current === 'object') {\n if (Object.hasOwn(current, NODE_FIELD)) return true;\n const { def } = current as {\n def?: { type?: string; innerType?: unknown };\n };\n if (def?.type !== 'optional') return false;\n current = def.innerType;\n }\n return false;\n};\n\nconst withNodeFields = <TSchema extends PrimitiveSchema>(\n schema: TSchema\n): WithNodeFields<TSchema> => {\n const reserved = Object.keys(NODE_FIELDS).find(\n (field) =>\n Object.hasOwn(schema.shape, field) && !isNodeField(schema.shape[field])\n );\n if (reserved) {\n throw new IsomerError(\n ISOMER_ERROR_CODES.RESERVED_NODE_FIELD,\n `definePrimitive: a primitive schema cannot declare \\`${reserved}\\`; every body node has it.`\n );\n }\n const extended = schema.extend(NODE_FIELDS);\n return (\n schema.def.catchall === undefined ? extended.strict() : extended\n ) as WithNodeFields<TSchema>;\n};\n"]}
1
+ {"version":3,"file":"primitive_module.js","sourceRoot":"","sources":["../../src/define/primitive_module.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,CAAC,EAAgC,MAAM,KAAK,CAAC;AAGtD,OAAO,EAEL,aAAa,GAEd,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AASvE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAgP/C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO;CACkC,CAAC;AAwL5C,oFAAoF;AACpF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,MAAuB,EACvB,IAAa,EACb,IAAY,EACZ,MAAyB,EACnB,EAAE;IACR,MAAM,MAAM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MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAC1E,CAAC;IACF,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,IAAI,WAAW,CACnB,kBAAkB,CAAC,mBAAmB,EACtC,wDAAwD,QAAQ,6BAA6B,CAC9F,CAAC;IACJ,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC5C,OAAO,CACL,MAAM,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,QAAQ,CACtC,CAAC;AAC/B,CAAC,CAAC","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nimport type { ReactNode } from 'react';\nimport { z, type ZodObject, type ZodType } from 'zod';\n\nimport type { ActionEventRef } from '../composition/action_event';\nimport {\n type ChildNodeRef,\n SURFACE_NAMES,\n type SurfaceName,\n} from '../composition/body_node_base';\nimport { ISOMER_ERROR_CODES, IsomerError } from '../composition/error';\nimport type { PrimitiveNode } from '../composition/node';\nimport type { ValidationError } from '../composition/validation_error';\n\nimport type { MarkdownContent } from './markdown_content';\nimport type { PrimitiveExample } from './primitive_example';\nimport type { PrimitiveIcon } from './primitive_icon';\nimport type { SlackAssetCollector } from './slack_assets';\nimport type { SlackBlock } from './slack_blocks';\nimport { formatZodIssues, oneOf } from './zod_format';\nimport { requiredString } from './zod_helpers';\n\nexport type { PrimitiveNode };\n\n/**\n * A primitive's entry in the catalog the authoring prompt is built from.\n *\n * Written for the model rather than for a developer: `useWhen` and `avoidWhen`\n * are what steer it away from reaching for the wrong primitive. `name` is the\n * one host-facing field, and the prompt never prints it.\n */\nexport interface PrimitiveCatalogEntry {\n type: string;\n /** Short name a host shows for the primitive, e.g. `Stat group`. Absent means the host derives one from `type`. */\n name?: string;\n /** One line on what the primitive is for, in the model's voice. */\n purpose: string;\n /** Situations that call for this primitive. Phrase each as a user intent, not a shape. */\n useWhen: string[];\n /** Situations that look like a fit but are not, naming the primitive to reach for instead. */\n avoidWhen: string[];\n /** A node literal the authoring prompt inlines under this primitive. */\n example: unknown;\n}\n\n/** A style a renderer asks for by name, resolved to a class by the host's adapter. */\nexport interface StyleHandle {\n /** Stable lookup key. The adapter's map is keyed on this. */\n key: string;\n /** Debug-facing label, which an adapter may fold into a generated class name. */\n readableName: string;\n}\n\n/** Dotted path into a pack's theme tokens, e.g. `colors.text.subdued`. */\nexport type ThemeTokenPath = string;\n\n/**\n * The sdk's own render context, and {@link DefaultPackTypes.context}.\n *\n * A pack with real theme tokens or a richer style-handle type declares its\n * own context in its {@link PackTypes}; {@link StyledRenderContext} is the\n * sdk's own extension. The bag is what lets a pack narrow without\n * re-declaring everything that mentions a context.\n */\nexport interface PrimitiveRenderContext {\n /**\n * The progressive enhancements this render may assume, by id. A set rather\n * than a field per feature so adding an enhancement costs no plumbing:\n * containers forward the whole context, and a renderer asks\n * `context.enhancements?.has('tableSort')`.\n *\n * Empty or absent is the baseline every host can render, so a renderer must\n * still answer the question on its own. See `docs/rendering.md`.\n */\n enhancements?: ReadonlySet<string>;\n /** Turns on `nodeAnchor` outside an HTML surface render, on the React and `snapshot` surfaces; inside one, the surface decides. */\n anchors?: boolean;\n /** Raises an interaction for the host to route. Absent means render non-interactively. */\n onEvent?: (event: ActionEventRef) => void;\n}\n\n/**\n * The render-context argument, optional only when omitting it is sound.\n *\n * The sdk's own {@link PrimitiveRenderContext} has no required field, so `{}`\n * is a complete value and a caller may leave it out. A pack that narrows the\n * context with a required member makes the argument mandatory.\n */\nexport type ReactContextArg<TContext> =\n Record<string, never> extends TContext\n ? [context?: TContext]\n : [context: TContext];\n\n/**\n * {@link PrimitiveRenderContext} plus the CSS-in-JS hooks an HTML style adapter\n * supplies. A pack that styles differently uses its own `TContext` instead.\n */\nexport interface StyledRenderContext extends PrimitiveRenderContext {\n /** Resolves handles to a `className`. Absent means the host supplies no styling. */\n resolveClassName?: (...handles: StyleHandle[]) => string;\n /** Resolves a theme token to a CSS variable reference. Absent means inline the literal value. */\n cssVarRef?: (path: ThemeTokenPath) => `var(--${string})`;\n}\n\n/** Passed to a primitive's style collector so it can vary CSS by layout mode. */\nexport interface PrimitiveStyleCollectionContext {\n /** The render fills its container rather than sitting at a fixed width. */\n fluid?: boolean;\n}\n\n/** A pack's collected styles, opaque to the SDK. */\nexport type PrimitiveStyleCollector = object;\n\n/**\n * The types a pack binds once and writes every primitive against: the palette\n * its frames supply, the context its `react` renderers receive, the collector\n * its `collectStyles` hooks mutate, and the Slack payload and collector types.\n *\n * Extend {@link DefaultPackTypes} and narrow only what the pack needs:\n *\n * ```ts\n * interface SlidesPackTypes extends DefaultPackTypes {\n * theme: SlideTheme;\n * context: SlideRenderContext;\n * }\n * ```\n */\nexport interface PackTypes {\n theme: unknown;\n context: unknown;\n collector: PrimitiveStyleCollector;\n slackBlock: unknown;\n slackCollector: unknown;\n}\n\n/** {@link PackTypes} as the sdk itself binds them, and the default everywhere. */\nexport interface DefaultPackTypes extends PackTypes {\n theme: unknown;\n context: PrimitiveRenderContext;\n collector: PrimitiveStyleCollector;\n slackBlock: SlackBlock;\n slackCollector: SlackAssetCollector;\n}\n\n/**\n * Each surface's renderer signature: the env bag it receives beyond the node,\n * and what it returns.\n *\n * Written out per surface rather than derived through an indexed access. A bag\n * is additive: a new extra on a surface is not an arity break. {@link Renderer}\n * indexes this table for the dispatcher cast; {@link Renderers} does not.\n */\nexport interface SurfaceMap<T extends PackTypes = DefaultPackTypes> {\n react: {\n env: {\n context: T['context'];\n scope: RenderScope<T>;\n /**\n * The frame's resolved palette, when this render is reached through the\n * `snapshot` surface. A bare `react`/`html` render has no {@link Frame} to\n * resolve one from, so it is absent there — a pack that needs a\n * literal color outside `snapshot` still goes through `context`.\n */\n theme?: T['theme'];\n };\n output: ReactNode;\n };\n /**\n * Identical to `react`, and served by the same renderer: an image backend\n * lays out the pack's DOM tree and stylesheet rather than a second tree\n * authored for it. The surface stays separate so a node can be hidden from\n * snapshots alone, and so a {@link Frame} has something to draw inside.\n */\n snapshot: {\n env: {\n context: T['context'];\n scope: RenderScope<T>;\n /** The frame's resolved palette for this render's mode; see `react.env.theme`. */\n theme?: T['theme'];\n };\n output: ReactNode;\n };\n text: {\n env: {\n scope: RenderScope<T>;\n };\n output: string;\n };\n /** Content built with `md`, escaped where it lands; authored Markdown source goes through `md.authored`. */\n markdown: {\n env: {\n scope: RenderScope<T>;\n };\n output: MarkdownContent;\n };\n /**\n * Returns one payload or several, so a primitive need not wrap a single\n * payload in an array.\n */\n slack: {\n env: {\n collector?: T['slackCollector'];\n scope: RenderScope<T>;\n };\n output: T['slackBlock'] | readonly T['slackBlock'][];\n };\n}\n\n/**\n * The dispatcher a renderer is given so a container can recurse into a child\n * owned by another pack. Erased to {@link PrimitiveNode}: a heterogeneous\n * inventory has no single node type to name.\n *\n * Passed as `scope` on every renderer's env bag. The dispatcher's own named\n * methods stay positional.\n */\nexport interface RenderScope<T extends PackTypes = DefaultPackTypes> {\n readonly definitions: readonly AnyPrimitiveDefinition[];\n /** Throws for an unknown node type; a missing primitive is a bug, not a degradation. */\n getDefinition(node: PrimitiveNode): AnyPrimitiveDefinition;\n /** `undefined` when the node is hidden from `surface`, `sanitize` drops it, or its primitive declares no renderer for `surface`. */\n renderOn<S extends SurfaceName>(\n surface: S,\n node: PrimitiveNode,\n extras: Omit<SurfaceMap<T>[S]['env'], 'scope'>\n ): SurfaceMap<T>[S]['output'] | undefined;\n renderReact(node: PrimitiveNode, context?: T['context']): ReactNode;\n collectStyles(\n node: PrimitiveNode,\n styles: PrimitiveStyleCollector,\n context: PrimitiveStyleCollectionContext\n ): void;\n renderText(node: PrimitiveNode): string;\n renderMarkdown(node: PrimitiveNode): string;\n /** A child as content, for a container building with `md`. */\n renderMarkdownContent(node: PrimitiveNode): MarkdownContent;\n /** Empty when the node is hidden from `slack`, `sanitize` drops it, or its renderer returns nothing; a node with no `slack` renderer degrades through its markdown. */\n renderSlack(\n node: PrimitiveNode,\n collector?: T['slackCollector']\n ): readonly T['slackBlock'][];\n /** `0` when the node is hidden from `snapshot` or its primitive declares no `metrics.snapshotHeight`. */\n estimateSnapshotHeight(node: PrimitiveNode): number;\n /** Appends schema failures under `path` to `errors`, each naming `node`'s type. */\n validate(node: PrimitiveNode, path: string, errors: ValidationError[]): void;\n}\n\n/**\n * One surface's renderer for one node type, per {@link SurfaceMap}.\n *\n * Indexes the env bag. Do not use this to type the renderers map: the\n * written-out signatures on {@link Renderers} are what keep the bags checked\n * per surface.\n */\nexport type Renderer<\n TNode extends PrimitiveNode,\n S extends SurfaceName,\n T extends PackTypes = DefaultPackTypes,\n> = (node: TNode, env: SurfaceMap<T>[S]['env']) => SurfaceMap<T>[S]['output'];\n\n/**\n * The surface a pack may declare beyond the mandatory three.\n *\n * Only `slack`, and even that stays optional per primitive: the dispatcher\n * converts the mandatory markdown to Block Kit, so a missing Slack renderer\n * degrades rather than disappearing. `snapshot` is not here because no primitive\n * implements it — the surface reuses `react`.\n */\nexport const OPTIONAL_SURFACES = [\n 'slack',\n] as const satisfies readonly SurfaceName[];\n\n/** One of the {@link OPTIONAL_SURFACES}. */\nexport type OptionalSurface = (typeof OPTIONAL_SURFACES)[number];\n\n/**\n * One renderer per surface a primitive implements.\n *\n * `react`, `text`, and `markdown` are always required: those three are what\n * make \"every composition degrades\" true. `react` serves the `snapshot` surface\n * too, so targeting images costs a primitive nothing.\n *\n * `slack` is declared method-style deliberately: method parameters are checked\n * bivariantly, which is what lets a pack narrow the collector's node type.\n */\nexport interface Renderers<\n TNode extends PrimitiveNode,\n T extends PackTypes = DefaultPackTypes,\n> {\n react(\n node: TNode,\n env: {\n context: T['context'];\n scope: RenderScope<T>;\n /** See {@link SurfaceMap.react}'s `env.theme`. */\n theme?: T['theme'];\n }\n ): ReactNode;\n text(\n node: TNode,\n env: {\n scope: RenderScope<T>;\n }\n ): string;\n markdown(\n node: TNode,\n env: {\n scope: RenderScope<T>;\n }\n ): MarkdownContent;\n slack?(\n node: TNode,\n env: {\n collector?: T['slackCollector'];\n scope: RenderScope<T>;\n }\n ): T['slackBlock'] | readonly T['slackBlock'][];\n}\n\n/**\n * Measurements a frame can ask of a node before drawing it.\n *\n * `snapshotHeight` is optional. The height estimate is `0` when it is missing, so\n * a frame that sums node heights sizes short.\n */\nexport interface PrimitiveMetrics<TNode extends PrimitiveNode> {\n /** The node's drawn height in pixels at the frame's width. */\n snapshotHeight?: (node: TNode) => number;\n}\n\n/**\n * Every primitive's schema is an object schema, because {@link definePrimitive}\n * extends it with `id` and `surfaces` and the composition builds a\n * `z.discriminatedUnion('type', …)` over them. Typed as `ZodObject` rather\n * than `ZodType<unknown>` so a union or intersection schema is a compile\n * error at the definition, not a runtime failure at the first `.extend()`.\n * Zod 4 types `z.object().superRefine(…)` as a `ZodObject` and preserves the\n * refinement through `.extend()`, so top-level refinements are unaffected.\n */\nexport type PrimitiveSchema = ZodObject;\n\n/**\n * The child-ref shape a primitive definition's own `children` returns.\n *\n * {@link ChildNodeRef} stays erased (`node: unknown`) because\n * `createChildNodeWalker` mixes children from every primitive type in the\n * runtime into one map and cannot name a single node type for them. A single\n * definition has no such excuse: its `children` should not type-check\n * against `unknown` and let something that is not a {@link PrimitiveNode} —\n * `null`, for instance — silently disappear from every tree walk.\n */\nexport interface PrimitiveChildRef extends ChildNodeRef {\n node: PrimitiveNode;\n}\n\n/**\n * One primitive: its node type, schema, catalog entry, and a renderer per\n * surface. The unit of vocabulary, and what {@link definePrimitive} takes.\n *\n * `T` is the pack's {@link PackTypes}, bound once with\n * {@link definePrimitiveFor} so each primitive names only `TNode`.\n */\nexport interface PrimitiveDefinition<\n TNode extends PrimitiveNode,\n T extends PackTypes = DefaultPackTypes,\n TSchema extends PrimitiveSchema = PrimitiveSchema,\n> {\n /** The node's discriminant, and the key this primitive occupies in an inventory. */\n type: TNode['type'];\n /** How the authoring prompt describes this primitive to the model. */\n catalog: PrimitiveCatalogEntry;\n /** Host-facing glyph, never shown to the model. Absent means the host supplies its own. */\n icon?: PrimitiveIcon;\n /**\n * Driven by the conformance harness, bare or named; read them with\n * `exampleNodes` or `primitiveExamples`. The catalog `example` is what the\n * prompt shows.\n */\n examples: readonly (TNode | PrimitiveExample<TNode>)[];\n /**\n * This primitive on its own. A container declares\n * {@link PrimitiveDefinition.schemaFor} as well, and uses\n * {@link unresolvedBodyNodeSchema} in the child slot here.\n */\n schema: TSchema;\n /**\n * A container's schema, bound to the body-node union of the composition it is\n * being built into.\n *\n * Declaring the shape and letting each composition supply its own union is\n * what lets one primitive appear in two runtimes with different inventories:\n * `z.lazy` memoizes per instance, and an instance built here belongs to\n * exactly one union.\n */\n schemaFor?: (bodyNodeSchema: ZodType<unknown>) => PrimitiveSchema;\n /** One function per surface; `react` serves `snapshot` as well. */\n renderers: Renderers<TNode, T>;\n /** Sizing a frame can ask for before drawing. Absent means it cannot be measured. */\n metrics?: PrimitiveMetrics<TNode>;\n /**\n * Render-time URL trust, the second of the two layers in `validate/url.ts`.\n *\n * Returning `null` drops the node. Applied even to an unvalidated node, so a\n * renderer invoked directly still cannot emit an unsafe URL.\n */\n sanitize?: (node: TNode) => TNode | null;\n /**\n * Nested nodes, for containers, in the order the `react` renderer draws\n * them; `findNodeElementPairs` relies on it. Absent means a leaf.\n */\n children?: (node: TNode) => readonly PrimitiveChildRef[];\n /**\n * True when this node produces surface output of its own, not only via\n * {@link PrimitiveDefinition.children}. A non-empty `children` result is\n * otherwise the complete source of rendered content, so a hybrid container\n * that still owns string fields returns true to keep rendering when every\n * nested node is hidden from the surface.\n */\n hasOwnContent?: (node: TNode) => boolean;\n /** Contributes this node's CSS by mutating `styles`, once per node per render. */\n collectStyles?: (\n node: TNode,\n env: { styles: T['collector']; context: PrimitiveStyleCollectionContext }\n ) => void;\n}\n\n/**\n * {@link PrimitiveDefinition} with every type parameter erased, and the form an\n * inventory is stored in.\n *\n * A heterogeneous pack has no single `TNode` to be generic over, so the\n * renderers degrade to `unknown` here.\n *\n * Each field carries the same contract as its {@link PrimitiveDefinition}\n * counterpart; only the types are erased.\n */\nexport interface AnyPrimitiveDefinition {\n type: string;\n catalog: PrimitiveCatalogEntry;\n icon?: PrimitiveIcon;\n examples: readonly (PrimitiveNode | PrimitiveExample)[];\n schema: PrimitiveSchema;\n schemaFor?: (bodyNodeSchema: ZodType<unknown>) => PrimitiveSchema;\n renderers: Record<'react' | 'text' | 'markdown', unknown> &\n Partial<Record<'slack', unknown>>;\n metrics?: {\n snapshotHeight?: unknown;\n };\n sanitize?: unknown;\n children?: unknown;\n hasOwnContent?: unknown;\n collectStyles?: unknown;\n}\n\n/** Parses `node` against `schema`, appending path-prefixed messages to `errors`. */\nexport const validateWithSchema = (\n schema: PrimitiveSchema,\n node: unknown,\n path: string,\n errors: ValidationError[]\n): void => {\n const result = schema.safeParse(node, { reportInput: true });\n if (!result.success) {\n errors.push(...formatZodIssues(result.error.issues, path));\n }\n};\n\n/** The `id` every node may carry, unique within a composition. */\nexport const bodyNodeIdSchema = requiredString('must be a non-empty string');\n\n/** The `surfaces` allowlist on a node. Absent means every surface; empty is rejected. */\nexport const bodyNodeSurfacesSchema = z\n .array(\n z.enum(SURFACE_NAMES, {\n error: () => oneOf(SURFACE_NAMES),\n })\n )\n .min(1, { error: 'must contain at least one surface' });\n\n/**\n * The child slot in a container's standalone {@link PrimitiveDefinition.schema},\n * where no body-node union is available.\n *\n * Deliberately permissive rather than `z.unknown()`: it still rejects a child\n * that is not a node at all, which is the error worth catching without an\n * inventory. Anything that depends on *which* types are legal — the validator,\n * the parser, the JSON Schema projection — goes through\n * {@link PrimitiveDefinition.schemaFor} and sees the real union.\n */\nexport const unresolvedBodyNodeSchema = z.looseObject({\n type: requiredString('must be a non-empty string'),\n});\n\n/**\n * Declares one primitive, extending its schema with the `id` and `surfaces`\n * fields every node carries, and closing it to unknown keys so a node is held\n * to the same rule as the composition root and the JSON Schema an agent reads.\n * A schema with its own catchall (`z.looseObject`) keeps it.\n *\n * A pack normally calls the form {@link definePrimitiveFor} binds to its own\n * {@link PackTypes}, so each primitive names only `TNode`.\n */\nexport const definePrimitive = <\n TNode extends PrimitiveNode,\n T extends PackTypes = DefaultPackTypes,\n TSchema extends PrimitiveSchema = PrimitiveSchema,\n>(\n definition: PrimitiveDefinition<TNode, T, TSchema>\n): PrimitiveDefinition<TNode, T, WithNodeFields<TSchema>> => {\n const { schemaFor } = definition;\n return {\n ...definition,\n schema: withNodeFields(definition.schema),\n // Both forms get the node fields, or a container would accept `id` and\n // `surfaces` standalone and reject them inside a composition.\n ...(schemaFor\n ? {\n schemaFor: (bodyNodeSchema: ZodType<unknown>) =>\n withNodeFields(schemaFor(bodyNodeSchema)),\n }\n : {}),\n };\n};\n\n/**\n * {@link definePrimitive} bound to one pack's {@link PackTypes}.\n *\n * ```ts\n * const define = definePrimitiveFor<SlidesPackTypes>();\n * export const note = define({ type: 'note', … });\n * ```\n */\nexport const definePrimitiveFor =\n <T extends PackTypes>() =>\n <\n TNode extends PrimitiveNode,\n TSchema extends PrimitiveSchema = PrimitiveSchema,\n >(\n definition: PrimitiveDefinition<TNode, T, TSchema>\n ): PrimitiveDefinition<TNode, T, WithNodeFields<TSchema>> =>\n definePrimitive<TNode, T, TSchema>(definition);\n\n/**\n * `.extend()` on a generic `ZodObject` widens the shape to `any`, so the\n * return type is rebuilt from `TSchema`'s shape. The brand on a field schema\n * stays on that same object at runtime.\n */\nexport type WithNodeFields<TSchema extends PrimitiveSchema> =\n TSchema extends ZodObject<infer Shape>\n ? ZodObject<\n Shape & {\n id: ReturnType<typeof bodyNodeIdSchema.optional>;\n surfaces: ReturnType<typeof bodyNodeSurfacesSchema.optional>;\n }\n >\n : PrimitiveSchema;\n\n// Marks the field schemas `definePrimitive` adds. A schema derived from a\n// defined one shares them by reference, and `Symbol.for` matches across ESM and\n// CommonJS copies of the SDK.\nconst NODE_FIELD = Symbol.for('elastic.isomer.node_field');\n\nconst nodeField = <T extends ZodType>(schema: T): T =>\n Object.defineProperty(schema, NODE_FIELD, { value: true });\n\nconst NODE_FIELDS = {\n id: nodeField(bodyNodeIdSchema.optional()),\n surfaces: nodeField(bodyNodeSurfacesSchema.optional()),\n};\n\nconst isNodeField = (schema: unknown): boolean => {\n let current = schema;\n while (current && typeof current === 'object') {\n if (Object.hasOwn(current, NODE_FIELD)) return true;\n const { def } = current as {\n def?: { type?: string; innerType?: unknown };\n };\n if (def?.type !== 'optional') return false;\n current = def.innerType;\n }\n return false;\n};\n\nconst withNodeFields = <TSchema extends PrimitiveSchema>(\n schema: TSchema\n): WithNodeFields<TSchema> => {\n const reserved = Object.keys(NODE_FIELDS).find(\n (field) =>\n Object.hasOwn(schema.shape, field) && !isNodeField(schema.shape[field])\n );\n if (reserved) {\n throw new IsomerError(\n ISOMER_ERROR_CODES.RESERVED_NODE_FIELD,\n `definePrimitive: a primitive schema cannot declare \\`${reserved}\\`; every body node has it.`\n );\n }\n const extended = schema.extend(NODE_FIELDS);\n return (\n schema.def.catchall === undefined ? extended.strict() : extended\n ) as WithNodeFields<TSchema>;\n};\n"]}
@@ -8,7 +8,7 @@ import type { PrimitiveNode } from '../composition/node.js';
8
8
  export interface SlackAssetRequest<TNode extends PrimitiveNode = PrimitiveNode> {
9
9
  /** Placeholder the render emits, which the host replaces with Slack's file id. */
10
10
  ref: string;
11
- /** The node to draw as an image, to be rendered on the `svg` surface. */
11
+ /** The node to draw as an image, to be rendered on the `snapshot` surface. */
12
12
  node: TNode;
13
13
  /** Accessible description, required because Slack rejects an image block without one. */
14
14
  altText: string;
@@ -1 +1 @@
1
- {"version":3,"file":"slack_assets.d.ts","sourceRoot":"","sources":["../../src/define/slack_assets.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB,CAChC,KAAK,SAAS,aAAa,GAAG,aAAa;IAE3C,kFAAkF;IAClF,GAAG,EAAE,MAAM,CAAC;IACZ,yEAAyE;IACzE,IAAI,EAAE,KAAK,CAAC;IACZ,yFAAyF;IACzF,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB,CAClC,KAAK,SAAS,aAAa,GAAG,aAAa;IAE3C,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/C,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;CACxD"}
1
+ {"version":3,"file":"slack_assets.d.ts","sourceRoot":"","sources":["../../src/define/slack_assets.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB,CAChC,KAAK,SAAS,aAAa,GAAG,aAAa;IAE3C,kFAAkF;IAClF,GAAG,EAAE,MAAM,CAAC;IACZ,8EAA8E;IAC9E,IAAI,EAAE,KAAK,CAAC;IACZ,yFAAyF;IACzF,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB,CAClC,KAAK,SAAS,aAAa,GAAG,aAAa;IAE3C,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/C,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAE,SAAS,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;CACxD"}
@@ -1 +1 @@
1
- {"version":3,"file":"slack_assets.js","sourceRoot":"","sources":["../../src/define/slack_assets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nimport type { PrimitiveNode } from '../composition/node';\n\n/**\n * One image the host must upload before the message can be posted.\n *\n * The renderer is pure, so it emits `ref` as a placeholder and the host swaps\n * in Slack's file id once the upload lands.\n */\nexport interface SlackAssetRequest<\n TNode extends PrimitiveNode = PrimitiveNode,\n> {\n /** Placeholder the render emits, which the host replaces with Slack's file id. */\n ref: string;\n /** The node to draw as an image, to be rendered on the `svg` surface. */\n node: TNode;\n /** Accessible description, required because Slack rejects an image block without one. */\n altText: string;\n}\n\n/**\n * Accumulates the {@link SlackAssetRequest}s a render produced.\n *\n * Opt-in: without a collector, a node that cannot draw inline degrades to text\n * instead, so default output stays safe for callers that cannot upload files.\n */\nexport interface SlackAssetCollector<\n TNode extends PrimitiveNode = PrimitiveNode,\n> {\n /** Reserves a placeholder `ref` for `node` and records the request. */\n allocate(node: TNode, altText: string): string;\n /** In allocation order, so a host can upload and swap refs in one pass. */\n readonly requests: readonly SlackAssetRequest<TNode>[];\n}\n"]}
1
+ {"version":3,"file":"slack_assets.js","sourceRoot":"","sources":["../../src/define/slack_assets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nimport type { PrimitiveNode } from '../composition/node';\n\n/**\n * One image the host must upload before the message can be posted.\n *\n * The renderer is pure, so it emits `ref` as a placeholder and the host swaps\n * in Slack's file id once the upload lands.\n */\nexport interface SlackAssetRequest<\n TNode extends PrimitiveNode = PrimitiveNode,\n> {\n /** Placeholder the render emits, which the host replaces with Slack's file id. */\n ref: string;\n /** The node to draw as an image, to be rendered on the `snapshot` surface. */\n node: TNode;\n /** Accessible description, required because Slack rejects an image block without one. */\n altText: string;\n}\n\n/**\n * Accumulates the {@link SlackAssetRequest}s a render produced.\n *\n * Opt-in: without a collector, a node that cannot draw inline degrades to text\n * instead, so default output stays safe for callers that cannot upload files.\n */\nexport interface SlackAssetCollector<\n TNode extends PrimitiveNode = PrimitiveNode,\n> {\n /** Reserves a placeholder `ref` for `node` and records the request. */\n allocate(node: TNode, altText: string): string;\n /** In allocation order, so a host can upload and swap refs in one pass. */\n readonly requests: readonly SlackAssetRequest<TNode>[];\n}\n"]}
@@ -1,6 +1,6 @@
1
- export { type ActionEventRef, type BodyNodeBase, type ChildNodeRef, type ChildNodeWalker, type Composition, type CompositionMeta, type DisplayValue, type IsomerErrorCode, type NamedColor, type NamedColorPalette, type PrimitiveNode, type RenderTheme, type StructuredValue, type StructuredValueFormat, type SurfaceName, type ValidationError, ALL_NAMED_COLORS, BODY_NODE_SURFACES, ISOMER_ERROR_CODES, STRUCTURED_VALUE_FORMATS, CompositionValidationError, createChildNodeWalker, formatValidationError, IsomerError, isVisibleOnSurface, mapCompositionNodes, someBodyNode, } from '../composition/index.js';
2
- export { type AnyPrimitiveDefinition, type BoundFrame, type DefaultPackTypes, type Frame, type FrameBody, type FrameComposition, type FrameDispatcher, type FrameHeader, type FrameViewport, type OptionalSurface, type PackTypes, type PrimitiveCatalogEntry, type PrimitiveChildRef, type PrimitiveDefinition, type PrimitiveMetrics, type PrimitiveRenderContext, type PrimitiveSchema, type PrimitiveStyleCollectionContext, type PrimitiveStyleCollector, type ReactContextArg, type Renderer, type Renderers, type RenderScope, type StyledRenderContext, type StyleHandle, type SurfaceMap, type ThemePair, type ThemeTokenPath, type WithNodeFields, bindFrame, definePrimitive, definePrimitiveFor, formatZodIssues, requiredString, unresolvedBodyNodeSchema, z, } from '../define/index.js';
3
- export { type AnyPrimitivePack, type ComposedPacks, type EnhancementDefinition, type HostCapabilities, type PackAuthoringOptions, type PackStyleAdapter, type PrimitiveGroup, type PrimitivePack, type PrimitivePackInput, composePacks, definePrimitivePack, describeCapabilities, scopeScript, } from '../pack/index.js';
1
+ export { type ActionEventRef, type BodyNodeBase, type ChildNodeRef, type ChildNodeWalker, type Composition, type CompositionMeta, type DisplayValue, type IsomerErrorCode, type NamedColor, type NamedColorPalette, type PrimitiveNode, type RenderTheme, type StructuredValue, type StructuredValueFormat, type SurfaceName, type ValidationError, ALL_NAMED_COLORS, BODY_NODE_SURFACES, ISOMER_ERROR_CODES, STRUCTURED_VALUE_FORMATS, SURFACE_NAMES, CompositionValidationError, createChildNodeWalker, formatValidationError, IsomerError, isVisibleOnSurface, mapCompositionNodes, someBodyNode, } from '../composition/index.js';
2
+ export { type AnyPrimitiveDefinition, type BoundFrame, type DefaultPackTypes, type ExampleNode, type Frame, type FrameBody, type FrameComposition, type FrameDispatcher, type FrameHeader, type FrameViewport, type NormalizedPrimitiveExample, type OptionalSurface, type PackTypes, type PrimitiveCatalogEntry, type PrimitiveChildRef, type PrimitiveDefinition, type PrimitiveExample, type PrimitiveIcon, type PrimitiveMetrics, type PrimitiveRenderContext, type PrimitiveSchema, type PrimitiveStyleCollectionContext, type PrimitiveStyleCollector, type ReactContextArg, type Renderer, type Renderers, type RenderScope, type StyledRenderContext, type StyleHandle, type SurfaceMap, type ThemePair, type ThemeTokenPath, type WithNodeFields, ICON_VARS, OPTIONAL_SURFACES, bindFrame, definePrimitive, definePrimitiveFor, exampleNodes, formatZodIssues, primitiveExamples, requiredString, unresolvedBodyNodeSchema, z, } from '../define/index.js';
3
+ export { type AnyPrimitivePack, type CapabilitySources, type ComposedPacks, type EnhancementDefinition, type HostCapabilities, type PackAuthoringOptions, type PackStyleAdapter, type PrimitiveGroup, type PrimitivePack, type PrimitivePackInput, type SurfaceSupport, composePacks, definePrimitivePack, describeCapabilities, scopeScript, } from '../pack/index.js';
4
4
  export { type FormatDisplayValueOptions, type LayoutBox, type LayoutFinding, type LayoutRect, type PayloadMeasurement, type PrimitiveDispatcher, type PrimitiveDispatcherOptions, LAYOUT_ROOM_ATTRIBUTE, NODE_ANCHOR_ATTRIBUTE, checkLayout, createPrimitiveDispatcher, formatDisplayValue, isStructuredValue, layoutRoom, nodeAnchor, rawDisplayValue, withNodeAnchors, withoutAnchors, } from '../render/index.js';
5
5
  export { type AuthoringJsonSchemaOptions, type CheckedComposition, type CheckedValidationResult, type CompositionJsonSchemaOptions, type CompositionSchemaOptions, type CompositionValidatorOptions, type InputBudget, type InputBudgetCheck, type ParsedComposition, type UrlSchemaOptions, type ValidationErrorMode, type ValidationResult, type ValidationWarning, ASSET_URL_MESSAGE, ASSET_URL_RULE, BLOCKED_HREF, MAX_INPUT_CHARACTERS, MAX_INPUT_DEPTH, MAX_INPUT_VALUES, NAVIGATION_HREF_MESSAGE, NAVIGATION_HREF_RULE, assetUrl, authoringSchemaSubset, buildAuthoringJsonSchema, buildCompositionJsonSchema, checkInputBudget, compositionToRender, createCompositionParser, createCompositionValidator, displayValueSchema, getCompositionSchemaForDefinitions, isInputRefusal, namedColorSchema, navigationHref, renderThemeSchema, sanitizeAssetUrl, sanitizeNavigationHref, structuredValueSchema, warningsForSurface, } from '../validate/index.js';
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entries/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,OA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nB,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EAChC,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,QAAQ,EACR,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,EAClB,kCAAkC,EAClC,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entries/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,0BAA0B,EAC1B,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,O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A0B,EAC/B,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,EACX,yBAAyB,EACzB,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,eAAe,EACf,eAAe,EACf,cAAc,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EAChC,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,QAAQ,EACR,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,EAClB,kCAAkC,EAClC,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,aAAa,CAAC"}
@@ -4,8 +4,8 @@
4
4
  * 2.0; you may not use this file except in compliance with the Elastic License
5
5
  * 2.0.
6
6
  */
7
- export { ALL_NAMED_COLORS, BODY_NODE_SURFACES, ISOMER_ERROR_CODES, STRUCTURED_VALUE_FORMATS, CompositionValidationError, createChildNodeWalker, formatValidationError, IsomerError, isVisibleOnSurface, mapCompositionNodes, someBodyNode, } from '../composition/index.js';
8
- export { bindFrame, definePrimitive, definePrimitiveFor, formatZodIssues, requiredString, unresolvedBodyNodeSchema, z, } from '../define/index.js';
7
+ export { ALL_NAMED_COLORS, BODY_NODE_SURFACES, ISOMER_ERROR_CODES, STRUCTURED_VALUE_FORMATS, SURFACE_NAMES, CompositionValidationError, createChildNodeWalker, formatValidationError, IsomerError, isVisibleOnSurface, mapCompositionNodes, someBodyNode, } from '../composition/index.js';
8
+ export { ICON_VARS, OPTIONAL_SURFACES, bindFrame, definePrimitive, definePrimitiveFor, exampleNodes, formatZodIssues, primitiveExamples, requiredString, unresolvedBodyNodeSchema, z, } from '../define/index.js';
9
9
  export { composePacks, definePrimitivePack, describeCapabilities, scopeScript, } from '../pack/index.js';
10
10
  export { LAYOUT_ROOM_ATTRIBUTE, NODE_ANCHOR_ATTRIBUTE, checkLayout, createPrimitiveDispatcher, formatDisplayValue, isStructuredValue, layoutRoom, nodeAnchor, rawDisplayValue, withNodeAnchors, withoutAnchors, } from '../render/index.js';
11
11
  export { ASSET_URL_MESSAGE, ASSET_URL_RULE, BLOCKED_HREF, MAX_INPUT_CHARACTERS, MAX_INPUT_DEPTH, MAX_INPUT_VALUES, NAVIGATION_HREF_MESSAGE, NAVIGATION_HREF_RULE, assetUrl, authoringSchemaSubset, buildAuthoringJsonSchema, buildCompositionJsonSchema, checkInputBudget, compositionToRender, createCompositionParser, createCompositionValidator, displayValueSchema, getCompositionSchemaForDefinitions, isInputRefusal, namedColorSchema, navigationHref, renderThemeSchema, sanitizeAssetUrl, sanitizeNavigationHref, structuredValueSchema, warningsForSurface, } from '../validate/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entries/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAiBL,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EA8BL,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,wBAAwB,EACxB,CAAC,GACF,MAAM,WAAW,CAAC;AACnB,OAAO,EAUL,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,GACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAQL,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,EACX,yBAAyB,EACzB,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,eAAe,EACf,eAAe,EACf,cAAc,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAcL,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,QAAQ,EACR,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,EAClB,kCAAkC,EAClC,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,aAAa,CAAC","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nexport {\n type ActionEventRef,\n type BodyNodeBase,\n type ChildNodeRef,\n type ChildNodeWalker,\n type Composition,\n type CompositionMeta,\n type DisplayValue,\n type IsomerErrorCode,\n type NamedColor,\n type NamedColorPalette,\n type PrimitiveNode,\n type RenderTheme,\n type StructuredValue,\n type StructuredValueFormat,\n type SurfaceName,\n type ValidationError,\n ALL_NAMED_COLORS,\n BODY_NODE_SURFACES,\n ISOMER_ERROR_CODES,\n STRUCTURED_VALUE_FORMATS,\n CompositionValidationError,\n createChildNodeWalker,\n formatValidationError,\n IsomerError,\n isVisibleOnSurface,\n mapCompositionNodes,\n someBodyNode,\n} from '../composition';\nexport {\n type AnyPrimitiveDefinition,\n type BoundFrame,\n type DefaultPackTypes,\n type Frame,\n type FrameBody,\n type FrameComposition,\n type FrameDispatcher,\n type FrameHeader,\n type FrameViewport,\n type OptionalSurface,\n type PackTypes,\n type PrimitiveCatalogEntry,\n type PrimitiveChildRef,\n type PrimitiveDefinition,\n type PrimitiveMetrics,\n type PrimitiveRenderContext,\n type PrimitiveSchema,\n type PrimitiveStyleCollectionContext,\n type PrimitiveStyleCollector,\n type ReactContextArg,\n type Renderer,\n type Renderers,\n type RenderScope,\n type StyledRenderContext,\n type StyleHandle,\n type SurfaceMap,\n type ThemePair,\n type ThemeTokenPath,\n type WithNodeFields,\n bindFrame,\n definePrimitive,\n definePrimitiveFor,\n formatZodIssues,\n requiredString,\n unresolvedBodyNodeSchema,\n z,\n} from '../define';\nexport {\n type AnyPrimitivePack,\n type ComposedPacks,\n type EnhancementDefinition,\n type HostCapabilities,\n type PackAuthoringOptions,\n type PackStyleAdapter,\n type PrimitiveGroup,\n type PrimitivePack,\n type PrimitivePackInput,\n composePacks,\n definePrimitivePack,\n describeCapabilities,\n scopeScript,\n} from '../pack';\nexport {\n type FormatDisplayValueOptions,\n type LayoutBox,\n type LayoutFinding,\n type LayoutRect,\n type PayloadMeasurement,\n type PrimitiveDispatcher,\n type PrimitiveDispatcherOptions,\n LAYOUT_ROOM_ATTRIBUTE,\n NODE_ANCHOR_ATTRIBUTE,\n checkLayout,\n createPrimitiveDispatcher,\n formatDisplayValue,\n isStructuredValue,\n layoutRoom,\n nodeAnchor,\n rawDisplayValue,\n withNodeAnchors,\n withoutAnchors,\n} from '../render';\nexport {\n type AuthoringJsonSchemaOptions,\n type CheckedComposition,\n type CheckedValidationResult,\n type CompositionJsonSchemaOptions,\n type CompositionSchemaOptions,\n type CompositionValidatorOptions,\n type InputBudget,\n type InputBudgetCheck,\n type ParsedComposition,\n type UrlSchemaOptions,\n type ValidationErrorMode,\n type ValidationResult,\n type ValidationWarning,\n ASSET_URL_MESSAGE,\n ASSET_URL_RULE,\n BLOCKED_HREF,\n MAX_INPUT_CHARACTERS,\n MAX_INPUT_DEPTH,\n MAX_INPUT_VALUES,\n NAVIGATION_HREF_MESSAGE,\n NAVIGATION_HREF_RULE,\n assetUrl,\n authoringSchemaSubset,\n buildAuthoringJsonSchema,\n buildCompositionJsonSchema,\n checkInputBudget,\n compositionToRender,\n createCompositionParser,\n createCompositionValidator,\n displayValueSchema,\n getCompositionSchemaForDefinitions,\n isInputRefusal,\n namedColorSchema,\n navigationHref,\n renderThemeSchema,\n sanitizeAssetUrl,\n sanitizeNavigationHref,\n structuredValueSchema,\n warningsForSurface,\n} from '../validate';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entries/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAiBL,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,0BAA0B,EAC1B,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAkCL,SAAS,EACT,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,wBAAwB,EACxB,CAAC,GACF,MAAM,WAAW,CAAC;AACnB,OAAO,EAYL,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,WAAW,GACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAQL,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,EACX,yBAAyB,EACzB,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,UAAU,EACV,eAAe,EACf,eAAe,EACf,cAAc,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAcL,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,QAAQ,EACR,qBAAqB,EACrB,wBAAwB,EACxB,0BAA0B,EAC1B,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,EAClB,kCAAkC,EAClC,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,aAAa,CAAC","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nexport {\n type ActionEventRef,\n type BodyNodeBase,\n type ChildNodeRef,\n type ChildNodeWalker,\n type Composition,\n type CompositionMeta,\n type DisplayValue,\n type IsomerErrorCode,\n type NamedColor,\n type NamedColorPalette,\n type PrimitiveNode,\n type RenderTheme,\n type StructuredValue,\n type StructuredValueFormat,\n type SurfaceName,\n type ValidationError,\n ALL_NAMED_COLORS,\n BODY_NODE_SURFACES,\n ISOMER_ERROR_CODES,\n STRUCTURED_VALUE_FORMATS,\n SURFACE_NAMES,\n CompositionValidationError,\n createChildNodeWalker,\n formatValidationError,\n IsomerError,\n isVisibleOnSurface,\n mapCompositionNodes,\n someBodyNode,\n} from '../composition';\nexport {\n type AnyPrimitiveDefinition,\n type BoundFrame,\n type DefaultPackTypes,\n type ExampleNode,\n type Frame,\n type FrameBody,\n type FrameComposition,\n type FrameDispatcher,\n type FrameHeader,\n type FrameViewport,\n type NormalizedPrimitiveExample,\n type OptionalSurface,\n type PackTypes,\n type PrimitiveCatalogEntry,\n type PrimitiveChildRef,\n type PrimitiveDefinition,\n type PrimitiveExample,\n type PrimitiveIcon,\n type PrimitiveMetrics,\n type PrimitiveRenderContext,\n type PrimitiveSchema,\n type PrimitiveStyleCollectionContext,\n type PrimitiveStyleCollector,\n type ReactContextArg,\n type Renderer,\n type Renderers,\n type RenderScope,\n type StyledRenderContext,\n type StyleHandle,\n type SurfaceMap,\n type ThemePair,\n type ThemeTokenPath,\n type WithNodeFields,\n ICON_VARS,\n OPTIONAL_SURFACES,\n bindFrame,\n definePrimitive,\n definePrimitiveFor,\n exampleNodes,\n formatZodIssues,\n primitiveExamples,\n requiredString,\n unresolvedBodyNodeSchema,\n z,\n} from '../define';\nexport {\n type AnyPrimitivePack,\n type CapabilitySources,\n type ComposedPacks,\n type EnhancementDefinition,\n type HostCapabilities,\n type PackAuthoringOptions,\n type PackStyleAdapter,\n type PrimitiveGroup,\n type PrimitivePack,\n type PrimitivePackInput,\n type SurfaceSupport,\n composePacks,\n definePrimitivePack,\n describeCapabilities,\n scopeScript,\n} from '../pack';\nexport {\n type FormatDisplayValueOptions,\n type LayoutBox,\n type LayoutFinding,\n type LayoutRect,\n type PayloadMeasurement,\n type PrimitiveDispatcher,\n type PrimitiveDispatcherOptions,\n LAYOUT_ROOM_ATTRIBUTE,\n NODE_ANCHOR_ATTRIBUTE,\n checkLayout,\n createPrimitiveDispatcher,\n formatDisplayValue,\n isStructuredValue,\n layoutRoom,\n nodeAnchor,\n rawDisplayValue,\n withNodeAnchors,\n withoutAnchors,\n} from '../render';\nexport {\n type AuthoringJsonSchemaOptions,\n type CheckedComposition,\n type CheckedValidationResult,\n type CompositionJsonSchemaOptions,\n type CompositionSchemaOptions,\n type CompositionValidatorOptions,\n type InputBudget,\n type InputBudgetCheck,\n type ParsedComposition,\n type UrlSchemaOptions,\n type ValidationErrorMode,\n type ValidationResult,\n type ValidationWarning,\n ASSET_URL_MESSAGE,\n ASSET_URL_RULE,\n BLOCKED_HREF,\n MAX_INPUT_CHARACTERS,\n MAX_INPUT_DEPTH,\n MAX_INPUT_VALUES,\n NAVIGATION_HREF_MESSAGE,\n NAVIGATION_HREF_RULE,\n assetUrl,\n authoringSchemaSubset,\n buildAuthoringJsonSchema,\n buildCompositionJsonSchema,\n checkInputBudget,\n compositionToRender,\n createCompositionParser,\n createCompositionValidator,\n displayValueSchema,\n getCompositionSchemaForDefinitions,\n isInputRefusal,\n namedColorSchema,\n navigationHref,\n renderThemeSchema,\n sanitizeAssetUrl,\n sanitizeNavigationHref,\n structuredValueSchema,\n warningsForSurface,\n} from '../validate';\n"]}
@@ -1,2 +1,2 @@
1
- export { type SlackActionElement, type SlackActionsBlock, type SlackAssetCollector, type SlackAssetRequest, type SlackBlock, type SlackButtonElement, type SlackCheckboxesElement, type SlackContextBlock, type SlackDividerBlock, type SlackEnvelopeDispatcher, type SlackEnvelopeOptions, type SlackEnvelopeResult, type SlackFileReference, type SlackHeaderBlock, type SlackHeaderLevel, type SlackImageBlock, type SlackImageElement, type SlackMrkdwnTextObject, type SlackMultiStaticSelectElement, type SlackOptionGroup, type SlackOptionObject, type SlackOverflowElement, type SlackPlainTextObject, type SlackRadioButtonsElement, type SlackRawTextElement, type SlackRichTextBlock, type SlackRichTextBlockElement, type SlackRichTextInline, type SlackRichTextLink, type SlackRichTextList, type SlackRichTextPreformatted, type SlackRichTextQuote, type SlackRichTextSection, type SlackRichTextStyle, type SlackRichTextTag, type SlackRichTextText, type SlackSectionAccessory, type SlackSectionBlock, type SlackStaticSelectElement, type SlackTableBlock, type SlackTableCell, type SlackTableColumnSetting, type SlackTagColor, type SlackTextObject, type SlackVideoBlock, SLACK_LIMITS, bold, clampSlackText, code, codeBlock, createSlackAssetCollector, escapeMrkdwn, gfmToSlackBlocks, isSlackReachableImageUrl, italic, link, markdownContentToSlackBlocks, renderSlackEnvelope, slackLinkUrl, strike, } from '../render/slack/index.js';
1
+ export { type SlackActionElement, type SlackActionsBlock, type SlackAssetCollector, type SlackAssetRequest, type SlackBlock, type SlackButtonElement, type SlackCheckboxesElement, type SlackContextBlock, type SlackDividerBlock, type SlackEnvelopeDispatcher, type SlackEnvelopeOptions, type SlackEnvelopeResult, type SlackFileReference, type SlackHeaderBlock, type SlackHeaderLevel, type SlackImageBlock, type SlackImageElement, type SlackMrkdwnTextObject, type SlackMultiStaticSelectElement, type SlackOptionGroup, type SlackOptionObject, type SlackOverflowElement, type SlackPlainTextObject, type SlackRadioButtonsElement, type SlackRawTextElement, type SlackRichTextBlock, type SlackRichTextBlockElement, type SlackRichTextInline, type SlackRichTextLink, type SlackRichTextList, type SlackRichTextPreformatted, type SlackRichTextQuote, type SlackRichTextSection, type SlackRichTextStyle, type SlackRichTextTag, type SlackRichTextText, type SlackSectionAccessory, type SlackSectionBlock, type SlackStaticSelectElement, type SlackTableBlock, type SlackTableCell, type SlackTableColumnSetting, type SlackTagColor, type SlackTextObject, type SlackVideoBlock, SLACK_LIMITS, bold, clampSlackText, code, codeBlock, createSlackAssetCollector, escapeMrkdwn, isSlackReachableImageUrl, italic, link, markdownContentToSlackBlocks, renderSlackEnvelope, slackLinkUrl, strike, } from '../render/slack/index.js';
2
2
  //# sourceMappingURL=slack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"slack.d.ts","sourceRoot":"","sources":["../../src/entries/slack.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,EAClC,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,y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K,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC5B,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,YAAY,EACZ,IAAI,EACJ,cAAc,EACd,IAAI,EACJ,SAAS,EACT,yBAAyB,EACzB,YAAY,EACZ,wBAAwB,EACxB,MAAM,EACN,IAAI,EACJ,4BAA4B,EAC5B,mBAAmB,EACnB,YAAY,EACZ,MAAM,GACP,MAAM,iBAAiB,CAAC"}
@@ -4,5 +4,5 @@
4
4
  * 2.0; you may not use this file except in compliance with the Elastic License
5
5
  * 2.0.
6
6
  */
7
- export { SLACK_LIMITS, bold, clampSlackText, code, codeBlock, createSlackAssetCollector, escapeMrkdwn, gfmToSlackBlocks, isSlackReachableImageUrl, italic, link, markdownContentToSlackBlocks, renderSlackEnvelope, slackLinkUrl, strike, } from '../render/slack/index.js';
7
+ export { SLACK_LIMITS, bold, clampSlackText, code, codeBlock, createSlackAssetCollector, escapeMrkdwn, isSlackReachableImageUrl, italic, link, markdownContentToSlackBlocks, renderSlackEnvelope, slackLinkUrl, strike, } from '../render/slack/index.js';
8
8
  //# sourceMappingURL=slack.js.map