@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,172 @@
|
|
|
1
|
+
import * as t from '@babel/types';
|
|
2
|
+
import { escapeAttr } from '../../shared/markup.js';
|
|
3
|
+
import { NG_RADIX } from './packages.js';
|
|
4
|
+
import { NG_PLANS } from './prepare.js';
|
|
5
|
+
/**
|
|
6
|
+
* The bindings of a claimed Radix element that carries a radix-ng directive (prepare.ts): the directive's attribute,
|
|
7
|
+
* Radix's props as its inputs, Radix's callbacks as its outputs, and Radix's own attributes read from the directive
|
|
8
|
+
* (`#toggle="rdxToggle" [attr.data-state]="toggle.pressed() ? 'on' : 'off'"`). The attributes it takes leave the
|
|
9
|
+
* element's, which the printer writes as for any element. Null for any other element.
|
|
10
|
+
*/
|
|
11
|
+
export function angularRadixBindings(n, p) {
|
|
12
|
+
const plan = NG_PLANS.get(n);
|
|
13
|
+
const directive = plan?.map.directive;
|
|
14
|
+
if (!plan || !directive)
|
|
15
|
+
return null;
|
|
16
|
+
const { map } = plan;
|
|
17
|
+
if (!plan.taken) {
|
|
18
|
+
const taken = [];
|
|
19
|
+
const kept = [];
|
|
20
|
+
for (const a of n.attrs) {
|
|
21
|
+
const radixProp = (a.kind === 'static' || a.kind === 'expr' || a.kind === 'bool') && Object.hasOwn(map.inputs, a.name);
|
|
22
|
+
const radixEvent = a.kind === 'event' && Object.hasOwn(map.outputs, a.react);
|
|
23
|
+
(radixProp || radixEvent ? taken : kept).push(a);
|
|
24
|
+
}
|
|
25
|
+
plan.taken = taken;
|
|
26
|
+
n.attrs = kept;
|
|
27
|
+
}
|
|
28
|
+
// (H6, host form: the directive is the class's host directive, bound by the caller; see host-form.ts)
|
|
29
|
+
const directives = [directive, ...(map.also ?? [])];
|
|
30
|
+
if (!plan.host)
|
|
31
|
+
for (const d of directives)
|
|
32
|
+
p.use(d.name);
|
|
33
|
+
const out = plan.host ? [] : directives.map((d) => d.attribute);
|
|
34
|
+
if (!plan.host)
|
|
35
|
+
out.push(...radixInputsAndOutputs(map, [...plan.taken, ...plan.events], p));
|
|
36
|
+
if (map.state) {
|
|
37
|
+
// the directive the state reads: this element's, or (stateFrom) the part's above it, already printed, or (H6) the
|
|
38
|
+
// part's its component's callers place it in, which the component injects (see injectedDirectives)
|
|
39
|
+
let ref = plan.ancestor ? NG_PLANS.get(plan.ancestor)?.ref : undefined;
|
|
40
|
+
if (plan.injectState) {
|
|
41
|
+
// (one member per directive: the first element that injects it names it)
|
|
42
|
+
const owner = (plan.injectOwner ? NG_PLANS.get(plan.injectOwner) : undefined) ?? plan;
|
|
43
|
+
ref = plan.inject ?? owner.inject ?? p.name(memberOf(plan.injectState.name));
|
|
44
|
+
owner.inject = ref;
|
|
45
|
+
plan.inject = ref;
|
|
46
|
+
}
|
|
47
|
+
else if (!map.stateFrom) {
|
|
48
|
+
// (a directive with no exportAs is named only in the host form, where the class injects it: NgPartMap.hostOnly)
|
|
49
|
+
ref = plan.ref ?? p.name(directive.exportAs ? directive.exportAs.replace(/^rdx/, '').replace(/^\w/, (c) => c.toLowerCase()) : memberOf(directive.name));
|
|
50
|
+
plan.ref = ref;
|
|
51
|
+
out.push(`#${ref}="${directive.exportAs}"`);
|
|
52
|
+
}
|
|
53
|
+
// (a key `style.--x` is a style property; any other an attribute)
|
|
54
|
+
if (ref)
|
|
55
|
+
for (const [attr, src] of Object.entries(map.state))
|
|
56
|
+
out.push(`[${attr.startsWith('style.') ? attr : `attr.${attr}`}]="${escapeAttr(src.replace(/\$/g, ref))}"`);
|
|
57
|
+
}
|
|
58
|
+
return out;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Radix's props and callbacks given to a part, as its directive's input and output bindings: each value through the
|
|
62
|
+
* map's adapter where radix-ng's shape differs (`[controlledValue]="align() ? [align()] : []"`), each callback reading
|
|
63
|
+
* Radix's argument from the output's event (`$event.checked`, `($event.value[0] ?? '')`). The element's other
|
|
64
|
+
* attributes are not printed here. Used on a part's element and, for a component in the host form, where a caller
|
|
65
|
+
* writes the component's host element (host-form.ts).
|
|
66
|
+
*/
|
|
67
|
+
export function radixInputsAndOutputs(map, attrs, p) {
|
|
68
|
+
const ctx = {
|
|
69
|
+
literal: (prop) => {
|
|
70
|
+
const a = attrs.find((x) => x.kind === 'static' && x.name === prop);
|
|
71
|
+
return a?.kind === 'static' ? a.value : undefined;
|
|
72
|
+
},
|
|
73
|
+
mayBeUndefined: (e) => p.mayBeUndefined?.(e) ?? true,
|
|
74
|
+
mayBeText: (e, text) => p.mayBeText?.(e, text) ?? true,
|
|
75
|
+
};
|
|
76
|
+
const out = [];
|
|
77
|
+
const gives = (prop) => attrs.some((x) => (x.kind === 'static' || x.kind === 'expr' || x.kind === 'bool') && x.name === prop);
|
|
78
|
+
// a controlled part given no handler: radix-ng's own write is still undone (NgOutput.controlledBy)
|
|
79
|
+
for (const [react, output] of Object.entries(map.outputs)) {
|
|
80
|
+
if (output.controlledBy && output.cancel && gives(output.controlledBy) && !attrs.some((x) => x.kind === 'event' && x.react === react))
|
|
81
|
+
out.push(`(${output.output})="${escapeAttr(output.cancel)}"`);
|
|
82
|
+
}
|
|
83
|
+
for (const a of attrs) {
|
|
84
|
+
if (a.kind === 'event') {
|
|
85
|
+
const output = map.outputs[a.react];
|
|
86
|
+
if (!output)
|
|
87
|
+
continue;
|
|
88
|
+
// an output that emits an event object: Radix's value is a member of it
|
|
89
|
+
const statement = p.handler(a.handler, output.output);
|
|
90
|
+
const event = output.event ? output.event(ctx) : output.pick ? `$event.${output.pick}` : null;
|
|
91
|
+
// (an event read that is a call's whole argument loses its own parentheses: `align.set($event.value[0] ?? '')`)
|
|
92
|
+
const bare = event?.replace(/^\((.*)\)$/, '$1');
|
|
93
|
+
const adapted = event && bare !== undefined ? statement.replace(/\(\$event\)|\$event\b/g, (found) => (found === '($event)' ? `(${bare})` : event)) : statement;
|
|
94
|
+
// a controlled part: radix-ng's own write is undone after the handler (NgOutput.controlledBy)
|
|
95
|
+
const cancel = output.controlledBy && output.cancel && gives(output.controlledBy) ? `; ${output.cancel}` : '';
|
|
96
|
+
out.push(`(${output.output})="${escapeAttr(adapted + cancel)}"`);
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
if (a.kind !== 'static' && a.kind !== 'expr' && a.kind !== 'bool')
|
|
100
|
+
continue;
|
|
101
|
+
const prop = Object.hasOwn(map.inputs, a.name) ? map.inputs[a.name] : undefined;
|
|
102
|
+
const input = prop?.input;
|
|
103
|
+
if (!prop || !input)
|
|
104
|
+
continue;
|
|
105
|
+
// an attribute the directive owns, written as text: the attribute, which sets the input of its name
|
|
106
|
+
if (prop.attribute && a.kind === 'static' && input === a.name && !prop.adapt) {
|
|
107
|
+
out.push(`${input}="${escapeAttr(a.value)}"`);
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
const given = a.kind === 'static' ? t.stringLiteral(a.value) : a.kind === 'bool' ? t.booleanLiteral(true) : a.expr;
|
|
111
|
+
const value = prop.adapt ? prop.adapt(given, ctx) : given;
|
|
112
|
+
out.push(`[${input}]="${escapeAttr(p.expr(value, input))}"`);
|
|
113
|
+
// (a second input the same prop feeds: NgProp.extra)
|
|
114
|
+
const extra = prop.extra?.adapt(given, ctx);
|
|
115
|
+
if (prop.extra && extra)
|
|
116
|
+
out.push(`[${prop.extra.input}]="${escapeAttr(p.expr(extra, prop.extra.input))}"`);
|
|
117
|
+
}
|
|
118
|
+
return out;
|
|
119
|
+
}
|
|
120
|
+
/** The radix-ng directives the given class names of a file name (`RdxToggle`), each with the entry point it comes from. */
|
|
121
|
+
export function angularRadixImports(uses) {
|
|
122
|
+
const wanted = new Set(uses);
|
|
123
|
+
const out = new Map();
|
|
124
|
+
for (const parts of Object.values(NG_RADIX)) {
|
|
125
|
+
for (const part of Object.values(parts)) {
|
|
126
|
+
if (part.directive && wanted.has(part.directive.name))
|
|
127
|
+
out.set(part.directive.name, part.directive.from);
|
|
128
|
+
// (H6: the structural directive that mounts a part, NgPartMap.presence)
|
|
129
|
+
if (part.presence && wanted.has(part.presence.name))
|
|
130
|
+
out.set(part.presence.name, part.presence.from);
|
|
131
|
+
// (and the more directives on the same element, NgPartMap.also)
|
|
132
|
+
for (const d of part.also ?? [])
|
|
133
|
+
if (wanted.has(d.name))
|
|
134
|
+
out.set(d.name, d.from);
|
|
135
|
+
// (the outer element's, NgPartMap.outer)
|
|
136
|
+
if (part.outer && wanted.has(part.outer.directive.name))
|
|
137
|
+
out.set(part.outer.directive.name, part.outer.directive.from);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return [...out];
|
|
141
|
+
}
|
|
142
|
+
/** A member name for an injected directive (`RdxAccordionItemDirective` → `accordionItem`). */
|
|
143
|
+
function memberOf(name) {
|
|
144
|
+
return name.replace(/^Rdx/, '').replace(/Directive$/, '').replace(/^\w/, (c) => c.toLowerCase());
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* H6: the directives a component's markup reads the state of through the injector (NgPlan.injectState), each as the
|
|
148
|
+
* member its template names: `protected readonly accordionItem = inject(RdxAccordionItemDirective);`. Read after the
|
|
149
|
+
* template is printed.
|
|
150
|
+
*/
|
|
151
|
+
export function injectedDirectives(roots) {
|
|
152
|
+
const out = new Map();
|
|
153
|
+
const walk = (n) => {
|
|
154
|
+
if (n.type === 'element') {
|
|
155
|
+
const plan = NG_PLANS.get(n);
|
|
156
|
+
if (plan?.inject && plan.injectState)
|
|
157
|
+
out.set(plan.inject, plan.injectState.name);
|
|
158
|
+
for (const a of n.attrs)
|
|
159
|
+
if (a.kind === 'slotProp')
|
|
160
|
+
a.children.forEach(walk);
|
|
161
|
+
n.children.forEach(walk);
|
|
162
|
+
}
|
|
163
|
+
else if (n.type === 'if')
|
|
164
|
+
n.branches.forEach((b) => b.children.forEach(walk));
|
|
165
|
+
else if (n.type === 'slot')
|
|
166
|
+
n.fallback.forEach(walk);
|
|
167
|
+
else if (n.type === 'for' || n.type === 'fragment' || n.type === 'keyed' || n.type === 'presence')
|
|
168
|
+
n.children.forEach(walk);
|
|
169
|
+
};
|
|
170
|
+
roots.forEach(walk);
|
|
171
|
+
return [...out].map(([member, directive]) => ({ member, directive }));
|
|
172
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as t from '@babel/types';
|
|
2
|
+
import type { ComponentIR, FunctionIR, ScriptItem } from '../../ir/model.js';
|
|
3
|
+
/** Helper code written into an Angular file (it may hold decorators), as statements. */
|
|
4
|
+
export declare function helperStatements(code: string): t.Statement[];
|
|
5
|
+
/**
|
|
6
|
+
* React's `ref` attribute in Angular. A ref the component made with `useRef` and puts on one of its own elements is a
|
|
7
|
+
* `viewChild()` query (see emit.ts). Every other ref an element takes (a callback ref, a ref a hook or a parent handed
|
|
8
|
+
* over, a function that builds one) goes through one small directive, `[bindRef]`, which does what React does with
|
|
9
|
+
* it: the element is handed to the callback, or written into the `{ current }` box, once it is in the view, and null is
|
|
10
|
+
* handed over when it leaves the view (or when the binding changes to another target, which then gets the element).
|
|
11
|
+
*/
|
|
12
|
+
/** The directive's class name, as a component's `imports` list it. */
|
|
13
|
+
export declare const BIND_REF = "BindRef";
|
|
14
|
+
/** The directive's file, written once per conversion and imported by every component that binds a ref this way. */
|
|
15
|
+
export declare const BIND_REF_FILE = "import { Directive, effect, ElementRef, inject, input, untracked } from '@angular/core';\n\n/**\n * React's `ref`: the element (or, on a component, the instance given as `bindRefTo`, whose members are the handle React\n * code calls) goes to a callback or into a `{ current }` box once it is in the view; when it leaves (or the binding\n * changes) the callback's cleanup runs, or the callback gets null, or the box is emptied.\n */\n@Directive({ selector: '[bindRef]' })\nexport class BindRef<T> {\n readonly bindRef = input.required<((value: T | null) => void | (() => void)) | { current: T | null } | null | undefined>();\n readonly bindRefTo = input<T>();\n private readonly element = inject<ElementRef<T>>(ElementRef).nativeElement;\n\n constructor() {\n effect((onCleanup) => {\n const target = this.bindRef();\n const value = this.bindRefTo() ?? this.element;\n if (typeof target === 'function') {\n const cleanup = untracked(() => target(value));\n onCleanup(() => (typeof cleanup === 'function' ? cleanup() : target(null)));\n } else if (target) {\n target.current = value;\n onCleanup(() => {\n target.current = null;\n });\n }\n });\n }\n}";
|
|
16
|
+
/**
|
|
17
|
+
* A ref value with a constant choice in it (`true ? glowRef : lineRef`, left by inlining a component whose prop was a
|
|
18
|
+
* literal) as the branch it takes; anything else as it is.
|
|
19
|
+
*/
|
|
20
|
+
export declare function foldRef(e: t.Expression): t.Expression;
|
|
21
|
+
/**
|
|
22
|
+
* The name for a callback ref lifted into the class: from the box it fills (`el => { items.current[k] = el }` →
|
|
23
|
+
* `itemsRef`), else from the element (`buttonRef`).
|
|
24
|
+
*/
|
|
25
|
+
export declare function refCallbackName(fn: t.Function, tag: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Whether a value is only tested or read through where it stands (`ref.current?.focus()`, `if (ref.current)`,
|
|
28
|
+
* `!ref.current`), so undefined and null read the same.
|
|
29
|
+
*/
|
|
30
|
+
export declare function readThrough(n: t.Node, parent: t.Node | null): boolean;
|
|
31
|
+
/** Whether an expression reads a binding of the function. */
|
|
32
|
+
export declare function readsBinding(e: t.Node, name: string, ir: FunctionIR): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* A callback ref without the statements that hand the element to the forwarded ref (`if (typeof ref === 'function')
|
|
35
|
+
* ref(node); else if (ref) ref.current = node;`), or null when it has none or reads the forwarded ref elsewhere.
|
|
36
|
+
*/
|
|
37
|
+
export declare function withoutForwarding(fn: t.ArrowFunctionExpression | t.FunctionExpression, forwardRef: string, refs: WeakMap<t.Node, string>): t.ArrowFunctionExpression | null;
|
|
38
|
+
/** `ref={setRoot}` attributes whose callback handed the element to the forwarded ref (see forwardingCallbacks). */
|
|
39
|
+
export declare const FORWARDING_REFS: WeakSet<t.Node>;
|
|
40
|
+
/**
|
|
41
|
+
* A component callback (`const setRoot = useCallback((node) => { rootRef.current = node; if (typeof ref === 'function')
|
|
42
|
+
* ref(node); else if (ref) ref.current = node; }, [ref])`) that is read only as one element's `ref`: the element is the
|
|
43
|
+
* public `el` query, as an inline callback's is, and the callback keeps the rest. Its `ref` attribute goes in
|
|
44
|
+
* FORWARDING_REFS.
|
|
45
|
+
*/
|
|
46
|
+
export declare function forwardingCallbacks(comp: ComponentIR): void;
|
|
47
|
+
/**
|
|
48
|
+
* Whether code that runs when the class is built (a hook call, a render statement, a field's value) reads a binding.
|
|
49
|
+
* `except`: readers that do not count (code moved to ngOnInit with it).
|
|
50
|
+
*/
|
|
51
|
+
export declare function readAtSetup(name: string, ir: FunctionIR, except?: (item: ScriptItem) => boolean): boolean;
|
|
52
|
+
/** The value type of a `{ current }` box type (`RefObject<T>` as TypeScript saw it), or null. */
|
|
53
|
+
export declare function boxValueType(mapped: t.TSType | null): t.TSType | null;
|
|
54
|
+
/** A function the component calls, as far as the escape check needs it: its parameters and its code. */
|
|
55
|
+
export interface CalleeCode {
|
|
56
|
+
params: t.Node[];
|
|
57
|
+
body: t.Node[];
|
|
58
|
+
/** the functions the callee's own module can call by name (its own and its imports), when known */
|
|
59
|
+
callee?: (name: string) => CalleeCode | null;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Whether an element ref passed on whole (`useOnScreen(wrapRef)`, `useThing({ ref: rootRef })`) only goes where it is
|
|
63
|
+
* read: every place it escapes to is an argument (as it is, or passed live as `() => ref`) of a function this conversion
|
|
64
|
+
* has the code of, which never writes the parameter's `.current` and hands it on only to functions that do the same
|
|
65
|
+
* (see onlyReads). The Angular box of a query (`elementBox`) reads the element live, as React's ref object
|
|
66
|
+
* does; only a write would differ. Anything else (a library, a child component, a value kept) is not known to read.
|
|
67
|
+
*/
|
|
68
|
+
export declare function escapesOnlyToReaders(ir: FunctionIR, roots: t.Node[], name: string, callee: (name: string) => CalleeCode | null): boolean;
|