@elastic/isomer-sdk 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/dist/cjs/composition/error.js +1 -0
  2. package/dist/cjs/composition/error.js.map +1 -1
  3. package/dist/cjs/define/index.js.map +1 -1
  4. package/dist/cjs/define/primitive_module.js.map +1 -1
  5. package/dist/cjs/define/slack_blocks.js.map +1 -1
  6. package/dist/cjs/entries/index.js +3 -1
  7. package/dist/cjs/entries/index.js.map +1 -1
  8. package/dist/cjs/entries/markdown.js +2 -1
  9. package/dist/cjs/entries/markdown.js.map +1 -1
  10. package/dist/cjs/entries/react.js +2 -1
  11. package/dist/cjs/entries/react.js.map +1 -1
  12. package/dist/cjs/entries/slack.js +5 -1
  13. package/dist/cjs/entries/slack.js.map +1 -1
  14. package/dist/cjs/pack/enhancements.js.map +1 -1
  15. package/dist/cjs/render/markdown/blocks.js +82 -0
  16. package/dist/cjs/render/markdown/blocks.js.map +1 -0
  17. package/dist/cjs/render/markdown/index.js +3 -1
  18. package/dist/cjs/render/markdown/index.js.map +1 -1
  19. package/dist/cjs/render/primitive_dispatch.js +36 -6
  20. package/dist/cjs/render/primitive_dispatch.js.map +1 -1
  21. package/dist/cjs/render/react/index.js +3 -1
  22. package/dist/cjs/render/react/index.js.map +1 -1
  23. package/dist/cjs/render/react/markdown_content.js +143 -0
  24. package/dist/cjs/render/react/markdown_content.js.map +1 -0
  25. package/dist/cjs/render/slack/blocks.js +7 -0
  26. package/dist/cjs/render/slack/blocks.js.map +1 -1
  27. package/dist/cjs/render/slack/container.js +62 -0
  28. package/dist/cjs/render/slack/container.js.map +1 -0
  29. package/dist/cjs/render/slack/envelope.js +70 -14
  30. package/dist/cjs/render/slack/envelope.js.map +1 -1
  31. package/dist/cjs/render/slack/format.js +56 -6
  32. package/dist/cjs/render/slack/format.js.map +1 -1
  33. package/dist/cjs/render/slack/index.js +7 -1
  34. package/dist/cjs/render/slack/index.js.map +1 -1
  35. package/dist/cjs/render/slack/markdown_content.js +29 -76
  36. package/dist/cjs/render/slack/markdown_content.js.map +1 -1
  37. package/dist/cjs/render/slack/unmodeled.js +38 -0
  38. package/dist/cjs/render/slack/unmodeled.js.map +1 -0
  39. package/dist/cjs/testing/conformance.js +15 -1
  40. package/dist/cjs/testing/conformance.js.map +1 -1
  41. package/dist/cjs/testing/index.js +2 -1
  42. package/dist/cjs/testing/index.js.map +1 -1
  43. package/dist/composition/error.d.ts +1 -0
  44. package/dist/composition/error.d.ts.map +1 -1
  45. package/dist/composition/error.js +1 -0
  46. package/dist/composition/error.js.map +1 -1
  47. package/dist/define/index.d.ts +1 -1
  48. package/dist/define/index.d.ts.map +1 -1
  49. package/dist/define/index.js.map +1 -1
  50. package/dist/define/primitive_module.d.ts +7 -5
  51. package/dist/define/primitive_module.d.ts.map +1 -1
  52. package/dist/define/primitive_module.js.map +1 -1
  53. package/dist/define/slack_blocks.d.ts +31 -1
  54. package/dist/define/slack_blocks.d.ts.map +1 -1
  55. package/dist/define/slack_blocks.js.map +1 -1
  56. package/dist/entries/index.d.ts +1 -1
  57. package/dist/entries/index.d.ts.map +1 -1
  58. package/dist/entries/index.js +1 -1
  59. package/dist/entries/index.js.map +1 -1
  60. package/dist/entries/markdown.d.ts +1 -1
  61. package/dist/entries/markdown.d.ts.map +1 -1
  62. package/dist/entries/markdown.js +1 -1
  63. package/dist/entries/markdown.js.map +1 -1
  64. package/dist/entries/react.d.ts +1 -1
  65. package/dist/entries/react.d.ts.map +1 -1
  66. package/dist/entries/react.js +1 -1
  67. package/dist/entries/react.js.map +1 -1
  68. package/dist/entries/slack.d.ts +1 -1
  69. package/dist/entries/slack.d.ts.map +1 -1
  70. package/dist/entries/slack.js +1 -1
  71. package/dist/entries/slack.js.map +1 -1
  72. package/dist/pack/enhancements.d.ts +4 -0
  73. package/dist/pack/enhancements.d.ts.map +1 -1
  74. package/dist/pack/enhancements.js.map +1 -1
  75. package/dist/render/markdown/blocks.d.ts +6 -0
  76. package/dist/render/markdown/blocks.d.ts.map +1 -0
  77. package/dist/render/markdown/blocks.js +77 -0
  78. package/dist/render/markdown/blocks.js.map +1 -0
  79. package/dist/render/markdown/index.d.ts +1 -0
  80. package/dist/render/markdown/index.d.ts.map +1 -1
  81. package/dist/render/markdown/index.js +1 -0
  82. package/dist/render/markdown/index.js.map +1 -1
  83. package/dist/render/primitive_dispatch.d.ts +4 -2
  84. package/dist/render/primitive_dispatch.d.ts.map +1 -1
  85. package/dist/render/primitive_dispatch.js +36 -6
  86. package/dist/render/primitive_dispatch.js.map +1 -1
  87. package/dist/render/react/index.d.ts +1 -0
  88. package/dist/render/react/index.d.ts.map +1 -1
  89. package/dist/render/react/index.js +1 -0
  90. package/dist/render/react/index.js.map +1 -1
  91. package/dist/render/react/markdown_content.d.ts +9 -0
  92. package/dist/render/react/markdown_content.d.ts.map +1 -0
  93. package/dist/render/react/markdown_content.js +139 -0
  94. package/dist/render/react/markdown_content.js.map +1 -0
  95. package/dist/render/slack/blocks.d.ts +8 -1
  96. package/dist/render/slack/blocks.d.ts.map +1 -1
  97. package/dist/render/slack/blocks.js +7 -0
  98. package/dist/render/slack/blocks.js.map +1 -1
  99. package/dist/render/slack/container.d.ts +25 -0
  100. package/dist/render/slack/container.d.ts.map +1 -0
  101. package/dist/render/slack/container.js +55 -0
  102. package/dist/render/slack/container.js.map +1 -0
  103. package/dist/render/slack/envelope.d.ts +6 -4
  104. package/dist/render/slack/envelope.d.ts.map +1 -1
  105. package/dist/render/slack/envelope.js +71 -15
  106. package/dist/render/slack/envelope.js.map +1 -1
  107. package/dist/render/slack/format.d.ts +15 -3
  108. package/dist/render/slack/format.d.ts.map +1 -1
  109. package/dist/render/slack/format.js +54 -5
  110. package/dist/render/slack/format.js.map +1 -1
  111. package/dist/render/slack/index.d.ts +4 -2
  112. package/dist/render/slack/index.d.ts.map +1 -1
  113. package/dist/render/slack/index.js +2 -0
  114. package/dist/render/slack/index.js.map +1 -1
  115. package/dist/render/slack/markdown_content.d.ts +3 -2
  116. package/dist/render/slack/markdown_content.d.ts.map +1 -1
  117. package/dist/render/slack/markdown_content.js +20 -67
  118. package/dist/render/slack/markdown_content.js.map +1 -1
  119. package/dist/render/slack/unmodeled.d.ts +16 -0
  120. package/dist/render/slack/unmodeled.d.ts.map +1 -0
  121. package/dist/render/slack/unmodeled.js +32 -0
  122. package/dist/render/slack/unmodeled.js.map +1 -0
  123. package/dist/testing/conformance.d.ts +3 -1
  124. package/dist/testing/conformance.d.ts.map +1 -1
  125. package/dist/testing/conformance.js +14 -0
  126. package/dist/testing/conformance.js.map +1 -1
  127. package/dist/testing/index.d.ts +1 -1
  128. package/dist/testing/index.d.ts.map +1 -1
  129. package/dist/testing/index.js +1 -1
  130. package/dist/testing/index.js.map +1 -1
  131. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"slack_blocks.js","sourceRoot":"","sources":["../../src/define/slack_blocks.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\n// Slack surface output types for SurfaceMap. Not wire format.\n//\n// Message-surface Block Kit only (channel/DM posts). Field names and shapes\n// match Slack's JSON so output can go to `chat.postMessage`. Fields are\n// commented only where this subset departs from the published contract, or\n// where Slack's behavior is not evident from the name.\n//\n// References:\n// https://api.slack.com/reference/block-kit/blocks\n// https://api.slack.com/reference/block-kit/composition-objects\n// https://api.slack.com/reference/block-kit/block-elements\n\nexport interface SlackPlainTextObject {\n type: 'plain_text';\n text: string;\n emoji?: boolean;\n}\n\nexport interface SlackMrkdwnTextObject {\n type: 'mrkdwn';\n text: string;\n /** When true, Slack skips auto-linking URLs, channels, and users. Defaults to false. */\n verbatim?: boolean;\n}\n\nexport type SlackTextObject = SlackPlainTextObject | SlackMrkdwnTextObject;\n\nexport type SlackHeaderLevel = 1 | 2 | 3 | 4;\n\nexport interface SlackHeaderBlock {\n type: 'header';\n block_id?: string;\n text: SlackPlainTextObject;\n /** H1–H4 sizing. Accepted on message, modal, and Home tab surfaces. */\n level?: SlackHeaderLevel;\n}\n\nexport interface SlackSectionBlock {\n type: 'section';\n block_id?: string;\n text?: SlackTextObject;\n fields?: SlackMrkdwnTextObject[];\n accessory?: SlackSectionAccessory;\n}\n\nexport interface SlackDividerBlock {\n type: 'divider';\n block_id?: string;\n}\n\n/**\n * Inline image used inside `context` blocks and as a `section` accessory.\n * Distinct from the block-level {@link SlackImageBlock}.\n */\nexport interface SlackImageElement {\n type: 'image';\n image_url: string;\n alt_text: string;\n}\n\nexport interface SlackContextBlock {\n type: 'context';\n block_id?: string;\n elements: Array<SlackTextObject | SlackImageElement>;\n}\n\nexport interface SlackButtonElement {\n type: 'button';\n text: SlackPlainTextObject;\n url?: string;\n value?: string;\n action_id?: string;\n style?: 'primary' | 'danger';\n}\n\n/**\n * Reference to a file already uploaded to Slack.\n *\n * `id` and `url` are Slack's published fields. `ref` is not: a render cannot\n * upload, so it emits a placeholder the host swaps for Slack's file id once\n * the upload lands. See `SlackAssetCollector`.\n */\nexport interface SlackFileReference {\n id?: string;\n url?: string;\n ref?: string;\n}\n\n/**\n * Block-level image. `image_url` requires a publicly hosted URL; `slack_file`\n * references a file uploaded to Slack first, which is the only VPN-safe path.\n */\nexport interface SlackImageBlock {\n type: 'image';\n block_id?: string;\n alt_text: string;\n image_url?: string;\n slack_file?: SlackFileReference;\n title?: SlackPlainTextObject;\n}\n\n/** `video` block, matching Slack's JSON contract exactly. */\nexport interface SlackVideoBlock {\n type: 'video';\n block_id?: string;\n title: SlackPlainTextObject;\n title_url?: string;\n video_url: string;\n thumbnail_url: string;\n alt_text: string;\n description?: SlackPlainTextObject;\n author_name?: string;\n provider_name?: string;\n provider_icon_url?: string;\n}\n\nexport interface SlackRichTextStyle {\n bold?: boolean;\n italic?: boolean;\n strike?: boolean;\n code?: boolean;\n}\n\nexport interface SlackRichTextText {\n type: 'text';\n text: string;\n style?: SlackRichTextStyle;\n}\n\nexport interface SlackRichTextLink {\n type: 'link';\n url: string;\n text?: string;\n style?: SlackRichTextStyle;\n}\n\nexport type SlackTagColor =\n | 'gray'\n | 'brown'\n | 'purple'\n | 'indigo'\n | 'blue'\n | 'green'\n | 'yellow'\n | 'orange'\n | 'red';\n\nexport interface SlackRichTextTag {\n type: 'tag';\n text: string;\n color?: SlackTagColor;\n style?: SlackRichTextStyle;\n}\n\nexport type SlackRichTextInline =\n SlackRichTextText | SlackRichTextLink | SlackRichTextTag;\n\nexport interface SlackRichTextSection {\n type: 'rich_text_section';\n elements: SlackRichTextInline[];\n}\n\nexport interface SlackRichTextList {\n type: 'rich_text_list';\n style: 'bullet' | 'ordered';\n indent?: number;\n /** Added to an ordered list's first number, which is otherwise 1. */\n offset?: number;\n border?: number;\n elements: SlackRichTextSection[];\n}\n\nexport interface SlackRichTextPreformatted {\n type: 'rich_text_preformatted';\n border?: number;\n elements: SlackRichTextInline[];\n}\n\nexport interface SlackRichTextQuote {\n type: 'rich_text_quote';\n border?: number;\n elements: SlackRichTextInline[];\n}\n\nexport type SlackRichTextBlockElement =\n | SlackRichTextSection\n | SlackRichTextList\n | SlackRichTextPreformatted\n | SlackRichTextQuote;\n\nexport interface SlackRichTextBlock {\n type: 'rich_text';\n block_id?: string;\n elements: SlackRichTextBlockElement[];\n}\n\n/** The option shape shared by every menu, select, checkbox, and radio element. */\nexport interface SlackOptionObject {\n text: SlackTextObject;\n value: string;\n description?: SlackPlainTextObject;\n /** Only honored inside an `overflow` element. */\n url?: string;\n}\n\nexport interface SlackOptionGroup {\n label: SlackPlainTextObject;\n options: SlackOptionObject[];\n}\n\nexport interface SlackOverflowElement {\n type: 'overflow';\n action_id: string;\n options: SlackOptionObject[];\n}\n\nexport interface SlackStaticSelectElement {\n type: 'static_select';\n action_id: string;\n placeholder?: SlackPlainTextObject;\n options?: SlackOptionObject[];\n option_groups?: SlackOptionGroup[];\n initial_option?: SlackOptionObject;\n}\n\nexport interface SlackMultiStaticSelectElement {\n type: 'multi_static_select';\n action_id: string;\n placeholder?: SlackPlainTextObject;\n options: SlackOptionObject[];\n initial_options?: SlackOptionObject[];\n max_selected_items?: number;\n}\n\nexport interface SlackRadioButtonsElement {\n type: 'radio_buttons';\n action_id: string;\n options: SlackOptionObject[];\n initial_option?: SlackOptionObject;\n}\n\nexport interface SlackCheckboxesElement {\n type: 'checkboxes';\n action_id: string;\n options: SlackOptionObject[];\n initial_options?: SlackOptionObject[];\n}\n\n/** Elements Slack permits inside an `actions` block. */\nexport type SlackActionElement =\n | SlackButtonElement\n | SlackOverflowElement\n | SlackStaticSelectElement\n | SlackMultiStaticSelectElement\n | SlackRadioButtonsElement\n | SlackCheckboxesElement;\n\n/** Elements Slack permits as a `section.accessory`. */\nexport type SlackSectionAccessory =\n | SlackButtonElement\n | SlackImageElement\n | SlackOverflowElement\n | SlackStaticSelectElement\n | SlackMultiStaticSelectElement\n | SlackRadioButtonsElement\n | SlackCheckboxesElement;\n\nexport interface SlackActionsBlock {\n type: 'actions';\n block_id?: string;\n elements: SlackActionElement[];\n}\n\n/** A plain table cell. Strings and numbers use this; see {@link SlackTableCell}. */\nexport interface SlackRawTextElement {\n type: 'raw_text';\n text: string;\n}\n\n/**\n * One table cell. Badge and toned values need the `rich_text` form so a `tag`\n * or bold run can sit inside the grid.\n */\nexport type SlackTableCell = SlackRawTextElement | SlackRichTextBlock;\n\n/**\n * Per-column behavior, positional: entry N configures column N.\n *\n * Trailing columns without an entry keep Slack's defaults (left-aligned, no\n * wrapping), and a `null` entry skips a column.\n */\nexport interface SlackTableColumnSetting {\n align?: 'left' | 'center' | 'right';\n is_wrapped?: boolean;\n}\n\n/**\n * Native `table` block, whose first row renders as the header.\n *\n * Cells, rows, and columns are capped by Slack; see `SLACK_LIMITS`.\n * https://docs.slack.dev/reference/block-kit/blocks/table-block\n */\nexport interface SlackTableBlock {\n type: 'table';\n block_id?: string;\n rows: SlackTableCell[][];\n column_settings?: Array<SlackTableColumnSetting | null>;\n}\n\n/** Every block this renderer emits, and what a `slack` renderer returns. */\nexport type SlackBlock =\n | SlackHeaderBlock\n | SlackSectionBlock\n | SlackDividerBlock\n | SlackImageBlock\n | SlackVideoBlock\n | SlackContextBlock\n | SlackActionsBlock\n | SlackRichTextBlock\n | SlackTableBlock;\n"]}
