@fluentic/style 0.1.0-beta.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/CHANGELOG.md +32 -0
- package/LICENSE +21 -0
- package/README.md +409 -0
- package/atomic/atRule/counterStyle.ts +35 -0
- package/atomic/atRule/fontFace.ts +37 -0
- package/atomic/atRule/fontPaletteValues.ts +36 -0
- package/atomic/atRule/fontSrc.ts +13 -0
- package/atomic/atRule/keyframes.ts +43 -0
- package/atomic/atRule/positionTry.ts +73 -0
- package/atomic/atRule/property.ts +39 -0
- package/atomic/atRule/utils.ts +81 -0
- package/atomic/className.ts +93 -0
- package/atomic/debug/className/className.ts +33 -0
- package/atomic/debug/className/index.ts +1 -0
- package/atomic/debug/property/data.ts +59 -0
- package/atomic/debug/property/index.ts +1 -0
- package/atomic/debug/property/property.ts +59 -0
- package/atomic/debug/selector.ts +88 -0
- package/atomic/debug/value.ts +53 -0
- package/atomic/element.ts +29 -0
- package/atomic/layer/README.md +116 -0
- package/atomic/layer/index.ts +3 -0
- package/atomic/layer/layer.ts +95 -0
- package/atomic/layer/types.ts +37 -0
- package/atomic/layer/utils.ts +51 -0
- package/atomic/property/index.ts +2 -0
- package/atomic/property/presets.ts +34 -0
- package/atomic/property/property.ts +13 -0
- package/atomic/property/type_maps.ts +389 -0
- package/atomic/property/types.ts +7 -0
- package/atomic/rule.ts +116 -0
- package/atomic/theme.ts +48 -0
- package/atomic/token.ts +53 -0
- package/atomic/utils/css.ts +49 -0
- package/atomic/utils/debug.ts +37 -0
- package/atomic/utils/format.ts +192 -0
- package/atomic/utils/selector.ts +14 -0
- package/atomic/utils/types.ts +11 -0
- package/atomic/value/index.ts +2 -0
- package/atomic/value/unitless.ts +47 -0
- package/atomic/value/value.ts +17 -0
- package/atomic/var.ts +19 -0
- package/builder/data/check_selector.noop.ts +8 -0
- package/builder/data/check_selector.ts +30 -0
- package/builder/data/const.ts +25 -0
- package/builder/data/create.ts +96 -0
- package/builder/data/data.ts +63 -0
- package/builder/data/debug.ts +113 -0
- package/builder/data/index.ts +9 -0
- package/builder/data/is.ts +68 -0
- package/builder/data/merge/index.ts +2 -0
- package/builder/data/merge/scope.ts +300 -0
- package/builder/data/merge/style.ts +284 -0
- package/builder/data/merge/utils.ts +35 -0
- package/builder/data/selector.ts +11 -0
- package/builder/data/state.ts +134 -0
- package/builder/extract/index.ts +6 -0
- package/builder/extract/scope.ts +30 -0
- package/builder/extract/slot.ts +36 -0
- package/builder/extract/style.ts +89 -0
- package/builder/extract/theme.ts +16 -0
- package/builder/extract/token.ts +41 -0
- package/builder/extract/utils.ts +95 -0
- package/builder/extract/withTokens.ts +64 -0
- package/builder/index.ts +2 -0
- package/builder/style_builder.ts +234 -0
- package/builder/style_data.ts +81 -0
- package/builder/style_fns.ts +611 -0
- package/builder/types/alias.ts +83 -0
- package/builder/types/fns.ts +185 -0
- package/builder/types/index.ts +1 -0
- package/builder/types/types.ts +51 -0
- package/builder/utils.ts +19 -0
- package/compiler/compiler/cache.ts +155 -0
- package/compiler/compiler/compiler.ts +173 -0
- package/compiler/compiler/index.ts +3 -0
- package/compiler/compiler/types.ts +62 -0
- package/compiler/extract/collector.ts +25 -0
- package/compiler/extract/extract.ts +51 -0
- package/compiler/extract/index.ts +3 -0
- package/compiler/extract/types.ts +35 -0
- package/compiler/index.ts +2 -0
- package/compiler/transform/debug/index.ts +2 -0
- package/compiler/transform/debug/plugin.ts +1347 -0
- package/compiler/transform/debug/transform.ts +47 -0
- package/compiler/transform/debug/utils/debug_data.ts +187 -0
- package/compiler/transform/debug/utils/source_url.ts +29 -0
- package/compiler/transform/evaluator/evaluator.ts +1138 -0
- package/compiler/transform/evaluator/index.ts +3 -0
- package/compiler/transform/evaluator/tracer.ts +607 -0
- package/compiler/transform/evaluator/types.ts +22 -0
- package/compiler/transform/extract/chain/chain.ts +2343 -0
- package/compiler/transform/extract/chain/extract_chain.ts +89 -0
- package/compiler/transform/extract/chain/index.ts +3 -0
- package/compiler/transform/extract/chain/types.ts +37 -0
- package/compiler/transform/extract/index.ts +2 -0
- package/compiler/transform/extract/plugin.ts +665 -0
- package/compiler/transform/extract/transform.ts +45 -0
- package/compiler/transform/extract/utils/imports.ts +132 -0
- package/compiler/transform/extract/utils/replacement.ts +349 -0
- package/compiler/transform/extract/utils/slot.ts +186 -0
- package/compiler/transform/extract/utils/state.ts +48 -0
- package/compiler/transform/extract/utils/theme.ts +86 -0
- package/compiler/transform/extract/utils/token.ts +1 -0
- package/compiler/transform/index.ts +5 -0
- package/compiler/transform/syntax/index.ts +5 -0
- package/compiler/transform/syntax/isStaticStyleValue.ts +44 -0
- package/compiler/transform/syntax/isStyleChainCall.ts +16 -0
- package/compiler/transform/syntax/static_ids.ts +282 -0
- package/compiler/transform/syntax/types.ts +7 -0
- package/compiler/transform/syntax/utils.ts +31 -0
- package/compiler/transform/utils/babel.ts +100 -0
- package/compiler/transform/utils/import.ts +47 -0
- package/compiler/transform/utils/path.ts +13 -0
- package/compiler/transform/utils/selector.ts +252 -0
- package/compiler/utils/constants.ts +69 -0
- package/compiler/utils/file_resolver.ts +72 -0
- package/compiler/utils/import_source.ts +200 -0
- package/compiler/utils/imports.ts +24 -0
- package/compiler/utils/path.ts +40 -0
- package/compiler/utils/sourcemap.ts +61 -0
- package/config/build.ts +32 -0
- package/config/config/css.ts +32 -0
- package/config/config/css_extra.ts +22 -0
- package/config/config/debug.ts +26 -0
- package/config/config/dev.ts +145 -0
- package/config/config/runtime.ts +29 -0
- package/config/configure.ts +28 -0
- package/config/constants.ts +1 -0
- package/config/index.ts +2 -0
- package/config/types.ts +56 -0
- package/config/utils.ts +5 -0
- package/css/counterStyle.ts +20 -0
- package/css/fontFace.ts +25 -0
- package/css/fontPaletteValues.ts +20 -0
- package/css/index.ts +8 -0
- package/css/keyframes.ts +20 -0
- package/css/positionTry.ts +20 -0
- package/css/property.ts +32 -0
- package/css/utils.ts +56 -0
- package/dev/config.ts +16 -0
- package/dev/fns.ts +48 -0
- package/dev/index.ts +2 -0
- package/dev/trace.ts +413 -0
- package/dev/utils.ts +528 -0
- package/dist/assert-h_Zkqc4E.js +105 -0
- package/dist/assert-h_Zkqc4E.js.map +1 -0
- package/dist/className-C1Ht5Wvv.js +144 -0
- package/dist/className-C1Ht5Wvv.js.map +1 -0
- package/dist/className-DC2Cq8p3.js +251 -0
- package/dist/className-DC2Cq8p3.js.map +1 -0
- package/dist/compiler/index.mjs +2 -0
- package/dist/compiler-DweanHoB.mjs +6847 -0
- package/dist/compiler-DweanHoB.mjs.map +1 -0
- package/dist/config/index.js +3 -0
- package/dist/config-BryWDfQX.js +25 -0
- package/dist/config-BryWDfQX.js.map +1 -0
- package/dist/config-DKHXWhe1.js +1 -0
- package/dist/config-Di2VYYKV.js +6 -0
- package/dist/config-Di2VYYKV.js.map +1 -0
- package/dist/config-DloHOG6I.js +13 -0
- package/dist/config-DloHOG6I.js.map +1 -0
- package/dist/css-BowBszUt.js +243 -0
- package/dist/css-BowBszUt.js.map +1 -0
- package/dist/css-ByOrugEX.js +805 -0
- package/dist/css-ByOrugEX.js.map +1 -0
- package/dist/css-DcazYor9.js +235 -0
- package/dist/css-DcazYor9.js.map +1 -0
- package/dist/css.js +2 -0
- package/dist/css_extra-DlOnsnR1.js +8 -0
- package/dist/css_extra-DlOnsnR1.js.map +1 -0
- package/dist/css_extra-oIi3UEPK.js +8 -0
- package/dist/css_extra-oIi3UEPK.js.map +1 -0
- package/dist/data-_te7t0M4.js +473 -0
- package/dist/data-_te7t0M4.js.map +1 -0
- package/dist/debug-BAw63qX6.js +15 -0
- package/dist/debug-BAw63qX6.js.map +1 -0
- package/dist/debug-DGki_v7g.js +15 -0
- package/dist/debug-DGki_v7g.js.map +1 -0
- package/dist/debug-n2aZQBSa.js +172 -0
- package/dist/debug-n2aZQBSa.js.map +1 -0
- package/dist/dev/rsc.js +183 -0
- package/dist/dev/rsc.js.map +1 -0
- package/dist/dev-CcphAa3R.js +376 -0
- package/dist/dev-CcphAa3R.js.map +1 -0
- package/dist/dev-DfBbuLeE.js +71 -0
- package/dist/dev-DfBbuLeE.js.map +1 -0
- package/dist/dev.js +2 -0
- package/dist/elementMarker-Bu7gDAkE.js +800 -0
- package/dist/elementMarker-Bu7gDAkE.js.map +1 -0
- package/dist/entry/dev/css.js +3 -0
- package/dist/entry/dev/jsx-dev-runtime.js +3 -0
- package/dist/entry/dev/jsx-runtime.js +3 -0
- package/dist/entry/dev.js +10 -0
- package/dist/entry/prod/css.js +3 -0
- package/dist/entry/prod/extract.js +3 -0
- package/dist/entry/prod/jsx-dev-runtime.js +3 -0
- package/dist/entry/prod/jsx-runtime.js +3 -0
- package/dist/entry/prod/runtime.js +5 -0
- package/dist/entry/prod.js +1230 -0
- package/dist/entry/prod.js.map +1 -0
- package/dist/entry/rsc-dev/css.js +3 -0
- package/dist/entry/rsc-dev/dev.js +544 -0
- package/dist/entry/rsc-dev/dev.js.map +1 -0
- package/dist/entry/rsc-dev/jsx-dev-runtime.js +12 -0
- package/dist/entry/rsc-dev/jsx-dev-runtime.js.map +1 -0
- package/dist/entry/rsc-dev/jsx-runtime.js +3 -0
- package/dist/entry/rsc-dev.js +1429 -0
- package/dist/entry/rsc-dev.js.map +1 -0
- package/dist/entry/rsc-prod/css.js +3 -0
- package/dist/entry/rsc-prod/jsx-dev-runtime.js +3 -0
- package/dist/entry/rsc-prod/jsx-runtime.js +3 -0
- package/dist/entry/rsc-prod/runtime.js +5 -0
- package/dist/entry/rsc-prod.js +10 -0
- package/dist/extract-CzWJeQi8.js +121 -0
- package/dist/extract-CzWJeQi8.js.map +1 -0
- package/dist/extract-DEwSDJ9Z.js +2 -0
- package/dist/format-3nKBE_5t.js +144 -0
- package/dist/format-3nKBE_5t.js.map +1 -0
- package/dist/getClassName-BlvXHYuf.js +260 -0
- package/dist/getClassName-BlvXHYuf.js.map +1 -0
- package/dist/global-CvfmFLsK.js +11 -0
- package/dist/global-CvfmFLsK.js.map +1 -0
- package/dist/index.js +9 -0
- package/dist/jsx/jsx-dev-runtime.js +12 -0
- package/dist/jsx/jsx-dev-runtime.js.map +1 -0
- package/dist/jsx/jsx-dev-runtime.server.js +11 -0
- package/dist/jsx/jsx-dev-runtime.server.js.map +1 -0
- package/dist/jsx/jsx-runtime.js +13 -0
- package/dist/jsx/jsx-runtime.js.map +1 -0
- package/dist/jsx/jsx-runtime.server.js +12 -0
- package/dist/jsx/jsx-runtime.server.js.map +1 -0
- package/dist/jsx-CwTeyUxr.js +39 -0
- package/dist/jsx-CwTeyUxr.js.map +1 -0
- package/dist/jsx-D2BksHSv.js +38 -0
- package/dist/jsx-D2BksHSv.js.map +1 -0
- package/dist/jsx_dev_runtime-B6xs4by8.js +12 -0
- package/dist/jsx_dev_runtime-B6xs4by8.js.map +1 -0
- package/dist/jsx_runtime-04xfnsi7.js +13 -0
- package/dist/jsx_runtime-04xfnsi7.js.map +1 -0
- package/dist/jsx_runtime-iHLDwpcW.js +12 -0
- package/dist/jsx_runtime-iHLDwpcW.js.map +1 -0
- package/dist/layer-D1SaH07m.js +94 -0
- package/dist/layer-D1SaH07m.js.map +1 -0
- package/dist/loader-DS61nRqr.mjs +81 -0
- package/dist/loader-DS61nRqr.mjs.map +1 -0
- package/dist/misc-B9kqEb2N.mjs +360 -0
- package/dist/misc-B9kqEb2N.mjs.map +1 -0
- package/dist/plugin/farm/index.mjs +176 -0
- package/dist/plugin/farm/index.mjs.map +1 -0
- package/dist/plugin/nextjs/index.mjs +282 -0
- package/dist/plugin/nextjs/index.mjs.map +1 -0
- package/dist/plugin/nextjs/loader.mjs +162 -0
- package/dist/plugin/nextjs/loader.mjs.map +1 -0
- package/dist/plugin/parcel/index.cjs +9 -0
- package/dist/plugin/parcel/index.mjs +5 -0
- package/dist/plugin/parcel/optimizer.cjs +28 -0
- package/dist/plugin/parcel/optimizer.cjs.map +1 -0
- package/dist/plugin/parcel/optimizer.mjs +29 -0
- package/dist/plugin/parcel/optimizer.mjs.map +1 -0
- package/dist/plugin/parcel/resolver.cjs +17 -0
- package/dist/plugin/parcel/resolver.cjs.map +1 -0
- package/dist/plugin/parcel/resolver.mjs +18 -0
- package/dist/plugin/parcel/resolver.mjs.map +1 -0
- package/dist/plugin/parcel/runtime.cjs +17 -0
- package/dist/plugin/parcel/runtime.cjs.map +1 -0
- package/dist/plugin/parcel/runtime.mjs +17 -0
- package/dist/plugin/parcel/runtime.mjs.map +1 -0
- package/dist/plugin/parcel/transformer.cjs +41 -0
- package/dist/plugin/parcel/transformer.cjs.map +1 -0
- package/dist/plugin/parcel/transformer.mjs +41 -0
- package/dist/plugin/parcel/transformer.mjs.map +1 -0
- package/dist/plugin/rspack/index.mjs +11 -0
- package/dist/plugin/rspack/index.mjs.map +1 -0
- package/dist/plugin/vite/index.mjs +176 -0
- package/dist/plugin/vite/index.mjs.map +1 -0
- package/dist/plugin/webpack/index.mjs +2 -0
- package/dist/plugin/webpack/loader.mjs +19 -0
- package/dist/plugin/webpack/loader.mjs.map +1 -0
- package/dist/presets-Bye3ea2x.js +139 -0
- package/dist/presets-Bye3ea2x.js.map +1 -0
- package/dist/property-CnLFt5kx.js +406 -0
- package/dist/property-CnLFt5kx.js.map +1 -0
- package/dist/registry-CyIj8LYK.mjs +22 -0
- package/dist/registry-CyIj8LYK.mjs.map +1 -0
- package/dist/rules-9HSO1pxL.js +767 -0
- package/dist/rules-9HSO1pxL.js.map +1 -0
- package/dist/runtime-CYqNCiaM.js +53 -0
- package/dist/runtime-CYqNCiaM.js.map +1 -0
- package/dist/selector/index.js +3 -0
- package/dist/server.js +63 -0
- package/dist/server.js.map +1 -0
- package/dist/shared-BAL9peIw.cjs +7646 -0
- package/dist/shared-BAL9peIw.cjs.map +1 -0
- package/dist/shared-CCpq1zqA.mjs +132 -0
- package/dist/shared-CCpq1zqA.mjs.map +1 -0
- package/dist/sidecar-4u6GnlQG.mjs +236 -0
- package/dist/sidecar-4u6GnlQG.mjs.map +1 -0
- package/dist/style-4rFUy-zW.js +752 -0
- package/dist/style-4rFUy-zW.js.map +1 -0
- package/dist/style-B1UUqjj5.js +743 -0
- package/dist/style-B1UUqjj5.js.map +1 -0
- package/dist/style-Cw3NtvR0.js +5 -0
- package/dist/style-DNqQ6H-7.js +1255 -0
- package/dist/style-DNqQ6H-7.js.map +1 -0
- package/dist/styleStore-Dea_WVbr.js +2000 -0
- package/dist/styleStore-Dea_WVbr.js.map +1 -0
- package/dist/styleStore-DyNXBcUK.js +54 -0
- package/dist/styleStore-DyNXBcUK.js.map +1 -0
- package/dist/token-CKXUECuU.js +76 -0
- package/dist/token-CKXUECuU.js.map +1 -0
- package/dist/token-u_tM-mtg.js +204 -0
- package/dist/token-u_tM-mtg.js.map +1 -0
- package/dist/trace-Bu_qOqRy.js +245 -0
- package/dist/trace-Bu_qOqRy.js.map +1 -0
- package/dist/trace-CU0rvNYr.js +244 -0
- package/dist/trace-CU0rvNYr.js.map +1 -0
- package/dist/utils-BbehLOby.js +2415 -0
- package/dist/utils-BbehLOby.js.map +1 -0
- package/dist/utils-C7xfDxtM.mjs +97 -0
- package/dist/utils-C7xfDxtM.mjs.map +1 -0
- package/dist/utils-CWNHx4EC.js +170 -0
- package/dist/utils-CWNHx4EC.js.map +1 -0
- package/dist/utils-CdI6vZsP.js +37 -0
- package/dist/utils-CdI6vZsP.js.map +1 -0
- package/dist/utils-D7FAOyg6.js +129 -0
- package/dist/utils-D7FAOyg6.js.map +1 -0
- package/dist/utils-DMFgOOtA.mjs +49 -0
- package/dist/utils-DMFgOOtA.mjs.map +1 -0
- package/dist/utils.js +26 -0
- package/dist/utils.js.map +1 -0
- package/dist/value-BR4e2MKt.js +910 -0
- package/dist/value-BR4e2MKt.js.map +1 -0
- package/dist/value-E8rEv2Oe.js +136 -0
- package/dist/value-E8rEv2Oe.js.map +1 -0
- package/dist/valueRef-lshFk1Cs.js +16 -0
- package/dist/valueRef-lshFk1Cs.js.map +1 -0
- package/dist/webpack-CxS2FDYU.mjs +107 -0
- package/dist/webpack-CxS2FDYU.mjs.map +1 -0
- package/dist/withTokens-LRidu3Vc.js +95 -0
- package/dist/withTokens-LRidu3Vc.js.map +1 -0
- package/entry/dev/config.ts +2 -0
- package/entry/dev/css.ts +3 -0
- package/entry/dev/index.ts +3 -0
- package/entry/dev/jsx_dev_runtime.ts +3 -0
- package/entry/dev/jsx_runtime.ts +3 -0
- package/entry/prod/config.ts +2 -0
- package/entry/prod/css.ts +3 -0
- package/entry/prod/extract.ts +1 -0
- package/entry/prod/index.ts +3 -0
- package/entry/prod/jsx_dev_runtime.ts +3 -0
- package/entry/prod/jsx_runtime.ts +3 -0
- package/entry/prod/runtime.ts +14 -0
- package/entry/rsc_dev/config.ts +6 -0
- package/entry/rsc_dev/css.ts +3 -0
- package/entry/rsc_dev/dev.ts +5 -0
- package/entry/rsc_dev/index.ts +3 -0
- package/entry/rsc_dev/jsx_dev_runtime.ts +3 -0
- package/entry/rsc_dev/jsx_runtime.ts +3 -0
- package/entry/rsc_dev/server.ts +11 -0
- package/entry/rsc_prod/config.ts +6 -0
- package/entry/rsc_prod/css.ts +3 -0
- package/entry/rsc_prod/index.ts +3 -0
- package/entry/rsc_prod/jsx_dev_runtime.ts +3 -0
- package/entry/rsc_prod/jsx_runtime.ts +3 -0
- package/entry/rsc_prod/runtime.ts +12 -0
- package/entry/rsc_prod/server.ts +13 -0
- package/entry/shared/config.ts +5 -0
- package/entry/shared/dev.ts +19 -0
- package/entry/shared/prod.ts +4 -0
- package/index.ts +36 -0
- package/jsx/extracted/jsx_dev_runtime.ts +11 -0
- package/jsx/extracted/jsx_runtime.ts +12 -0
- package/jsx/rsc/jsx_dev_runtime.ts +11 -0
- package/jsx/rsc/jsx_runtime.ts +12 -0
- package/jsx/rsc_extracted/jsx_dev_runtime.ts +2 -0
- package/jsx/rsc_extracted/jsx_runtime.ts +2 -0
- package/jsx/runtime/jsx_dev_runtime.ts +11 -0
- package/jsx/runtime/jsx_runtime.ts +12 -0
- package/jsx/types.ts +8 -0
- package/jsx/utils.ts +59 -0
- package/package.json +298 -0
- package/plugin/bundler/farm/index.ts +1 -0
- package/plugin/bundler/farm/plugin.ts +320 -0
- package/plugin/bundler/parcel/config.json +19 -0
- package/plugin/bundler/parcel/index.ts +1 -0
- package/plugin/bundler/parcel/optimizer.ts +36 -0
- package/plugin/bundler/parcel/plugin.ts +4 -0
- package/plugin/bundler/parcel/resolver.ts +36 -0
- package/plugin/bundler/parcel/runtime.ts +23 -0
- package/plugin/bundler/parcel/shared.ts +234 -0
- package/plugin/bundler/parcel/transformer.ts +67 -0
- package/plugin/bundler/rspack/index.ts +1 -0
- package/plugin/bundler/rspack/plugin.ts +14 -0
- package/plugin/bundler/vite/index.ts +1 -0
- package/plugin/bundler/vite/plugin.ts +133 -0
- package/plugin/bundler/vite/state.ts +153 -0
- package/plugin/bundler/webpack/index.ts +1 -0
- package/plugin/bundler/webpack/loader.ts +19 -0
- package/plugin/bundler/webpack/plugin.ts +240 -0
- package/plugin/bundler/webpack/shared/index.ts +2 -0
- package/plugin/bundler/webpack/shared/loader.ts +155 -0
- package/plugin/bundler/webpack/shared/registry.ts +16 -0
- package/plugin/bundler/webpack/utils.ts +96 -0
- package/plugin/nextjs/constants.ts +7 -0
- package/plugin/nextjs/html.ts +62 -0
- package/plugin/nextjs/index.ts +2 -0
- package/plugin/nextjs/loader.ts +222 -0
- package/plugin/nextjs/plugin.ts +532 -0
- package/plugin/nextjs/types.ts +33 -0
- package/plugin/nextjs/utils.ts +210 -0
- package/plugin/utils/cache/css_cache.ts +146 -0
- package/plugin/utils/cache/file.ts +40 -0
- package/plugin/utils/cache/index.ts +2 -0
- package/plugin/utils/compiler.ts +94 -0
- package/plugin/utils/constants.ts +7 -0
- package/plugin/utils/cssMarker.ts +14 -0
- package/plugin/utils/cssOutput.ts +65 -0
- package/plugin/utils/filter.ts +98 -0
- package/plugin/utils/imports.ts +5 -0
- package/plugin/utils/index.ts +10 -0
- package/plugin/utils/injection.ts +28 -0
- package/plugin/utils/misc.ts +5 -0
- package/plugin/utils/runtimeEntry.ts +57 -0
- package/plugin/utils/sidecar/index.ts +1 -0
- package/plugin/utils/sidecar/server.ts +143 -0
- package/plugin/utils/sidecar/sidecar.ts +167 -0
- package/plugin/utils/sidecar/utils.ts +109 -0
- package/plugin/utils/sourcemap.ts +52 -0
- package/plugin/utils/virtual.ts +81 -0
- package/runtime/core/cache/combine.ts +102 -0
- package/runtime/core/cache/index.ts +5 -0
- package/runtime/core/cache/item.ts +231 -0
- package/runtime/core/cache/pool.ts +310 -0
- package/runtime/core/cache/prop.ts +283 -0
- package/runtime/core/cache/propCache.ts +62 -0
- package/runtime/core/cache/resolvedItem.ts +31 -0
- package/runtime/core/cache/result.ts +115 -0
- package/runtime/core/cache/stateItem.ts +208 -0
- package/runtime/core/cache/tokenValues.ts +150 -0
- package/runtime/core/cache/utils/tree.ts +57 -0
- package/runtime/core/cache/utils/walk.ts +24 -0
- package/runtime/core/className.ts +101 -0
- package/runtime/core/combinedStyle.ts +101 -0
- package/runtime/core/createTransformElement.ts +39 -0
- package/runtime/core/elementMarker.ts +189 -0
- package/runtime/core/elementMarkerData.ts +27 -0
- package/runtime/core/getClassName.ts +47 -0
- package/runtime/core/getSheetRules.ts +7 -0
- package/runtime/core/getToken.ts +14 -0
- package/runtime/core/index.ts +5 -0
- package/runtime/core/jsx.ts +4 -0
- package/runtime/core/resolveClassNameRuntime.ts +33 -0
- package/runtime/env.ts +7 -0
- package/runtime/extract/getClassName.ts +476 -0
- package/runtime/extract/index.ts +4 -0
- package/runtime/extract/jsx.ts +55 -0
- package/runtime/index.ts +12 -0
- package/runtime/rsc/constants.ts +6 -0
- package/runtime/rsc/dev.ts +38 -0
- package/runtime/rsc/getClassName.ts +98 -0
- package/runtime/rsc/index.ts +3 -0
- package/runtime/rsc/jsx.ts +4 -0
- package/runtime/rsc/observer.ts +238 -0
- package/runtime/rsc/styleStore.ts +82 -0
- package/runtime/sheet/element.ts +13 -0
- package/runtime/sheet/global-noop.ts +13 -0
- package/runtime/sheet/global-prod.ts +13 -0
- package/runtime/sheet/global.ts +13 -0
- package/runtime/sheet/index.ts +3 -0
- package/runtime/sheet/insert.ts +37 -0
- package/runtime/sheet/rule.ts +77 -0
- package/runtime/sheet/rules.ts +131 -0
- package/runtime/sheet/theme.ts +34 -0
- package/runtime/style/index.ts +3 -0
- package/runtime/style/scope.ts +65 -0
- package/runtime/style/style.ts +34 -0
- package/runtime/style/token.ts +1 -0
- package/runtime/types.ts +42 -0
- package/selector/assert.ts +131 -0
- package/selector/index.ts +5 -0
- package/selector/presets/default.ts +27 -0
- package/selector/presets/index.ts +3 -0
- package/selector/presets/minimal.ts +37 -0
- package/selector/presets/selectors.ts +85 -0
- package/selector/selector.ts +68 -0
- package/selector/types.ts +24 -0
- package/selector/validate.ts +91 -0
- package/sheet/dev/dev_layer.ts +151 -0
- package/sheet/dev/dev_sort.ts +249 -0
- package/sheet/dev/index.ts +129 -0
- package/sheet/dev/utils.ts +130 -0
- package/sheet/index.ts +4 -0
- package/sheet/prod.ts +109 -0
- package/sheet/sheet.ts +10 -0
- package/sheet/sourcemap.ts +70 -0
- package/sheet/types.ts +31 -0
- package/sheet/utils/dom.ts +71 -0
- package/sheet/utils/index.ts +4 -0
- package/sheet/utils/layer.ts +14 -0
- package/sheet/utils/noop.ts +11 -0
- package/sheet/utils/rule.ts +3 -0
- package/sheet/utils/sourcemap.ts +221 -0
- package/style/index.ts +9 -0
- package/style/keyframes.ts +40 -0
- package/style/style.ts +112 -0
- package/style/theme.ts +36 -0
- package/style/token.ts +101 -0
- package/style/tokens.ts +64 -0
- package/style/transform.ts +9 -0
- package/style/types.ts +32 -0
- package/style/utils/expose.ts +43 -0
- package/style/utils/index.ts +1 -0
- package/style/value.ts +103 -0
- package/style/valueRef.ts +25 -0
- package/utils/global.ts +44 -0
- package/utils/hash.ts +22 -0
- package/utils/id.ts +20 -0
- package/utils/object.ts +87 -0
- package/utils/trace.ts +211 -0
- package/utils/type.ts +22 -0
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import type { CSSPropertyName } from '../utils/types';
|
|
2
|
+
import { INTERMEDIATE, LONGHAND, type PropertyTypeRecord, SHORTHAND } from './types';
|
|
3
|
+
|
|
4
|
+
type TypeMap = PropertyTypeRecord<CSSPropertyName>;
|
|
5
|
+
|
|
6
|
+
export const animation: TypeMap = {
|
|
7
|
+
animation: SHORTHAND,
|
|
8
|
+
animationComposition: LONGHAND,
|
|
9
|
+
animationDelay: LONGHAND,
|
|
10
|
+
animationDirection: LONGHAND,
|
|
11
|
+
animationDuration: LONGHAND,
|
|
12
|
+
animationFillMode: LONGHAND,
|
|
13
|
+
animationIterationCount: LONGHAND,
|
|
14
|
+
animationName: LONGHAND,
|
|
15
|
+
animationPlayState: LONGHAND,
|
|
16
|
+
animationRange: INTERMEDIATE,
|
|
17
|
+
animationRangeEnd: LONGHAND,
|
|
18
|
+
animationRangeStart: LONGHAND,
|
|
19
|
+
animationTimeline: LONGHAND,
|
|
20
|
+
animationTimingFunction: LONGHAND,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const background: TypeMap = {
|
|
24
|
+
background: SHORTHAND,
|
|
25
|
+
backgroundAttachment: LONGHAND,
|
|
26
|
+
backgroundBlendMode: LONGHAND,
|
|
27
|
+
backgroundClip: LONGHAND,
|
|
28
|
+
backgroundColor: LONGHAND,
|
|
29
|
+
backgroundImage: LONGHAND,
|
|
30
|
+
backgroundOrigin: LONGHAND,
|
|
31
|
+
backgroundPosition: INTERMEDIATE,
|
|
32
|
+
backgroundPositionX: LONGHAND,
|
|
33
|
+
backgroundPositionY: LONGHAND,
|
|
34
|
+
backgroundRepeat: INTERMEDIATE,
|
|
35
|
+
backgroundSize: LONGHAND,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const border: TypeMap = {
|
|
39
|
+
border: SHORTHAND,
|
|
40
|
+
borderBlock: INTERMEDIATE,
|
|
41
|
+
borderBlockColor: INTERMEDIATE,
|
|
42
|
+
borderBlockEnd: INTERMEDIATE,
|
|
43
|
+
borderBlockEndColor: LONGHAND,
|
|
44
|
+
borderBlockEndStyle: LONGHAND,
|
|
45
|
+
borderBlockEndWidth: LONGHAND,
|
|
46
|
+
borderBlockStart: INTERMEDIATE,
|
|
47
|
+
borderBlockStartColor: LONGHAND,
|
|
48
|
+
borderBlockStartStyle: LONGHAND,
|
|
49
|
+
borderBlockStartWidth: LONGHAND,
|
|
50
|
+
borderBlockStyle: INTERMEDIATE,
|
|
51
|
+
borderBlockWidth: INTERMEDIATE,
|
|
52
|
+
borderBottom: INTERMEDIATE,
|
|
53
|
+
borderBottomColor: LONGHAND,
|
|
54
|
+
borderBottomLeftRadius: LONGHAND,
|
|
55
|
+
borderBottomRightRadius: LONGHAND,
|
|
56
|
+
borderBottomStyle: LONGHAND,
|
|
57
|
+
borderBottomWidth: LONGHAND,
|
|
58
|
+
borderColor: INTERMEDIATE,
|
|
59
|
+
borderImage: INTERMEDIATE,
|
|
60
|
+
borderImageOutset: LONGHAND,
|
|
61
|
+
borderImageRepeat: LONGHAND,
|
|
62
|
+
borderImageSlice: LONGHAND,
|
|
63
|
+
borderImageSource: LONGHAND,
|
|
64
|
+
borderImageWidth: LONGHAND,
|
|
65
|
+
borderInline: INTERMEDIATE,
|
|
66
|
+
borderInlineColor: INTERMEDIATE,
|
|
67
|
+
borderInlineEnd: INTERMEDIATE,
|
|
68
|
+
borderInlineEndColor: LONGHAND,
|
|
69
|
+
borderInlineEndStyle: LONGHAND,
|
|
70
|
+
borderInlineEndWidth: LONGHAND,
|
|
71
|
+
borderInlineStart: INTERMEDIATE,
|
|
72
|
+
borderInlineStartColor: LONGHAND,
|
|
73
|
+
borderInlineStartStyle: LONGHAND,
|
|
74
|
+
borderInlineStartWidth: LONGHAND,
|
|
75
|
+
borderInlineStyle: INTERMEDIATE,
|
|
76
|
+
borderInlineWidth: INTERMEDIATE,
|
|
77
|
+
borderLeft: INTERMEDIATE,
|
|
78
|
+
borderLeftColor: LONGHAND,
|
|
79
|
+
borderLeftStyle: LONGHAND,
|
|
80
|
+
borderLeftWidth: LONGHAND,
|
|
81
|
+
borderRadius: SHORTHAND,
|
|
82
|
+
borderEndEndRadius: LONGHAND,
|
|
83
|
+
borderEndStartRadius: LONGHAND,
|
|
84
|
+
borderRight: INTERMEDIATE,
|
|
85
|
+
borderRightColor: LONGHAND,
|
|
86
|
+
borderRightStyle: LONGHAND,
|
|
87
|
+
borderRightWidth: LONGHAND,
|
|
88
|
+
borderSpacing: SHORTHAND,
|
|
89
|
+
borderStartEndRadius: LONGHAND,
|
|
90
|
+
borderStartStartRadius: LONGHAND,
|
|
91
|
+
borderStyle: INTERMEDIATE,
|
|
92
|
+
borderTop: INTERMEDIATE,
|
|
93
|
+
borderTopColor: LONGHAND,
|
|
94
|
+
borderTopLeftRadius: LONGHAND,
|
|
95
|
+
borderTopRightRadius: LONGHAND,
|
|
96
|
+
borderTopStyle: LONGHAND,
|
|
97
|
+
borderTopWidth: LONGHAND,
|
|
98
|
+
borderWidth: INTERMEDIATE,
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export const columns: TypeMap = {
|
|
102
|
+
columns: SHORTHAND,
|
|
103
|
+
columnCount: LONGHAND,
|
|
104
|
+
columnRule: INTERMEDIATE,
|
|
105
|
+
columnRuleColor: LONGHAND,
|
|
106
|
+
columnRuleStyle: LONGHAND,
|
|
107
|
+
columnRuleWidth: LONGHAND,
|
|
108
|
+
columnWidth: LONGHAND,
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
export const containIntrinsicSize: TypeMap = {
|
|
112
|
+
containIntrinsicSize: SHORTHAND,
|
|
113
|
+
containIntrinsicBlockSize: LONGHAND,
|
|
114
|
+
containIntrinsicHeight: LONGHAND,
|
|
115
|
+
containIntrinsicInlineSize: LONGHAND,
|
|
116
|
+
containIntrinsicWidth: LONGHAND,
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export const container: TypeMap = {
|
|
120
|
+
container: SHORTHAND,
|
|
121
|
+
containerName: LONGHAND,
|
|
122
|
+
containerType: LONGHAND,
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export const flex: TypeMap = {
|
|
126
|
+
flex: SHORTHAND,
|
|
127
|
+
flexBasis: LONGHAND,
|
|
128
|
+
flexDirection: LONGHAND,
|
|
129
|
+
flexFlow: INTERMEDIATE,
|
|
130
|
+
flexGrow: LONGHAND,
|
|
131
|
+
flexShrink: LONGHAND,
|
|
132
|
+
flexWrap: LONGHAND,
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export const font: TypeMap = {
|
|
136
|
+
font: SHORTHAND,
|
|
137
|
+
fontFamily: LONGHAND,
|
|
138
|
+
fontFeatureSettings: LONGHAND,
|
|
139
|
+
fontKerning: LONGHAND,
|
|
140
|
+
fontLanguageOverride: LONGHAND,
|
|
141
|
+
fontOpticalSizing: LONGHAND,
|
|
142
|
+
fontPalette: LONGHAND,
|
|
143
|
+
fontSize: LONGHAND,
|
|
144
|
+
fontSizeAdjust: LONGHAND,
|
|
145
|
+
fontStretch: LONGHAND,
|
|
146
|
+
fontStyle: LONGHAND,
|
|
147
|
+
fontSynthesis: INTERMEDIATE,
|
|
148
|
+
fontSynthesisSmallCaps: LONGHAND,
|
|
149
|
+
fontSynthesisStyle: LONGHAND,
|
|
150
|
+
fontSynthesisWeight: LONGHAND,
|
|
151
|
+
fontVariant: INTERMEDIATE,
|
|
152
|
+
fontVariantAlternates: LONGHAND,
|
|
153
|
+
fontVariantCaps: LONGHAND,
|
|
154
|
+
fontVariantEastAsian: LONGHAND,
|
|
155
|
+
fontVariantEmoji: LONGHAND,
|
|
156
|
+
fontVariantLigatures: LONGHAND,
|
|
157
|
+
fontVariantNumeric: LONGHAND,
|
|
158
|
+
fontVariantPosition: LONGHAND,
|
|
159
|
+
fontVariationSettings: LONGHAND,
|
|
160
|
+
fontWeight: LONGHAND,
|
|
161
|
+
lineHeight: LONGHAND,
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export const gap: TypeMap = {
|
|
165
|
+
gap: SHORTHAND,
|
|
166
|
+
columnGap: LONGHAND,
|
|
167
|
+
rowGap: LONGHAND,
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export const grid: TypeMap = {
|
|
171
|
+
grid: SHORTHAND,
|
|
172
|
+
gridArea: INTERMEDIATE,
|
|
173
|
+
gridAutoColumns: LONGHAND,
|
|
174
|
+
gridAutoFlow: LONGHAND,
|
|
175
|
+
gridAutoRows: LONGHAND,
|
|
176
|
+
gridColumn: INTERMEDIATE,
|
|
177
|
+
gridColumnEnd: LONGHAND,
|
|
178
|
+
gridColumnStart: LONGHAND,
|
|
179
|
+
gridRow: INTERMEDIATE,
|
|
180
|
+
gridRowEnd: LONGHAND,
|
|
181
|
+
gridRowStart: LONGHAND,
|
|
182
|
+
gridTemplate: INTERMEDIATE,
|
|
183
|
+
gridTemplateAreas: LONGHAND,
|
|
184
|
+
gridTemplateColumns: LONGHAND,
|
|
185
|
+
gridTemplateRows: LONGHAND,
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
export const inset: TypeMap = {
|
|
189
|
+
inset: SHORTHAND,
|
|
190
|
+
insetBlock: INTERMEDIATE,
|
|
191
|
+
insetBlockEnd: LONGHAND,
|
|
192
|
+
insetBlockStart: LONGHAND,
|
|
193
|
+
insetInline: INTERMEDIATE,
|
|
194
|
+
insetInlineEnd: LONGHAND,
|
|
195
|
+
insetInlineStart: LONGHAND,
|
|
196
|
+
bottom: LONGHAND,
|
|
197
|
+
left: LONGHAND,
|
|
198
|
+
right: LONGHAND,
|
|
199
|
+
top: LONGHAND,
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
export const listStyle: TypeMap = {
|
|
203
|
+
listStyle: SHORTHAND,
|
|
204
|
+
listStyleImage: LONGHAND,
|
|
205
|
+
listStylePosition: LONGHAND,
|
|
206
|
+
listStyleType: LONGHAND,
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
export const margin: TypeMap = {
|
|
210
|
+
margin: SHORTHAND,
|
|
211
|
+
marginBlock: INTERMEDIATE,
|
|
212
|
+
marginBlockEnd: LONGHAND,
|
|
213
|
+
marginBlockStart: LONGHAND,
|
|
214
|
+
marginBottom: LONGHAND,
|
|
215
|
+
marginInline: INTERMEDIATE,
|
|
216
|
+
marginInlineEnd: LONGHAND,
|
|
217
|
+
marginInlineStart: LONGHAND,
|
|
218
|
+
marginLeft: LONGHAND,
|
|
219
|
+
marginRight: LONGHAND,
|
|
220
|
+
marginTop: LONGHAND,
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
export const mask: TypeMap = {
|
|
224
|
+
mask: SHORTHAND,
|
|
225
|
+
maskBorder: INTERMEDIATE,
|
|
226
|
+
maskBorderMode: LONGHAND,
|
|
227
|
+
maskBorderOutset: LONGHAND,
|
|
228
|
+
maskBorderRepeat: LONGHAND,
|
|
229
|
+
maskBorderSlice: LONGHAND,
|
|
230
|
+
maskBorderSource: LONGHAND,
|
|
231
|
+
maskBorderWidth: LONGHAND,
|
|
232
|
+
maskClip: LONGHAND,
|
|
233
|
+
maskComposite: LONGHAND,
|
|
234
|
+
maskImage: LONGHAND,
|
|
235
|
+
maskMode: LONGHAND,
|
|
236
|
+
maskOrigin: LONGHAND,
|
|
237
|
+
maskPosition: LONGHAND,
|
|
238
|
+
maskRepeat: LONGHAND,
|
|
239
|
+
maskSize: LONGHAND,
|
|
240
|
+
maskType: LONGHAND,
|
|
241
|
+
WebkitMask: SHORTHAND,
|
|
242
|
+
WebkitMaskBoxImage: INTERMEDIATE,
|
|
243
|
+
WebkitMaskBoxImageOutset: LONGHAND,
|
|
244
|
+
WebkitMaskBoxImageRepeat: LONGHAND,
|
|
245
|
+
WebkitMaskBoxImageSlice: LONGHAND,
|
|
246
|
+
WebkitMaskBoxImageSource: LONGHAND,
|
|
247
|
+
WebkitMaskBoxImageWidth: LONGHAND,
|
|
248
|
+
WebkitMaskClip: LONGHAND,
|
|
249
|
+
WebkitMaskComposite: LONGHAND,
|
|
250
|
+
WebkitMaskImage: LONGHAND,
|
|
251
|
+
WebkitMaskOrigin: LONGHAND,
|
|
252
|
+
WebkitMaskPosition: LONGHAND,
|
|
253
|
+
WebkitMaskPositionX: LONGHAND,
|
|
254
|
+
WebkitMaskPositionY: LONGHAND,
|
|
255
|
+
WebkitMaskRepeat: LONGHAND,
|
|
256
|
+
WebkitMaskRepeatX: LONGHAND,
|
|
257
|
+
WebkitMaskRepeatY: LONGHAND,
|
|
258
|
+
WebkitMaskSize: LONGHAND,
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
export const offset: TypeMap = {
|
|
262
|
+
offset: SHORTHAND,
|
|
263
|
+
offsetAnchor: LONGHAND,
|
|
264
|
+
offsetDistance: LONGHAND,
|
|
265
|
+
offsetPath: LONGHAND,
|
|
266
|
+
offsetPosition: LONGHAND,
|
|
267
|
+
offsetRotate: LONGHAND,
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
export const outline: TypeMap = {
|
|
271
|
+
outline: SHORTHAND,
|
|
272
|
+
outlineColor: LONGHAND,
|
|
273
|
+
outlineOffset: LONGHAND,
|
|
274
|
+
outlineStyle: LONGHAND,
|
|
275
|
+
outlineWidth: LONGHAND,
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
export const overflow: TypeMap = {
|
|
279
|
+
overflow: SHORTHAND,
|
|
280
|
+
overflowBlock: LONGHAND,
|
|
281
|
+
overflowClipMargin: SHORTHAND,
|
|
282
|
+
overflowInline: LONGHAND,
|
|
283
|
+
overflowWrap: LONGHAND,
|
|
284
|
+
overflowX: LONGHAND,
|
|
285
|
+
overflowY: LONGHAND,
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
export const overscrollBehavior: TypeMap = {
|
|
289
|
+
overscrollBehavior: SHORTHAND,
|
|
290
|
+
overscrollBehaviorBlock: LONGHAND,
|
|
291
|
+
overscrollBehaviorInline: LONGHAND,
|
|
292
|
+
overscrollBehaviorX: LONGHAND,
|
|
293
|
+
overscrollBehaviorY: LONGHAND,
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
export const padding: TypeMap = {
|
|
297
|
+
padding: SHORTHAND,
|
|
298
|
+
paddingBlock: INTERMEDIATE,
|
|
299
|
+
paddingBlockEnd: LONGHAND,
|
|
300
|
+
paddingBlockStart: LONGHAND,
|
|
301
|
+
paddingBottom: LONGHAND,
|
|
302
|
+
paddingInline: INTERMEDIATE,
|
|
303
|
+
paddingInlineEnd: LONGHAND,
|
|
304
|
+
paddingInlineStart: LONGHAND,
|
|
305
|
+
paddingLeft: LONGHAND,
|
|
306
|
+
paddingRight: LONGHAND,
|
|
307
|
+
paddingTop: LONGHAND,
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
export const place: TypeMap = {
|
|
311
|
+
placeContent: SHORTHAND,
|
|
312
|
+
alignContent: LONGHAND,
|
|
313
|
+
justifyContent: LONGHAND,
|
|
314
|
+
placeItems: SHORTHAND,
|
|
315
|
+
alignItems: LONGHAND,
|
|
316
|
+
justifyItems: LONGHAND,
|
|
317
|
+
placeSelf: SHORTHAND,
|
|
318
|
+
alignSelf: LONGHAND,
|
|
319
|
+
justifySelf: LONGHAND,
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
export const scrollMargin: TypeMap = {
|
|
323
|
+
scrollMargin: SHORTHAND,
|
|
324
|
+
scrollMarginBlock: INTERMEDIATE,
|
|
325
|
+
scrollMarginBlockEnd: LONGHAND,
|
|
326
|
+
scrollMarginBlockStart: LONGHAND,
|
|
327
|
+
scrollMarginBottom: LONGHAND,
|
|
328
|
+
scrollMarginInline: INTERMEDIATE,
|
|
329
|
+
scrollMarginInlineEnd: LONGHAND,
|
|
330
|
+
scrollMarginInlineStart: LONGHAND,
|
|
331
|
+
scrollMarginLeft: LONGHAND,
|
|
332
|
+
scrollMarginRight: LONGHAND,
|
|
333
|
+
scrollMarginTop: LONGHAND,
|
|
334
|
+
};
|
|
335
|
+
|
|
336
|
+
export const scrollPadding: TypeMap = {
|
|
337
|
+
scrollPadding: SHORTHAND,
|
|
338
|
+
scrollPaddingBlock: INTERMEDIATE,
|
|
339
|
+
scrollPaddingBlockEnd: LONGHAND,
|
|
340
|
+
scrollPaddingBlockStart: LONGHAND,
|
|
341
|
+
scrollPaddingBottom: LONGHAND,
|
|
342
|
+
scrollPaddingInline: INTERMEDIATE,
|
|
343
|
+
scrollPaddingInlineEnd: LONGHAND,
|
|
344
|
+
scrollPaddingInlineStart: LONGHAND,
|
|
345
|
+
scrollPaddingLeft: LONGHAND,
|
|
346
|
+
scrollPaddingRight: LONGHAND,
|
|
347
|
+
scrollPaddingTop: LONGHAND,
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
export const scrollTimeline: TypeMap = {
|
|
351
|
+
scrollTimeline: SHORTHAND,
|
|
352
|
+
scrollTimelineAxis: LONGHAND,
|
|
353
|
+
scrollTimelineName: LONGHAND,
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
export const text: TypeMap = {
|
|
357
|
+
textDecoration: SHORTHAND,
|
|
358
|
+
textDecorationColor: LONGHAND,
|
|
359
|
+
textDecorationLine: LONGHAND,
|
|
360
|
+
textDecorationSkip: LONGHAND,
|
|
361
|
+
textDecorationSkipInk: LONGHAND,
|
|
362
|
+
textDecorationStyle: LONGHAND,
|
|
363
|
+
textDecorationThickness: LONGHAND,
|
|
364
|
+
textEmphasis: SHORTHAND,
|
|
365
|
+
textEmphasisColor: LONGHAND,
|
|
366
|
+
textEmphasisPosition: LONGHAND,
|
|
367
|
+
textEmphasisStyle: LONGHAND,
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
export const transition: TypeMap = {
|
|
371
|
+
transition: SHORTHAND,
|
|
372
|
+
transitionBehavior: LONGHAND,
|
|
373
|
+
transitionDelay: LONGHAND,
|
|
374
|
+
transitionDuration: LONGHAND,
|
|
375
|
+
transitionProperty: LONGHAND,
|
|
376
|
+
transitionTimingFunction: LONGHAND,
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
export const viewTimeline: TypeMap = {
|
|
380
|
+
viewTimeline: SHORTHAND,
|
|
381
|
+
viewTimelineAxis: LONGHAND,
|
|
382
|
+
viewTimelineInset: LONGHAND,
|
|
383
|
+
viewTimelineName: LONGHAND,
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
export const whiteSpace: TypeMap = {
|
|
387
|
+
whiteSpace: SHORTHAND,
|
|
388
|
+
whiteSpaceCollapse: LONGHAND,
|
|
389
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LayerPropertyPriorities } from '../layer';
|
|
2
|
+
|
|
3
|
+
export const LONGHAND = LayerPropertyPriorities.longhand;
|
|
4
|
+
export const SHORTHAND = LayerPropertyPriorities.shorthand;
|
|
5
|
+
export const INTERMEDIATE = LayerPropertyPriorities.intermediate;
|
|
6
|
+
|
|
7
|
+
export type PropertyTypeRecord<T extends string = string> = Partial<Record<T, number>>;
|
package/atomic/rule.ts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { ItemSelector } from '../builder/data/state';
|
|
2
|
+
import type { ScopeClassNameFormat } from '../config/types';
|
|
3
|
+
import { getScopeClassName } from './className';
|
|
4
|
+
import { LayerMediaPriorities, type LayerPriority, LayerSelectorPriorities } from './layer';
|
|
5
|
+
import { getCssPropertyName, getPropertyPriority } from './property';
|
|
6
|
+
import { escapeCssIdent } from './utils/css';
|
|
7
|
+
import { getSelectorPriority, getSelectorText } from './utils/selector';
|
|
8
|
+
import { getCssPropertyValue } from './value';
|
|
9
|
+
|
|
10
|
+
export function buildAtomicRule(
|
|
11
|
+
className: string,
|
|
12
|
+
property: string,
|
|
13
|
+
value: string,
|
|
14
|
+
selector: ItemSelector | null,
|
|
15
|
+
parentSelector: ItemSelector | null,
|
|
16
|
+
atRules: ItemSelector[] | null,
|
|
17
|
+
scopeClassNameFormat: ScopeClassNameFormat | null,
|
|
18
|
+
): string {
|
|
19
|
+
const cssProp = getCssPropertyName(property);
|
|
20
|
+
const cssValue = getCssPropertyValue(property, value);
|
|
21
|
+
const escapedClass = escapeCssIdent(className);
|
|
22
|
+
|
|
23
|
+
const classSelector = '.' + escapedClass;
|
|
24
|
+
const itemSelector = selector ? getSelectorText(selector) : '';
|
|
25
|
+
|
|
26
|
+
let selectorStr = classSelector + itemSelector;
|
|
27
|
+
|
|
28
|
+
if (parentSelector) {
|
|
29
|
+
const parentClass = '.' + escapeCssIdent(
|
|
30
|
+
getScopeClassName(className, scopeClassNameFormat),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const parent = parentClass + getSelectorText(parentSelector);
|
|
34
|
+
const parentWhere = `:where(${parent})`;
|
|
35
|
+
|
|
36
|
+
selectorStr = classSelector + parentWhere + itemSelector + ',' + parentWhere + ' ' + selectorStr;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let rule = `${selectorStr}{${cssProp}: ${cssValue}}`;
|
|
40
|
+
|
|
41
|
+
if (atRules) {
|
|
42
|
+
for (let i = atRules.length - 1; i >= 0; i--) {
|
|
43
|
+
rule = `${getSelectorText(atRules[i])}{${rule}}`;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return rule;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function getAtomicRuleLayerPriority(
|
|
51
|
+
property: string,
|
|
52
|
+
priority: number | null,
|
|
53
|
+
selector: ItemSelector | null,
|
|
54
|
+
parentSelector: ItemSelector | null,
|
|
55
|
+
atRules: ItemSelector[] | null,
|
|
56
|
+
isScopeRule: boolean = false,
|
|
57
|
+
): LayerPriority {
|
|
58
|
+
const selectorPriority = getSelectorPriority(selector);
|
|
59
|
+
const parentSelectorPriority = getSelectorPriority(parentSelector);
|
|
60
|
+
const atRulePriority = getAtRulePriority(atRules);
|
|
61
|
+
|
|
62
|
+
return [
|
|
63
|
+
priority ?? 0,
|
|
64
|
+
getLayerSelectorPriority(selector, parentSelector, selectorPriority),
|
|
65
|
+
getParentSelectorPriority(parentSelector, parentSelectorPriority),
|
|
66
|
+
getMediaPriority(atRules, atRulePriority),
|
|
67
|
+
atRules ? atRules.length : 0,
|
|
68
|
+
isScopeRule && !parentSelector ? 1 : 0,
|
|
69
|
+
getPropertyPriority(property),
|
|
70
|
+
];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function getMediaPriority(
|
|
74
|
+
atRules: ItemSelector[] | null,
|
|
75
|
+
priority: number,
|
|
76
|
+
) {
|
|
77
|
+
if (!atRules?.length) return LayerMediaPriorities.base;
|
|
78
|
+
if (priority <= 0) return LayerMediaPriorities.media;
|
|
79
|
+
return LayerMediaPriorities.priorityMedia + priority;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function getLayerSelectorPriority(
|
|
83
|
+
selector: ItemSelector | null,
|
|
84
|
+
parentSelector: ItemSelector | null,
|
|
85
|
+
priority: number,
|
|
86
|
+
) {
|
|
87
|
+
if (selector) {
|
|
88
|
+
return priority > 0
|
|
89
|
+
? LayerSelectorPriorities.prioritySelector + priority
|
|
90
|
+
: LayerSelectorPriorities.selector;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (parentSelector) return LayerSelectorPriorities.parentSelector;
|
|
94
|
+
|
|
95
|
+
return LayerSelectorPriorities.base;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function getParentSelectorPriority(
|
|
99
|
+
parentSelector: ItemSelector | null,
|
|
100
|
+
priority: number,
|
|
101
|
+
) {
|
|
102
|
+
if (!parentSelector) return 0;
|
|
103
|
+
return priority > 0 ? priority + 1 : 1;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function getAtRulePriority(atRules: ItemSelector[] | null) {
|
|
107
|
+
if (!atRules?.length) return 0;
|
|
108
|
+
|
|
109
|
+
let priority = 0;
|
|
110
|
+
|
|
111
|
+
for (let i = 0, len = atRules.length; i < len; i++) {
|
|
112
|
+
priority = Math.max(priority, getSelectorPriority(atRules[i]));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return priority;
|
|
116
|
+
}
|
package/atomic/theme.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ThemeNameFormat, ThemeNameInfo, TokenNameFormat } from '../config/types';
|
|
2
|
+
import type { StyleTokenOverride } from '../style/token';
|
|
3
|
+
import { getTokenOverrideValue, getTokenVarName } from './token';
|
|
4
|
+
import { escapeCssIdent, escapeCssValue, getIdentifierSafeHash } from './utils/css';
|
|
5
|
+
import { createNameFormatter } from './utils/format';
|
|
6
|
+
|
|
7
|
+
export const THEME_NAME_FORMAT = 'theme[-(name)]-$hash';
|
|
8
|
+
|
|
9
|
+
export const formatThemeName = createNameFormatter<ThemeNameInfo>(['name']);
|
|
10
|
+
|
|
11
|
+
export function createThemeClassName(
|
|
12
|
+
name: string | null,
|
|
13
|
+
id: string,
|
|
14
|
+
themeNameFormat: ThemeNameFormat | null,
|
|
15
|
+
) {
|
|
16
|
+
return formatThemeName(
|
|
17
|
+
themeNameFormat || THEME_NAME_FORMAT,
|
|
18
|
+
getIdentifierSafeHash(id),
|
|
19
|
+
{ name },
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function getThemeRuleCss(
|
|
24
|
+
className: string,
|
|
25
|
+
tokens: readonly StyleTokenOverride[],
|
|
26
|
+
tokenNameFormat: TokenNameFormat | null,
|
|
27
|
+
) {
|
|
28
|
+
const declarations: string[] = [];
|
|
29
|
+
|
|
30
|
+
for (let i = 0, len = tokens.length; i < len; i++) {
|
|
31
|
+
declarations.push(getThemeDeclaration(tokens[i], tokenNameFormat));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return '.' + escapeCssIdent(className) + '{' + declarations.join(';') + '}';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function getThemeDeclaration(
|
|
38
|
+
token: StyleTokenOverride,
|
|
39
|
+
tokenNameFormat: TokenNameFormat | null,
|
|
40
|
+
) {
|
|
41
|
+
const name = getTokenVarName(token, tokenNameFormat);
|
|
42
|
+
|
|
43
|
+
const value = token.ref
|
|
44
|
+
? getTokenOverrideValue(token, tokenNameFormat)
|
|
45
|
+
: escapeCssValue(String(token.value ?? ''));
|
|
46
|
+
|
|
47
|
+
return name + ':' + value;
|
|
48
|
+
}
|
package/atomic/token.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { TokenNameFormat, TokenNameInfo } from '../config/types';
|
|
2
|
+
import { getStyleTokenId, type StyleTokenData, type StyleTokenOverride } from '../style/token';
|
|
3
|
+
import { getCssVar, getCssVarRawFallback, getIdentifierSafeHash } from './utils/css';
|
|
4
|
+
import { createNameFormatter } from './utils/format';
|
|
5
|
+
|
|
6
|
+
export const TOKEN_NAME_FORMAT = 'token[-(name)]-$hash';
|
|
7
|
+
|
|
8
|
+
export const formatTokenName = createNameFormatter<TokenNameInfo>(['name']);
|
|
9
|
+
|
|
10
|
+
export function getTokenVarName(
|
|
11
|
+
token: StyleTokenData | StyleTokenOverride,
|
|
12
|
+
format: TokenNameFormat | null,
|
|
13
|
+
) {
|
|
14
|
+
const id = getStyleTokenId(token);
|
|
15
|
+
|
|
16
|
+
const name = formatTokenName(
|
|
17
|
+
format || TOKEN_NAME_FORMAT,
|
|
18
|
+
getIdentifierSafeHash(id),
|
|
19
|
+
{ name: id },
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
return '--' + name;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function getTokenVar(
|
|
26
|
+
token: StyleTokenData,
|
|
27
|
+
format: TokenNameFormat | null,
|
|
28
|
+
) {
|
|
29
|
+
return getTokenVarFallback(token, format);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function getTokenOverrideValue(
|
|
33
|
+
token: StyleTokenOverride,
|
|
34
|
+
format: TokenNameFormat | null,
|
|
35
|
+
) {
|
|
36
|
+
return token.ref ? getTokenVar(token.ref, format) : token.value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function getTokenVarFallback(
|
|
40
|
+
token: StyleTokenData,
|
|
41
|
+
tokenNameFormat: TokenNameFormat | null,
|
|
42
|
+
): string {
|
|
43
|
+
const varName = getTokenVarName(token, tokenNameFormat);
|
|
44
|
+
|
|
45
|
+
if (token.ref) {
|
|
46
|
+
return getCssVarRawFallback(
|
|
47
|
+
varName,
|
|
48
|
+
getTokenVarFallback(token.ref, tokenNameFormat),
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return getCssVar(varName, String(token.value ?? ''));
|
|
53
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { hashString } from '../../utils/hash';
|
|
2
|
+
|
|
3
|
+
export function getCssVar(varName: string, value: string) {
|
|
4
|
+
return 'var(' + varName + ', ' + escapeCssValue(value) + ')';
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function getCssVarRawFallback(varName: string, fallbackCss: string) {
|
|
8
|
+
return 'var(' + varName + ', ' + fallbackCss + ')';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function escapeCssValue(value: string): string {
|
|
12
|
+
if (!value) return '';
|
|
13
|
+
|
|
14
|
+
return value
|
|
15
|
+
.trim()
|
|
16
|
+
// Escape existing backslashes first so we don't break them.
|
|
17
|
+
.replace(/\\/g, '\\\\')
|
|
18
|
+
.replace(/"/g, '\\"')
|
|
19
|
+
.replace(/'/g, "\\'")
|
|
20
|
+
.replace(/;/g, '\\;');
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function escapeCssIdent(ident: string): string {
|
|
24
|
+
const escaped = ident.replace(/([[\]():.#,>+~*=!|^$@])/g, '\\$1');
|
|
25
|
+
|
|
26
|
+
if (/^[0-9]/.test(escaped)) {
|
|
27
|
+
return '\\3' + escaped[0] + ' ' + escaped.slice(1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (/^-[0-9]/.test(escaped)) {
|
|
31
|
+
return '-\\3' + escaped[1] + ' ' + escaped.slice(2);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return escaped;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function sanitizeCssIdentName(value: string, fallback: string = '') {
|
|
38
|
+
return value.replace(/[^a-zA-Z0-9_-]+/g, '-').replace(/^-+|-+$/g, '') || fallback;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function getIdentifierSafeHash(value: string) {
|
|
42
|
+
const hash = hashString(value);
|
|
43
|
+
|
|
44
|
+
const first = hash.charCodeAt(0);
|
|
45
|
+
|
|
46
|
+
if (first < 48 || first > 57) return hash;
|
|
47
|
+
|
|
48
|
+
return String.fromCharCode(97 + first - 48) + hash.slice(1);
|
|
49
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { sanitizeCssIdentName } from './css';
|
|
2
|
+
|
|
3
|
+
export function normalizeDebugKeywordValue(value: string) {
|
|
4
|
+
const normalized = value.trim().toLowerCase();
|
|
5
|
+
return /^[a-z][a-z0-9-]*$/.test(normalized) ? normalized : null;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function sanitizeDebugName(value: string | undefined) {
|
|
9
|
+
if (!value) return '';
|
|
10
|
+
|
|
11
|
+
const normalized = value
|
|
12
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1-$2')
|
|
13
|
+
.toLowerCase();
|
|
14
|
+
|
|
15
|
+
return sanitizeCssIdentName(normalized, '');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function normalizePropertyName(property: string) {
|
|
19
|
+
return property
|
|
20
|
+
.trim()
|
|
21
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1-$2')
|
|
22
|
+
.replace(/_/g, '-')
|
|
23
|
+
.toLowerCase();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function sanitizeDebugPropertyName(property: string) {
|
|
27
|
+
let name = property;
|
|
28
|
+
|
|
29
|
+
if (name.charCodeAt(0) === 45 && name.charCodeAt(1) === 45) {
|
|
30
|
+
name = name.slice(2);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return name
|
|
34
|
+
.replace(/[^a-z0-9_-]+/g, '-')
|
|
35
|
+
.replace(/[-_]+/g, '-')
|
|
36
|
+
.replace(/^-+|-+$/g, '');
|
|
37
|
+
}
|