@elastic/isomer-sdk 0.0.0 → 0.1.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 +58 -0
- package/THIRD_PARTY_LICENSES.md +957 -0
- package/dist/author/authored_fields.d.ts +103 -0
- package/dist/author/authored_fields.d.ts.map +1 -0
- package/dist/author/authored_fields.js +183 -0
- package/dist/author/authored_fields.js.map +1 -0
- package/dist/author/index.d.ts +5 -0
- package/dist/author/index.d.ts.map +1 -0
- package/dist/author/index.js +10 -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 +116 -0
- package/dist/author/jsx_shim.d.ts.map +1 -0
- package/dist/author/jsx_shim.js +353 -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/cjs/author/authored_fields.js +189 -0
- package/dist/cjs/author/authored_fields.js.map +1 -0
- package/dist/cjs/author/index.js +20 -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 +359 -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/composition/action_event.js +9 -0
- package/dist/cjs/composition/action_event.js.map +1 -0
- package/dist/cjs/composition/body_node_base.js +105 -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 +72 -0
- package/dist/cjs/composition/error.js.map +1 -0
- package/dist/cjs/composition/index.js +31 -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 +32 -0
- package/dist/cjs/define/frame.js.map +1 -0
- package/dist/cjs/define/index.js +25 -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_module.js +107 -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 +75 -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 +26 -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 +34 -0
- package/dist/cjs/pack/capabilities.js.map +1 -0
- package/dist/cjs/pack/compose.js +56 -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 +85 -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 +189 -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 +190 -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 +187 -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 +825 -0
- package/dist/cjs/render/slack/format.js.map +1 -0
- package/dist/cjs/render/slack/index.js +31 -0
- package/dist/cjs/render/slack/index.js.map +1 -0
- package/dist/cjs/render/slack/markdown_content.js +358 -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 +296 -0
- package/dist/cjs/testing/conformance.js.map +1 -0
- package/dist/cjs/testing/index.js +16 -0
- package/dist/cjs/testing/index.js.map +1 -0
- package/dist/cjs/testing/registration.js +140 -0
- package/dist/cjs/testing/registration.js.map +1 -0
- package/dist/cjs/validate/authoring_schema.js +296 -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 +52 -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 +208 -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 +71 -0
- package/dist/composition/body_node_base.d.ts.map +1 -0
- package/dist/composition/body_node_base.js +97 -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 +60 -0
- package/dist/composition/error.d.ts.map +1 -0
- package/dist/composition/error.js +68 -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 +166 -0
- package/dist/define/frame.d.ts.map +1 -0
- package/dist/define/frame.js +28 -0
- package/dist/define/frame.js.map +1 -0
- package/dist/define/index.d.ts +8 -0
- package/dist/define/index.d.ts.map +1 -0
- package/dist/define/index.js +11 -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_module.d.ts +421 -0
- package/dist/define/primitive_module.d.ts.map +1 -0
- package/dist/define/primitive_module.js +101 -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 +27 -0
- package/dist/pack/capabilities.d.ts.map +1 -0
- package/dist/pack/capabilities.js +30 -0
- package/dist/pack/capabilities.js.map +1 -0
- package/dist/pack/compose.d.ts +21 -0
- package/dist/pack/compose.d.ts.map +1 -0
- package/dist/pack/compose.js +52 -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 +155 -0
- package/dist/pack/primitive_pack.d.ts.map +1 -0
- package/dist/pack/primitive_pack.js +81 -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 +48 -0
- package/dist/render/markdown/builder.d.ts.map +1 -0
- package/dist/render/markdown/builder.js +183 -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 +3 -0
- package/dist/render/markdown/format.d.ts.map +1 -0
- package/dist/render/markdown/format.js +186 -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 +183 -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 +95 -0
- package/dist/render/slack/format.d.ts.map +1 -0
- package/dist/render/slack/format.js +807 -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 +11 -0
- package/dist/render/slack/markdown_content.d.ts.map +1 -0
- package/dist/render/slack/markdown_content.js +354 -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 +140 -0
- package/dist/testing/conformance.d.ts.map +1 -0
- package/dist/testing/conformance.js +287 -0
- package/dist/testing/conformance.js.map +1 -0
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +9 -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 +103 -0
- package/dist/testing/registration.js.map +1 -0
- package/dist/validate/authoring_schema.d.ts +27 -0
- package/dist/validate/authoring_schema.d.ts.map +1 -0
- package/dist/validate/authoring_schema.js +291 -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 +105 -0
- package/dist/validate/validation.d.ts.map +1 -0
- package/dist/validate/validation.js +200 -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 +118 -5
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ZodType } from 'zod';
|
|
3
|
+
import type { PrimitiveNode } from '../define/primitive_module.js';
|
|
4
|
+
/**
|
|
5
|
+
* Child-element type a schema field is filled from.
|
|
6
|
+
*
|
|
7
|
+
* `Symbol.for`: ESM and CJS builds must agree, same as `authorType`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const authoredChild: unique symbol;
|
|
10
|
+
/** Phantom props type for the child component. Not set at runtime. */
|
|
11
|
+
export declare const authoredProps: unique symbol;
|
|
12
|
+
/** Set when a field is filled from text children. */
|
|
13
|
+
export declare const authoredText: unique symbol;
|
|
14
|
+
/**
|
|
15
|
+
* A field filled from child elements of `TName`.
|
|
16
|
+
*
|
|
17
|
+
* Phantom: `z.infer` still reads the underlying schema. The shim reads `TName`
|
|
18
|
+
* and `TProps` off the field type, and the symbols off the schema value.
|
|
19
|
+
*/
|
|
20
|
+
export interface AuthoredChildBrand<TName extends string, TProps> {
|
|
21
|
+
readonly [authoredChild]: TName;
|
|
22
|
+
readonly [authoredProps]: TProps;
|
|
23
|
+
}
|
|
24
|
+
/** A field filled from text children. */
|
|
25
|
+
export interface AuthoredTextBrand {
|
|
26
|
+
readonly [authoredText]: true;
|
|
27
|
+
}
|
|
28
|
+
/** What {@link fromChildren}'s `toItem` receives. */
|
|
29
|
+
export interface AuthorChildContext {
|
|
30
|
+
/** Nested elements, parsed as body nodes. */
|
|
31
|
+
parseChildren: (children: ReactNode) => PrimitiveNode[];
|
|
32
|
+
}
|
|
33
|
+
type ArrayItem<TSchema extends ZodType> = NonNullable<zOutput<TSchema>> extends readonly (infer Item)[] ? Item : NonNullable<zOutput<TSchema>>;
|
|
34
|
+
type zOutput<TSchema> = TSchema extends {
|
|
35
|
+
_zod: {
|
|
36
|
+
output: infer Output;
|
|
37
|
+
};
|
|
38
|
+
} ? Output : never;
|
|
39
|
+
/** `TText` is optional on the child props because leftover text fills it. */
|
|
40
|
+
type ChildProps<TItem, TText extends string | undefined> = [TText] extends [
|
|
41
|
+
string
|
|
42
|
+
] ? Omit<TItem, TText> & Partial<Pick<TItem, Extract<TText, keyof TItem>>> & {
|
|
43
|
+
children?: ReactNode;
|
|
44
|
+
} : TItem & {
|
|
45
|
+
children?: ReactNode;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Brands `schema` as JSX children of `childType`.
|
|
49
|
+
*
|
|
50
|
+
* `options.text` copies leftover text onto that field. `options.toItem` replaces
|
|
51
|
+
* the default prop copy; its props annotation is the child component's props.
|
|
52
|
+
* The brand is read through `.optional()`, `.nullable()`, `.default()`, and
|
|
53
|
+
* `.readonly()`; any other method clones without it, so call it on `schema`
|
|
54
|
+
* before passing it in.
|
|
55
|
+
*/
|
|
56
|
+
export declare function fromChildren<const TName extends string, TSchema extends ZodType>(childType: TName, schema: TSchema): TSchema & AuthoredChildBrand<TName, ChildProps<ArrayItem<TSchema>, undefined>>;
|
|
57
|
+
export declare function fromChildren<const TName extends string, TSchema extends ZodType, const TText extends string>(childType: TName, schema: TSchema, options: {
|
|
58
|
+
text: TText;
|
|
59
|
+
}): TSchema & AuthoredChildBrand<TName, ChildProps<ArrayItem<TSchema>, TText>>;
|
|
60
|
+
export declare function fromChildren<const TName extends string, TSchema extends ZodType, TProps>(childType: TName, schema: TSchema, options: {
|
|
61
|
+
text?: string;
|
|
62
|
+
toItem(props: TProps, context: AuthorChildContext): unknown;
|
|
63
|
+
}): TSchema & AuthoredChildBrand<TName, TProps>;
|
|
64
|
+
/**
|
|
65
|
+
* Brands `schema` as text children.
|
|
66
|
+
*
|
|
67
|
+
* Whitespace collapses unless `collapseWhitespace` is `false`.
|
|
68
|
+
*/
|
|
69
|
+
export declare const fromTextChildren: <TSchema extends ZodType>(schema: TSchema, options?: {
|
|
70
|
+
collapseWhitespace?: boolean;
|
|
71
|
+
}) => TSchema & AuthoredTextBrand;
|
|
72
|
+
/** One {@link fromChildren} field as the shim reads it. */
|
|
73
|
+
export interface AuthoredChildField {
|
|
74
|
+
field: string;
|
|
75
|
+
childType: string;
|
|
76
|
+
/** Field leftover text children fill. */
|
|
77
|
+
textField?: string;
|
|
78
|
+
/** Replaces the default prop copy. */
|
|
79
|
+
toItem?: (props: object, context: AuthorChildContext) => unknown;
|
|
80
|
+
/** The array element schema, or the field schema itself when it is not an array. */
|
|
81
|
+
itemSchema: ZodType;
|
|
82
|
+
/** Whether the field accepts `undefined`, so children may be omitted. */
|
|
83
|
+
optional: boolean;
|
|
84
|
+
/** Structural fingerprint of `itemSchema`; every field branding one child type must share it. */
|
|
85
|
+
signature: string;
|
|
86
|
+
}
|
|
87
|
+
/** One {@link fromTextChildren} field as the shim reads it. */
|
|
88
|
+
export interface AuthoredTextField {
|
|
89
|
+
field: string;
|
|
90
|
+
/** `true` unless the brand was given `collapseWhitespace: false`. */
|
|
91
|
+
collapseWhitespace: boolean;
|
|
92
|
+
/** Whether the field accepts `undefined`, so text children may be omitted. */
|
|
93
|
+
optional: boolean;
|
|
94
|
+
}
|
|
95
|
+
/** The branded fields found on one object schema. */
|
|
96
|
+
export interface AuthoredSpec {
|
|
97
|
+
children: AuthoredChildField[];
|
|
98
|
+
text: AuthoredTextField[];
|
|
99
|
+
}
|
|
100
|
+
/** Top-level branded fields on an object schema. Nested brands stay on the item schema. */
|
|
101
|
+
export declare const readAuthoredSpec: (schema: ZodType) => AuthoredSpec;
|
|
102
|
+
export {};
|
|
103
|
+
//# sourceMappingURL=authored_fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authored_fields.d.ts","sourceRoot":"","sources":["../../src/author/authored_fields.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAGnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,aAAa,eAA8C,CAAC;AAEzE,sEAAsE;AACtE,eAAO,MAAM,aAAa,eAA8C,CAAC;AAEzE,qDAAqD;AACrD,eAAO,MAAM,YAAY,eAA6C,CAAC;AAMvE;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB,CAAC,KAAK,SAAS,MAAM,EAAE,MAAM;IAC9D,QAAQ,CAAC,CAAC,aAAa,CAAC,EAAE,KAAK,CAAC;IAChC,QAAQ,CAAC,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,yCAAyC;AACzC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC;CAC/B;AAED,qDAAqD;AACrD,MAAM,WAAW,kBAAkB;IACjC,6CAA6C;IAC7C,aAAa,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,aAAa,EAAE,CAAC;CACzD;AAED,KAAK,SAAS,CAAC,OAAO,SAAS,OAAO,IACpC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,SAAS,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE,GACzD,IAAI,GACJ,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;AAEpC,KAAK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
+
* 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, IsomerError } from '../composition/error.js';
|
|
8
|
+
/**
|
|
9
|
+
* Child-element type a schema field is filled from.
|
|
10
|
+
*
|
|
11
|
+
* `Symbol.for`: ESM and CJS builds must agree, same as `authorType`.
|
|
12
|
+
*/
|
|
13
|
+
export const authoredChild = Symbol.for('elastic.isomer.authored_child');
|
|
14
|
+
/** Phantom props type for the child component. Not set at runtime. */
|
|
15
|
+
export const authoredProps = Symbol.for('elastic.isomer.authored_props');
|
|
16
|
+
/** Set when a field is filled from text children. */
|
|
17
|
+
export const authoredText = Symbol.for('elastic.isomer.authored_text');
|
|
18
|
+
const authoredToItem = Symbol.for('elastic.isomer.authored_to_item');
|
|
19
|
+
const authoredTextField = Symbol.for('elastic.isomer.authored_text_field');
|
|
20
|
+
const authoredCollapse = Symbol.for('elastic.isomer.authored_collapse');
|
|
21
|
+
const BRANDS = [
|
|
22
|
+
authoredChild,
|
|
23
|
+
authoredTextField,
|
|
24
|
+
authoredToItem,
|
|
25
|
+
authoredText,
|
|
26
|
+
authoredCollapse,
|
|
27
|
+
];
|
|
28
|
+
// Applies a complete branding. Branding an instance again is allowed only with
|
|
29
|
+
// the same configuration, absent options included, since both fields share it.
|
|
30
|
+
const brand = (caller, schema, config) => {
|
|
31
|
+
const record = schema;
|
|
32
|
+
if (BRANDS.some((key) => Object.hasOwn(schema, key))) {
|
|
33
|
+
if (BRANDS.every((key) => record[key] === config[key]))
|
|
34
|
+
return;
|
|
35
|
+
throw new IsomerError(ISOMER_ERROR_CODES.AUTHORED_SCHEMA_REUSED, `${caller}: this schema instance is already branded another way; pass each field its own schema.`);
|
|
36
|
+
}
|
|
37
|
+
for (const key of BRANDS) {
|
|
38
|
+
if (config[key] !== undefined) {
|
|
39
|
+
Object.defineProperty(schema, key, {
|
|
40
|
+
value: config[key],
|
|
41
|
+
enumerable: false,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
export function fromChildren(childType, schema, options) {
|
|
47
|
+
brand('fromChildren', schema, {
|
|
48
|
+
[authoredChild]: childType,
|
|
49
|
+
[authoredTextField]: options?.text,
|
|
50
|
+
[authoredToItem]: options?.toItem,
|
|
51
|
+
});
|
|
52
|
+
return schema;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Brands `schema` as text children.
|
|
56
|
+
*
|
|
57
|
+
* Whitespace collapses unless `collapseWhitespace` is `false`.
|
|
58
|
+
*/
|
|
59
|
+
export const fromTextChildren = (schema, options) => {
|
|
60
|
+
brand('fromTextChildren', schema, {
|
|
61
|
+
[authoredText]: true,
|
|
62
|
+
[authoredCollapse]: options?.collapseWhitespace === false ? false : undefined,
|
|
63
|
+
});
|
|
64
|
+
return schema;
|
|
65
|
+
};
|
|
66
|
+
const zodDefType = (schema) => schema._zod?.def?.type;
|
|
67
|
+
const WRAPPER_TYPES = new Set(['optional', 'nullable', 'default', 'readonly']);
|
|
68
|
+
const innerSchema = (schema) => {
|
|
69
|
+
const def = schema._zod?.def;
|
|
70
|
+
return def?.type && WRAPPER_TYPES.has(def.type) ? def.innerType : undefined;
|
|
71
|
+
};
|
|
72
|
+
// The schema holding `brand`: `schema` or one it wraps.
|
|
73
|
+
const brandHolder = (schema, key) => {
|
|
74
|
+
let current = schema;
|
|
75
|
+
while (current && !Object.hasOwn(current, key)) {
|
|
76
|
+
current = innerSchema(current);
|
|
77
|
+
}
|
|
78
|
+
return current;
|
|
79
|
+
};
|
|
80
|
+
// Whether any wrapper layer of `schema` accepts `undefined`.
|
|
81
|
+
const optionalThrough = (schema) => {
|
|
82
|
+
for (let current = schema; current; current = innerSchema(current)) {
|
|
83
|
+
if (isOptionalSchema(current))
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
return false;
|
|
87
|
+
};
|
|
88
|
+
const unwrapAll = (schema) => {
|
|
89
|
+
let current = schema;
|
|
90
|
+
for (let inner = innerSchema(current); inner; inner = innerSchema(current)) {
|
|
91
|
+
current = inner;
|
|
92
|
+
}
|
|
93
|
+
return current;
|
|
94
|
+
};
|
|
95
|
+
/** `undefined` is a valid value, so children may be omitted. */
|
|
96
|
+
const isOptionalSchema = (schema) => {
|
|
97
|
+
const type = zodDefType(schema);
|
|
98
|
+
return type === 'optional' || type === 'default';
|
|
99
|
+
};
|
|
100
|
+
const schemaSignature = (schema, seen = new Set()) => {
|
|
101
|
+
if (seen.has(schema)) {
|
|
102
|
+
return 'cycle';
|
|
103
|
+
}
|
|
104
|
+
seen.add(schema);
|
|
105
|
+
const type = zodDefType(schema) ?? '?';
|
|
106
|
+
if (type === 'object' && 'shape' in schema) {
|
|
107
|
+
const shape = schema.shape;
|
|
108
|
+
const fields = Object.keys(shape)
|
|
109
|
+
.sort()
|
|
110
|
+
.map((key) => `${key}:${schemaSignature(shape[key], seen)}`);
|
|
111
|
+
return `{${fields.join(',')}}`;
|
|
112
|
+
}
|
|
113
|
+
if (type === 'array' && 'element' in schema) {
|
|
114
|
+
return `[${schemaSignature(schema.element, seen)}]`;
|
|
115
|
+
}
|
|
116
|
+
const inner = innerSchema(schema);
|
|
117
|
+
if (inner) {
|
|
118
|
+
return `${type}(${schemaSignature(inner, seen)})`;
|
|
119
|
+
}
|
|
120
|
+
return type;
|
|
121
|
+
};
|
|
122
|
+
const arrayElement = (schema) => {
|
|
123
|
+
const inner = unwrapAll(schema);
|
|
124
|
+
if (zodDefType(inner) === 'array' && 'element' in inner) {
|
|
125
|
+
return inner.element;
|
|
126
|
+
}
|
|
127
|
+
return inner;
|
|
128
|
+
};
|
|
129
|
+
const readChild = (field, schema) => {
|
|
130
|
+
const holder = brandHolder(schema, authoredChild);
|
|
131
|
+
const childType = holder?.[authoredChild];
|
|
132
|
+
if (!holder || typeof childType !== 'string') {
|
|
133
|
+
return undefined;
|
|
134
|
+
}
|
|
135
|
+
const textField = holder[authoredTextField];
|
|
136
|
+
const toItem = holder[authoredToItem];
|
|
137
|
+
const child = {
|
|
138
|
+
field,
|
|
139
|
+
childType,
|
|
140
|
+
itemSchema: arrayElement(holder),
|
|
141
|
+
optional: optionalThrough(schema),
|
|
142
|
+
signature: schemaSignature(arrayElement(holder)),
|
|
143
|
+
};
|
|
144
|
+
if (typeof textField === 'string') {
|
|
145
|
+
child.textField = textField;
|
|
146
|
+
}
|
|
147
|
+
if (typeof toItem === 'function') {
|
|
148
|
+
child.toItem = toItem;
|
|
149
|
+
}
|
|
150
|
+
return child;
|
|
151
|
+
};
|
|
152
|
+
const readText = (field, schema) => {
|
|
153
|
+
const holder = brandHolder(schema, authoredText);
|
|
154
|
+
if (!holder) {
|
|
155
|
+
return undefined;
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
field,
|
|
159
|
+
collapseWhitespace: holder[authoredCollapse] !== false,
|
|
160
|
+
optional: optionalThrough(schema),
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
/** Top-level branded fields on an object schema. Nested brands stay on the item schema. */
|
|
164
|
+
export const readAuthoredSpec = (schema) => {
|
|
165
|
+
if (zodDefType(schema) !== 'object' || !('shape' in schema)) {
|
|
166
|
+
return { children: [], text: [] };
|
|
167
|
+
}
|
|
168
|
+
const children = [];
|
|
169
|
+
const text = [];
|
|
170
|
+
for (const [field, fieldSchema] of Object.entries(schema.shape)) {
|
|
171
|
+
const child = readChild(field, fieldSchema);
|
|
172
|
+
if (child) {
|
|
173
|
+
children.push(child);
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
const textField = readText(field, fieldSchema);
|
|
177
|
+
if (textField) {
|
|
178
|
+
text.push(textField);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return { children, text };
|
|
182
|
+
};
|
|
183
|
+
//# sourceMappingURL=authored_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AAC;QACZ,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO;QACL,KAAK;QACL,kBAAkB,EACf,MAA2C,CAAC,gBAAgB,CAAC,KAAK,KAAK;QAC1E,QAAQ,EAAE,eAAe,CAAC,MAAM,CAAC;KAClC,CAAC;AACJ,CAAC,CAAC;AAEF,2FAA2F;AAC3F,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAe,EAAgB,EAAE;IAChE,IAAI,UAAU,CAAC,MAAM,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,IAAI,MAAM,CAAC,EAAE,CAAC;QAC5D,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IACpC,CAAC;IACD,MAAM,QAAQ,GAAyB,EAAE,CAAC;IAC1C,MAAM,IAAI,GAAwB,EAAE,CAAC;IACrC,KAAK,MAAM,CAAC,KAAK,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAC/C,MAAM,CAAC,KAAgC,CACxC,EAAE,CAAC;QACF,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QAC5C,IAAI,KAAK,EAAE,CAAC;YACV,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACrB,SAAS;QACX,CAAC;QACD,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QAC/C,IAAI,SAAS,EAAE,CAAC;YACd,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC5B,CAAC,CAAC","sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nimport type { ReactNode } from 'react';\nimport type { ZodType } from 'zod';\n\nimport { ISOMER_ERROR_CODES, IsomerError } from '../composition/error';\nimport type { PrimitiveNode } from '../define/primitive_module';\n\n/**\n * Child-element type a schema field is filled from.\n *\n * `Symbol.for`: ESM and CJS builds must agree, same as `authorType`.\n */\nexport const authoredChild = Symbol.for('elastic.isomer.authored_child');\n\n/** Phantom props type for the child component. Not set at runtime. */\nexport const authoredProps = Symbol.for('elastic.isomer.authored_props');\n\n/** Set when a field is filled from text children. */\nexport const authoredText = Symbol.for('elastic.isomer.authored_text');\n\nconst authoredToItem = Symbol.for('elastic.isomer.authored_to_item');\nconst authoredTextField = Symbol.for('elastic.isomer.authored_text_field');\nconst authoredCollapse = Symbol.for('elastic.isomer.authored_collapse');\n\n/**\n * A field filled from child elements of `TName`.\n *\n * Phantom: `z.infer` still reads the underlying schema. The shim reads `TName`\n * and `TProps` off the field type, and the symbols off the schema value.\n */\nexport interface AuthoredChildBrand<TName extends string, TProps> {\n readonly [authoredChild]: TName;\n readonly [authoredProps]: TProps;\n}\n\n/** A field filled from text children. */\nexport interface AuthoredTextBrand {\n readonly [authoredText]: true;\n}\n\n/** What {@link fromChildren}'s `toItem` receives. */\nexport interface AuthorChildContext {\n /** Nested elements, parsed as body nodes. */\n parseChildren: (children: ReactNode) => PrimitiveNode[];\n}\n\ntype ArrayItem<TSchema extends ZodType> =\n NonNullable<zOutput<TSchema>> extends readonly (infer Item)[]\n ? Item\n : NonNullable<zOutput<TSchema>>;\n\ntype zOutput<TSchema> = TSchema extends { _zod: { output: infer Output } }\n ? Output\n : never;\n\n/** `TText` is optional on the child props because leftover text fills it. */\ntype ChildProps<TItem, TText extends string | undefined> = [TText] extends [\n string,\n]\n ? Omit<TItem, TText> &\n Partial<Pick<TItem, Extract<TText, keyof TItem>>> & {\n children?: ReactNode;\n }\n : TItem & { children?: ReactNode };\n\nconst BRANDS = [\n authoredChild,\n authoredTextField,\n authoredToItem,\n authoredText,\n authoredCollapse,\n] as const;\n\n// Applies a complete branding. Branding an instance again is allowed only with\n// the same configuration, absent options included, since both fields share it.\nconst brand = (\n caller: 'fromChildren' | 'fromTextChildren',\n schema: object,\n config: Partial<Record<(typeof BRANDS)[number], unknown>>\n): void => {\n const record = schema as Record<symbol, unknown>;\n if (BRANDS.some((key) => Object.hasOwn(schema, key))) {\n if (BRANDS.every((key) => record[key] === config[key])) return;\n throw new IsomerError(\n ISOMER_ERROR_CODES.AUTHORED_SCHEMA_REUSED,\n `${caller}: this schema instance is already branded another way; pass each field its own schema.`\n );\n }\n for (const key of BRANDS) {\n if (config[key] !== undefined) {\n Object.defineProperty(schema, key, {\n value: config[key],\n enumerable: false,\n });\n }\n }\n};\n\n/**\n * Brands `schema` as JSX children of `childType`.\n *\n * `options.text` copies leftover text onto that field. `options.toItem` replaces\n * the default prop copy; its props annotation is the child component's props.\n * The brand is read through `.optional()`, `.nullable()`, `.default()`, and\n * `.readonly()`; any other method clones without it, so call it on `schema`\n * before passing it in.\n */\nexport function fromChildren<\n const TName extends string,\n TSchema extends ZodType,\n>(\n childType: TName,\n schema: TSchema\n): TSchema &\n AuthoredChildBrand<TName, ChildProps<ArrayItem<TSchema>, undefined>>;\nexport function fromChildren<\n const TName extends string,\n TSchema extends ZodType,\n const TText extends string,\n>(\n childType: TName,\n schema: TSchema,\n options: { text: TText }\n): TSchema & AuthoredChildBrand<TName, ChildProps<ArrayItem<TSchema>, TText>>;\nexport function fromChildren<\n const TName extends string,\n TSchema extends ZodType,\n TProps,\n>(\n childType: TName,\n schema: TSchema,\n options: {\n text?: string;\n toItem(props: TProps, context: AuthorChildContext): unknown;\n }\n): TSchema & AuthoredChildBrand<TName, TProps>;\nexport function fromChildren(\n childType: string,\n schema: ZodType,\n options?: {\n text?: string;\n toItem?: (this: void, props: never, context: AuthorChildContext) => unknown;\n }\n): ZodType {\n brand('fromChildren', schema, {\n [authoredChild]: childType,\n [authoredTextField]: options?.text,\n [authoredToItem]: options?.toItem,\n });\n return schema;\n}\n\n/**\n * Brands `schema` as text children.\n *\n * Whitespace collapses unless `collapseWhitespace` is `false`.\n */\nexport const fromTextChildren = <TSchema extends ZodType>(\n schema: TSchema,\n options?: { collapseWhitespace?: boolean }\n): TSchema & AuthoredTextBrand => {\n brand('fromTextChildren', schema, {\n [authoredText]: true,\n [authoredCollapse]:\n options?.collapseWhitespace === false ? false : undefined,\n });\n return schema as TSchema & AuthoredTextBrand;\n};\n\n/** One {@link fromChildren} field as the shim reads it. */\nexport interface AuthoredChildField {\n field: string;\n childType: string;\n /** Field leftover text children fill. */\n textField?: string;\n /** Replaces the default prop copy. */\n toItem?: (props: object, context: AuthorChildContext) => unknown;\n /** The array element schema, or the field schema itself when it is not an array. */\n itemSchema: ZodType;\n /** Whether the field accepts `undefined`, so children may be omitted. */\n optional: boolean;\n /** Structural fingerprint of `itemSchema`; every field branding one child type must share it. */\n signature: string;\n}\n\n/** One {@link fromTextChildren} field as the shim reads it. */\nexport interface AuthoredTextField {\n field: string;\n /** `true` unless the brand was given `collapseWhitespace: false`. */\n collapseWhitespace: boolean;\n /** Whether the field accepts `undefined`, so text children may be omitted. */\n optional: boolean;\n}\n\n/** The branded fields found on one object schema. */\nexport interface AuthoredSpec {\n children: AuthoredChildField[];\n text: AuthoredTextField[];\n}\n\nconst zodDefType = (schema: object): string | undefined =>\n (schema as { _zod?: { def?: { type?: string } } })._zod?.def?.type;\n\nconst WRAPPER_TYPES = new Set(['optional', 'nullable', 'default', 'readonly']);\n\ninterface WrapperDef {\n type?: string;\n innerType?: ZodType;\n}\n\nconst innerSchema = (schema: ZodType): ZodType | undefined => {\n const def: WrapperDef | undefined = (\n schema as { _zod?: { def?: WrapperDef } }\n )._zod?.def;\n return def?.type && WRAPPER_TYPES.has(def.type) ? def.innerType : undefined;\n};\n\n// The schema holding `brand`: `schema` or one it wraps.\nconst brandHolder = (schema: ZodType, key: symbol): ZodType | undefined => {\n let current: ZodType | undefined = schema;\n while (current && !Object.hasOwn(current, key)) {\n current = innerSchema(current);\n }\n return current;\n};\n\n// Whether any wrapper layer of `schema` accepts `undefined`.\nconst optionalThrough = (schema: ZodType): boolean => {\n for (\n let current: ZodType | undefined = schema;\n current;\n current = innerSchema(current)\n ) {\n if (isOptionalSchema(current)) return true;\n }\n return false;\n};\n\nconst unwrapAll = (schema: ZodType): ZodType => {\n let current = schema;\n for (let inner = innerSchema(current); inner; inner = innerSchema(current)) {\n current = inner;\n }\n return current;\n};\n\n/** `undefined` is a valid value, so children may be omitted. */\nconst isOptionalSchema = (schema: ZodType): boolean => {\n const type = zodDefType(schema);\n return type === 'optional' || type === 'default';\n};\n\nconst schemaSignature = (\n schema: ZodType,\n seen: Set<object> = new Set()\n): string => {\n if (seen.has(schema)) {\n return 'cycle';\n }\n seen.add(schema);\n const type = zodDefType(schema) ?? '?';\n if (type === 'object' && 'shape' in schema) {\n const shape = schema.shape as Record<string, ZodType>;\n const fields = Object.keys(shape)\n .sort()\n .map((key) => `${key}:${schemaSignature(shape[key] as ZodType, seen)}`);\n return `{${fields.join(',')}}`;\n }\n if (type === 'array' && 'element' in schema) {\n return `[${schemaSignature((schema as { element: ZodType }).element, seen)}]`;\n }\n const inner = innerSchema(schema);\n if (inner) {\n return `${type}(${schemaSignature(inner, seen)})`;\n }\n return type;\n};\n\nconst arrayElement = (schema: ZodType): ZodType => {\n const inner = unwrapAll(schema);\n if (zodDefType(inner) === 'array' && 'element' in inner) {\n return (inner as { element: ZodType }).element;\n }\n return inner;\n};\n\nconst readChild = (\n field: string,\n schema: ZodType\n): AuthoredChildField | undefined => {\n const holder = brandHolder(schema, authoredChild);\n const childType = (holder as { [authoredChild]?: unknown } | undefined)?.[\n authoredChild\n ];\n if (!holder || typeof childType !== 'string') {\n return undefined;\n }\n const textField = (holder as { [authoredTextField]?: unknown })[\n authoredTextField\n ];\n const toItem = (holder as { [authoredToItem]?: unknown })[authoredToItem];\n const child: AuthoredChildField = {\n field,\n childType,\n itemSchema: arrayElement(holder),\n optional: optionalThrough(schema),\n signature: schemaSignature(arrayElement(holder)),\n };\n if (typeof textField === 'string') {\n child.textField = textField;\n }\n if (typeof toItem === 'function') {\n child.toItem = toItem as (\n props: object,\n context: AuthorChildContext\n ) => unknown;\n }\n return child;\n};\n\nconst readText = (\n field: string,\n schema: ZodType\n): AuthoredTextField | undefined => {\n const holder = brandHolder(schema, authoredText);\n if (!holder) {\n return undefined;\n }\n return {\n field,\n collapseWhitespace:\n (holder as { [authoredCollapse]?: unknown })[authoredCollapse] !== false,\n optional: optionalThrough(schema),\n };\n};\n\n/** Top-level branded fields on an object schema. Nested brands stay on the item schema. */\nexport const readAuthoredSpec = (schema: ZodType): AuthoredSpec => {\n if (zodDefType(schema) !== 'object' || !('shape' in schema)) {\n return { children: [], text: [] };\n }\n const children: AuthoredChildField[] = [];\n const text: AuthoredTextField[] = [];\n for (const [field, fieldSchema] of Object.entries(\n schema.shape as Record<string, ZodType>\n )) {\n const child = readChild(field, fieldSchema);\n if (child) {\n children.push(child);\n continue;\n }\n const textField = readText(field, fieldSchema);\n if (textField) {\n text.push(textField);\n }\n }\n return { children, text };\n};\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { type AuthorChildContext, type AuthoredChildBrand, type AuthoredTextBrand, fromChildren, fromTextChildren, } from './authored_fields.js';
|
|
2
|
+
export { type AuthorComponent } from './jsx.js';
|
|
3
|
+
export { type AuthorComposition, type CompositionAuthorProps, type JsxShim, type PrimitiveComponentMap, buildJsxShim, textFromChildren, } from './jsx_shim.js';
|
|
4
|
+
export { type AuthoringProfileId, type AuthoringPromptContext, type AuthoringViewSummary, AUTHORING_PROFILE_IDS, buildAuthoringPrompt, formatPrimitiveEntry, } from './prompt.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/author/index.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,YAAY,EACZ,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,OAAO,EACZ,KAAK,qBAAqB,EAC1B,YAAY,EACZ,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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 { fromChildren, fromTextChildren, } from './authored_fields.js';
|
|
8
|
+
export { buildJsxShim, textFromChildren, } from './jsx_shim.js';
|
|
9
|
+
export { AUTHORING_PROFILE_IDS, buildAuthoringPrompt, formatPrimitiveEntry, } from './prompt.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/author/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAIL,YAAY,EACZ,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAKL,YAAY,EACZ,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAIL,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,UAAU,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 AuthorChildContext,\n type AuthoredChildBrand,\n type AuthoredTextBrand,\n fromChildren,\n fromTextChildren,\n} from './authored_fields';\nexport { type AuthorComponent } from './jsx';\nexport {\n type AuthorComposition,\n type CompositionAuthorProps,\n type JsxShim,\n type PrimitiveComponentMap,\n buildJsxShim,\n textFromChildren,\n} from './jsx_shim';\nexport {\n type AuthoringProfileId,\n type AuthoringPromptContext,\n type AuthoringViewSummary,\n AUTHORING_PROFILE_IDS,\n buildAuthoringPrompt,\n formatPrimitiveEntry,\n} from './prompt';\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Brand carrying the primitive type an authoring component stands for.
|
|
3
|
+
*
|
|
4
|
+
* `Symbol.for` rather than `Symbol()`: the SDK ships both ESM and CJS builds,
|
|
5
|
+
* so a host can hold two copies of this module and a unique symbol would make
|
|
6
|
+
* one build's components unreadable to the other's shim.
|
|
7
|
+
*/
|
|
8
|
+
export declare const authorType: unique symbol;
|
|
9
|
+
/**
|
|
10
|
+
* A JSX component that renders `null` and exists only to carry `TType` through
|
|
11
|
+
* the tree until the shim converts it to a composition.
|
|
12
|
+
*/
|
|
13
|
+
export interface AuthorComponent<TProps, TType extends string> {
|
|
14
|
+
(props: TProps): null;
|
|
15
|
+
readonly [authorType]: TType;
|
|
16
|
+
/** Set to `type` by the shim. */
|
|
17
|
+
displayName?: string;
|
|
18
|
+
}
|
|
19
|
+
/** The {@link AuthorComponent} for one primitive `type`. */
|
|
20
|
+
export declare const defineAuthorComponent: <TProps, TType extends string>(type: TType) => AuthorComponent<TProps, TType>;
|
|
21
|
+
//# sourceMappingURL=jsx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx.d.ts","sourceRoot":"","sources":["../../src/author/jsx.ts"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,eAA2C,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,eAAe,CAAC,MAAM,EAAE,KAAK,SAAS,MAAM;IAC3D,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,CAAC,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC;IAC7B,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,4DAA4D;AAC5D,eAAO,MAAM,qBAAqB,GAAI,MAAM,EAAE,KAAK,SAAS,MAAM,EAChE,MAAM,KAAK,KACV,eAAe,CAAC,MAAM,EAAE,KAAK,CAI5B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
* Brand carrying the primitive type an authoring component stands for.
|
|
9
|
+
*
|
|
10
|
+
* `Symbol.for` rather than `Symbol()`: the SDK ships both ESM and CJS builds,
|
|
11
|
+
* so a host can hold two copies of this module and a unique symbol would make
|
|
12
|
+
* one build's components unreadable to the other's shim.
|
|
13
|
+
*/
|
|
14
|
+
export const authorType = Symbol.for('elastic.isomer.author_type');
|
|
15
|
+
/** The {@link AuthorComponent} for one primitive `type`. */
|
|
16
|
+
export const defineAuthorComponent = (type) => Object.assign(() => null, {
|
|
17
|
+
[authorType]: type,
|
|
18
|
+
displayName: type,
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=jsx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx.js","sourceRoot":"","sources":["../../src/author/jsx.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAanE,4DAA4D;AAC5D,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,IAAW,EACqB,EAAE,CAClC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE;IACxB,CAAC,UAAU,CAAC,EAAE,IAAI;IAClB,WAAW,EAAE,IAAI;CAClB,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/**\n * Brand carrying the primitive type an authoring component stands for.\n *\n * `Symbol.for` rather than `Symbol()`: the SDK ships both ESM and CJS builds,\n * so a host can hold two copies of this module and a unique symbol would make\n * one build's components unreadable to the other's shim.\n */\nexport const authorType = Symbol.for('elastic.isomer.author_type');\n\n/**\n * A JSX component that renders `null` and exists only to carry `TType` through\n * the tree until the shim converts it to a composition.\n */\nexport interface AuthorComponent<TProps, TType extends string> {\n (props: TProps): null;\n readonly [authorType]: TType;\n /** Set to `type` by the shim. */\n displayName?: string;\n}\n\n/** The {@link AuthorComponent} for one primitive `type`. */\nexport const defineAuthorComponent = <TProps, TType extends string>(\n type: TType\n): AuthorComponent<TProps, TType> =>\n Object.assign(() => null, {\n [authorType]: type,\n displayName: type,\n });\n"]}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
import type { z, ZodObject } from 'zod';
|
|
3
|
+
import type { Composition } from '../composition/composition.js';
|
|
4
|
+
import type { PrimitiveNode } from '../define/primitive_module.js';
|
|
5
|
+
import { type AuthoredChildBrand, type AuthoredTextBrand } from './authored_fields.js';
|
|
6
|
+
import { type AuthorComponent } from './jsx.js';
|
|
7
|
+
/** A {@link Composition} whose `body` is the pack's own authoring node type. */
|
|
8
|
+
export type AuthorComposition<TNode extends PrimitiveNode = PrimitiveNode> = Omit<Composition<TNode>, 'body'> & {
|
|
9
|
+
body: TNode[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Props of the shim's root element: the composition fields minus `type`, with
|
|
13
|
+
* `body` given either as an array or as JSX children.
|
|
14
|
+
*/
|
|
15
|
+
export interface CompositionAuthorProps<TNode extends PrimitiveNode = PrimitiveNode> extends Omit<AuthorComposition<TNode>, 'type' | 'body'> {
|
|
16
|
+
/** Wins outright when present: `children` are then ignored, not merged. */
|
|
17
|
+
body?: TNode[];
|
|
18
|
+
/** Parsed into `body` only when `body` is absent. Each child must be an authoring element of a registered primitive type. */
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/** Literal `type` strings; wide `string` is dropped so a string index cannot collide with `component`. */
|
|
22
|
+
type LiteralType<T extends string> = string extends T ? never : T;
|
|
23
|
+
/** No keys. Intersects away, unlike `Record<string, never>`. */
|
|
24
|
+
type NoKeys = Record<never, never>;
|
|
25
|
+
type ShapeOf<T> = T extends {
|
|
26
|
+
shape: infer Shape;
|
|
27
|
+
} ? Shape : NoKeys;
|
|
28
|
+
/** A primitive's schema type, or `never` when it declares none. */
|
|
29
|
+
type SchemaOf<P> = P extends {
|
|
30
|
+
schema: infer S;
|
|
31
|
+
} ? S extends ZodObject ? S : never : never;
|
|
32
|
+
/** A bare `ZodObject` has a string index; a real shape does not. */
|
|
33
|
+
type LooseSchema<TSchema> = string extends keyof ShapeOf<TSchema> ? true : false;
|
|
34
|
+
type Branded<F> = F extends AuthoredChildBrand<string, unknown> | AuthoredTextBrand ? F : F extends {
|
|
35
|
+
_zod: {
|
|
36
|
+
def: {
|
|
37
|
+
type: 'optional' | 'nullable' | 'default' | 'readonly';
|
|
38
|
+
innerType: infer Inner;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
} ? Branded<Inner> : F;
|
|
42
|
+
type AuthoredNames<TSchema> = {
|
|
43
|
+
[K in keyof ShapeOf<TSchema>]: Branded<ShapeOf<TSchema>[K]> extends AuthoredChildBrand<string, unknown> | AuthoredTextBrand ? K : never;
|
|
44
|
+
}[keyof ShapeOf<TSchema>];
|
|
45
|
+
type AuthorPropsForSchema<TSchema extends ZodObject> = LooseSchema<TSchema> extends true ? Record<string, unknown> & {
|
|
46
|
+
children?: ReactNode;
|
|
47
|
+
} : Omit<z.infer<TSchema>, 'type' | AuthoredNames<TSchema>> & Partial<Pick<z.infer<TSchema>, Extract<AuthoredNames<TSchema>, keyof z.infer<TSchema>>>> & {
|
|
48
|
+
children?: ReactNode;
|
|
49
|
+
};
|
|
50
|
+
type AuthorPropsFor<P> = [SchemaOf<P>] extends [never] ? Record<string, unknown> & {
|
|
51
|
+
children?: ReactNode;
|
|
52
|
+
} : AuthorPropsForSchema<SchemaOf<P>>;
|
|
53
|
+
type ChildEntry<F> = 0 extends 1 & F ? NoKeys : F extends AuthoredChildBrand<infer Name, infer Props> ? [Name] extends [string] ? {
|
|
54
|
+
[K in Capitalize<Name>]: AuthorComponent<Props & {
|
|
55
|
+
children?: ReactNode;
|
|
56
|
+
}, Name>;
|
|
57
|
+
} : NoKeys : NoKeys;
|
|
58
|
+
type UnionToIntersection<T> = (T extends unknown ? (value: T) => void : never) extends (value: infer R) => void ? R : never;
|
|
59
|
+
type ChildComponentsOf<TSchema> = LooseSchema<TSchema> extends true ? NoKeys : UnionToIntersection<{
|
|
60
|
+
[K in keyof ShapeOf<TSchema>]: ChildEntry<Branded<ShapeOf<TSchema>[K]>>;
|
|
61
|
+
}[keyof ShapeOf<TSchema>]>;
|
|
62
|
+
type ChildMapOfTuple<TPrimitives> = TPrimitives extends readonly [
|
|
63
|
+
infer Head,
|
|
64
|
+
...infer Tail
|
|
65
|
+
] ? ChildComponentsOf<SchemaOf<Head>> & ChildMapOfTuple<Tail extends readonly {
|
|
66
|
+
type: string;
|
|
67
|
+
}[] ? Tail : []> : NoKeys;
|
|
68
|
+
type ChildComponentMap<TPrimitives extends readonly {
|
|
69
|
+
type: string;
|
|
70
|
+
}[]> = ChildMapOfTuple<TPrimitives>;
|
|
71
|
+
/**
|
|
72
|
+
* PascalCase authoring components keyed from a pack's primitive `type` list.
|
|
73
|
+
* `slideFrame` becomes `SlideFrame`. Props come from the primitive's schema.
|
|
74
|
+
*/
|
|
75
|
+
export type PrimitiveComponentMap<TPrimitives extends readonly {
|
|
76
|
+
type: string;
|
|
77
|
+
}[]> = {
|
|
78
|
+
[P in TPrimitives[number] as Capitalize<LiteralType<P['type'] & string>>]: AuthorComponent<AuthorPropsFor<P>, P['type'] & string>;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* A pack's JSX authoring front: the root `Composition` element, one
|
|
82
|
+
* PascalCase component per primitive and per branded child, and the conversion
|
|
83
|
+
* back to plain data.
|
|
84
|
+
*/
|
|
85
|
+
export type JsxShim<TNode extends PrimitiveNode = PrimitiveNode, TPrimitives extends readonly {
|
|
86
|
+
type: string;
|
|
87
|
+
}[] = readonly {
|
|
88
|
+
type: string;
|
|
89
|
+
}[]> = {
|
|
90
|
+
Composition: AuthorComponent<CompositionAuthorProps<TNode>, 'view'>;
|
|
91
|
+
/** Throws when the root is not the `Composition` element, or when a child is not a registered primitive. */
|
|
92
|
+
toComposition: (element: ReactElement<CompositionAuthorProps<TNode>>) => AuthorComposition<TNode>;
|
|
93
|
+
} & PrimitiveComponentMap<TPrimitives> & ChildComponentMap<TPrimitives>;
|
|
94
|
+
/**
|
|
95
|
+
* Builds a pack's {@link JsxShim} from its primitive list.
|
|
96
|
+
*
|
|
97
|
+
* Branded schema fields ({@link fromChildren}, {@link fromTextChildren}) fill
|
|
98
|
+
* from JSX children, and each child type becomes a component. A primitive with
|
|
99
|
+
* no brand still fills its one child slot, array or single node, from
|
|
100
|
+
* {@link PrimitiveDefinition.children}.
|
|
101
|
+
*/
|
|
102
|
+
export declare const buildJsxShim: <const TPrimitives extends readonly {
|
|
103
|
+
type: string;
|
|
104
|
+
}[] = readonly {
|
|
105
|
+
type: string;
|
|
106
|
+
}[], TNode extends PrimitiveNode = PrimitiveNode>(primitives?: TPrimitives) => JsxShim<TNode, TPrimitives>;
|
|
107
|
+
/** React children as a flat array, with fragments inlined. */
|
|
108
|
+
export declare const flattenChildren: (children: ReactNode) => ReactNode[];
|
|
109
|
+
/**
|
|
110
|
+
* Children joined into one string. Throws on an element child, so a prop typed as text stays text. Collapses whitespace unless `{ collapseWhitespace: false }`.
|
|
111
|
+
*/
|
|
112
|
+
export declare const textFromChildren: (children: ReactNode, options?: {
|
|
113
|
+
collapseWhitespace?: boolean;
|
|
114
|
+
}) => string;
|
|
115
|
+
export {};
|
|
116
|
+
//# sourceMappingURL=jsx_shim.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx_shim.d.ts","sourceRoot":"","sources":["../../src/author/jsx_shim.ts"],"names":[],"mappings":"AAOA,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,CAAC,EAAE,SAAS,EAAW,MAAM,KAAK,CAAC;AAEjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EACL,KAAK,kBAAkB,EAGvB,KAAK,iBAAiB,EAEvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,eAAe,EAAqC,MAAM,OAAO,CAAC;AAEhF,gFAAgF;AAChF,MAAM,MAAM,iBAAiB,CAAC,KAAK,SAAS,aAAa,GAAG,aAAa,IACvE,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,GAAG;IACjC,IAAI,EAAE,KAAK,EAAE,CAAC;CACf,CAAC;AAEJ;;;GAGG;AACH,MAAM,WAAW,sBAAsB,CACrC,KAAK,SAAS,aAAa,GAAG,aAAa,CAC3C,SAAQ,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvD,2E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