@elastic/isomer-sdk 0.0.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.
- package/LICENSE.txt +93 -0
- package/NOTICE.txt +1861 -0
- package/README.md +69 -0
- package/THIRD_PARTY_LICENSES.md +957 -0
- package/dist/author/authored_fields.d.ts +153 -0
- package/dist/author/authored_fields.d.ts.map +1 -0
- package/dist/author/authored_fields.js +227 -0
- package/dist/author/authored_fields.js.map +1 -0
- package/dist/author/authoring_input.d.ts +7 -0
- package/dist/author/authoring_input.d.ts.map +1 -0
- package/dist/author/authoring_input.js +60 -0
- package/dist/author/authoring_input.js.map +1 -0
- package/dist/author/authoring_model.d.ts +27 -0
- package/dist/author/authoring_model.d.ts.map +1 -0
- package/dist/author/authoring_model.js +98 -0
- package/dist/author/authoring_model.js.map +1 -0
- package/dist/author/declarations.d.ts +13 -0
- package/dist/author/declarations.d.ts.map +1 -0
- package/dist/author/declarations.js +277 -0
- package/dist/author/declarations.js.map +1 -0
- package/dist/author/index.d.ts +7 -0
- package/dist/author/index.d.ts.map +1 -0
- package/dist/author/index.js +12 -0
- package/dist/author/index.js.map +1 -0
- package/dist/author/jsx.d.ts +21 -0
- package/dist/author/jsx.d.ts.map +1 -0
- package/dist/author/jsx.js +20 -0
- package/dist/author/jsx.js.map +1 -0
- package/dist/author/jsx_shim.d.ts +117 -0
- package/dist/author/jsx_shim.d.ts.map +1 -0
- package/dist/author/jsx_shim.js +270 -0
- package/dist/author/jsx_shim.js.map +1 -0
- package/dist/author/prompt.d.ts +58 -0
- package/dist/author/prompt.d.ts.map +1 -0
- package/dist/author/prompt.js +148 -0
- package/dist/author/prompt.js.map +1 -0
- package/dist/author/schema_to_typescript.d.ts +37 -0
- package/dist/author/schema_to_typescript.d.ts.map +1 -0
- package/dist/author/schema_to_typescript.js +286 -0
- package/dist/author/schema_to_typescript.js.map +1 -0
- package/dist/cjs/author/authored_fields.js +233 -0
- package/dist/cjs/author/authored_fields.js.map +1 -0
- package/dist/cjs/author/authoring_input.js +64 -0
- package/dist/cjs/author/authoring_input.js.map +1 -0
- package/dist/cjs/author/authoring_model.js +104 -0
- package/dist/cjs/author/authoring_model.js.map +1 -0
- package/dist/cjs/author/declarations.js +281 -0
- package/dist/cjs/author/declarations.js.map +1 -0
- package/dist/cjs/author/index.js +25 -0
- package/dist/cjs/author/index.js.map +1 -0
- package/dist/cjs/author/jsx.js +24 -0
- package/dist/cjs/author/jsx.js.map +1 -0
- package/dist/cjs/author/jsx_shim.js +276 -0
- package/dist/cjs/author/jsx_shim.js.map +1 -0
- package/dist/cjs/author/prompt.js +153 -0
- package/dist/cjs/author/prompt.js.map +1 -0
- package/dist/cjs/author/schema_to_typescript.js +295 -0
- package/dist/cjs/author/schema_to_typescript.js.map +1 -0
- package/dist/cjs/composition/action_event.js +9 -0
- package/dist/cjs/composition/action_event.js.map +1 -0
- package/dist/cjs/composition/body_node_base.js +112 -0
- package/dist/cjs/composition/body_node_base.js.map +1 -0
- package/dist/cjs/composition/composition.js +9 -0
- package/dist/cjs/composition/composition.js.map +1 -0
- package/dist/cjs/composition/error.js +73 -0
- package/dist/cjs/composition/error.js.map +1 -0
- package/dist/cjs/composition/index.js +32 -0
- package/dist/cjs/composition/index.js.map +1 -0
- package/dist/cjs/composition/map_nodes.js +85 -0
- package/dist/cjs/composition/map_nodes.js.map +1 -0
- package/dist/cjs/composition/named_color.js +20 -0
- package/dist/cjs/composition/named_color.js.map +1 -0
- package/dist/cjs/composition/node.js +9 -0
- package/dist/cjs/composition/node.js.map +1 -0
- package/dist/cjs/composition/one_line.js +23 -0
- package/dist/cjs/composition/one_line.js.map +1 -0
- package/dist/cjs/composition/structured_value.js +21 -0
- package/dist/cjs/composition/structured_value.js.map +1 -0
- package/dist/cjs/composition/validation_error.js +40 -0
- package/dist/cjs/composition/validation_error.js.map +1 -0
- package/dist/cjs/define/frame.js +31 -0
- package/dist/cjs/define/frame.js.map +1 -0
- package/dist/cjs/define/index.js +31 -0
- package/dist/cjs/define/index.js.map +1 -0
- package/dist/cjs/define/markdown_content.js +12 -0
- package/dist/cjs/define/markdown_content.js.map +1 -0
- package/dist/cjs/define/primitive_example.js +26 -0
- package/dist/cjs/define/primitive_example.js.map +1 -0
- package/dist/cjs/define/primitive_icon.js +17 -0
- package/dist/cjs/define/primitive_icon.js.map +1 -0
- package/dist/cjs/define/primitive_module.js +118 -0
- package/dist/cjs/define/primitive_module.js.map +1 -0
- package/dist/cjs/define/slack_assets.js +9 -0
- package/dist/cjs/define/slack_assets.js.map +1 -0
- package/dist/cjs/define/slack_blocks.js +9 -0
- package/dist/cjs/define/slack_blocks.js.map +1 -0
- package/dist/cjs/define/zod_format.js +122 -0
- package/dist/cjs/define/zod_format.js.map +1 -0
- package/dist/cjs/define/zod_helpers.js +26 -0
- package/dist/cjs/define/zod_helpers.js.map +1 -0
- package/dist/cjs/entries/html.js +12 -0
- package/dist/cjs/entries/html.js.map +1 -0
- package/dist/cjs/entries/index.js +80 -0
- package/dist/cjs/entries/index.js.map +1 -0
- package/dist/cjs/entries/markdown.js +14 -0
- package/dist/cjs/entries/markdown.js.map +1 -0
- package/dist/cjs/entries/react.js +20 -0
- package/dist/cjs/entries/react.js.map +1 -0
- package/dist/cjs/entries/slack.js +25 -0
- package/dist/cjs/entries/slack.js.map +1 -0
- package/dist/cjs/entries/text.js +12 -0
- package/dist/cjs/entries/text.js.map +1 -0
- package/dist/cjs/pack/capabilities.js +40 -0
- package/dist/cjs/pack/capabilities.js.map +1 -0
- package/dist/cjs/pack/compose.js +59 -0
- package/dist/cjs/pack/compose.js.map +1 -0
- package/dist/cjs/pack/enhancements.js +65 -0
- package/dist/cjs/pack/enhancements.js.map +1 -0
- package/dist/cjs/pack/index.js +18 -0
- package/dist/cjs/pack/index.js.map +1 -0
- package/dist/cjs/pack/primitive_pack.js +97 -0
- package/dist/cjs/pack/primitive_pack.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/render/anchors.js +167 -0
- package/dist/cjs/render/anchors.js.map +1 -0
- package/dist/cjs/render/context_view.js +54 -0
- package/dist/cjs/render/context_view.js.map +1 -0
- package/dist/cjs/render/format_display_value.js +143 -0
- package/dist/cjs/render/format_display_value.js.map +1 -0
- package/dist/cjs/render/format_number.js +46 -0
- package/dist/cjs/render/format_number.js.map +1 -0
- package/dist/cjs/render/html/enhancements.js +30 -0
- package/dist/cjs/render/html/enhancements.js.map +1 -0
- package/dist/cjs/render/html/envelope.js +218 -0
- package/dist/cjs/render/html/envelope.js.map +1 -0
- package/dist/cjs/render/html/index.js +12 -0
- package/dist/cjs/render/html/index.js.map +1 -0
- package/dist/cjs/render/index.js +25 -0
- package/dist/cjs/render/index.js.map +1 -0
- package/dist/cjs/render/layout_check.js +133 -0
- package/dist/cjs/render/layout_check.js.map +1 -0
- package/dist/cjs/render/markdown/builder.js +195 -0
- package/dist/cjs/render/markdown/builder.js.map +1 -0
- package/dist/cjs/render/markdown/envelope.js +33 -0
- package/dist/cjs/render/markdown/envelope.js.map +1 -0
- package/dist/cjs/render/markdown/format.js +208 -0
- package/dist/cjs/render/markdown/format.js.map +1 -0
- package/dist/cjs/render/markdown/index.js +15 -0
- package/dist/cjs/render/markdown/index.js.map +1 -0
- package/dist/cjs/render/measure_dom.js +61 -0
- package/dist/cjs/render/measure_dom.js.map +1 -0
- package/dist/cjs/render/payload.js +13 -0
- package/dist/cjs/render/payload.js.map +1 -0
- package/dist/cjs/render/primitive_dispatch.js +173 -0
- package/dist/cjs/render/primitive_dispatch.js.map +1 -0
- package/dist/cjs/render/react/content.js +44 -0
- package/dist/cjs/render/react/content.js.map +1 -0
- package/dist/cjs/render/react/enhancements.js +32 -0
- package/dist/cjs/render/react/enhancements.js.map +1 -0
- package/dist/cjs/render/react/index.js +15 -0
- package/dist/cjs/render/react/index.js.map +1 -0
- package/dist/cjs/render/slack/assets.js +45 -0
- package/dist/cjs/render/slack/assets.js.map +1 -0
- package/dist/cjs/render/slack/blocks.js +80 -0
- package/dist/cjs/render/slack/blocks.js.map +1 -0
- package/dist/cjs/render/slack/envelope.js +551 -0
- package/dist/cjs/render/slack/envelope.js.map +1 -0
- package/dist/cjs/render/slack/format.js +225 -0
- package/dist/cjs/render/slack/format.js.map +1 -0
- package/dist/cjs/render/slack/index.js +30 -0
- package/dist/cjs/render/slack/index.js.map +1 -0
- package/dist/cjs/render/slack/markdown_content.js +409 -0
- package/dist/cjs/render/slack/markdown_content.js.map +1 -0
- package/dist/cjs/render/text/envelope.js +21 -0
- package/dist/cjs/render/text/envelope.js.map +1 -0
- package/dist/cjs/render/text/index.js +12 -0
- package/dist/cjs/render/text/index.js.map +1 -0
- package/dist/cjs/testing/conformance.js +312 -0
- package/dist/cjs/testing/conformance.js.map +1 -0
- package/dist/cjs/testing/icon.js +248 -0
- package/dist/cjs/testing/icon.js.map +1 -0
- package/dist/cjs/testing/index.js +18 -0
- package/dist/cjs/testing/index.js.map +1 -0
- package/dist/cjs/testing/registration.js +142 -0
- package/dist/cjs/testing/registration.js.map +1 -0
- package/dist/cjs/validate/authoring_schema.js +312 -0
- package/dist/cjs/validate/authoring_schema.js.map +1 -0
- package/dist/cjs/validate/composition_schema.js +135 -0
- package/dist/cjs/validate/composition_schema.js.map +1 -0
- package/dist/cjs/validate/index.js +53 -0
- package/dist/cjs/validate/index.js.map +1 -0
- package/dist/cjs/validate/input_budget.js +156 -0
- package/dist/cjs/validate/input_budget.js.map +1 -0
- package/dist/cjs/validate/json_schema.js +72 -0
- package/dist/cjs/validate/json_schema.js.map +1 -0
- package/dist/cjs/validate/node_issues.js +65 -0
- package/dist/cjs/validate/node_issues.js.map +1 -0
- package/dist/cjs/validate/url.js +116 -0
- package/dist/cjs/validate/url.js.map +1 -0
- package/dist/cjs/validate/validation.js +165 -0
- package/dist/cjs/validate/validation.js.map +1 -0
- package/dist/cjs/validate/value_schemas.js +53 -0
- package/dist/cjs/validate/value_schemas.js.map +1 -0
- package/dist/composition/action_event.d.ts +13 -0
- package/dist/composition/action_event.d.ts.map +1 -0
- package/dist/composition/action_event.js +8 -0
- package/dist/composition/action_event.js.map +1 -0
- package/dist/composition/body_node_base.d.ts +72 -0
- package/dist/composition/body_node_base.d.ts.map +1 -0
- package/dist/composition/body_node_base.js +104 -0
- package/dist/composition/body_node_base.js.map +1 -0
- package/dist/composition/composition.d.ts +71 -0
- package/dist/composition/composition.d.ts.map +1 -0
- package/dist/composition/composition.js +8 -0
- package/dist/composition/composition.js.map +1 -0
- package/dist/composition/error.d.ts +61 -0
- package/dist/composition/error.d.ts.map +1 -0
- package/dist/composition/error.js +69 -0
- package/dist/composition/error.js.map +1 -0
- package/dist/composition/index.d.ts +11 -0
- package/dist/composition/index.d.ts.map +1 -0
- package/dist/composition/index.js +14 -0
- package/dist/composition/index.js.map +1 -0
- package/dist/composition/map_nodes.d.ts +16 -0
- package/dist/composition/map_nodes.d.ts.map +1 -0
- package/dist/composition/map_nodes.js +81 -0
- package/dist/composition/map_nodes.js.map +1 -0
- package/dist/composition/named_color.d.ts +9 -0
- package/dist/composition/named_color.d.ts.map +1 -0
- package/dist/composition/named_color.js +17 -0
- package/dist/composition/named_color.js.map +1 -0
- package/dist/composition/node.d.ts +11 -0
- package/dist/composition/node.d.ts.map +1 -0
- package/dist/composition/node.js +8 -0
- package/dist/composition/node.js.map +1 -0
- package/dist/composition/one_line.d.ts +7 -0
- package/dist/composition/one_line.d.ts.map +1 -0
- package/dist/composition/one_line.js +17 -0
- package/dist/composition/one_line.js.map +1 -0
- package/dist/composition/structured_value.d.ts +27 -0
- package/dist/composition/structured_value.d.ts.map +1 -0
- package/dist/composition/structured_value.js +18 -0
- package/dist/composition/structured_value.js.map +1 -0
- package/dist/composition/validation_error.d.ts +33 -0
- package/dist/composition/validation_error.d.ts.map +1 -0
- package/dist/composition/validation_error.js +35 -0
- package/dist/composition/validation_error.js.map +1 -0
- package/dist/define/frame.d.ts +155 -0
- package/dist/define/frame.d.ts.map +1 -0
- package/dist/define/frame.js +27 -0
- package/dist/define/frame.js.map +1 -0
- package/dist/define/index.d.ts +10 -0
- package/dist/define/index.d.ts.map +1 -0
- package/dist/define/index.js +13 -0
- package/dist/define/index.js.map +1 -0
- package/dist/define/markdown_content.d.ts +15 -0
- package/dist/define/markdown_content.d.ts.map +1 -0
- package/dist/define/markdown_content.js +9 -0
- package/dist/define/markdown_content.js.map +1 -0
- package/dist/define/primitive_example.d.ts +30 -0
- package/dist/define/primitive_example.d.ts.map +1 -0
- package/dist/define/primitive_example.js +21 -0
- package/dist/define/primitive_example.js.map +1 -0
- package/dist/define/primitive_icon.d.ts +11 -0
- package/dist/define/primitive_icon.d.ts.map +1 -0
- package/dist/define/primitive_icon.js +14 -0
- package/dist/define/primitive_icon.js.map +1 -0
- package/dist/define/primitive_module.d.ts +435 -0
- package/dist/define/primitive_module.d.ts.map +1 -0
- package/dist/define/primitive_module.js +112 -0
- package/dist/define/primitive_module.js.map +1 -0
- package/dist/define/slack_assets.d.ts +28 -0
- package/dist/define/slack_assets.d.ts.map +1 -0
- package/dist/define/slack_assets.js +8 -0
- package/dist/define/slack_assets.js.map +1 -0
- package/dist/define/slack_blocks.d.ts +234 -0
- package/dist/define/slack_blocks.d.ts.map +1 -0
- package/dist/define/slack_blocks.js +8 -0
- package/dist/define/slack_blocks.js.map +1 -0
- package/dist/define/zod_format.d.ts +33 -0
- package/dist/define/zod_format.d.ts.map +1 -0
- package/dist/define/zod_format.js +114 -0
- package/dist/define/zod_format.js.map +1 -0
- package/dist/define/zod_helpers.d.ts +10 -0
- package/dist/define/zod_helpers.d.ts.map +1 -0
- package/dist/define/zod_helpers.js +22 -0
- package/dist/define/zod_helpers.js.map +1 -0
- package/dist/entries/html.d.ts +3 -0
- package/dist/entries/html.d.ts.map +1 -0
- package/dist/entries/html.js +8 -0
- package/dist/entries/html.js.map +1 -0
- package/dist/entries/index.d.ts +6 -0
- package/dist/entries/index.d.ts.map +1 -0
- package/dist/entries/index.js +12 -0
- package/dist/entries/index.js.map +1 -0
- package/dist/entries/markdown.d.ts +3 -0
- package/dist/entries/markdown.d.ts.map +1 -0
- package/dist/entries/markdown.js +8 -0
- package/dist/entries/markdown.js.map +1 -0
- package/dist/entries/react.d.ts +5 -0
- package/dist/entries/react.d.ts.map +1 -0
- package/dist/entries/react.js +11 -0
- package/dist/entries/react.js.map +1 -0
- package/dist/entries/slack.d.ts +2 -0
- package/dist/entries/slack.d.ts.map +1 -0
- package/dist/entries/slack.js +8 -0
- package/dist/entries/slack.js.map +1 -0
- package/dist/entries/text.d.ts +2 -0
- package/dist/entries/text.d.ts.map +1 -0
- package/dist/entries/text.js +8 -0
- package/dist/entries/text.js.map +1 -0
- package/dist/pack/capabilities.d.ts +41 -0
- package/dist/pack/capabilities.d.ts.map +1 -0
- package/dist/pack/capabilities.js +36 -0
- package/dist/pack/capabilities.js.map +1 -0
- package/dist/pack/compose.d.ts +24 -0
- package/dist/pack/compose.d.ts.map +1 -0
- package/dist/pack/compose.js +55 -0
- package/dist/pack/compose.js.map +1 -0
- package/dist/pack/enhancements.d.ts +65 -0
- package/dist/pack/enhancements.d.ts.map +1 -0
- package/dist/pack/enhancements.js +59 -0
- package/dist/pack/enhancements.js.map +1 -0
- package/dist/pack/index.d.ts +5 -0
- package/dist/pack/index.d.ts.map +1 -0
- package/dist/pack/index.js +11 -0
- package/dist/pack/index.js.map +1 -0
- package/dist/pack/primitive_pack.d.ts +164 -0
- package/dist/pack/primitive_pack.d.ts.map +1 -0
- package/dist/pack/primitive_pack.js +92 -0
- package/dist/pack/primitive_pack.js.map +1 -0
- package/dist/render/anchors.d.ts +82 -0
- package/dist/render/anchors.d.ts.map +1 -0
- package/dist/render/anchors.js +153 -0
- package/dist/render/anchors.js.map +1 -0
- package/dist/render/context_view.d.ts +10 -0
- package/dist/render/context_view.d.ts.map +1 -0
- package/dist/render/context_view.js +49 -0
- package/dist/render/context_view.js.map +1 -0
- package/dist/render/format_display_value.d.ts +20 -0
- package/dist/render/format_display_value.d.ts.map +1 -0
- package/dist/render/format_display_value.js +137 -0
- package/dist/render/format_display_value.js.map +1 -0
- package/dist/render/format_number.d.ts +9 -0
- package/dist/render/format_number.d.ts.map +1 -0
- package/dist/render/format_number.js +42 -0
- package/dist/render/format_number.js.map +1 -0
- package/dist/render/html/enhancements.d.ts +10 -0
- package/dist/render/html/enhancements.d.ts.map +1 -0
- package/dist/render/html/enhancements.js +25 -0
- package/dist/render/html/enhancements.js.map +1 -0
- package/dist/render/html/envelope.d.ts +182 -0
- package/dist/render/html/envelope.d.ts.map +1 -0
- package/dist/render/html/envelope.js +214 -0
- package/dist/render/html/envelope.js.map +1 -0
- package/dist/render/html/index.d.ts +3 -0
- package/dist/render/html/index.d.ts.map +1 -0
- package/dist/render/html/index.js +8 -0
- package/dist/render/html/index.js.map +1 -0
- package/dist/render/index.d.ts +6 -0
- package/dist/render/index.d.ts.map +1 -0
- package/dist/render/index.js +11 -0
- package/dist/render/index.js.map +1 -0
- package/dist/render/layout_check.d.ts +43 -0
- package/dist/render/layout_check.d.ts.map +1 -0
- package/dist/render/layout_check.js +129 -0
- package/dist/render/layout_check.js.map +1 -0
- package/dist/render/markdown/builder.d.ts +46 -0
- package/dist/render/markdown/builder.d.ts.map +1 -0
- package/dist/render/markdown/builder.js +190 -0
- package/dist/render/markdown/builder.js.map +1 -0
- package/dist/render/markdown/envelope.d.ts +20 -0
- package/dist/render/markdown/envelope.d.ts.map +1 -0
- package/dist/render/markdown/envelope.js +29 -0
- package/dist/render/markdown/envelope.js.map +1 -0
- package/dist/render/markdown/format.d.ts +10 -0
- package/dist/render/markdown/format.d.ts.map +1 -0
- package/dist/render/markdown/format.js +202 -0
- package/dist/render/markdown/format.js.map +1 -0
- package/dist/render/markdown/index.d.ts +3 -0
- package/dist/render/markdown/index.d.ts.map +1 -0
- package/dist/render/markdown/index.js +9 -0
- package/dist/render/markdown/index.js.map +1 -0
- package/dist/render/measure_dom.d.ts +10 -0
- package/dist/render/measure_dom.d.ts.map +1 -0
- package/dist/render/measure_dom.js +57 -0
- package/dist/render/measure_dom.js.map +1 -0
- package/dist/render/payload.d.ts +16 -0
- package/dist/render/payload.d.ts.map +1 -0
- package/dist/render/payload.js +9 -0
- package/dist/render/payload.js.map +1 -0
- package/dist/render/primitive_dispatch.d.ts +72 -0
- package/dist/render/primitive_dispatch.d.ts.map +1 -0
- package/dist/render/primitive_dispatch.js +169 -0
- package/dist/render/primitive_dispatch.js.map +1 -0
- package/dist/render/react/content.d.ts +40 -0
- package/dist/render/react/content.d.ts.map +1 -0
- package/dist/render/react/content.js +39 -0
- package/dist/render/react/content.js.map +1 -0
- package/dist/render/react/enhancements.d.ts +15 -0
- package/dist/render/react/enhancements.d.ts.map +1 -0
- package/dist/render/react/enhancements.js +28 -0
- package/dist/render/react/enhancements.js.map +1 -0
- package/dist/render/react/index.d.ts +3 -0
- package/dist/render/react/index.d.ts.map +1 -0
- package/dist/render/react/index.js +9 -0
- package/dist/render/react/index.js.map +1 -0
- package/dist/render/slack/assets.d.ts +16 -0
- package/dist/render/slack/assets.d.ts.map +1 -0
- package/dist/render/slack/assets.js +40 -0
- package/dist/render/slack/assets.js.map +1 -0
- package/dist/render/slack/blocks.d.ts +72 -0
- package/dist/render/slack/blocks.d.ts.map +1 -0
- package/dist/render/slack/blocks.js +77 -0
- package/dist/render/slack/blocks.js.map +1 -0
- package/dist/render/slack/envelope.d.ts +52 -0
- package/dist/render/slack/envelope.d.ts.map +1 -0
- package/dist/render/slack/envelope.js +547 -0
- package/dist/render/slack/envelope.js.map +1 -0
- package/dist/render/slack/format.d.ts +70 -0
- package/dist/render/slack/format.d.ts.map +1 -0
- package/dist/render/slack/format.js +209 -0
- package/dist/render/slack/format.js.map +1 -0
- package/dist/render/slack/index.d.ts +6 -0
- package/dist/render/slack/index.d.ts.map +1 -0
- package/dist/render/slack/index.js +12 -0
- package/dist/render/slack/index.js.map +1 -0
- package/dist/render/slack/markdown_content.d.ts +17 -0
- package/dist/render/slack/markdown_content.d.ts.map +1 -0
- package/dist/render/slack/markdown_content.js +404 -0
- package/dist/render/slack/markdown_content.js.map +1 -0
- package/dist/render/text/envelope.d.ts +15 -0
- package/dist/render/text/envelope.d.ts.map +1 -0
- package/dist/render/text/envelope.js +17 -0
- package/dist/render/text/envelope.js.map +1 -0
- package/dist/render/text/index.d.ts +2 -0
- package/dist/render/text/index.d.ts.map +1 -0
- package/dist/render/text/index.js +8 -0
- package/dist/render/text/index.js.map +1 -0
- package/dist/testing/conformance.d.ts +145 -0
- package/dist/testing/conformance.d.ts.map +1 -0
- package/dist/testing/conformance.js +303 -0
- package/dist/testing/conformance.js.map +1 -0
- package/dist/testing/icon.d.ts +11 -0
- package/dist/testing/icon.d.ts.map +1 -0
- package/dist/testing/icon.js +244 -0
- package/dist/testing/icon.js.map +1 -0
- package/dist/testing/index.d.ts +4 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +10 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/registration.d.ts +32 -0
- package/dist/testing/registration.d.ts.map +1 -0
- package/dist/testing/registration.js +105 -0
- package/dist/testing/registration.js.map +1 -0
- package/dist/validate/authoring_schema.d.ts +33 -0
- package/dist/validate/authoring_schema.d.ts.map +1 -0
- package/dist/validate/authoring_schema.js +306 -0
- package/dist/validate/authoring_schema.js.map +1 -0
- package/dist/validate/composition_schema.d.ts +80 -0
- package/dist/validate/composition_schema.d.ts.map +1 -0
- package/dist/validate/composition_schema.js +127 -0
- package/dist/validate/composition_schema.js.map +1 -0
- package/dist/validate/index.d.ts +9 -0
- package/dist/validate/index.d.ts.map +1 -0
- package/dist/validate/index.js +15 -0
- package/dist/validate/index.js.map +1 -0
- package/dist/validate/input_budget.d.ts +35 -0
- package/dist/validate/input_budget.d.ts.map +1 -0
- package/dist/validate/input_budget.js +151 -0
- package/dist/validate/input_budget.js.map +1 -0
- package/dist/validate/json_schema.d.ts +32 -0
- package/dist/validate/json_schema.d.ts.map +1 -0
- package/dist/validate/json_schema.js +68 -0
- package/dist/validate/json_schema.js.map +1 -0
- package/dist/validate/node_issues.d.ts +12 -0
- package/dist/validate/node_issues.d.ts.map +1 -0
- package/dist/validate/node_issues.js +61 -0
- package/dist/validate/node_issues.js.map +1 -0
- package/dist/validate/url.d.ts +50 -0
- package/dist/validate/url.d.ts.map +1 -0
- package/dist/validate/url.js +107 -0
- package/dist/validate/url.js.map +1 -0
- package/dist/validate/validation.d.ts +95 -0
- package/dist/validate/validation.d.ts.map +1 -0
- package/dist/validate/validation.js +157 -0
- package/dist/validate/validation.js.map +1 -0
- package/dist/validate/value_schemas.d.ts +53 -0
- package/dist/validate/value_schemas.d.ts.map +1 -0
- package/dist/validate/value_schemas.js +50 -0
- package/dist/validate/value_schemas.js.map +1 -0
- package/package.json +119 -5
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type IsomerErrorCode } from './error.js';
|
|
2
|
+
/**
|
|
3
|
+
* One fatal validation finding.
|
|
4
|
+
*
|
|
5
|
+
* `path` locates the offending value (`body[3].items[0].label`) and is empty
|
|
6
|
+
* for a finding about the document as a whole. `message` is a predicate
|
|
7
|
+
* (`is required`, `must be one of: a, b`) so the two read as one sentence
|
|
8
|
+
* through {@link formatValidationError}.
|
|
9
|
+
*/
|
|
10
|
+
export interface ValidationError {
|
|
11
|
+
path: string;
|
|
12
|
+
message: string;
|
|
13
|
+
/** The `type` of the innermost primitive node `path` lands in, when there is one. */
|
|
14
|
+
nodeType?: string;
|
|
15
|
+
/** Set only on a refusal from `checkInputBudget`: `INPUT_OVER_BUDGET` or `INPUT_NOT_PLAIN_DATA`. */
|
|
16
|
+
code?: IsomerErrorCode;
|
|
17
|
+
}
|
|
18
|
+
/** `<path> (in <nodeType>) <message>`, or the message alone for a root finding. */
|
|
19
|
+
export declare const formatValidationError: ({ path, message, nodeType, }: ValidationError) => string;
|
|
20
|
+
/**
|
|
21
|
+
* Thrown when a `Composition` fails validation, carrying every finding
|
|
22
|
+
* rather than only the first.
|
|
23
|
+
*
|
|
24
|
+
* Identify it by `name`, `code`, and `errors`, never `instanceof`: the SDK
|
|
25
|
+
* ships both ESM and CJS builds, so a host can hold two copies of this class
|
|
26
|
+
* and an identity check would miss one.
|
|
27
|
+
*/
|
|
28
|
+
export declare class CompositionValidationError extends Error {
|
|
29
|
+
readonly code: "COMPOSITION_INVALID";
|
|
30
|
+
readonly errors: ValidationError[];
|
|
31
|
+
constructor(errors: ValidationError[]);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=validation_error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation_error.d.ts","sourceRoot":"","sources":["../../src/composition/validation_error.ts"],"names":[],"mappings":"AAOA,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAGnE;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oGAAoG;IACpG,IAAI,CAAC,EAAE,eAAe,CAAC;CACxB;AAED,mFAAmF;AACnF,eAAO,MAAM,qBAAqB,GAAI,8BAInC,eAAe,KAAG,MAOpB,CAAC;AAEF;;;;;;;GAOG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,QAAQ,CAAC,IAAI,wBAA0C;IACvD,QAAQ,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC;gBAEvB,MAAM,EAAE,eAAe,EAAE;CAStC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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 { ISOMER_ERROR_CODES } from './error.js';
|
|
8
|
+
import { nameText } from './one_line.js';
|
|
9
|
+
/** `<path> (in <nodeType>) <message>`, or the message alone for a root finding. */
|
|
10
|
+
export const formatValidationError = ({ path, message, nodeType, }) => {
|
|
11
|
+
if (!path) {
|
|
12
|
+
return message;
|
|
13
|
+
}
|
|
14
|
+
return nodeType === undefined
|
|
15
|
+
? `${path} ${message}`
|
|
16
|
+
: `${path} (in ${nameText(nodeType)}) ${message}`;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Thrown when a `Composition` fails validation, carrying every finding
|
|
20
|
+
* rather than only the first.
|
|
21
|
+
*
|
|
22
|
+
* Identify it by `name`, `code`, and `errors`, never `instanceof`: the SDK
|
|
23
|
+
* ships both ESM and CJS builds, so a host can hold two copies of this class
|
|
24
|
+
* and an identity check would miss one.
|
|
25
|
+
*/
|
|
26
|
+
export class CompositionValidationError extends Error {
|
|
27
|
+
code = ISOMER_ERROR_CODES.COMPOSITION_INVALID;
|
|
28
|
+
errors;
|
|
29
|
+
constructor(errors) {
|
|
30
|
+
super(`Invalid Composition:\n ${errors.map(formatValidationError).join('\n ') || '(no detail)'}`);
|
|
31
|
+
this.name = 'CompositionValidationError';
|
|
32
|
+
this.errors = errors;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=validation_error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation_error.js","sourceRoot":"","sources":["../../src/composition/validation_error.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,kBAAkB,EAAwB,MAAM,SAAS,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAmBtC,mFAAmF;AACnF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EACpC,IAAI,EACJ,OAAO,EACP,QAAQ,GACQ,EAAU,EAAE;IAC5B,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,OAAO,QAAQ,KAAK,SAAS;QAC3B,CAAC,CAAC,GAAG,IAAI,IAAI,OAAO,EAAE;QACtB,CAAC,CAAC,GAAG,IAAI,QAAQ,QAAQ,CAAC,QAAQ,CAAC,KAAK,OAAO,EAAE,CAAC;AACtD,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IAC1C,IAAI,GAAG,kBAAkB,CAAC,mBAAmB,CAAC;IAC9C,MAAM,CAAoB;IAEnC,YAAY,MAAyB;QACnC,KAAK,CACH,2BACE,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,aACpD,EAAE,CACH,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF","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 { ISOMER_ERROR_CODES, type IsomerErrorCode } from './error';\nimport { nameText } from './one_line';\n\n/**\n * One fatal validation finding.\n *\n * `path` locates the offending value (`body[3].items[0].label`) and is empty\n * for a finding about the document as a whole. `message` is a predicate\n * (`is required`, `must be one of: a, b`) so the two read as one sentence\n * through {@link formatValidationError}.\n */\nexport interface ValidationError {\n path: string;\n message: string;\n /** The `type` of the innermost primitive node `path` lands in, when there is one. */\n nodeType?: string;\n /** Set only on a refusal from `checkInputBudget`: `INPUT_OVER_BUDGET` or `INPUT_NOT_PLAIN_DATA`. */\n code?: IsomerErrorCode;\n}\n\n/** `<path> (in <nodeType>) <message>`, or the message alone for a root finding. */\nexport const formatValidationError = ({\n path,\n message,\n nodeType,\n}: ValidationError): string => {\n if (!path) {\n return message;\n }\n return nodeType === undefined\n ? `${path} ${message}`\n : `${path} (in ${nameText(nodeType)}) ${message}`;\n};\n\n/**\n * Thrown when a `Composition` fails validation, carrying every finding\n * rather than only the first.\n *\n * Identify it by `name`, `code`, and `errors`, never `instanceof`: the SDK\n * ships both ESM and CJS builds, so a host can hold two copies of this class\n * and an identity check would miss one.\n */\nexport class CompositionValidationError extends Error {\n readonly code = ISOMER_ERROR_CODES.COMPOSITION_INVALID;\n readonly errors: ValidationError[];\n\n constructor(errors: ValidationError[]) {\n super(\n `Invalid Composition:\\n ${\n errors.map(formatValidationError).join('\\n ') || '(no detail)'\n }`\n );\n this.name = 'CompositionValidationError';\n this.errors = errors;\n }\n}\n"]}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { RenderTheme } from '../composition/named_color.js';
|
|
3
|
+
import type { PrimitiveNode } from '../composition/node.js';
|
|
4
|
+
/**
|
|
5
|
+
* A frame's palette, per mode. An image has no media queries, so it must
|
|
6
|
+
* commit to one; `auto` resolves light.
|
|
7
|
+
*/
|
|
8
|
+
export interface ThemePair<TTheme> {
|
|
9
|
+
light: TTheme;
|
|
10
|
+
dark: TTheme;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Geometry and resolved theme a frame draws within.
|
|
14
|
+
*
|
|
15
|
+
* Named for the viewport rather than the frame because {@link Frame.wrap}
|
|
16
|
+
* draws *a* frame within it; the two would otherwise read as the same thing.
|
|
17
|
+
*/
|
|
18
|
+
export interface FrameViewport<TTheme> {
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
/** Resolved from {@link Frame.theme} for `mode`. */
|
|
22
|
+
theme: TTheme;
|
|
23
|
+
/** What the caller asked for, before resolution. `undefined` and `auto` both resolve light. */
|
|
24
|
+
mode: RenderTheme | undefined;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The two dispatcher methods a frame needs.
|
|
28
|
+
*
|
|
29
|
+
* The render context the nodes are drawn with is bound by the caller rather
|
|
30
|
+
* than passed here: it carries the class-name resolution that pairs with the
|
|
31
|
+
* stylesheet emitted alongside the frame's output, which is the surface's
|
|
32
|
+
* concern and not the document's. Generic in `TNode` so a helper can be
|
|
33
|
+
* written against a narrowed node union while the runtime holds the erased form.
|
|
34
|
+
*/
|
|
35
|
+
export interface FrameDispatcher<TNode extends PrimitiveNode = PrimitiveNode> {
|
|
36
|
+
/** Draws one node on the `snapshot` surface. `key` must be unique among its siblings. */
|
|
37
|
+
renderSnapshot(node: TNode, key: string): ReactNode;
|
|
38
|
+
/** The node's height in pixels; `0` when it is hidden from `snapshot` or its primitive declares no `metrics.snapshotHeight`. */
|
|
39
|
+
estimateSnapshotHeight(node: TNode): number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* What {@link Frame.wrap} is told about the composition it draws around.
|
|
43
|
+
*
|
|
44
|
+
* The body is withheld, and {@link bindFrame} copies only these fields into a
|
|
45
|
+
* fresh value, so the surround cannot branch on a pack's node types.
|
|
46
|
+
*/
|
|
47
|
+
export interface FrameHeader {
|
|
48
|
+
title?: string | undefined;
|
|
49
|
+
subtitle?: string | undefined;
|
|
50
|
+
/** The caller's preference, not a resolved palette. Use {@link FrameViewport.theme} to draw. */
|
|
51
|
+
theme?: RenderTheme | undefined;
|
|
52
|
+
}
|
|
53
|
+
/** {@link FrameHeader} plus the body, for the sizing and validation hooks. */
|
|
54
|
+
export interface FrameComposition extends FrameHeader {
|
|
55
|
+
/** Raw nodes, for measuring and checking only. {@link FrameBody} is what gets drawn. */
|
|
56
|
+
body: PrimitiveNode[];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Body nodes already rendered to elements, ready to be surrounded.
|
|
60
|
+
*
|
|
61
|
+
* Distinct from `Composition.body`, which is the raw {@link PrimitiveNode}
|
|
62
|
+
* array a frame never sees.
|
|
63
|
+
*/
|
|
64
|
+
export type FrameBody = readonly ReactNode[];
|
|
65
|
+
/**
|
|
66
|
+
* A document a `snapshot` render can produce: its geometry, the surround it draws
|
|
67
|
+
* around the body, and whatever it requires of a composition it is asked to
|
|
68
|
+
* draw.
|
|
69
|
+
*
|
|
70
|
+
* A host registers frames with the runtime and picks one per render. That is
|
|
71
|
+
* what lets one runtime serve a 760px card, a 1920x1080 slide, and a
|
|
72
|
+
* host-branded variant of either from the same vocabulary — and what keeps a
|
|
73
|
+
* vocabulary pack additive, since nothing about a primitive decides the frame.
|
|
74
|
+
* A frame is named by the key a host registers it under, not by a field it
|
|
75
|
+
* carries.
|
|
76
|
+
*/
|
|
77
|
+
export interface Frame<TTheme> {
|
|
78
|
+
/** Width used when the caller passes none. */
|
|
79
|
+
defaultWidth: number;
|
|
80
|
+
/**
|
|
81
|
+
* Palette per mode. Frame and palette vary independently — a branded card is
|
|
82
|
+
* this geometry with a host's colors — so a host overrides one by spreading
|
|
83
|
+
* this value rather than rebuilding anything.
|
|
84
|
+
*/
|
|
85
|
+
theme: ThemePair<TTheme>;
|
|
86
|
+
/**
|
|
87
|
+
* Height for this body when the caller passes none, in the geometry this
|
|
88
|
+
* document defines. Calling {@link FrameDispatcher.estimateSnapshotHeight} is
|
|
89
|
+
* what makes a missing `metrics.snapshotHeight` size the frame short: that
|
|
90
|
+
* method returns `0` for a node whose primitive declares none.
|
|
91
|
+
*/
|
|
92
|
+
estimateHeight(composition: FrameComposition, dispatcher: FrameDispatcher): number;
|
|
93
|
+
/**
|
|
94
|
+
* What this document requires of a body. A slide document's
|
|
95
|
+
* exactly-one-`slideFrame` rule is the example.
|
|
96
|
+
*
|
|
97
|
+
* Returned rather than thrown so a caller can decide what to do with it, but
|
|
98
|
+
* note where it is *not* checked: composition validation is frame-agnostic,
|
|
99
|
+
* and has to be, because the same composition can be valid in one frame and
|
|
100
|
+
* not another. Only the `snapshot` surface consults this, on the frame a render
|
|
101
|
+
* actually names, and raises before drawing. A host that wants the answer
|
|
102
|
+
* earlier asks the frame directly.
|
|
103
|
+
*/
|
|
104
|
+
validateBody?(body: readonly PrimitiveNode[]): readonly string[];
|
|
105
|
+
/**
|
|
106
|
+
* Draws the surround around the already-rendered body nodes, including a
|
|
107
|
+
* title header if this document wants one.
|
|
108
|
+
*
|
|
109
|
+
* Takes the nodes as an array rather than a single `ReactNode` so a frame
|
|
110
|
+
* that draws no surround can return its one root element — image layout
|
|
111
|
+
* starts from a single element, and an array or a fragment is not one.
|
|
112
|
+
*
|
|
113
|
+
* Declared property-style, so it is checked contravariantly in `TTheme` under
|
|
114
|
+
* `strictFunctionTypes`. A method signature is bivariant, which would admit a
|
|
115
|
+
* frame needing a richer theme into a slot typed for a narrower one, where it
|
|
116
|
+
* would read a token nothing supplies.
|
|
117
|
+
*/
|
|
118
|
+
wrap: (header: FrameHeader, body: FrameBody, viewport: FrameViewport<TTheme>) => ReactNode;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* A {@link Frame} as the runtime stores it, with its theme resolved away.
|
|
122
|
+
*
|
|
123
|
+
* The erasure is a closure rather than a type parameter because the runtime
|
|
124
|
+
* dispatches nodes through one inventory keyed by node type, which has no
|
|
125
|
+
* single theme to name. A runtime's frames are homogeneous in `TTheme`, so the
|
|
126
|
+
* palette is known where it is resolved and only the resolved result is stored.
|
|
127
|
+
*/
|
|
128
|
+
export interface BoundFrame {
|
|
129
|
+
readonly defaultWidth: number;
|
|
130
|
+
/** See {@link Frame.estimateHeight}. */
|
|
131
|
+
estimateHeight(composition: FrameComposition, dispatcher: FrameDispatcher): number;
|
|
132
|
+
/** See {@link Frame.validateBody}; empty when this frame states no rule. */
|
|
133
|
+
validateBody(body: readonly PrimitiveNode[]): readonly string[];
|
|
134
|
+
/**
|
|
135
|
+
* Resolves {@link Frame.theme} for `mode`, erased to `unknown` like the rest
|
|
136
|
+
* of this type. Lets a caller hand the palette to a primitive's `env.theme`
|
|
137
|
+
* without itself knowing `TTheme`.
|
|
138
|
+
*/
|
|
139
|
+
resolveTheme(mode: RenderTheme | undefined): unknown;
|
|
140
|
+
/** Renders the body and its surround at `viewport`'s geometry. */
|
|
141
|
+
render(composition: FrameComposition, viewport: {
|
|
142
|
+
width: number;
|
|
143
|
+
height: number;
|
|
144
|
+
mode: RenderTheme | undefined;
|
|
145
|
+
}, dispatcher: FrameDispatcher): ReactNode;
|
|
146
|
+
/** One node, no surround. */
|
|
147
|
+
renderNode(node: PrimitiveNode, dispatcher: FrameDispatcher): ReactNode;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Erases a {@link Frame}'s `TTheme` into a {@link BoundFrame}, resolving the
|
|
151
|
+
* palette per render and composing the generic body walk with the frame's own
|
|
152
|
+
* surround.
|
|
153
|
+
*/
|
|
154
|
+
export declare const bindFrame: <TTheme>(frame: Frame<TTheme>) => BoundFrame;
|
|
155
|
+
//# sourceMappingURL=frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../src/define/frame.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,SAAS,CAAC,MAAM;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa,CAAC,MAAM;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,+FAA+F;IAC/F,IAAI,EAAE,WAAW,GAAG,SAAS,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe,CAAC,KAAK,SAAS,aAAa,GAAG,aAAa;IAC1E,yFAAyF;IACzF,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACpD,gIAAgI;IAChI,sBAAsB,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC;CAC7C;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,gGAAgG;IAChG,KAAK,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CACjC;AAED,8EAA8E;AAC9E,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,wFAAwF;IACxF,IAAI,EAAE,aAAa,EAAE,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,SAAS,EAAE,CAAC;AAE7C;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,KAAK,CAAC,MAAM;IAC3B,8CAA8C;IAC9C,YAAY,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACzB;;;;;OAKG;IACH,cAAc,CACZ,WAAW,EAAE,gBAAgB,EAC7B,UAAU,EAAE,eAAe,GAC1B,MAAM,CAAC;IACV;;;;;;;;;;OAUG;IACH,YAAY,CAAC,CAAC,IAAI,EAAE,SAAS,aAAa,EAAE,GAAG,SAAS,MAAM,EAAE,CAAC;IACjE;;;;;;;;;;;;OAYG;IACH,IAAI,EAAE,CACJ,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,SAAS,EACf,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,KAC5B,SAAS,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,wCAAwC;IACxC,cAAc,CACZ,WAAW,EAAE,gBAAgB,EAC7B,UAAU,EAAE,eAAe,GAC1B,MAAM,CAAC;IACV,4EAA4E;IAC5E,YAAY,CAAC,IAAI,EAAE,SAAS,aAAa,EAAE,GAAG,SAAS,MAAM,EAAE,CAAC;IAChE;;;;OAIG;IACH,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC;IACrD,kEAAkE;IAClE,MAAM,CACJ,WAAW,EAAE,gBAAgB,EAC7B,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,WAAW,GAAG,SAAS,CAAA;KAAE,EAC1E,UAAU,EAAE,eAAe,GAC1B,SAAS,CAAC;IACb,6BAA6B;IAC7B,UAAU,CAAC,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,eAAe,GAAG,SAAS,CAAC;CACzE;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,GAAI,MAAM,EAAE,OAAO,KAAK,CAAC,MAAM,CAAC,KAAG,UAuBxD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
/**
|
|
8
|
+
* Erases a {@link Frame}'s `TTheme` into a {@link BoundFrame}, resolving the
|
|
9
|
+
* palette per render and composing the generic body walk with the frame's own
|
|
10
|
+
* surround.
|
|
11
|
+
*/
|
|
12
|
+
export const bindFrame = (frame) => {
|
|
13
|
+
const themeFor = (mode) => mode === 'dark' ? frame.theme.dark : frame.theme.light;
|
|
14
|
+
return {
|
|
15
|
+
defaultWidth: frame.defaultWidth,
|
|
16
|
+
estimateHeight: (composition, dispatcher) => frame.estimateHeight(composition, dispatcher),
|
|
17
|
+
validateBody: (body) => frame.validateBody?.(body) ?? [],
|
|
18
|
+
resolveTheme: (mode) => themeFor(mode),
|
|
19
|
+
render: (composition, viewport, dispatcher) => {
|
|
20
|
+
const theme = themeFor(viewport.mode);
|
|
21
|
+
const { title, subtitle, theme: mode } = composition;
|
|
22
|
+
return frame.wrap({ title, subtitle, theme: mode }, composition.body.map((node, index) => dispatcher.renderSnapshot(node, `body-${index}`)), { ...viewport, theme });
|
|
23
|
+
},
|
|
24
|
+
renderNode: (node, dispatcher) => dispatcher.renderSnapshot(node, node.type),
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame.js","sourceRoot":"","sources":["../../src/define/frame.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA8KH;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAS,KAAoB,EAAc,EAAE;IACpE,MAAM,QAAQ,GAAG,CAAC,IAA6B,EAAU,EAAE,CACzD,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;IACzD,OAAO;QACL,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,cAAc,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,CAC1C,KAAK,CAAC,cAAc,CAAC,WAAW,EAAE,UAAU,CAAC;QAC/C,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE;QACxD,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;QACtC,MAAM,EAAE,CAAC,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE;YAC5C,MAAM,KAAK,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACtC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,WAAW,CAAC;YACrD,OAAO,KAAK,CAAC,IAAI,CACf,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,EAChC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACnC,UAAU,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,KAAK,EAAE,CAAC,CACjD,EACD,EAAE,GAAG,QAAQ,EAAE,KAAK,EAAE,CACvB,CAAC;QACJ,CAAC;QACD,UAAU,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,CAC/B,UAAU,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;KAC7C,CAAC;AACJ,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 frame a `snapshot` render is drawn inside, and the geometry that sizes it.\n// Frame is a runtime input, not a pack asset: vocabulary is additive, the\n// document is exclusive.\n\nimport type { ReactNode } from 'react';\n\nimport type { RenderTheme } from '../composition/named_color';\nimport type { PrimitiveNode } from '../composition/node';\n\n/**\n * A frame's palette, per mode. An image has no media queries, so it must\n * commit to one; `auto` resolves light.\n */\nexport interface ThemePair<TTheme> {\n light: TTheme;\n dark: TTheme;\n}\n\n/**\n * Geometry and resolved theme a frame draws within.\n *\n * Named for the viewport rather than the frame because {@link Frame.wrap}\n * draws *a* frame within it; the two would otherwise read as the same thing.\n */\nexport interface FrameViewport<TTheme> {\n width: number;\n height: number;\n /** Resolved from {@link Frame.theme} for `mode`. */\n theme: TTheme;\n /** What the caller asked for, before resolution. `undefined` and `auto` both resolve light. */\n mode: RenderTheme | undefined;\n}\n\n/**\n * The two dispatcher methods a frame needs.\n *\n * The render context the nodes are drawn with is bound by the caller rather\n * than passed here: it carries the class-name resolution that pairs with the\n * stylesheet emitted alongside the frame's output, which is the surface's\n * concern and not the document's. Generic in `TNode` so a helper can be\n * written against a narrowed node union while the runtime holds the erased form.\n */\nexport interface FrameDispatcher<TNode extends PrimitiveNode = PrimitiveNode> {\n /** Draws one node on the `snapshot` surface. `key` must be unique among its siblings. */\n renderSnapshot(node: TNode, key: string): ReactNode;\n /** The node's height in pixels; `0` when it is hidden from `snapshot` or its primitive declares no `metrics.snapshotHeight`. */\n estimateSnapshotHeight(node: TNode): number;\n}\n\n/**\n * What {@link Frame.wrap} is told about the composition it draws around.\n *\n * The body is withheld, and {@link bindFrame} copies only these fields into a\n * fresh value, so the surround cannot branch on a pack's node types.\n */\nexport interface FrameHeader {\n title?: string | undefined;\n subtitle?: string | undefined;\n /** The caller's preference, not a resolved palette. Use {@link FrameViewport.theme} to draw. */\n theme?: RenderTheme | undefined;\n}\n\n/** {@link FrameHeader} plus the body, for the sizing and validation hooks. */\nexport interface FrameComposition extends FrameHeader {\n /** Raw nodes, for measuring and checking only. {@link FrameBody} is what gets drawn. */\n body: PrimitiveNode[];\n}\n\n/**\n * Body nodes already rendered to elements, ready to be surrounded.\n *\n * Distinct from `Composition.body`, which is the raw {@link PrimitiveNode}\n * array a frame never sees.\n */\nexport type FrameBody = readonly ReactNode[];\n\n/**\n * A document a `snapshot` render can produce: its geometry, the surround it draws\n * around the body, and whatever it requires of a composition it is asked to\n * draw.\n *\n * A host registers frames with the runtime and picks one per render. That is\n * what lets one runtime serve a 760px card, a 1920x1080 slide, and a\n * host-branded variant of either from the same vocabulary — and what keeps a\n * vocabulary pack additive, since nothing about a primitive decides the frame.\n * A frame is named by the key a host registers it under, not by a field it\n * carries.\n */\nexport interface Frame<TTheme> {\n /** Width used when the caller passes none. */\n defaultWidth: number;\n /**\n * Palette per mode. Frame and palette vary independently — a branded card is\n * this geometry with a host's colors — so a host overrides one by spreading\n * this value rather than rebuilding anything.\n */\n theme: ThemePair<TTheme>;\n /**\n * Height for this body when the caller passes none, in the geometry this\n * document defines. Calling {@link FrameDispatcher.estimateSnapshotHeight} is\n * what makes a missing `metrics.snapshotHeight` size the frame short: that\n * method returns `0` for a node whose primitive declares none.\n */\n estimateHeight(\n composition: FrameComposition,\n dispatcher: FrameDispatcher\n ): number;\n /**\n * What this document requires of a body. A slide document's\n * exactly-one-`slideFrame` rule is the example.\n *\n * Returned rather than thrown so a caller can decide what to do with it, but\n * note where it is *not* checked: composition validation is frame-agnostic,\n * and has to be, because the same composition can be valid in one frame and\n * not another. Only the `snapshot` surface consults this, on the frame a render\n * actually names, and raises before drawing. A host that wants the answer\n * earlier asks the frame directly.\n */\n validateBody?(body: readonly PrimitiveNode[]): readonly string[];\n /**\n * Draws the surround around the already-rendered body nodes, including a\n * title header if this document wants one.\n *\n * Takes the nodes as an array rather than a single `ReactNode` so a frame\n * that draws no surround can return its one root element — image layout\n * starts from a single element, and an array or a fragment is not one.\n *\n * Declared property-style, so it is checked contravariantly in `TTheme` under\n * `strictFunctionTypes`. A method signature is bivariant, which would admit a\n * frame needing a richer theme into a slot typed for a narrower one, where it\n * would read a token nothing supplies.\n */\n wrap: (\n header: FrameHeader,\n body: FrameBody,\n viewport: FrameViewport<TTheme>\n ) => ReactNode;\n}\n\n/**\n * A {@link Frame} as the runtime stores it, with its theme resolved away.\n *\n * The erasure is a closure rather than a type parameter because the runtime\n * dispatches nodes through one inventory keyed by node type, which has no\n * single theme to name. A runtime's frames are homogeneous in `TTheme`, so the\n * palette is known where it is resolved and only the resolved result is stored.\n */\nexport interface BoundFrame {\n readonly defaultWidth: number;\n /** See {@link Frame.estimateHeight}. */\n estimateHeight(\n composition: FrameComposition,\n dispatcher: FrameDispatcher\n ): number;\n /** See {@link Frame.validateBody}; empty when this frame states no rule. */\n validateBody(body: readonly PrimitiveNode[]): readonly string[];\n /**\n * Resolves {@link Frame.theme} for `mode`, erased to `unknown` like the rest\n * of this type. Lets a caller hand the palette to a primitive's `env.theme`\n * without itself knowing `TTheme`.\n */\n resolveTheme(mode: RenderTheme | undefined): unknown;\n /** Renders the body and its surround at `viewport`'s geometry. */\n render(\n composition: FrameComposition,\n viewport: { width: number; height: number; mode: RenderTheme | undefined },\n dispatcher: FrameDispatcher\n ): ReactNode;\n /** One node, no surround. */\n renderNode(node: PrimitiveNode, dispatcher: FrameDispatcher): ReactNode;\n}\n\n/**\n * Erases a {@link Frame}'s `TTheme` into a {@link BoundFrame}, resolving the\n * palette per render and composing the generic body walk with the frame's own\n * surround.\n */\nexport const bindFrame = <TTheme>(frame: Frame<TTheme>): BoundFrame => {\n const themeFor = (mode: RenderTheme | undefined): TTheme =>\n mode === 'dark' ? frame.theme.dark : frame.theme.light;\n return {\n defaultWidth: frame.defaultWidth,\n estimateHeight: (composition, dispatcher) =>\n frame.estimateHeight(composition, dispatcher),\n validateBody: (body) => frame.validateBody?.(body) ?? [],\n resolveTheme: (mode) => themeFor(mode),\n render: (composition, viewport, dispatcher) => {\n const theme = themeFor(viewport.mode);\n const { title, subtitle, theme: mode } = composition;\n return frame.wrap(\n { title, subtitle, theme: mode },\n composition.body.map((node, index) =>\n dispatcher.renderSnapshot(node, `body-${index}`)\n ),\n { ...viewport, theme }\n );\n },\n renderNode: (node, dispatcher) =>\n dispatcher.renderSnapshot(node, node.type),\n };\n};\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { type BoundFrame, type Frame, type FrameBody, type FrameComposition, type FrameDispatcher, type FrameHeader, type FrameViewport, type ThemePair, bindFrame, } from './frame.js';
|
|
2
|
+
export { type MarkdownBlock, type MarkdownContent, type MarkdownInline, type MarkdownInlineInput, } from './markdown_content.js';
|
|
3
|
+
export { type ExampleNode, type NormalizedPrimitiveExample, type PrimitiveExample, exampleNodes, primitiveExamples, } from './primitive_example.js';
|
|
4
|
+
export { type PrimitiveIcon, ICON_VARS } from './primitive_icon.js';
|
|
5
|
+
export { type AnyPrimitiveDefinition, type DefaultPackTypes, type OptionalSurface, type PackTypes, type PrimitiveCatalogEntry, type PrimitiveChildRef, type PrimitiveDefinition, type PrimitiveMetrics, type PrimitiveNode, type PrimitiveRenderContext, type PrimitiveSchema, type PrimitiveStyleCollectionContext, type PrimitiveStyleCollector, type ReactContextArg, type Renderer, type Renderers, type RenderScope, type StyledRenderContext, type StyleHandle, type SurfaceMap, type ThemeTokenPath, type WithNodeFields, OPTIONAL_SURFACES, bodyNodeIdSchema, bodyNodeSurfacesSchema, definePrimitive, definePrimitiveFor, unresolvedBodyNodeSchema, validateWithSchema, } from './primitive_module.js';
|
|
6
|
+
export { type SlackAssetCollector, type SlackAssetRequest, } from './slack_assets.js';
|
|
7
|
+
export { type SlackActionElement, type SlackActionsBlock, type SlackBlock, type SlackButtonElement, type SlackCheckboxesElement, type SlackContextBlock, type SlackDividerBlock, 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, } from './slack_blocks.js';
|
|
8
|
+
export { declaredFieldsNote, formatZodIssues } from './zod_format.js';
|
|
9
|
+
export { requiredString, z } from './zod_helpers.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/define/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,SAAS,GACV,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,0BAA0B,EAC/B,KAAK,gBAAgB,EACrB,YAAY,EACZ,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,aAAa,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,+BAA+B,EACpC,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,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,GACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
export { bindFrame, } from './frame.js';
|
|
8
|
+
export { exampleNodes, primitiveExamples, } from './primitive_example.js';
|
|
9
|
+
export { ICON_VARS } from './primitive_icon.js';
|
|
10
|
+
export { OPTIONAL_SURFACES, bodyNodeIdSchema, bodyNodeSurfacesSchema, definePrimitive, definePrimitiveFor, unresolvedBodyNodeSchema, validateWithSchema, } from './primitive_module.js';
|
|
11
|
+
export { declaredFieldsNote, formatZodIssues } from './zod_format.js';
|
|
12
|
+
export { requiredString, z } from './zod_helpers.js';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/define/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EASL,SAAS,GACV,MAAM,SAAS,CAAC;AAOjB,OAAO,EAIL,YAAY,EACZ,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAsB,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAuBL,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AA+C5B,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,CAAC,EAAE,MAAM,eAAe,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 BoundFrame,\n type Frame,\n type FrameBody,\n type FrameComposition,\n type FrameDispatcher,\n type FrameHeader,\n type FrameViewport,\n type ThemePair,\n bindFrame,\n} from './frame';\nexport {\n type MarkdownBlock,\n type MarkdownContent,\n type MarkdownInline,\n type MarkdownInlineInput,\n} from './markdown_content';\nexport {\n type ExampleNode,\n type NormalizedPrimitiveExample,\n type PrimitiveExample,\n exampleNodes,\n primitiveExamples,\n} from './primitive_example';\nexport { type PrimitiveIcon, ICON_VARS } from './primitive_icon';\nexport {\n type AnyPrimitiveDefinition,\n type DefaultPackTypes,\n type OptionalSurface,\n type PackTypes,\n type PrimitiveCatalogEntry,\n type PrimitiveChildRef,\n type PrimitiveDefinition,\n type PrimitiveMetrics,\n type PrimitiveNode,\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 ThemeTokenPath,\n type WithNodeFields,\n OPTIONAL_SURFACES,\n bodyNodeIdSchema,\n bodyNodeSurfacesSchema,\n definePrimitive,\n definePrimitiveFor,\n unresolvedBodyNodeSchema,\n validateWithSchema,\n} from './primitive_module';\nexport {\n type SlackAssetCollector,\n type SlackAssetRequest,\n} from './slack_assets';\nexport {\n type SlackActionElement,\n type SlackActionsBlock,\n type SlackBlock,\n type SlackButtonElement,\n type SlackCheckboxesElement,\n type SlackContextBlock,\n type SlackDividerBlock,\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} from './slack_blocks';\nexport { declaredFieldsNote, formatZodIssues } from './zod_format';\nexport { requiredString, z } from './zod_helpers';\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Brands `md` output. `Symbol.for`: ESM and CJS builds must agree. */
|
|
2
|
+
export declare const markdownContent: unique symbol;
|
|
3
|
+
/** Inline Markdown built with `md`. */
|
|
4
|
+
export interface MarkdownInline {
|
|
5
|
+
readonly [markdownContent]: 'inline';
|
|
6
|
+
}
|
|
7
|
+
/** Block Markdown built with `md`. */
|
|
8
|
+
export interface MarkdownBlock {
|
|
9
|
+
readonly [markdownContent]: 'block';
|
|
10
|
+
}
|
|
11
|
+
/** What a `markdown` renderer may return in place of a string. Nested lists flatten. */
|
|
12
|
+
export type MarkdownContent = MarkdownBlock | readonly MarkdownContent[];
|
|
13
|
+
/** A string is text: escaped wherever it would read as Markdown, line breaks as spaces. */
|
|
14
|
+
export type MarkdownInlineInput = string | MarkdownInline;
|
|
15
|
+
//# sourceMappingURL=markdown_content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown_content.d.ts","sourceRoot":"","sources":["../../src/define/markdown_content.ts"],"names":[],"mappings":"AAOA,uEAAuE;AACvE,eAAO,MAAM,eAAe,eAAgD,CAAC;AAE7E,uCAAuC;AACvC,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,CAAC,eAAe,CAAC,EAAE,QAAQ,CAAC;CACtC;AAED,sCAAsC;AACtC,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;CACrC;AAED,wFAAwF;AACxF,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,SAAS,eAAe,EAAE,CAAC;AAEzE,2FAA2F;AAC3F,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
/** Brands `md` output. `Symbol.for`: ESM and CJS builds must agree. */
|
|
8
|
+
export const markdownContent = Symbol.for('elastic.isomer.markdown_content');
|
|
9
|
+
//# sourceMappingURL=markdown_content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown_content.js","sourceRoot":"","sources":["../../src/define/markdown_content.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,uEAAuE;AACvE,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,iCAAiC,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/** Brands `md` output. `Symbol.for`: ESM and CJS builds must agree. */\nexport const markdownContent = Symbol.for('elastic.isomer.markdown_content');\n\n/** Inline Markdown built with `md`. */\nexport interface MarkdownInline {\n readonly [markdownContent]: 'inline';\n}\n\n/** Block Markdown built with `md`. */\nexport interface MarkdownBlock {\n readonly [markdownContent]: 'block';\n}\n\n/** What a `markdown` renderer may return in place of a string. Nested lists flatten. */\nexport type MarkdownContent = MarkdownBlock | readonly MarkdownContent[];\n\n/** A string is text: escaped wherever it would read as Markdown, line breaks as spaces. */\nexport type MarkdownInlineInput = string | MarkdownInline;\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { PrimitiveNode } from '../composition/node.js';
|
|
2
|
+
/** A published example with a name hosts can list it by. */
|
|
3
|
+
export interface PrimitiveExample<TNode extends PrimitiveNode = PrimitiveNode> {
|
|
4
|
+
/** Short and unique within the primitive, such as `Warning tone`. */
|
|
5
|
+
name: string;
|
|
6
|
+
/** What the example demonstrates. */
|
|
7
|
+
description?: string;
|
|
8
|
+
node: TNode;
|
|
9
|
+
/** Never set: an entry is a bare node exactly when it has a `type`. */
|
|
10
|
+
type?: never;
|
|
11
|
+
}
|
|
12
|
+
/** An entry of `examples` read as one shape; `name` is absent for a bare node. */
|
|
13
|
+
export interface NormalizedPrimitiveExample<TNode extends PrimitiveNode = PrimitiveNode> {
|
|
14
|
+
name?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
node: TNode;
|
|
17
|
+
}
|
|
18
|
+
/** The node type an `examples` entry holds. */
|
|
19
|
+
export type ExampleNode<TEntry> = TEntry extends PrimitiveExample<infer TNode> ? TNode : TEntry;
|
|
20
|
+
interface WithExamples {
|
|
21
|
+
readonly examples: readonly (PrimitiveNode | PrimitiveExample)[];
|
|
22
|
+
}
|
|
23
|
+
/** Distributes over a union of definitions, so a mixed registry keeps every node type. */
|
|
24
|
+
type NodeOf<TDefinition extends WithExamples> = ExampleNode<TDefinition['examples'][number]>;
|
|
25
|
+
/** A definition's examples, bare or named, as {@link NormalizedPrimitiveExample}s. */
|
|
26
|
+
export declare const primitiveExamples: <TDefinition extends WithExamples>({ examples, }: TDefinition) => NormalizedPrimitiveExample<NodeOf<TDefinition>>[];
|
|
27
|
+
/** A definition's example nodes, without names. */
|
|
28
|
+
export declare const exampleNodes: <TDefinition extends WithExamples>({ examples, }: TDefinition) => NodeOf<TDefinition>[];
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=primitive_example.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitive_example.d.ts","sourceRoot":"","sources":["../../src/define/primitive_example.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,4DAA4D;AAC5D,MAAM,WAAW,gBAAgB,CAAC,KAAK,SAAS,aAAa,GAAG,aAAa;IAC3E,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,KAAK,CAAC;IACZ,uEAAuE;IACvE,IAAI,CAAC,EAAE,KAAK,CAAC;CACd;AAED,kFAAkF;AAClF,MAAM,WAAW,0BAA0B,CACzC,KAAK,SAAS,aAAa,GAAG,aAAa;IAE3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,KAAK,CAAC;CACb;AAED,+CAA+C;AAC/C,MAAM,MAAM,WAAW,CAAC,MAAM,IAC5B,MAAM,SAAS,gBAAgB,CAAC,MAAM,KAAK,CAAC,GAAG,KAAK,GAAG,MAAM,CAAC;AAEhE,UAAU,YAAY;IACpB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,aAAa,GAAG,gBAAgB,CAAC,EAAE,CAAC;CAClE;AAED,0FAA0F;AAC1F,KAAK,MAAM,CAAC,WAAW,SAAS,YAAY,IAAI,WAAW,CACzD,WAAW,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAChC,CAAC;AAkBF,sFAAsF;AACtF,eAAO,MAAM,iBAAiB,GAAI,WAAW,SAAS,YAAY,EAAE,eAEjE,WAAW,KAAG,0BAA0B,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,EACc,CAAC;AAE/E,mDAAmD;AACnD,eAAO,MAAM,YAAY,GAAI,WAAW,SAAS,YAAY,EAAE,eAE5D,WAAW,KAAG,MAAM,CAAC,WAAW,CAAC,EACqC,CAAC"}
|
|
@@ -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"]}
|