@antheo/morph 0.0.0-stage → 0.3.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 +266 -2
- package/SKILL.md +61 -0
- package/dist/ai/cli-provider.d.ts +80 -0
- package/dist/ai/cli-provider.js +250 -0
- package/dist/ai/gate.d.ts +39 -0
- package/dist/ai/gate.js +124 -0
- package/dist/ai/provider.d.ts +36 -0
- package/dist/ai/provider.js +168 -0
- package/dist/ai/repair.d.ts +90 -0
- package/dist/ai/repair.js +172 -0
- package/dist/analyzer/deps.d.ts +30 -0
- package/dist/analyzer/deps.js +265 -0
- package/dist/analyzer/manifest.d.ts +5 -0
- package/dist/analyzer/manifest.js +119 -0
- package/dist/analyzer/parse.d.ts +21 -0
- package/dist/analyzer/parse.js +29 -0
- package/dist/batch-worker.d.ts +16 -0
- package/dist/batch-worker.js +10 -0
- package/dist/batch.d.ts +26 -0
- package/dist/batch.js +227 -0
- package/dist/bridge/index.d.ts +26 -0
- package/dist/bridge/index.js +138 -0
- package/dist/bridge/props.d.ts +56 -0
- package/dist/bridge/props.js +191 -0
- package/dist/bridge/wrappers.d.ts +24 -0
- package/dist/bridge/wrappers.js +276 -0
- package/dist/cli/format.d.ts +7 -0
- package/dist/cli/format.js +30 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +492 -0
- package/dist/fonts/carry.d.ts +34 -0
- package/dist/fonts/carry.js +113 -0
- package/dist/fonts/fallback.d.ts +11 -0
- package/dist/fonts/fallback.js +21 -0
- package/dist/fonts/google.d.ts +65 -0
- package/dist/fonts/google.js +343 -0
- package/dist/fonts/index.d.ts +27 -0
- package/dist/fonts/index.js +48 -0
- package/dist/fonts/local.d.ts +46 -0
- package/dist/fonts/local.js +150 -0
- package/dist/fonts/sfnt.d.ts +19 -0
- package/dist/fonts/sfnt.js +174 -0
- package/dist/fonts/shim.d.ts +14 -0
- package/dist/fonts/shim.js +96 -0
- package/dist/gate.d.ts +105 -0
- package/dist/gate.js +157 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.js +74 -0
- package/dist/ir/annotate.d.ts +16 -0
- package/dist/ir/annotate.js +145 -0
- package/dist/ir/as-child.d.ts +18 -0
- package/dist/ir/as-child.js +239 -0
- package/dist/ir/compounds.d.ts +27 -0
- package/dist/ir/compounds.js +183 -0
- package/dist/ir/contexts.d.ts +26 -0
- package/dist/ir/contexts.js +185 -0
- package/dist/ir/dom.d.ts +11 -0
- package/dist/ir/dom.js +60 -0
- package/dist/ir/effect-returns.d.ts +10 -0
- package/dist/ir/effect-returns.js +25 -0
- package/dist/ir/extract-ui-types.d.ts +33 -0
- package/dist/ir/extract-ui-types.js +224 -0
- package/dist/ir/extract-ui.d.ts +34 -0
- package/dist/ir/extract-ui.js +567 -0
- package/dist/ir/falsy.d.ts +13 -0
- package/dist/ir/falsy.js +66 -0
- package/dist/ir/forward-refs.d.ts +11 -0
- package/dist/ir/forward-refs.js +155 -0
- package/dist/ir/fragment-source.d.ts +4 -0
- package/dist/ir/fragment-source.js +13 -0
- package/dist/ir/fragments.d.ts +32 -0
- package/dist/ir/fragments.js +192 -0
- package/dist/ir/helper-snippets.d.ts +30 -0
- package/dist/ir/helper-snippets.js +550 -0
- package/dist/ir/latest-refs.d.ts +11 -0
- package/dist/ir/latest-refs.js +187 -0
- package/dist/ir/live-args.d.ts +26 -0
- package/dist/ir/live-args.js +335 -0
- package/dist/ir/lower.d.ts +83 -0
- package/dist/ir/lower.js +6016 -0
- package/dist/ir/markup-values.d.ts +16 -0
- package/dist/ir/markup-values.js +188 -0
- package/dist/ir/model.d.ts +605 -0
- package/dist/ir/model.js +1 -0
- package/dist/ir/oracle.d.ts +91 -0
- package/dist/ir/oracle.js +610 -0
- package/dist/ir/radix.d.ts +122 -0
- package/dist/ir/radix.js +344 -0
- package/dist/ir/rename.d.ts +15 -0
- package/dist/ir/rename.js +151 -0
- package/dist/ir/render-props.d.ts +31 -0
- package/dist/ir/render-props.js +67 -0
- package/dist/ir/rewrite.d.ts +44 -0
- package/dist/ir/rewrite.js +381 -0
- package/dist/ir/running-index.d.ts +11 -0
- package/dist/ir/running-index.js +217 -0
- package/dist/ir/snapshots.d.ts +12 -0
- package/dist/ir/snapshots.js +140 -0
- package/dist/ir/style.d.ts +19 -0
- package/dist/ir/style.js +76 -0
- package/dist/ir/types.d.ts +42 -0
- package/dist/ir/types.js +271 -0
- package/dist/ir/walk.d.ts +11 -0
- package/dist/ir/walk.js +18 -0
- package/dist/mcp/server.d.ts +81 -0
- package/dist/mcp/server.js +518 -0
- package/dist/pipeline.d.ts +26 -0
- package/dist/pipeline.js +750 -0
- package/dist/registry/add.d.ts +91 -0
- package/dist/registry/add.js +273 -0
- package/dist/registry/fetch.d.ts +40 -0
- package/dist/registry/fetch.js +186 -0
- package/dist/registry/ip.d.ts +18 -0
- package/dist/registry/ip.js +153 -0
- package/dist/registry/item.d.ts +39 -0
- package/dist/registry/item.js +131 -0
- package/dist/registry/load.d.ts +35 -0
- package/dist/registry/load.js +106 -0
- package/dist/registry/paths.d.ts +8 -0
- package/dist/registry/paths.js +43 -0
- package/dist/registry/publish.d.ts +119 -0
- package/dist/registry/publish.js +439 -0
- package/dist/targets/angular/bank/bank.d.ts +39 -0
- package/dist/targets/angular/bank/bank.js +61 -0
- package/dist/targets/angular/bank/helpers.d.ts +64 -0
- package/dist/targets/angular/bank/helpers.js +246 -0
- package/dist/targets/angular/bank/kept.d.ts +98 -0
- package/dist/targets/angular/bank/kept.js +791 -0
- package/dist/targets/angular/bank/plan-helpers.d.ts +17 -0
- package/dist/targets/angular/bank/plan-helpers.js +286 -0
- package/dist/targets/angular/bank/plan.d.ts +22 -0
- package/dist/targets/angular/bank/plan.js +152 -0
- package/dist/targets/angular/bank/receivers.d.ts +66 -0
- package/dist/targets/angular/bank/receivers.js +293 -0
- package/dist/targets/angular/bank/runtime.d.ts +14 -0
- package/dist/targets/angular/bank/runtime.js +152 -0
- package/dist/targets/angular/controlled.d.ts +7 -0
- package/dist/targets/angular/controlled.js +37 -0
- package/dist/targets/angular/dynamic-tags.d.ts +34 -0
- package/dist/targets/angular/dynamic-tags.js +192 -0
- package/dist/targets/angular/emit.d.ts +41 -0
- package/dist/targets/angular/emit.js +5970 -0
- package/dist/targets/angular/exports.d.ts +48 -0
- package/dist/targets/angular/exports.js +243 -0
- package/dist/targets/angular/helpers.d.ts +15 -0
- package/dist/targets/angular/helpers.js +33 -0
- package/dist/targets/angular/host-boundary.d.ts +5 -0
- package/dist/targets/angular/host-boundary.js +166 -0
- package/dist/targets/angular/host-form.d.ts +150 -0
- package/dist/targets/angular/host-form.js +727 -0
- package/dist/targets/angular/markup-values.d.ts +58 -0
- package/dist/targets/angular/markup-values.js +661 -0
- package/dist/targets/angular/motion-directive.d.ts +12 -0
- package/dist/targets/angular/motion-directive.js +257 -0
- package/dist/targets/angular/motion-hooks.d.ts +73 -0
- package/dist/targets/angular/motion-hooks.js +293 -0
- package/dist/targets/angular/motion-layout.d.ts +14 -0
- package/dist/targets/angular/motion-layout.js +74 -0
- package/dist/targets/angular/motion-templates.d.ts +10 -0
- package/dist/targets/angular/motion-templates.js +65 -0
- package/dist/targets/angular/motion.d.ts +57 -0
- package/dist/targets/angular/motion.js +202 -0
- package/dist/targets/angular/narrowing.d.ts +24 -0
- package/dist/targets/angular/narrowing.js +205 -0
- package/dist/targets/angular/ngc.d.ts +23 -0
- package/dist/targets/angular/ngc.js +134 -0
- package/dist/targets/angular/passed-handle.d.ts +39 -0
- package/dist/targets/angular/passed-handle.js +154 -0
- package/dist/targets/angular/projected.d.ts +9 -0
- package/dist/targets/angular/projected.js +63 -0
- package/dist/targets/angular/radix/cores/alert-dialog.d.ts +13 -0
- package/dist/targets/angular/radix/cores/alert-dialog.js +388 -0
- package/dist/targets/angular/radix/cores/index.d.ts +17 -0
- package/dist/targets/angular/radix/cores/index.js +50 -0
- package/dist/targets/angular/radix/cores/slider.d.ts +8 -0
- package/dist/targets/angular/radix/cores/slider.js +202 -0
- package/dist/targets/angular/radix/index.d.ts +21 -0
- package/dist/targets/angular/radix/index.js +35 -0
- package/dist/targets/angular/radix/packages.d.ts +3 -0
- package/dist/targets/angular/radix/packages.js +558 -0
- package/dist/targets/angular/radix/part.d.ts +236 -0
- package/dist/targets/angular/radix/part.js +71 -0
- package/dist/targets/angular/radix/prepare.d.ts +66 -0
- package/dist/targets/angular/radix/prepare.js +548 -0
- package/dist/targets/angular/radix/template.d.ts +43 -0
- package/dist/targets/angular/radix/template.js +172 -0
- package/dist/targets/angular/refs.d.ts +68 -0
- package/dist/targets/angular/refs.js +443 -0
- package/dist/targets/angular/slots.d.ts +22 -0
- package/dist/targets/angular/slots.js +60 -0
- package/dist/targets/angular/source-types.d.ts +10 -0
- package/dist/targets/angular/source-types.js +45 -0
- package/dist/targets/angular/spread-forward.d.ts +24 -0
- package/dist/targets/angular/spread-forward.js +72 -0
- package/dist/targets/angular/spread.d.ts +32 -0
- package/dist/targets/angular/spread.js +182 -0
- package/dist/targets/angular/svg-hosts.d.ts +25 -0
- package/dist/targets/angular/svg-hosts.js +107 -0
- package/dist/targets/angular/template-expr.d.ts +36 -0
- package/dist/targets/angular/template-expr.js +287 -0
- package/dist/targets/angular/types.d.ts +9 -0
- package/dist/targets/angular/types.js +63 -0
- package/dist/targets/angular/walk.d.ts +11 -0
- package/dist/targets/angular/walk.js +26 -0
- package/dist/targets/react-native/emit.d.ts +14 -0
- package/dist/targets/react-native/emit.js +585 -0
- package/dist/targets/react-native/fidelity.d.ts +5 -0
- package/dist/targets/react-native/fidelity.js +43 -0
- package/dist/targets/react-native/motion.d.ts +10 -0
- package/dist/targets/react-native/motion.js +290 -0
- package/dist/targets/react-native/skia.d.ts +30 -0
- package/dist/targets/react-native/skia.js +358 -0
- package/dist/targets/shared/context.d.ts +47 -0
- package/dist/targets/shared/context.js +195 -0
- package/dist/targets/shared/foreign.d.ts +10 -0
- package/dist/targets/shared/foreign.js +72 -0
- package/dist/targets/shared/fragments.d.ts +21 -0
- package/dist/targets/shared/fragments.js +309 -0
- package/dist/targets/shared/handles.d.ts +65 -0
- package/dist/targets/shared/handles.js +299 -0
- package/dist/targets/shared/inline.d.ts +53 -0
- package/dist/targets/shared/inline.js +524 -0
- package/dist/targets/shared/layout.d.ts +70 -0
- package/dist/targets/shared/layout.js +224 -0
- package/dist/targets/shared/markup.d.ts +26 -0
- package/dist/targets/shared/markup.js +65 -0
- package/dist/targets/shared/module.d.ts +84 -0
- package/dist/targets/shared/module.js +468 -0
- package/dist/targets/shared/motion-hooks.d.ts +37 -0
- package/dist/targets/shared/motion-hooks.js +87 -0
- package/dist/targets/shared/motion-layout.d.ts +70 -0
- package/dist/targets/shared/motion-layout.js +392 -0
- package/dist/targets/shared/portal.d.ts +10 -0
- package/dist/targets/shared/portal.js +23 -0
- package/dist/targets/shared/prop-writes.d.ts +11 -0
- package/dist/targets/shared/prop-writes.js +32 -0
- package/dist/targets/shared/prune.d.ts +54 -0
- package/dist/targets/shared/prune.js +405 -0
- package/dist/targets/shared/react-libs.d.ts +25 -0
- package/dist/targets/shared/react-libs.js +142 -0
- package/dist/targets/shared/react-types.d.ts +16 -0
- package/dist/targets/shared/react-types.js +374 -0
- package/dist/targets/shared/react-values.d.ts +20 -0
- package/dist/targets/shared/react-values.js +145 -0
- package/dist/targets/shared/ref-callback.d.ts +16 -0
- package/dist/targets/shared/ref-callback.js +114 -0
- package/dist/targets/shared/script.d.ts +65 -0
- package/dist/targets/shared/script.js +406 -0
- package/dist/targets/shared/unused.d.ts +12 -0
- package/dist/targets/shared/unused.js +146 -0
- package/dist/targets/svelte/dom-spread.d.ts +27 -0
- package/dist/targets/svelte/dom-spread.js +146 -0
- package/dist/targets/svelte/emit.d.ts +15 -0
- package/dist/targets/svelte/emit.js +3784 -0
- package/dist/targets/svelte/handle-branches.d.ts +22 -0
- package/dist/targets/svelte/handle-branches.js +146 -0
- package/dist/targets/svelte/html-keys.d.ts +9 -0
- package/dist/targets/svelte/html-keys.js +40 -0
- package/dist/targets/svelte/markup-data/data.d.ts +51 -0
- package/dist/targets/svelte/markup-data/data.js +305 -0
- package/dist/targets/svelte/markup-data/helper.d.ts +12 -0
- package/dist/targets/svelte/markup-data/helper.js +81 -0
- package/dist/targets/svelte/markup-data/module-data.d.ts +21 -0
- package/dist/targets/svelte/markup-data/module-data.js +473 -0
- package/dist/targets/svelte/markup-data/sites.d.ts +52 -0
- package/dist/targets/svelte/markup-data/sites.js +303 -0
- package/dist/targets/svelte/motion-layout.d.ts +13 -0
- package/dist/targets/svelte/motion-layout.js +70 -0
- package/dist/targets/svelte/motion-table.d.ts +14 -0
- package/dist/targets/svelte/motion-table.js +308 -0
- package/dist/targets/svelte/motion.d.ts +46 -0
- package/dist/targets/svelte/motion.js +405 -0
- package/dist/targets/svelte/presence.d.ts +71 -0
- package/dist/targets/svelte/presence.js +318 -0
- package/dist/targets/svelte/radix/accordion.d.ts +9 -0
- package/dist/targets/svelte/radix/accordion.js +24 -0
- package/dist/targets/svelte/radix/aspect-ratio.d.ts +6 -0
- package/dist/targets/svelte/radix/aspect-ratio.js +8 -0
- package/dist/targets/svelte/radix/avatar.d.ts +6 -0
- package/dist/targets/svelte/radix/avatar.js +10 -0
- package/dist/targets/svelte/radix/checkbox.d.ts +10 -0
- package/dist/targets/svelte/radix/checkbox.js +24 -0
- package/dist/targets/svelte/radix/collapsible.d.ts +7 -0
- package/dist/targets/svelte/radix/collapsible.js +16 -0
- package/dist/targets/svelte/radix/context-menu.d.ts +8 -0
- package/dist/targets/svelte/radix/context-menu.js +49 -0
- package/dist/targets/svelte/radix/cores/alert-dialog.d.ts +17 -0
- package/dist/targets/svelte/radix/cores/alert-dialog.js +449 -0
- package/dist/targets/svelte/radix/cores/collapsible.d.ts +12 -0
- package/dist/targets/svelte/radix/cores/collapsible.js +214 -0
- package/dist/targets/svelte/radix/cores/core.d.ts +32 -0
- package/dist/targets/svelte/radix/cores/core.js +80 -0
- package/dist/targets/svelte/radix/cores/direction.d.ts +10 -0
- package/dist/targets/svelte/radix/cores/direction.js +64 -0
- package/dist/targets/svelte/radix/cores/index.d.ts +19 -0
- package/dist/targets/svelte/radix/cores/index.js +85 -0
- package/dist/targets/svelte/radix/cores/modal-layer.d.ts +11 -0
- package/dist/targets/svelte/radix/cores/modal-layer.js +244 -0
- package/dist/targets/svelte/radix/cores/presence.d.ts +12 -0
- package/dist/targets/svelte/radix/cores/presence.js +129 -0
- package/dist/targets/svelte/radix/cores/slider-logic.d.ts +10 -0
- package/dist/targets/svelte/radix/cores/slider-logic.js +287 -0
- package/dist/targets/svelte/radix/cores/slider.d.ts +13 -0
- package/dist/targets/svelte/radix/cores/slider.js +267 -0
- package/dist/targets/svelte/radix/dialog.d.ts +8 -0
- package/dist/targets/svelte/radix/dialog.js +20 -0
- package/dist/targets/svelte/radix/dropdown-menu.d.ts +9 -0
- package/dist/targets/svelte/radix/dropdown-menu.js +38 -0
- package/dist/targets/svelte/radix/emit.d.ts +12 -0
- package/dist/targets/svelte/radix/emit.js +1339 -0
- package/dist/targets/svelte/radix/hover-card.d.ts +7 -0
- package/dist/targets/svelte/radix/hover-card.js +22 -0
- package/dist/targets/svelte/radix/index.d.ts +12 -0
- package/dist/targets/svelte/radix/index.js +28 -0
- package/dist/targets/svelte/radix/label.d.ts +3 -0
- package/dist/targets/svelte/radix/label.js +5 -0
- package/dist/targets/svelte/radix/menubar.d.ts +7 -0
- package/dist/targets/svelte/radix/menubar.js +34 -0
- package/dist/targets/svelte/radix/navigation-menu.d.ts +8 -0
- package/dist/targets/svelte/radix/navigation-menu.js +25 -0
- package/dist/targets/svelte/radix/packages.d.ts +34 -0
- package/dist/targets/svelte/radix/packages.js +100 -0
- package/dist/targets/svelte/radix/part.d.ts +161 -0
- package/dist/targets/svelte/radix/part.js +85 -0
- package/dist/targets/svelte/radix/popover.d.ts +7 -0
- package/dist/targets/svelte/radix/popover.js +15 -0
- package/dist/targets/svelte/radix/progress.d.ts +11 -0
- package/dist/targets/svelte/radix/progress.js +27 -0
- package/dist/targets/svelte/radix/radio-group.d.ts +9 -0
- package/dist/targets/svelte/radix/radio-group.js +26 -0
- package/dist/targets/svelte/radix/scroll-area.d.ts +7 -0
- package/dist/targets/svelte/radix/scroll-area.js +19 -0
- package/dist/targets/svelte/radix/select.d.ts +13 -0
- package/dist/targets/svelte/radix/select.js +81 -0
- package/dist/targets/svelte/radix/separator.d.ts +3 -0
- package/dist/targets/svelte/radix/separator.js +5 -0
- package/dist/targets/svelte/radix/slider.d.ts +6 -0
- package/dist/targets/svelte/radix/slider.js +8 -0
- package/dist/targets/svelte/radix/switch.d.ts +6 -0
- package/dist/targets/svelte/radix/switch.js +10 -0
- package/dist/targets/svelte/radix/tabs.d.ts +8 -0
- package/dist/targets/svelte/radix/tabs.js +15 -0
- package/dist/targets/svelte/radix/toggle-group.d.ts +9 -0
- package/dist/targets/svelte/radix/toggle-group.js +17 -0
- package/dist/targets/svelte/radix/toggle.d.ts +6 -0
- package/dist/targets/svelte/radix/toggle.js +9 -0
- package/dist/targets/svelte/radix/tooltip.d.ts +6 -0
- package/dist/targets/svelte/radix/tooltip.js +24 -0
- package/dist/targets/svelte/strip.d.ts +2 -0
- package/dist/targets/svelte/strip.js +5 -0
- package/dist/targets/vue/emit.d.ts +15 -0
- package/dist/targets/vue/emit.js +4092 -0
- package/dist/targets/vue/events.d.ts +11 -0
- package/dist/targets/vue/events.js +13 -0
- package/dist/targets/vue/module-builders.d.ts +28 -0
- package/dist/targets/vue/module-builders.js +258 -0
- package/dist/targets/vue/motion-layout.d.ts +19 -0
- package/dist/targets/vue/motion-layout.js +79 -0
- package/dist/targets/vue/motion.d.ts +12 -0
- package/dist/targets/vue/motion.js +46 -0
- package/dist/targets/vue/radix/accordion.d.ts +3 -0
- package/dist/targets/vue/radix/accordion.js +12 -0
- package/dist/targets/vue/radix/alert-dialog.d.ts +6 -0
- package/dist/targets/vue/radix/alert-dialog.js +18 -0
- package/dist/targets/vue/radix/aspect-ratio.d.ts +6 -0
- package/dist/targets/vue/radix/aspect-ratio.js +8 -0
- package/dist/targets/vue/radix/avatar.d.ts +3 -0
- package/dist/targets/vue/radix/avatar.js +7 -0
- package/dist/targets/vue/radix/checkbox.d.ts +3 -0
- package/dist/targets/vue/radix/checkbox.js +9 -0
- package/dist/targets/vue/radix/collapsible.d.ts +7 -0
- package/dist/targets/vue/radix/collapsible.js +11 -0
- package/dist/targets/vue/radix/context-menu.d.ts +3 -0
- package/dist/targets/vue/radix/context-menu.js +30 -0
- package/dist/targets/vue/radix/dialog.d.ts +3 -0
- package/dist/targets/vue/radix/dialog.js +12 -0
- package/dist/targets/vue/radix/direction.d.ts +7 -0
- package/dist/targets/vue/radix/direction.js +9 -0
- package/dist/targets/vue/radix/dropdown-menu.d.ts +3 -0
- package/dist/targets/vue/radix/dropdown-menu.js +29 -0
- package/dist/targets/vue/radix/hover-card.d.ts +3 -0
- package/dist/targets/vue/radix/hover-card.js +11 -0
- package/dist/targets/vue/radix/index.d.ts +65 -0
- package/dist/targets/vue/radix/index.js +225 -0
- package/dist/targets/vue/radix/label.d.ts +3 -0
- package/dist/targets/vue/radix/label.js +5 -0
- package/dist/targets/vue/radix/menubar.d.ts +6 -0
- package/dist/targets/vue/radix/menubar.js +29 -0
- package/dist/targets/vue/radix/navigation-menu.d.ts +6 -0
- package/dist/targets/vue/radix/navigation-menu.js +21 -0
- package/dist/targets/vue/radix/part.d.ts +41 -0
- package/dist/targets/vue/radix/part.js +46 -0
- package/dist/targets/vue/radix/popover.d.ts +3 -0
- package/dist/targets/vue/radix/popover.js +11 -0
- package/dist/targets/vue/radix/progress.d.ts +3 -0
- package/dist/targets/vue/radix/progress.js +6 -0
- package/dist/targets/vue/radix/radio-group.d.ts +3 -0
- package/dist/targets/vue/radix/radio-group.js +10 -0
- package/dist/targets/vue/radix/scroll-area.d.ts +3 -0
- package/dist/targets/vue/radix/scroll-area.js +11 -0
- package/dist/targets/vue/radix/select.d.ts +3 -0
- package/dist/targets/vue/radix/select.js +29 -0
- package/dist/targets/vue/radix/separator.d.ts +3 -0
- package/dist/targets/vue/radix/separator.js +5 -0
- package/dist/targets/vue/radix/slider.d.ts +3 -0
- package/dist/targets/vue/radix/slider.js +13 -0
- package/dist/targets/vue/radix/switch.d.ts +3 -0
- package/dist/targets/vue/radix/switch.js +9 -0
- package/dist/targets/vue/radix/tabs.d.ts +3 -0
- package/dist/targets/vue/radix/tabs.js +12 -0
- package/dist/targets/vue/radix/toggle-group.d.ts +3 -0
- package/dist/targets/vue/radix/toggle-group.js +10 -0
- package/dist/targets/vue/radix/toggle.d.ts +3 -0
- package/dist/targets/vue/radix/toggle.js +8 -0
- package/dist/targets/vue/radix/tooltip.d.ts +3 -0
- package/dist/targets/vue/radix/tooltip.js +14 -0
- package/dist/targets/vue/render-fn/h.d.ts +52 -0
- package/dist/targets/vue/render-fn/h.js +442 -0
- package/dist/targets/vue/render-fn.d.ts +21 -0
- package/dist/targets/vue/render-fn.js +357 -0
- package/dist/targets/vue/slot.d.ts +9 -0
- package/dist/targets/vue/slot.js +57 -0
- package/dist/typecheck/host.d.ts +45 -0
- package/dist/typecheck/host.js +309 -0
- package/dist/typecheck/index.d.ts +16 -0
- package/dist/typecheck/index.js +17 -0
- package/dist/typecheck/lucide.d.ts +8 -0
- package/dist/typecheck/lucide.js +45 -0
- package/dist/typecheck/sourcemap.d.ts +9 -0
- package/dist/typecheck/sourcemap.js +54 -0
- package/dist/typecheck/svelte.d.ts +9 -0
- package/dist/typecheck/svelte.js +116 -0
- package/dist/typecheck/vue.d.ts +8 -0
- package/dist/typecheck/vue.js +78 -0
- package/dist/types.d.ts +446 -0
- package/dist/types.js +11 -0
- package/dist/utils/cleanup.d.ts +32 -0
- package/dist/utils/cleanup.js +119 -0
- package/dist/utils/errors.d.ts +7 -0
- package/dist/utils/errors.js +15 -0
- package/dist/utils/fs-safe.d.ts +14 -0
- package/dist/utils/fs-safe.js +64 -0
- package/dist/validate.d.ts +16 -0
- package/dist/validate.js +204 -0
- package/dist/verify/auto-steps.d.ts +107 -0
- package/dist/verify/auto-steps.js +471 -0
- package/dist/verify/bundle.d.ts +68 -0
- package/dist/verify/bundle.js +548 -0
- package/dist/verify/diff.d.ts +31 -0
- package/dist/verify/diff.js +133 -0
- package/dist/verify/leaks.d.ts +25 -0
- package/dist/verify/leaks.js +261 -0
- package/dist/verify/link-worker.d.ts +1 -0
- package/dist/verify/link-worker.js +27 -0
- package/dist/verify/runner.d.ts +57 -0
- package/dist/verify/runner.js +867 -0
- package/dist/verify/sandbox.d.ts +40 -0
- package/dist/verify/sandbox.js +496 -0
- package/dist/verify/steps.d.ts +42 -0
- package/dist/verify/steps.js +475 -0
- package/dist/verify/verdict.d.ts +15 -0
- package/dist/verify/verdict.js +19 -0
- package/package.json +118 -4
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import * as t from '@babel/types';
|
|
2
|
+
import type { RadixPartMap } from '../../../ir/radix.js';
|
|
3
|
+
/**
|
|
4
|
+
* A Radix part on Angular. `@radix-ng/primitives` is directive-based: the directive sits on the element Radix renders
|
|
5
|
+
* (`<button rdxToggle>`), its inputs take Radix's props and its outputs Radix's callbacks. radix-ng is a port of Base UI,
|
|
6
|
+
* not of Radix: it sets Base UI's data attributes (`data-pressed`, `data-checked`, `data-open`) and never Radix's
|
|
7
|
+
* `data-state`, which shadcn's classes select on (`data-[state=on]:bg-accent`), so each part says how its `data-state`
|
|
8
|
+
* reads from the directive's public state, and the element is given it.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The value types a mapped prop or a callback's payload may have (a wrapper's new input is typed from it); `style` is
|
|
12
|
+
* React's style object (the emitter types a `style` input itself).
|
|
13
|
+
*/
|
|
14
|
+
export type NgValueType = 'boolean' | 'boolean | indeterminate' | 'string' | 'string[]' | 'string | string[]' | 'number' | 'number[]' | 'number | null' | 'style' | readonly string[];
|
|
15
|
+
/** A radix-ng directive: its class, the attribute that selects it, its `exportAs` and its entry point. */
|
|
16
|
+
export interface NgDirective {
|
|
17
|
+
/** the exported class (`RdxToggle`) */
|
|
18
|
+
name: string;
|
|
19
|
+
/** the attribute of its selector (`rdxToggle` for `[rdxToggle]`) */
|
|
20
|
+
attribute: string;
|
|
21
|
+
/** its `exportAs` (`rdxToggle`), so the template can read its state */
|
|
22
|
+
exportAs: string;
|
|
23
|
+
/** the package entry point that exports it (`@radix-ng/primitives/toggle`) */
|
|
24
|
+
from: string;
|
|
25
|
+
}
|
|
26
|
+
/** One Radix prop the part maps: the directive's input (or, for a plain part, an attribute computed from it). */
|
|
27
|
+
export interface NgProp {
|
|
28
|
+
/** the directive input it binds (its public name); absent on a plain part */
|
|
29
|
+
input?: string;
|
|
30
|
+
type: NgValueType;
|
|
31
|
+
/**
|
|
32
|
+
* Radix's value as the directive's input takes it, where the two differ in shape (ToggleGroup's single `value`, a
|
|
33
|
+
* string, is radix-ng's `controlledValue`, a list): the value given, and the literal value the element gives another
|
|
34
|
+
* prop (`literal('type')`: undefined when not given). Absent: the value as it is.
|
|
35
|
+
*/
|
|
36
|
+
adapt?: (value: t.Expression, ctx: NgAdaptContext) => t.Expression;
|
|
37
|
+
/** the prop must be written as a string literal (another prop's adapter reads it): a value is a radix-prop error */
|
|
38
|
+
literal?: boolean;
|
|
39
|
+
/** the directive of NgPartMap.also that takes the input (its class name); absent: the part's own directive */
|
|
40
|
+
on?: string;
|
|
41
|
+
/**
|
|
42
|
+
* A second input the same Radix prop feeds (Checkbox's `checked`, `boolean | 'indeterminate'`, is radix-ng's
|
|
43
|
+
* `controlledChecked` and `indeterminate`): its value from the prop's, or null where none is needed.
|
|
44
|
+
*/
|
|
45
|
+
extra?: {
|
|
46
|
+
input: string;
|
|
47
|
+
adapt: (value: t.Expression, ctx: NgAdaptContext) => t.Expression | null;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* An attribute the directive owns (it binds `[attr.aria-label]` from its input of that name, which would remove the
|
|
51
|
+
* element's own): bound as the input where the part's element or a host-form caller gives it, never a prop a wrapper
|
|
52
|
+
* declares for its rest props (those reach the element through the rest object, set after the directive's bindings).
|
|
53
|
+
*/
|
|
54
|
+
attribute?: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface NgPartMap extends RadixPartMap {
|
|
57
|
+
/** the element Radix renders for this part (`button`) */
|
|
58
|
+
tag: string;
|
|
59
|
+
/** the directive on it; null for a part written as Radix's own element (`plain`) */
|
|
60
|
+
directive: NgDirective | null;
|
|
61
|
+
/** Radix's props, by React name, with their directive input and value type */
|
|
62
|
+
inputs: Readonly<Record<string, NgProp>>;
|
|
63
|
+
/**
|
|
64
|
+
* Radix's callbacks, by React name: the directive's output and the type of the value Radix passes (checked equal to
|
|
65
|
+
* Radix's argument); `pick`: the output emits an event object and Radix's value is this member of it
|
|
66
|
+
* (`onCheckedChange` emits `{ checked, eventDetails }`).
|
|
67
|
+
*/
|
|
68
|
+
outputs: Readonly<Record<string, NgOutput>>;
|
|
69
|
+
/**
|
|
70
|
+
* The part's `state` reads another part's directive (`$` is it), the nearest element above it in the same template that
|
|
71
|
+
* renders that Radix part (Switch.Thumb reads its Root's `checkedState()`); on a plain part, `plainAttrs` reads that
|
|
72
|
+
* part's props (Progress.Indicator reads its Root's value and max).
|
|
73
|
+
*/
|
|
74
|
+
stateFrom?: string;
|
|
75
|
+
/**
|
|
76
|
+
* Radix's own attributes the element is given, each an expression in terms of `$` (the directive, by its exportAs:
|
|
77
|
+
* `$.pressed() ? 'on' : 'off'`) or, on a plain part, of the props (see `plainAttrs`).
|
|
78
|
+
*/
|
|
79
|
+
state?: Readonly<Record<string, string>>;
|
|
80
|
+
/**
|
|
81
|
+
* A plain part (no directive): Radix's attributes computed from the props it is given (`get(name)`: the expression the
|
|
82
|
+
* element gives that prop, or null), each null when Radix sets none. Written before the element's own attributes, so
|
|
83
|
+
* the element's own win, as Radix spreads them last.
|
|
84
|
+
*/
|
|
85
|
+
plainAttrs?: (get: (prop: string) => t.Expression | null, helper: (helper: NgHelper) => string) => Record<string, t.Expression>;
|
|
86
|
+
/**
|
|
87
|
+
* Attributes radix-ng sets that Radix does not (`data-pressed`): a class name of the module that reads one is said in a
|
|
88
|
+
* radix-data warning, as it would match on Angular only.
|
|
89
|
+
*/
|
|
90
|
+
extraAttributes?: readonly string[];
|
|
91
|
+
/**
|
|
92
|
+
* What radix-ng does differently when the element is given an `onClick` (its own, or a caller's through a wrapper's
|
|
93
|
+
* rest props): said as a radix-behaviour warning where one is given.
|
|
94
|
+
*/
|
|
95
|
+
clickDiffers?: string;
|
|
96
|
+
/** what radix-ng's part does differently wherever it is used: said as a radix-behaviour warning at the element */
|
|
97
|
+
differs?: string;
|
|
98
|
+
/**
|
|
99
|
+
* radix-ng's part finds this Radix part's directive through Angular's injector (ToggleGroup.Item finds its Root's
|
|
100
|
+
* `rdxToggleGroup`): it must sit inside that part's element in the same template, or inside the host element of a
|
|
101
|
+
* component whose root is that part in the host form (host-form.ts); anywhere else it would silently run on its own.
|
|
102
|
+
*/
|
|
103
|
+
within?: string;
|
|
104
|
+
/**
|
|
105
|
+
* radix-ng mounts the part only while it is shown, through a structural directive on an `<ng-template>` around it
|
|
106
|
+
* (`<ng-template rdxAccordionPanelPresence><div rdxAccordionPanel>`), as Radix's Presence mounts its content: the
|
|
107
|
+
* template's directive. Such a part is never a component's host.
|
|
108
|
+
*/
|
|
109
|
+
presence?: Omit<NgDirective, 'exportAs'>;
|
|
110
|
+
/**
|
|
111
|
+
* radix-ng splits the part into two elements, as Radix's popper does (Radix: a positioned wrapper `<div>` around the
|
|
112
|
+
* content): the outer element's directive, which takes the Radix props named in `inputs` (side, sideOffset, align),
|
|
113
|
+
* around the part's own element, which keeps the rest.
|
|
114
|
+
*/
|
|
115
|
+
outer?: {
|
|
116
|
+
tag: string;
|
|
117
|
+
directive: NgDirective;
|
|
118
|
+
inputs: Readonly<Record<string, NgProp>>;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Radix props of the part that are not converted, each with the measured reason: on the part's element they are a
|
|
122
|
+
* radix-prop error (they are in no map); given to a component whose rest props reach the part, the same error where
|
|
123
|
+
* the caller gives them.
|
|
124
|
+
*/
|
|
125
|
+
refusedProps?: Readonly<Record<string, string>>;
|
|
126
|
+
/**
|
|
127
|
+
* More radix-ng directives on the same element (Checkbox: `rdxCheckboxRoot` holds the state and `rdxCheckboxButton`
|
|
128
|
+
* makes the element Radix's button, role="checkbox"): written beside the part's own, or as more host directives.
|
|
129
|
+
*/
|
|
130
|
+
also?: readonly NgDirective[];
|
|
131
|
+
/**
|
|
132
|
+
* The part converts only as the root of a component in the host form (its directive has no exportAs, so a template
|
|
133
|
+
* cannot read its state; the host-form class injects it): anywhere else a radix-prop error.
|
|
134
|
+
*/
|
|
135
|
+
hostOnly?: string;
|
|
136
|
+
/**
|
|
137
|
+
* The part only provides a value to the parts below it through the injector (Direction's Provider): children a
|
|
138
|
+
* component projects into it would not see it, so there it is refused.
|
|
139
|
+
*/
|
|
140
|
+
providesToChildren?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* What radix-ng's part does differently for the props an element gives it (`type`, `orientation`, `collapsible`):
|
|
143
|
+
* said as radix-behaviour warnings where the part is written (its element, or where a caller writes a host-form
|
|
144
|
+
* component that is it).
|
|
145
|
+
*/
|
|
146
|
+
differencesAt?: (ctx: NgWrittenContext) => string[];
|
|
147
|
+
/** Radix props radix-ng has no input for, each with why leaving it out is exact (said otherwise by differencesAt) */
|
|
148
|
+
drops?: Readonly<Record<string, string>>;
|
|
149
|
+
/**
|
|
150
|
+
* A plain part Radix renders inside an element of its own (AspectRatio: a sizing `<div>` around the part's): the outer
|
|
151
|
+
* element's tag, attributes and style, from the part's props (`get`); the part's element keeps the rest, its style
|
|
152
|
+
* given by `innerStyle` from the style it is given (null: none).
|
|
153
|
+
*/
|
|
154
|
+
wrapper?: {
|
|
155
|
+
tag: string;
|
|
156
|
+
attrs: Record<string, string>;
|
|
157
|
+
style: (get: (prop: string) => t.Expression | null) => t.Expression;
|
|
158
|
+
innerStyle: (style: t.Expression | null) => t.Expression;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* A module function a plain part's attributes call (Radix's own computation, written once per file that needs it):
|
|
163
|
+
* `helper(...)` in plainAttrs declares it in the module and returns its local name.
|
|
164
|
+
*/
|
|
165
|
+
export interface NgHelper {
|
|
166
|
+
/** the name it takes when the module has no binding of that name */
|
|
167
|
+
name: string;
|
|
168
|
+
/** its source, given its local name */
|
|
169
|
+
source: (name: string) => string;
|
|
170
|
+
}
|
|
171
|
+
/** A Radix callback as a directive output (see NgPartMap.outputs). */
|
|
172
|
+
export interface NgOutput {
|
|
173
|
+
output: string;
|
|
174
|
+
payload: NgValueType;
|
|
175
|
+
pick?: string;
|
|
176
|
+
/**
|
|
177
|
+
* Radix's argument read from the output's event, where it depends on another prop's literal value (ToggleGroup:
|
|
178
|
+
* `$event.value` for type="multiple", `$event.value[0] ?? ''` for type="single"): template code for `$event`.
|
|
179
|
+
*/
|
|
180
|
+
event?: (ctx: NgAdaptContext) => string;
|
|
181
|
+
/** with `event`: the type of what the output emits (its `pick` member, when given), which `event` turns into `payload` */
|
|
182
|
+
emits?: NgValueType;
|
|
183
|
+
/**
|
|
184
|
+
* The Radix prop that makes the part controlled (`open`): where an element gives it, radix-ng's own write is undone by
|
|
185
|
+
* `cancel` (template code, after the handler, or alone where no handler is given), so the part shows the parent's
|
|
186
|
+
* value only, as Radix's controlled part does.
|
|
187
|
+
*/
|
|
188
|
+
controlledBy?: string;
|
|
189
|
+
cancel?: string;
|
|
190
|
+
}
|
|
191
|
+
/** What a part's differences may ask about the props an element gives it. */
|
|
192
|
+
export interface NgWrittenContext {
|
|
193
|
+
/** the string literal given for a prop; undefined when none */
|
|
194
|
+
literal(prop: string): string | undefined;
|
|
195
|
+
/** whether a prop is given */
|
|
196
|
+
given(prop: string): boolean;
|
|
197
|
+
/** whether a prop is given as true (`collapsible`, `collapsible={true}`) */
|
|
198
|
+
isTrue(prop: string): boolean;
|
|
199
|
+
}
|
|
200
|
+
/** What an adapter may ask about the element it adapts a value for. */
|
|
201
|
+
export interface NgAdaptContext {
|
|
202
|
+
/** the string literal the element gives a prop; undefined when it gives none */
|
|
203
|
+
literal(prop: string): string | undefined;
|
|
204
|
+
/** whether a value may be undefined by React's types (true when they do not say) */
|
|
205
|
+
mayBeUndefined(e: t.Expression): boolean;
|
|
206
|
+
/** whether a value may be the given string by React's types (true when they do not say) */
|
|
207
|
+
mayBeText(e: t.Expression, text: string): boolean;
|
|
208
|
+
}
|
|
209
|
+
/** One package's parts, by Radix part name. */
|
|
210
|
+
export type NgPackageMap = Readonly<Record<string, NgPartMap>>;
|
|
211
|
+
/** A part carried by a radix-ng directive. `asChild` is not mapped (see index.ts). */
|
|
212
|
+
export declare function ngPart(tag: string, directive: NgDirective, options?: {
|
|
213
|
+
inputs?: Record<string, NgProp>;
|
|
214
|
+
outputs?: Record<string, NgOutput>;
|
|
215
|
+
state?: Record<string, string>;
|
|
216
|
+
stateFrom?: string;
|
|
217
|
+
extraAttributes?: string[];
|
|
218
|
+
clickDiffers?: string;
|
|
219
|
+
differs?: string;
|
|
220
|
+
within?: string;
|
|
221
|
+
presence?: Omit<NgDirective, 'exportAs'>;
|
|
222
|
+
differencesAt?: NgPartMap['differencesAt'];
|
|
223
|
+
drops?: Record<string, string>;
|
|
224
|
+
also?: NgDirective[];
|
|
225
|
+
hostOnly?: string;
|
|
226
|
+
providesToChildren?: boolean;
|
|
227
|
+
outer?: NgPartMap['outer'];
|
|
228
|
+
refusedProps?: Record<string, string>;
|
|
229
|
+
}): NgPartMap;
|
|
230
|
+
/** A part written as the element Radix renders, its attributes computed from its props (no radix-ng directive). */
|
|
231
|
+
export declare function plainPart(tag: string, inputs: Record<string, NgValueType>, plainAttrs: NgPartMap['plainAttrs'], extra?: {
|
|
232
|
+
stateFrom?: string;
|
|
233
|
+
wrapper?: NgPartMap['wrapper'];
|
|
234
|
+
}): NgPartMap;
|
|
235
|
+
/** The TypeScript type of a mapped value; null for a style object (typed by the emitter as React's style). */
|
|
236
|
+
export declare function ngType(type: NgValueType): t.TSType | null;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as t from '@babel/types';
|
|
2
|
+
/** A part carried by a radix-ng directive. `asChild` is not mapped (see index.ts). */
|
|
3
|
+
export function ngPart(tag, directive, options = {}) {
|
|
4
|
+
const inputs = options.inputs ?? {};
|
|
5
|
+
const outputs = options.outputs ?? {};
|
|
6
|
+
return {
|
|
7
|
+
from: directive.from,
|
|
8
|
+
name: directive.name,
|
|
9
|
+
props: { ...Object.fromEntries([...Object.keys(inputs), ...Object.keys(options.outer?.inputs ?? {})].map((k) => [k, k])), ...Object.fromEntries(Object.entries(options.drops ?? {}).map(([k, why]) => [k, { drop: true, why }])) },
|
|
10
|
+
events: Object.fromEntries(Object.entries(outputs).map(([k, v]) => [k, v.output])),
|
|
11
|
+
element: true,
|
|
12
|
+
tag,
|
|
13
|
+
directive,
|
|
14
|
+
inputs,
|
|
15
|
+
outputs,
|
|
16
|
+
...(options.state ? { state: options.state } : {}),
|
|
17
|
+
...(options.stateFrom ? { stateFrom: options.stateFrom } : {}),
|
|
18
|
+
...(options.extraAttributes ? { extraAttributes: options.extraAttributes } : {}),
|
|
19
|
+
...(options.clickDiffers ? { clickDiffers: options.clickDiffers } : {}),
|
|
20
|
+
...(options.differs ? { differs: options.differs } : {}),
|
|
21
|
+
...(options.within ? { within: options.within } : {}),
|
|
22
|
+
...(options.presence ? { presence: options.presence } : {}),
|
|
23
|
+
...(options.differencesAt ? { differencesAt: options.differencesAt } : {}),
|
|
24
|
+
...(options.drops ? { drops: options.drops } : {}),
|
|
25
|
+
...(options.also ? { also: options.also } : {}),
|
|
26
|
+
...(options.hostOnly ? { hostOnly: options.hostOnly } : {}),
|
|
27
|
+
...(options.providesToChildren ? { providesToChildren: true } : {}),
|
|
28
|
+
...(options.outer ? { outer: options.outer } : {}),
|
|
29
|
+
...(options.refusedProps ? { refusedProps: options.refusedProps } : {}),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** A part written as the element Radix renders, its attributes computed from its props (no radix-ng directive). */
|
|
33
|
+
export function plainPart(tag, inputs, plainAttrs, extra = {}) {
|
|
34
|
+
return {
|
|
35
|
+
...(extra.stateFrom ? { stateFrom: extra.stateFrom } : {}),
|
|
36
|
+
...(extra.wrapper ? { wrapper: extra.wrapper } : {}),
|
|
37
|
+
from: 'html',
|
|
38
|
+
name: tag,
|
|
39
|
+
props: Object.fromEntries(Object.keys(inputs).map((k) => [k, k])),
|
|
40
|
+
events: {},
|
|
41
|
+
element: true,
|
|
42
|
+
tag,
|
|
43
|
+
directive: null,
|
|
44
|
+
inputs: Object.fromEntries(Object.entries(inputs).map(([k, type]) => [k, { type }])),
|
|
45
|
+
outputs: {},
|
|
46
|
+
...(plainAttrs ? { plainAttrs } : {}),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** The TypeScript type of a mapped value; null for a style object (typed by the emitter as React's style). */
|
|
50
|
+
export function ngType(type) {
|
|
51
|
+
if (type === 'style')
|
|
52
|
+
return null;
|
|
53
|
+
if (type === 'boolean')
|
|
54
|
+
return t.tsBooleanKeyword();
|
|
55
|
+
if (type === 'boolean | indeterminate')
|
|
56
|
+
return t.tsUnionType([t.tsBooleanKeyword(), t.tsLiteralType(t.stringLiteral('indeterminate'))]);
|
|
57
|
+
if (type === 'string')
|
|
58
|
+
return t.tsStringKeyword();
|
|
59
|
+
if (type === 'number')
|
|
60
|
+
return t.tsNumberKeyword();
|
|
61
|
+
// (M3: the slider core's values)
|
|
62
|
+
if (type === 'number[]')
|
|
63
|
+
return t.tsArrayType(t.tsNumberKeyword());
|
|
64
|
+
if (type === 'number | null')
|
|
65
|
+
return t.tsUnionType([t.tsNumberKeyword(), t.tsNullKeyword()]);
|
|
66
|
+
if (type === 'string[]')
|
|
67
|
+
return t.tsArrayType(t.tsStringKeyword());
|
|
68
|
+
if (type === 'string | string[]')
|
|
69
|
+
return t.tsUnionType([t.tsStringKeyword(), t.tsArrayType(t.tsStringKeyword())]);
|
|
70
|
+
return t.tsUnionType(type.map((v) => t.tsLiteralType(t.stringLiteral(v))));
|
|
71
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { Diagnostic } from '../../../types.js';
|
|
2
|
+
import type { AttrNode, ComponentIR, ElementNode, ModuleIR } from '../../../ir/model.js';
|
|
3
|
+
import { type NgDirective, type NgPartMap, type NgWrittenContext } from './part.js';
|
|
4
|
+
/** A claimed Radix element on Angular and the part it renders (read by the template printer, see template.ts). */
|
|
5
|
+
export interface NgPlan {
|
|
6
|
+
map: NgPartMap;
|
|
7
|
+
pkg: string;
|
|
8
|
+
part: string;
|
|
9
|
+
/** Radix's callbacks given to the part (the directive's outputs), taken out of the element's attributes */
|
|
10
|
+
events: AttrNode[];
|
|
11
|
+
/** the attributes the directive takes as inputs, taken out of the element's at its first print */
|
|
12
|
+
taken?: AttrNode[];
|
|
13
|
+
/** the template reference to the directive, once printed */
|
|
14
|
+
ref?: string;
|
|
15
|
+
/** NgPartMap.stateFrom: the element above it, in the same template, whose directive its state reads */
|
|
16
|
+
ancestor?: ElementNode;
|
|
17
|
+
/**
|
|
18
|
+
* H6: the element is its component's root in the host form (host-form.ts): the directive sits on the component's host
|
|
19
|
+
* through `hostDirectives`, its inputs and outputs are bound by the caller, and the template prints only the reference
|
|
20
|
+
* to it and Radix's state read from it, which become the class's injected directive and host bindings.
|
|
21
|
+
*/
|
|
22
|
+
host?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* H6: the directive the part's state reads (NgPartMap.stateFrom) is not in this template: the component injects it
|
|
25
|
+
* (its host sits inside that part's element where its callers write it), under `inject`, named at the first print.
|
|
26
|
+
*/
|
|
27
|
+
injectState?: NgDirective;
|
|
28
|
+
inject?: string;
|
|
29
|
+
/** the first element of the component that injects the same directive: they share its member */
|
|
30
|
+
injectOwner?: ElementNode;
|
|
31
|
+
}
|
|
32
|
+
/** M3: the DOM event a React handler prop listens to (`onClick` → `click`, `onDoubleClick` → `dblclick`), its capture suffix aside. */
|
|
33
|
+
export declare function domEventName(react: string): string;
|
|
34
|
+
/** Each claimed Radix element of the conversion, by node (set by prepareAngularRadix). */
|
|
35
|
+
export declare const NG_PLANS: WeakMap<ElementNode, NgPlan>;
|
|
36
|
+
/**
|
|
37
|
+
* H6: a Radix part a component's markup holds that radix-ng finds (or reads the state of) through the injector, outside
|
|
38
|
+
* the component's own template: every caller must write the component inside an element of that part, or inside a
|
|
39
|
+
* component in the host form that is one (checked where each caller writes it: radixNeedsAt in host-form.ts).
|
|
40
|
+
*/
|
|
41
|
+
export interface RadixNeed {
|
|
42
|
+
pkg: string;
|
|
43
|
+
part: string;
|
|
44
|
+
/** the element that needs it, for the message */
|
|
45
|
+
by: string;
|
|
46
|
+
/** its radix-ng directive's class */
|
|
47
|
+
directive: string;
|
|
48
|
+
}
|
|
49
|
+
/** The map of the Radix part a component's rest props reach (see REST_PARTS), if any. */
|
|
50
|
+
export declare function radixRestMapOf(comp: ComponentIR | null | undefined): NgPartMap | undefined;
|
|
51
|
+
/** The Radix part a component's rest props reach in its own template (see REST_PARTS), if any. */
|
|
52
|
+
export declare function radixRestPartOf(comp: ComponentIR | null | undefined): string | undefined;
|
|
53
|
+
/** What a component's callers must place it inside (see RadixNeed). */
|
|
54
|
+
export declare function radixNeedsOf(comp: ComponentIR | null | undefined): readonly RadixNeed[];
|
|
55
|
+
/** What a part's differences read from the attributes an element gives it (NgPartMap.differencesAt). */
|
|
56
|
+
export declare function writtenContext(attrs: readonly AttrNode[]): NgWrittenContext;
|
|
57
|
+
/**
|
|
58
|
+
* Prepares the claimed Radix parts of one module for the Angular emitter, before any module is emitted (a parent in
|
|
59
|
+
* another file reads this module's components as they are now). Each claimed element becomes the element Radix renders
|
|
60
|
+
* (`<TogglePrimitive.Root>` → `<button>`): a plain part gets Radix's attributes computed from its props; a directive
|
|
61
|
+
* part is printed with its directive by the template (template.ts). A component that takes the part's props as its own
|
|
62
|
+
* and spreads its rest onto the part (shadcn's `{ className, ...props }: React.ComponentProps<typeof
|
|
63
|
+
* TogglePrimitive.Root>`) takes each mapped Radix prop and callback as a prop of its own, passed on to the part, and its
|
|
64
|
+
* other rest props as the element's attributes (the HTML rest props of `<button {...props}>`).
|
|
65
|
+
*/
|
|
66
|
+
export declare function prepareAngularRadix(mod: ModuleIR, packages: ReadonlySet<string>, diagnostics: Diagnostic[]): void;
|