@yahoo/uds-v5-wip 1.59.0 → 1.61.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/dist/codegen/dist/loader/getLoaderArtifacts.js +2 -0
- package/dist/config/dist/Props.d.ts +161 -25
- package/dist/config/dist/bindRender.d.ts +16 -0
- package/dist/config/dist/bindRender.js +310 -0
- package/dist/config/dist/className.d.ts +54 -0
- package/dist/config/dist/className.js +77 -0
- package/dist/config/dist/component-config.d.ts +674 -161
- package/dist/config/dist/component-config.js +163 -0
- package/dist/config/dist/component-refs.d.ts +41 -18
- package/dist/config/dist/createConfig.d.ts +140 -59
- package/dist/config/dist/createConfig.js +95 -217
- package/dist/config/dist/createStyler.d.ts +35 -0
- package/dist/config/dist/createStyler.js +93 -0
- package/dist/config/dist/defineComponent.d.ts +297 -4
- package/dist/config/dist/defineComponent.js +264 -2
- package/dist/config/dist/defineCompositeStyle.d.ts +93 -0
- package/dist/config/dist/defineCompositeStyle.js +18 -0
- package/dist/config/dist/defineMotionConfig.d.ts +152 -0
- package/dist/config/dist/definePreview.d.ts +45 -0
- package/dist/config/dist/definePreview.js +35 -0
- package/dist/config/dist/defineStyleProp.d.ts +199 -3
- package/dist/config/dist/defineStyleProp.js +3 -2
- package/dist/config/dist/index.d.ts +20 -11
- package/dist/config/dist/index.js +8 -4
- package/dist/config/dist/merge-utils.js +51 -0
- package/dist/config/dist/propertyAcceptedTypes.d.ts +19 -0
- package/dist/config/dist/refs.d.ts +85 -0
- package/dist/config/dist/refs.js +92 -47
- package/dist/config/dist/resolveCompoundProps.d.ts +65 -0
- package/dist/config/dist/resolveCompoundProps.js +120 -0
- package/dist/config/dist/resolveStyleProp.d.ts +72 -3
- package/dist/config/dist/resolveStyleProp.js +68 -43
- package/dist/config/dist/runtime-registry.js +30 -2
- package/dist/config/dist/serialize.d.ts +8 -34
- package/dist/config/dist/serialize.js +10 -71
- package/dist/config/dist/sniffTokenType.d.ts +7 -0
- package/dist/config/dist/sniffTokenType.js +67 -0
- package/dist/config/dist/style-prop-runtime.d.ts +75 -1
- package/dist/config/dist/style-prop-runtime.js +390 -0
- package/dist/config/dist/types/css-properties.d.ts +223 -0
- package/dist/config/dist/types/css-values.d.ts +2 -1
- package/dist/config/dist/types.d.ts +14 -3
- package/dist/config.d.ts +21 -1560
- package/dist/config.js +15 -20
- package/dist/loader/dist/_virtual/_rolldown/runtime.js +1 -2
- package/dist/loader/dist/index.d.ts +2 -0
- package/dist/loader/dist/index.js +3 -0
- package/dist/loader/dist/loader/artifacts.js +2 -2
- package/dist/loader/dist/loader/babel-utils.js +1 -29
- package/dist/loader/dist/loader/internal-meta.js +38 -1
- package/dist/loader/dist/loader/lower-new-api-primitive.js +176 -14
- package/dist/loader/dist/loader.d.ts +27 -0
- package/dist/loader/dist/loader.js +71 -309
- package/dist/loader/dist/transform-runner.js +14 -0
- package/dist/loader/dist/unplugin.d.ts +27 -0
- package/dist/loader/dist/unplugin.js +52 -0
- package/dist/plugin.d.ts +2 -2
- package/dist/plugin.js +3 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -51
- package/dist/components/accordion.config.d.ts +0 -2
- package/dist/components/accordion.config.js +0 -2
- package/dist/components/accordion.d.ts +0 -2
- package/dist/components/accordion.js +0 -2
- package/dist/components/alert.config.d.ts +0 -2
- package/dist/components/alert.config.js +0 -2
- package/dist/components/alert.d.ts +0 -2
- package/dist/components/alert.js +0 -2
- package/dist/components/anchor.config.d.ts +0 -2
- package/dist/components/anchor.config.js +0 -2
- package/dist/components/anchor.d.ts +0 -2
- package/dist/components/anchor.js +0 -2
- package/dist/components/article.d.ts +0 -2
- package/dist/components/article.js +0 -2
- package/dist/components/aside.d.ts +0 -2
- package/dist/components/aside.js +0 -2
- package/dist/components/avatar-group.config.d.ts +0 -2
- package/dist/components/avatar-group.config.js +0 -2
- package/dist/components/avatar-group.d.ts +0 -2
- package/dist/components/avatar-group.js +0 -2
- package/dist/components/avatar.config.d.ts +0 -2
- package/dist/components/avatar.config.js +0 -2
- package/dist/components/avatar.d.ts +0 -2
- package/dist/components/avatar.js +0 -2
- package/dist/components/badge.config.d.ts +0 -2
- package/dist/components/badge.config.js +0 -2
- package/dist/components/badge.d.ts +0 -2
- package/dist/components/badge.js +0 -2
- package/dist/components/box.d.ts +0 -2
- package/dist/components/box.js +0 -2
- package/dist/components/breadcrumb.config.d.ts +0 -2
- package/dist/components/breadcrumb.config.js +0 -2
- package/dist/components/breadcrumb.d.ts +0 -2
- package/dist/components/breadcrumb.js +0 -2
- package/dist/components/button.config.d.ts +0 -2
- package/dist/components/button.config.js +0 -2
- package/dist/components/button.d.ts +0 -2
- package/dist/components/button.js +0 -2
- package/dist/components/card.config.d.ts +0 -2
- package/dist/components/card.config.js +0 -2
- package/dist/components/card.d.ts +0 -2
- package/dist/components/card.js +0 -2
- package/dist/components/collapsible.config.d.ts +0 -2
- package/dist/components/collapsible.config.js +0 -2
- package/dist/components/collapsible.d.ts +0 -2
- package/dist/components/collapsible.js +0 -2
- package/dist/components/command.config.d.ts +0 -2
- package/dist/components/command.config.js +0 -2
- package/dist/components/command.d.ts +0 -2
- package/dist/components/command.js +0 -2
- package/dist/components/control-color.config.d.ts +0 -2
- package/dist/components/control-color.config.js +0 -2
- package/dist/components/control-color.d.ts +0 -2
- package/dist/components/control-color.js +0 -2
- package/dist/components/control-curve.config.d.ts +0 -2
- package/dist/components/control-curve.config.js +0 -2
- package/dist/components/control-curve.d.ts +0 -2
- package/dist/components/control-curve.js +0 -2
- package/dist/components/control-folder.config.d.ts +0 -2
- package/dist/components/control-folder.config.js +0 -2
- package/dist/components/control-folder.d.ts +0 -2
- package/dist/components/control-folder.js +0 -2
- package/dist/components/control-group.config.d.ts +0 -2
- package/dist/components/control-group.config.js +0 -2
- package/dist/components/control-group.d.ts +0 -2
- package/dist/components/control-group.js +0 -2
- package/dist/components/control-knob.config.d.ts +0 -2
- package/dist/components/control-knob.config.js +0 -2
- package/dist/components/control-knob.d.ts +0 -2
- package/dist/components/control-knob.js +0 -2
- package/dist/components/control-panel.config.d.ts +0 -2
- package/dist/components/control-panel.config.js +0 -2
- package/dist/components/control-panel.d.ts +0 -2
- package/dist/components/control-panel.js +0 -2
- package/dist/components/control-select.config.d.ts +0 -2
- package/dist/components/control-select.config.js +0 -2
- package/dist/components/control-select.d.ts +0 -2
- package/dist/components/control-select.js +0 -2
- package/dist/components/control-slider.config.d.ts +0 -2
- package/dist/components/control-slider.config.js +0 -2
- package/dist/components/control-slider.d.ts +0 -2
- package/dist/components/control-slider.js +0 -2
- package/dist/components/control-spring.config.d.ts +0 -2
- package/dist/components/control-spring.config.js +0 -2
- package/dist/components/control-spring.d.ts +0 -2
- package/dist/components/control-spring.js +0 -2
- package/dist/components/control-stepper.config.d.ts +0 -2
- package/dist/components/control-stepper.config.js +0 -2
- package/dist/components/control-stepper.d.ts +0 -2
- package/dist/components/control-stepper.js +0 -2
- package/dist/components/control-toggle.config.d.ts +0 -2
- package/dist/components/control-toggle.config.js +0 -2
- package/dist/components/control-toggle.d.ts +0 -2
- package/dist/components/control-toggle.js +0 -2
- package/dist/components/dist/_slots.js +0 -8
- package/dist/components/dist/accordion.config.d.ts +0 -432
- package/dist/components/dist/accordion.config.js +0 -81
- package/dist/components/dist/accordion.d.ts +0 -454
- package/dist/components/dist/accordion.js +0 -60
- package/dist/components/dist/alert.config.d.ts +0 -220
- package/dist/components/dist/alert.config.js +0 -54
- package/dist/components/dist/alert.d.ts +0 -231
- package/dist/components/dist/alert.js +0 -16
- package/dist/components/dist/anchor.config.d.ts +0 -251
- package/dist/components/dist/anchor.config.js +0 -22
- package/dist/components/dist/anchor.d.ts +0 -262
- package/dist/components/dist/anchor.js +0 -9
- package/dist/components/dist/article.d.ts +0 -12
- package/dist/components/dist/article.js +0 -9
- package/dist/components/dist/aside.d.ts +0 -12
- package/dist/components/dist/aside.js +0 -9
- package/dist/components/dist/avatar-group.config.d.ts +0 -316
- package/dist/components/dist/avatar-group.config.js +0 -33
- package/dist/components/dist/avatar-group.d.ts +0 -330
- package/dist/components/dist/avatar-group.js +0 -39
- package/dist/components/dist/avatar.config.d.ts +0 -198
- package/dist/components/dist/avatar.config.js +0 -49
- package/dist/components/dist/avatar.d.ts +0 -212
- package/dist/components/dist/avatar.js +0 -20
- package/dist/components/dist/badge.config.d.ts +0 -478
- package/dist/components/dist/badge.config.js +0 -99
- package/dist/components/dist/badge.d.ts +0 -490
- package/dist/components/dist/badge.js +0 -16
- package/dist/components/dist/box.d.ts +0 -15
- package/dist/components/dist/box.js +0 -9
- package/dist/components/dist/breadcrumb.config.d.ts +0 -391
- package/dist/components/dist/breadcrumb.config.js +0 -43
- package/dist/components/dist/breadcrumb.d.ts +0 -421
- package/dist/components/dist/breadcrumb.js +0 -119
- package/dist/components/dist/button.config.d.ts +0 -382
- package/dist/components/dist/button.config.js +0 -91
- package/dist/components/dist/button.d.ts +0 -404
- package/dist/components/dist/button.js +0 -35
- package/dist/components/dist/card.config.d.ts +0 -337
- package/dist/components/dist/card.config.js +0 -33
- package/dist/components/dist/card.d.ts +0 -353
- package/dist/components/dist/card.js +0 -27
- package/dist/components/dist/collapsible.config.d.ts +0 -46
- package/dist/components/dist/collapsible.config.js +0 -46
- package/dist/components/dist/collapsible.d.ts +0 -62
- package/dist/components/dist/collapsible.js +0 -38
- package/dist/components/dist/command.config.d.ts +0 -1614
- package/dist/components/dist/command.config.js +0 -170
- package/dist/components/dist/command.d.ts +0 -1723
- package/dist/components/dist/command.js +0 -341
- package/dist/components/dist/control-color.config.d.ts +0 -980
- package/dist/components/dist/control-color.config.js +0 -81
- package/dist/components/dist/control-color.d.ts +0 -996
- package/dist/components/dist/control-color.js +0 -64
- package/dist/components/dist/control-curve.config.d.ts +0 -19
- package/dist/components/dist/control-curve.config.js +0 -14
- package/dist/components/dist/control-curve.d.ts +0 -36
- package/dist/components/dist/control-curve.js +0 -81
- package/dist/components/dist/control-folder.config.d.ts +0 -178
- package/dist/components/dist/control-folder.config.js +0 -47
- package/dist/components/dist/control-folder.d.ts +0 -195
- package/dist/components/dist/control-folder.js +0 -41
- package/dist/components/dist/control-group.config.d.ts +0 -860
- package/dist/components/dist/control-group.config.js +0 -80
- package/dist/components/dist/control-group.d.ts +0 -882
- package/dist/components/dist/control-group.js +0 -89
- package/dist/components/dist/control-knob.config.d.ts +0 -793
- package/dist/components/dist/control-knob.config.js +0 -67
- package/dist/components/dist/control-knob.d.ts +0 -820
- package/dist/components/dist/control-knob.js +0 -148
- package/dist/components/dist/control-panel.config.d.ts +0 -403
- package/dist/components/dist/control-panel.config.js +0 -38
- package/dist/components/dist/control-panel.d.ts +0 -416
- package/dist/components/dist/control-panel.js +0 -22
- package/dist/components/dist/control-select.config.d.ts +0 -1177
- package/dist/components/dist/control-select.config.js +0 -102
- package/dist/components/dist/control-select.d.ts +0 -1201
- package/dist/components/dist/control-select.js +0 -63
- package/dist/components/dist/control-slider.config.d.ts +0 -105
- package/dist/components/dist/control-slider.config.js +0 -98
- package/dist/components/dist/control-slider.d.ts +0 -128
- package/dist/components/dist/control-slider.js +0 -87
- package/dist/components/dist/control-spring.config.d.ts +0 -418
- package/dist/components/dist/control-spring.config.js +0 -36
- package/dist/components/dist/control-spring.d.ts +0 -440
- package/dist/components/dist/control-spring.js +0 -136
- package/dist/components/dist/control-stepper.config.d.ts +0 -1085
- package/dist/components/dist/control-stepper.config.js +0 -108
- package/dist/components/dist/control-stepper.d.ts +0 -1105
- package/dist/components/dist/control-stepper.js +0 -109
- package/dist/components/dist/control-toggle.config.d.ts +0 -408
- package/dist/components/dist/control-toggle.config.js +0 -26
- package/dist/components/dist/control-toggle.d.ts +0 -421
- package/dist/components/dist/control-toggle.js +0 -36
- package/dist/components/dist/createSlot.d.ts +0 -9
- package/dist/components/dist/createSlot.js +0 -89
- package/dist/components/dist/dropdown.config.d.ts +0 -921
- package/dist/components/dist/dropdown.config.js +0 -107
- package/dist/components/dist/dropdown.d.ts +0 -951
- package/dist/components/dist/dropdown.js +0 -92
- package/dist/components/dist/empty-state.config.d.ts +0 -397
- package/dist/components/dist/empty-state.config.js +0 -53
- package/dist/components/dist/empty-state.d.ts +0 -417
- package/dist/components/dist/empty-state.js +0 -33
- package/dist/components/dist/footer.d.ts +0 -12
- package/dist/components/dist/footer.js +0 -9
- package/dist/components/dist/grid.d.ts +0 -42
- package/dist/components/dist/grid.js +0 -34
- package/dist/components/dist/header.d.ts +0 -12
- package/dist/components/dist/header.js +0 -9
- package/dist/components/dist/hstack.d.ts +0 -16
- package/dist/components/dist/hstack.js +0 -21
- package/dist/components/dist/image.d.ts +0 -20
- package/dist/components/dist/image.js +0 -9
- package/dist/components/dist/input.config.d.ts +0 -59
- package/dist/components/dist/input.config.js +0 -42
- package/dist/components/dist/input.d.ts +0 -68
- package/dist/components/dist/input.js +0 -14
- package/dist/components/dist/item.config.d.ts +0 -352
- package/dist/components/dist/item.config.js +0 -83
- package/dist/components/dist/item.d.ts +0 -375
- package/dist/components/dist/item.js +0 -51
- package/dist/components/dist/list.d.ts +0 -20
- package/dist/components/dist/list.js +0 -21
- package/dist/components/dist/main.d.ts +0 -12
- package/dist/components/dist/main.js +0 -9
- package/dist/components/dist/modal.config.d.ts +0 -398
- package/dist/components/dist/modal.config.js +0 -92
- package/dist/components/dist/modal.d.ts +0 -434
- package/dist/components/dist/modal.js +0 -125
- package/dist/components/dist/nav-header.config.d.ts +0 -159
- package/dist/components/dist/nav-header.config.js +0 -26
- package/dist/components/dist/nav-header.d.ts +0 -174
- package/dist/components/dist/nav-header.js +0 -23
- package/dist/components/dist/nav.d.ts +0 -12
- package/dist/components/dist/nav.js +0 -9
- package/dist/components/dist/preset-bar.config.d.ts +0 -193
- package/dist/components/dist/preset-bar.config.js +0 -39
- package/dist/components/dist/preset-bar.d.ts +0 -216
- package/dist/components/dist/preset-bar.js +0 -71
- package/dist/components/dist/presets/index.d.ts +0 -17675
- package/dist/components/dist/presets/index.js +0 -97
- package/dist/components/dist/pressable.d.ts +0 -12
- package/dist/components/dist/pressable.js +0 -9
- package/dist/components/dist/progress.config.d.ts +0 -297
- package/dist/components/dist/progress.config.js +0 -35
- package/dist/components/dist/progress.d.ts +0 -312
- package/dist/components/dist/progress.js +0 -43
- package/dist/components/dist/section.d.ts +0 -12
- package/dist/components/dist/section.js +0 -9
- package/dist/components/dist/select.config.d.ts +0 -32
- package/dist/components/dist/select.config.js +0 -25
- package/dist/components/dist/select.d.ts +0 -46
- package/dist/components/dist/select.js +0 -13
- package/dist/components/dist/sheet.config.d.ts +0 -246
- package/dist/components/dist/sheet.config.js +0 -99
- package/dist/components/dist/sheet.d.ts +0 -268
- package/dist/components/dist/sheet.js +0 -53
- package/dist/components/dist/sidebar.config.d.ts +0 -1652
- package/dist/components/dist/sidebar.config.js +0 -217
- package/dist/components/dist/sidebar.d.ts +0 -1826
- package/dist/components/dist/sidebar.js +0 -492
- package/dist/components/dist/skeleton.config.d.ts +0 -17
- package/dist/components/dist/skeleton.config.js +0 -10
- package/dist/components/dist/skeleton.d.ts +0 -28
- package/dist/components/dist/skeleton.js +0 -16
- package/dist/components/dist/slider.config.d.ts +0 -45
- package/dist/components/dist/slider.config.js +0 -40
- package/dist/components/dist/slider.d.ts +0 -71
- package/dist/components/dist/slider.js +0 -247
- package/dist/components/dist/spinner.config.d.ts +0 -35
- package/dist/components/dist/spinner.config.js +0 -24
- package/dist/components/dist/spinner.d.ts +0 -43
- package/dist/components/dist/spinner.js +0 -29
- package/dist/components/dist/svg.d.ts +0 -22
- package/dist/components/dist/svg.js +0 -17
- package/dist/components/dist/switch.config.d.ts +0 -354
- package/dist/components/dist/switch.config.js +0 -47
- package/dist/components/dist/switch.d.ts +0 -371
- package/dist/components/dist/switch.js +0 -32
- package/dist/components/dist/table.d.ts +0 -37
- package/dist/components/dist/table.js +0 -29
- package/dist/components/dist/tabs.config.d.ts +0 -612
- package/dist/components/dist/tabs.config.js +0 -56
- package/dist/components/dist/tabs.d.ts +0 -633
- package/dist/components/dist/tabs.js +0 -77
- package/dist/components/dist/text.config.d.ts +0 -307
- package/dist/components/dist/text.config.js +0 -149
- package/dist/components/dist/text.d.ts +0 -206
- package/dist/components/dist/text.js +0 -12
- package/dist/components/dist/textarea.config.d.ts +0 -353
- package/dist/components/dist/textarea.config.js +0 -57
- package/dist/components/dist/textarea.d.ts +0 -363
- package/dist/components/dist/textarea.js +0 -9
- package/dist/components/dist/toast.config.d.ts +0 -336
- package/dist/components/dist/toast.config.js +0 -145
- package/dist/components/dist/toast.d.ts +0 -427
- package/dist/components/dist/toast.js +0 -159
- package/dist/components/dist/tooltip.config.d.ts +0 -194
- package/dist/components/dist/tooltip.config.js +0 -40
- package/dist/components/dist/tooltip.d.ts +0 -207
- package/dist/components/dist/tooltip.js +0 -28
- package/dist/components/dist/vstack.d.ts +0 -16
- package/dist/components/dist/vstack.js +0 -20
- package/dist/components/dropdown.config.d.ts +0 -2
- package/dist/components/dropdown.config.js +0 -2
- package/dist/components/dropdown.d.ts +0 -2
- package/dist/components/dropdown.js +0 -2
- package/dist/components/empty-state.config.d.ts +0 -2
- package/dist/components/empty-state.config.js +0 -2
- package/dist/components/empty-state.d.ts +0 -2
- package/dist/components/empty-state.js +0 -2
- package/dist/components/footer.d.ts +0 -2
- package/dist/components/footer.js +0 -2
- package/dist/components/grid.d.ts +0 -2
- package/dist/components/grid.js +0 -2
- package/dist/components/header.d.ts +0 -2
- package/dist/components/header.js +0 -2
- package/dist/components/hstack.d.ts +0 -2
- package/dist/components/hstack.js +0 -2
- package/dist/components/image.d.ts +0 -2
- package/dist/components/image.js +0 -2
- package/dist/components/input.config.d.ts +0 -2
- package/dist/components/input.config.js +0 -2
- package/dist/components/input.d.ts +0 -2
- package/dist/components/input.js +0 -2
- package/dist/components/item.config.d.ts +0 -2
- package/dist/components/item.config.js +0 -2
- package/dist/components/item.d.ts +0 -2
- package/dist/components/item.js +0 -2
- package/dist/components/list.d.ts +0 -2
- package/dist/components/list.js +0 -2
- package/dist/components/main.d.ts +0 -2
- package/dist/components/main.js +0 -2
- package/dist/components/modal.config.d.ts +0 -2
- package/dist/components/modal.config.js +0 -2
- package/dist/components/modal.d.ts +0 -2
- package/dist/components/modal.js +0 -2
- package/dist/components/nav-header.config.d.ts +0 -2
- package/dist/components/nav-header.config.js +0 -2
- package/dist/components/nav-header.d.ts +0 -2
- package/dist/components/nav-header.js +0 -2
- package/dist/components/nav.d.ts +0 -2
- package/dist/components/nav.js +0 -2
- package/dist/components/preset-bar.config.d.ts +0 -2
- package/dist/components/preset-bar.config.js +0 -2
- package/dist/components/preset-bar.d.ts +0 -2
- package/dist/components/preset-bar.js +0 -2
- package/dist/components/presets/index.d.ts +0 -44
- package/dist/components/presets/index.js +0 -44
- package/dist/components/pressable.d.ts +0 -2
- package/dist/components/pressable.js +0 -2
- package/dist/components/progress.config.d.ts +0 -2
- package/dist/components/progress.config.js +0 -2
- package/dist/components/progress.d.ts +0 -2
- package/dist/components/progress.js +0 -2
- package/dist/components/section.d.ts +0 -2
- package/dist/components/section.js +0 -2
- package/dist/components/select.config.d.ts +0 -2
- package/dist/components/select.config.js +0 -2
- package/dist/components/select.d.ts +0 -2
- package/dist/components/select.js +0 -2
- package/dist/components/sheet.config.d.ts +0 -2
- package/dist/components/sheet.config.js +0 -2
- package/dist/components/sheet.d.ts +0 -2
- package/dist/components/sheet.js +0 -2
- package/dist/components/sidebar.config.d.ts +0 -2
- package/dist/components/sidebar.config.js +0 -2
- package/dist/components/sidebar.d.ts +0 -2
- package/dist/components/sidebar.js +0 -2
- package/dist/components/skeleton.config.d.ts +0 -2
- package/dist/components/skeleton.config.js +0 -2
- package/dist/components/skeleton.d.ts +0 -2
- package/dist/components/skeleton.js +0 -2
- package/dist/components/slider.config.d.ts +0 -2
- package/dist/components/slider.config.js +0 -2
- package/dist/components/slider.d.ts +0 -2
- package/dist/components/slider.js +0 -2
- package/dist/components/spinner.config.d.ts +0 -2
- package/dist/components/spinner.config.js +0 -2
- package/dist/components/spinner.d.ts +0 -2
- package/dist/components/spinner.js +0 -2
- package/dist/components/svg.d.ts +0 -2
- package/dist/components/svg.js +0 -2
- package/dist/components/switch.config.d.ts +0 -2
- package/dist/components/switch.config.js +0 -2
- package/dist/components/switch.d.ts +0 -2
- package/dist/components/switch.js +0 -2
- package/dist/components/table.d.ts +0 -2
- package/dist/components/table.js +0 -2
- package/dist/components/tabs.config.d.ts +0 -2
- package/dist/components/tabs.config.js +0 -2
- package/dist/components/tabs.d.ts +0 -2
- package/dist/components/tabs.js +0 -2
- package/dist/components/text.config.d.ts +0 -2
- package/dist/components/text.config.js +0 -2
- package/dist/components/text.d.ts +0 -2
- package/dist/components/text.js +0 -2
- package/dist/components/textarea.config.d.ts +0 -2
- package/dist/components/textarea.config.js +0 -2
- package/dist/components/textarea.d.ts +0 -2
- package/dist/components/textarea.js +0 -2
- package/dist/components/toast.config.d.ts +0 -2
- package/dist/components/toast.config.js +0 -2
- package/dist/components/toast.d.ts +0 -2
- package/dist/components/toast.js +0 -2
- package/dist/components/tooltip.config.d.ts +0 -2
- package/dist/components/tooltip.config.js +0 -2
- package/dist/components/tooltip.d.ts +0 -2
- package/dist/components/tooltip.js +0 -2
- package/dist/components/vstack.d.ts +0 -2
- package/dist/components/vstack.js +0 -2
- package/dist/config/dist/component-resolution.js +0 -78
- package/dist/config/dist/consts/defaultColors.d.ts +0 -253
- package/dist/config/dist/consts/defaultColors.js +0 -252
- package/dist/config/dist/createComponent.d.ts +0 -1
- package/dist/config/dist/createComponent.js +0 -1
- package/dist/config/dist/preset-merge.js +0 -192
- package/dist/config/dist/propertyGroups.d.ts +0 -1
- package/dist/config/dist/propertyGroups.js +0 -414
- package/dist/config/dist/resolveTokenTypes.d.ts +0 -1
- package/dist/config/dist/resolveTokenTypes.js +0 -149
- package/dist/config-utils/dist/componentConfig.d.ts +0 -10
- package/dist/config-utils/dist/componentConfig.js +0 -11
- package/dist/config-utils.d.ts +0 -2
- package/dist/config-utils.js +0 -2
- package/dist/core/dist/color-opacity-map.js +0 -33
- package/dist/core/dist/compositeStyles.d.ts +0 -22
- package/dist/core/dist/compositeStyles.js +0 -51
- package/dist/core/dist/configurable-prop-helpers.d.ts +0 -32
- package/dist/core/dist/configurable-prop-helpers.js +0 -61
- package/dist/core/dist/createComponent.boundaries.js +0 -192
- package/dist/core/dist/createComponent.d.ts +0 -57
- package/dist/core/dist/createComponent.js +0 -67
- package/dist/core/dist/createComponentExample.d.ts +0 -42
- package/dist/core/dist/createComponentExample.js +0 -27
- package/dist/core/dist/createProvider.d.ts +0 -13
- package/dist/core/dist/createProvider.js +0 -24
- package/dist/core/dist/generated/stylePropsTwMap.d.ts +0 -1701
- package/dist/core/dist/generated/stylePropsTwMap.js +0 -570
- package/dist/core/dist/getComponentStyles.d.ts +0 -50
- package/dist/core/dist/getComponentStyles.js +0 -85
- package/dist/core/dist/getStyles.d.ts +0 -43
- package/dist/core/dist/getStyles.js +0 -300
- package/dist/core/dist/index.d.ts +0 -13
- package/dist/core/dist/index.js +0 -13
- package/dist/core/dist/modifier-mappings.d.ts +0 -13
- package/dist/core/dist/modifier-mappings.js +0 -61
- package/dist/core/dist/resolveMotionState.d.ts +0 -5
- package/dist/core/dist/resolveMotionState.js +0 -17
- package/dist/core/dist/resolveProps.boundaries.js +0 -131
- package/dist/core/dist/style-prop-data.d.ts +0 -33
- package/dist/core/dist/style-prop-data.js +0 -1257
- package/dist/core/dist/transformPreset.d.ts +0 -18
- package/dist/core/dist/transformPreset.js +0 -28
- package/dist/core/dist/withDefaultStyleProps.d.ts +0 -44
- package/dist/core/dist/withDefaultStyleProps.js +0 -18
- package/dist/core.d.ts +0 -14
- package/dist/core.js +0 -15
- package/dist/createSlot.d.ts +0 -2
- package/dist/createSlot.js +0 -2
- package/dist/fixtures.d.ts +0 -4
- package/dist/fixtures.js +0 -5
- package/dist/foundational-presets/dist/_virtual/_rolldown/runtime.js +0 -13
- package/dist/foundational-presets/dist/defaultPreset.d.ts +0 -1558
- package/dist/foundational-presets/dist/defaultPreset.js +0 -615
- package/dist/foundational-presets/dist/index.d.ts +0 -1
- package/dist/foundational-presets/dist/index.js +0 -1
- package/dist/foundational-presets/dist/motion.d.ts +0 -13
- package/dist/foundational-presets/dist/motion.js +0 -10
- package/dist/foundational-presets/dist/style-props.js +0 -1445
- package/dist/loader/dist/loader/create-component-data.js +0 -33
- package/dist/loader/dist/loader/create-component-lowering.js +0 -454
- package/dist/loader/dist/loader/data-attr-transform.js +0 -191
- package/dist/loader/dist/loader/dynamic-style-codegen.js +0 -97
- package/dist/loader/dist/loader/motion-transform.js +0 -717
- package/dist/loader/dist/loader/style-transform.js +0 -670
- package/dist/loader/dist/node_modules/react/cjs/react-jsx-runtime.development.js +0 -203
- package/dist/loader/dist/node_modules/react/cjs/react-jsx-runtime.production.js +0 -25
- package/dist/loader/dist/node_modules/react/cjs/react.development.js +0 -762
- package/dist/loader/dist/node_modules/react/cjs/react.production.js +0 -351
- package/dist/loader/dist/node_modules/react/index.js +0 -10
- package/dist/loader/dist/node_modules/react/jsx-runtime.js +0 -10
- package/dist/loader/dist/packages/core/dist/color-opacity-map.js +0 -33
- package/dist/loader/dist/packages/core/dist/compositeStyles.js +0 -43
- package/dist/loader/dist/packages/core/dist/createComponent.js +0 -6
- package/dist/loader/dist/packages/core/dist/createProvider.js +0 -7
- package/dist/loader/dist/packages/core/dist/generated/stylePropsTwMap.js +0 -570
- package/dist/loader/dist/packages/core/dist/getComponentStyles.js +0 -2
- package/dist/loader/dist/packages/core/dist/getStyles.js +0 -60
- package/dist/loader/dist/packages/core/dist/index.js +0 -6
- package/dist/loader/dist/packages/core/dist/modifier-mappings.js +0 -61
- package/dist/loader/dist/packages/core/dist/style-prop-data.js +0 -1257
- package/dist/loader/dist/packages/core/dist/withDefaultStyleProps.js +0 -1
- package/dist/presets/dist/defaultPreset.d.ts +0 -6
- package/dist/presets/dist/defaultPreset.js +0 -51
- package/dist/presets/dist/index.d.ts +0 -1
- package/dist/presets/dist/index.js +0 -1
- package/dist/presets/motion.d.ts +0 -2
- package/dist/presets/motion.js +0 -2
- package/dist/presets.d.ts +0 -2
- package/dist/presets.js +0 -3
- package/dist/styles.d.ts +0 -4
- package/dist/styles.js +0 -5
- package/dist/transformPreset.d.ts +0 -2
- package/dist/transformPreset.js +0 -3
- /package/dist/{config/dist/component-resolution.d.ts → loader/dist/transform-runner.d.ts} +0 -0
|
@@ -1,43 +1,41 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
import { loadManifest, loadTransformData } from "./loader/artifacts.js";
|
|
4
|
-
import { isCompiledJsxCallee } from "./loader/babel-utils.js";
|
|
5
|
-
import { canInlineSimpleLoweredComponent, resolveLoweredCreateComponentData } from "./loader/create-component-data.js";
|
|
6
|
-
import { applySlotMotionToElement, clearHoistedMotionStates, componentHasExitMotion, getCustomSlotMotion, getHoistedMotionStates, handleMotionOnElement, wrapCustomComponentWithAnimatePresence, wrapParentConditionalWithAnimatePresence } from "./loader/motion-transform.js";
|
|
7
|
-
import { findClassesParamName, findSlotFromClassNameAttr, findSlotFromPropsSpreadAttr, findSlotPropsParamName, handleCompiledJsxDataAttrs, injectInternalUdsProps } from "./loader/data-attr-transform.js";
|
|
8
|
-
import { buildInlineSimpleLoweredCreateComponentRenderFn, buildInlineSimplePrimitiveCreateComponentRenderFn, buildLoweredCreateComponentConfigExpression, extractOwnPropKeys, inferCreateComponentNameFromAssignment, isCreateComponentRenderFnNode, remapOnPressToOnClickInJsxAttributes } from "./loader/create-component-lowering.js";
|
|
1
|
+
import { loadManifest } from "./loader/artifacts.js";
|
|
2
|
+
import { injectInternalUdsProps } from "./loader/internal-meta.js";
|
|
9
3
|
import { lowerNewApiPrimitiveJsx } from "./loader/lower-new-api-primitive.js";
|
|
10
|
-
import { createStyleTransformRuntime } from "./loader/style-transform.js";
|
|
11
|
-
import * as t from "@babel/types";
|
|
12
4
|
import path from "node:path";
|
|
13
|
-
import
|
|
5
|
+
import * as t from "@babel/types";
|
|
14
6
|
import _generate from "@babel/generator";
|
|
15
7
|
import { parse } from "@babel/parser";
|
|
8
|
+
import _traverse from "@babel/traverse";
|
|
16
9
|
//#region ../loader/dist/loader.js
|
|
17
10
|
const traverse = _traverse.default ?? _traverse;
|
|
18
11
|
const generate = _generate.default ?? _generate;
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
12
|
+
/**
|
|
13
|
+
* The UDS loader's only build-time job. Three responsibilities, one
|
|
14
|
+
* Babel pass:
|
|
15
|
+
*
|
|
16
|
+
* 1. **Import rewrite** — when the source imports a registered
|
|
17
|
+
* component from an aliased local path (e.g.
|
|
18
|
+
* `@/uds/components/box`), rewrite the import source to
|
|
19
|
+
* `'#uds/components'` so it resolves to the codegen-emitted
|
|
20
|
+
* `.uds/components.tsx` barrel. The authoring file
|
|
21
|
+
* (`apps/<app>/src/uds/components/<name>.tsx`) is only read by
|
|
22
|
+
* codegen — production renders the downleveled FC.
|
|
23
|
+
*
|
|
24
|
+
* 2. **Static primitive JSX lowering** — when a JSX site references a
|
|
25
|
+
* registered primitive (`type: 'primitive'` + non-empty
|
|
26
|
+
* `propBindings` in the manifest), try `lowerNewApiPrimitiveJsx`
|
|
27
|
+
* to bake a literal `className="bg-primary"` into the output.
|
|
28
|
+
* Skips the codegen FC's runtime className concatenation entirely
|
|
29
|
+
* in the all-static case. Falls through to the runtime FC when
|
|
30
|
+
* lowering bails.
|
|
31
|
+
*
|
|
32
|
+
* 3. **Dev-mode metadata** — inject `data-uds-id` + `data-uds-source`
|
|
33
|
+
* attrs onto every UDS JSX site so devtools can map elements
|
|
34
|
+
* back to source positions. Off in production.
|
|
35
|
+
*
|
|
36
|
+
* Anything else (motion wiring, composite expansion, slot resolution,
|
|
37
|
+
* styler tracking) is owned by codegen and intentionally absent here.
|
|
38
|
+
*/
|
|
41
39
|
const transformLoader = function(source) {
|
|
42
40
|
const loaderContext = this ?? void 0;
|
|
43
41
|
if (!loaderContext?.getOptions) return source;
|
|
@@ -51,15 +49,8 @@ const transformLoader = function(source) {
|
|
|
51
49
|
loaderContext.addDependency?.(transformDataPath);
|
|
52
50
|
}
|
|
53
51
|
const manifest = loadManifest(manifestPath, isDev);
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const allUdsComponents = styleRuntime.allComponents;
|
|
57
|
-
const primitiveUdsComponents = styleRuntime.primitiveComponents;
|
|
58
|
-
const componentTagPatterns = styleRuntime.componentTagPatterns;
|
|
59
|
-
const hasAnyComponent = source.includes("from 'uds/") || source.includes("from \"@uds/") || source.includes("from 'uds'") || source.includes("from \"uds/") || source.includes("from '@uds/") || source.includes("from \"uds\"") || componentTagPatterns.length > 0 && componentTagPatterns.some((pattern) => source.includes(pattern));
|
|
60
|
-
const hasCreateComponent = source.includes("createComponent") || source.includes("createComponentStyler");
|
|
61
|
-
if (!hasAnyComponent && !hasCreateComponent) return source;
|
|
62
|
-
const customComponents = getCustomComponents(manifest);
|
|
52
|
+
if (!manifest) return source;
|
|
53
|
+
if (!Object.keys(manifest.components).some((name) => source.includes(name))) return source;
|
|
63
54
|
const isTS = resourcePath?.endsWith(".ts") || resourcePath?.endsWith(".tsx");
|
|
64
55
|
const isJSX = resourcePath?.endsWith(".tsx") || resourcePath?.endsWith(".jsx");
|
|
65
56
|
const parserPlugins = [];
|
|
@@ -75,291 +66,62 @@ const transformLoader = function(source) {
|
|
|
75
66
|
return source;
|
|
76
67
|
}
|
|
77
68
|
let transformed = false;
|
|
78
|
-
const importsToAdd = /* @__PURE__ */ new Map();
|
|
79
|
-
let hasMotionImport = false;
|
|
80
|
-
let needsMotionImport = false;
|
|
81
|
-
let hasAnimatePresenceImport = false;
|
|
82
|
-
let needsAnimatePresenceImport = false;
|
|
83
|
-
let needsResolveMotionStateImport = false;
|
|
84
|
-
let needsProcessStylePropsImport = false;
|
|
85
|
-
clearHoistedMotionStates();
|
|
86
|
-
const stylerToComponent = /* @__PURE__ */ new Map();
|
|
87
|
-
const classesVarToComponent = /* @__PURE__ */ new Map();
|
|
88
|
-
const slotPropsVarToComponent = /* @__PURE__ */ new Map();
|
|
89
69
|
const udsImportedNames = /* @__PURE__ */ new Set();
|
|
90
|
-
const createComponentImportNames = /* @__PURE__ */ new Set();
|
|
91
|
-
const createVariantsImportNames = /* @__PURE__ */ new Set();
|
|
92
|
-
const createVariantsClassMaps = /* @__PURE__ */ new Map();
|
|
93
|
-
const hoistedVariantClassMapNames = /* @__PURE__ */ new Map();
|
|
94
|
-
const hoistedVariantClassMaps = /* @__PURE__ */ new Map();
|
|
95
|
-
const createComponentDefinedNames = /* @__PURE__ */ new Set();
|
|
96
|
-
let needsCreateComponentImportCleanup = false;
|
|
97
70
|
traverse(ast, {
|
|
98
|
-
JSXOpeningElement(nodePath) {
|
|
99
|
-
const jsxName = nodePath.node.name;
|
|
100
|
-
const jsxTagName = jsxName?.type === "JSXIdentifier" ? jsxName.name : void 0;
|
|
101
|
-
if (jsxTagName) {
|
|
102
|
-
const componentEntry = manifest?.components?.[jsxTagName];
|
|
103
|
-
if (componentEntry?.propBindings && udsImportedNames.has(jsxTagName)) {
|
|
104
|
-
const closingElement = (nodePath.parentPath?.node)?.closingElement ?? null;
|
|
105
|
-
if (lowerNewApiPrimitiveJsx(nodePath.node, closingElement, {
|
|
106
|
-
tag: componentEntry.element,
|
|
107
|
-
propBindings: componentEntry.propBindings,
|
|
108
|
-
defaultClassNames: componentEntry.defaultClassNames ?? []
|
|
109
|
-
}, t)) transformed = true;
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
if (jsxTagName && !allUdsComponents.has(jsxTagName) && udsImportedNames.has(jsxTagName)) {
|
|
114
|
-
allUdsComponents.add(jsxTagName);
|
|
115
|
-
if (!primitiveUdsComponents.has(jsxTagName)) {
|
|
116
|
-
const manifestEntry = manifest?.components[jsxTagName];
|
|
117
|
-
if (manifestEntry?.type === "primitive" && manifestEntry.element || transformData?.primitiveElementMap?.[jsxTagName]) primitiveUdsComponents.add(jsxTagName);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
const isUdsJsxTag = jsxTagName && isUdsComponentReference(nodePath, jsxTagName, allUdsComponents, udsImportedNames, createComponentDefinedNames, customComponents);
|
|
121
|
-
if (isDev && jsxTagName && isUdsJsxTag) {
|
|
122
|
-
injectInternalUdsProps(nodePath, resourcePath, projectRoot, {
|
|
123
|
-
componentName: jsxTagName,
|
|
124
|
-
slotName: "root"
|
|
125
|
-
});
|
|
126
|
-
transformed = true;
|
|
127
|
-
}
|
|
128
|
-
if (jsxTagName && isUdsJsxTag && remapOnPressToOnClickInJsxAttributes(nodePath.node.attributes)) transformed = true;
|
|
129
|
-
let motionTransformed = false;
|
|
130
|
-
if (isUdsJsxTag && handleMotionOnElement(nodePath, manifest, customComponents, primitiveUdsComponents, importsToAdd)) {
|
|
131
|
-
transformed = true;
|
|
132
|
-
motionTransformed = true;
|
|
133
|
-
}
|
|
134
|
-
if (jsxTagName && customComponents?.has(jsxTagName) && componentHasExitMotion(manifest, jsxTagName)) {
|
|
135
|
-
if (wrapCustomComponentWithAnimatePresence(nodePath)) {
|
|
136
|
-
needsAnimatePresenceImport = true;
|
|
137
|
-
transformed = true;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
if (isUdsJsxTag && styleRuntime.transformUdsComponentStyleProps(nodePath, createVariantsClassMaps, hoistedVariantClassMapNames, hoistedVariantClassMaps)) transformed = true;
|
|
141
|
-
if (!motionTransformed && jsxTagName && isUdsJsxTag && primitiveUdsComponents.has(jsxTagName)) {
|
|
142
|
-
const baseElement = (manifest?.components[jsxTagName])?.element ?? transformData?.primitiveElementMap?.[jsxTagName];
|
|
143
|
-
if (baseElement) {
|
|
144
|
-
let resolvedElement = baseElement;
|
|
145
|
-
const asAttrIndex = nodePath.node.attributes.findIndex((attr) => t.isJSXAttribute(attr) && t.isJSXIdentifier(attr.name) && attr.name.name === "as");
|
|
146
|
-
if (asAttrIndex >= 0) {
|
|
147
|
-
const asAttr = nodePath.node.attributes[asAttrIndex];
|
|
148
|
-
if (t.isStringLiteral(asAttr.value)) {
|
|
149
|
-
resolvedElement = asAttr.value.value;
|
|
150
|
-
nodePath.node.attributes.splice(asAttrIndex, 1);
|
|
151
|
-
} else if (t.isJSXExpressionContainer(asAttr.value) && t.isStringLiteral(asAttr.value.expression)) {
|
|
152
|
-
resolvedElement = asAttr.value.expression.value;
|
|
153
|
-
nodePath.node.attributes.splice(asAttrIndex, 1);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
const slotClassName = transformData?.componentClassData?.[jsxTagName]?.slotClassNames?.root ?? componentSlotClass(jsxTagName, "root");
|
|
157
|
-
nodePath.node.name = t.jsxIdentifier(resolvedElement);
|
|
158
|
-
const existingClassAttr = nodePath.node.attributes.find((attr) => t.isJSXAttribute(attr) && t.isJSXIdentifier(attr.name) && attr.name.name === "className");
|
|
159
|
-
if (existingClassAttr && t.isJSXAttribute(existingClassAttr)) {
|
|
160
|
-
if (t.isStringLiteral(existingClassAttr.value)) existingClassAttr.value = t.stringLiteral(`${slotClassName} ${existingClassAttr.value.value}`);
|
|
161
|
-
else if (t.isJSXExpressionContainer(existingClassAttr.value) && !t.isJSXEmptyExpression(existingClassAttr.value.expression)) if (t.isStringLiteral(existingClassAttr.value.expression)) existingClassAttr.value = t.jsxExpressionContainer(t.stringLiteral(`${slotClassName} ${existingClassAttr.value.expression.value}`));
|
|
162
|
-
else existingClassAttr.value = t.jsxExpressionContainer(t.templateLiteral([t.templateElement({
|
|
163
|
-
raw: `${slotClassName} `,
|
|
164
|
-
cooked: `${slotClassName} `
|
|
165
|
-
}, false), t.templateElement({
|
|
166
|
-
raw: "",
|
|
167
|
-
cooked: ""
|
|
168
|
-
}, true)], [existingClassAttr.value.expression]));
|
|
169
|
-
} else nodePath.node.attributes.push(t.jsxAttribute(t.jsxIdentifier("className"), t.stringLiteral(slotClassName)));
|
|
170
|
-
const parent = nodePath.parent;
|
|
171
|
-
if (parent?.type === "JSXElement" && parent.closingElement?.name?.type === "JSXIdentifier") parent.closingElement.name = t.jsxIdentifier(resolvedElement);
|
|
172
|
-
transformed = true;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
const classNameSlotInfo = findSlotFromClassNameAttr(nodePath.node.attributes, classesVarToComponent, stylerToComponent, slotPropsVarToComponent);
|
|
176
|
-
const slotInfo = findSlotFromPropsSpreadAttr(nodePath.node.attributes, slotPropsVarToComponent) ?? classNameSlotInfo;
|
|
177
|
-
if (!slotInfo) return;
|
|
178
|
-
const slotMotion = getCustomSlotMotion(manifest, slotInfo);
|
|
179
|
-
if (slotMotion) {
|
|
180
|
-
const motionResult = applySlotMotionToElement(nodePath, slotMotion);
|
|
181
|
-
if (motionResult.transformed) {
|
|
182
|
-
transformed = true;
|
|
183
|
-
needsMotionImport = true;
|
|
184
|
-
}
|
|
185
|
-
if (motionResult.needsResolveMotionStateImport) needsResolveMotionStateImport = true;
|
|
186
|
-
if (motionResult.transformed && slotMotion.exit) {
|
|
187
|
-
if (wrapParentConditionalWithAnimatePresence(nodePath)) needsAnimatePresenceImport = true;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
if (nodePath.node.attributes.some((attr) => attr.type === "JSXAttribute" && attr.name?.name === "data-uds-slot")) return;
|
|
191
|
-
nodePath.node.attributes.push(t.jsxAttribute(t.jsxIdentifier("data-uds-slot"), t.stringLiteral(slotInfo.slotName)), t.jsxAttribute(t.jsxIdentifier("data-uds-component"), t.stringLiteral(slotInfo.componentName)));
|
|
192
|
-
transformed = true;
|
|
193
|
-
},
|
|
194
71
|
ImportDeclaration(nodePath) {
|
|
195
72
|
const importSource = nodePath.node.source?.value;
|
|
196
73
|
if (!importSource) return;
|
|
197
|
-
if (importSource
|
|
198
|
-
|
|
199
|
-
if (specifier.imported.name === "motion") hasMotionImport = true;
|
|
200
|
-
if (specifier.imported.name === "AnimatePresence") hasAnimatePresenceImport = true;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
if (!isUdsImportSource(importSource)) return;
|
|
204
|
-
for (const specifier of nodePath.node.specifiers) {
|
|
205
|
-
const localName = specifier.local?.name;
|
|
206
|
-
if (localName) udsImportedNames.add(localName);
|
|
207
|
-
}
|
|
74
|
+
if (!(!importSource.startsWith(".") && !importSource.startsWith("/"))) return;
|
|
75
|
+
let shouldRewriteSource = false;
|
|
208
76
|
for (const specifier of nodePath.node.specifiers) {
|
|
209
77
|
if (specifier.type !== "ImportSpecifier") continue;
|
|
210
|
-
const importedName = specifier.imported?.type === "Identifier" ? specifier.imported.name :
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
if (
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
if (importedName === "createVariants") {
|
|
218
|
-
const localName = specifier.local?.name ?? importedName;
|
|
219
|
-
createVariantsImportNames.add(localName);
|
|
220
|
-
continue;
|
|
221
|
-
}
|
|
222
|
-
if (importedName === "createComponent") {
|
|
223
|
-
const localName = specifier.local?.name ?? importedName;
|
|
224
|
-
createComponentImportNames.add(localName);
|
|
78
|
+
const importedName = specifier.imported?.type === "Identifier" ? specifier.imported.name : void 0;
|
|
79
|
+
const localName = specifier.local?.name;
|
|
80
|
+
if (!importedName || !localName) continue;
|
|
81
|
+
if (Object.hasOwn(manifest.components, importedName)) {
|
|
82
|
+
udsImportedNames.add(localName);
|
|
83
|
+
shouldRewriteSource = true;
|
|
225
84
|
}
|
|
226
85
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
if (init.type === "CallExpression" && init.callee?.type === "Identifier" && createVariantsImportNames.has(init.callee.name) && id?.type === "Identifier") {
|
|
233
|
-
const variantClassMap = styleRuntime.extractVariantClassMapFromCreateVariantsCall(init);
|
|
234
|
-
if (variantClassMap) createVariantsClassMaps.set(id.name, variantClassMap);
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
if (init.type === "CallExpression" && init.callee?.type === "Identifier" && init.callee.name === "createComponentStyler" && init.arguments[0]?.type === "StringLiteral" && id?.type === "Identifier") {
|
|
238
|
-
stylerToComponent.set(id.name, init.arguments[0].value);
|
|
239
|
-
return;
|
|
240
|
-
}
|
|
241
|
-
if (init.type === "CallExpression" && init.callee?.type === "Identifier" && id?.type === "Identifier") {
|
|
242
|
-
const componentName = stylerToComponent.get(init.callee.name);
|
|
243
|
-
if (componentName) classesVarToComponent.set(id.name, componentName);
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
|
-
if (init.type === "CallExpression" && init.callee?.type === "MemberExpression" && init.callee.property?.name === "resolve" && init.callee.object?.type === "Identifier" && id?.type === "ObjectPattern") {
|
|
247
|
-
const componentName = stylerToComponent.get(init.callee.object.name);
|
|
248
|
-
if (componentName) {
|
|
249
|
-
for (const prop of id.properties) if (prop.type === "ObjectProperty" && prop.key?.type === "Identifier" && prop.key.name === "classes") {
|
|
250
|
-
const valueName = prop.value?.type === "Identifier" ? prop.value.name : "classes";
|
|
251
|
-
classesVarToComponent.set(valueName, componentName);
|
|
252
|
-
break;
|
|
253
|
-
}
|
|
86
|
+
if (!shouldRewriteSource && /\/uds\/components\/[^/]+$/.test(importSource)) {
|
|
87
|
+
const tail = importSource.split("/").pop();
|
|
88
|
+
if (tail) {
|
|
89
|
+
const pascal = tail.split("-").filter(Boolean).map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join("");
|
|
90
|
+
if (Object.hasOwn(manifest.components, pascal)) shouldRewriteSource = true;
|
|
254
91
|
}
|
|
255
92
|
}
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
const callee = nodePath.node.callee;
|
|
259
|
-
if (callee.type !== "Identifier") return;
|
|
260
|
-
if (isCompiledJsxCallee(callee)) {
|
|
261
|
-
const firstArg = nodePath.node.arguments[0];
|
|
262
|
-
if (t.isIdentifier(firstArg) && isUdsComponentReference(nodePath, firstArg.name, allUdsComponents, udsImportedNames, createComponentDefinedNames, customComponents) && styleRuntime.transformCompiledJsxStyleProps(nodePath.node, hoistedVariantClassMapNames, hoistedVariantClassMaps)) transformed = true;
|
|
263
|
-
const compiledResult = handleCompiledJsxDataAttrs(nodePath.node, classesVarToComponent, stylerToComponent, slotPropsVarToComponent, manifest);
|
|
264
|
-
if (compiledResult.transformed) transformed = true;
|
|
265
|
-
if (compiledResult.needsMotionImport) needsMotionImport = true;
|
|
266
|
-
if (compiledResult.needsResolveMotionStateImport) needsResolveMotionStateImport = true;
|
|
267
|
-
return;
|
|
268
|
-
}
|
|
269
|
-
const isCreateComponentCall = createComponentImportNames.has(callee.name) || createComponentImportNames.size === 0 && callee.name === "createComponent";
|
|
270
|
-
if (!isCreateComponentCall) return;
|
|
271
|
-
const args = nodePath.node.arguments;
|
|
272
|
-
const componentName = inferCreateComponentNameFromAssignment(nodePath);
|
|
273
|
-
if (!componentName) return;
|
|
274
|
-
createComponentDefinedNames.add(componentName);
|
|
275
|
-
let renderFn = null;
|
|
276
|
-
if (isCreateComponentCall) {
|
|
277
|
-
if (args.length >= 2 && args[0]?.type === "StringLiteral" && isCreateComponentRenderFnNode(args[1])) throw nodePath.buildCodeFrameError("createComponent(\"Name\", renderFn) is no longer supported. Use createComponent(renderFn).");
|
|
278
|
-
const isPrimitiveCreateComponentCall = args.length === 1 && t.isStringLiteral(args[0]);
|
|
279
|
-
if (!(args.length === 1 && isCreateComponentRenderFnNode(args[0])) && !isPrimitiveCreateComponentCall) return;
|
|
280
|
-
if (isCreateComponentRenderFnNode(args[0])) renderFn = args[0];
|
|
281
|
-
}
|
|
282
|
-
if (renderFn) {
|
|
283
|
-
const classesParam = findClassesParamName(renderFn);
|
|
284
|
-
if (classesParam) classesVarToComponent.set(classesParam, componentName);
|
|
285
|
-
const slotPropsParam = findSlotPropsParamName(renderFn);
|
|
286
|
-
if (slotPropsParam) slotPropsVarToComponent.set(slotPropsParam, componentName);
|
|
287
|
-
}
|
|
288
|
-
const loweredData = resolveLoweredCreateComponentData(componentName, renderFn ? extractOwnPropKeys(renderFn) : [], manifest, transformData);
|
|
289
|
-
if (args.length === 1 && t.isStringLiteral(args[0])) {
|
|
290
|
-
loweredData.rootElement = args[0].value;
|
|
291
|
-
if (canInlineSimpleLoweredComponent(loweredData)) {
|
|
292
|
-
const primitiveResult = buildInlineSimplePrimitiveCreateComponentRenderFn(loweredData);
|
|
293
|
-
nodePath.replaceWith(primitiveResult.expression);
|
|
294
|
-
if (primitiveResult.needsProcessStylePropsImport) needsProcessStylePropsImport = true;
|
|
295
|
-
needsCreateComponentImportCleanup = true;
|
|
296
|
-
transformed = true;
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
nodePath.replaceWith(t.callExpression(t.cloneNode(callee), [buildLoweredCreateComponentConfigExpression(loweredData), t.cloneNode(args[0], true)]));
|
|
93
|
+
if (shouldRewriteSource) {
|
|
94
|
+
nodePath.node.source.value = "#uds/components";
|
|
300
95
|
transformed = true;
|
|
301
|
-
return;
|
|
302
96
|
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
97
|
+
},
|
|
98
|
+
JSXOpeningElement(nodePath) {
|
|
99
|
+
const jsxName = nodePath.node.name;
|
|
100
|
+
const jsxTagName = jsxName?.type === "JSXIdentifier" ? jsxName.name : void 0;
|
|
101
|
+
if (!jsxTagName) return;
|
|
102
|
+
if (!udsImportedNames.has(jsxTagName)) return;
|
|
103
|
+
const componentEntry = manifest.components[jsxTagName];
|
|
104
|
+
if (!componentEntry) return;
|
|
105
|
+
if (isDev) {
|
|
106
|
+
injectInternalUdsProps(nodePath, resourcePath, projectRoot, {
|
|
107
|
+
componentName: jsxTagName,
|
|
108
|
+
slotName: "root"
|
|
109
|
+
});
|
|
310
110
|
transformed = true;
|
|
311
|
-
return;
|
|
312
111
|
}
|
|
313
|
-
if (!
|
|
314
|
-
|
|
315
|
-
|
|
112
|
+
if (!componentEntry.propBindings) return;
|
|
113
|
+
if (componentEntry.type !== "primitive") return;
|
|
114
|
+
if (nodePath.node.attributes.some((attr) => attr.type === "JSXAttribute" && attr.name?.type === "JSXIdentifier" && attr.name.name === "motion")) return;
|
|
115
|
+
const closingElement = (nodePath.parentPath?.node)?.closingElement ?? null;
|
|
116
|
+
if (lowerNewApiPrimitiveJsx(nodePath.node, closingElement, {
|
|
117
|
+
tag: componentEntry.element,
|
|
118
|
+
propBindings: componentEntry.propBindings,
|
|
119
|
+
defaultClassNames: componentEntry.defaultClassNames ?? [],
|
|
120
|
+
componentName: jsxTagName
|
|
121
|
+
}, t)) transformed = true;
|
|
316
122
|
}
|
|
317
123
|
});
|
|
318
|
-
if (needsCreateComponentImportCleanup) traverse(ast, { ImportDeclaration(nodePath) {
|
|
319
|
-
const importSource = nodePath.node.source?.value;
|
|
320
|
-
if (!importSource) return;
|
|
321
|
-
if (!isUdsImportSource(importSource)) return;
|
|
322
|
-
const nextSpecifiers = nodePath.node.specifiers.filter((specifier) => {
|
|
323
|
-
if (specifier.type !== "ImportSpecifier") return true;
|
|
324
|
-
const importedName = specifier.imported?.type === "Identifier" ? specifier.imported.name : specifier.imported?.value;
|
|
325
|
-
if (importedName !== "createComponent") return true;
|
|
326
|
-
const localName = specifier.local?.name ?? importedName;
|
|
327
|
-
nodePath.scope.crawl();
|
|
328
|
-
const binding = nodePath.scope.getBinding(localName);
|
|
329
|
-
return Boolean(binding?.referenced);
|
|
330
|
-
});
|
|
331
|
-
if (nextSpecifiers.length === nodePath.node.specifiers.length) return;
|
|
332
|
-
if (nextSpecifiers.length === 0) {
|
|
333
|
-
nodePath.remove();
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
nodePath.node.specifiers = nextSpecifiers;
|
|
337
|
-
} });
|
|
338
124
|
if (!transformed) return source;
|
|
339
|
-
const sourceDir = path.dirname(resourcePath || projectRoot);
|
|
340
|
-
for (const [componentName, importPath] of importsToAdd) {
|
|
341
|
-
const absoluteImport = path.resolve(projectRoot, importPath);
|
|
342
|
-
let resolvedPath = path.relative(sourceDir, absoluteImport);
|
|
343
|
-
if (!resolvedPath.startsWith(".")) resolvedPath = `./${resolvedPath}`;
|
|
344
|
-
ast.program.body.unshift(t.importDeclaration([t.importSpecifier(t.identifier(componentName), t.identifier(componentName))], t.stringLiteral(resolvedPath)));
|
|
345
|
-
}
|
|
346
|
-
const motionImportSpecifiers = [];
|
|
347
|
-
if (needsMotionImport && !hasMotionImport) motionImportSpecifiers.push(t.importSpecifier(t.identifier("motion"), t.identifier("motion")));
|
|
348
|
-
if (needsAnimatePresenceImport && !hasAnimatePresenceImport) motionImportSpecifiers.push(t.importSpecifier(t.identifier("AnimatePresence"), t.identifier("AnimatePresence")));
|
|
349
|
-
if (motionImportSpecifiers.length > 0) ast.program.body.unshift(t.importDeclaration(motionImportSpecifiers, t.stringLiteral("motion/react")));
|
|
350
|
-
if (needsProcessStylePropsImport) {
|
|
351
|
-
if (!ast.program.body.some((node) => t.isImportDeclaration(node) && node.specifiers.some((s) => t.isImportSpecifier(s) && (t.isIdentifier(s.imported) && s.imported.name === "processStyleProps" || t.isStringLiteral(s.imported) && s.imported.value === "processStyleProps")))) ast.program.body.unshift(t.importDeclaration([t.importSpecifier(t.identifier("processStyleProps"), t.identifier("processStyleProps"))], t.stringLiteral("@uds/core")));
|
|
352
|
-
}
|
|
353
|
-
if (needsResolveMotionStateImport) ast.program.body.unshift(t.importDeclaration([t.importSpecifier(t.identifier("__rms"), t.identifier("resolveMotionState"))], t.stringLiteral("@uds/core")));
|
|
354
|
-
const motionStatesMap = getHoistedMotionStates();
|
|
355
|
-
if (motionStatesMap.size > 0) for (const [varName, statesConfig] of motionStatesMap) ast.program.body.unshift(t.variableDeclaration("const", [t.variableDeclarator(t.identifier(varName), t.valueToNode(statesConfig))]));
|
|
356
|
-
if (hoistedVariantClassMaps.size > 0) {
|
|
357
|
-
const declarations = [];
|
|
358
|
-
for (const [lookupName, classMap] of hoistedVariantClassMaps) declarations.push(t.variableDeclaration("const", [t.variableDeclarator(t.identifier(lookupName), t.objectExpression(Object.entries(classMap).map(([variantName, className]) => t.objectProperty(t.stringLiteral(variantName), t.stringLiteral(className)))))]));
|
|
359
|
-
const firstNonImportIndex = ast.program.body.findIndex((node) => node.type !== "ImportDeclaration");
|
|
360
|
-
if (firstNonImportIndex === -1) ast.program.body.push(...declarations);
|
|
361
|
-
else ast.program.body.splice(firstNonImportIndex, 0, ...declarations);
|
|
362
|
-
}
|
|
363
125
|
return generate(ast, {
|
|
364
126
|
retainLines: true,
|
|
365
127
|
sourceMaps: false
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "../../config/dist/index.js";
|
|
2
|
+
import "./loader/artifacts.js";
|
|
3
|
+
import "./loader.js";
|
|
4
|
+
import "./loader/babel-utils.js";
|
|
5
|
+
import "../../codegen/dist/loader/getLoaderArtifacts.js";
|
|
6
|
+
import "node:path";
|
|
7
|
+
import "@babel/types";
|
|
8
|
+
import "@babel/parser";
|
|
9
|
+
import "node:zlib";
|
|
10
|
+
//#region ../loader/dist/transform-runner.js
|
|
11
|
+
const VIRTUAL_ARTIFACTS_DIR = "/virtual/uds-loader-artifacts";
|
|
12
|
+
`${VIRTUAL_ARTIFACTS_DIR}`;
|
|
13
|
+
`${VIRTUAL_ARTIFACTS_DIR}`;
|
|
14
|
+
//#endregion
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as _$unplugin from "unplugin";
|
|
2
|
+
|
|
3
|
+
//#region ../loader/dist/unplugin.d.ts
|
|
4
|
+
//#region src/unplugin.d.ts
|
|
5
|
+
interface UdsPluginOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Path to `.uds/meta-loader.json` (default: `<cwd>/.uds/meta-loader.json`)
|
|
8
|
+
*/
|
|
9
|
+
manifestPath?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Enable development-only metadata transforms.
|
|
12
|
+
* Defaults to `process.env.NODE_ENV !== 'production'`.
|
|
13
|
+
*/
|
|
14
|
+
isDev?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Include filters for files to transform.
|
|
17
|
+
* Defaults to JS/TS module extensions.
|
|
18
|
+
*/
|
|
19
|
+
include?: RegExp | RegExp[];
|
|
20
|
+
/**
|
|
21
|
+
* Exclude filters for files to skip.
|
|
22
|
+
*/
|
|
23
|
+
exclude?: RegExp | RegExp[];
|
|
24
|
+
}
|
|
25
|
+
declare const udsPlugin: _$unplugin.UnpluginInstance<UdsPluginOptions, boolean>; //#endregion
|
|
26
|
+
//#endregion
|
|
27
|
+
export { UdsPluginOptions, udsPlugin };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { transformLoader } from "./loader.js";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { createUnplugin } from "unplugin";
|
|
4
|
+
//#region ../loader/dist/unplugin.js
|
|
5
|
+
const DEFAULT_INCLUDE = /\.[cm]?[jt]sx?$/;
|
|
6
|
+
function toArray(value) {
|
|
7
|
+
if (!value) return [];
|
|
8
|
+
return Array.isArray(value) ? value : [value];
|
|
9
|
+
}
|
|
10
|
+
function sanitizeId(id) {
|
|
11
|
+
const queryStart = id.indexOf("?");
|
|
12
|
+
const hashStart = id.indexOf("#");
|
|
13
|
+
const cutIndex = queryStart === -1 ? hashStart : hashStart === -1 ? queryStart : Math.min(queryStart, hashStart);
|
|
14
|
+
return cutIndex === -1 ? id : id.slice(0, cutIndex);
|
|
15
|
+
}
|
|
16
|
+
function matchesFilters(id, includes, excludes) {
|
|
17
|
+
if (excludes.some((pattern) => pattern.test(id))) return false;
|
|
18
|
+
if (includes.length === 0) return true;
|
|
19
|
+
return includes.some((pattern) => pattern.test(id));
|
|
20
|
+
}
|
|
21
|
+
const udsPlugin = createUnplugin((options = {}) => {
|
|
22
|
+
const includePatterns = toArray(options.include ?? DEFAULT_INCLUDE);
|
|
23
|
+
const excludePatterns = toArray(options.exclude);
|
|
24
|
+
const manifestPath = path.resolve(process.cwd(), options.manifestPath ?? ".uds/meta-loader.json");
|
|
25
|
+
const isDev = options.isDev ?? true;
|
|
26
|
+
return {
|
|
27
|
+
name: "uds-unplugin",
|
|
28
|
+
enforce: "pre",
|
|
29
|
+
transformInclude(id) {
|
|
30
|
+
return matchesFilters(sanitizeId(id), includePatterns, excludePatterns);
|
|
31
|
+
},
|
|
32
|
+
transform(code, id) {
|
|
33
|
+
const resourcePath = sanitizeId(id);
|
|
34
|
+
if (!matchesFilters(resourcePath, includePatterns, excludePatterns)) return null;
|
|
35
|
+
const transformedCode = transformLoader.call({
|
|
36
|
+
getOptions: () => ({
|
|
37
|
+
manifestPath,
|
|
38
|
+
isDev
|
|
39
|
+
}),
|
|
40
|
+
addDependency: () => {},
|
|
41
|
+
resourcePath
|
|
42
|
+
}, code);
|
|
43
|
+
if (transformedCode === code) return null;
|
|
44
|
+
return {
|
|
45
|
+
code: transformedCode,
|
|
46
|
+
map: null
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
//#endregion
|
|
52
|
+
export { udsPlugin };
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { type
|
|
1
|
+
import { UdsPluginOptions, udsPlugin } from "./loader/dist/unplugin.js";
|
|
2
|
+
export { type UdsPluginOptions, udsPlugin };
|
package/dist/plugin.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { udsPlugin } from "./loader/dist/unplugin.js";
|
|
2
|
+
import "./loader/dist/index.js";
|
|
3
|
+
export { udsPlugin };
|