@elmethis/solid 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 +21 -0
- package/README.md +118 -0
- package/lib/index.solid.cjs +25 -0
- package/lib/index.solid.mjs +5806 -0
- package/lib/style.css +2 -0
- package/lib-solid/components/a2ui/catalog/basic-catalog.jsx +207 -0
- package/lib-solid/components/a2ui/catalog/basic-catalog.jsx.map +1 -0
- package/lib-solid/components/a2ui/catalog/catalog-utils.js +23 -0
- package/lib-solid/components/a2ui/catalog/catalog-utils.js.map +1 -0
- package/lib-solid/components/a2ui/catalog/catalog.js +85 -0
- package/lib-solid/components/a2ui/catalog/catalog.js.map +1 -0
- package/lib-solid/components/a2ui/catalog/notion-block-catalog.jsx +217 -0
- package/lib-solid/components/a2ui/catalog/notion-block-catalog.jsx.map +1 -0
- package/lib-solid/components/a2ui/catalog/render-indexed-child.jsx +4 -0
- package/lib-solid/components/a2ui/catalog/render-indexed-child.jsx.map +1 -0
- package/lib-solid/components/a2ui/component-host.jsx +98 -0
- package/lib-solid/components/a2ui/component-host.jsx.map +1 -0
- package/lib-solid/components/a2ui/elm-a2ui.jsx +152 -0
- package/lib-solid/components/a2ui/elm-a2ui.jsx.map +1 -0
- package/lib-solid/components/a2ui/elm-a2ui.module.css +193 -0
- package/lib-solid/components/a2ui/stream-json-lines.js +45 -0
- package/lib-solid/components/a2ui/stream-json-lines.js.map +1 -0
- package/lib-solid/components/code/elm-code-block.jsx +40 -0
- package/lib-solid/components/code/elm-code-block.jsx.map +1 -0
- package/lib-solid/components/code/elm-code-block.module.css +45 -0
- package/lib-solid/components/code/elm-html-viewer.jsx +114 -0
- package/lib-solid/components/code/elm-html-viewer.jsx.map +1 -0
- package/lib-solid/components/code/elm-html-viewer.module.css +61 -0
- package/lib-solid/components/code/elm-html.jsx +178 -0
- package/lib-solid/components/code/elm-html.jsx.map +1 -0
- package/lib-solid/components/code/elm-html.module.css +5 -0
- package/lib-solid/components/code/elm-katex.jsx +14 -0
- package/lib-solid/components/code/elm-katex.jsx.map +1 -0
- package/lib-solid/components/code/elm-katex.module.css +4 -0
- package/lib-solid/components/code/elm-shiki-highlighter.jsx +74 -0
- package/lib-solid/components/code/elm-shiki-highlighter.jsx.map +1 -0
- package/lib-solid/components/code/elm-shiki-highlighter.module.css +25 -0
- package/lib-solid/components/containments/elm-collapse.jsx +31 -0
- package/lib-solid/components/containments/elm-collapse.jsx.map +1 -0
- package/lib-solid/components/containments/elm-collapse.module.css +47 -0
- package/lib-solid/components/containments/elm-modal.jsx +96 -0
- package/lib-solid/components/containments/elm-modal.jsx.map +1 -0
- package/lib-solid/components/containments/elm-modal.module.css +28 -0
- package/lib-solid/components/containments/elm-parallax.jsx +22 -0
- package/lib-solid/components/containments/elm-parallax.jsx.map +1 -0
- package/lib-solid/components/containments/elm-parallax.module.css +29 -0
- package/lib-solid/components/containments/elm-tabs.jsx +74 -0
- package/lib-solid/components/containments/elm-tabs.jsx.map +1 -0
- package/lib-solid/components/containments/elm-tabs.module.css +63 -0
- package/lib-solid/components/containments/elm-toggle.jsx +58 -0
- package/lib-solid/components/containments/elm-toggle.jsx.map +1 -0
- package/lib-solid/components/containments/elm-toggle.module.css +98 -0
- package/lib-solid/components/containments/elm-tooltip.jsx +61 -0
- package/lib-solid/components/containments/elm-tooltip.jsx.map +1 -0
- package/lib-solid/components/containments/elm-tooltip.module.css +23 -0
- package/lib-solid/components/fallback/elm-block-fallback.jsx +22 -0
- package/lib-solid/components/fallback/elm-block-fallback.jsx.map +1 -0
- package/lib-solid/components/fallback/elm-block-fallback.module.css +8 -0
- package/lib-solid/components/fallback/elm-rectangle-wave.jsx +8 -0
- package/lib-solid/components/fallback/elm-rectangle-wave.jsx.map +1 -0
- package/lib-solid/components/fallback/elm-rectangle-wave.module.css +35 -0
- package/lib-solid/components/fallback/elm-unsupported-block.jsx +19 -0
- package/lib-solid/components/fallback/elm-unsupported-block.jsx.map +1 -0
- package/lib-solid/components/fallback/elm-unsupported-block.module.css +26 -0
- package/lib-solid/components/form/elm-button-dropdown.jsx +121 -0
- package/lib-solid/components/form/elm-button-dropdown.jsx.map +1 -0
- package/lib-solid/components/form/elm-button-dropdown.module.css +83 -0
- package/lib-solid/components/form/elm-button.jsx +49 -0
- package/lib-solid/components/form/elm-button.jsx.map +1 -0
- package/lib-solid/components/form/elm-button.module.css +96 -0
- package/lib-solid/components/form/elm-checkbox.jsx +61 -0
- package/lib-solid/components/form/elm-checkbox.jsx.map +1 -0
- package/lib-solid/components/form/elm-checkbox.module.css +63 -0
- package/lib-solid/components/form/elm-select.jsx +98 -0
- package/lib-solid/components/form/elm-select.jsx.map +1 -0
- package/lib-solid/components/form/elm-select.module.css +108 -0
- package/lib-solid/components/form/elm-slider.jsx +298 -0
- package/lib-solid/components/form/elm-slider.jsx.map +1 -0
- package/lib-solid/components/form/elm-slider.module.css +236 -0
- package/lib-solid/components/form/elm-switch.jsx +37 -0
- package/lib-solid/components/form/elm-switch.jsx.map +1 -0
- package/lib-solid/components/form/elm-switch.module.css +59 -0
- package/lib-solid/components/form/elm-text-area.jsx +95 -0
- package/lib-solid/components/form/elm-text-area.jsx.map +1 -0
- package/lib-solid/components/form/elm-text-area.module.css +133 -0
- package/lib-solid/components/form/elm-text-field.jsx +129 -0
- package/lib-solid/components/form/elm-text-field.jsx.map +1 -0
- package/lib-solid/components/form/elm-text-field.module.css +158 -0
- package/lib-solid/components/form/elm-validation.jsx +27 -0
- package/lib-solid/components/form/elm-validation.jsx.map +1 -0
- package/lib-solid/components/form/elm-validation.module.css +9 -0
- package/lib-solid/components/icon/elm-copy-icon.jsx +34 -0
- package/lib-solid/components/icon/elm-copy-icon.jsx.map +1 -0
- package/lib-solid/components/icon/elm-copy-icon.module.css +32 -0
- package/lib-solid/components/icon/elm-dot-loading-icon.jsx +19 -0
- package/lib-solid/components/icon/elm-dot-loading-icon.jsx.map +1 -0
- package/lib-solid/components/icon/elm-dot-loading-icon.module.css +48 -0
- package/lib-solid/components/icon/elm-inline-icon.jsx +19 -0
- package/lib-solid/components/icon/elm-inline-icon.jsx.map +1 -0
- package/lib-solid/components/icon/elm-inline-icon.module.css +38 -0
- package/lib-solid/components/icon/elm-language-icon.jsx +17 -0
- package/lib-solid/components/icon/elm-language-icon.jsx.map +1 -0
- package/lib-solid/components/icon/elm-mdi-icon.jsx +27 -0
- package/lib-solid/components/icon/elm-mdi-icon.jsx.map +1 -0
- package/lib-solid/components/icon/elm-mdi-icon.module.css +7 -0
- package/lib-solid/components/icon/elm-square-loading-icon.jsx +31 -0
- package/lib-solid/components/icon/elm-square-loading-icon.jsx.map +1 -0
- package/lib-solid/components/icon/elm-square-loading-icon.module.css +38 -0
- package/lib-solid/components/icon/elm-toggle-theme.jsx +146 -0
- package/lib-solid/components/icon/elm-toggle-theme.jsx.map +1 -0
- package/lib-solid/components/icon/elm-toggle-theme.module.css +15 -0
- package/lib-solid/components/icon/language-glyph.jsx +27 -0
- package/lib-solid/components/icon/language-glyph.jsx.map +1 -0
- package/lib-solid/components/media/elm-audio-player.jsx +275 -0
- package/lib-solid/components/media/elm-audio-player.jsx.map +1 -0
- package/lib-solid/components/media/elm-audio-player.module.css +433 -0
- package/lib-solid/components/media/elm-block-image.jsx +54 -0
- package/lib-solid/components/media/elm-block-image.jsx.map +1 -0
- package/lib-solid/components/media/elm-block-image.module.css +45 -0
- package/lib-solid/components/media/elm-file.jsx +65 -0
- package/lib-solid/components/media/elm-file.jsx.map +1 -0
- package/lib-solid/components/media/elm-file.module.css +33 -0
- package/lib-solid/components/navigation/elm-bookmark.jsx +44 -0
- package/lib-solid/components/navigation/elm-bookmark.jsx.map +1 -0
- package/lib-solid/components/navigation/elm-bookmark.module.css +88 -0
- package/lib-solid/components/navigation/elm-breadcrumb.jsx +26 -0
- package/lib-solid/components/navigation/elm-breadcrumb.jsx.map +1 -0
- package/lib-solid/components/navigation/elm-breadcrumb.module.css +44 -0
- package/lib-solid/components/navigation/elm-page-top.jsx +56 -0
- package/lib-solid/components/navigation/elm-page-top.jsx.map +1 -0
- package/lib-solid/components/navigation/elm-page-top.module.css +130 -0
- package/lib-solid/components/notion/elm-notion-callout.jsx +22 -0
- package/lib-solid/components/notion/elm-notion-callout.jsx.map +1 -0
- package/lib-solid/components/notion/elm-notion-callout.module.css +91 -0
- package/lib-solid/components/others/color-sample-copy.js +63 -0
- package/lib-solid/components/others/color-sample-copy.js.map +1 -0
- package/lib-solid/components/others/elm-color-primitive-sample.jsx +55 -0
- package/lib-solid/components/others/elm-color-primitive-sample.jsx.map +1 -0
- package/lib-solid/components/others/elm-color-primitive-sample.module.css +74 -0
- package/lib-solid/components/others/elm-color-semantic-sample.jsx +170 -0
- package/lib-solid/components/others/elm-color-semantic-sample.jsx.map +1 -0
- package/lib-solid/components/others/elm-color-semantic-sample.module.css +134 -0
- package/lib-solid/components/others/elm-markdown.jsx +133 -0
- package/lib-solid/components/others/elm-markdown.jsx.map +1 -0
- package/lib-solid/components/others/elm-markdown.module.css +6 -0
- package/lib-solid/components/others/use-wordle.jsx +247 -0
- package/lib-solid/components/others/use-wordle.jsx.map +1 -0
- package/lib-solid/components/others/use-wordle.module.css +192 -0
- package/lib-solid/components/others/wordle/validGuesses.js +10660 -0
- package/lib-solid/components/others/wordle/validGuesses.js.map +1 -0
- package/lib-solid/components/others/wordle/wordlist.js +5760 -0
- package/lib-solid/components/others/wordle/wordlist.js.map +1 -0
- package/lib-solid/components/table/elm-table-body.jsx +9 -0
- package/lib-solid/components/table/elm-table-body.jsx.map +1 -0
- package/lib-solid/components/table/elm-table-cell.jsx +27 -0
- package/lib-solid/components/table/elm-table-cell.jsx.map +1 -0
- package/lib-solid/components/table/elm-table-cell.module.css +27 -0
- package/lib-solid/components/table/elm-table-header.jsx +13 -0
- package/lib-solid/components/table/elm-table-header.jsx.map +1 -0
- package/lib-solid/components/table/elm-table-header.module.css +7 -0
- package/lib-solid/components/table/elm-table-row.jsx +10 -0
- package/lib-solid/components/table/elm-table-row.jsx.map +1 -0
- package/lib-solid/components/table/elm-table-row.module.css +15 -0
- package/lib-solid/components/table/elm-table.jsx +63 -0
- package/lib-solid/components/table/elm-table.jsx.map +1 -0
- package/lib-solid/components/table/elm-table.module.css +107 -0
- package/lib-solid/components/table/index.js +7 -0
- package/lib-solid/components/table/index.js.map +1 -0
- package/lib-solid/components/table/table-context.js +5 -0
- package/lib-solid/components/table/table-context.js.map +1 -0
- package/lib-solid/components/typography/elm-block-quote.jsx +22 -0
- package/lib-solid/components/typography/elm-block-quote.jsx.map +1 -0
- package/lib-solid/components/typography/elm-block-quote.module.css +40 -0
- package/lib-solid/components/typography/elm-callout.jsx +24 -0
- package/lib-solid/components/typography/elm-callout.jsx.map +1 -0
- package/lib-solid/components/typography/elm-callout.module.css +65 -0
- package/lib-solid/components/typography/elm-divider.jsx +8 -0
- package/lib-solid/components/typography/elm-divider.jsx.map +1 -0
- package/lib-solid/components/typography/elm-divider.module.css +5 -0
- package/lib-solid/components/typography/elm-fragment-identifier.jsx +16 -0
- package/lib-solid/components/typography/elm-fragment-identifier.jsx.map +1 -0
- package/lib-solid/components/typography/elm-fragment-identifier.module.css +28 -0
- package/lib-solid/components/typography/elm-heading.jsx +37 -0
- package/lib-solid/components/typography/elm-heading.jsx.map +1 -0
- package/lib-solid/components/typography/elm-heading.module.css +96 -0
- package/lib-solid/components/typography/elm-inline-text.jsx +75 -0
- package/lib-solid/components/typography/elm-inline-text.jsx.map +1 -0
- package/lib-solid/components/typography/elm-inline-text.module.css +118 -0
- package/lib-solid/components/typography/elm-list.jsx +13 -0
- package/lib-solid/components/typography/elm-list.jsx.map +1 -0
- package/lib-solid/components/typography/elm-list.module.css +92 -0
- package/lib-solid/components/typography/elm-paragraph.jsx +21 -0
- package/lib-solid/components/typography/elm-paragraph.jsx.map +1 -0
- package/lib-solid/components/typography/elm-paragraph.module.css +15 -0
- package/lib-solid/components/typography/markers/list-bullet-level-1.svg +3 -0
- package/lib-solid/components/typography/markers/list-bullet-level-2.svg +3 -0
- package/lib-solid/components/typography/markers/list-bullet-level-3.svg +3 -0
- package/lib-solid/exports.js +67 -0
- package/lib-solid/exports.js.map +1 -0
- package/lib-solid/hooks/create-auto-animate.js +61 -0
- package/lib-solid/hooks/create-auto-animate.js.map +1 -0
- package/lib-solid/index.js +3 -0
- package/lib-solid/index.js.map +1 -0
- package/lib-solid/primitives/call-event-handler.js +9 -0
- package/lib-solid/primitives/call-event-handler.js.map +1 -0
- package/lib-solid/primitives/create-async-state.js +71 -0
- package/lib-solid/primitives/create-async-state.js.map +1 -0
- package/lib-solid/primitives/create-auto-animate.js +67 -0
- package/lib-solid/primitives/create-auto-animate.js.map +1 -0
- package/lib-solid/primitives/create-clipboard.js +41 -0
- package/lib-solid/primitives/create-clipboard.js.map +1 -0
- package/lib-solid/primitives/create-controllable-signal.js +32 -0
- package/lib-solid/primitives/create-controllable-signal.js.map +1 -0
- package/lib-solid/primitives/create-debounced.js +41 -0
- package/lib-solid/primitives/create-debounced.js.map +1 -0
- package/lib-solid/primitives/create-delayed-signal.js +34 -0
- package/lib-solid/primitives/create-delayed-signal.js.map +1 -0
- package/lib-solid/primitives/create-elmethis-theme.js +83 -0
- package/lib-solid/primitives/create-elmethis-theme.js.map +1 -0
- package/lib-solid/primitives/create-modal.jsx +14 -0
- package/lib-solid/primitives/create-modal.jsx.map +1 -0
- package/lib-solid/primitives/create-storage.js +173 -0
- package/lib-solid/primitives/create-storage.js.map +1 -0
- package/lib-solid/primitives/create-throttled-queue.js +80 -0
- package/lib-solid/primitives/create-throttled-queue.js.map +1 -0
- package/lib-solid/primitives/create-throttled.js +58 -0
- package/lib-solid/primitives/create-throttled.js.map +1 -0
- package/lib-solid/styles/_component-vars.css +48 -0
- package/lib-solid/styles/merge-style.js +11 -0
- package/lib-solid/styles/merge-style.js.map +1 -0
- package/lib-solid/styles/text.module.css +11 -0
- package/lib-types/components/a2ui/catalog/basic-catalog.d.ts +5 -0
- package/lib-types/components/a2ui/catalog/basic-catalog.d.ts.map +1 -0
- package/lib-types/components/a2ui/catalog/catalog-utils.d.ts +5 -0
- package/lib-types/components/a2ui/catalog/catalog-utils.d.ts.map +1 -0
- package/lib-types/components/a2ui/catalog/catalog.d.ts +39 -0
- package/lib-types/components/a2ui/catalog/catalog.d.ts.map +1 -0
- package/lib-types/components/a2ui/catalog/notion-block-catalog.d.ts +5 -0
- package/lib-types/components/a2ui/catalog/notion-block-catalog.d.ts.map +1 -0
- package/lib-types/components/a2ui/catalog/render-indexed-child.d.ts +11 -0
- package/lib-types/components/a2ui/catalog/render-indexed-child.d.ts.map +1 -0
- package/lib-types/components/a2ui/component-host.d.ts +14 -0
- package/lib-types/components/a2ui/component-host.d.ts.map +1 -0
- package/lib-types/components/a2ui/elm-a2ui.d.ts +28 -0
- package/lib-types/components/a2ui/elm-a2ui.d.ts.map +1 -0
- package/lib-types/components/a2ui/stream-json-lines.d.ts +8 -0
- package/lib-types/components/a2ui/stream-json-lines.d.ts.map +1 -0
- package/lib-types/components/code/elm-code-block.d.ts +11 -0
- package/lib-types/components/code/elm-code-block.d.ts.map +1 -0
- package/lib-types/components/code/elm-html-viewer.d.ts +20 -0
- package/lib-types/components/code/elm-html-viewer.d.ts.map +1 -0
- package/lib-types/components/code/elm-html.d.ts +24 -0
- package/lib-types/components/code/elm-html.d.ts.map +1 -0
- package/lib-types/components/code/elm-katex.d.ts +9 -0
- package/lib-types/components/code/elm-katex.d.ts.map +1 -0
- package/lib-types/components/code/elm-shiki-highlighter.d.ts +9 -0
- package/lib-types/components/code/elm-shiki-highlighter.d.ts.map +1 -0
- package/lib-types/components/containments/elm-collapse.d.ts +8 -0
- package/lib-types/components/containments/elm-collapse.d.ts.map +1 -0
- package/lib-types/components/containments/elm-modal.d.ts +9 -0
- package/lib-types/components/containments/elm-modal.d.ts.map +1 -0
- package/lib-types/components/containments/elm-parallax.d.ts +6 -0
- package/lib-types/components/containments/elm-parallax.d.ts.map +1 -0
- package/lib-types/components/containments/elm-tabs.d.ts +24 -0
- package/lib-types/components/containments/elm-tabs.d.ts.map +1 -0
- package/lib-types/components/containments/elm-toggle.d.ts +17 -0
- package/lib-types/components/containments/elm-toggle.d.ts.map +1 -0
- package/lib-types/components/containments/elm-tooltip.d.ts +9 -0
- package/lib-types/components/containments/elm-tooltip.d.ts.map +1 -0
- package/lib-types/components/fallback/elm-block-fallback.d.ts +6 -0
- package/lib-types/components/fallback/elm-block-fallback.d.ts.map +1 -0
- package/lib-types/components/fallback/elm-rectangle-wave.d.ts +4 -0
- package/lib-types/components/fallback/elm-rectangle-wave.d.ts.map +1 -0
- package/lib-types/components/fallback/elm-unsupported-block.d.ts +6 -0
- package/lib-types/components/fallback/elm-unsupported-block.d.ts.map +1 -0
- package/lib-types/components/form/elm-button-dropdown.d.ts +51 -0
- package/lib-types/components/form/elm-button-dropdown.d.ts.map +1 -0
- package/lib-types/components/form/elm-button.d.ts +12 -0
- package/lib-types/components/form/elm-button.d.ts.map +1 -0
- package/lib-types/components/form/elm-checkbox.d.ts +17 -0
- package/lib-types/components/form/elm-checkbox.d.ts.map +1 -0
- package/lib-types/components/form/elm-select.d.ts +29 -0
- package/lib-types/components/form/elm-select.d.ts.map +1 -0
- package/lib-types/components/form/elm-slider.d.ts +32 -0
- package/lib-types/components/form/elm-slider.d.ts.map +1 -0
- package/lib-types/components/form/elm-switch.d.ts +15 -0
- package/lib-types/components/form/elm-switch.d.ts.map +1 -0
- package/lib-types/components/form/elm-text-area.d.ts +14 -0
- package/lib-types/components/form/elm-text-area.d.ts.map +1 -0
- package/lib-types/components/form/elm-text-field.d.ts +18 -0
- package/lib-types/components/form/elm-text-field.d.ts.map +1 -0
- package/lib-types/components/form/elm-validation.d.ts +8 -0
- package/lib-types/components/form/elm-validation.d.ts.map +1 -0
- package/lib-types/components/icon/elm-copy-icon.d.ts +7 -0
- package/lib-types/components/icon/elm-copy-icon.d.ts.map +1 -0
- package/lib-types/components/icon/elm-dot-loading-icon.d.ts +7 -0
- package/lib-types/components/icon/elm-dot-loading-icon.d.ts.map +1 -0
- package/lib-types/components/icon/elm-inline-icon.d.ts +12 -0
- package/lib-types/components/icon/elm-inline-icon.d.ts.map +1 -0
- package/lib-types/components/icon/elm-language-icon.d.ts +13 -0
- package/lib-types/components/icon/elm-language-icon.d.ts.map +1 -0
- package/lib-types/components/icon/elm-mdi-icon.d.ts +10 -0
- package/lib-types/components/icon/elm-mdi-icon.d.ts.map +1 -0
- package/lib-types/components/icon/elm-square-loading-icon.d.ts +7 -0
- package/lib-types/components/icon/elm-square-loading-icon.d.ts.map +1 -0
- package/lib-types/components/icon/elm-toggle-theme.d.ts +7 -0
- package/lib-types/components/icon/elm-toggle-theme.d.ts.map +1 -0
- package/lib-types/components/icon/language-glyph.d.ts +11 -0
- package/lib-types/components/icon/language-glyph.d.ts.map +1 -0
- package/lib-types/components/media/elm-audio-player.d.ts +25 -0
- package/lib-types/components/media/elm-audio-player.d.ts.map +1 -0
- package/lib-types/components/media/elm-block-image.d.ts +15 -0
- package/lib-types/components/media/elm-block-image.d.ts.map +1 -0
- package/lib-types/components/media/elm-file.d.ts +11 -0
- package/lib-types/components/media/elm-file.d.ts.map +1 -0
- package/lib-types/components/navigation/elm-bookmark.d.ts +13 -0
- package/lib-types/components/navigation/elm-bookmark.d.ts.map +1 -0
- package/lib-types/components/navigation/elm-breadcrumb.d.ts +11 -0
- package/lib-types/components/navigation/elm-breadcrumb.d.ts.map +1 -0
- package/lib-types/components/navigation/elm-page-top.d.ts +7 -0
- package/lib-types/components/navigation/elm-page-top.d.ts.map +1 -0
- package/lib-types/components/notion/elm-notion-callout.d.ts +21 -0
- package/lib-types/components/notion/elm-notion-callout.d.ts.map +1 -0
- package/lib-types/components/others/color-sample-copy.d.ts +10 -0
- package/lib-types/components/others/color-sample-copy.d.ts.map +1 -0
- package/lib-types/components/others/elm-color-primitive-sample.d.ts +4 -0
- package/lib-types/components/others/elm-color-primitive-sample.d.ts.map +1 -0
- package/lib-types/components/others/elm-color-semantic-sample.d.ts +4 -0
- package/lib-types/components/others/elm-color-semantic-sample.d.ts.map +1 -0
- package/lib-types/components/others/elm-markdown.d.ts +8 -0
- package/lib-types/components/others/elm-markdown.d.ts.map +1 -0
- package/lib-types/components/others/use-wordle.d.ts +25 -0
- package/lib-types/components/others/use-wordle.d.ts.map +1 -0
- package/lib-types/components/others/wordle/validGuesses.d.ts +2 -0
- package/lib-types/components/others/wordle/validGuesses.d.ts.map +1 -0
- package/lib-types/components/others/wordle/wordlist.d.ts +2 -0
- package/lib-types/components/others/wordle/wordlist.d.ts.map +1 -0
- package/lib-types/components/table/elm-table-body.d.ts +4 -0
- package/lib-types/components/table/elm-table-body.d.ts.map +1 -0
- package/lib-types/components/table/elm-table-cell.d.ts +11 -0
- package/lib-types/components/table/elm-table-cell.d.ts.map +1 -0
- package/lib-types/components/table/elm-table-header.d.ts +4 -0
- package/lib-types/components/table/elm-table-header.d.ts.map +1 -0
- package/lib-types/components/table/elm-table-row.d.ts +4 -0
- package/lib-types/components/table/elm-table-row.d.ts.map +1 -0
- package/lib-types/components/table/elm-table.d.ts +7 -0
- package/lib-types/components/table/elm-table.d.ts.map +1 -0
- package/lib-types/components/table/index.d.ts +7 -0
- package/lib-types/components/table/index.d.ts.map +1 -0
- package/lib-types/components/table/table-context.d.ts +7 -0
- package/lib-types/components/table/table-context.d.ts.map +1 -0
- package/lib-types/components/typography/elm-block-quote.d.ts +5 -0
- package/lib-types/components/typography/elm-block-quote.d.ts.map +1 -0
- package/lib-types/components/typography/elm-callout.d.ts +8 -0
- package/lib-types/components/typography/elm-callout.d.ts.map +1 -0
- package/lib-types/components/typography/elm-divider.d.ts +4 -0
- package/lib-types/components/typography/elm-divider.d.ts.map +1 -0
- package/lib-types/components/typography/elm-fragment-identifier.d.ts +7 -0
- package/lib-types/components/typography/elm-fragment-identifier.d.ts.map +1 -0
- package/lib-types/components/typography/elm-heading.d.ts +8 -0
- package/lib-types/components/typography/elm-heading.d.ts.map +1 -0
- package/lib-types/components/typography/elm-inline-text.d.ts +23 -0
- package/lib-types/components/typography/elm-inline-text.d.ts.map +1 -0
- package/lib-types/components/typography/elm-list.d.ts +7 -0
- package/lib-types/components/typography/elm-list.d.ts.map +1 -0
- package/lib-types/components/typography/elm-paragraph.d.ts +7 -0
- package/lib-types/components/typography/elm-paragraph.d.ts.map +1 -0
- package/lib-types/exports.d.ts +67 -0
- package/lib-types/exports.d.ts.map +1 -0
- package/lib-types/hooks/create-auto-animate.d.ts +26 -0
- package/lib-types/hooks/create-auto-animate.d.ts.map +1 -0
- package/lib-types/index.d.ts +3 -0
- package/lib-types/index.d.ts.map +1 -0
- package/lib-types/primitives/call-event-handler.d.ts +6 -0
- package/lib-types/primitives/call-event-handler.d.ts.map +1 -0
- package/lib-types/primitives/create-async-state.d.ts +25 -0
- package/lib-types/primitives/create-async-state.d.ts.map +1 -0
- package/lib-types/primitives/create-auto-animate.d.ts +26 -0
- package/lib-types/primitives/create-auto-animate.d.ts.map +1 -0
- package/lib-types/primitives/create-clipboard.d.ts +16 -0
- package/lib-types/primitives/create-clipboard.d.ts.map +1 -0
- package/lib-types/primitives/create-controllable-signal.d.ts +17 -0
- package/lib-types/primitives/create-controllable-signal.d.ts.map +1 -0
- package/lib-types/primitives/create-debounced.d.ts +10 -0
- package/lib-types/primitives/create-debounced.d.ts.map +1 -0
- package/lib-types/primitives/create-delayed-signal.d.ts +10 -0
- package/lib-types/primitives/create-delayed-signal.d.ts.map +1 -0
- package/lib-types/primitives/create-elmethis-theme.d.ts +12 -0
- package/lib-types/primitives/create-elmethis-theme.d.ts.map +1 -0
- package/lib-types/primitives/create-modal.d.ts +15 -0
- package/lib-types/primitives/create-modal.d.ts.map +1 -0
- package/lib-types/primitives/create-storage.d.ts +18 -0
- package/lib-types/primitives/create-storage.d.ts.map +1 -0
- package/lib-types/primitives/create-throttled-queue.d.ts +17 -0
- package/lib-types/primitives/create-throttled-queue.d.ts.map +1 -0
- package/lib-types/primitives/create-throttled.d.ts +10 -0
- package/lib-types/primitives/create-throttled.d.ts.map +1 -0
- package/lib-types/styles/merge-style.d.ts +5 -0
- package/lib-types/styles/merge-style.d.ts.map +1 -0
- package/package.json +112 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { createSignal, onCleanup, onMount, } from "solid-js";
|
|
2
|
+
const LOCAL_STORAGE_SYNC_EVENT = "elmethis-local-storage-change";
|
|
3
|
+
const SESSION_CHANNEL_PREFIX = "elmethis:sessionStorage:";
|
|
4
|
+
const parse = (serialized) => JSON.parse(serialized);
|
|
5
|
+
const serialize = (value) => {
|
|
6
|
+
const serialized = JSON.stringify(value);
|
|
7
|
+
if (serialized === undefined) {
|
|
8
|
+
throw new TypeError("The storage value is not JSON-serializable");
|
|
9
|
+
}
|
|
10
|
+
return serialized;
|
|
11
|
+
};
|
|
12
|
+
const isStorageSyncMessage = (value) => {
|
|
13
|
+
if (typeof value !== "object" || value === null)
|
|
14
|
+
return false;
|
|
15
|
+
const message = value;
|
|
16
|
+
return (message.protocol === "elmethis-storage-v1" &&
|
|
17
|
+
typeof message.key === "string" &&
|
|
18
|
+
(message.type === "remove" ||
|
|
19
|
+
(message.type === "set" && typeof message.value === "string")));
|
|
20
|
+
};
|
|
21
|
+
const warn = (operation, key, error) => {
|
|
22
|
+
console.warn(`createStorage: failed to ${operation} "${key}"`, error);
|
|
23
|
+
};
|
|
24
|
+
function createStorage(area, options) {
|
|
25
|
+
const [state, setStateRaw] = createSignal(options.initialValue);
|
|
26
|
+
const source = {};
|
|
27
|
+
let storage;
|
|
28
|
+
let channel;
|
|
29
|
+
let mounted = false;
|
|
30
|
+
const setRawValue = (value) => setStateRaw((() => value));
|
|
31
|
+
const applyIncoming = (operation) => {
|
|
32
|
+
if (operation.type === "remove") {
|
|
33
|
+
setRawValue(options.initialValue);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
setRawValue(parse(operation.value));
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
warn("parse", options.key, error);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const persist = (operation) => {
|
|
44
|
+
if (!mounted)
|
|
45
|
+
return;
|
|
46
|
+
if (storage) {
|
|
47
|
+
try {
|
|
48
|
+
if (operation.type === "remove")
|
|
49
|
+
storage.removeItem(options.key);
|
|
50
|
+
else
|
|
51
|
+
storage.setItem(options.key, operation.value);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
warn(operation.type === "remove" ? "remove" : "write", options.key, error);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const message = {
|
|
58
|
+
protocol: "elmethis-storage-v1",
|
|
59
|
+
key: options.key,
|
|
60
|
+
...operation,
|
|
61
|
+
};
|
|
62
|
+
if (area === "local") {
|
|
63
|
+
window.dispatchEvent(new CustomEvent(LOCAL_STORAGE_SYNC_EVENT, {
|
|
64
|
+
detail: { ...message, source },
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
else if (channel) {
|
|
68
|
+
try {
|
|
69
|
+
channel.postMessage(message);
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
warn("broadcast", options.key, error);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
const setState = ((value) => {
|
|
77
|
+
const nextValue = setStateRaw(value);
|
|
78
|
+
try {
|
|
79
|
+
persist({ type: "set", value: serialize(nextValue) });
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
warn("serialize", options.key, error);
|
|
83
|
+
}
|
|
84
|
+
return nextValue;
|
|
85
|
+
});
|
|
86
|
+
const remove = () => {
|
|
87
|
+
setRawValue(options.initialValue);
|
|
88
|
+
persist({ type: "remove" });
|
|
89
|
+
};
|
|
90
|
+
onMount(() => {
|
|
91
|
+
mounted = true;
|
|
92
|
+
try {
|
|
93
|
+
storage = area === "local" ? window.localStorage : window.sessionStorage;
|
|
94
|
+
const storedValue = storage.getItem(options.key);
|
|
95
|
+
if (storedValue === null) {
|
|
96
|
+
try {
|
|
97
|
+
storage.setItem(options.key, serialize(options.initialValue));
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
warn("write", options.key, error);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
applyIncoming({ type: "set", value: storedValue });
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
storage = undefined;
|
|
109
|
+
warn("read", options.key, error);
|
|
110
|
+
}
|
|
111
|
+
const onStorage = (event) => {
|
|
112
|
+
if (event.key !== options.key ||
|
|
113
|
+
(event.storageArea !== null && event.storageArea !== storage)) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
applyIncoming(event.newValue === null
|
|
117
|
+
? { type: "remove" }
|
|
118
|
+
: { type: "set", value: event.newValue });
|
|
119
|
+
};
|
|
120
|
+
const onLocalSync = (event) => {
|
|
121
|
+
const message = event.detail;
|
|
122
|
+
if (message?.source === source ||
|
|
123
|
+
!isStorageSyncMessage(message) ||
|
|
124
|
+
message.key !== options.key) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
applyIncoming(message);
|
|
128
|
+
};
|
|
129
|
+
window.addEventListener("storage", onStorage);
|
|
130
|
+
if (area === "local") {
|
|
131
|
+
window.addEventListener(LOCAL_STORAGE_SYNC_EVENT, onLocalSync);
|
|
132
|
+
}
|
|
133
|
+
else if (typeof BroadcastChannel !== "undefined") {
|
|
134
|
+
try {
|
|
135
|
+
channel = new BroadcastChannel(`${SESSION_CHANNEL_PREFIX}${options.key}`);
|
|
136
|
+
channel.addEventListener("message", (event) => {
|
|
137
|
+
if (!isStorageSyncMessage(event.data) ||
|
|
138
|
+
event.data.key !== options.key) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
applyIncoming(event.data);
|
|
142
|
+
if (storage) {
|
|
143
|
+
try {
|
|
144
|
+
if (event.data.type === "remove")
|
|
145
|
+
storage.removeItem(options.key);
|
|
146
|
+
else
|
|
147
|
+
storage.setItem(options.key, event.data.value);
|
|
148
|
+
}
|
|
149
|
+
catch (error) {
|
|
150
|
+
warn("mirror", options.key, error);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
catch (error) {
|
|
156
|
+
channel = undefined;
|
|
157
|
+
warn("open broadcast channel for", options.key, error);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
onCleanup(() => {
|
|
161
|
+
mounted = false;
|
|
162
|
+
storage = undefined;
|
|
163
|
+
window.removeEventListener("storage", onStorage);
|
|
164
|
+
window.removeEventListener(LOCAL_STORAGE_SYNC_EVENT, onLocalSync);
|
|
165
|
+
channel?.close();
|
|
166
|
+
channel = undefined;
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
return { state, setState, remove };
|
|
170
|
+
}
|
|
171
|
+
export const createLocalStorage = (options) => createStorage("local", options);
|
|
172
|
+
export const createSessionStorage = (options) => createStorage("session", options);
|
|
173
|
+
//# sourceMappingURL=create-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-storage.js","sourceRoot":"","sources":["../../src/primitives/create-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,SAAS,EACT,OAAO,GAGR,MAAM,UAAU,CAAC;AAYlB,MAAM,wBAAwB,GAAG,+BAA+B,CAAC;AACjE,MAAM,sBAAsB,GAAG,0BAA0B,CAAC;AAmB1D,MAAM,KAAK,GAAG,CAAI,UAAkB,EAAK,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAM,CAAC;AAExE,MAAM,SAAS,GAAG,CAAI,KAAQ,EAAU,EAAE;IACxC,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACzC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,IAAI,SAAS,CAAC,4CAA4C,CAAC,CAAC;IACpE,CAAC;IACD,OAA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E,KAAK,EAAE,CAAC;YACjB,OAAO,GAAG,SAAS,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AACrC,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,OAAqC,EACf,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAE3D,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,OAAuC,EACjB,EAAE,CAAC,aAAa,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { getOwner, onCleanup } from "solid-js";
|
|
2
|
+
/** A universal FIFO queue that spaces task starts from prior task completion. */
|
|
3
|
+
export class ThrottledQueue {
|
|
4
|
+
queue = [];
|
|
5
|
+
minInterval;
|
|
6
|
+
lastFinishedAt = 0;
|
|
7
|
+
running = false;
|
|
8
|
+
destroyed = false;
|
|
9
|
+
timer;
|
|
10
|
+
constructor(minInterval = 200) {
|
|
11
|
+
this.minInterval = Math.max(0, minInterval);
|
|
12
|
+
}
|
|
13
|
+
push(task) {
|
|
14
|
+
if (this.destroyed) {
|
|
15
|
+
return Promise.reject(new Error("ThrottledQueue is destroyed"));
|
|
16
|
+
}
|
|
17
|
+
return new Promise((resolve, reject) => {
|
|
18
|
+
this.queue.push({
|
|
19
|
+
run: async () => {
|
|
20
|
+
try {
|
|
21
|
+
resolve(await task());
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
reject(error);
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
reject,
|
|
28
|
+
});
|
|
29
|
+
this.drain();
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
destroy(reason = "ThrottledQueue destroyed") {
|
|
33
|
+
if (this.destroyed)
|
|
34
|
+
return;
|
|
35
|
+
this.destroyed = true;
|
|
36
|
+
if (this.timer !== undefined) {
|
|
37
|
+
clearTimeout(this.timer);
|
|
38
|
+
this.timer = undefined;
|
|
39
|
+
}
|
|
40
|
+
const error = new Error(reason);
|
|
41
|
+
for (const entry of this.queue.splice(0))
|
|
42
|
+
entry.reject(error);
|
|
43
|
+
this.running = false;
|
|
44
|
+
}
|
|
45
|
+
drain() {
|
|
46
|
+
if (this.running || this.destroyed)
|
|
47
|
+
return;
|
|
48
|
+
this.running = true;
|
|
49
|
+
this.scheduleNext();
|
|
50
|
+
}
|
|
51
|
+
scheduleNext() {
|
|
52
|
+
if (this.queue.length === 0 || this.destroyed) {
|
|
53
|
+
this.running = false;
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const elapsed = Date.now() - this.lastFinishedAt;
|
|
57
|
+
const delay = Math.max(0, this.minInterval - elapsed);
|
|
58
|
+
this.timer = setTimeout(async () => {
|
|
59
|
+
this.timer = undefined;
|
|
60
|
+
if (this.destroyed)
|
|
61
|
+
return;
|
|
62
|
+
const entry = this.queue.shift();
|
|
63
|
+
if (!entry)
|
|
64
|
+
return;
|
|
65
|
+
await entry.run();
|
|
66
|
+
this.lastFinishedAt = Date.now();
|
|
67
|
+
this.scheduleNext();
|
|
68
|
+
}, delay);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/** Creates a queue that rejects pending tasks when its Solid owner is disposed. */
|
|
72
|
+
export function createThrottledQueue(minInterval = 200) {
|
|
73
|
+
if (!getOwner()) {
|
|
74
|
+
throw new Error("createThrottledQueue requires a reactive owner");
|
|
75
|
+
}
|
|
76
|
+
const queue = new ThrottledQueue(minInterval);
|
|
77
|
+
onCleanup(() => queue.destroy("owner disposed"));
|
|
78
|
+
return queue;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=create-throttled-queue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-throttled-queue.js","sourceRoot":"","sources":["../../src/primitives/create-throttled-queue.ts"],"names":[],"mappings":"AAAA,OA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,oBAAoB,CAAC,WAAW,GAAG,GAAG;IACpD,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,cAAc,CAAC,WAAW,CAAC,CAAC;IAC9C,SAAS,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;IACjD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { createSignal, onCleanup, untrack, } from "solid-js";
|
|
2
|
+
/** Creates writable state with a leading-and-trailing throttled view. */
|
|
3
|
+
export function createThrottled(initialValue, interval) {
|
|
4
|
+
const [value, setImmediateValue] = createSignal(initialValue, {
|
|
5
|
+
equals: Object.is,
|
|
6
|
+
});
|
|
7
|
+
const [throttledValue, setThrottledValue] = createSignal(initialValue, {
|
|
8
|
+
equals: Object.is,
|
|
9
|
+
});
|
|
10
|
+
const [isCooling, setIsCooling] = createSignal(false);
|
|
11
|
+
let timer;
|
|
12
|
+
let disposed = false;
|
|
13
|
+
const armCooldown = () => {
|
|
14
|
+
setIsCooling(true);
|
|
15
|
+
timer = setTimeout(() => {
|
|
16
|
+
timer = undefined;
|
|
17
|
+
if (disposed)
|
|
18
|
+
return;
|
|
19
|
+
const latestValue = untrack(value);
|
|
20
|
+
if (!Object.is(latestValue, untrack(throttledValue))) {
|
|
21
|
+
setThrottledValue(() => latestValue);
|
|
22
|
+
armCooldown();
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
setIsCooling(false);
|
|
26
|
+
}
|
|
27
|
+
}, Math.max(0, interval));
|
|
28
|
+
};
|
|
29
|
+
const setValue = ((nextValue) => untrack(() => {
|
|
30
|
+
const currentValue = value();
|
|
31
|
+
const resolvedValue = typeof nextValue === "function"
|
|
32
|
+
? nextValue(currentValue)
|
|
33
|
+
: nextValue;
|
|
34
|
+
if (Object.is(resolvedValue, currentValue))
|
|
35
|
+
return resolvedValue;
|
|
36
|
+
setImmediateValue(() => resolvedValue);
|
|
37
|
+
if (interval <= 0) {
|
|
38
|
+
if (timer !== undefined) {
|
|
39
|
+
clearTimeout(timer);
|
|
40
|
+
timer = undefined;
|
|
41
|
+
}
|
|
42
|
+
setThrottledValue(() => resolvedValue);
|
|
43
|
+
setIsCooling(false);
|
|
44
|
+
}
|
|
45
|
+
else if (timer === undefined) {
|
|
46
|
+
setThrottledValue(() => resolvedValue);
|
|
47
|
+
armCooldown();
|
|
48
|
+
}
|
|
49
|
+
return resolvedValue;
|
|
50
|
+
}));
|
|
51
|
+
onCleanup(() => {
|
|
52
|
+
disposed = true;
|
|
53
|
+
if (timer !== undefined)
|
|
54
|
+
clearTimeout(timer);
|
|
55
|
+
});
|
|
56
|
+
return { value, setValue, throttledValue, isCooling };
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=create-throttled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-throttled.js","sourceRoot":"","sources":["../../src/primitives/create-throttled.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,SAAS,EACT,OAAO,GAGR,MAAM,UAAU,CAAC;AASlB,yEAAyE;AACzE,MAAM,UAAU,eAAe,CAC7B,YAAe,EACf,QAAgB;IAEhB,MAAM,CAAC,KAAK,EAAE,iBAAiB,CAAC,GAAG,YAAY,CAAC,YAAY,EAAE;QAC5D,MAAM,EAAE,MAAM,CAAC,EAAE;KAClB,CAAC,CAAC;IACH,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,YAAY,CAAC,YAAY,EAAE;QACrE,MAAM,EAAE,MAAM,CAAC,EAAE;KAClB,CAAC,CAAC;IACH,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACtD,IAAI,KAAgD,CAAC;IACrD,IAAI,QAAQ,GAAG,KAA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,CAAC;QACtB,CAAC;aAAM,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YAC/B,iBAAiB,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,CAAC;YACvC,WAAW,EAAE,CAAC;QAChB,CAAC;QAED,OAAO,aAAa,CAAC;IACvB,CAAC,CAAC,CAAc,CAAC;IAEnB,SAAS,CAAC,GAAG,EAAE;QACb,QAAQ,GAAG,IAAI,CAAC;QAChB,IAAI,KAAK,KAAK,SAAS;YAAE,YAAY,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Allowlist of component-private CSS variables.
|
|
3
|
+
*
|
|
4
|
+
* This file is not bundled. Stylelint reads it so private variables set from
|
|
5
|
+
* component props do not trigger unknown-property errors.
|
|
6
|
+
*
|
|
7
|
+
* Component-private variables use the `--elmethis-scoped-*` prefix and belong
|
|
8
|
+
* on a component's root element. Design tokens without the `scoped` segment
|
|
9
|
+
* come from @elmethis/core/tokens.css.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
:root {
|
|
13
|
+
--elmethis-scoped-background-color: initial;
|
|
14
|
+
--elmethis-scoped-callout-color: initial;
|
|
15
|
+
--elmethis-scoped-callout-surface: initial;
|
|
16
|
+
--elmethis-scoped-collapse-transition-duration: initial;
|
|
17
|
+
--elmethis-scoped-color: initial;
|
|
18
|
+
--elmethis-scoped-cursor: initial;
|
|
19
|
+
--elmethis-scoped-dimensions: initial;
|
|
20
|
+
--elmethis-scoped-font-size: initial;
|
|
21
|
+
--elmethis-scoped-height: initial;
|
|
22
|
+
--elmethis-scoped-aspect-ratio: initial;
|
|
23
|
+
--elmethis-scoped-highlight-color: initial;
|
|
24
|
+
--elmethis-scoped-inset: initial;
|
|
25
|
+
--elmethis-scoped-opacity: initial;
|
|
26
|
+
--elmethis-scoped-padding: initial;
|
|
27
|
+
--elmethis-scoped-scale: initial;
|
|
28
|
+
--elmethis-scoped-size: initial;
|
|
29
|
+
--elmethis-scoped-width: initial;
|
|
30
|
+
--elmethis-scoped-delay: initial;
|
|
31
|
+
--elmethis-scoped-duration: initial;
|
|
32
|
+
--elmethis-scoped-modal-delay: initial;
|
|
33
|
+
--elmethis-scoped-progress: initial;
|
|
34
|
+
--elmethis-scoped-hover: initial;
|
|
35
|
+
--elmethis-scoped-volume: initial;
|
|
36
|
+
--elmethis-scoped-value-ratio: initial;
|
|
37
|
+
--elmethis-scoped-inner-min-ratio: initial;
|
|
38
|
+
--elmethis-scoped-inner-max-ratio: initial;
|
|
39
|
+
--elmethis-scoped-fill-start-ratio: initial;
|
|
40
|
+
--elmethis-scoped-fill-size-ratio: initial;
|
|
41
|
+
--elmethis-scoped-marker-ratio: initial;
|
|
42
|
+
--elmethis-scoped-max-marker-label-chars: initial;
|
|
43
|
+
--elmethis-scoped-max-marker-label-width: initial;
|
|
44
|
+
--elmethis-scoped-transition-timing-function: initial;
|
|
45
|
+
--elmethis-scoped-font-family: initial;
|
|
46
|
+
--shiki-dark: initial;
|
|
47
|
+
--shiki-dark-bg: initial;
|
|
48
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const mergeStyle = (style, scopedStyle) => {
|
|
2
|
+
if (typeof style !== "string") {
|
|
3
|
+
return { ...scopedStyle, ...(style ?? {}) };
|
|
4
|
+
}
|
|
5
|
+
const serializedScopedStyle = Object.entries(scopedStyle)
|
|
6
|
+
.filter((entry) => entry[1] != null)
|
|
7
|
+
.map(([name, value]) => `${name}:${String(value)}`)
|
|
8
|
+
.join(";");
|
|
9
|
+
return [serializedScopedStyle, style.trim()].filter(Boolean).join(";");
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=merge-style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-style.js","sourceRoot":"","sources":["../../src/styles/merge-style.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,KAAY,EACZ,WAA8B,EACF,EAAE;IAC9B,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,EAAE,GAAG,WAAW,EAAE,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,CAAC;IAC9C,CAAC;IAED,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC;SACtD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;SACnC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;SAClD,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO,CAAC,qBAAqB,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzE,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CatalogRenderer, type SolidRendererEntry } from "./catalog";
|
|
2
|
+
export declare const basicComponents: SolidRendererEntry[];
|
|
3
|
+
export declare const basicFunctions: import("@a2ui/web_core/v0_9").FunctionImplementation[];
|
|
4
|
+
export declare const basicCatalog: CatalogRenderer;
|
|
5
|
+
//# sourceMappingURL=basic-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"basic-catalog.d.ts","sourceRoot":"","sources":["../../../../src/components/a2ui/catalog/basic-catalog.tsx"],"names":[],"mappings":"AAmCA,OAAO,EACL,eAAe,EAEf,KAAK,kBAAkB,EACxB,MAAM,WAAW,CAAC;AAgCnB,eAAO,MAAM,eAAe,EAAE,kBAAkB,EA2X/C,CAAC;AAEF,eAAO,MAAM,cAAc,wDAAuB,CAAC;AACnD,eAAO,MAAM,YAAY,iBAGxB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { JSX } from "solid-js";
|
|
2
|
+
export declare const justifyContentMap: Record<string, JSX.CSSProperties["justify-content"]>;
|
|
3
|
+
export declare const alignItemsMap: Record<string, JSX.CSSProperties["align-items"]>;
|
|
4
|
+
export declare const objectFitMap: Record<string, JSX.CSSProperties["object-fit"]>;
|
|
5
|
+
//# sourceMappingURL=catalog-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-utils.d.ts","sourceRoot":"","sources":["../../../../src/components/a2ui/catalog/catalog-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC,eAAO,MAAM,iBAAiB,EAAE,MAAM,CACpC,MAAM,EACN,GAAG,CAAC,aAAa,CAAC,iBAAiB,CAAC,CASrC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,aAAa,CAAC,aAAa,CAAC,CAK1E,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,aAAa,CAAC,YAAY,CAAC,CAMxE,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Accessor, JSX } from "solid-js";
|
|
2
|
+
import { Catalog, type ComponentApi, type ComponentContext, type FunctionImplementation, type InferredComponentApiSchemaType, type ResolveA2uiProps, type SurfaceModel } from "@a2ui/web_core/v0_9";
|
|
3
|
+
export interface ChildRef {
|
|
4
|
+
id: string;
|
|
5
|
+
basePath: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const createChildRefs: (defaultBasePath: Accessor<string>) => ((value: unknown) => ChildRef[]);
|
|
8
|
+
export interface RenderArgs<TProps = Record<string, unknown>> {
|
|
9
|
+
componentId: string;
|
|
10
|
+
/** Stable DOM-safe identity scoped by surface, component, and data path. */
|
|
11
|
+
instanceId: string;
|
|
12
|
+
index: number;
|
|
13
|
+
props: TProps;
|
|
14
|
+
surface: SurfaceModel<SolidRendererEntry>;
|
|
15
|
+
context: ComponentContext;
|
|
16
|
+
childRefs: (value: unknown) => ChildRef[];
|
|
17
|
+
renderChild: (componentId: string, basePath?: string, index?: number | Accessor<number>) => JSX.Element;
|
|
18
|
+
}
|
|
19
|
+
export type RenderFn<TProps = Record<string, unknown>> = (args: RenderArgs<TProps>) => JSX.Element;
|
|
20
|
+
export type SolidRendererEntry<Api extends ComponentApi = ComponentApi> = Api & {
|
|
21
|
+
render: RenderFn<ResolveA2uiProps<InferredComponentApiSchemaType<Api>>>;
|
|
22
|
+
};
|
|
23
|
+
export type RendererEntry<Api extends ComponentApi = ComponentApi> = SolidRendererEntry<Api>;
|
|
24
|
+
export declare function defineRenderer<Api extends ComponentApi>(api: Api, render: RenderFn<ResolveA2uiProps<InferredComponentApiSchemaType<Api>>>): SolidRendererEntry<Api>;
|
|
25
|
+
/**
|
|
26
|
+
* Immutable Solid renderer definitions paired with their A2UI schemas and
|
|
27
|
+
* functions. The same entries are passed to `MessageProcessor` and used for
|
|
28
|
+
* rendering, so validation/binding and view lookup cannot drift apart.
|
|
29
|
+
*/
|
|
30
|
+
export declare class CatalogRenderer {
|
|
31
|
+
readonly components: ReadonlyMap<string, SolidRendererEntry>;
|
|
32
|
+
readonly functions: readonly FunctionImplementation[];
|
|
33
|
+
constructor(components?: Iterable<SolidRendererEntry>, functions?: readonly FunctionImplementation[]);
|
|
34
|
+
get(name: string): SolidRendererEntry | undefined;
|
|
35
|
+
names(): string[];
|
|
36
|
+
extend(...overrides: ReadonlyArray<CatalogRenderer | SolidRendererEntry>): CatalogRenderer;
|
|
37
|
+
toCatalog(id: string): Catalog<SolidRendererEntry>;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -0,0 +1 @@
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G,CAAC,OAAO,CAAC;AAEjB,MAAM,MAAM,kBAAkB,CAAC,GAAG,SAAS,YAAY,GAAG,YAAY,IACpE,GAAG,GAAG;IACJ,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC,8BAA8B,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACzE,CAAC;AAEJ,MAAM,MAAM,aAAa,CAAC,GAAG,SAAS,YAAY,GAAG,YAAY,IAC/D,kBAAkB,CAAC,GAAG,CAAC,CAAC;AAE1B,wBAAgB,cAAc,CAAC,GAAG,SAAS,YAAY,EACrD,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC,8BAA8B,CAAC,GAAG,CAAC,CAAC,CAAC,GACtE,kBAAkB,CAAC,GAAG,CAAC,CAEzB;AAED;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAC7D,QAAQ,CAAC,SAAS,EAAE,SAAS,sBAAsB,EAAE,CAAC;gBAGpD,UAAU,GAAE,QAAQ,CAAC,kBAAkB,CAAM,EAC7C,SAAS,GAAE,SAAS,sBAAsB,EAAO;IAQnD,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAIjD,KAAK,IAAI,MAAM,EAAE;IAIjB,MAAM,CACJ,GAAG,SAAS,EAAE,aAAa,CAAC,eAAe,GAAG,kBAAkB,CAAC,GAChE,eAAe;IAuBlB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAGnD"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CatalogRenderer, type SolidRendererEntry } from "./catalog";
|
|
2
|
+
export declare const notionBlockCatalog: CatalogRenderer;
|
|
3
|
+
export declare const notionBlockComponents: SolidRendererEntry<import("@a2ui/web_core/v0_9").ComponentApi<import("zod").ZodTypeAny>>[];
|
|
4
|
+
export declare const notionBlockFunctions: import("@a2ui/web_core/v0_9").FunctionImplementation[];
|
|
5
|
+
//# sourceMappingURL=notion-block-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notion-block-catalog.d.ts","sourceRoot":"","sources":["../../../../src/components/a2ui/catalog/notion-block-catalog.tsx"],"names":[],"mappings":"AAgFA,OAAO,EACL,eAAe,EAGf,KAAK,kBAAkB,EACxB,MAAM,WAAW,CAAC;AAycnB,eAAO,MAAM,kBAAkB,EAAE,eAEhC,CAAC;AACF,eAAO,MAAM,qBAAqB,4FAEjC,CAAC;AACF,eAAO,MAAM,oBAAoB,wDAAoC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Accessor, type JSX } from "solid-js";
|
|
2
|
+
import type { ChildRef } from "./catalog";
|
|
3
|
+
interface RenderIndexedChildProps {
|
|
4
|
+
child: ChildRef;
|
|
5
|
+
index: Accessor<number>;
|
|
6
|
+
renderChild: (componentId: string, basePath?: string, index?: number | Accessor<number>) => JSX.Element;
|
|
7
|
+
}
|
|
8
|
+
/** Passes the reactive sibling index through without rebuilding child JSX. */
|
|
9
|
+
export declare const RenderIndexedChild: (props: RenderIndexedChildProps) => JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=render-indexed-child.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-indexed-child.d.ts","sourceRoot":"","sources":["../../../../src/components/a2ui/catalog/render-indexed-child.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAEnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1C,UAAU,uBAAuB;IAC/B,KAAK,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACxB,WAAW,EAAE,CACX,WAAW,EAAE,MAAM,EACnB,QAAQ,CAAC,EAAE,MAAM,EACjB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,KAC9B,GAAG,CAAC,OAAO,CAAC;CAClB;AAED,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,GAAI,OAAO,uBAAuB,gBAEhE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type Accessor, type JSX } from "solid-js";
|
|
2
|
+
import { type SurfaceModel } from "@a2ui/web_core/v0_9";
|
|
3
|
+
import { type CatalogRenderer, type SolidRendererEntry } from "./catalog/catalog";
|
|
4
|
+
export declare const ROOT_COMPONENT_ID = "root";
|
|
5
|
+
export declare const A2uiSurfaceContext: import("solid-js").Context<Accessor<SurfaceModel<SolidRendererEntry>> | undefined>;
|
|
6
|
+
export declare const A2uiCatalogContext: import("solid-js").Context<Accessor<CatalogRenderer> | undefined>;
|
|
7
|
+
export interface ComponentHostProps {
|
|
8
|
+
id: string;
|
|
9
|
+
basePath: string;
|
|
10
|
+
index?: number | Accessor<number>;
|
|
11
|
+
ancestors?: readonly string[];
|
|
12
|
+
}
|
|
13
|
+
export declare const ComponentHost: (props: ComponentHostProps) => JSX.Element;
|
|
14
|
+
//# sourceMappingURL=component-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-host.d.ts","sourceRoot":"","sources":["../../../src/components/a2ui/component-host.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,QAAQ,EACb,KAAK,GAAG,EACT,MAAM,UAAU,CAAC;AAGlB,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EAExB,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,iBAAiB,SAAS,CAAC;AAExC,eAAO,MAAM,kBAAkB,oFAC8B,CAAC;AAC9D,eAAO,MAAM,kBAAkB,mEAA6C,CAAC;AAE7E,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/B;AAUD,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,gBAoKtD,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import { type SurfaceModel } from "@a2ui/web_core/v0_9";
|
|
3
|
+
import { type CatalogRenderer, type SolidRendererEntry } from "./catalog/catalog";
|
|
4
|
+
export declare const BASIC_CATALOG_ID = "https://a2ui.org/specification/v0_9/basic_catalog.json";
|
|
5
|
+
export interface A2uiSurfaceProps {
|
|
6
|
+
surface: SurfaceModel<SolidRendererEntry>;
|
|
7
|
+
catalog?: CatalogRenderer;
|
|
8
|
+
}
|
|
9
|
+
/** Renders an existing v0.9 surface with the Solid-native recursive host. */
|
|
10
|
+
export declare const A2uiSurface: (props: A2uiSurfaceProps) => JSX.Element;
|
|
11
|
+
export interface ElmA2uiProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
12
|
+
/** A JSONL stream URL. `messages` takes precedence when both are supplied. */
|
|
13
|
+
url?: string;
|
|
14
|
+
/** Optional headers for the stream request. A new object restarts the request. */
|
|
15
|
+
headers?: Record<string, string>;
|
|
16
|
+
/** Pre-collected v0.9 messages. Takes precedence over `url`. */
|
|
17
|
+
messages?: object[];
|
|
18
|
+
/** An additional catalog id to pre-register. */
|
|
19
|
+
catalogId?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Solid uses a paired {@link CatalogRenderer}, not React's `components`
|
|
22
|
+
* array. Extend `notionBlockCatalog` or `basicCatalog` with
|
|
23
|
+
* `defineRenderer()` so the processor and renderer receive identical APIs.
|
|
24
|
+
*/
|
|
25
|
+
catalog?: CatalogRenderer;
|
|
26
|
+
}
|
|
27
|
+
export declare const ElmA2ui: (props: ElmA2uiProps) => JSX.Element;
|
|
28
|
+
//# sourceMappingURL=elm-a2ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elm-a2ui.d.ts","sourceRoot":"","sources":["../../../src/components/a2ui/elm-a2ui.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,GAAG,EACT,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAI1E,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACxB,MAAM,mBAAmB,CAAC;AAU3B,eAAO,MAAM,gBAAgB,2DAC6B,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,YAAY,CAAC,kBAAkB,CAAC,CAAC;IAC1C,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B;AAED,6EAA6E;AAC7E,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,gBAalD,CAAC;AAEF,MAAM,WAAW,YAAa,SAAQ,IAAI,CACxC,GAAG,CAAC,cAAc,CAAC,cAAc,CAAC,EAClC,UAAU,CACX;IACC,8EAA8E;IAC9E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B;AAWD,eAAO,MAAM,OAAO,GAAI,OAAO,YAAY,gBA0J1C,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface StreamJsonLinesOptions {
|
|
2
|
+
signal?: AbortSignal;
|
|
3
|
+
onMessage: (message: unknown) => void;
|
|
4
|
+
onError?: (error: unknown, line: string) => void;
|
|
5
|
+
}
|
|
6
|
+
/** Incrementally parses a JSONL byte stream, skipping malformed lines. */
|
|
7
|
+
export declare function streamJsonLines(body: ReadableStream<Uint8Array>, { signal, onMessage, onError }: StreamJsonLinesOptions): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=stream-json-lines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream-json-lines.d.ts","sourceRoot":"","sources":["../../../src/components/a2ui/stream-json-lines.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAClD;AAED,0EAA0E;AAC1E,wBAAsB,eAAe,CACnC,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,EAChC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,sBAAsB,GACrD,OAAO,CAAC,IAAI,CAAC,CAqCf"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
export interface ElmCodeBlockProps extends JSX.HTMLAttributes<HTMLElement> {
|
|
3
|
+
/** The code to display. */
|
|
4
|
+
code: string;
|
|
5
|
+
/** The language of the code. Defaults to plaintext. */
|
|
6
|
+
language?: string;
|
|
7
|
+
/** The caption. The language is used when this is not provided. */
|
|
8
|
+
caption?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const ElmCodeBlock: (props: ElmCodeBlockProps) => JSX.Element;
|
|
11
|
+
//# sourceMappingURL=elm-code-block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elm-code-block.d.ts","sourceRoot":"","sources":["../../../src/components/code/elm-code-block.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAS5D,MAAM,WAAW,iBAAkB,SAAQ,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC;IACxE,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IAEb,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,gBAkCpD,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
import { type ElmHtmlProps } from "./elm-html";
|
|
3
|
+
export interface ElmHtmlViewerProps extends JSX.HTMLAttributes<HTMLElement>, Pick<ElmHtmlProps, "sandbox" | "autoHeight" | "allowScripts" | "height"> {
|
|
4
|
+
/** Raw HTML to preview, open, and download. `src` takes precedence. */
|
|
5
|
+
html?: string;
|
|
6
|
+
/**
|
|
7
|
+
* URL to preview directly. Open navigates directly to this URL and download
|
|
8
|
+
* uses it as the anchor href without creating an intermediate Blob URL.
|
|
9
|
+
*/
|
|
10
|
+
src?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Suggested download filename. The default is `download.html`. This is also
|
|
13
|
+
* assigned in `src` mode, but browsers may ignore the download attribute for
|
|
14
|
+
* cross-origin URLs; response headers and browser policy then choose the
|
|
15
|
+
* resulting filename or whether the resource opens instead.
|
|
16
|
+
*/
|
|
17
|
+
filename?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const ElmHtmlViewer: (props: ElmHtmlViewerProps) => JSX.Element;
|
|
20
|
+
//# sourceMappingURL=elm-html-viewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elm-html-viewer.d.ts","sourceRoot":"","sources":["../../../src/components/code/elm-html-viewer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAK3D,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAGxD,MAAM,WAAW,kBACf,SACE,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC,EAC/B,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,YAAY,GAAG,cAAc,GAAG,QAAQ,CAAC;IAC1E,uEAAuE;IACvE,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,gBA+HtD,CAAC"}
|