@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,910 @@
|
|
|
1
|
+
//#region utils/global.ts
|
|
2
|
+
function symbol(name) {
|
|
3
|
+
return Symbol.for(`@fluentic/style.${name}`);
|
|
4
|
+
}
|
|
5
|
+
function getGlobalData(key) {
|
|
6
|
+
return globalThis[symbol(key)];
|
|
7
|
+
}
|
|
8
|
+
function globalData(key, data) {
|
|
9
|
+
const id = symbol(key);
|
|
10
|
+
const root = globalThis;
|
|
11
|
+
if (root[id] === void 0) assign(root, id, data());
|
|
12
|
+
return root[id];
|
|
13
|
+
}
|
|
14
|
+
function assign(target, id, value) {
|
|
15
|
+
Object.defineProperty(target, id, {
|
|
16
|
+
value,
|
|
17
|
+
configurable: true,
|
|
18
|
+
enumerable: false,
|
|
19
|
+
writable: true
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region config/utils.ts
|
|
24
|
+
const SIDECAR_URL_GLOBAL_SYMBOL = "FLUENTIC_STYLE_SIDECAR_URL";
|
|
25
|
+
function getCacheTTL(cache) {
|
|
26
|
+
return cache === true ? 3e5 : cache === false ? 0 : Math.max(cache, 0);
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region config/config/runtime.ts
|
|
30
|
+
const RUNTIME_CONFIG_DEFAULT = {
|
|
31
|
+
changes: 0,
|
|
32
|
+
isPlugin: false,
|
|
33
|
+
isHoist: false,
|
|
34
|
+
isExtracted: false,
|
|
35
|
+
isRSC: false,
|
|
36
|
+
runtimeCacheTTL: getCacheTTL(true)
|
|
37
|
+
};
|
|
38
|
+
const RUNTIME_CONFIG = globalData("config.runtime", () => ({ ...RUNTIME_CONFIG_DEFAULT }));
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region config/constants.ts
|
|
41
|
+
const LayerPlaceholder = "$layer";
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region config/config/css.ts
|
|
44
|
+
const CSS_CONFIG_DEFAULT = {
|
|
45
|
+
layer: true,
|
|
46
|
+
layers: [LayerPlaceholder],
|
|
47
|
+
layerNamespace: "css"
|
|
48
|
+
};
|
|
49
|
+
const CSS_CONFIG = globalData("config.css", () => ({ ...CSS_CONFIG_DEFAULT }));
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region config/build.ts
|
|
52
|
+
const BUILD_CONFIG = globalData("config.build", () => ({ current: null }));
|
|
53
|
+
function setBuildConfig(config) {
|
|
54
|
+
BUILD_CONFIG.current = config;
|
|
55
|
+
RUNTIME_CONFIG.isHoist = config.hoist;
|
|
56
|
+
if (config.css) Object.assign(CSS_CONFIG, config.css);
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region entry/shared/config.ts
|
|
60
|
+
setBuildConfig(JSON.parse(FLUENTIC_STYLE_BUILD_CONFIG));
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region utils/object.ts
|
|
63
|
+
function set(target, field, data) {
|
|
64
|
+
target[field] = data;
|
|
65
|
+
}
|
|
66
|
+
function unsetAll(obj) {
|
|
67
|
+
for (const key of Object.keys(obj)) delete obj[key];
|
|
68
|
+
}
|
|
69
|
+
function hasOwn(target, field) {
|
|
70
|
+
return Object.prototype.hasOwnProperty.call(target, field);
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region config/config/dev.ts
|
|
74
|
+
const DEV_CONFIG_DEFAULT = {
|
|
75
|
+
isDev: false,
|
|
76
|
+
isCheckSelectorEnabled: true,
|
|
77
|
+
isSourcemapEnabled: true,
|
|
78
|
+
isLocalClassNameEnabled: true,
|
|
79
|
+
sheetMaxRules: 1e3,
|
|
80
|
+
sheetStyleTagNonce: null,
|
|
81
|
+
stylePriorityMode: "layer",
|
|
82
|
+
sourcemapLocationMode: "style",
|
|
83
|
+
isElementClassNameEnabled: true
|
|
84
|
+
};
|
|
85
|
+
const IS_DEV = globalData("config.dev.isDev", () => ({ isDev: false }));
|
|
86
|
+
const DEV_CONFIG = globalData("config.dev", () => ({ ...DEV_CONFIG_DEFAULT }));
|
|
87
|
+
const configPlugin = globalData("config.dev.plugin", () => ({ config: null }));
|
|
88
|
+
const configBase = globalData("config.dev.base", () => ({ config: null }));
|
|
89
|
+
const configUtils = globalData("config.dev.utils", () => ({ config: null }));
|
|
90
|
+
function getBuildDevConfig() {
|
|
91
|
+
return configPlugin.config;
|
|
92
|
+
}
|
|
93
|
+
function setBuildDevConfig(config) {
|
|
94
|
+
const checkSelector = config.checkSelector === "force" ? false : config.checkSelector;
|
|
95
|
+
IS_DEV.isDev = true;
|
|
96
|
+
setOptions(configPlugin, {
|
|
97
|
+
...config,
|
|
98
|
+
checkSelector
|
|
99
|
+
}, null);
|
|
100
|
+
rebuildDevConfig();
|
|
101
|
+
}
|
|
102
|
+
function setDevUtilsRuntimeOptions(options) {
|
|
103
|
+
setOptions(configUtils, options, null);
|
|
104
|
+
rebuildDevConfig();
|
|
105
|
+
}
|
|
106
|
+
function rebuildDevConfig() {
|
|
107
|
+
unsetAll(DEV_CONFIG);
|
|
108
|
+
Object.assign(DEV_CONFIG, DEV_CONFIG_DEFAULT, configBase.config, configPlugin.config, configUtils.config);
|
|
109
|
+
DEV_CONFIG.isDev = IS_DEV.isDev;
|
|
110
|
+
RUNTIME_CONFIG.changes += 1;
|
|
111
|
+
}
|
|
112
|
+
function setOptions(partialConfig, options, defaultConfig) {
|
|
113
|
+
if (!options) {
|
|
114
|
+
partialConfig.config = defaultConfig;
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (!partialConfig.config) partialConfig.config = defaultConfig || {};
|
|
118
|
+
const config = partialConfig.config;
|
|
119
|
+
if (options.priorityMode) config.stylePriorityMode = options.priorityMode;
|
|
120
|
+
if (options.sourcemapMode) config.sourcemapLocationMode = options.sourcemapMode;
|
|
121
|
+
if (typeof options.elementClassName === "boolean") config.isElementClassNameEnabled = options.elementClassName;
|
|
122
|
+
if (typeof options.checkSelector === "boolean") config.isCheckSelectorEnabled = options.checkSelector;
|
|
123
|
+
}
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region entry/shared/dev.ts
|
|
126
|
+
set(globalThis, Symbol.for(SIDECAR_URL_GLOBAL_SYMBOL), FLUENTIC_STYLE_SIDECAR_SERVER_URL || "");
|
|
127
|
+
setBuildDevConfig(JSON.parse(FLUENTIC_STYLE_DEV_CONFIG));
|
|
128
|
+
RUNTIME_CONFIG.isPlugin = true;
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region entry/rsc_dev/config.ts
|
|
131
|
+
RUNTIME_CONFIG.isRSC = true;
|
|
132
|
+
//#endregion
|
|
133
|
+
//#region config/configure.ts
|
|
134
|
+
function configureStyleRuntime(options = {}) {
|
|
135
|
+
if (options.css) {
|
|
136
|
+
checkBuildConfig("css");
|
|
137
|
+
Object.assign(CSS_CONFIG, options.css);
|
|
138
|
+
}
|
|
139
|
+
if (options.cacheTTL !== void 0) RUNTIME_CONFIG.runtimeCacheTTL = getCacheTTL(options.cacheTTL);
|
|
140
|
+
}
|
|
141
|
+
function checkBuildConfig(field) {
|
|
142
|
+
if (!BUILD_CONFIG.current) return;
|
|
143
|
+
throw new Error(`Configure "${field}" via plugin options.`);
|
|
144
|
+
}
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region utils/hash.ts
|
|
147
|
+
function hashString(str) {
|
|
148
|
+
let hash = 2166136261;
|
|
149
|
+
for (let i = 0; i < str.length; i++) hash = Math.imul(hash ^ str.charCodeAt(i), 16777619);
|
|
150
|
+
return (hash >>> 0).toString(36).padEnd(7, "0");
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region atomic/utils/css.ts
|
|
154
|
+
function getCssVar(varName, value) {
|
|
155
|
+
return "var(" + varName + ", " + escapeCssValue(value) + ")";
|
|
156
|
+
}
|
|
157
|
+
function getCssVarRawFallback(varName, fallbackCss) {
|
|
158
|
+
return "var(" + varName + ", " + fallbackCss + ")";
|
|
159
|
+
}
|
|
160
|
+
function escapeCssValue(value) {
|
|
161
|
+
if (!value) return "";
|
|
162
|
+
return value.trim().replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/'/g, "\\'").replace(/;/g, "\\;");
|
|
163
|
+
}
|
|
164
|
+
function escapeCssIdent(ident) {
|
|
165
|
+
const escaped = ident.replace(/([[\]():.#,>+~*=!|^$@])/g, "\\$1");
|
|
166
|
+
if (/^[0-9]/.test(escaped)) return "\\3" + escaped[0] + " " + escaped.slice(1);
|
|
167
|
+
if (/^-[0-9]/.test(escaped)) return "-\\3" + escaped[1] + " " + escaped.slice(2);
|
|
168
|
+
return escaped;
|
|
169
|
+
}
|
|
170
|
+
function sanitizeCssIdentName(value, fallback = "") {
|
|
171
|
+
return value.replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-+|-+$/g, "") || fallback;
|
|
172
|
+
}
|
|
173
|
+
function getIdentifierSafeHash(value) {
|
|
174
|
+
const hash = hashString(value);
|
|
175
|
+
const first = hash.charCodeAt(0);
|
|
176
|
+
if (first < 48 || first > 57) return hash;
|
|
177
|
+
return String.fromCharCode(97 + first - 48) + hash.slice(1);
|
|
178
|
+
}
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region atomic/utils/format.ts
|
|
181
|
+
const TOKEN_REGEX = /\(([a-zA-Z][a-zA-Z0-9]*)(?::([0-9]+)(!)?)?\)/g;
|
|
182
|
+
const OPTIONAL_REGEX = /\[([^[\]]*)\]/g;
|
|
183
|
+
const HASH_TOKEN = "$hash";
|
|
184
|
+
function createNameFormatter(keys) {
|
|
185
|
+
const keySet = new Set(keys);
|
|
186
|
+
const cache = /* @__PURE__ */ new Map();
|
|
187
|
+
function getFormatFn(format) {
|
|
188
|
+
if (typeof format === "function") return format;
|
|
189
|
+
let fn = cache.get(format);
|
|
190
|
+
if (!fn) {
|
|
191
|
+
fn = compileFormat(format, keySet);
|
|
192
|
+
cache.set(format, fn);
|
|
193
|
+
}
|
|
194
|
+
return fn;
|
|
195
|
+
}
|
|
196
|
+
return function format(format, hash, info) {
|
|
197
|
+
const name = getFormatFn(format)(info);
|
|
198
|
+
if (!hash) return name;
|
|
199
|
+
if (name.includes(HASH_TOKEN)) return name.replace(HASH_TOKEN, hash);
|
|
200
|
+
return name ? name + "-" + hash : hash;
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function compileFormat(format, keySet) {
|
|
204
|
+
const segments = compileSegments(format, keySet);
|
|
205
|
+
return (info) => {
|
|
206
|
+
let name = "";
|
|
207
|
+
for (const segment of segments) {
|
|
208
|
+
const text = formatSegment(info, segment);
|
|
209
|
+
if (text === null) {
|
|
210
|
+
if (!segment.optional) return "";
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
name += text;
|
|
214
|
+
}
|
|
215
|
+
return name;
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
function compileSegments(format, keySet) {
|
|
219
|
+
const segments = [];
|
|
220
|
+
let lastIndex = 0;
|
|
221
|
+
for (const match of format.matchAll(OPTIONAL_REGEX)) {
|
|
222
|
+
const index = match.index ?? 0;
|
|
223
|
+
if (index > lastIndex) segments.push({
|
|
224
|
+
optional: false,
|
|
225
|
+
parts: compileParts(format.slice(lastIndex, index), keySet)
|
|
226
|
+
});
|
|
227
|
+
segments.push({
|
|
228
|
+
optional: true,
|
|
229
|
+
parts: compileParts(match[1], keySet)
|
|
230
|
+
});
|
|
231
|
+
lastIndex = index + match[0].length;
|
|
232
|
+
}
|
|
233
|
+
if (lastIndex < format.length) segments.push({
|
|
234
|
+
optional: false,
|
|
235
|
+
parts: compileParts(format.slice(lastIndex), keySet)
|
|
236
|
+
});
|
|
237
|
+
return segments;
|
|
238
|
+
}
|
|
239
|
+
function compileParts(segment, keySet) {
|
|
240
|
+
const parts = [];
|
|
241
|
+
let lastIndex = 0;
|
|
242
|
+
for (const match of segment.matchAll(TOKEN_REGEX)) {
|
|
243
|
+
const index = match.index ?? 0;
|
|
244
|
+
const key = match[1];
|
|
245
|
+
if (!keySet.has(key)) continue;
|
|
246
|
+
if (index > lastIndex) parts.push({
|
|
247
|
+
type: "text",
|
|
248
|
+
value: segment.slice(lastIndex, index)
|
|
249
|
+
});
|
|
250
|
+
parts.push({
|
|
251
|
+
type: "token",
|
|
252
|
+
key,
|
|
253
|
+
maxLength: match[2] ? Number(match[2]) : null,
|
|
254
|
+
truncate: Boolean(match[3])
|
|
255
|
+
});
|
|
256
|
+
lastIndex = index + match[0].length;
|
|
257
|
+
}
|
|
258
|
+
if (lastIndex < segment.length) parts.push({
|
|
259
|
+
type: "text",
|
|
260
|
+
value: segment.slice(lastIndex)
|
|
261
|
+
});
|
|
262
|
+
return parts;
|
|
263
|
+
}
|
|
264
|
+
function formatSegment(info, segment) {
|
|
265
|
+
let text = "";
|
|
266
|
+
for (const part of segment.parts) {
|
|
267
|
+
if (part.type === "text") {
|
|
268
|
+
text += part.value;
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
271
|
+
const value = formatTokenValue(info[part.key], part.maxLength, part.truncate);
|
|
272
|
+
if (value === null) {
|
|
273
|
+
if (segment.optional) return null;
|
|
274
|
+
continue;
|
|
275
|
+
}
|
|
276
|
+
text += value;
|
|
277
|
+
}
|
|
278
|
+
return text;
|
|
279
|
+
}
|
|
280
|
+
function formatTokenValue(value, maxLength, truncate) {
|
|
281
|
+
if (!value) return null;
|
|
282
|
+
if (!maxLength) return value;
|
|
283
|
+
if (!Number.isFinite(maxLength) || maxLength < 0 || value.length <= maxLength) return value;
|
|
284
|
+
return truncate ? value.slice(0, maxLength) : null;
|
|
285
|
+
}
|
|
286
|
+
//#endregion
|
|
287
|
+
//#region atomic/layer/layer.ts
|
|
288
|
+
function compareLayerPriority(p1, p2) {
|
|
289
|
+
return p1[0] - p2[0] || p1[1] - p2[1] || p1[2] - p2[2] || p1[3] - p2[3] || p1[4] - p2[4] || p1[5] - p2[5] || p1[6] - p2[6];
|
|
290
|
+
}
|
|
291
|
+
function createLayerNamePool() {
|
|
292
|
+
const lookup = /* @__PURE__ */ new Map();
|
|
293
|
+
const getLayerId = (priority) => {
|
|
294
|
+
const key = priority.join("|");
|
|
295
|
+
let name = lookup.get(key);
|
|
296
|
+
if (name) return name;
|
|
297
|
+
name = "p" + hashString(key);
|
|
298
|
+
lookup.set(key, name);
|
|
299
|
+
return name;
|
|
300
|
+
};
|
|
301
|
+
const getLayerName = (layerNamespace, priority) => {
|
|
302
|
+
const layerId = getLayerId(priority);
|
|
303
|
+
return layerNamespace ? layerNamespace + "." + layerId : layerId;
|
|
304
|
+
};
|
|
305
|
+
return {
|
|
306
|
+
getLayerName,
|
|
307
|
+
getLayerId
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
function createLayerPool(layerNamespace) {
|
|
311
|
+
const namePool = createLayerNamePool();
|
|
312
|
+
const priorities = /* @__PURE__ */ new Map();
|
|
313
|
+
const getName = (priority) => {
|
|
314
|
+
const key = priority.join("|");
|
|
315
|
+
if (!priorities.has(key)) priorities.set(key, priority);
|
|
316
|
+
return namePool.getLayerName(layerNamespace, priority);
|
|
317
|
+
};
|
|
318
|
+
const getNames = () => {
|
|
319
|
+
return Array.from(priorities.values()).sort(compareLayerPriority).map((priority) => namePool.getLayerName(layerNamespace, priority));
|
|
320
|
+
};
|
|
321
|
+
return {
|
|
322
|
+
getName,
|
|
323
|
+
getNames
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
function flattenCssLayers(layers, layerNames) {
|
|
327
|
+
const names = typeof layerNames === "string" ? [layerNames] : layerNames;
|
|
328
|
+
return layers.flatMap((layer) => layer === "$layer" ? names : layer).filter(Boolean);
|
|
329
|
+
}
|
|
330
|
+
//#endregion
|
|
331
|
+
//#region atomic/layer/types.ts
|
|
332
|
+
const LayerDefaultLayers = [LayerPlaceholder];
|
|
333
|
+
const LayerDefaultPriority = [
|
|
334
|
+
0,
|
|
335
|
+
0,
|
|
336
|
+
0,
|
|
337
|
+
0,
|
|
338
|
+
0,
|
|
339
|
+
0,
|
|
340
|
+
0
|
|
341
|
+
];
|
|
342
|
+
const LayerMediaPriorities = {
|
|
343
|
+
base: 0,
|
|
344
|
+
media: 1,
|
|
345
|
+
priorityMedia: 2
|
|
346
|
+
};
|
|
347
|
+
const LayerSelectorPriorities = {
|
|
348
|
+
base: 0,
|
|
349
|
+
parentSelector: 1,
|
|
350
|
+
selector: 2,
|
|
351
|
+
prioritySelector: 3
|
|
352
|
+
};
|
|
353
|
+
const LayerPropertyPriorities = {
|
|
354
|
+
shorthand: 0,
|
|
355
|
+
intermediate: 1,
|
|
356
|
+
longhand: 2
|
|
357
|
+
};
|
|
358
|
+
//#endregion
|
|
359
|
+
//#region atomic/layer/utils.ts
|
|
360
|
+
function getLayerOrderCss(layers, layerNames) {
|
|
361
|
+
const names = flattenCssLayers(layers, layerNames);
|
|
362
|
+
if (!names.length) return "";
|
|
363
|
+
return "@layer " + names.join(", ") + ";";
|
|
364
|
+
}
|
|
365
|
+
function getLayerBlockCss(layerName, css) {
|
|
366
|
+
return "@layer " + layerName + " {" + css + "}";
|
|
367
|
+
}
|
|
368
|
+
function joinLayerCss(layerOrderCss, css) {
|
|
369
|
+
const output = [];
|
|
370
|
+
if (layerOrderCss) output.push(layerOrderCss);
|
|
371
|
+
output.push(...css);
|
|
372
|
+
return output.join("\n") + "\n";
|
|
373
|
+
}
|
|
374
|
+
//#endregion
|
|
375
|
+
//#region style/token.ts
|
|
376
|
+
const TOKEN_ID = symbol("style:token");
|
|
377
|
+
const TOKEN_OVERRIDE = symbol("style:token.override");
|
|
378
|
+
const TOKEN_DEBUG = symbol("style:token.debug");
|
|
379
|
+
const idCounter = globalData("style.token.idCounter", () => ({ value: 0 }));
|
|
380
|
+
function resetStyleTokenIdCounter() {
|
|
381
|
+
idCounter.value = 0;
|
|
382
|
+
}
|
|
383
|
+
function createStyleToken(value, debugId) {
|
|
384
|
+
const token = (value, debug) => {
|
|
385
|
+
return createStyleTokenOverride(token, value, debug);
|
|
386
|
+
};
|
|
387
|
+
token[TOKEN_ID] = debugId || String(idCounter.value++);
|
|
388
|
+
if (isStyleTokenData(value)) {
|
|
389
|
+
token.value = value.value;
|
|
390
|
+
token.ref = value;
|
|
391
|
+
} else {
|
|
392
|
+
token.value = value;
|
|
393
|
+
token.ref = null;
|
|
394
|
+
}
|
|
395
|
+
return token;
|
|
396
|
+
}
|
|
397
|
+
function createStyleTokenOverride(token, value, debug) {
|
|
398
|
+
const override = isStyleTokenData(value) ? {
|
|
399
|
+
[TOKEN_ID]: getStyleTokenId(token),
|
|
400
|
+
[TOKEN_OVERRIDE]: true,
|
|
401
|
+
value: value.value,
|
|
402
|
+
ref: value
|
|
403
|
+
} : {
|
|
404
|
+
[TOKEN_ID]: getStyleTokenId(token),
|
|
405
|
+
[TOKEN_OVERRIDE]: true,
|
|
406
|
+
value,
|
|
407
|
+
ref: null
|
|
408
|
+
};
|
|
409
|
+
if (debug) Object.defineProperty(override, TOKEN_DEBUG, {
|
|
410
|
+
configurable: true,
|
|
411
|
+
enumerable: false,
|
|
412
|
+
value: debug
|
|
413
|
+
});
|
|
414
|
+
return override;
|
|
415
|
+
}
|
|
416
|
+
function getStyleTokenOverrideDebug(token) {
|
|
417
|
+
return token[TOKEN_DEBUG] ?? null;
|
|
418
|
+
}
|
|
419
|
+
function isStyleTokenData(value) {
|
|
420
|
+
return !!value && typeof value[TOKEN_ID] === "string" && value[TOKEN_OVERRIDE] !== true;
|
|
421
|
+
}
|
|
422
|
+
function isStyleTokenOverrideData(value) {
|
|
423
|
+
return !!value && typeof value[TOKEN_ID] === "string" && value[TOKEN_OVERRIDE] === true;
|
|
424
|
+
}
|
|
425
|
+
function getStyleTokenId(token) {
|
|
426
|
+
return token[TOKEN_ID];
|
|
427
|
+
}
|
|
428
|
+
const formatTokenName = createNameFormatter(["name"]);
|
|
429
|
+
function getTokenVarName(token, format) {
|
|
430
|
+
const id = getStyleTokenId(token);
|
|
431
|
+
return "--" + formatTokenName(format || "token[-(name)]-$hash", getIdentifierSafeHash(id), { name: id });
|
|
432
|
+
}
|
|
433
|
+
function getTokenVar(token, format) {
|
|
434
|
+
return getTokenVarFallback(token, format);
|
|
435
|
+
}
|
|
436
|
+
function getTokenOverrideValue(token, format) {
|
|
437
|
+
return token.ref ? getTokenVar(token.ref, format) : token.value;
|
|
438
|
+
}
|
|
439
|
+
function getTokenVarFallback(token, tokenNameFormat) {
|
|
440
|
+
const varName = getTokenVarName(token, tokenNameFormat);
|
|
441
|
+
if (token.ref) return getCssVarRawFallback(varName, getTokenVarFallback(token.ref, tokenNameFormat));
|
|
442
|
+
return getCssVar(varName, String(token.value ?? ""));
|
|
443
|
+
}
|
|
444
|
+
//#endregion
|
|
445
|
+
//#region atomic/property/types.ts
|
|
446
|
+
const LONGHAND = LayerPropertyPriorities.longhand;
|
|
447
|
+
const SHORTHAND = LayerPropertyPriorities.shorthand;
|
|
448
|
+
const INTERMEDIATE = LayerPropertyPriorities.intermediate;
|
|
449
|
+
//#endregion
|
|
450
|
+
//#region atomic/property/type_maps.ts
|
|
451
|
+
const animation = {
|
|
452
|
+
animation: SHORTHAND,
|
|
453
|
+
animationComposition: LONGHAND,
|
|
454
|
+
animationDelay: LONGHAND,
|
|
455
|
+
animationDirection: LONGHAND,
|
|
456
|
+
animationDuration: LONGHAND,
|
|
457
|
+
animationFillMode: LONGHAND,
|
|
458
|
+
animationIterationCount: LONGHAND,
|
|
459
|
+
animationName: LONGHAND,
|
|
460
|
+
animationPlayState: LONGHAND,
|
|
461
|
+
animationRange: INTERMEDIATE,
|
|
462
|
+
animationRangeEnd: LONGHAND,
|
|
463
|
+
animationRangeStart: LONGHAND,
|
|
464
|
+
animationTimeline: LONGHAND,
|
|
465
|
+
animationTimingFunction: LONGHAND
|
|
466
|
+
};
|
|
467
|
+
const background = {
|
|
468
|
+
background: SHORTHAND,
|
|
469
|
+
backgroundAttachment: LONGHAND,
|
|
470
|
+
backgroundBlendMode: LONGHAND,
|
|
471
|
+
backgroundClip: LONGHAND,
|
|
472
|
+
backgroundColor: LONGHAND,
|
|
473
|
+
backgroundImage: LONGHAND,
|
|
474
|
+
backgroundOrigin: LONGHAND,
|
|
475
|
+
backgroundPosition: INTERMEDIATE,
|
|
476
|
+
backgroundPositionX: LONGHAND,
|
|
477
|
+
backgroundPositionY: LONGHAND,
|
|
478
|
+
backgroundRepeat: INTERMEDIATE,
|
|
479
|
+
backgroundSize: LONGHAND
|
|
480
|
+
};
|
|
481
|
+
const border = {
|
|
482
|
+
border: SHORTHAND,
|
|
483
|
+
borderBlock: INTERMEDIATE,
|
|
484
|
+
borderBlockColor: INTERMEDIATE,
|
|
485
|
+
borderBlockEnd: INTERMEDIATE,
|
|
486
|
+
borderBlockEndColor: LONGHAND,
|
|
487
|
+
borderBlockEndStyle: LONGHAND,
|
|
488
|
+
borderBlockEndWidth: LONGHAND,
|
|
489
|
+
borderBlockStart: INTERMEDIATE,
|
|
490
|
+
borderBlockStartColor: LONGHAND,
|
|
491
|
+
borderBlockStartStyle: LONGHAND,
|
|
492
|
+
borderBlockStartWidth: LONGHAND,
|
|
493
|
+
borderBlockStyle: INTERMEDIATE,
|
|
494
|
+
borderBlockWidth: INTERMEDIATE,
|
|
495
|
+
borderBottom: INTERMEDIATE,
|
|
496
|
+
borderBottomColor: LONGHAND,
|
|
497
|
+
borderBottomLeftRadius: LONGHAND,
|
|
498
|
+
borderBottomRightRadius: LONGHAND,
|
|
499
|
+
borderBottomStyle: LONGHAND,
|
|
500
|
+
borderBottomWidth: LONGHAND,
|
|
501
|
+
borderColor: INTERMEDIATE,
|
|
502
|
+
borderImage: INTERMEDIATE,
|
|
503
|
+
borderImageOutset: LONGHAND,
|
|
504
|
+
borderImageRepeat: LONGHAND,
|
|
505
|
+
borderImageSlice: LONGHAND,
|
|
506
|
+
borderImageSource: LONGHAND,
|
|
507
|
+
borderImageWidth: LONGHAND,
|
|
508
|
+
borderInline: INTERMEDIATE,
|
|
509
|
+
borderInlineColor: INTERMEDIATE,
|
|
510
|
+
borderInlineEnd: INTERMEDIATE,
|
|
511
|
+
borderInlineEndColor: LONGHAND,
|
|
512
|
+
borderInlineEndStyle: LONGHAND,
|
|
513
|
+
borderInlineEndWidth: LONGHAND,
|
|
514
|
+
borderInlineStart: INTERMEDIATE,
|
|
515
|
+
borderInlineStartColor: LONGHAND,
|
|
516
|
+
borderInlineStartStyle: LONGHAND,
|
|
517
|
+
borderInlineStartWidth: LONGHAND,
|
|
518
|
+
borderInlineStyle: INTERMEDIATE,
|
|
519
|
+
borderInlineWidth: INTERMEDIATE,
|
|
520
|
+
borderLeft: INTERMEDIATE,
|
|
521
|
+
borderLeftColor: LONGHAND,
|
|
522
|
+
borderLeftStyle: LONGHAND,
|
|
523
|
+
borderLeftWidth: LONGHAND,
|
|
524
|
+
borderRadius: SHORTHAND,
|
|
525
|
+
borderEndEndRadius: LONGHAND,
|
|
526
|
+
borderEndStartRadius: LONGHAND,
|
|
527
|
+
borderRight: INTERMEDIATE,
|
|
528
|
+
borderRightColor: LONGHAND,
|
|
529
|
+
borderRightStyle: LONGHAND,
|
|
530
|
+
borderRightWidth: LONGHAND,
|
|
531
|
+
borderSpacing: SHORTHAND,
|
|
532
|
+
borderStartEndRadius: LONGHAND,
|
|
533
|
+
borderStartStartRadius: LONGHAND,
|
|
534
|
+
borderStyle: INTERMEDIATE,
|
|
535
|
+
borderTop: INTERMEDIATE,
|
|
536
|
+
borderTopColor: LONGHAND,
|
|
537
|
+
borderTopLeftRadius: LONGHAND,
|
|
538
|
+
borderTopRightRadius: LONGHAND,
|
|
539
|
+
borderTopStyle: LONGHAND,
|
|
540
|
+
borderTopWidth: LONGHAND,
|
|
541
|
+
borderWidth: INTERMEDIATE
|
|
542
|
+
};
|
|
543
|
+
const columns = {
|
|
544
|
+
columns: SHORTHAND,
|
|
545
|
+
columnCount: LONGHAND,
|
|
546
|
+
columnRule: INTERMEDIATE,
|
|
547
|
+
columnRuleColor: LONGHAND,
|
|
548
|
+
columnRuleStyle: LONGHAND,
|
|
549
|
+
columnRuleWidth: LONGHAND,
|
|
550
|
+
columnWidth: LONGHAND
|
|
551
|
+
};
|
|
552
|
+
const containIntrinsicSize = {
|
|
553
|
+
containIntrinsicSize: SHORTHAND,
|
|
554
|
+
containIntrinsicBlockSize: LONGHAND,
|
|
555
|
+
containIntrinsicHeight: LONGHAND,
|
|
556
|
+
containIntrinsicInlineSize: LONGHAND,
|
|
557
|
+
containIntrinsicWidth: LONGHAND
|
|
558
|
+
};
|
|
559
|
+
const container = {
|
|
560
|
+
container: SHORTHAND,
|
|
561
|
+
containerName: LONGHAND,
|
|
562
|
+
containerType: LONGHAND
|
|
563
|
+
};
|
|
564
|
+
const flex = {
|
|
565
|
+
flex: SHORTHAND,
|
|
566
|
+
flexBasis: LONGHAND,
|
|
567
|
+
flexDirection: LONGHAND,
|
|
568
|
+
flexFlow: INTERMEDIATE,
|
|
569
|
+
flexGrow: LONGHAND,
|
|
570
|
+
flexShrink: LONGHAND,
|
|
571
|
+
flexWrap: LONGHAND
|
|
572
|
+
};
|
|
573
|
+
const font = {
|
|
574
|
+
font: SHORTHAND,
|
|
575
|
+
fontFamily: LONGHAND,
|
|
576
|
+
fontFeatureSettings: LONGHAND,
|
|
577
|
+
fontKerning: LONGHAND,
|
|
578
|
+
fontLanguageOverride: LONGHAND,
|
|
579
|
+
fontOpticalSizing: LONGHAND,
|
|
580
|
+
fontPalette: LONGHAND,
|
|
581
|
+
fontSize: LONGHAND,
|
|
582
|
+
fontSizeAdjust: LONGHAND,
|
|
583
|
+
fontStretch: LONGHAND,
|
|
584
|
+
fontStyle: LONGHAND,
|
|
585
|
+
fontSynthesis: INTERMEDIATE,
|
|
586
|
+
fontSynthesisSmallCaps: LONGHAND,
|
|
587
|
+
fontSynthesisStyle: LONGHAND,
|
|
588
|
+
fontSynthesisWeight: LONGHAND,
|
|
589
|
+
fontVariant: INTERMEDIATE,
|
|
590
|
+
fontVariantAlternates: LONGHAND,
|
|
591
|
+
fontVariantCaps: LONGHAND,
|
|
592
|
+
fontVariantEastAsian: LONGHAND,
|
|
593
|
+
fontVariantEmoji: LONGHAND,
|
|
594
|
+
fontVariantLigatures: LONGHAND,
|
|
595
|
+
fontVariantNumeric: LONGHAND,
|
|
596
|
+
fontVariantPosition: LONGHAND,
|
|
597
|
+
fontVariationSettings: LONGHAND,
|
|
598
|
+
fontWeight: LONGHAND,
|
|
599
|
+
lineHeight: LONGHAND
|
|
600
|
+
};
|
|
601
|
+
const gap = {
|
|
602
|
+
gap: SHORTHAND,
|
|
603
|
+
columnGap: LONGHAND,
|
|
604
|
+
rowGap: LONGHAND
|
|
605
|
+
};
|
|
606
|
+
const grid = {
|
|
607
|
+
grid: SHORTHAND,
|
|
608
|
+
gridArea: INTERMEDIATE,
|
|
609
|
+
gridAutoColumns: LONGHAND,
|
|
610
|
+
gridAutoFlow: LONGHAND,
|
|
611
|
+
gridAutoRows: LONGHAND,
|
|
612
|
+
gridColumn: INTERMEDIATE,
|
|
613
|
+
gridColumnEnd: LONGHAND,
|
|
614
|
+
gridColumnStart: LONGHAND,
|
|
615
|
+
gridRow: INTERMEDIATE,
|
|
616
|
+
gridRowEnd: LONGHAND,
|
|
617
|
+
gridRowStart: LONGHAND,
|
|
618
|
+
gridTemplate: INTERMEDIATE,
|
|
619
|
+
gridTemplateAreas: LONGHAND,
|
|
620
|
+
gridTemplateColumns: LONGHAND,
|
|
621
|
+
gridTemplateRows: LONGHAND
|
|
622
|
+
};
|
|
623
|
+
const inset = {
|
|
624
|
+
inset: SHORTHAND,
|
|
625
|
+
insetBlock: INTERMEDIATE,
|
|
626
|
+
insetBlockEnd: LONGHAND,
|
|
627
|
+
insetBlockStart: LONGHAND,
|
|
628
|
+
insetInline: INTERMEDIATE,
|
|
629
|
+
insetInlineEnd: LONGHAND,
|
|
630
|
+
insetInlineStart: LONGHAND,
|
|
631
|
+
bottom: LONGHAND,
|
|
632
|
+
left: LONGHAND,
|
|
633
|
+
right: LONGHAND,
|
|
634
|
+
top: LONGHAND
|
|
635
|
+
};
|
|
636
|
+
const listStyle = {
|
|
637
|
+
listStyle: SHORTHAND,
|
|
638
|
+
listStyleImage: LONGHAND,
|
|
639
|
+
listStylePosition: LONGHAND,
|
|
640
|
+
listStyleType: LONGHAND
|
|
641
|
+
};
|
|
642
|
+
const margin = {
|
|
643
|
+
margin: SHORTHAND,
|
|
644
|
+
marginBlock: INTERMEDIATE,
|
|
645
|
+
marginBlockEnd: LONGHAND,
|
|
646
|
+
marginBlockStart: LONGHAND,
|
|
647
|
+
marginBottom: LONGHAND,
|
|
648
|
+
marginInline: INTERMEDIATE,
|
|
649
|
+
marginInlineEnd: LONGHAND,
|
|
650
|
+
marginInlineStart: LONGHAND,
|
|
651
|
+
marginLeft: LONGHAND,
|
|
652
|
+
marginRight: LONGHAND,
|
|
653
|
+
marginTop: LONGHAND
|
|
654
|
+
};
|
|
655
|
+
const mask = {
|
|
656
|
+
mask: SHORTHAND,
|
|
657
|
+
maskBorder: INTERMEDIATE,
|
|
658
|
+
maskBorderMode: LONGHAND,
|
|
659
|
+
maskBorderOutset: LONGHAND,
|
|
660
|
+
maskBorderRepeat: LONGHAND,
|
|
661
|
+
maskBorderSlice: LONGHAND,
|
|
662
|
+
maskBorderSource: LONGHAND,
|
|
663
|
+
maskBorderWidth: LONGHAND,
|
|
664
|
+
maskClip: LONGHAND,
|
|
665
|
+
maskComposite: LONGHAND,
|
|
666
|
+
maskImage: LONGHAND,
|
|
667
|
+
maskMode: LONGHAND,
|
|
668
|
+
maskOrigin: LONGHAND,
|
|
669
|
+
maskPosition: LONGHAND,
|
|
670
|
+
maskRepeat: LONGHAND,
|
|
671
|
+
maskSize: LONGHAND,
|
|
672
|
+
maskType: LONGHAND,
|
|
673
|
+
WebkitMask: SHORTHAND,
|
|
674
|
+
WebkitMaskBoxImage: INTERMEDIATE,
|
|
675
|
+
WebkitMaskBoxImageOutset: LONGHAND,
|
|
676
|
+
WebkitMaskBoxImageRepeat: LONGHAND,
|
|
677
|
+
WebkitMaskBoxImageSlice: LONGHAND,
|
|
678
|
+
WebkitMaskBoxImageSource: LONGHAND,
|
|
679
|
+
WebkitMaskBoxImageWidth: LONGHAND,
|
|
680
|
+
WebkitMaskClip: LONGHAND,
|
|
681
|
+
WebkitMaskComposite: LONGHAND,
|
|
682
|
+
WebkitMaskImage: LONGHAND,
|
|
683
|
+
WebkitMaskOrigin: LONGHAND,
|
|
684
|
+
WebkitMaskPosition: LONGHAND,
|
|
685
|
+
WebkitMaskPositionX: LONGHAND,
|
|
686
|
+
WebkitMaskPositionY: LONGHAND,
|
|
687
|
+
WebkitMaskRepeat: LONGHAND,
|
|
688
|
+
WebkitMaskRepeatX: LONGHAND,
|
|
689
|
+
WebkitMaskRepeatY: LONGHAND,
|
|
690
|
+
WebkitMaskSize: LONGHAND
|
|
691
|
+
};
|
|
692
|
+
const offset = {
|
|
693
|
+
offset: SHORTHAND,
|
|
694
|
+
offsetAnchor: LONGHAND,
|
|
695
|
+
offsetDistance: LONGHAND,
|
|
696
|
+
offsetPath: LONGHAND,
|
|
697
|
+
offsetPosition: LONGHAND,
|
|
698
|
+
offsetRotate: LONGHAND
|
|
699
|
+
};
|
|
700
|
+
const outline = {
|
|
701
|
+
outline: SHORTHAND,
|
|
702
|
+
outlineColor: LONGHAND,
|
|
703
|
+
outlineOffset: LONGHAND,
|
|
704
|
+
outlineStyle: LONGHAND,
|
|
705
|
+
outlineWidth: LONGHAND
|
|
706
|
+
};
|
|
707
|
+
const overflow = {
|
|
708
|
+
overflow: SHORTHAND,
|
|
709
|
+
overflowBlock: LONGHAND,
|
|
710
|
+
overflowClipMargin: SHORTHAND,
|
|
711
|
+
overflowInline: LONGHAND,
|
|
712
|
+
overflowWrap: LONGHAND,
|
|
713
|
+
overflowX: LONGHAND,
|
|
714
|
+
overflowY: LONGHAND
|
|
715
|
+
};
|
|
716
|
+
const overscrollBehavior = {
|
|
717
|
+
overscrollBehavior: SHORTHAND,
|
|
718
|
+
overscrollBehaviorBlock: LONGHAND,
|
|
719
|
+
overscrollBehaviorInline: LONGHAND,
|
|
720
|
+
overscrollBehaviorX: LONGHAND,
|
|
721
|
+
overscrollBehaviorY: LONGHAND
|
|
722
|
+
};
|
|
723
|
+
const padding = {
|
|
724
|
+
padding: SHORTHAND,
|
|
725
|
+
paddingBlock: INTERMEDIATE,
|
|
726
|
+
paddingBlockEnd: LONGHAND,
|
|
727
|
+
paddingBlockStart: LONGHAND,
|
|
728
|
+
paddingBottom: LONGHAND,
|
|
729
|
+
paddingInline: INTERMEDIATE,
|
|
730
|
+
paddingInlineEnd: LONGHAND,
|
|
731
|
+
paddingInlineStart: LONGHAND,
|
|
732
|
+
paddingLeft: LONGHAND,
|
|
733
|
+
paddingRight: LONGHAND,
|
|
734
|
+
paddingTop: LONGHAND
|
|
735
|
+
};
|
|
736
|
+
const place = {
|
|
737
|
+
placeContent: SHORTHAND,
|
|
738
|
+
alignContent: LONGHAND,
|
|
739
|
+
justifyContent: LONGHAND,
|
|
740
|
+
placeItems: SHORTHAND,
|
|
741
|
+
alignItems: LONGHAND,
|
|
742
|
+
justifyItems: LONGHAND,
|
|
743
|
+
placeSelf: SHORTHAND,
|
|
744
|
+
alignSelf: LONGHAND,
|
|
745
|
+
justifySelf: LONGHAND
|
|
746
|
+
};
|
|
747
|
+
const scrollMargin = {
|
|
748
|
+
scrollMargin: SHORTHAND,
|
|
749
|
+
scrollMarginBlock: INTERMEDIATE,
|
|
750
|
+
scrollMarginBlockEnd: LONGHAND,
|
|
751
|
+
scrollMarginBlockStart: LONGHAND,
|
|
752
|
+
scrollMarginBottom: LONGHAND,
|
|
753
|
+
scrollMarginInline: INTERMEDIATE,
|
|
754
|
+
scrollMarginInlineEnd: LONGHAND,
|
|
755
|
+
scrollMarginInlineStart: LONGHAND,
|
|
756
|
+
scrollMarginLeft: LONGHAND,
|
|
757
|
+
scrollMarginRight: LONGHAND,
|
|
758
|
+
scrollMarginTop: LONGHAND
|
|
759
|
+
};
|
|
760
|
+
const scrollPadding = {
|
|
761
|
+
scrollPadding: SHORTHAND,
|
|
762
|
+
scrollPaddingBlock: INTERMEDIATE,
|
|
763
|
+
scrollPaddingBlockEnd: LONGHAND,
|
|
764
|
+
scrollPaddingBlockStart: LONGHAND,
|
|
765
|
+
scrollPaddingBottom: LONGHAND,
|
|
766
|
+
scrollPaddingInline: INTERMEDIATE,
|
|
767
|
+
scrollPaddingInlineEnd: LONGHAND,
|
|
768
|
+
scrollPaddingInlineStart: LONGHAND,
|
|
769
|
+
scrollPaddingLeft: LONGHAND,
|
|
770
|
+
scrollPaddingRight: LONGHAND,
|
|
771
|
+
scrollPaddingTop: LONGHAND
|
|
772
|
+
};
|
|
773
|
+
const scrollTimeline = {
|
|
774
|
+
scrollTimeline: SHORTHAND,
|
|
775
|
+
scrollTimelineAxis: LONGHAND,
|
|
776
|
+
scrollTimelineName: LONGHAND
|
|
777
|
+
};
|
|
778
|
+
const text = {
|
|
779
|
+
textDecoration: SHORTHAND,
|
|
780
|
+
textDecorationColor: LONGHAND,
|
|
781
|
+
textDecorationLine: LONGHAND,
|
|
782
|
+
textDecorationSkip: LONGHAND,
|
|
783
|
+
textDecorationSkipInk: LONGHAND,
|
|
784
|
+
textDecorationStyle: LONGHAND,
|
|
785
|
+
textDecorationThickness: LONGHAND,
|
|
786
|
+
textEmphasis: SHORTHAND,
|
|
787
|
+
textEmphasisColor: LONGHAND,
|
|
788
|
+
textEmphasisPosition: LONGHAND,
|
|
789
|
+
textEmphasisStyle: LONGHAND
|
|
790
|
+
};
|
|
791
|
+
const transition = {
|
|
792
|
+
transition: SHORTHAND,
|
|
793
|
+
transitionBehavior: LONGHAND,
|
|
794
|
+
transitionDelay: LONGHAND,
|
|
795
|
+
transitionDuration: LONGHAND,
|
|
796
|
+
transitionProperty: LONGHAND,
|
|
797
|
+
transitionTimingFunction: LONGHAND
|
|
798
|
+
};
|
|
799
|
+
const viewTimeline = {
|
|
800
|
+
viewTimeline: SHORTHAND,
|
|
801
|
+
viewTimelineAxis: LONGHAND,
|
|
802
|
+
viewTimelineInset: LONGHAND,
|
|
803
|
+
viewTimelineName: LONGHAND
|
|
804
|
+
};
|
|
805
|
+
const whiteSpace = {
|
|
806
|
+
whiteSpace: SHORTHAND,
|
|
807
|
+
whiteSpaceCollapse: LONGHAND
|
|
808
|
+
};
|
|
809
|
+
//#endregion
|
|
810
|
+
//#region atomic/property/presets.ts
|
|
811
|
+
const DefaultPropertyTypes = {
|
|
812
|
+
...animation,
|
|
813
|
+
...background,
|
|
814
|
+
...border,
|
|
815
|
+
...columns,
|
|
816
|
+
...containIntrinsicSize,
|
|
817
|
+
...container,
|
|
818
|
+
...flex,
|
|
819
|
+
...font,
|
|
820
|
+
...gap,
|
|
821
|
+
...grid,
|
|
822
|
+
...inset,
|
|
823
|
+
...listStyle,
|
|
824
|
+
...margin,
|
|
825
|
+
...mask,
|
|
826
|
+
...offset,
|
|
827
|
+
...outline,
|
|
828
|
+
...overflow,
|
|
829
|
+
...overscrollBehavior,
|
|
830
|
+
...padding,
|
|
831
|
+
...place,
|
|
832
|
+
...scrollMargin,
|
|
833
|
+
...scrollPadding,
|
|
834
|
+
...scrollTimeline,
|
|
835
|
+
...text,
|
|
836
|
+
...transition,
|
|
837
|
+
...viewTimeline,
|
|
838
|
+
...whiteSpace
|
|
839
|
+
};
|
|
840
|
+
function getPropertyPriority(property) {
|
|
841
|
+
return DefaultPropertyTypes[property] ?? 0;
|
|
842
|
+
}
|
|
843
|
+
function getCssPropertyName(property) {
|
|
844
|
+
return property.replace(/^(webkit|moz|ms|o)([A-Z])/g, (_, prefix, c) => `-${prefix}-${c.toLowerCase()}`).replace(/[A-Z]/g, (c) => "-" + c.toLowerCase());
|
|
845
|
+
}
|
|
846
|
+
//#endregion
|
|
847
|
+
//#region atomic/value/unitless.ts
|
|
848
|
+
const UnitlessProperties = [
|
|
849
|
+
"animationIterationCount",
|
|
850
|
+
"aspectRatio",
|
|
851
|
+
"borderImageOutset",
|
|
852
|
+
"borderImageSlice",
|
|
853
|
+
"borderImageWidth",
|
|
854
|
+
"boxFlex",
|
|
855
|
+
"boxFlexGroup",
|
|
856
|
+
"boxOrdinalGroup",
|
|
857
|
+
"columnCount",
|
|
858
|
+
"columns",
|
|
859
|
+
"fillOpacity",
|
|
860
|
+
"flex",
|
|
861
|
+
"flexGrow",
|
|
862
|
+
"flexNegative",
|
|
863
|
+
"flexOrder",
|
|
864
|
+
"flexPositive",
|
|
865
|
+
"flexShrink",
|
|
866
|
+
"floodOpacity",
|
|
867
|
+
"fontWeight",
|
|
868
|
+
"gridArea",
|
|
869
|
+
"gridColumn",
|
|
870
|
+
"gridColumnEnd",
|
|
871
|
+
"gridColumnSpan",
|
|
872
|
+
"gridColumnStart",
|
|
873
|
+
"gridRow",
|
|
874
|
+
"gridRowEnd",
|
|
875
|
+
"gridRowSpan",
|
|
876
|
+
"gridRowStart",
|
|
877
|
+
"imageOrientation",
|
|
878
|
+
"lineClamp",
|
|
879
|
+
"lineHeight",
|
|
880
|
+
"opacity",
|
|
881
|
+
"order",
|
|
882
|
+
"orphans",
|
|
883
|
+
"scale",
|
|
884
|
+
"stopOpacity",
|
|
885
|
+
"strokeDasharray",
|
|
886
|
+
"strokeDashoffset",
|
|
887
|
+
"strokeMiterlimit",
|
|
888
|
+
"strokeOpacity",
|
|
889
|
+
"strokeWidth",
|
|
890
|
+
"tabSize",
|
|
891
|
+
"widows",
|
|
892
|
+
"zIndex",
|
|
893
|
+
"zoom"
|
|
894
|
+
];
|
|
895
|
+
//#endregion
|
|
896
|
+
//#region atomic/value/value.ts
|
|
897
|
+
const CSS_NUMBER_VALUE = /^-?(\d+\.?\d*|\.\d+)$/;
|
|
898
|
+
const UNITLESS = new Set(UnitlessProperties);
|
|
899
|
+
function getCssPropertyValue(property, value) {
|
|
900
|
+
if (!value || !shouldAppendCssPx(property)) return value;
|
|
901
|
+
if (CSS_NUMBER_VALUE.test(value)) return value + "px";
|
|
902
|
+
return value;
|
|
903
|
+
}
|
|
904
|
+
function shouldAppendCssPx(property) {
|
|
905
|
+
return !UNITLESS.has(property);
|
|
906
|
+
}
|
|
907
|
+
//#endregion
|
|
908
|
+
export { getCssVarRawFallback as A, CSS_CONFIG_DEFAULT as B, LayerMediaPriorities as C, createNameFormatter as D, createLayerPool as E, DEV_CONFIG as F, globalData as G, RUNTIME_CONFIG as H, getBuildDevConfig as I, symbol as K, setDevUtilsRuntimeOptions as L, sanitizeCssIdentName as M, hashString as N, escapeCssIdent as O, configureStyleRuntime as P, hasOwn as R, LayerDefaultPriority as S, compareLayerPriority as T, SIDECAR_URL_GLOBAL_SYMBOL as U, LayerPlaceholder as V, getGlobalData as W, resetStyleTokenIdCounter as _, getTokenOverrideValue as a, joinLayerCss as b, TOKEN_DEBUG as c, createStyleToken as d, createStyleTokenOverride as f, isStyleTokenOverrideData as g, isStyleTokenData as h, getPropertyPriority as i, getIdentifierSafeHash as j, escapeCssValue as k, TOKEN_ID as l, getStyleTokenOverrideDebug as m, shouldAppendCssPx as n, getTokenVar as o, getStyleTokenId as p, getCssPropertyName as r, getTokenVarName as s, getCssPropertyValue as t, TOKEN_OVERRIDE as u, getLayerBlockCss as v, LayerSelectorPriorities as w, LayerDefaultLayers as x, getLayerOrderCss as y, CSS_CONFIG as z };
|
|
909
|
+
|
|
910
|
+
//# sourceMappingURL=value-BR4e2MKt.js.map
|