@prestack/thread-ui 0.0.1
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/CHANGELOG.md +348 -0
- package/dist/attach.d.ts +1 -0
- package/dist/attach.js +1 -0
- package/dist/ui/animations/anm_appear.d.ts +16 -0
- package/dist/ui/animations/anm_appear.js +10 -0
- package/dist/ui/animations/anm_blur_in.d.ts +22 -0
- package/dist/ui/animations/anm_blur_in.js +16 -0
- package/dist/ui/animations/anm_blur_out.d.ts +22 -0
- package/dist/ui/animations/anm_blur_out.js +16 -0
- package/dist/ui/animations/anm_dismiss.d.ts +22 -0
- package/dist/ui/animations/anm_dismiss.js +16 -0
- package/dist/ui/animations/anm_drop.d.ts +22 -0
- package/dist/ui/animations/anm_drop.js +16 -0
- package/dist/ui/animations/anm_fall.d.ts +22 -0
- package/dist/ui/animations/anm_fall.js +16 -0
- package/dist/ui/animations/anm_flash.d.ts +19 -0
- package/dist/ui/animations/anm_flash.js +16 -0
- package/dist/ui/animations/anm_glow.d.ts +16 -0
- package/dist/ui/animations/anm_glow.js +14 -0
- package/dist/ui/animations/anm_lift.d.ts +16 -0
- package/dist/ui/animations/anm_lift.js +14 -0
- package/dist/ui/animations/anm_nudge.d.ts +16 -0
- package/dist/ui/animations/anm_nudge.js +14 -0
- package/dist/ui/animations/anm_pop_in.d.ts +29 -0
- package/dist/ui/animations/anm_pop_in.js +20 -0
- package/dist/ui/animations/anm_pop_out.d.ts +29 -0
- package/dist/ui/animations/anm_pop_out.js +20 -0
- package/dist/ui/animations/anm_press.d.ts +19 -0
- package/dist/ui/animations/anm_press.js +10 -0
- package/dist/ui/animations/anm_pulse.d.ts +20 -0
- package/dist/ui/animations/anm_pulse.js +11 -0
- package/dist/ui/animations/anm_rise.d.ts +22 -0
- package/dist/ui/animations/anm_rise.js +16 -0
- package/dist/ui/animations/anm_shake.d.ts +23 -0
- package/dist/ui/animations/anm_shake.js +11 -0
- package/dist/ui/animations/anm_slide_in_left.d.ts +22 -0
- package/dist/ui/animations/anm_slide_in_left.js +16 -0
- package/dist/ui/animations/anm_slide_in_right.d.ts +22 -0
- package/dist/ui/animations/anm_slide_in_right.js +16 -0
- package/dist/ui/animations/anm_slide_out_left.d.ts +22 -0
- package/dist/ui/animations/anm_slide_out_left.js +16 -0
- package/dist/ui/animations/anm_slide_out_right.d.ts +22 -0
- package/dist/ui/animations/anm_slide_out_right.js +16 -0
- package/dist/ui/animations/anm_spin.d.ts +16 -0
- package/dist/ui/animations/anm_spin.js +10 -0
- package/dist/ui/animations/anm_swell.d.ts +16 -0
- package/dist/ui/animations/anm_swell.js +14 -0
- package/dist/ui/animations/anm_wobble.d.ts +27 -0
- package/dist/ui/animations/anm_wobble.js +22 -0
- package/dist/ui/animations/anm_zoom_in.d.ts +22 -0
- package/dist/ui/animations/anm_zoom_in.js +16 -0
- package/dist/ui/animations/anm_zoom_out.d.ts +22 -0
- package/dist/ui/animations/anm_zoom_out.js +16 -0
- package/dist/ui/animations.d.ts +59 -0
- package/dist/ui/animations.js +227 -0
- package/dist/ui/attach.d.ts +3 -0
- package/dist/ui/attach.js +497 -0
- package/dist/ui/charts.d.ts +32 -0
- package/dist/ui/charts.js +35 -0
- package/dist/ui/checked.d.ts +19 -0
- package/dist/ui/checked.js +3 -0
- package/dist/ui/collector.d.ts +32 -0
- package/dist/ui/collector.js +75 -0
- package/dist/ui/compositions.d.ts +21 -0
- package/dist/ui/compositions.js +305 -0
- package/dist/ui/consent.d.ts +22 -0
- package/dist/ui/consent.js +44 -0
- package/dist/ui/content.d.ts +9 -0
- package/dist/ui/content.js +11 -0
- package/dist/ui/contrast.d.ts +3 -0
- package/dist/ui/contrast.js +23 -0
- package/dist/ui/controls.d.ts +14 -0
- package/dist/ui/controls.js +2 -0
- package/dist/ui/disclosure.d.ts +14 -0
- package/dist/ui/disclosure.js +2 -0
- package/dist/ui/dismiss-layer.d.ts +14 -0
- package/dist/ui/dismiss-layer.js +66 -0
- package/dist/ui/door.d.ts +40 -0
- package/dist/ui/door.js +100 -0
- package/dist/ui/drag.d.ts +82 -0
- package/dist/ui/drag.js +212 -0
- package/dist/ui/elements/accordion.d.ts +12 -0
- package/dist/ui/elements/accordion.js +16 -0
- package/dist/ui/elements/accordion.works.d.ts +22 -0
- package/dist/ui/elements/accordion.works.js +44 -0
- package/dist/ui/elements/aspect-ratio.d.ts +10 -0
- package/dist/ui/elements/aspect-ratio.js +9 -0
- package/dist/ui/elements/aspect-ratio.works.d.ts +2 -0
- package/dist/ui/elements/aspect-ratio.works.js +3 -0
- package/dist/ui/elements/avatar.d.ts +11 -0
- package/dist/ui/elements/avatar.js +10 -0
- package/dist/ui/elements/avatar.works.d.ts +4 -0
- package/dist/ui/elements/avatar.works.js +16 -0
- package/dist/ui/elements/badge.d.ts +11 -0
- package/dist/ui/elements/badge.js +10 -0
- package/dist/ui/elements/badge.works.d.ts +5 -0
- package/dist/ui/elements/badge.works.js +6 -0
- package/dist/ui/elements/bars.d.ts +14 -0
- package/dist/ui/elements/bars.js +17 -0
- package/dist/ui/elements/bars.works.d.ts +12 -0
- package/dist/ui/elements/bars.works.js +20 -0
- package/dist/ui/elements/box.d.ts +12 -0
- package/dist/ui/elements/box.js +11 -0
- package/dist/ui/elements/breadcrumb.d.ts +10 -0
- package/dist/ui/elements/breadcrumb.js +12 -0
- package/dist/ui/elements/breadcrumb.works.d.ts +7 -0
- package/dist/ui/elements/breadcrumb.works.js +21 -0
- package/dist/ui/elements/button.d.ts +17 -0
- package/dist/ui/elements/button.js +16 -0
- package/dist/ui/elements/button.works.d.ts +17 -0
- package/dist/ui/elements/button.works.js +34 -0
- package/dist/ui/elements/column.d.ts +9 -0
- package/dist/ui/elements/column.js +8 -0
- package/dist/ui/elements/consent.d.ts +13 -0
- package/dist/ui/elements/consent.js +21 -0
- package/dist/ui/elements/consent.works.d.ts +41 -0
- package/dist/ui/elements/consent.works.js +79 -0
- package/dist/ui/elements/donut.d.ts +13 -0
- package/dist/ui/elements/donut.js +16 -0
- package/dist/ui/elements/donut.works.d.ts +11 -0
- package/dist/ui/elements/donut.works.js +28 -0
- package/dist/ui/elements/each.d.ts +14 -0
- package/dist/ui/elements/each.js +9 -0
- package/dist/ui/elements/each.works.d.ts +3 -0
- package/dist/ui/elements/each.works.js +68 -0
- package/dist/ui/elements/empty.d.ts +9 -0
- package/dist/ui/elements/empty.js +12 -0
- package/dist/ui/elements/field.d.ts +16 -0
- package/dist/ui/elements/field.js +15 -0
- package/dist/ui/elements/field.works.d.ts +17 -0
- package/dist/ui/elements/field.works.js +45 -0
- package/dist/ui/elements/funnel.d.ts +14 -0
- package/dist/ui/elements/funnel.js +17 -0
- package/dist/ui/elements/funnel.works.d.ts +12 -0
- package/dist/ui/elements/funnel.works.js +23 -0
- package/dist/ui/elements/gauge.d.ts +12 -0
- package/dist/ui/elements/gauge.js +15 -0
- package/dist/ui/elements/gauge.works.d.ts +11 -0
- package/dist/ui/elements/gauge.works.js +31 -0
- package/dist/ui/elements/glyph.d.ts +10 -0
- package/dist/ui/elements/glyph.js +9 -0
- package/dist/ui/elements/glyph.works.d.ts +5 -0
- package/dist/ui/elements/glyph.works.js +16 -0
- package/dist/ui/elements/grid.d.ts +9 -0
- package/dist/ui/elements/grid.js +8 -0
- package/dist/ui/elements/heatmap.d.ts +15 -0
- package/dist/ui/elements/heatmap.js +17 -0
- package/dist/ui/elements/heatmap.works.d.ts +11 -0
- package/dist/ui/elements/heatmap.works.js +11 -0
- package/dist/ui/elements/hit-box.d.ts +19 -0
- package/dist/ui/elements/hit-box.js +15 -0
- package/dist/ui/elements/hit-box.works.d.ts +87 -0
- package/dist/ui/elements/hit-box.works.js +451 -0
- package/dist/ui/elements/image.d.ts +10 -0
- package/dist/ui/elements/image.js +9 -0
- package/dist/ui/elements/line-chart.d.ts +13 -0
- package/dist/ui/elements/line-chart.js +16 -0
- package/dist/ui/elements/line-chart.works.d.ts +12 -0
- package/dist/ui/elements/line-chart.works.js +27 -0
- package/dist/ui/elements/link.d.ts +12 -0
- package/dist/ui/elements/link.js +15 -0
- package/dist/ui/elements/link.works.d.ts +10 -0
- package/dist/ui/elements/link.works.js +15 -0
- package/dist/ui/elements/media.d.ts +11 -0
- package/dist/ui/elements/media.js +22 -0
- package/dist/ui/elements/menu.d.ts +12 -0
- package/dist/ui/elements/menu.js +18 -0
- package/dist/ui/elements/menu.works.d.ts +50 -0
- package/dist/ui/elements/menu.works.js +100 -0
- package/dist/ui/elements/money.d.ts +10 -0
- package/dist/ui/elements/money.js +9 -0
- package/dist/ui/elements/money.works.d.ts +4 -0
- package/dist/ui/elements/money.works.js +4 -0
- package/dist/ui/elements/pagination.d.ts +11 -0
- package/dist/ui/elements/pagination.js +12 -0
- package/dist/ui/elements/pagination.works.d.ts +5 -0
- package/dist/ui/elements/pagination.works.js +15 -0
- package/dist/ui/elements/progress.d.ts +11 -0
- package/dist/ui/elements/progress.js +11 -0
- package/dist/ui/elements/progress.works.d.ts +2 -0
- package/dist/ui/elements/progress.works.js +6 -0
- package/dist/ui/elements/radio-group.d.ts +15 -0
- package/dist/ui/elements/radio-group.js +16 -0
- package/dist/ui/elements/radio-group.works.d.ts +10 -0
- package/dist/ui/elements/radio-group.works.js +22 -0
- package/dist/ui/elements/row.d.ts +9 -0
- package/dist/ui/elements/row.js +8 -0
- package/dist/ui/elements/scatter.d.ts +13 -0
- package/dist/ui/elements/scatter.js +15 -0
- package/dist/ui/elements/scatter.works.d.ts +11 -0
- package/dist/ui/elements/scatter.works.js +24 -0
- package/dist/ui/elements/select.d.ts +13 -0
- package/dist/ui/elements/select.js +11 -0
- package/dist/ui/elements/select.works.d.ts +4 -0
- package/dist/ui/elements/select.works.js +3 -0
- package/dist/ui/elements/separator.d.ts +10 -0
- package/dist/ui/elements/separator.js +9 -0
- package/dist/ui/elements/skeleton.d.ts +8 -0
- package/dist/ui/elements/skeleton.js +9 -0
- package/dist/ui/elements/slider.d.ts +14 -0
- package/dist/ui/elements/slider.js +10 -0
- package/dist/ui/elements/slider.works.d.ts +4 -0
- package/dist/ui/elements/slider.works.js +3 -0
- package/dist/ui/elements/sparkline.d.ts +10 -0
- package/dist/ui/elements/sparkline.js +15 -0
- package/dist/ui/elements/sparkline.works.d.ts +10 -0
- package/dist/ui/elements/sparkline.works.js +19 -0
- package/dist/ui/elements/spinner.d.ts +9 -0
- package/dist/ui/elements/spinner.js +12 -0
- package/dist/ui/elements/stack.d.ts +9 -0
- package/dist/ui/elements/stack.js +8 -0
- package/dist/ui/elements/stat.d.ts +12 -0
- package/dist/ui/elements/stat.js +10 -0
- package/dist/ui/elements/stat.works.d.ts +3 -0
- package/dist/ui/elements/stat.works.js +10 -0
- package/dist/ui/elements/surface.d.ts +9 -0
- package/dist/ui/elements/surface.js +15 -0
- package/dist/ui/elements/surface.works.d.ts +7 -0
- package/dist/ui/elements/surface.works.js +4 -0
- package/dist/ui/elements/table.d.ts +13 -0
- package/dist/ui/elements/table.js +16 -0
- package/dist/ui/elements/table.works.d.ts +11 -0
- package/dist/ui/elements/table.works.js +15 -0
- package/dist/ui/elements/tabs.d.ts +12 -0
- package/dist/ui/elements/tabs.js +16 -0
- package/dist/ui/elements/tabs.works.d.ts +25 -0
- package/dist/ui/elements/tabs.works.js +53 -0
- package/dist/ui/elements/text.d.ts +13 -0
- package/dist/ui/elements/text.js +9 -0
- package/dist/ui/elements/textarea.d.ts +14 -0
- package/dist/ui/elements/textarea.js +11 -0
- package/dist/ui/elements/textarea.works.d.ts +4 -0
- package/dist/ui/elements/textarea.works.js +3 -0
- package/dist/ui/elements/time.d.ts +11 -0
- package/dist/ui/elements/time.js +14 -0
- package/dist/ui/elements/time.works.d.ts +11 -0
- package/dist/ui/elements/time.works.js +16 -0
- package/dist/ui/elements/toggle.d.ts +11 -0
- package/dist/ui/elements/toggle.js +10 -0
- package/dist/ui/elements/toggle.works.d.ts +4 -0
- package/dist/ui/elements/toggle.works.js +3 -0
- package/dist/ui/elements/tooltip.d.ts +12 -0
- package/dist/ui/elements/tooltip.js +15 -0
- package/dist/ui/elements/tooltip.works.d.ts +28 -0
- package/dist/ui/elements/tooltip.works.js +54 -0
- package/dist/ui/elements/value.d.ts +12 -0
- package/dist/ui/elements/value.js +9 -0
- package/dist/ui/elements/value.works.d.ts +4 -0
- package/dist/ui/elements/value.works.js +4 -0
- package/dist/ui/elements.d.ts +1143 -0
- package/dist/ui/elements.js +68 -0
- package/dist/ui/focus-scope.d.ts +7 -0
- package/dist/ui/focus-scope.js +109 -0
- package/dist/ui/fonts.d.ts +103 -0
- package/dist/ui/fonts.js +243 -0
- package/dist/ui/generators/dev.d.ts +2 -0
- package/dist/ui/generators/dev.js +61 -0
- package/dist/ui/generators/elements.d.ts +31 -0
- package/dist/ui/generators/elements.js +520 -0
- package/dist/ui/generators/i18n.d.ts +5 -0
- package/dist/ui/generators/i18n.js +264 -0
- package/dist/ui/generators/icons.d.ts +1 -0
- package/dist/ui/generators/icons.js +187 -0
- package/dist/ui/generators/react.d.ts +26 -0
- package/dist/ui/generators/react.js +218 -0
- package/dist/ui/generators/routes.d.ts +11 -0
- package/dist/ui/generators/routes.js +597 -0
- package/dist/ui/generators/show.d.ts +1 -0
- package/dist/ui/generators/show.js +231 -0
- package/dist/ui/generators/styles.d.ts +1 -0
- package/dist/ui/generators/styles.js +502 -0
- package/dist/ui/generators/variants.d.ts +12 -0
- package/dist/ui/generators/variants.js +162 -0
- package/dist/ui/i18n/catalogs/en.d.ts +172 -0
- package/dist/ui/i18n/catalogs/en.js +148 -0
- package/dist/ui/i18n/format.d.ts +13 -0
- package/dist/ui/i18n/format.js +161 -0
- package/dist/ui/i18n/locales.d.ts +9 -0
- package/dist/ui/i18n/locales.js +20 -0
- package/dist/ui/i18n/parse.d.ts +45 -0
- package/dist/ui/i18n/parse.js +249 -0
- package/dist/ui/i18n/translator.d.ts +10 -0
- package/dist/ui/i18n/translator.js +22 -0
- package/dist/ui/i18n/types.d.ts +33 -0
- package/dist/ui/i18n/types.js +9 -0
- package/dist/ui/icons.d.ts +67 -0
- package/dist/ui/icons.js +249 -0
- package/dist/ui/islands/map.d.ts +33 -0
- package/dist/ui/islands/map.js +44 -0
- package/dist/ui/localizations.d.ts +33 -0
- package/dist/ui/localizations.js +51 -0
- package/dist/ui/makers/message.d.ts +1 -0
- package/dist/ui/makers/message.js +230 -0
- package/dist/ui/material.d.ts +83 -0
- package/dist/ui/material.js +95 -0
- package/dist/ui/materials/mat_bordered.d.ts +22 -0
- package/dist/ui/materials/mat_bordered.js +12 -0
- package/dist/ui/materials/mat_ceramic.d.ts +22 -0
- package/dist/ui/materials/mat_ceramic.js +12 -0
- package/dist/ui/materials/mat_clay.d.ts +22 -0
- package/dist/ui/materials/mat_clay.js +12 -0
- package/dist/ui/materials/mat_elevated.d.ts +32 -0
- package/dist/ui/materials/mat_elevated.js +23 -0
- package/dist/ui/materials/mat_flat.d.ts +50 -0
- package/dist/ui/materials/mat_flat.js +33 -0
- package/dist/ui/materials/mat_glass.d.ts +32 -0
- package/dist/ui/materials/mat_glass.js +19 -0
- package/dist/ui/materials/mat_lit.d.ts +22 -0
- package/dist/ui/materials/mat_lit.js +12 -0
- package/dist/ui/materials/mat_moulded.d.ts +16 -0
- package/dist/ui/materials/mat_moulded.js +10 -0
- package/dist/ui/materials.d.ts +56 -0
- package/dist/ui/materials.js +175 -0
- package/dist/ui/modes.d.ts +25 -0
- package/dist/ui/modes.js +25 -0
- package/dist/ui/navigation.d.ts +3 -0
- package/dist/ui/navigation.js +24 -0
- package/dist/ui/positioning.d.ts +24 -0
- package/dist/ui/positioning.js +48 -0
- package/dist/ui/presented.d.ts +10 -0
- package/dist/ui/presented.js +81 -0
- package/dist/ui/provider.d.ts +31 -0
- package/dist/ui/provider.js +104 -0
- package/dist/ui/render-loop.d.ts +12 -0
- package/dist/ui/render-loop.js +94 -0
- package/dist/ui/roving-focus.d.ts +15 -0
- package/dist/ui/roving-focus.js +143 -0
- package/dist/ui/screens.d.ts +17 -0
- package/dist/ui/screens.js +112 -0
- package/dist/ui/scroll-lock.d.ts +2 -0
- package/dist/ui/scroll-lock.js +24 -0
- package/dist/ui/series.d.ts +9 -0
- package/dist/ui/series.js +67 -0
- package/dist/ui/signals.d.ts +120 -0
- package/dist/ui/signals.js +286 -0
- package/dist/ui/styleguide.d.ts +27 -0
- package/dist/ui/styleguide.js +138 -0
- package/dist/ui/styleguides.d.ts +11 -0
- package/dist/ui/styleguides.js +299 -0
- package/dist/ui/themes.d.ts +5 -0
- package/dist/ui/themes.js +16 -0
- package/dist/ui/token.d.ts +16 -0
- package/dist/ui/token.js +37 -0
- package/dist/ui/tokens/shadow.d.ts +6 -0
- package/dist/ui/tokens/shadow.js +17 -0
- package/dist/ui/tokens.d.ts +180 -0
- package/dist/ui/tokens.js +200 -0
- package/dist/ui/validators.d.ts +37 -0
- package/dist/ui/validators.js +184 -0
- package/dist/ui/variant.d.ts +122 -0
- package/dist/ui/variant.js +201 -0
- package/dist/ui/variants/var_avatar-round.d.ts +23 -0
- package/dist/ui/variants/var_avatar-round.js +13 -0
- package/dist/ui/variants/var_bubble-me.d.ts +21 -0
- package/dist/ui/variants/var_bubble-me.js +13 -0
- package/dist/ui/variants/var_bubble-them.d.ts +18 -0
- package/dist/ui/variants/var_bubble-them.js +12 -0
- package/dist/ui/variants/var_button-border.d.ts +116 -0
- package/dist/ui/variants/var_button-border.js +75 -0
- package/dist/ui/variants/var_button-cta.d.ts +116 -0
- package/dist/ui/variants/var_button-cta.js +75 -0
- package/dist/ui/variants/var_button-destructive-ghost.d.ts +113 -0
- package/dist/ui/variants/var_button-destructive-ghost.js +71 -0
- package/dist/ui/variants/var_button-destructive.d.ts +116 -0
- package/dist/ui/variants/var_button-destructive.js +75 -0
- package/dist/ui/variants/var_button-fill.d.ts +116 -0
- package/dist/ui/variants/var_button-fill.js +75 -0
- package/dist/ui/variants/var_button-ghost.d.ts +113 -0
- package/dist/ui/variants/var_button-ghost.js +71 -0
- package/dist/ui/variants/var_button-glass.d.ts +84 -0
- package/dist/ui/variants/var_button-glass.js +54 -0
- package/dist/ui/variants/var_button-normal.d.ts +116 -0
- package/dist/ui/variants/var_button-normal.js +75 -0
- package/dist/ui/variants/var_button-quiet.d.ts +119 -0
- package/dist/ui/variants/var_button-quiet.js +73 -0
- package/dist/ui/variants/var_card.d.ts +30 -0
- package/dist/ui/variants/var_card.js +16 -0
- package/dist/ui/variants/var_chip.d.ts +18 -0
- package/dist/ui/variants/var_chip.js +12 -0
- package/dist/ui/variants/var_choice.d.ts +26 -0
- package/dist/ui/variants/var_choice.js +14 -0
- package/dist/ui/variants/var_framed.d.ts +11 -0
- package/dist/ui/variants/var_framed.js +9 -0
- package/dist/ui/variants/var_glyph-plain.d.ts +14 -0
- package/dist/ui/variants/var_glyph-plain.js +10 -0
- package/dist/ui/variants/var_input.d.ts +61 -0
- package/dist/ui/variants/var_input.js +42 -0
- package/dist/ui/variants/var_link-inline.d.ts +39 -0
- package/dist/ui/variants/var_link-inline.js +28 -0
- package/dist/ui/variants/var_list-row.d.ts +47 -0
- package/dist/ui/variants/var_list-row.js +33 -0
- package/dist/ui/variants/var_rule.d.ts +11 -0
- package/dist/ui/variants/var_rule.js +9 -0
- package/dist/ui/variants/var_skeleton-block.d.ts +17 -0
- package/dist/ui/variants/var_skeleton-block.js +11 -0
- package/dist/ui/variants/var_spinner-turning.d.ts +17 -0
- package/dist/ui/variants/var_spinner-turning.js +11 -0
- package/dist/ui/variants/var_stat-tile.d.ts +18 -0
- package/dist/ui/variants/var_stat-tile.js +12 -0
- package/dist/ui/variants/var_tab-bar.d.ts +24 -0
- package/dist/ui/variants/var_tab-bar.js +14 -0
- package/dist/ui/variants/var_tap-target.d.ts +33 -0
- package/dist/ui/variants/var_tap-target.js +24 -0
- package/dist/ui/variants.d.ts +174 -0
- package/dist/ui/variants.js +50 -0
- package/dist/ui/wrappers.d.ts +128 -0
- package/dist/ui/wrappers.js +220 -0
- package/package.json +16 -0
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
import { named } from "@prestack/thread/core/scope";
|
|
2
|
+
import { ANIMATIONS } from "./animations.js";
|
|
3
|
+
import { COMPOSITIONS } from "./compositions.js";
|
|
4
|
+
import { FONTS } from "./fonts.js";
|
|
5
|
+
import { ICONS } from "./icons.js";
|
|
6
|
+
import { LOCALIZATIONS } from "./localizations.js";
|
|
7
|
+
import { ELEMENTS } from "./elements.js";
|
|
8
|
+
import { MATERIALS } from "./materials.js";
|
|
9
|
+
import { MODES } from "./modes.js";
|
|
10
|
+
import { SCREENS } from "./screens.js";
|
|
11
|
+
import { STYLEGUIDES } from "./styleguides.js";
|
|
12
|
+
import { SIGNALS } from "./signals.js";
|
|
13
|
+
import { THEMES } from "./themes.js";
|
|
14
|
+
import { TOKENS } from "./tokens.js";
|
|
15
|
+
import { VARIANTS } from "./variants.js";
|
|
16
|
+
const SEEDED = {
|
|
17
|
+
attaches: ['@prestack/thread'],
|
|
18
|
+
id: 'ui',
|
|
19
|
+
declares: [
|
|
20
|
+
' {',
|
|
21
|
+
' id: \'ui\',',
|
|
22
|
+
' at: \'_threads/ui.ts\',',
|
|
23
|
+
' describes: \'Draws things. An app declares its elements, variants and screens, and the components, stylesheet and translations follow.\',',
|
|
24
|
+
' version: 1,',
|
|
25
|
+
' },',
|
|
26
|
+
].join('\n'),
|
|
27
|
+
};
|
|
28
|
+
const SHIPPED = [
|
|
29
|
+
{
|
|
30
|
+
into: 'ui.ts',
|
|
31
|
+
list: 'GENERATORS',
|
|
32
|
+
id: 'styles-generator',
|
|
33
|
+
source: " {\n id: 'styles-generator',\n at: 'node_modules/@prestack/thread-ui/dist/ui/generators/styles.js',\n describes: 'The generator of the stylesheet — it reads the tokens, materials, variants and style guide an app declares and writes one class per variant, so what an app looks like is a consequence of its declarations rather than a file somebody maintains beside them.',\n version: 1,\n by: 'thread styles',\n runs: 'thread styles --check',\n derives: [\n {\n id: 'stylesheet',\n at: 'app/_generated/tokens.css',\n describes: 'One class per variant and one variable per value, written from the declarations rather than kept beside them.',\n version: 1,\n by: 'thread styles',\n runs: 'thread styles --check',\n },\n {\n id: 'declared',\n at: 'app/_generated/declared.ts',\n describes: 'What this app declared for itself, said in types so an element offers it — a variant an app wrote is a member on the element that wears it, the way a shipped one is. A declaration file because it weighs nothing: it is gone at build, so an app gets its own variants without a registry being shipped into the artifact.',\n version: 1,\n by: 'thread styles',\n runs: 'thread styles --check',\n },\n ],\n },",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
into: 'ui.ts',
|
|
37
|
+
list: 'GENERATORS',
|
|
38
|
+
id: 'tokens-generator',
|
|
39
|
+
source: " {\n id: 'tokens-generator',\n at: 'node_modules/@prestack/thread-ui/dist/ui/tokens.js',\n describes: 'The seeder of token files — it reads the tokens an app declares and writes the file each `declares` row names when that file is not there yet, so a token that carries a rule begins by being declared rather than by somebody remembering to add a file beside the row. A `holds` row names no file, because a token that is only a name has nothing to seed. Run with `--check`, the mode the gate runs it in, it writes nothing and refuses instead: a file that disagrees with its row, a file under tokens no row names, or a row with no file at all — so an unseeded token is a gate failure, not something the gate quietly fixes.',\n version: 1,\n by: 'thread tokens',\n runs: 'thread tokens --check',\n },",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
into: 'ui.ts',
|
|
43
|
+
list: 'GENERATORS',
|
|
44
|
+
id: 'materials-generator',
|
|
45
|
+
source: " {\n id: 'materials-generator',\n at: 'node_modules/@prestack/thread-ui/dist/ui/materials.js',\n describes: 'The seeder of material files — it reads the materials an app declares and writes the `mat_` file each row names when that file is not there yet. Run with `--check`, the mode the gate runs it in, it writes nothing and refuses instead: a file that disagrees with its row, a `mat_` file no row names, or a row with no file at all — so an unseeded material is a gate failure, not something the gate quietly fixes.',\n version: 1,\n by: 'thread materials',\n runs: 'thread materials --check',\n },",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
into: 'ui.ts',
|
|
49
|
+
list: 'GENERATORS',
|
|
50
|
+
id: 'i18n-generator',
|
|
51
|
+
source: " {\n id: 'i18n-generator',\n at: 'node_modules/@prestack/thread-ui/dist/ui/generators/i18n.js',\n describes: 'The generator of an app\\'s wording — it reads the languages the app declares and every message key its interface names, and writes one file per language holding a line for each. It cannot invent a sentence, so a key it has just found arrives holding nothing; run with `--check`, the mode the gate runs it in, it writes nothing and refuses a language file that is not what the declarations produce, and refuses any key left unanswered. It also writes the module the app imports, which states the keys the interface uses as a type, so a language missing one is a compiler error before it is a gate error.',\n version: 1,\n by: 'thread i18n',\n runs: 'thread i18n --check',\n derives: [\n {\n id: 'wording',\n at: 'app/_generated/wording.ts',\n describes: 'Every language this app is in, as one module the layout hands to the provider, with the keys the interface names stated as a type so a language missing one is a compiler error.',\n version: 1,\n by: 'thread i18n',\n runs: 'thread i18n --check',\n },\n ],\n },",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
into: 'ui.ts',
|
|
55
|
+
list: 'GENERATORS',
|
|
56
|
+
id: 'routes-generator',
|
|
57
|
+
source: " {\n id: 'routes-generator',\n at: 'node_modules/@prestack/thread-ui/dist/ui/generators/routes.js',\n describes: 'The generator of the routes, the map, the pages a browser reaches, and the root layout. Nobody types a route. The first page an app declares answers `/`, every other page answers its own name, and a sheet, popover, overlay or toast has no route, so the page under each route follows from the screens sheet. It reads every `navigateTo` the screens and their compositions hold and writes the map: from which screen, through which button, to which screen. A button is the only thing that makes a link. A press that names a sheet, popover, overlay or toast is a link like any other, and the client half opens that screen where somebody already is. A name no screen has, a destination not written out as a name, and a route typed into a screen are each refused by name. The layout imports what the other generators produce. Run with `--check`, the mode the gate runs it in, it writes nothing and refuses a hand edit to any of these files, exactly as the stylesheet is refused.',\n version: 1,\n by: 'thread routes',\n runs: 'thread routes --check',\n derives: [\n {\n id: 'layout',\n at: 'app/layout.tsx',\n describes: 'The root layout — it imports what the other generators produce and hands the wording to the provider, so the one file every page passes through is a consequence of the declarations rather than something somebody keeps in step with them.',\n version: 1,\n by: 'thread routes',\n runs: 'thread routes --check',\n },\n {\n id: 'door',\n at: 'app/_generated/door.tsx',\n describes: 'This app\\'s own client half. It is written when the app has operations a page can reach, or screens a press can move between. The provider takes something to run an operation with and something to move between screens with, and the layout cannot hand either over: the layout is a server component and the provider is a client one, and a function does not cross that line — \"Functions cannot be passed directly to Client Components\", measured 2026-09-01 as a page that returned 500 on every request while the gate was green. So both are made on the side that uses them. This file imports what the operations half derived and the map, and hands them over itself. The layout renders this and passes only the actor, which is data and crosses the way data does.',\n version: 1,\n by: 'thread routes',\n runs: 'thread routes --check',\n },\n {\n id: 'bundler',\n at: 'next.config.js',\n describes: 'Where the bundler resolves from, derived from where the packages actually are. Only written when they live outside this app, which is when a bundler cannot see them and every import fails at run time while the compiler is content.',\n version: 1,\n by: 'thread routes',\n runs: 'thread routes --check',\n },\n {\n id: 'map',\n at: 'app/_generated/map.ts',\n describes: 'Every screen this app has, where each one lives, and every way from one to another: from which screen, through which button, to which screen. It is read off every `navigateTo` the screens and their compositions hold, so a button is the only thing that makes a link. The client half moves through it: a press that names a page goes to the address held here, and a press that names a sheet, popover, overlay or toast opens it where somebody already is. A screen no button reaches is printed by `thread routes` rather than found by somebody looking for it.',\n version: 1,\n by: 'thread routes',\n runs: 'thread routes --check',\n },\n ],\n },",
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
into: 'ui.ts',
|
|
61
|
+
list: 'GENERATORS',
|
|
62
|
+
id: 'dev-generator',
|
|
63
|
+
source: " {\n id: 'dev-generator',\n at: 'node_modules/@prestack/thread-ui/dist/ui/generators/dev.js',\n describes: 'The command that runs the app, and the only one here that puts a pixel on a screen — until it existed the framework could build an interface nothing in it could start, because a gate answers whether declarations agree with files and cannot answer whether a button is where somebody says it is not. It is two halves in one word. First it settles this tree: every generator the declarations name is run until the checks stop complaining, which is what `thread create` and `thread run trial` already did and what starting the app was alone in not doing — an app had `thread gate` in front of `next dev`, and a gate refuses a stale file rather than writing it. Then it runs the entry the manifest declares, which is where the gate hook fires and Next is reached. Neither half is written down here: the generators are read off the rows, and `next dev` appears nowhere, so a package attached tomorrow is run by this without this changing and an app served by something else needs no edit. `--ship` swaps the entry for the build. Alone among the generators it carries no `runs:`, because a server stays up until it is stopped and a gate step that never returns is a gate that hangs.',\n version: 1,\n by: 'thread dev',\n },",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
into: 'ui.ts',
|
|
67
|
+
list: 'GENERATORS',
|
|
68
|
+
id: 'message-maker',
|
|
69
|
+
source: " {\n id: 'message-maker',\n at: 'node_modules/@prestack/thread-ui/dist/ui/makers/message.js',\n describes: 'The maker of a message — asked for in every declared language at the moment the key is made, and refused while any answer is blank, so a key cannot be brought into existence half translated. It is also the only safe way to rename one: a rename moves the wording in every language and rewrites every file in the interface that names it, in one run, where doing it by hand leaves a key half moved and one sentence missing at run time.',\n version: 1,\n by: 'thread create message',\n },",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
into: 'ui.ts',
|
|
73
|
+
list: 'GENERATORS',
|
|
74
|
+
id: 'show-generator',
|
|
75
|
+
source: " {\n id: 'show-generator',\n at: 'node_modules/@prestack/thread-ui/dist/ui/generators/show.js',\n describes: 'The reader of what nothing reaches — style guide rows nothing names, variants no element accepts, elements wearing nothing, and signals no element is seen to raise. It writes nothing and refuses nothing, because none of those is wrong on its own: a value declared ahead of the thing that will use it is ordinary, and a report that refused it would teach people to stop reading. It exists because the gate answers whether declarations agree with each other and cannot answer whether anything reaches them, and the difference between those two questions cost six capabilities in one week — each declared, typechecked, generated, and unable to run.',\n version: 1,\n by: 'thread show',\n },",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
into: 'ui.ts',
|
|
79
|
+
list: 'GENERATORS',
|
|
80
|
+
id: 'variants-generator',
|
|
81
|
+
source: " {\n id: 'variants-generator',\n at: 'node_modules/@prestack/thread-ui/dist/ui/generators/variants.js',\n describes: 'The seeder of variant files — it reads the variants an app declares and writes the `var_` file each row names when that file is not there yet. Run with `--check`, the mode the gate runs it in, it writes nothing and refuses instead: a file that disagrees with its row, a `var_` file no row names, or a row with no file at all. It is the last of the three file-backed sheets to get this, and it was the one that needed it — a variant file nothing declared sat in the framework unnoticed until two readers found it by hand, because no gate could.',\n version: 1,\n by: 'thread variants',\n runs: 'thread variants --check',\n },",
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
into: 'ui.ts',
|
|
85
|
+
list: 'GENERATORS',
|
|
86
|
+
id: 'elements-generator',
|
|
87
|
+
source: " {\n id: 'elements-generator',\n at: 'node_modules/@prestack/thread-ui/dist/ui/generators/elements.js',\n describes: 'The writer of element files — it reads the tag an element row states, whether it arranges other things and the signals it raises, and writes the component out of those three facts. An element file stops being a place a tag is typed and becomes a derived thing. Founder, 2026-08-31: \"elements does not hold anything that can render anything, its functionality only . only our compiler can translate things into proper css and html and only at build time do we produce a renderable result.\" Only a row that names this generator in its own `derives` is written, so an element carrying real behaviour is left exactly as it is until it is converted. Run with `--check`, the mode the gate runs it in, it writes nothing and refuses a file that differs from what its row produces.',\n version: 1,\n by: 'thread elements',\n runs: 'thread elements --check',\n },",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
into: 'ui.ts',
|
|
91
|
+
list: 'GENERATORS',
|
|
92
|
+
id: 'icons-generator',
|
|
93
|
+
source: " {\n id: 'icons-generator',\n at: 'node_modules/@prestack/thread-ui/dist/ui/generators/icons.js',\n describes: 'The generator of the icon module — it reads which library the icon rows name and which meanings they declare, and writes the one module that imports exactly those symbols and installs them. A meaning is what an element asks for, so changing the library row redraws every icon in the app and rewrites nothing else. Run with `--check`, the mode the gate runs it in, it writes nothing and refuses a generated file that does not match the rows.',\n version: 1,\n by: 'thread icons',\n runs: 'thread icons --check',\n derives: [\n {\n id: 'symbols',\n at: 'app/_generated/icons.ts',\n describes: 'The one module importing exactly the symbols the icon rows name, from the one library they name.',\n version: 1,\n by: 'thread icons',\n runs: 'thread icons --check',\n },\n ],\n },",
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
into: 'ui.ts',
|
|
97
|
+
list: 'GENERATORS',
|
|
98
|
+
id: 'animations-generator',
|
|
99
|
+
source: " {\n id: 'animations-generator',\n at: 'node_modules/@prestack/thread-ui/dist/ui/animations.js',\n describes: 'The seeder of animation files — it reads the animations an app declares and writes the `anm_` file each row names when that file is not there yet. Run with `--check`, the mode the gate runs it in, it writes nothing and refuses instead: a file that disagrees with its row, an `anm_` file no row names, or a row with no file at all — so an unseeded animation is a gate failure, not something the gate quietly fixes.',\n version: 1,\n by: 'thread animations',\n runs: 'thread animations --check',\n },",
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
into: 'ui.ts',
|
|
103
|
+
list: 'GENERATORS',
|
|
104
|
+
id: 'compositions-generator',
|
|
105
|
+
source: " {\n id: 'compositions-generator',\n at: 'node_modules/@prestack/thread-ui/dist/ui/compositions.js',\n describes: 'The seeder of composition files — it reads the compositions an app declares and writes the `cmp_` file each row names when that file is not there yet, so a composition begins by being declared rather than by somebody remembering to add a file beside the row. Run with `--check`, the mode the gate runs it in, it writes nothing and refuses instead: a row whose file is absent, a `cmp_` file no row names, and an import that is not a declared element, a declared composition or the door — so a composition that did not come from the CLI, or that reaches something nothing declares, stops the build rather than rendering.',\n version: 1,\n by: 'thread compositions',\n runs: 'thread compositions --check',\n },",
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
into: 'ui.ts',
|
|
109
|
+
list: 'GENERATORS',
|
|
110
|
+
id: 'screens-generator',
|
|
111
|
+
source: " {\n id: 'screens-generator',\n at: 'node_modules/@prestack/thread-ui/dist/ui/screens.js',\n describes: 'The seeder of screen files — it reads the screens an app declares and writes the `scr_` file each row names when that file is not there yet, so a screen begins by being declared and wears the arrangement its row states rather than carrying one somebody wrote beside it. Run with `--check`, the mode the gate runs it in, it writes nothing and refuses instead: a row whose file is absent, a `scr_` file no row names, and an import that is not a declared composition, a declared element or the door.',\n version: 1,\n by: 'thread screens',\n runs: 'thread screens --check',\n },",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
into: 'ui.ts',
|
|
115
|
+
list: 'GENERATORS',
|
|
116
|
+
id: 'react-compiler',
|
|
117
|
+
source: " {\n id: 'react-compiler',\n at: 'node_modules/@prestack/thread-ui/dist/ui/generators/react.js',\n describes: 'The compiler of compositions and screens — it runs inside `thread build`, on every file on its way into the artifact, and turns what a person wrote into what React runs. `Button.primary` becomes a tag wearing the class its variant resolves to, and a name of a place becomes the class the composition or screen around it arranges, so neither is worked out again on every render. It writes nothing to disk: the file a person wrote stays the file a person wrote, and the compiled form exists only in the artifact. Everything it does not own — a condition, a list, a hook somebody wrote — is copied through unchanged.',\n version: 1,\n by: 'thread build',\n },",
|
|
118
|
+
},
|
|
119
|
+
];
|
|
120
|
+
export const ATTACH_HOME = `node_modules/${named('ui')}/dist`;
|
|
121
|
+
const SAID = {
|
|
122
|
+
on: '2026-09-09',
|
|
123
|
+
said: 'No reason at all for 15....elements are all ONE THING, screens ONE THING, ompositions ONE THING, tokens ONE THING....and so on.',
|
|
124
|
+
};
|
|
125
|
+
const FIELDS = {
|
|
126
|
+
section: { is: 'string', means: 'The heading a row sits under in its sheet, so rows that belong together are read together.' },
|
|
127
|
+
token: { is: 'string' },
|
|
128
|
+
is: {
|
|
129
|
+
is: 'string',
|
|
130
|
+
means: 'What a row is, written out as its value: a colour, a media query, the name of a language, the library every icon is drawn from.',
|
|
131
|
+
},
|
|
132
|
+
asks: {
|
|
133
|
+
is: 'Readonly<Record<string, string | number>>',
|
|
134
|
+
means: 'What a token\'s rule is handed instead of a value, written name=value and separated by commas: offset=2, blur=4.',
|
|
135
|
+
},
|
|
136
|
+
sets: {
|
|
137
|
+
is: 'Readonly<Record<string, string>>',
|
|
138
|
+
means: 'What a row sets, written name=value and separated by commas. For a font role, a composition or an element it is a property and the style guide row it takes, gap=space-3; for an icon it is a library and what this meaning is called there.',
|
|
139
|
+
},
|
|
140
|
+
modes: {
|
|
141
|
+
is: 'Readonly<Record<string, string | Readonly<Record<string, string>>>>',
|
|
142
|
+
means: 'How what a row sets changes under a mode, written mode.property=row and separated by commas, dark.background=colour-surface, or mode=row where the row itself is the value.',
|
|
143
|
+
},
|
|
144
|
+
places: {
|
|
145
|
+
is: 'Readonly<Record<string, Readonly<Record<string, string>>>>',
|
|
146
|
+
means: 'The named places inside a thing and what each one sets, written place.property=row and separated by commas: hero.display=layout-flex.',
|
|
147
|
+
},
|
|
148
|
+
works: {
|
|
149
|
+
is: 'string',
|
|
150
|
+
means: 'The file beside an element that holds the code it runs, as a path from the element\'s own file: ./price-tag.works.tsx.',
|
|
151
|
+
},
|
|
152
|
+
measures: {
|
|
153
|
+
is: 'readonly string[]',
|
|
154
|
+
means: 'The values an element works out while it runs and hands to the stylesheet by name, separated by commas.',
|
|
155
|
+
},
|
|
156
|
+
reads: { is: 'string', means: 'What an element reads as to assistive technology: picture, progress, divider, grouping.' },
|
|
157
|
+
gives: { is: 'readonly string[]', means: 'The attributes an element hands its tag from what it carries, separated by commas.' },
|
|
158
|
+
keeps: { is: 'boolean', means: 'Whether an element keeps state of its own between renders.' },
|
|
159
|
+
animates: { is: 'boolean', means: 'Whether an element plays the animation the variant it wears names.' },
|
|
160
|
+
shows: { is: 'string', means: 'Which of the things an element carries is shown as its wording.' },
|
|
161
|
+
called: { is: 'string', means: 'The landmark an element is announced as: nav.breadcrumb.' },
|
|
162
|
+
wires: { is: 'string', means: 'The function in an element\'s works file that wires its events.' },
|
|
163
|
+
dresses: {
|
|
164
|
+
is: 'string',
|
|
165
|
+
means: 'The named place inside an element that wears the variant, when the variant is not worn by the element itself.',
|
|
166
|
+
},
|
|
167
|
+
themes: {
|
|
168
|
+
is: 'Readonly<Record<string, { readonly is?: string; readonly modes?: Readonly<Record<string, string>> }>>',
|
|
169
|
+
means: 'How a value changes under a theme, written theme.is=value, or theme.modes.mode=value where the theme has a dark and a light of its own, separated by commas.',
|
|
170
|
+
},
|
|
171
|
+
wears: { is: 'readonly string[]', means: 'The elements that accept a variant, by their names and separated by commas: Button, Link.' },
|
|
172
|
+
selector: {
|
|
173
|
+
is: 'string',
|
|
174
|
+
means: 'The CSS selector that is true while a signal holds. One the browser sets has its own, :hover; one an element raises is a data attribute named after the signal, and that is what is used when this is left blank.',
|
|
175
|
+
},
|
|
176
|
+
arranges: { is: 'boolean', means: 'Whether a thing arranges other things inside it, which is what lets it take children.' },
|
|
177
|
+
tag: {
|
|
178
|
+
is: 'string | Readonly<Record<string, string>>',
|
|
179
|
+
means: 'The HTML tag an element is written as: button, div, svg. When the tag depends on what the element carries, name that prop as by and give one entry per value, separated by commas: by=as, image=img, video=video.',
|
|
180
|
+
},
|
|
181
|
+
raises: { is: 'readonly string[]', means: 'The signals an element raises, separated by commas, each one a row in the signals sheet.' },
|
|
182
|
+
carries: {
|
|
183
|
+
is: 'Readonly<Record<string, string>>',
|
|
184
|
+
means: 'What an element takes as props, written name=kind and separated by commas: label=wording, disabled=flag.',
|
|
185
|
+
},
|
|
186
|
+
always: { is: 'readonly string[]', means: 'The signals that hold for as long as an element is on screen, separated by commas.' },
|
|
187
|
+
plays: {
|
|
188
|
+
is: 'Readonly<Record<string, string>>',
|
|
189
|
+
means: 'What a screen or a composition plays arriving and leaving, each naming an animation: in=rise, out=fall.',
|
|
190
|
+
},
|
|
191
|
+
derives: { is: 'readonly Threaded[]' },
|
|
192
|
+
};
|
|
193
|
+
const SHAPES = Object.fromEntries(Object.entries(FIELDS).map(([key, one]) => [key, ` readonly ${key}?: ${one.is}`]));
|
|
194
|
+
const CONCEPTS = Object.entries(FIELDS).flatMap(([id, one]) => one.means === undefined ? [] : [{ id, means: one.means }]);
|
|
195
|
+
function concept(one) {
|
|
196
|
+
return [
|
|
197
|
+
' {',
|
|
198
|
+
` id: ${quoted(one.id)},`,
|
|
199
|
+
" at: '_threads/concepts.ts',",
|
|
200
|
+
` describes: ${quoted(one.means)},`,
|
|
201
|
+
' version: 1,',
|
|
202
|
+
' cites: [',
|
|
203
|
+
` { on: ${quoted(SAID.on)}, said: ${quoted(SAID.said)} },`,
|
|
204
|
+
' ],',
|
|
205
|
+
' },',
|
|
206
|
+
].join('\n');
|
|
207
|
+
}
|
|
208
|
+
function stated(rows, always = []) {
|
|
209
|
+
const held = new Set(always);
|
|
210
|
+
for (const one of rows) {
|
|
211
|
+
for (const key of Object.keys(SHAPES)) {
|
|
212
|
+
if (one[key] !== undefined)
|
|
213
|
+
held.add(key);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return Object.keys(SHAPES).filter((key) => held.has(key));
|
|
217
|
+
}
|
|
218
|
+
function inside(node) {
|
|
219
|
+
return [...(node.holds ?? []), ...(node.declares ?? [])];
|
|
220
|
+
}
|
|
221
|
+
function quoted(value) {
|
|
222
|
+
return `'${value.replace(/\\/g, '\\\\').replace(/'/g, "\\'")}'`;
|
|
223
|
+
}
|
|
224
|
+
function installed(at) {
|
|
225
|
+
return at.replace(/^thread\/ui\/(.*)\.tsx?$/, `${ATTACH_HOME}/$1.js`);
|
|
226
|
+
}
|
|
227
|
+
function literal(value) {
|
|
228
|
+
return typeof value === 'number' ? String(value) : quoted(value);
|
|
229
|
+
}
|
|
230
|
+
const BARE = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
|
|
231
|
+
function pairs(held) {
|
|
232
|
+
const each = Object.entries(held).map(([key, value]) => `${BARE.test(key) ? key : quoted(key)}: ${typeof value === 'object' ? pairs(value) : literal(value)}`);
|
|
233
|
+
return `{ ${each.join(', ')} }`;
|
|
234
|
+
}
|
|
235
|
+
function listed(held) {
|
|
236
|
+
return `[${held.map(quoted).join(', ')}]`;
|
|
237
|
+
}
|
|
238
|
+
function themed(held) {
|
|
239
|
+
const each = Object.entries(held).map(([key, one]) => {
|
|
240
|
+
const parts = [
|
|
241
|
+
...(one.is === undefined ? [] : [`is: ${quoted(one.is)}`]),
|
|
242
|
+
...(one.modes === undefined ? [] : [`modes: ${pairs(one.modes)}`]),
|
|
243
|
+
];
|
|
244
|
+
return `${key}: { ${parts.join(', ')} }`;
|
|
245
|
+
});
|
|
246
|
+
return `{ ${each.join(', ')} }`;
|
|
247
|
+
}
|
|
248
|
+
const WRITTEN = new Set([
|
|
249
|
+
'id', 'at', 'describes', 'version', 'derives', 'holds',
|
|
250
|
+
'section', 'token', 'is', 'asks', 'sets', 'modes', 'places', 'themes', 'wears', 'selector',
|
|
251
|
+
'arranges', 'plays',
|
|
252
|
+
]);
|
|
253
|
+
function valued(held) {
|
|
254
|
+
if (typeof held === 'string')
|
|
255
|
+
return quoted(held);
|
|
256
|
+
if (typeof held === 'boolean' || typeof held === 'number')
|
|
257
|
+
return String(held);
|
|
258
|
+
if (Array.isArray(held))
|
|
259
|
+
return held.every((one) => typeof one === 'string') ? listed(held) : undefined;
|
|
260
|
+
if (held !== null && typeof held === 'object') {
|
|
261
|
+
return pairs(held);
|
|
262
|
+
}
|
|
263
|
+
return undefined;
|
|
264
|
+
}
|
|
265
|
+
function rest(one) {
|
|
266
|
+
const out = [];
|
|
267
|
+
for (const [key, held] of Object.entries(one)) {
|
|
268
|
+
if (WRITTEN.has(key) || held === undefined)
|
|
269
|
+
continue;
|
|
270
|
+
const said = valued(held);
|
|
271
|
+
if (said !== undefined)
|
|
272
|
+
out.push(` ${key}: ${said},`);
|
|
273
|
+
}
|
|
274
|
+
return out;
|
|
275
|
+
}
|
|
276
|
+
function row(one, file, sheet) {
|
|
277
|
+
const held = one.at === undefined || one.at === sheet;
|
|
278
|
+
const derives = (one.derives ?? []).filter((each) => installed(each.at) === each.at);
|
|
279
|
+
return [
|
|
280
|
+
' {',
|
|
281
|
+
` id: ${quoted(one.id)},`,
|
|
282
|
+
...(one.section === undefined ? [] : [` section: ${quoted(one.section)},`]),
|
|
283
|
+
...(one.token === undefined ? [] : [` token: ${quoted(one.token)},`]),
|
|
284
|
+
...(one.is === undefined ? [] : [` is: ${quoted(one.is)},`]),
|
|
285
|
+
...(one.asks === undefined ? [] : [` asks: ${pairs(one.asks)},`]),
|
|
286
|
+
...(one.sets === undefined ? [] : [` sets: ${pairs(one.sets)},`]),
|
|
287
|
+
...(one.modes === undefined ? [] : [` modes: ${pairs(one.modes)},`]),
|
|
288
|
+
...(one.places === undefined ? [] : [` places: ${pairs(one.places)},`]),
|
|
289
|
+
...(one.themes === undefined ? [] : [` themes: ${themed(one.themes)},`]),
|
|
290
|
+
...(one.wears === undefined ? [] : [` wears: ${listed(one.wears)},`]),
|
|
291
|
+
...(one.selector === undefined ? [] : [` selector: ${quoted(one.selector)},`]),
|
|
292
|
+
...(one.arranges === undefined ? [] : [` arranges: ${String(one.arranges)},`]),
|
|
293
|
+
...(one.plays === undefined ? [] : [` plays: ${pairs(one.plays)},`]),
|
|
294
|
+
...rest(one),
|
|
295
|
+
...(derives.length === 0
|
|
296
|
+
? []
|
|
297
|
+
: [
|
|
298
|
+
' derives: [',
|
|
299
|
+
...derives.flatMap((each) => [
|
|
300
|
+
' {',
|
|
301
|
+
` id: ${quoted(each.id)},`,
|
|
302
|
+
` at: ${quoted(each.at)},`,
|
|
303
|
+
...(each.by === undefined ? [] : [` by: ${quoted(each.by)},`]),
|
|
304
|
+
...(each.runs === undefined ? [] : [` runs: ${quoted(each.runs)},`]),
|
|
305
|
+
` describes: ${quoted(each.describes)},`,
|
|
306
|
+
' version: 1,',
|
|
307
|
+
' },',
|
|
308
|
+
]),
|
|
309
|
+
' ],',
|
|
310
|
+
]),
|
|
311
|
+
...(held ? [] : [` at: ${quoted(installed(one.at ?? ''))},`]),
|
|
312
|
+
` describes: ${quoted(one.describes)},`,
|
|
313
|
+
' version: 1,',
|
|
314
|
+
' },',
|
|
315
|
+
].join('\n');
|
|
316
|
+
}
|
|
317
|
+
const ARRANGES = {
|
|
318
|
+
composition: ['sets', 'modes', 'places', 'plays'],
|
|
319
|
+
screen: ['sets', 'modes', 'places', 'plays'],
|
|
320
|
+
styleguide: ['themes'],
|
|
321
|
+
element: ['tag', 'raises', 'carries', 'always', 'places', 'works', 'measures', 'reads', 'gives', 'keeps', 'animates', 'shows', 'called', 'wires', 'dresses'],
|
|
322
|
+
};
|
|
323
|
+
function source(node, file, rows) {
|
|
324
|
+
const extra = stated(rows, ARRANGES[node.id] ?? []).map((key) => SHAPES[key] ?? '');
|
|
325
|
+
const authors = node.declares !== undefined || rows.some((one) => one.at !== undefined && one.at !== node.at);
|
|
326
|
+
const values = node.holds !== undefined || rows.some((one) => one.at === undefined || one.at === node.at);
|
|
327
|
+
const own = node.id
|
|
328
|
+
.split('-')
|
|
329
|
+
.map((part) => `${part.charAt(0).toUpperCase()}${part.slice(1)}`)
|
|
330
|
+
.join('');
|
|
331
|
+
const widened = (base) => extra.length === 0 ? base : `(${base} & {\n${extra.join('\n')}\n })`;
|
|
332
|
+
const lists = [
|
|
333
|
+
...(authors || !values ? [` readonly declares?: readonly ${widened('Threaded')}[]`] : []),
|
|
334
|
+
...(values ? [` readonly holds?: readonly ${widened("Omit<Threaded, 'at'>")}[]`] : []),
|
|
335
|
+
];
|
|
336
|
+
const bespoke = extra.length > 0 || values || node.files !== undefined;
|
|
337
|
+
const shape = bespoke
|
|
338
|
+
? `
|
|
339
|
+
export interface ${own} extends Threaded {
|
|
340
|
+
${[...(node.files === undefined ? [] : [' readonly files?: string']), ...lists].join('\n')}
|
|
341
|
+
}
|
|
342
|
+
`
|
|
343
|
+
: '';
|
|
344
|
+
const held = [
|
|
345
|
+
...(node.files === undefined ? [] : [` files: ${quoted(node.files)},`]),
|
|
346
|
+
...(authors || !values ? [' declares: [],'] : []),
|
|
347
|
+
...(values ? [' holds: [],'] : []),
|
|
348
|
+
];
|
|
349
|
+
const wants = shape.includes('Condition');
|
|
350
|
+
return `import type { Threaded } from '../core/thread.ts'${wants ? `\nimport type { Condition } from '../core/condition.ts'` : ''}
|
|
351
|
+
${shape}
|
|
352
|
+
export const ${node.id.toUpperCase()}: ${bespoke ? own : 'Threaded'} = {
|
|
353
|
+
id: ${quoted(node.id)},
|
|
354
|
+
at: ${quoted(`_threads/${file}`)},
|
|
355
|
+
describes: ${quoted(node.describes)},
|
|
356
|
+
version: 1,
|
|
357
|
+
${held.join('\n')}
|
|
358
|
+
}
|
|
359
|
+
`;
|
|
360
|
+
}
|
|
361
|
+
const LISTS = [
|
|
362
|
+
{ node: TOKENS, file: 'tokens.ts' },
|
|
363
|
+
{ node: FONTS, file: 'fonts.ts' },
|
|
364
|
+
{ node: ICONS, file: 'icons.ts' },
|
|
365
|
+
{ node: ANIMATIONS, file: 'animations.ts' },
|
|
366
|
+
{ node: SIGNALS, file: 'signals.ts' },
|
|
367
|
+
{ node: MATERIALS, file: 'materials.ts' },
|
|
368
|
+
{ node: VARIANTS, file: 'variants.ts' },
|
|
369
|
+
{ node: STYLEGUIDES, file: 'styleguides.ts' },
|
|
370
|
+
{ node: LOCALIZATIONS, file: 'localizations.ts' },
|
|
371
|
+
{ node: MODES, file: 'modes.ts' },
|
|
372
|
+
{ node: THEMES, file: 'themes.ts' },
|
|
373
|
+
{ node: ELEMENTS, file: 'elements.ts' },
|
|
374
|
+
{ node: COMPOSITIONS, file: 'compositions.ts' },
|
|
375
|
+
{ node: SCREENS, file: 'screens.ts' },
|
|
376
|
+
];
|
|
377
|
+
function child(one) {
|
|
378
|
+
return [
|
|
379
|
+
' {',
|
|
380
|
+
` id: ${quoted(one.node.id)},`,
|
|
381
|
+
` at: ${quoted(`_threads/${one.file}`)},`,
|
|
382
|
+
` describes: ${quoted(one.node.describes)},`,
|
|
383
|
+
' version: 1,',
|
|
384
|
+
' },',
|
|
385
|
+
].join('\n');
|
|
386
|
+
}
|
|
387
|
+
function sectioned(one) {
|
|
388
|
+
const last = new Map();
|
|
389
|
+
return (one.rows ?? inside(one.node)).map((held) => {
|
|
390
|
+
const list = held.at === undefined || held.at === one.node.at ? 'holds' : 'declares';
|
|
391
|
+
const before = last.get(list);
|
|
392
|
+
const section = held.section ?? '';
|
|
393
|
+
last.set(list, section);
|
|
394
|
+
const turned = before !== undefined && before !== section;
|
|
395
|
+
return {
|
|
396
|
+
into: one.file,
|
|
397
|
+
list,
|
|
398
|
+
id: held.id,
|
|
399
|
+
source: `${turned ? '\n' : ''}${row(held, one.file, one.node.at)}`,
|
|
400
|
+
};
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
const UI_SOURCE = `import type { Threaded } from '../core/thread.ts'
|
|
404
|
+
|
|
405
|
+
export const UI: Threaded = {
|
|
406
|
+
${SEEDED.declares.split('\n').slice(1, -1).map((line) => line.slice(4)).join('\n')}
|
|
407
|
+
declares: [],
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
export const GENERATORS: readonly Threaded[] = []
|
|
411
|
+
`;
|
|
412
|
+
const RETIRED = [
|
|
413
|
+
{
|
|
414
|
+
into: 'tokens.ts',
|
|
415
|
+
list: 'holds',
|
|
416
|
+
id: 'font',
|
|
417
|
+
why: 'a font is not a token — the fonts sheet holds faces, sizes and appearance directly, so there is no variable of this kind for a style guide to give a value to',
|
|
418
|
+
},
|
|
419
|
+
...['sm', 'md', 'lg'].map((one) => ({
|
|
420
|
+
into: 'styleguides.ts',
|
|
421
|
+
list: 'holds',
|
|
422
|
+
id: `icon-${one}`,
|
|
423
|
+
why: 'the style guide holds no icon size — `icons.ts` does, and it is the one place a symbol is measured. These rows and a constant inside the package were both claiming to decide it, and the constant was what anything actually drew at, so changing the row moved the CSS variable and left every icon the size it already was',
|
|
424
|
+
})),
|
|
425
|
+
...['link', 'glyph', 'avatar', 'skeleton', 'spinner'].map((one) => ({
|
|
426
|
+
into: 'variants.ts',
|
|
427
|
+
list: 'declares',
|
|
428
|
+
id: one,
|
|
429
|
+
why: `a variant sharing a word with the element that wears it — \`${one}\` was coined twice, once as the element and once as the look, with two different meanings. The framework's own rule refuses that, and an app made entirely by these commands failed its own descent on five words this package had shipped. Renamed to \`${one}-\` plus what distinguishes it`,
|
|
430
|
+
})),
|
|
431
|
+
...['icon', 'icon-ghost', 'icon-border', 'label-icon', 'elevated'].map((one) => ({
|
|
432
|
+
into: 'variants.ts',
|
|
433
|
+
list: 'declares',
|
|
434
|
+
id: `button-${one}`,
|
|
435
|
+
why: 'a variant may not decide what a button CONTAINS — a symbol, a word or both is the composition\'s to arrange, and four variants existed only to answer it. `button-ghost`, `button-fill` and the rest each serve every shape of content. `button-elevated` is withdrawn as simply poor',
|
|
436
|
+
})),
|
|
437
|
+
...['filled', 'outlined', 'plain'].map((one) => ({
|
|
438
|
+
into: 'materials.ts',
|
|
439
|
+
list: 'declares',
|
|
440
|
+
id: one,
|
|
441
|
+
why: 'not a material — a background, an ink and a border width are three style guide rows, and wrapping them in a material only added a second place to look. A material is for what composes into one appearance worth naming: glass, a real relief, a glaze. The variants that wore these now name the rows directly',
|
|
442
|
+
})),
|
|
443
|
+
...['primary', 'secondary'].map((one) => ({
|
|
444
|
+
into: 'variants.ts',
|
|
445
|
+
list: 'declares',
|
|
446
|
+
id: `button-${one}`,
|
|
447
|
+
why: 'a second name for something the button family already carries — `button-primary` is `button-fill` and `button-secondary` is `button-border`. Two names for one look is the defect this framework refuses everywhere else, and it was shipping it in the one place an app looks first',
|
|
448
|
+
})),
|
|
449
|
+
...['sans', 'serif', 'mono', 'display'].map((one) => ({
|
|
450
|
+
into: 'styleguides.ts',
|
|
451
|
+
list: 'holds',
|
|
452
|
+
id: `font-${one}`,
|
|
453
|
+
why: 'the style guide holds no font — a font is not a token value, and the fonts sheet is the source for faces',
|
|
454
|
+
})),
|
|
455
|
+
...['display', 'heading', 'body', 'label'].map((one) => ({
|
|
456
|
+
into: 'variants.ts',
|
|
457
|
+
list: 'declares',
|
|
458
|
+
id: one,
|
|
459
|
+
why: 'a type role, not a variant — it set a face, a size and a weight, all of which the fonts sheet now decides',
|
|
460
|
+
})),
|
|
461
|
+
];
|
|
462
|
+
export const ATTACH = {
|
|
463
|
+
attaches: SEEDED.attaches,
|
|
464
|
+
id: SEEDED.id,
|
|
465
|
+
needs: {
|
|
466
|
+
'@types/react': '^19.0.0',
|
|
467
|
+
'@types/react-dom': '^19.0.0',
|
|
468
|
+
next: '^16.0.0',
|
|
469
|
+
react: '^19.0.0',
|
|
470
|
+
'react-dom': '^19.0.0',
|
|
471
|
+
},
|
|
472
|
+
rows: [
|
|
473
|
+
...CONCEPTS.map((one) => ({
|
|
474
|
+
into: 'concepts.ts',
|
|
475
|
+
list: 'CONCEPTS',
|
|
476
|
+
id: one.id,
|
|
477
|
+
source: concept(one),
|
|
478
|
+
})),
|
|
479
|
+
...LISTS.map((one) => ({
|
|
480
|
+
into: 'ui.ts',
|
|
481
|
+
list: 'declares',
|
|
482
|
+
id: one.node.id,
|
|
483
|
+
source: child(one),
|
|
484
|
+
})),
|
|
485
|
+
...LISTS.flatMap((one) => sectioned(one)),
|
|
486
|
+
...SHIPPED,
|
|
487
|
+
],
|
|
488
|
+
retires: RETIRED,
|
|
489
|
+
declares: SEEDED.declares,
|
|
490
|
+
writes: [
|
|
491
|
+
{ file: 'ui.ts', source: UI_SOURCE },
|
|
492
|
+
...LISTS.map((one) => ({
|
|
493
|
+
file: one.file,
|
|
494
|
+
source: source(one.node, one.file, one.rows ?? inside(one.node)),
|
|
495
|
+
})),
|
|
496
|
+
],
|
|
497
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { MessageKey } from './content.tsx';
|
|
2
|
+
export type Row = Readonly<Record<string, unknown>>;
|
|
3
|
+
export type WhenTight = 'scroll' | 'bucket' | 'wrap' | 'shrink';
|
|
4
|
+
export interface ChartBase {
|
|
5
|
+
readonly rows: readonly Row[];
|
|
6
|
+
readonly titleKey?: MessageKey;
|
|
7
|
+
readonly whenTight?: WhenTight;
|
|
8
|
+
readonly format?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const num: (row: Row, key: string) => number;
|
|
11
|
+
export declare const str: (row: Row, key: string) => string;
|
|
12
|
+
export declare function useRamp(count: number): readonly string[];
|
|
13
|
+
export declare function placed(element: string, place: string): string;
|
|
14
|
+
export declare function measured(held: Readonly<Record<string, string | number>>): Record<string, string | number>;
|
|
15
|
+
export declare function EmptyFrame({ className }: {
|
|
16
|
+
className?: string;
|
|
17
|
+
}): React.ReactElement;
|
|
18
|
+
export interface SeriesProps extends ChartBase {
|
|
19
|
+
readonly value: string;
|
|
20
|
+
readonly at: string;
|
|
21
|
+
readonly by?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function polyline(values: readonly number[], width: number, height: number): string;
|
|
24
|
+
export interface CategoryProps extends ChartBase {
|
|
25
|
+
readonly value: string;
|
|
26
|
+
readonly by: string;
|
|
27
|
+
}
|
|
28
|
+
export interface TwoAxisProps extends ChartBase {
|
|
29
|
+
readonly x: string;
|
|
30
|
+
readonly y: string;
|
|
31
|
+
readonly value?: string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { seriesRamp } from "./series.js";
|
|
4
|
+
import { classOfElement } from "./variant.js";
|
|
5
|
+
import { useUi } from "./wrappers.js";
|
|
6
|
+
export const num = (row, key) => {
|
|
7
|
+
const v = row[key];
|
|
8
|
+
return typeof v === 'number' ? v : Number(v ?? 0);
|
|
9
|
+
};
|
|
10
|
+
export const str = (row, key) => String(row[key] ?? '');
|
|
11
|
+
export function useRamp(count) {
|
|
12
|
+
const { palette } = useUi();
|
|
13
|
+
return seriesRamp(palette.accent, palette.surface, Math.max(1, count));
|
|
14
|
+
}
|
|
15
|
+
export function placed(element, place) {
|
|
16
|
+
return `${classOfElement(element)}-${place}`;
|
|
17
|
+
}
|
|
18
|
+
export function measured(held) {
|
|
19
|
+
const out = {};
|
|
20
|
+
for (const [name, value] of Object.entries(held))
|
|
21
|
+
out[`--${name}`] = value;
|
|
22
|
+
return out;
|
|
23
|
+
}
|
|
24
|
+
export function EmptyFrame({ className }) {
|
|
25
|
+
return _jsx("div", { className: className, "data-empty": "true" });
|
|
26
|
+
}
|
|
27
|
+
export function polyline(values, width, height) {
|
|
28
|
+
if (values.length === 0)
|
|
29
|
+
return '';
|
|
30
|
+
const max = Math.max(...values);
|
|
31
|
+
const min = Math.min(...values, 0);
|
|
32
|
+
const span = max - min || 1;
|
|
33
|
+
const step = values.length === 1 ? 0 : width / (values.length - 1);
|
|
34
|
+
return values.map((v, i) => `${(i * step).toFixed(2)},${(height - ((v - min) / span) * height).toFixed(2)}`).join(' ');
|
|
35
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ELEMENTS } from './elements.ts';
|
|
2
|
+
import { VARIANTS } from './variants.ts';
|
|
3
|
+
type Shipped = (typeof VARIANTS)['declares'][number];
|
|
4
|
+
export interface Wearing {
|
|
5
|
+
}
|
|
6
|
+
export interface Dispatching {
|
|
7
|
+
}
|
|
8
|
+
export type VariantsFor<E extends string> = Shipped extends infer One ? One extends {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly wears: readonly string[];
|
|
11
|
+
} ? E extends One['wears'][number] ? Camel<One['id']> : never : never : never;
|
|
12
|
+
type Pascal<S extends string> = S extends `${infer Head}-${infer Rest}` ? `${Capitalize<Head>}${Pascal<Rest>}` : Capitalize<S>;
|
|
13
|
+
type Camel<S extends string> = S extends `${infer Head}-${infer Rest}` ? `${Head}${Pascal<Rest>}` : S;
|
|
14
|
+
export type ArrangementElement = (typeof ELEMENTS)['declares'][number] extends infer One ? One extends {
|
|
15
|
+
readonly arranges: true;
|
|
16
|
+
readonly id: infer Id extends string;
|
|
17
|
+
} ? Pascal<Id> : never : never;
|
|
18
|
+
export declare function idOf(name: string): string;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface ClientEvent {
|
|
2
|
+
readonly property: 'interaction' | 'visit' | 'consent';
|
|
3
|
+
readonly screen?: string;
|
|
4
|
+
readonly element?: string;
|
|
5
|
+
readonly name?: string;
|
|
6
|
+
readonly action?: string;
|
|
7
|
+
readonly refusedBy?: string;
|
|
8
|
+
readonly attempt?: number;
|
|
9
|
+
readonly at: number;
|
|
10
|
+
readonly seq: number;
|
|
11
|
+
}
|
|
12
|
+
export interface CollectorOptions {
|
|
13
|
+
readonly endpoint: string;
|
|
14
|
+
readonly allowed: () => boolean;
|
|
15
|
+
readonly sample?: number;
|
|
16
|
+
readonly maxBatch?: number;
|
|
17
|
+
readonly intervalMs?: number;
|
|
18
|
+
readonly now?: () => number;
|
|
19
|
+
readonly random?: () => number;
|
|
20
|
+
readonly fetch?: typeof globalThis.fetch;
|
|
21
|
+
readonly beacon?: (url: string, body: string) => boolean;
|
|
22
|
+
}
|
|
23
|
+
export type RecordedEvent = Omit<ClientEvent, 'at' | 'seq'>;
|
|
24
|
+
export interface Collector {
|
|
25
|
+
record: (event: RecordedEvent) => void;
|
|
26
|
+
flush: () => Promise<void>;
|
|
27
|
+
stop: () => void;
|
|
28
|
+
dropped: () => number;
|
|
29
|
+
pending: () => number;
|
|
30
|
+
}
|
|
31
|
+
export declare const INERT_COLLECTOR: Collector;
|
|
32
|
+
export declare function createCollector(options: CollectorOptions): Collector;
|