1
+ {"version":3,"file":"slack_blocks.js","sourceRoot":"","sources":["../../src/define/slack_blocks.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\n// Slack surface output types for SurfaceMap. Not wire format.\n//\n// Message-surface Block Kit only (channel/DM posts). Field names and shapes\n// match Slack's JSON so output can go to `chat.postMessage`. Fields are\n// commented only where this subset departs from the published contract, or\n// where Slack's behavior is not evident from the name.\n//\n// References:\n// https://api.slack.com/reference/block-kit/blocks\n// https://api.slack.com/reference/block-kit/composition-objects\n// https://api.slack.com/reference/block-kit/block-elements\n\nexport interface SlackPlainTextObject {\n type: 'plain_text';\n text: string;\n emoji?: boolean;\n}\n\nexport interface SlackMrkdwnTextObject {\n type: 'mrkdwn';\n text: string;\n /** When true, Slack skips auto-linking URLs, channels, and users. Defaults to false. */\n verbatim?: boolean;\n}\n\nexport type SlackTextObject = SlackPlainTextObject | SlackMrkdwnTextObject;\n\nexport type SlackHeaderLevel = 1 | 2 | 3 | 4;\n\nexport interface SlackHeaderBlock {\n type: 'header';\n block_id?: string;\n text: SlackPlainTextObject;\n /** H1–H4 sizing. Accepted on message, modal, and Home tab surfaces. */\n level?: SlackHeaderLevel;\n}\n\nexport interface SlackSectionBlock {\n type: 'section';\n block_id?: string;\n text?: SlackTextObject;\n fields?: SlackMrkdwnTextObject[];\n accessory?: SlackSectionAccessory;\n}\n\nexport interface SlackDividerBlock {\n type: 'divider';\n block_id?: string;\n}\n\n/**\n * Inline image used inside `context` blocks and as a `section` accessory.\n * Distinct from the block-level {@link SlackImageBlock}.\n */\nexport interface SlackImageElement {\n type: 'image';\n image_url: string;\n alt_text: string;\n}\n\nexport interface SlackContextBlock {\n type: 'context';\n block_id?: string;\n elements: Array<SlackTextObject | SlackImageElement>;\n}\n\nexport interface SlackButtonElement {\n type: 'button';\n text: SlackPlainTextObject;\n url?: string;\n value?: string;\n action_id?: string;\n style?: 'primary' | 'danger';\n}\n\n/**\n * Reference to a file already uploaded to Slack.\n *\n * `id` and `url` are Slack's published fields. `ref` is not: a render cannot\n * upload, so it emits a placeholder the host swaps for Slack's file id once\n * the upload lands. See `SlackAssetCollector`.\n */\nexport interface SlackFileReference {\n id?: string;\n url?: string;\n ref?: string;\n}\n\n/**\n * Block-level image. `image_url` requires a publicly hosted URL; `slack_file`\n * references a file uploaded to Slack first, which is the only VPN-safe path.\n */\nexport interface SlackImageBlock {\n type: 'image';\n block_id?: string;\n alt_text: string;\n image_url?: string;\n slack_file?: SlackFileReference;\n title?: SlackPlainTextObject;\n}\n\n/** `video` block, matching Slack's JSON contract exactly. */\nexport interface SlackVideoBlock {\n type: 'video';\n block_id?: string;\n title: SlackPlainTextObject;\n title_url?: string;\n video_url: string;\n thumbnail_url: string;\n alt_text: string;\n description?: SlackPlainTextObject;\n author_name?: string;\n provider_name?: string;\n provider_icon_url?: string;\n}\n\nexport interface SlackRichTextStyle {\n bold?: boolean;\n italic?: boolean;\n strike?: boolean;\n code?: boolean;\n}\n\nexport interface SlackRichTextText {\n type: 'text';\n text: string;\n style?: SlackRichTextStyle;\n}\n\nexport interface SlackRichTextLink {\n type: 'link';\n url: string;\n text?: string;\n style?: SlackRichTextStyle;\n}\n\nexport type SlackTagColor =\n | 'gray'\n | 'brown'\n | 'purple'\n | 'indigo'\n | 'blue'\n | 'green'\n | 'yellow'\n | 'orange'\n | 'red';\n\nexport interface SlackRichTextTag {\n type: 'tag';\n text: string;\n color?: SlackTagColor;\n style?: SlackRichTextStyle;\n}\n\nexport type SlackRichTextInline =\n SlackRichTextText | SlackRichTextLink | SlackRichTextTag;\n\nexport interface SlackRichTextSection {\n type: 'rich_text_section';\n elements: SlackRichTextInline[];\n}\n\nexport interface SlackRichTextList {\n type: 'rich_text_list';\n style: 'bullet' | 'ordered';\n indent?: number;\n /** Added to an ordered list's first number, which is otherwise 1. */\n offset?: number;\n border?: number;\n elements: SlackRichTextSection[];\n}\n\nexport interface SlackRichTextPreformatted {\n type: 'rich_text_preformatted';\n border?: number;\n elements: SlackRichTextInline[];\n}\n\nexport interface SlackRichTextQuote {\n type: 'rich_text_quote';\n border?: number;\n elements: SlackRichTextInline[];\n}\n\nexport type SlackRichTextBlockElement =\n | SlackRichTextSection\n | SlackRichTextList\n | SlackRichTextPreformatted\n | SlackRichTextQuote;\n\nexport interface SlackRichTextBlock {\n type: 'rich_text';\n block_id?: string;\n elements: SlackRichTextBlockElement[];\n}\n\n/** The option shape shared by every menu, select, checkbox, and radio element. */\nexport interface SlackOptionObject {\n text: SlackTextObject;\n value: string;\n description?: SlackPlainTextObject;\n /** Only honored inside an `overflow` element. */\n url?: string;\n}\n\nexport interface SlackOptionGroup {\n label: SlackPlainTextObject;\n options: SlackOptionObject[];\n}\n\nexport interface SlackOverflowElement {\n type: 'overflow';\n action_id: string;\n options: SlackOptionObject[];\n}\n\nexport interface SlackStaticSelectElement {\n type: 'static_select';\n action_id: string;\n placeholder?: SlackPlainTextObject;\n options?: SlackOptionObject[];\n option_groups?: SlackOptionGroup[];\n initial_option?: SlackOptionObject;\n}\n\nexport interface SlackMultiStaticSelectElement {\n type: 'multi_static_select';\n action_id: string;\n placeholder?: SlackPlainTextObject;\n options: SlackOptionObject[];\n initial_options?: SlackOptionObject[];\n max_selected_items?: number;\n}\n\nexport interface SlackRadioButtonsElement {\n type: 'radio_buttons';\n action_id: string;\n options: SlackOptionObject[];\n initial_option?: SlackOptionObject;\n}\n\nexport interface SlackCheckboxesElement {\n type: 'checkboxes';\n action_id: string;\n options: SlackOptionObject[];\n initial_options?: SlackOptionObject[];\n}\n\n/** Elements Slack permits inside an `actions` block. */\nexport type SlackActionElement =\n | SlackButtonElement\n | SlackOverflowElement\n | SlackStaticSelectElement\n | SlackMultiStaticSelectElement\n | SlackRadioButtonsElement\n | SlackCheckboxesElement;\n\n/** Elements Slack permits as a `section.accessory`. */\nexport type SlackSectionAccessory =\n | SlackButtonElement\n | SlackImageElement\n | SlackOverflowElement\n | SlackStaticSelectElement\n | SlackMultiStaticSelectElement\n | SlackRadioButtonsElement\n | SlackCheckboxesElement;\n\nexport interface SlackActionsBlock {\n type: 'actions';\n block_id?: string;\n elements: SlackActionElement[];\n}\n\n/** A plain table cell. Strings and numbers use this; see {@link SlackTableCell}. */\nexport interface SlackRawTextElement {\n type: 'raw_text';\n text: string;\n}\n\n/**\n * One table cell. Badge and toned values need the `rich_text` form so a `tag`\n * or bold run can sit inside the grid.\n */\nexport type SlackTableCell = SlackRawTextElement | SlackRichTextBlock;\n\n/**\n * Per-column behavior, positional: entry N configures column N.\n *\n * Trailing columns without an entry keep Slack's defaults (left-aligned, no\n * wrapping), and a `null` entry skips a column.\n */\nexport interface SlackTableColumnSetting {\n align?: 'left' | 'center' | 'right';\n is_wrapped?: boolean;\n}\n\n/**\n * Native `table` block, whose first row renders as the header.\n *\n * Cells, rows, and columns are capped by Slack; see `SLACK_LIMITS`.\n * https://docs.slack.dev/reference/block-kit/blocks/table-block\n */\nexport interface SlackTableBlock {\n type: 'table';\n block_id?: string;\n rows: SlackTableCell[][];\n column_settings?: Array<SlackTableColumnSetting | null>;\n}\n\n/** Blocks a {@link SlackContainerBlock} holds. Slack also accepts `file` and `input`, which this subset does not model. */\nexport type SlackContainerChildBlock =\n | SlackHeaderBlock\n | SlackSectionBlock\n | SlackDividerBlock\n | SlackImageBlock\n | SlackVideoBlock\n | SlackContextBlock\n | SlackActionsBlock\n | SlackRichTextBlock\n | SlackTableBlock;\n\ninterface SlackContainerFields {\n type: 'container';\n block_id?: string;\n subtitle?: SlackTextObject;\n icon?: SlackImageElement;\n /** Between 1 and `SLACK_LIMITS.containerChildBlocks`; Slack rejects a nested `container`. */\n child_blocks: SlackContainerChildBlock[];\n width?: 'narrow' | 'standard' | 'wide' | 'full';\n is_collapsible?: boolean;\n /** Only honored when `is_collapsible` is set. */\n default_collapsed?: boolean;\n /** Only honored when the container is not collapsible. */\n has_header_divider?: boolean;\n}\n\n/**\n * Titled group of child blocks, optionally collapsible. Slack shows\n * `rich_text_title` over `title` when both are set.\n *\n * https://docs.slack.dev/reference/block-kit/blocks/container-block\n */\nexport type SlackContainerBlock = SlackContainerFields &\n (\n | { title: SlackPlainTextObject; rich_text_title?: SlackRichTextBlock }\n | { title?: SlackPlainTextObject; rich_text_title: SlackRichTextBlock }\n );\n\n/** Every block this renderer emits, and what a `slack` renderer returns. */\nexport type SlackBlock = SlackContainerChildBlock | SlackContainerBlock;\n"]}
@@ -2,5 +2,5 @@ export { type ActionEventRef, type BodyNodeBase, type ChildNodeRef, type ChildNo
2
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
3
  export { type AnyPrimitivePack, type CapabilitySources, type ComposedPacks, type EnhancementDefinition, type HostCapabilities, type PackAuthoringOptions, type PackStyleAdapter, type PrimitiveGroup, type PrimitivePack, type PrimitivePackInput, type SurfaceSupport, UNCATEGORIZED_GROUP_TITLE, 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
- 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';
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, sanitizeParsedAssetUrl, sanitizeParsedNavigationHref, 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,aAAa,EACb,0BAA0B,EAC1B,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,qBAAqB,EA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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,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,WAAW,EACh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AkB,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,sBAAsB,EACtB,4BAA4B,EAC5B,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,aAAa,CAAC"}
@@ -8,5 +8,5 @@ export { ALL_NAMED_COLORS, BODY_NODE_SURFACES, ISOMER_ERROR_CODES, STRUCTURED_VA
8
8
  export { ICON_VARS, OPTIONAL_SURFACES, bindFrame, definePrimitive, definePrimitiveFor, exampleNodes, formatZodIssues, primitiveExamples, requiredString, unresolvedBodyNodeSchema, z, } from '../define/index.js';
9
9
  export { UNCATEGORIZED_GROUP_TITLE, 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
- 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';
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, sanitizeParsedAssetUrl, sanitizeParsedNavigationHref, structuredValueSchema, warningsForSurface, } from '../validate/index.js';
12
12
  //# sourceMappingURL=index.js.map
@@ -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,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,yBAAyB,EACzB,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 UNCATEGORIZED_GROUP_TITLE,\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,yBAAyB,EACzB,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,sBAAsB,EACtB,4BAA4B,EAC5B,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 UNCATEGORIZED_GROUP_TITLE,\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 sanitizeParsedAssetUrl,\n sanitizeParsedNavigationHref,\n structuredValueSchema,\n warningsForSurface,\n} from '../validate';\n"]}
@@ -1,3 +1,3 @@
1
1
  export { type MarkdownBlock, type MarkdownContent, type MarkdownInline, type MarkdownInlineInput, } from '../define/index.js';
2
- export { type AuthoredMarkdownSegment, type MarkdownEnvelopeDispatcher, type MarkdownEnvelopeOptions, type SplitAuthoredMarkdownOptions, md, renderMarkdownEnvelope, serializeMarkdown, splitAuthoredMarkdown, } from '../render/markdown/index.js';
2
+ export { type AuthoredMarkdownSegment, type MarkdownEnvelopeDispatcher, type MarkdownEnvelopeOptions, type SplitAuthoredMarkdownOptions, exceedsParseBudget, md, renderMarkdownEnvelope, serializeMarkdown, splitAuthoredMarkdown, } from '../render/markdown/index.js';
3
3
  //# sourceMappingURL=markdown.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/entries/markdown.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,EAAE,EACF,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/entries/markdown.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,kBAAkB,EAClB,EAAE,EACF,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,oBAAoB,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 { md, renderMarkdownEnvelope, serializeMarkdown, splitAuthoredMarkdown, } from '../render/markdown/index.js';
7
+ export { exceedsParseBudget, md, renderMarkdownEnvelope, serializeMarkdown, splitAuthoredMarkdown, } from '../render/markdown/index.js';
8
8
  //# sourceMappingURL=markdown.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../src/entries/markdown.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,EAKL,EAAE,EACF,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,oBAAoB,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 MarkdownBlock,\n type MarkdownContent,\n type MarkdownInline,\n type MarkdownInlineInput,\n} from '../define';\n\nexport {\n type AuthoredMarkdownSegment,\n type MarkdownEnvelopeDispatcher,\n type MarkdownEnvelopeOptions,\n type SplitAuthoredMarkdownOptions,\n md,\n renderMarkdownEnvelope,\n serializeMarkdown,\n splitAuthoredMarkdown,\n} from '../render/markdown';\n"]}
1
+ {"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../src/entries/markdown.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,EAKL,kBAAkB,EAClB,EAAE,EACF,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,oBAAoB,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 MarkdownBlock,\n type MarkdownContent,\n type MarkdownInline,\n type MarkdownInlineInput,\n} from '../define';\n\nexport {\n type AuthoredMarkdownSegment,\n type MarkdownEnvelopeDispatcher,\n type MarkdownEnvelopeOptions,\n type SplitAuthoredMarkdownOptions,\n exceedsParseBudget,\n md,\n renderMarkdownEnvelope,\n serializeMarkdown,\n splitAuthoredMarkdown,\n} from '../render/markdown';\n"]}
@@ -1,5 +1,5 @@
1
1
  export { runEnhancementScript } from '../pack/enhancements.js';
2
2
  export { findNodeElementPairs } from '../render/anchors.js';
3
3
  export { measureDom } from '../render/measure_dom.js';
4
- export { type CompositionWrapperOptions, type ReactContentDispatcher, type ReactContentOptions, applyEnhancements, renderCompositionContent, wrapCompositionContent, } from '../render/react/index.js';
4
+ export { type CompositionWrapperOptions, type ReactContentDispatcher, type ReactContentOptions, applyEnhancements, renderCompositionContent, renderMarkdownContent, wrapCompositionContent, } from '../render/react/index.js';
5
5
  //# sourceMappingURL=react.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/entries/react.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/entries/react.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,iBAAiB,CAAC"}
@@ -7,5 +7,5 @@
7
7
  export { runEnhancementScript } from '../pack/enhancements.js';
8
8
  export { findNodeElementPairs } from '../render/anchors.js';
9
9
  export { measureDom } from '../render/measure_dom.js';
10
- export { applyEnhancements, renderCompositionContent, wrapCompositionContent, } from '../render/react/index.js';
10
+ export { applyEnhancements, renderCompositionContent, renderMarkdownContent, wrapCompositionContent, } from '../render/react/index.js';
11
11
  //# sourceMappingURL=react.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/entries/react.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAIL,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,iBAAiB,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 { runEnhancementScript } from '../pack/enhancements';\nexport { findNodeElementPairs } from '../render/anchors';\nexport { measureDom } from '../render/measure_dom';\nexport {\n type CompositionWrapperOptions,\n type ReactContentDispatcher,\n type ReactContentOptions,\n applyEnhancements,\n renderCompositionContent,\n wrapCompositionContent,\n} from '../render/react';\n"]}
1
+ {"version":3,"file":"react.js","sourceRoot":"","sources":["../../src/entries/react.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAIL,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,iBAAiB,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 { runEnhancementScript } from '../pack/enhancements';\nexport { findNodeElementPairs } from '../render/anchors';\nexport { measureDom } from '../render/measure_dom';\nexport {\n type CompositionWrapperOptions,\n type ReactContentDispatcher,\n type ReactContentOptions,\n applyEnhancements,\n renderCompositionContent,\n renderMarkdownContent,\n wrapCompositionContent,\n} from '../render/react';\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, 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 SlackContainerBlock, type SlackContainerChildBlock, type SlackContainerOptions, type SlackContextBlock, type SlackDividerBlock, type SlackEnvelopeDispatcher, type SlackEnvelopeOptions, type SlackEnvelopeResult, type SlackFileReference, type SlackHeaderBlock, type SlackHeaderLevel, type SlackImageBlock, type SlackImageElement, type SlackLinkOptions, 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, isModeledSlackBlockType, isSlackReachableImageUrl, isUnmodeledSlackBlock, italic, link, markdownContentToSlackBlocks, renderSlackEnvelope, slackContainer, slackLinkUrl, strike, unmodeledSlackBlock, } 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,yBAAyB,EAC9B,KAAK,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,I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AK,eAAe,EACpB,YAAY,EACZ,IAAI,EACJ,cAAc,EACd,IAAI,EACJ,SAAS,EACT,yBAAyB,EACzB,YAAY,EACZ,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACrB,MAAM,EACN,IAAI,EACJ,4BAA4B,EAC5B,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,MAAM,EACN,mBAAmB,GACpB,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, isSlackReachableImageUrl, italic, link, markdownContentToSlackBlocks, renderSlackEnvelope, slackLinkUrl, strike, } from '../render/slack/index.js';
7
+ export { SLACK_LIMITS, bold, clampSlackText, code, codeBlock, createSlackAssetCollector, escapeMrkdwn, isModeledSlackBlockType, isSlackReachableImageUrl, isUnmodeledSlackBlock, italic, link, markdownContentToSlackBlocks, renderSlackEnvelope, slackContainer, slackLinkUrl, strike, unmodeledSlackBlock, } from '../render/slack/index.js';
8
8
  //# sourceMappingURL=slack.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"slack.js","sourceRoot":"","sources":["../../src/entries/slack.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EA8CL,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","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 SlackActionElement,\n type SlackActionsBlock,\n type SlackAssetCollector,\n type SlackAssetRequest,\n type SlackBlock,\n type SlackButtonElement,\n type SlackCheckboxesElement,\n type SlackContextBlock,\n type SlackDividerBlock,\n type SlackEnvelopeDispatcher,\n type SlackEnvelopeOptions,\n type SlackEnvelopeResult,\n type SlackFileReference,\n type SlackHeaderBlock,\n type SlackHeaderLevel,\n type SlackImageBlock,\n type SlackImageElement,\n type SlackMrkdwnTextObject,\n type SlackMultiStaticSelectElement,\n type SlackOptionGroup,\n type SlackOptionObject,\n type SlackOverflowElement,\n type SlackPlainTextObject,\n type SlackRadioButtonsElement,\n type SlackRawTextElement,\n type SlackRichTextBlock,\n type SlackRichTextBlockElement,\n type SlackRichTextInline,\n type SlackRichTextLink,\n type SlackRichTextList,\n type SlackRichTextPreformatted,\n type SlackRichTextQuote,\n type SlackRichTextSection,\n type SlackRichTextStyle,\n type SlackRichTextTag,\n type SlackRichTextText,\n type SlackSectionAccessory,\n type SlackSectionBlock,\n type SlackStaticSelectElement,\n type SlackTableBlock,\n type SlackTableCell,\n type SlackTableColumnSetting,\n type SlackTagColor,\n type SlackTextObject,\n type SlackVideoBlock,\n SLACK_LIMITS,\n bold,\n clampSlackText,\n code,\n codeBlock,\n createSlackAssetCollector,\n escapeMrkdwn,\n isSlackReachableImageUrl,\n italic,\n link,\n markdownContentToSlackBlocks,\n renderSlackEnvelope,\n slackLinkUrl,\n strike,\n} from '../render/slack';\n"]}
1
+ {"version":3,"file":"slack.js","sourceRoot":"","sources":["../../src/entries/slack.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAkDL,YAAY,EACZ,IAAI,EACJ,cAAc,EACd,IAAI,EACJ,SAAS,EACT,yBAAyB,EACzB,YAAY,EACZ,uBAAuB,EACvB,wBAAwB,EACxB,qBAAqB,EACrB,MAAM,EACN,IAAI,EACJ,4BAA4B,EAC5B,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,MAAM,EACN,mBAAmB,GACpB,MAAM,iBAAiB,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 SlackActionElement,\n type SlackActionsBlock,\n type SlackAssetCollector,\n type SlackAssetRequest,\n type SlackBlock,\n type SlackButtonElement,\n type SlackCheckboxesElement,\n type SlackContainerBlock,\n type SlackContainerChildBlock,\n type SlackContainerOptions,\n type SlackContextBlock,\n type SlackDividerBlock,\n type SlackEnvelopeDispatcher,\n type SlackEnvelopeOptions,\n type SlackEnvelopeResult,\n type SlackFileReference,\n type SlackHeaderBlock,\n type SlackHeaderLevel,\n type SlackImageBlock,\n type SlackImageElement,\n type SlackLinkOptions,\n type SlackMrkdwnTextObject,\n type SlackMultiStaticSelectElement,\n type SlackOptionGroup,\n type SlackOptionObject,\n type SlackOverflowElement,\n type SlackPlainTextObject,\n type SlackRadioButtonsElement,\n type SlackRawTextElement,\n type SlackRichTextBlock,\n type SlackRichTextBlockElement,\n type SlackRichTextInline,\n type SlackRichTextLink,\n type SlackRichTextList,\n type SlackRichTextPreformatted,\n type SlackRichTextQuote,\n type SlackRichTextSection,\n type SlackRichTextStyle,\n type SlackRichTextTag,\n type SlackRichTextText,\n type SlackSectionAccessory,\n type SlackSectionBlock,\n type SlackStaticSelectElement,\n type SlackTableBlock,\n type SlackTableCell,\n type SlackTableColumnSetting,\n type SlackTagColor,\n type SlackTextObject,\n type SlackVideoBlock,\n SLACK_LIMITS,\n bold,\n clampSlackText,\n code,\n codeBlock,\n createSlackAssetCollector,\n escapeMrkdwn,\n isModeledSlackBlockType,\n isSlackReachableImageUrl,\n isUnmodeledSlackBlock,\n italic,\n link,\n markdownContentToSlackBlocks,\n renderSlackEnvelope,\n slackContainer,\n slackLinkUrl,\n strike,\n unmodeledSlackBlock,\n} from '../render/slack';\n"]}
@@ -10,6 +10,10 @@ import type { PrimitiveNode } from '../composition/node.js';
10
10
  export interface EnhancementDefinition {
11
11
  /** What a renderer tests for via `context.enhancements`. Unique across a runtime's packs. */
12
12
  id: string;
13
+ /** Short label for hosts; when omitted, use {@link EnhancementDefinition.id}. */
14
+ name?: string;
15
+ /** What enabling the enhancement does, for host UI and authoring material. */
16
+ description?: string;
13
17
  /**
14
18
  * Whether this composition has anything for the enhancement to act on.
15
19
  * Gating on content rather than the opt-in alone is what keeps a composition
@@ -1 +1 @@
1
- {"version":3,"file":"enhancements.d.ts","sourceRoot":"","sources":["../../src/pack/enhancements.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,6FAA6F;IAC7F,EAAE,EAAE,MAAM,CAAC;IACX;;;;;;;OAOG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,SAAS,aAAa,EAAE,EAAE,IAAI,EAAE,eAAe,KAAK,OAAO,CAAC;IAC9E;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2GAA2G;IAC3G,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,MAAM,SAAS,aAAa,EAAE,EAC9B,MAAM,eAAe,EACrB,aAAa,SAAS,qBAAqB,EAAE,EAC7C,YAAY,SAAS,MAAM,EAAE,KAC5B,qBAAqB,EAcvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,KAAG,MAAoC,CAAC;AAEhF,iEAAiE;AACjE,eAAO,MAAM,yBAAyB,uBAAuB,CAAC;AAE9D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,GAAI,IAAI,MAAM,EAAE,MAAM,OAAO,KAAG,IAkBhE,CAAC"}
1
+ {"version":3,"file":"enhancements.d.ts","sourceRoot":"","sources":["../../src/pack/enhancements.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,6FAA6F;IAC7F,EAAE,EAAE,MAAM,CAAC;IACX,iFAAiF;IACjF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;OAOG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,SAAS,aAAa,EAAE,EAAE,IAAI,EAAE,eAAe,KAAK,OAAO,CAAC;IAC9E;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2GAA2G;IAC3G,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,MAAM,SAAS,aAAa,EAAE,EAC9B,MAAM,eAAe,EACrB,aAAa,SAAS,qBAAqB,EAAE,EAC7C,YAAY,SAAS,MAAM,EAAE,KAC5B,qBAAqB,EAcvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,KAAG,MAAoC,CAAC;AAEhF,iEAAiE;AACjE,eAAO,MAAM,yBAAyB,uBAAuB,CAAC;AAE9D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,GAAI,IAAI,MAAM,EAAE,MAAM,OAAO,KAAG,IAkBhE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"enhancements.js","sourceRoot":"","sources":["../../src/pack/enhancements.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAwCnD;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,IAA8B,EAC9B,IAAqB,EACrB,WAA6C,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AAC;QAChE,GAAG,CAAC,IAAI,CAAC,CAAC;IACZ,CAAC;AACH,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 { ChildNodeWalker } from '../composition/body_node_base';\nimport { IsomerError } from '../composition/error';\nimport type { PrimitiveNode } from '../composition/node';\n\n/**\n * A progressive enhancement any vocabulary pack may declare.\n *\n * Ids are open strings rather than a closed union so a second pack can\n * register one without editing a shared type. Duplicate ids across packs in\n * one runtime are rejected at construction.\n */\nexport interface EnhancementDefinition {\n /** What a renderer tests for via `context.enhancements`. Unique across a runtime's packs. */\n id: string;\n /**\n * Whether this composition has anything for the enhancement to act on.\n * Gating on content rather than the opt-in alone is what keeps a composition\n * with no matching node from shipping the script.\n *\n * `walk` is the composition's child walker, so a match nested inside a\n * container from another pack is still found.\n */\n appliesTo: (body: readonly PrimitiveNode[], walk: ChildNodeWalker) => boolean;\n /**\n * A function body with `root: Element`, the render's `.isomer` section, in\n * scope. It runs in its own function, so a top-level `const` or `return`\n * cannot reach another enhancement. Absent when the host drives the\n * enhancement itself.\n *\n * It must not look for its root through `document.currentScript`, which is\n * `null` inside a shadow root. It must address markup through `data-*`\n * attributes rather than class names: class names are minified per render,\n * and a selector written against one is a contract nothing checks. An event\n * meant for the host sets `composed: true` as well as `bubbles: true`, or it\n * stops at a shadow boundary.\n */\n script?: string;\n /** Renders node anchors when resolved, for an enhancement that finds nodes with `findNodeElementPairs`. */\n anchors?: true;\n}\n\n/**\n * The `definitions` that apply to `body`, the first of each id, limited to\n * `requested` ids when given. The HTML and React surfaces both resolve through\n * it, so the two cannot disagree on which enhancements a render carries.\n */\nexport const resolveEnhancements = (\n body: readonly PrimitiveNode[],\n walk: ChildNodeWalker,\n definitions: readonly EnhancementDefinition[],\n requested?: readonly string[]\n): EnhancementDefinition[] => {\n const wanted = requested && new Set(requested);\n const ids = new Set<string>();\n return definitions.filter((definition) => {\n if (\n ids.has(definition.id) ||\n (wanted && !wanted.has(definition.id)) ||\n !definition.appliesTo(body, walk)\n ) {\n return false;\n }\n ids.add(definition.id);\n return true;\n });\n};\n\n/**\n * Wraps one script body in its own function, so its `const`s and a top-level\n * `return` stay its own. Anything that joins script bodies scopes each first.\n */\nexport const scopeScript = (body: string): string => `(() => {\\n${body}\\n})();`;\n\n/** Marks the `<script>` a `scripts: 'embedded'` render emits. */\nexport const EMBEDDED_SCRIPT_ATTRIBUTE = 'data-isomer-script';\n\n/**\n * Runs a `scripts: 'host'` render's `js` against the\n * `.isomer` section the host inserted.\n *\n * Needed wherever the HTML is inserted by the host rather than parsed with the\n * page, including every shadow root: such a `<script>` never runs, and one\n * that did would find no `document.currentScript`.\n *\n * Compiles with `new Function`, so a strict Content-Security-Policy must allow\n * `'unsafe-eval'`. A host that cannot should render with `scripts: 'embedded'`\n * into light DOM.\n */\nexport const runEnhancementScript = (js: string, root: Element): void => {\n // Guards untyped callers; typed ones already handled `querySelector`'s null.\n if (!root) {\n throw new IsomerError(\n 'ENHANCEMENT_ROOT_MISSING',\n 'runEnhancementScript: no root element; pass the `.isomer` section the render produced'\n );\n }\n if (root.querySelector(`script[${EMBEDDED_SCRIPT_ATTRIBUTE}]`)) {\n console.warn(\n \"isomer: this HTML was rendered with scripts: 'embedded'; render with scripts: 'host' so its enhancements run once\"\n );\n }\n if (js) {\n // eslint-disable-next-line @typescript-eslint/no-implied-eval -- compiling the render's script is the point.\n const run = new Function('root', js) as (root: Element) => void;\n run(root);\n }\n};\n"]}
1
+ {"version":3,"file":"enhancements.js","sourceRoot":"","sources":["../../src/pack/enhancements.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AA4CnD;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,IAA8B,EAC9B,IAAqB,EACrB,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AA4B,CAAC;QAChE,GAAG,CAAC,IAAI,CAAC,CAAC;IACZ,CAAC;AACH,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 { ChildNodeWalker } from '../composition/body_node_base';\nimport { IsomerError } from '../composition/error';\nimport type { PrimitiveNode } from '../composition/node';\n\n/**\n * A progressive enhancement any vocabulary pack may declare.\n *\n * Ids are open strings rather than a closed union so a second pack can\n * register one without editing a shared type. Duplicate ids across packs in\n * one runtime are rejected at construction.\n */\nexport interface EnhancementDefinition {\n /** What a renderer tests for via `context.enhancements`. Unique across a runtime's packs. */\n id: string;\n /** Short label for hosts; when omitted, use {@link EnhancementDefinition.id}. */\n name?: string;\n /** What enabling the enhancement does, for host UI and authoring material. */\n description?: string;\n /**\n * Whether this composition has anything for the enhancement to act on.\n * Gating on content rather than the opt-in alone is what keeps a composition\n * with no matching node from shipping the script.\n *\n * `walk` is the composition's child walker, so a match nested inside a\n * container from another pack is still found.\n */\n appliesTo: (body: readonly PrimitiveNode[], walk: ChildNodeWalker) => boolean;\n /**\n * A function body with `root: Element`, the render's `.isomer` section, in\n * scope. It runs in its own function, so a top-level `const` or `return`\n * cannot reach another enhancement. Absent when the host drives the\n * enhancement itself.\n *\n * It must not look for its root through `document.currentScript`, which is\n * `null` inside a shadow root. It must address markup through `data-*`\n * attributes rather than class names: class names are minified per render,\n * and a selector written against one is a contract nothing checks. An event\n * meant for the host sets `composed: true` as well as `bubbles: true`, or it\n * stops at a shadow boundary.\n */\n script?: string;\n /** Renders node anchors when resolved, for an enhancement that finds nodes with `findNodeElementPairs`. */\n anchors?: true;\n}\n\n/**\n * The `definitions` that apply to `body`, the first of each id, limited to\n * `requested` ids when given. The HTML and React surfaces both resolve through\n * it, so the two cannot disagree on which enhancements a render carries.\n */\nexport const resolveEnhancements = (\n body: readonly PrimitiveNode[],\n walk: ChildNodeWalker,\n definitions: readonly EnhancementDefinition[],\n requested?: readonly string[]\n): EnhancementDefinition[] => {\n const wanted = requested && new Set(requested);\n const ids = new Set<string>();\n return definitions.filter((definition) => {\n if (\n ids.has(definition.id) ||\n (wanted && !wanted.has(definition.id)) ||\n !definition.appliesTo(body, walk)\n ) {\n return false;\n }\n ids.add(definition.id);\n return true;\n });\n};\n\n/**\n * Wraps one script body in its own function, so its `const`s and a top-level\n * `return` stay its own. Anything that joins script bodies scopes each first.\n */\nexport const scopeScript = (body: string): string => `(() => {\\n${body}\\n})();`;\n\n/** Marks the `<script>` a `scripts: 'embedded'` render emits. */\nexport const EMBEDDED_SCRIPT_ATTRIBUTE = 'data-isomer-script';\n\n/**\n * Runs a `scripts: 'host'` render's `js` against the\n * `.isomer` section the host inserted.\n *\n * Needed wherever the HTML is inserted by the host rather than parsed with the\n * page, including every shadow root: such a `<script>` never runs, and one\n * that did would find no `document.currentScript`.\n *\n * Compiles with `new Function`, so a strict Content-Security-Policy must allow\n * `'unsafe-eval'`. A host that cannot should render with `scripts: 'embedded'`\n * into light DOM.\n */\nexport const runEnhancementScript = (js: string, root: Element): void => {\n // Guards untyped callers; typed ones already handled `querySelector`'s null.\n if (!root) {\n throw new IsomerError(\n 'ENHANCEMENT_ROOT_MISSING',\n 'runEnhancementScript: no root element; pass the `.isomer` section the render produced'\n );\n }\n if (root.querySelector(`script[${EMBEDDED_SCRIPT_ATTRIBUTE}]`)) {\n console.warn(\n \"isomer: this HTML was rendered with scripts: 'embedded'; render with scripts: 'host' so its enhancements run once\"\n );\n }\n if (js) {\n // eslint-disable-next-line @typescript-eslint/no-implied-eval -- compiling the render's script is the point.\n const run = new Function('root', js) as (root: Element) => void;\n run(root);\n }\n};\n"]}
@@ -0,0 +1,6 @@
1
+ import type { MarkdownContent } from '../../define/markdown_content.js';
2
+ /** GFM as mdast blocks with references resolved, typed `unknown[]` so no declaration names mdast; source past the parse budget is its literal paragraphs. */
3
+ export declare const gfmBlocks: (gfm: string) => readonly unknown[];
4
+ /** `content` as flat mdast blocks with authored source parsed, typed `unknown[]` so no declaration names mdast. */
5
+ export declare const resolvedMarkdownBlocks: (content: MarkdownContent) => readonly unknown[];
6
+ //# sourceMappingURL=blocks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../../src/render/markdown/blocks.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AA6DrE,6JAA6J;AAC7J,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,KAAG,SAAS,OAAO,EAAuB,CAAC;AAmBhF,mHAAmH;AACnH,eAAO,MAAM,sBAAsB,GACjC,SAAS,eAAe,KACvB,SAAS,OAAO,EAC2C,CAAC"}
@@ -0,0 +1,77 @@
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
+ import { markdownBlocks, VERBATIM_TYPE } from './builder.js';
8
+ import { parseGfmBlocks } from './format.js';
9
+ // Each reference resolved to its document's first definition.
10
+ const withReferences = (blocks) => {
11
+ const definitions = new Map();
12
+ const collect = (node) => {
13
+ if (node.type === 'definition' && !definitions.has(node.identifier)) {
14
+ definitions.set(node.identifier, node);
15
+ }
16
+ if ('children' in node) {
17
+ node.children.forEach(collect);
18
+ }
19
+ };
20
+ blocks.forEach(collect);
21
+ if (definitions.size === 0) {
22
+ return [...blocks];
23
+ }
24
+ const resolve = (node) => {
25
+ switch (node.type) {
26
+ case 'linkReference':
27
+ return {
28
+ type: 'link',
29
+ url: definitions.get(node.identifier)?.url ?? '',
30
+ title: definitions.get(node.identifier)?.title,
31
+ children: node.children.map(resolve),
32
+ };
33
+ case 'imageReference':
34
+ return {
35
+ type: 'image',
36
+ url: definitions.get(node.identifier)?.url ?? '',
37
+ title: definitions.get(node.identifier)?.title,
38
+ alt: node.alt ?? null,
39
+ };
40
+ default:
41
+ return 'children' in node
42
+ ? { ...node, children: node.children.map(resolve) }
43
+ : node;
44
+ }
45
+ };
46
+ return blocks.map(resolve);
47
+ };
48
+ const lines = (text) => text.replace(/\r\n?/g, '\n');
49
+ const literalParagraphs = (text) => lines(text)
50
+ .split(/\n[ \t]*\n/)
51
+ .filter((paragraph) => paragraph.trim() !== '')
52
+ .map((paragraph) => ({
53
+ type: 'paragraph',
54
+ children: [{ type: 'text', value: paragraph.trim() }],
55
+ }));
56
+ const parsedBlocks = (gfm) => {
57
+ const parsed = parseGfmBlocks(lines(gfm));
58
+ return parsed === null ? literalParagraphs(gfm) : withReferences(parsed);
59
+ };
60
+ /** GFM as mdast blocks with references resolved, typed `unknown[]` so no declaration names mdast; source past the parse budget is its literal paragraphs. */
61
+ export const gfmBlocks = (gfm) => parsedBlocks(gfm);
62
+ // Markdown printed as written is read as the GFM it holds; authored source
63
+ // that sanitizing left inert is never parsed.
64
+ const expanded = (node) => {
65
+ if (node.type === VERBATIM_TYPE) {
66
+ const { value, source } = node;
67
+ return source === undefined
68
+ ? parsedBlocks(value)
69
+ : literalParagraphs(source);
70
+ }
71
+ return 'children' in node
72
+ ? [{ ...node, children: node.children.flatMap(expanded) }]
73
+ : [node];
74
+ };
75
+ /** `content` as flat mdast blocks with authored source parsed, typed `unknown[]` so no declaration names mdast. */
76
+ export const resolvedMarkdownBlocks = (content) => markdownBlocks(content).flatMap(expanded);
77
+ //# sourceMappingURL=blocks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blocks.js","sourceRoot":"","sources":["../../../src/render/markdown/blocks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,8DAA8D;AAC9D,MAAM,cAAc,GAAG,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AAG,CAAC,CAAC;AAEhF,2EAA2E;AAC3E,8CAA8C;AAC9C,MAAM,QAAQ,GAAG,CAAC,IAAW,EAAW,EAAE;IACxC,IAAK,IAAI,CAAC,IAAe,KAAK,aAAa,EAAE,CAAC;QAC5C,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAGzB,CAAC;QACF,OAAO,MAAM,KAAK,SAAS;YACzB,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC;YACrB,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,UAAU,IAAI,IAAI;QACvB,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAW,CAAC;QACnE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACb,CAAC,CAAC;AAEF,mHAAmH;AACnH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,OAAwB,EACJ,EAAE,CACrB,cAAc,CAAC,OAAO,CAAmB,CAAC,OAAO,CAAC,QAAQ,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\n// The mdast blocks behind builder content, shared by the Slack and React\n// translations so both read one parse.\n\nimport type { Definition, Nodes, PhrasingContent, RootContent } from 'mdast';\n\nimport type { MarkdownContent } from '../../define/markdown_content';\n\nimport { markdownBlocks, VERBATIM_TYPE } from './builder';\nimport { parseGfmBlocks } from './format';\n\n// Each reference resolved to its document's first definition.\nconst withReferences = (blocks: readonly RootContent[]): RootContent[] => {\n const definitions = new Map<string, Definition>();\n const collect = (node: Nodes): void => {\n if (node.type === 'definition' && !definitions.has(node.identifier)) {\n definitions.set(node.identifier, node);\n }\n if ('children' in node) {\n node.children.forEach(collect);\n }\n };\n blocks.forEach(collect);\n if (definitions.size === 0) {\n return [...blocks];\n }\n const resolve = (node: Nodes): Nodes => {\n switch (node.type) {\n case 'linkReference':\n return {\n type: 'link',\n url: definitions.get(node.identifier)?.url ?? '',\n title: definitions.get(node.identifier)?.title,\n children: node.children.map(resolve) as PhrasingContent[],\n };\n case 'imageReference':\n return {\n type: 'image',\n url: definitions.get(node.identifier)?.url ?? '',\n title: definitions.get(node.identifier)?.title,\n alt: node.alt ?? null,\n };\n default:\n return 'children' in node\n ? ({ ...node, children: node.children.map(resolve) } as Nodes)\n : node;\n }\n };\n return blocks.map(resolve) as RootContent[];\n};\n\nconst lines = (text: string): string => text.replace(/\\r\\n?/g, '\\n');\n\nconst literalParagraphs = (text: string): RootContent[] =>\n lines(text)\n .split(/\\n[ \\t]*\\n/)\n .filter((paragraph) => paragraph.trim() !== '')\n .map((paragraph) => ({\n type: 'paragraph',\n children: [{ type: 'text', value: paragraph.trim() }],\n }));\n\nconst parsedBlocks = (gfm: string): RootContent[] => {\n const parsed = parseGfmBlocks(lines(gfm)) as RootContent[] | null;\n return parsed === null ? literalParagraphs(gfm) : withReferences(parsed);\n};\n\n/** GFM as mdast blocks with references resolved, typed `unknown[]` so no declaration names mdast; source past the parse budget is its literal paragraphs. */\nexport const gfmBlocks = (gfm: string): readonly unknown[] => parsedBlocks(gfm);\n\n// Markdown printed as written is read as the GFM it holds; authored source\n// that sanitizing left inert is never parsed.\nconst expanded = (node: Nodes): Nodes[] => {\n if ((node.type as string) === VERBATIM_TYPE) {\n const { value, source } = node as unknown as {\n value: string;\n source?: string;\n };\n return source === undefined\n ? parsedBlocks(value)\n : literalParagraphs(source);\n }\n return 'children' in node\n ? [{ ...node, children: node.children.flatMap(expanded) } as Nodes]\n : [node];\n};\n\n/** `content` as flat mdast blocks with authored source parsed, typed `unknown[]` so no declaration names mdast. */\nexport const resolvedMarkdownBlocks = (\n content: MarkdownContent\n): readonly unknown[] =>\n (markdownBlocks(content) as RootContent[]).flatMap(expanded);\n"]}
@@ -1,4 +1,5 @@
1
1
  export { md, serializeMarkdown } from './builder.js';
2
2
  export { type MarkdownEnvelopeDispatcher, type MarkdownEnvelopeOptions, renderMarkdownEnvelope, } from './envelope.js';
3
+ export { exceedsParseBudget } from './format.js';
3
4
  export { type AuthoredMarkdownSegment, type SplitAuthoredMarkdownOptions, splitAuthoredMarkdown, } from './split.js';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/render/markdown/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,sBAAsB,GACvB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,qBAAqB,GACtB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/render/markdown/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,sBAAsB,GACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,qBAAqB,GACtB,MAAM,SAAS,CAAC"}
@@ -6,5 +6,6 @@
6
6
  */
7
7
  export { md, serializeMarkdown } from './builder.js';
8
8
  export { renderMarkdownEnvelope, } from './envelope.js';
9
+ export { exceedsParseBudget } from './format.js';
9
10
  export { splitAuthoredMarkdown, } from './split.js';
10
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/render/markdown/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAGL,sBAAsB,GACvB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAGL,qBAAqB,GACtB,MAAM,SAAS,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 { md, serializeMarkdown } from './builder';\nexport {\n type MarkdownEnvelopeDispatcher,\n type MarkdownEnvelopeOptions,\n renderMarkdownEnvelope,\n} from './envelope';\n\nexport {\n type AuthoredMarkdownSegment,\n type SplitAuthoredMarkdownOptions,\n splitAuthoredMarkdown,\n} from './split';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/render/markdown/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAGL,sBAAsB,GACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9C,OAAO,EAGL,qBAAqB,GACtB,MAAM,SAAS,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 { md, serializeMarkdown } from './builder';\nexport {\n type MarkdownEnvelopeDispatcher,\n type MarkdownEnvelopeOptions,\n renderMarkdownEnvelope,\n} from './envelope';\nexport { exceedsParseBudget } from './format';\n\nexport {\n type AuthoredMarkdownSegment,\n type SplitAuthoredMarkdownOptions,\n splitAuthoredMarkdown,\n} from './split';\n"]}
@@ -3,6 +3,7 @@ import { type SurfaceName } from '../composition/body_node_base.js';
3
3
  import type { ValidationError } from '../composition/validation_error.js';
4
4
  import type { MarkdownContent } from '../define/markdown_content.js';
5
5
  import { type AnyPrimitiveDefinition, type DefaultPackTypes, type PackTypes, type PrimitiveNode, type PrimitiveStyleCollectionContext, type ReactContextArg, type SurfaceMap } from '../define/primitive_module.js';
6
+ import type { SlackLinkOptions } from './slack/format.js';
6
7
  /**
7
8
  * Renders a node on any surface by looking its `type` up in one flattened
8
9
  * inventory.
@@ -39,9 +40,10 @@ export interface PrimitiveDispatcher<TNode extends PrimitiveNode, T extends Pack
39
40
  * Empty when the node is hidden from `slack`, `sanitize` drops it, or its
40
41
  * renderer returns nothing. A node with no `slack` renderer degrades through
41
42
  * its markdown; one `isSlackAssetType` names becomes an `image` block when
42
- * `collector` can allocate.
43
+ * `collector` can allocate. `options.baseUrl` reaches the renderer's env and
44
+ * every child it renders through `scope`.
43
45
  */
44
- renderSlack(node: TNode, collector?: T['slackCollector']): readonly T['slackBlock'][];
46
+ renderSlack(node: TNode, collector?: T['slackCollector'], options?: SlackLinkOptions): readonly T['slackBlock'][];
45
47
  /** `0` when the node is hidden from `snapshot` or its primitive declares no `metrics.snapshotHeight`. */
46
48
  estimateSnapshotHeight(node: TNode): number;
47
49
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"primitive_dispatch.d.ts","sourceRoot":"","sources":["../../src/render/primitive_dispatch.ts"],"names":[],"mappings":"AAOA,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAErE,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,+BAA+B,EACpC,KAAK,eAAe,EAGpB,KAAK,UAAU,EAChB,MAAM,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qDAAqD;IACrD,qBAAqB,CAAC,IAAI,EAAE,KAAK,GAAG,eAAe,CAAC;IACpD;;;;;;OAMG;IACH,WAAW,CACT,IAAI,EAAE,KAAK,EACX,SAAS,CAAC,EAAE,CAAC,CAAC,gBAAgB,CAAC,EAC/B,OAAO,CAAC,EAAE,gBAAgB,GACzB,SAAS,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC;IAC9B,yGAAyG;IACzG,sBAAsB,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC;IAC5C;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC;CACtE;AAoBD,wFAAwF;AACxF,MAAM,WAAW,0BAA0B;IACzC,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,SAAS,CAAC;CAC5D;AAED;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GACpC,KAAK,SAAS,aAAa,EAC3B,CAAC,SAAS,SAAS,GAAG,gBAAgB,EAEtC,aAAa,SAAS,sBAAsB,EAAE,EAC9C,UAAS,0BAA+B,KACvC,mBAAmB,CAAC,KAAK,EAAE,CAAC,CAuN9B,CAAC"}
@@ -57,7 +57,30 @@ export const createPrimitiveDispatcher = (definitions, options = {}) => {
57
57
  // Assigned after helpers that close over this binding.
58
58
  // eslint-disable-next-line prefer-const
59
59
  let self;
60
- const scope = () => self;
60
+ const scopeFor = (surface, extras) => {
61
+ const parent = self;
62
+ if (surface === 'slack') {
63
+ const { baseUrl } = extras;
64
+ return baseUrl === undefined
65
+ ? parent
66
+ : {
67
+ ...parent,
68
+ renderOn: (target, node, targetExtras) => parent.renderOn(target, node, target === 'slack' ? { baseUrl, ...targetExtras } : targetExtras),
69
+ renderSlack: (node, collector) => self.renderSlack(node, collector, { baseUrl }),
70
+ };
71
+ }
72
+ if (surface !== 'snapshot') {
73
+ return parent;
74
+ }
75
+ const { theme } = extras;
76
+ return {
77
+ ...parent,
78
+ renderReact: (node, ...context) => parent.renderOn('snapshot', node, {
79
+ context: context[0] ?? {},
80
+ theme,
81
+ }),
82
+ };
83
+ };
61
84
  const renderOn = (surface, node, extras) => {
62
85
  if (!isVisibleOnSurface(node, surface)) {
63
86
  return undefined;
@@ -71,7 +94,10 @@ export const createPrimitiveDispatcher = (definitions, options = {}) => {
71
94
  // `renderOn` for a node its sanitizer has already run on.
72
95
  const renderSanitized = (surface, definition, safeNode, extras) => {
73
96
  const renderer = definition.renderers[RENDERER_FOR_SURFACE[surface]];
74
- return renderer?.(safeNode, { ...extras, scope: scope() });
97
+ return renderer?.(safeNode, {
98
+ ...extras,
99
+ scope: scopeFor(surface, extras),
100
+ });
75
101
  };
76
102
  const renderMarkdownContent = (node) => renderOn('markdown', node, {}) ?? [];
77
103
  const renderMarkdown = (node) => serializeMarkdown(renderMarkdownContent(node));
@@ -101,7 +127,7 @@ export const createPrimitiveDispatcher = (definitions, options = {}) => {
101
127
  renderText: (node) => renderOn('text', node, {}) ?? '',
102
128
  renderMarkdown,
103
129
  renderMarkdownContent,
104
- renderSlack: (node, collector) => {
130
+ renderSlack: (node, collector, options = {}) => {
105
131
  if (!isVisibleOnSurface(node, 'slack')) {
106
132
  return [];
107
133
  }
@@ -129,15 +155,19 @@ export const createPrimitiveDispatcher = (definitions, options = {}) => {
129
155
  // Degrading here rather than in the envelope is what reaches nested
130
156
  // children: a container's `slack` renderer recurses through this
131
157
  // method, and the envelope only ever sees the container's own output.
132
- return asSlackPayload(markdownContentToSlackBlocks(renderMarkdownContent(node)));
158
+ return asSlackPayload(markdownContentToSlackBlocks(renderMarkdownContent(node), options));
133
159
  }
134
160
  const safeNode = sanitizeNode(definition, node);
135
161
  if (safeNode === null) {
136
162
  return [];
137
163
  }
138
- const rendered = slackRenderer(safeNode, {
164
+ const extras = {
139
165
  ...(collector === undefined ? {} : { collector }),
140
- scope: scope(),
166
+ ...(options.baseUrl === undefined ? {} : { baseUrl: options.baseUrl }),
167
+ };
168
+ const rendered = slackRenderer(safeNode, {
169
+ ...extras,
170
+ scope: scopeFor('slack', extras),
141
171
  });
142
172
  return isReadonlyArray(rendered) ? rendered : [rendered];
143
173
  },