@fluentic/style 0.1.0-beta.1 → 0.1.0-beta.10
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 +150 -2
- package/README.md +181 -49
- package/atomic/atRule/utils.ts +3 -2
- package/atomic/className.ts +50 -12
- package/atomic/debug/className/className.ts +24 -8
- package/atomic/element.ts +5 -2
- package/atomic/rule.ts +11 -5
- package/atomic/scope.ts +19 -0
- package/atomic/theme.ts +44 -3
- package/atomic/token.ts +7 -4
- package/atomic/utils/cssIdent.ts +54 -0
- package/atomic/utils/cssVar.ts +19 -0
- package/atomic/utils/debug.ts +1 -1
- package/atomic/utils/format.ts +1 -1
- package/atomic/utils/hash.ts +14 -0
- package/atomic/utils/selector.ts +31 -1
- package/atomic/var.ts +3 -2
- package/builder/classname/class_name_builder.ts +491 -0
- package/builder/classname/fns.ts +77 -0
- package/builder/classname/index.ts +3 -0
- package/builder/classname/types.ts +41 -0
- package/builder/data/const.ts +8 -1
- package/builder/data/create.ts +52 -6
- package/builder/data/data.ts +33 -8
- package/builder/data/debug.ts +1 -0
- package/builder/data/index.ts +0 -1
- package/builder/data/is.ts +26 -3
- package/builder/data/merge/scope.ts +38 -38
- package/builder/data/merge/style.ts +115 -20
- package/builder/data/state.ts +17 -2
- package/builder/extract/index.ts +1 -0
- package/builder/extract/sheet.ts +30 -0
- package/builder/extract/token.ts +30 -14
- package/builder/extract/utils.ts +2 -0
- package/builder/extract/withTokens.ts +2 -1
- package/builder/selector_override.noop.ts +11 -0
- package/builder/selector_override.ts +31 -0
- package/builder/selector_override_core.ts +79 -0
- package/builder/style_builder.ts +144 -20
- package/builder/style_data.ts +25 -0
- package/builder/style_fns.ts +57 -57
- package/builder/token/data.ts +30 -0
- package/builder/token/index.ts +3 -0
- package/builder/token/name.ts +54 -0
- package/builder/token/symbols.ts +6 -0
- package/builder/types/alias.ts +44 -16
- package/builder/types/fns.ts +24 -16
- package/builder/types/types.ts +37 -7
- package/builder/utils.ts +1 -0
- package/compiler/compiler/compiler.ts +88 -14
- package/compiler/compiler/constants.ts +6 -0
- package/compiler/compiler/index.ts +1 -0
- package/compiler/compiler/types.ts +4 -1
- package/compiler/cssProp.ts +21 -0
- package/compiler/extract/extract.ts +42 -14
- package/compiler/extract/types.ts +2 -0
- package/compiler/index.ts +1 -0
- package/compiler/transform/cssProp/index.ts +1 -0
- package/compiler/transform/cssProp/plugin.ts +161 -0
- package/compiler/transform/debug/plugin.ts +93 -4
- package/compiler/transform/debug/transform.ts +2 -1
- package/compiler/transform/debug/utils/debug_data.ts +73 -0
- package/compiler/transform/evaluator/evaluator.ts +169 -32
- package/compiler/transform/evaluator/tracer.ts +48 -11
- package/compiler/transform/extract/chain/chain.ts +1370 -162
- package/compiler/transform/extract/chain/extract_chain.ts +12 -4
- package/compiler/transform/extract/chain/types.ts +3 -1
- package/compiler/transform/extract/plugin.ts +64 -6
- package/compiler/transform/extract/transform.ts +2 -1
- package/compiler/transform/extract/utils/replacement.ts +72 -2
- package/compiler/transform/extract/utils/state.ts +3 -0
- package/compiler/transform/extract/utils/theme.ts +6 -6
- package/compiler/transform/index.ts +1 -0
- package/compiler/transform/syntax/isStaticStyleValue.ts +15 -9
- package/compiler/transform/syntax/static_ids.ts +1 -1
- package/compiler/utils/constants.ts +12 -5
- package/compiler/utils/file_resolver.ts +2 -0
- package/compiler/utils/import_source.ts +19 -8
- package/compiler/utils/imports.ts +11 -1
- package/config/build.ts +9 -2
- package/config/config/check.ts +25 -0
- package/config/config/css.ts +18 -1
- package/config/config/debug.ts +24 -1
- package/config/config/dev.ts +17 -1
- package/config/configure.ts +19 -2
- package/config/types.ts +7 -0
- package/css/index.ts +2 -0
- package/css/sheet.ts +152 -0
- package/css/styleTarget.ts +251 -0
- package/dev/config.ts +2 -3
- package/dev/utils.ts +3 -3
- package/dialect/extracted/index.ts +5 -0
- package/dialect/index.ts +1 -0
- package/dialect/namedTokens.ts +153 -0
- package/dist/adapter/preact.js +2 -0
- package/dist/adapter/react.js +2 -0
- package/dist/adapter/solid.js +2 -0
- package/dist/className-yhJCGT0F.js +304 -0
- package/dist/className-yhJCGT0F.js.map +1 -0
- package/dist/combine-Bww7VnSr.js +1254 -0
- package/dist/combine-Bww7VnSr.js.map +1 -0
- package/dist/compiler/index.mjs +2 -2
- package/dist/{compiler-DENc3a2R.mjs → compiler-C3CEGGtI.mjs} +2335 -638
- package/dist/compiler-C3CEGGtI.mjs.map +1 -0
- package/dist/config/index.js +2 -2
- package/dist/config-BAEzRmSJ.js +6 -0
- package/dist/{config-Di2VYYKV.js.map → config-BAEzRmSJ.js.map} +1 -1
- package/dist/config-BKP5LOkt.js +35 -0
- package/dist/config-BKP5LOkt.js.map +1 -0
- package/dist/config-C5VWvTav.js +34 -0
- package/dist/config-C5VWvTav.js.map +1 -0
- package/dist/config-CB4lm2tM.js +1 -0
- package/dist/config-CDjbHwb-.js +6 -0
- package/dist/config-CDjbHwb-.js.map +1 -0
- package/dist/config-DNEnHEf3.js +36 -0
- package/dist/config-DNEnHEf3.js.map +1 -0
- package/dist/createTransformElement-D8fXZ3wA.js +34 -0
- package/dist/createTransformElement-D8fXZ3wA.js.map +1 -0
- package/dist/css-BDn0epJ8.js +1339 -0
- package/dist/css-BDn0epJ8.js.map +1 -0
- package/dist/css-CFxNrYt3.js +4040 -0
- package/dist/css-CFxNrYt3.js.map +1 -0
- package/dist/css-DEYgrj76.js +524 -0
- package/dist/css-DEYgrj76.js.map +1 -0
- package/dist/{runtime-CYqNCiaM.js → css-DWBWsyxZ.js} +16 -19
- package/dist/css-DWBWsyxZ.js.map +1 -0
- package/dist/css.js +2 -2
- package/dist/{css_extra-oIi3UEPK.js → css_extra-nTq_Gw0E.js} +2 -2
- package/dist/{css_extra-DlOnsnR1.js.map → css_extra-nTq_Gw0E.js.map} +1 -1
- package/dist/data-CDrS1Bq4.js +785 -0
- package/dist/data-CDrS1Bq4.js.map +1 -0
- package/dist/debug-BkVbf0Cz.js +52 -0
- package/dist/debug-BkVbf0Cz.js.map +1 -0
- package/dist/{debug-n2aZQBSa.js → debug-YuhEIQVO.js} +80 -4
- package/dist/debug-YuhEIQVO.js.map +1 -0
- package/dist/dev/rsc.js +10 -9
- package/dist/dev/rsc.js.map +1 -1
- package/dist/{dev-CcphAa3R.js → dev-0imWmSVb.js} +10 -10
- package/dist/dev-0imWmSVb.js.map +1 -0
- package/dist/dev.js +1 -1
- package/dist/dialect/extracted/index.js +2 -0
- package/dist/dialect/index.js +2 -0
- package/dist/{elementMarker-Bu7gDAkE.js → elementMarker-kvpMjB49.js} +164 -30
- package/dist/elementMarker-kvpMjB49.js.map +1 -0
- package/dist/entry/dev/adapter/preact.js +12 -0
- package/dist/entry/dev/adapter/preact.js.map +1 -0
- package/dist/entry/dev/adapter/react.js +12 -0
- package/dist/entry/dev/adapter/react.js.map +1 -0
- package/dist/entry/dev/adapter/solid.js +12 -0
- package/dist/entry/dev/adapter/solid.js.map +1 -0
- package/dist/entry/dev/css.js +3 -3
- package/dist/entry/dev/jsx-dev-runtime.js +2 -1
- package/dist/entry/dev/jsx-runtime.js +2 -1
- package/dist/entry/dev.js +13 -9
- package/dist/entry/prod/adapter/preact.js +12 -0
- package/dist/entry/prod/adapter/preact.js.map +1 -0
- package/dist/entry/prod/adapter/react.js +12 -0
- package/dist/entry/prod/adapter/react.js.map +1 -0
- package/dist/entry/prod/adapter/solid.js +12 -0
- package/dist/entry/prod/adapter/solid.js.map +1 -0
- package/dist/entry/prod/css.js +3 -3
- package/dist/entry/prod/extract.js +242 -3
- package/dist/entry/prod/extract.js.map +1 -0
- package/dist/entry/prod/jsx-dev-runtime.js +2 -2
- package/dist/entry/prod/jsx-runtime.js +2 -2
- package/dist/entry/prod/runtime.js +3 -4
- package/dist/entry/prod.js +84 -1201
- package/dist/entry/prod.js.map +1 -1
- package/dist/entry/rsc-dev/adapter/preact.js +13 -0
- package/dist/entry/rsc-dev/adapter/preact.js.map +1 -0
- package/dist/entry/rsc-dev/adapter/react.js +13 -0
- package/dist/entry/rsc-dev/adapter/react.js.map +1 -0
- package/dist/entry/rsc-dev/adapter/solid.js +13 -0
- package/dist/entry/rsc-dev/adapter/solid.js.map +1 -0
- package/dist/entry/rsc-dev/css.js +3 -3
- package/dist/entry/rsc-dev/dev.js +11 -13
- package/dist/entry/rsc-dev/dev.js.map +1 -1
- package/dist/entry/rsc-dev/jsx-dev-runtime.js +2 -2
- package/dist/entry/rsc-dev/jsx-runtime.js +2 -2
- package/dist/entry/rsc-dev.js +582 -664
- package/dist/entry/rsc-dev.js.map +1 -1
- package/dist/entry/rsc-prod/adapter/preact.js +2 -0
- package/dist/entry/rsc-prod/adapter/react.js +2 -0
- package/dist/entry/rsc-prod/adapter/solid.js +2 -0
- package/dist/entry/rsc-prod/css.js +9 -3
- package/dist/entry/rsc-prod/css.js.map +1 -0
- package/dist/entry/rsc-prod/jsx-dev-runtime.js +2 -2
- package/dist/entry/rsc-prod/jsx-runtime.js +2 -2
- package/dist/entry/rsc-prod/runtime.js +3 -4
- package/dist/entry/rsc-prod.js +242 -10
- package/dist/entry/rsc-prod.js.map +1 -0
- package/dist/{styleStore-Dea_WVbr.js → env-Cz8frh6e.js} +1335 -372
- package/dist/env-Cz8frh6e.js.map +1 -0
- package/dist/getClassName-9CsXbNls.js +545 -0
- package/dist/getClassName-9CsXbNls.js.map +1 -0
- package/dist/{utils-D7FAOyg6.js → getClassName-DGm-VNDo.js} +28 -65
- package/dist/getClassName-DGm-VNDo.js.map +1 -0
- package/dist/getClassName-Dtc4yyYI.js +47 -0
- package/dist/getClassName-Dtc4yyYI.js.map +1 -0
- package/dist/{getClassName-BlvXHYuf.js → getClassName-DtkplEIt.js} +56 -14
- package/dist/getClassName-DtkplEIt.js.map +1 -0
- package/dist/global-CAc9OjKx.js +14 -0
- package/dist/global-CAc9OjKx.js.map +1 -0
- package/dist/{format-3nKBE_5t.js → hash-Cr-LCWDt.js} +51 -29
- package/dist/hash-Cr-LCWDt.js.map +1 -0
- package/dist/index.js +10 -8
- package/dist/jsx/jsx-dev-runtime.js +2 -2
- package/dist/jsx/jsx-dev-runtime.server.js +1 -1
- package/dist/jsx/jsx-runtime.js +2 -2
- package/dist/jsx/jsx-runtime.server.js +1 -1
- package/dist/jsx-CVxpkS04.js +39 -0
- package/dist/jsx-CVxpkS04.js.map +1 -0
- package/dist/{jsx_dev_runtime-B6xs4by8.js → jsx_dev_runtime-D068tAsT.js} +2 -3
- package/dist/{jsx_dev_runtime-B6xs4by8.js.map → jsx_dev_runtime-D068tAsT.js.map} +1 -1
- package/dist/{jsx_runtime-iHLDwpcW.js → jsx_runtime-6Qa1lmz2.js} +2 -2
- package/dist/{jsx_runtime-iHLDwpcW.js.map → jsx_runtime-6Qa1lmz2.js.map} +1 -1
- package/dist/{jsx_runtime-04xfnsi7.js → jsx_runtime-DT1Tr9cH.js} +2 -3
- package/dist/{jsx_runtime-04xfnsi7.js.map → jsx_runtime-DT1Tr9cH.js.map} +1 -1
- package/dist/{loader-B5Kw0DD-.mjs → loader-_-VjzlrX.mjs} +13 -14
- package/dist/loader-_-VjzlrX.mjs.map +1 -0
- package/dist/{misc-DCdYYyhK.mjs → misc-B76PUnWe.mjs} +11 -6
- package/dist/misc-B76PUnWe.mjs.map +1 -0
- package/dist/namedTokens-5AayGokX.js +85 -0
- package/dist/namedTokens-5AayGokX.js.map +1 -0
- package/dist/plugin/farm/index.mjs +4 -3
- package/dist/plugin/farm/index.mjs.map +1 -1
- package/dist/plugin/nextjs/index.mjs +121 -17
- package/dist/plugin/nextjs/index.mjs.map +1 -1
- package/dist/plugin/nextjs/loader.mjs +4 -4
- package/dist/plugin/parcel/index.cjs +2 -0
- package/dist/plugin/parcel/index.mjs +3 -1
- package/dist/plugin/parcel/optimizer.cjs +3 -2
- package/dist/plugin/parcel/optimizer.cjs.map +1 -1
- package/dist/plugin/parcel/optimizer.mjs +3 -2
- package/dist/plugin/parcel/optimizer.mjs.map +1 -1
- package/dist/plugin/parcel/resolver.cjs +1 -1
- package/dist/plugin/parcel/resolver.mjs +2 -2
- package/dist/plugin/parcel/runtime.cjs +1 -1
- package/dist/plugin/parcel/runtime.mjs +1 -1
- package/dist/plugin/parcel/transformer.cjs +1 -1
- package/dist/plugin/parcel/transformer.mjs +2 -2
- package/dist/plugin/rspack/index.mjs +3 -2
- package/dist/plugin/rspack/index.mjs.map +1 -1
- package/dist/plugin/vite/index.mjs +13 -10
- package/dist/plugin/vite/index.mjs.map +1 -1
- package/dist/plugin/webpack/index.mjs +3 -2
- package/dist/plugin/webpack/loader.mjs +2 -2
- package/dist/presets/tailwind/index.js +995 -0
- package/dist/presets/tailwind/index.js.map +1 -0
- package/dist/{assert-BGdigdr5.js → presets-DSanixJV.js} +106 -2
- package/dist/presets-DSanixJV.js.map +1 -0
- package/dist/{registry-yHLRxyoo.mjs → registry-w8ET5R7v.mjs} +2 -2
- package/dist/{registry-yHLRxyoo.mjs.map → registry-w8ET5R7v.mjs.map} +1 -1
- package/dist/resolveClassNameRuntime-CJjlUP93.js +63 -0
- package/dist/resolveClassNameRuntime-CJjlUP93.js.map +1 -0
- package/dist/{rules-9HSO1pxL.js → rules-DaMaMHgb.js} +618 -138
- package/dist/rules-DaMaMHgb.js.map +1 -0
- package/dist/scope-CZdGAnl_.js +601 -0
- package/dist/scope-CZdGAnl_.js.map +1 -0
- package/dist/selector/index.js +1 -2
- package/dist/server.js +17 -11
- package/dist/server.js.map +1 -1
- package/dist/{shared-CxbHR89f.mjs → shared-C_cYxNzz.mjs} +4 -4
- package/dist/{shared-CxbHR89f.mjs.map → shared-C_cYxNzz.mjs.map} +1 -1
- package/dist/{shared-CBArHB9-.cjs → shared-PK52rW6T.cjs} +2338 -635
- package/dist/shared-PK52rW6T.cjs.map +1 -0
- package/dist/sheet-CxkO1Hwt.js +7 -0
- package/dist/sheet-CxkO1Hwt.js.map +1 -0
- package/dist/{sidecar-BFakLl0X.mjs → sidecar-BhvmXYsD.mjs} +3 -3
- package/dist/{sidecar-BFakLl0X.mjs.map → sidecar-BhvmXYsD.mjs.map} +1 -1
- package/dist/style-CAhAnRni.js +1129 -0
- package/dist/style-CAhAnRni.js.map +1 -0
- package/dist/{styleStore-DyNXBcUK.js → styleStore-BzLZwpwy.js} +8 -7
- package/dist/styleStore-BzLZwpwy.js.map +1 -0
- package/dist/styleStore-DaIJ4OPV.js +58 -0
- package/dist/styleStore-DaIJ4OPV.js.map +1 -0
- package/dist/token-D33mKTka.js +138 -0
- package/dist/token-D33mKTka.js.map +1 -0
- package/dist/{trace-Bu_qOqRy.js → trace-B3dpTRJp.js} +3 -3
- package/dist/{trace-Bu_qOqRy.js.map → trace-B3dpTRJp.js.map} +1 -1
- package/dist/{trace-CU0rvNYr.js → trace-c2WmBbmX.js} +2 -2
- package/dist/{trace-CU0rvNYr.js.map → trace-c2WmBbmX.js.map} +1 -1
- package/dist/transform-DSpimwwC.js +23 -0
- package/dist/transform-DSpimwwC.js.map +1 -0
- package/dist/{utils-Bdbqn0f8.mjs → utils-DND33M6y.mjs} +3 -3
- package/dist/{utils-Bdbqn0f8.mjs.map → utils-DND33M6y.mjs.map} +1 -1
- package/dist/utils-DZK0mfmY.js +42 -0
- package/dist/utils-DZK0mfmY.js.map +1 -0
- package/dist/utils-D_XgtMtn.js +72 -0
- package/dist/utils-D_XgtMtn.js.map +1 -0
- package/dist/utils-DxCpyV2E.js +62 -0
- package/dist/utils-DxCpyV2E.js.map +1 -0
- package/dist/{utils-BbehLOby.js → utils-H1VInWpd.js} +407 -234
- package/dist/utils-H1VInWpd.js.map +1 -0
- package/dist/utils-NdisireF.mjs +182 -0
- package/dist/utils-NdisireF.mjs.map +1 -0
- package/dist/utils.js +4 -4
- package/dist/utils.js.map +1 -1
- package/dist/value-CK0-Xbov.js +160 -0
- package/dist/value-CK0-Xbov.js.map +1 -0
- package/dist/{webpack-Dh6lox2l.mjs → webpack-D7QO0bKN.mjs} +5 -5
- package/dist/webpack-D7QO0bKN.mjs.map +1 -0
- package/entry/dev/adapter/preact.ts +8 -0
- package/entry/dev/adapter/react.ts +8 -0
- package/entry/dev/adapter/solid.ts +8 -0
- package/entry/dev/config.ts +1 -1
- package/entry/dev/index.ts +1 -0
- package/entry/dev/jsx_dev_runtime.ts +1 -0
- package/entry/dev/jsx_runtime.ts +1 -0
- package/entry/dev/sheet.ts +4 -0
- package/entry/prod/adapter/preact.ts +8 -0
- package/entry/prod/adapter/react.ts +8 -0
- package/entry/prod/adapter/solid.ts +8 -0
- package/entry/prod/config_debug.ts +2 -0
- package/entry/prod/index.ts +1 -1
- package/entry/prod/runtime.ts +4 -2
- package/entry/rsc_dev/adapter/preact.ts +9 -0
- package/entry/rsc_dev/adapter/react.ts +9 -0
- package/entry/rsc_dev/adapter/solid.ts +9 -0
- package/entry/rsc_dev/config.ts +1 -1
- package/entry/rsc_dev/server.ts +1 -1
- package/entry/rsc_prod/adapter/preact.ts +1 -0
- package/entry/rsc_prod/adapter/react.ts +1 -0
- package/entry/rsc_prod/adapter/solid.ts +1 -0
- package/entry/rsc_prod/config_debug.ts +6 -0
- package/entry/rsc_prod/index.ts +1 -1
- package/entry/rsc_prod/runtime.ts +1 -1
- package/entry/rsc_prod/server.ts +1 -1
- package/entry/shared/config_debug.ts +9 -0
- package/entry/shared/config_dev.ts +14 -0
- package/entry/shared/dev.ts +11 -2
- package/entry/shared/utils.ts +28 -0
- package/jsx/types/index.ts +1 -0
- package/jsx/types/preact.ts +14 -0
- package/jsx/{types.ts → types/react.ts} +2 -2
- package/jsx/types/solid.ts +32 -0
- package/package.json +110 -8
- package/plugin/bundler/farm/plugin.ts +2 -0
- package/plugin/bundler/parcel/optimizer.ts +1 -0
- package/plugin/bundler/parcel/plugin.ts +2 -0
- package/plugin/bundler/rspack/plugin.ts +1 -0
- package/plugin/bundler/vite/plugin.ts +5 -9
- package/plugin/bundler/vite/state.ts +11 -6
- package/plugin/bundler/webpack/plugin.ts +2 -1
- package/plugin/bundler/webpack/shared/loader.ts +9 -7
- package/plugin/nextjs/plugin.ts +208 -15
- package/plugin/nextjs/types.ts +1 -2
- package/plugin/nextjs/utils.ts +121 -0
- package/plugin/utils/compiler.ts +2 -0
- package/plugin/utils/runtimeEntry.ts +15 -2
- package/presets/tailwind/classname/index.ts +2 -0
- package/presets/tailwind/classname/transform.ts +239 -0
- package/presets/tailwind/classname/types.ts +124 -0
- package/presets/tailwind/index.ts +5 -0
- package/presets/tailwind/selectors.ts +27 -0
- package/presets/tailwind/style/index.ts +2 -0
- package/presets/tailwind/style/transform.ts +436 -0
- package/presets/tailwind/style/types.ts +346 -0
- package/presets/tailwind/theme.ts +479 -0
- package/presets/tailwind/types.ts +147 -0
- package/runtime/adapter/utils.ts +120 -0
- package/runtime/core/cache/combine.ts +76 -28
- package/runtime/core/cache/combineRuntime.ts +4 -0
- package/runtime/core/cache/index.ts +2 -1
- package/runtime/core/cache/item.ts +32 -13
- package/runtime/core/cache/itemWithResolver.ts +44 -0
- package/runtime/core/cache/pool.ts +16 -31
- package/runtime/core/cache/prop.ts +10 -8
- package/runtime/core/cache/result.ts +2 -2
- package/runtime/core/cache/stateItem.ts +16 -1
- package/runtime/core/cache/token.ts +20 -0
- package/runtime/core/cache/tokenValues.ts +19 -11
- package/runtime/core/combinedStyle.ts +4 -4
- package/runtime/extract/combineStyle.ts +211 -0
- package/runtime/extract/getClassName.ts +55 -23
- package/runtime/extract/index.ts +4 -2
- package/runtime/extract/token.ts +41 -0
- package/runtime/extract/tokenResolver.ts +17 -0
- package/runtime/index.ts +8 -1
- package/runtime/rsc/getClassName.ts +4 -0
- package/runtime/rsc/observer.ts +4 -0
- package/runtime/rsc/styleStore.ts +18 -7
- package/runtime/sheet/rule.ts +16 -12
- package/runtime/sheet/rules.ts +8 -3
- package/runtime/style/scope.ts +0 -24
- package/runtime/style/style.ts +181 -6
- package/runtime/types.ts +6 -4
- package/sheet/dev/dev_layer.ts +18 -7
- package/sheet/dev/dev_sort.ts +45 -11
- package/sheet/prod.ts +18 -7
- package/sheet/types.ts +2 -0
- package/sheet/utils/layer.ts +33 -0
- package/style/classname.ts +47 -0
- package/style/important.ts +19 -0
- package/style/index.ts +3 -0
- package/style/style.ts +47 -16
- package/style/theme.ts +4 -3
- package/style/token.ts +26 -21
- package/style/tokens.ts +18 -12
- package/style/transform.ts +41 -2
- package/style/types.ts +6 -4
- package/style/utils/expose.ts +4 -3
- package/style/value.ts +26 -11
- package/style/valueRef.ts +1 -1
- package/style/weight.ts +21 -0
- package/utils/global.ts +1 -3
- package/utils/hash.ts +4 -0
- package/utils/symbol.ts +3 -0
- package/atomic/layer/README.md +0 -116
- package/atomic/utils/css.ts +0 -49
- package/dist/assert-BGdigdr5.js.map +0 -1
- package/dist/className-C1Ht5Wvv.js +0 -144
- package/dist/className-C1Ht5Wvv.js.map +0 -1
- package/dist/className-DC2Cq8p3.js +0 -251
- package/dist/className-DC2Cq8p3.js.map +0 -1
- package/dist/compiler-DENc3a2R.mjs.map +0 -1
- package/dist/config-BryWDfQX.js +0 -25
- package/dist/config-BryWDfQX.js.map +0 -1
- package/dist/config-DKHXWhe1.js +0 -1
- package/dist/config-Di2VYYKV.js +0 -6
- package/dist/config-DloHOG6I.js +0 -13
- package/dist/config-DloHOG6I.js.map +0 -1
- package/dist/css-BowBszUt.js +0 -243
- package/dist/css-BowBszUt.js.map +0 -1
- package/dist/css-ByOrugEX.js +0 -805
- package/dist/css-ByOrugEX.js.map +0 -1
- package/dist/css-DcazYor9.js +0 -235
- package/dist/css-DcazYor9.js.map +0 -1
- package/dist/css_extra-DlOnsnR1.js +0 -8
- package/dist/css_extra-oIi3UEPK.js.map +0 -1
- package/dist/data-BsqOa5br.js +0 -473
- package/dist/data-BsqOa5br.js.map +0 -1
- package/dist/debug-BAw63qX6.js +0 -15
- package/dist/debug-BAw63qX6.js.map +0 -1
- package/dist/debug-DGki_v7g.js +0 -15
- package/dist/debug-DGki_v7g.js.map +0 -1
- package/dist/debug-n2aZQBSa.js.map +0 -1
- package/dist/dev-CcphAa3R.js.map +0 -1
- package/dist/dev-DfBbuLeE.js +0 -71
- package/dist/dev-DfBbuLeE.js.map +0 -1
- package/dist/elementMarker-Bu7gDAkE.js.map +0 -1
- package/dist/extract-CzWJeQi8.js +0 -121
- package/dist/extract-CzWJeQi8.js.map +0 -1
- package/dist/extract-DEwSDJ9Z.js +0 -2
- package/dist/format-3nKBE_5t.js.map +0 -1
- package/dist/getClassName-BlvXHYuf.js.map +0 -1
- package/dist/global-CvfmFLsK.js +0 -11
- package/dist/global-CvfmFLsK.js.map +0 -1
- package/dist/jsx-CwTeyUxr.js +0 -39
- package/dist/jsx-CwTeyUxr.js.map +0 -1
- package/dist/jsx-D2BksHSv.js +0 -38
- package/dist/jsx-D2BksHSv.js.map +0 -1
- package/dist/layer-D1SaH07m.js +0 -94
- package/dist/layer-D1SaH07m.js.map +0 -1
- package/dist/loader-B5Kw0DD-.mjs.map +0 -1
- package/dist/misc-DCdYYyhK.mjs.map +0 -1
- package/dist/presets-BhXa232U.js +0 -108
- package/dist/presets-BhXa232U.js.map +0 -1
- package/dist/property-CnLFt5kx.js +0 -406
- package/dist/property-CnLFt5kx.js.map +0 -1
- package/dist/rules-9HSO1pxL.js.map +0 -1
- package/dist/runtime-CYqNCiaM.js.map +0 -1
- package/dist/shared-CBArHB9-.cjs.map +0 -1
- package/dist/style-B-6jHipw.js +0 -5
- package/dist/style-B1UUqjj5.js +0 -743
- package/dist/style-B1UUqjj5.js.map +0 -1
- package/dist/style-DgHbdbdF.js +0 -752
- package/dist/style-DgHbdbdF.js.map +0 -1
- package/dist/style-v2bf70TZ.js +0 -1269
- package/dist/style-v2bf70TZ.js.map +0 -1
- package/dist/styleStore-Dea_WVbr.js.map +0 -1
- package/dist/styleStore-DyNXBcUK.js.map +0 -1
- package/dist/token-CKXUECuU.js +0 -76
- package/dist/token-CKXUECuU.js.map +0 -1
- package/dist/token-u_tM-mtg.js +0 -204
- package/dist/token-u_tM-mtg.js.map +0 -1
- package/dist/utils-BbehLOby.js.map +0 -1
- package/dist/utils-CEaq_c-A.mjs +0 -97
- package/dist/utils-CEaq_c-A.mjs.map +0 -1
- package/dist/utils-CWNHx4EC.js +0 -170
- package/dist/utils-CWNHx4EC.js.map +0 -1
- package/dist/utils-D7FAOyg6.js.map +0 -1
- package/dist/value-BR4e2MKt.js +0 -910
- package/dist/value-BR4e2MKt.js.map +0 -1
- package/dist/value-E8rEv2Oe.js +0 -136
- package/dist/value-E8rEv2Oe.js.map +0 -1
- package/dist/valueRef-lshFk1Cs.js +0 -16
- package/dist/valueRef-lshFk1Cs.js.map +0 -1
- package/dist/webpack-Dh6lox2l.mjs.map +0 -1
- package/dist/withTokens-LRidu3Vc.js +0 -95
- package/dist/withTokens-LRidu3Vc.js.map +0 -1
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { c as getStyleFnMeta, s as normalizePath } from "./compiler-C3CEGGtI.mjs";
|
|
2
|
+
import { f as resolvePluginSourcemapOptions, h as getPluginBuildDevConfig, m as getPluginBuildConfig } from "./misc-B76PUnWe.mjs";
|
|
3
|
+
import { n as STYLE_IMPORTS, t as createWebpackRegistry } from "./registry-w8ET5R7v.mjs";
|
|
4
|
+
import { createRequire } from "node:module";
|
|
5
|
+
import { createHash } from "node:crypto";
|
|
6
|
+
import fs from "node:fs";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
//#region plugin/nextjs/constants.ts
|
|
10
|
+
const DEV_CSS_ROUTE = "/__fluentic/dev.css";
|
|
11
|
+
const LOADER_IMPORT_PATH = STYLE_IMPORTS.Plugin + "/nextjs/loader";
|
|
12
|
+
const CSS_ENTRY_IMPORT_PATH = STYLE_IMPORTS.Plugin + "/nextjs/bundle.css";
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region plugin/nextjs/utils.ts
|
|
15
|
+
const nextRegistry = createWebpackRegistry("nextjs.registry");
|
|
16
|
+
const PRECOLLECT_CACHE_DIRS = {
|
|
17
|
+
dev: "nextjs/precollect/dev",
|
|
18
|
+
prod: "nextjs/precollect/prod"
|
|
19
|
+
};
|
|
20
|
+
const NEXT_COMPILER_IDS = {
|
|
21
|
+
turbopack: "nextjs:turbopack",
|
|
22
|
+
webpackServer: "nextjs:webpack-server",
|
|
23
|
+
webpackClient: "nextjs:webpack-client"
|
|
24
|
+
};
|
|
25
|
+
function getTransformLoaderPath() {
|
|
26
|
+
return createRequire(import.meta.url).resolve(LOADER_IMPORT_PATH);
|
|
27
|
+
}
|
|
28
|
+
function getNextCacheDir(rootDir, cacheDir) {
|
|
29
|
+
return cacheDir ?? path.join(rootDir, ".next/cache/fluentic-style");
|
|
30
|
+
}
|
|
31
|
+
function getNextPrecollectCacheSubdir(dev) {
|
|
32
|
+
return dev ? PRECOLLECT_CACHE_DIRS.dev : PRECOLLECT_CACHE_DIRS.prod;
|
|
33
|
+
}
|
|
34
|
+
function createNextBuildConfig(options) {
|
|
35
|
+
return getPluginBuildConfig(options);
|
|
36
|
+
}
|
|
37
|
+
function createNextBuildDevConfig(options) {
|
|
38
|
+
return getPluginBuildDevConfig(options);
|
|
39
|
+
}
|
|
40
|
+
function createNextConfigHash(buildConfig, dev, importSources) {
|
|
41
|
+
const values = [
|
|
42
|
+
createPackageCacheIdentity(),
|
|
43
|
+
dev ? "dev" : "prod",
|
|
44
|
+
buildConfig.hoist ? "hoist" : "no-hoist",
|
|
45
|
+
JSON.stringify(createSerializableImportSources(importSources))
|
|
46
|
+
];
|
|
47
|
+
return createHash("sha256").update(values.join("\0")).digest("hex");
|
|
48
|
+
}
|
|
49
|
+
function createPackageCacheIdentity() {
|
|
50
|
+
const require = createRequire(import.meta.url);
|
|
51
|
+
let entryPath = "";
|
|
52
|
+
try {
|
|
53
|
+
entryPath = require.resolve("@fluentic/style/plugin/nextjs");
|
|
54
|
+
} catch {
|
|
55
|
+
entryPath = fileURLToPath(import.meta.url);
|
|
56
|
+
}
|
|
57
|
+
const packageInfo = findPackageInfo(entryPath);
|
|
58
|
+
return [
|
|
59
|
+
packageInfo.version,
|
|
60
|
+
normalizePath(packageInfo.packageRoot),
|
|
61
|
+
normalizePath(entryPath),
|
|
62
|
+
getStatIdentity(packageInfo.packageJsonPath),
|
|
63
|
+
getStatIdentity(entryPath)
|
|
64
|
+
].join("\0");
|
|
65
|
+
}
|
|
66
|
+
function findPackageInfo(entryPath) {
|
|
67
|
+
let current = path.dirname(entryPath);
|
|
68
|
+
while (true) {
|
|
69
|
+
const packageJsonPath = path.join(current, "package.json");
|
|
70
|
+
try {
|
|
71
|
+
const pkg = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
|
|
72
|
+
if (pkg.name === "@fluentic/style") return {
|
|
73
|
+
packageRoot: current,
|
|
74
|
+
packageJsonPath,
|
|
75
|
+
version: pkg.version ?? ""
|
|
76
|
+
};
|
|
77
|
+
} catch {}
|
|
78
|
+
const parent = path.dirname(current);
|
|
79
|
+
if (parent === current) break;
|
|
80
|
+
current = parent;
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
packageRoot: path.dirname(entryPath),
|
|
84
|
+
packageJsonPath: "",
|
|
85
|
+
version: ""
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function getStatIdentity(filePath) {
|
|
89
|
+
if (!filePath) return "";
|
|
90
|
+
try {
|
|
91
|
+
const stat = fs.statSync(filePath);
|
|
92
|
+
return `${stat.size}:${stat.mtimeMs}`;
|
|
93
|
+
} catch {
|
|
94
|
+
return "";
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function createSerializableImportSources(importSources) {
|
|
98
|
+
if (!importSources?.length) return void 0;
|
|
99
|
+
const result = [];
|
|
100
|
+
for (const entry of importSources) {
|
|
101
|
+
if (entry.check) continue;
|
|
102
|
+
const source = serializeImportSourcePattern(entry.source);
|
|
103
|
+
const name = entry.name;
|
|
104
|
+
const meta = entry.meta ?? (entry.styleFn ? getStyleFnMeta(entry.styleFn) : null);
|
|
105
|
+
if (!meta) continue;
|
|
106
|
+
if (entry.source !== void 0 && source === void 0) continue;
|
|
107
|
+
result.push(removeUndefinedValues({
|
|
108
|
+
source,
|
|
109
|
+
name,
|
|
110
|
+
meta
|
|
111
|
+
}));
|
|
112
|
+
}
|
|
113
|
+
return result.length ? result : void 0;
|
|
114
|
+
}
|
|
115
|
+
function serializeImportSourcePattern(source) {
|
|
116
|
+
if (source === void 0) return void 0;
|
|
117
|
+
if (Array.isArray(source)) {
|
|
118
|
+
const result = [];
|
|
119
|
+
for (const item of source) {
|
|
120
|
+
if (typeof item !== "string") return void 0;
|
|
121
|
+
result.push(item);
|
|
122
|
+
}
|
|
123
|
+
return result;
|
|
124
|
+
}
|
|
125
|
+
return typeof source === "string" ? source : void 0;
|
|
126
|
+
}
|
|
127
|
+
function resolveNextCompilerOptions(options, sidecar, buildConfig, buildDevConfig, dev) {
|
|
128
|
+
const resolved = resolvePluginSourcemapOptions({
|
|
129
|
+
...options,
|
|
130
|
+
devSourcemap: dev ? "sidecarServer" : "sourceUrl"
|
|
131
|
+
}, sidecar);
|
|
132
|
+
return {
|
|
133
|
+
...resolved,
|
|
134
|
+
css: {
|
|
135
|
+
...resolved.css,
|
|
136
|
+
...buildConfig.css
|
|
137
|
+
},
|
|
138
|
+
dev: {
|
|
139
|
+
...resolved.dev,
|
|
140
|
+
...buildDevConfig
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function removeUndefinedValues(value) {
|
|
145
|
+
if (Array.isArray(value)) return value.map((item) => removeUndefinedValues(item));
|
|
146
|
+
if (!value || typeof value !== "object") return value;
|
|
147
|
+
const result = {};
|
|
148
|
+
for (const [key, item] of Object.entries(value)) if (item !== void 0) result[key] = removeUndefinedValues(item);
|
|
149
|
+
return result;
|
|
150
|
+
}
|
|
151
|
+
function isAppLayoutFile(filePath) {
|
|
152
|
+
return /\/app\/(?:[^/]+\/)*layout\.[cm]?[jt]sx?$/.test(normalizePath(filePath));
|
|
153
|
+
}
|
|
154
|
+
function hasCssMarker(source, marker) {
|
|
155
|
+
return source.includes(marker);
|
|
156
|
+
}
|
|
157
|
+
function replaceCssMarker(source, marker, css) {
|
|
158
|
+
return source.split(marker).join(css);
|
|
159
|
+
}
|
|
160
|
+
function addAliases(config, aliases) {
|
|
161
|
+
if (!config.resolve) config.resolve = {};
|
|
162
|
+
if (!config.resolve.alias) config.resolve.alias = {};
|
|
163
|
+
Object.assign(config.resolve.alias, aliases);
|
|
164
|
+
}
|
|
165
|
+
function addWebpackPlugin(config, plugin) {
|
|
166
|
+
if (!config.plugins) config.plugins = [];
|
|
167
|
+
config.plugins.push(plugin);
|
|
168
|
+
}
|
|
169
|
+
function replaceCssMarkerAsset(args) {
|
|
170
|
+
for (const asset of args.compilation.getAssets()) {
|
|
171
|
+
if (!asset.name.endsWith(".css")) continue;
|
|
172
|
+
const source = asset.source.source().toString();
|
|
173
|
+
if (!hasCssMarker(source, args.marker)) continue;
|
|
174
|
+
args.compilation.updateAsset(asset.name, new args.compiler.webpack.sources.RawSource(replaceCssMarker(source, args.marker, args.css)));
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
179
|
+
//#endregion
|
|
180
|
+
export { DEV_CSS_ROUTE as _, createNextBuildDevConfig as a, getNextCacheDir as c, isAppLayoutFile as d, nextRegistry as f, CSS_ENTRY_IMPORT_PATH as g, resolveNextCompilerOptions as h, createNextBuildConfig as i, getNextPrecollectCacheSubdir as l, replaceCssMarkerAsset as m, addAliases as n, createNextConfigHash as o, removeUndefinedValues as p, addWebpackPlugin as r, createSerializableImportSources as s, NEXT_COMPILER_IDS as t, getTransformLoaderPath as u, LOADER_IMPORT_PATH as v };
|
|
181
|
+
|
|
182
|
+
//# sourceMappingURL=utils-NdisireF.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-NdisireF.mjs","names":[],"sources":["../plugin/nextjs/constants.ts","../plugin/nextjs/utils.ts"],"sourcesContent":["import { STYLE_IMPORTS } from '../utils/imports';\n\nexport const DEV_CSS_ROUTE = '/__fluentic/dev.css';\n\nexport const LOADER_IMPORT_PATH = STYLE_IMPORTS.Plugin + '/nextjs/loader';\n\nexport const CSS_ENTRY_IMPORT_PATH = STYLE_IMPORTS.Plugin + '/nextjs/bundle.css';\n","import { createHash } from 'node:crypto';\nimport fs from 'node:fs';\nimport { createRequire } from 'node:module';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport type { Compilation, Compiler, WebpackPluginInstance } from 'webpack';\nimport type { Compiler as PluginCompiler } from '../../compiler';\nimport type { ImportSource } from '../../compiler/utils/import_source';\nimport { normalizePath } from '../../compiler/utils/path';\nimport type { BuildConfig, BuildDevConfig } from '../../config/build';\nimport { getStyleFnMeta } from '../../style/style';\nimport { createWebpackRegistry } from '../bundler/webpack/shared/registry';\nimport type { FileCssCache } from '../utils/cache';\nimport type { PluginOptions as BasePluginOptions } from '../utils/compiler';\nimport type { TransformFilter } from '../utils/filter';\nimport { getPluginBuildConfig, getPluginBuildDevConfig } from '../utils/runtimeEntry';\nimport type { SourcemapSidecar } from '../utils/sidecar';\nimport { resolvePluginSourcemapOptions } from '../utils/sourcemap';\nimport { LOADER_IMPORT_PATH } from './constants';\nimport type { PluginOptions, WebpackConfiguration } from './types';\n\nexport const nextRegistry = createWebpackRegistry('nextjs.registry');\n\nexport const PRECOLLECT_CACHE_DIRS = {\n dev: 'nextjs/precollect/dev',\n prod: 'nextjs/precollect/prod',\n};\n\nexport const NEXT_COMPILER_IDS = {\n turbopack: 'nextjs:turbopack',\n webpackServer: 'nextjs:webpack-server',\n webpackClient: 'nextjs:webpack-client',\n};\n\nexport type { PluginCompiler };\n\nexport type NextLoaderState = {\n compiler: PluginCompiler;\n filter: TransformFilter;\n dev: boolean;\n isServer: boolean;\n configHash: string;\n devCssHref: string | null;\n cssEntryImportPath: string;\n cssCache: Pick<FileCssCache, 'setFileCss'> | null;\n};\n\nexport type NextWebpackEntryValue = string | string[] | {\n import?: string | string[];\n [key: string]: unknown;\n};\n\nexport function getTransformLoaderPath() {\n return createRequire(import.meta.url).resolve(LOADER_IMPORT_PATH);\n}\n\nexport function getNextCacheDir(rootDir: string, cacheDir?: string) {\n return cacheDir ?? path.join(rootDir, '.next/cache/fluentic-style');\n}\n\nexport function getNextPrecollectCacheSubdir(dev: boolean) {\n return dev ? PRECOLLECT_CACHE_DIRS.dev : PRECOLLECT_CACHE_DIRS.prod;\n}\n\nexport function createNextBuildConfig(options: PluginOptions): BuildConfig {\n return getPluginBuildConfig(options);\n}\n\nexport function createNextBuildDevConfig(options: PluginOptions): BuildDevConfig | null {\n return getPluginBuildDevConfig(options);\n}\n\nexport function createNextConfigHash(\n buildConfig: BuildConfig,\n dev: boolean,\n importSources?: readonly ImportSource[] | null,\n) {\n const values = [\n createPackageCacheIdentity(),\n dev ? 'dev' : 'prod',\n buildConfig.hoist ? 'hoist' : 'no-hoist',\n JSON.stringify(createSerializableImportSources(importSources)),\n ];\n\n return createHash('sha256').update(values.join('\\0')).digest('hex');\n}\n\nfunction createPackageCacheIdentity() {\n const require = createRequire(import.meta.url);\n let entryPath = '';\n\n try {\n entryPath = require.resolve('@fluentic/style/plugin/nextjs');\n } catch {\n entryPath = fileURLToPath(import.meta.url);\n }\n\n const packageInfo = findPackageInfo(entryPath);\n const parts = [\n packageInfo.version,\n normalizePath(packageInfo.packageRoot),\n normalizePath(entryPath),\n getStatIdentity(packageInfo.packageJsonPath),\n getStatIdentity(entryPath),\n ];\n\n return parts.join('\\0');\n}\n\nfunction findPackageInfo(entryPath: string) {\n let current = path.dirname(entryPath);\n\n while (true) {\n const packageJsonPath = path.join(current, 'package.json');\n\n try {\n const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')) as {\n name?: string;\n version?: string;\n };\n\n if (pkg.name === '@fluentic/style') {\n return {\n packageRoot: current,\n packageJsonPath,\n version: pkg.version ?? '',\n };\n }\n } catch {\n // Keep walking toward the filesystem root.\n }\n\n const parent = path.dirname(current);\n if (parent === current) break;\n current = parent;\n }\n\n return {\n packageRoot: path.dirname(entryPath),\n packageJsonPath: '',\n version: '',\n };\n}\n\nfunction getStatIdentity(filePath: string) {\n if (!filePath) return '';\n\n try {\n const stat = fs.statSync(filePath);\n return `${stat.size}:${stat.mtimeMs}`;\n } catch {\n return '';\n }\n}\n\nexport function createSerializableImportSources(\n importSources: readonly ImportSource[] | null | undefined,\n): ImportSource[] | undefined {\n if (!importSources?.length) return undefined;\n\n const result: ImportSource[] = [];\n\n for (const entry of importSources) {\n if (entry.check) continue;\n\n const source = serializeImportSourcePattern(entry.source);\n const name = entry.name;\n const meta = entry.meta ?? (entry.styleFn ? getStyleFnMeta(entry.styleFn) : null);\n\n if (!meta) continue;\n if (entry.source !== undefined && source === undefined) continue;\n\n result.push(removeUndefinedValues({\n source,\n name,\n meta,\n }));\n }\n\n return result.length ? result : undefined;\n}\n\nfunction serializeImportSourcePattern(\n source: ImportSource['source'],\n): string | string[] | undefined {\n if (source === undefined) return undefined;\n\n if (Array.isArray(source)) {\n const result: string[] = [];\n\n for (const item of source) {\n if (typeof item !== 'string') return undefined;\n result.push(item);\n }\n\n return result;\n }\n\n return typeof source === 'string' ? source : undefined;\n}\n\nexport function resolveNextCompilerOptions(\n options: PluginOptions,\n sidecar: SourcemapSidecar | null,\n buildConfig: BuildConfig,\n buildDevConfig: BuildDevConfig | null,\n dev: boolean,\n): BasePluginOptions {\n const resolved = resolvePluginSourcemapOptions({\n ...options,\n devSourcemap: dev ? 'sidecarServer' : 'sourceUrl',\n }, sidecar);\n\n return {\n ...resolved,\n css: {\n ...resolved.css,\n ...buildConfig.css,\n },\n dev: {\n ...resolved.dev,\n ...buildDevConfig,\n },\n };\n}\n\nexport function removeUndefinedValues<T>(value: T): T {\n if (Array.isArray(value)) {\n return value.map((item) => removeUndefinedValues(item)) as T;\n }\n\n if (!value || typeof value !== 'object') {\n return value;\n }\n\n const result: Record<string, unknown> = {};\n\n for (const [key, item] of Object.entries(value)) {\n if (item !== undefined) {\n result[key] = removeUndefinedValues(item);\n }\n }\n\n return result as T;\n}\n\nexport function prependClientEntry(entry: unknown, moduleId: string) {\n if (typeof entry === 'function') {\n return async () => prependClientEntry(await entry(), moduleId);\n }\n\n if (!entry || typeof entry !== 'object') return entry;\n\n const result: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(entry)) {\n result[key] = prependEntryValue(value as NextWebpackEntryValue, moduleId);\n }\n\n return result;\n}\n\nexport function prependEntryValue(entry: NextWebpackEntryValue, moduleId: string): NextWebpackEntryValue {\n if (typeof entry === 'string') {\n return entry === moduleId ? entry : [moduleId, entry];\n }\n\n if (Array.isArray(entry)) {\n return entry.includes(moduleId) ? entry : [moduleId, ...entry];\n }\n\n const imports = entry.import;\n if (!imports) return { ...entry, import: moduleId };\n\n return {\n ...entry,\n import: Array.isArray(imports)\n ? imports.includes(moduleId) ? imports : [moduleId, ...imports]\n : imports === moduleId\n ? imports\n : [moduleId, imports],\n };\n}\n\nexport function isAppLayoutFile(filePath: string) {\n return /\\/app\\/(?:[^/]+\\/)*layout\\.[cm]?[jt]sx?$/.test(normalizePath(filePath));\n}\n\nexport function hasCssMarker(source: string, marker: string) {\n return source.includes(marker);\n}\n\nexport function replaceCssMarker(source: string, marker: string, css: string) {\n return source.split(marker).join(css);\n}\n\nexport function addAliases(config: WebpackConfiguration, aliases: Record<string, string>) {\n if (!config.resolve) config.resolve = {};\n if (!config.resolve.alias) config.resolve.alias = {};\n Object.assign(config.resolve.alias, aliases);\n}\n\nexport function addWebpackPlugin(config: WebpackConfiguration, plugin: WebpackPluginInstance) {\n if (!config.plugins) config.plugins = [];\n config.plugins.push(plugin);\n}\n\nexport function replaceCssMarkerAsset(args: {\n compiler: Compiler;\n compilation: Compilation;\n css: string;\n marker: string;\n}) {\n for (const asset of args.compilation.getAssets()) {\n if (!asset.name.endsWith('.css')) continue;\n\n const source = asset.source.source().toString();\n if (!hasCssMarker(source, args.marker)) continue;\n\n args.compilation.updateAsset(\n asset.name,\n new args.compiler.webpack.sources.RawSource(\n replaceCssMarker(source, args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,OAAO,OAAO;AAC7C;AAEA,SAAgB,iBAAiB,QAA8B,QAA+B;CAC5F,IAAI,CAAC,OAAO,SAAS,OAAO,UAAU,CAAC;CACvC,OAAO,QAAQ,KAAK,MAAM;AAC5B;AAEA,SAAgB,sBAAsB,MAKnC;CACD,KAAK,MAAM,SAAS,KAAK,YAAY,UAAU,GAAG;EAChD,IAAI,CAAC,MAAM,KAAK,SAAS,MAAM,GAAG;EAElC,MAAM,SAAS,MAAM,OAAO,OAAO,EAAE,SAAS;EAC9C,IAAI,CAAC,aAAa,QAAQ,KAAK,MAAM,GAAG;EAExC,KAAK,YAAY,YACf,MAAM,MACN,IAAI,KAAK,SAAS,QAAQ,QAAQ,UAChC,iBAAiB,QAAQ,KAAK,QAAQ,KAAK,GAAG,CAChD,CACF;EAEA,OAAO;CACT;CAEA,OAAO;AACT"}
|
package/dist/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
1
|
+
import "./data-CDrS1Bq4.js";
|
|
2
|
+
import { h as isSelectorData, v as isSlotData } from "./value-CK0-Xbov.js";
|
|
3
|
+
import { h as isStyleTokenData } from "./token-D33mKTka.js";
|
|
4
4
|
//#region style/utils/expose.ts
|
|
5
5
|
function exposeStyle(styles) {
|
|
6
6
|
return exposeStyleObject(styles);
|
|
@@ -15,7 +15,7 @@ function exposeStyleObject(source) {
|
|
|
15
15
|
return result;
|
|
16
16
|
}
|
|
17
17
|
function exposeStyleValue(value) {
|
|
18
|
-
if (isStyleTokenData(value) || isSlotData(value)) return value;
|
|
18
|
+
if (isStyleTokenData(value) || isSlotData(value) || isSelectorData(value)) return value;
|
|
19
19
|
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
20
20
|
const exposed = exposeStyleObject(value);
|
|
21
21
|
return Reflect.ownKeys(exposed).length > 0 ? exposed : void 0;
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[],"sources":["../style/utils/expose.ts"],"sourcesContent":["import type { AnyBuilderData, SlotData } from '../../builder/data';\nimport { isSlotData } from '../../builder/data';\nimport { isStyleTokenData, type StyleTokenData } from '../token';\n\ntype ExposedStyleItem<T> = T extends StyleTokenData ? T\n : T extends SlotData ? T\n : T extends AnyBuilderData ? never\n : T extends readonly unknown[] ? never\n : T extends object ? ExposedStyle<T>\n : never;\n\nexport type ExposedStyle<T> = {\n [K in keyof T as ExposedStyleItem<T[K]> extends never ? never : K]: ExposedStyleItem<T[K]>;\n};\n\nexport function exposeStyle<T extends object>(styles: T): ExposedStyle<T> {\n return exposeStyleObject(styles) as ExposedStyle<T>;\n}\n\nfunction exposeStyleObject(source: object) {\n const result: Record<PropertyKey, unknown> = {};\n\n for (const key of Reflect.ownKeys(source)) {\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n\n const exposed = exposeStyleValue((source as Record<PropertyKey, unknown>)[key]);\n\n if (exposed !== undefined) {\n result[key] = exposed;\n }\n }\n\n return result;\n}\n\nfunction exposeStyleValue(value: unknown): unknown {\n if (isStyleTokenData(value) || isSlotData(value)) return value;\n\n if (!value || typeof value !== 'object' || Array.isArray(value)) return undefined;\n\n const exposed = exposeStyleObject(value);\n return Reflect.ownKeys(exposed).length > 0 ? exposed : undefined;\n}\n"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../style/utils/expose.ts"],"sourcesContent":["import type { AnyBuilderData, SelectorData, SlotData } from '../../builder/data';\nimport { isSelectorData, isSlotData } from '../../builder/data';\nimport { isStyleTokenData, type StyleTokenData } from '../token';\n\ntype ExposedStyleItem<T> = T extends StyleTokenData ? T\n : T extends SlotData ? T\n : T extends SelectorData ? T\n : T extends AnyBuilderData ? never\n : T extends readonly unknown[] ? never\n : T extends object ? ExposedStyle<T>\n : never;\n\nexport type ExposedStyle<T> = {\n [K in keyof T as ExposedStyleItem<T[K]> extends never ? never : K]: ExposedStyleItem<T[K]>;\n};\n\nexport function exposeStyle<T extends object>(styles: T): ExposedStyle<T> {\n return exposeStyleObject(styles) as ExposedStyle<T>;\n}\n\nfunction exposeStyleObject(source: object) {\n const result: Record<PropertyKey, unknown> = {};\n\n for (const key of Reflect.ownKeys(source)) {\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n\n const exposed = exposeStyleValue((source as Record<PropertyKey, unknown>)[key]);\n\n if (exposed !== undefined) {\n result[key] = exposed;\n }\n }\n\n return result;\n}\n\nfunction exposeStyleValue(value: unknown): unknown {\n if (isStyleTokenData(value) || isSlotData(value) || isSelectorData(value)) return value;\n\n if (!value || typeof value !== 'object' || Array.isArray(value)) return undefined;\n\n const exposed = exposeStyleObject(value);\n return Reflect.ownKeys(exposed).length > 0 ? exposed : undefined;\n}\n"],"mappings":";;;;AAgBA,SAAgB,YAA8B,QAA4B;CACxE,OAAO,kBAAkB,MAAM;AACjC;AAEA,SAAS,kBAAkB,QAAgB;CACzC,MAAM,SAAuC,CAAC;CAE9C,KAAK,MAAM,OAAO,QAAQ,QAAQ,MAAM,GAAG;EACzC,IAAI,CAAC,OAAO,UAAU,qBAAqB,KAAK,QAAQ,GAAG,GAAG;EAE9D,MAAM,UAAU,iBAAkB,OAAwC,IAAI;EAE9E,IAAI,YAAY,KAAA,GACd,OAAO,OAAO;CAElB;CAEA,OAAO;AACT;AAEA,SAAS,iBAAiB,OAAyB;CACjD,IAAI,iBAAiB,KAAK,KAAK,WAAW,KAAK,KAAK,eAAe,KAAK,GAAG,OAAO;CAElF,IAAI,CAAC,SAAS,OAAO,UAAU,YAAY,MAAM,QAAQ,KAAK,GAAG,OAAO,KAAA;CAExE,MAAM,UAAU,kBAAkB,KAAK;CACvC,OAAO,QAAQ,QAAQ,OAAO,EAAE,SAAS,IAAI,UAAU,KAAA;AACzD"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { l as symbol } from "./css-DWBWsyxZ.js";
|
|
2
|
+
//#region builder/data/const.ts
|
|
3
|
+
const BUILDER_TYPE = symbol("builder.type");
|
|
4
|
+
const BUILDER_STATE = symbol("builder.state");
|
|
5
|
+
const BUILDER_CALLSITE = symbol("builder.callsite");
|
|
6
|
+
const BUILDER_SLOT_ID = symbol("builder.slotId");
|
|
7
|
+
const BUILDER_SCOPE_ID = symbol("builder.scopeId");
|
|
8
|
+
const BUILDER_SCOPE = symbol("builder.scope");
|
|
9
|
+
const BUILDER_SELECTOR = symbol("builder.selector");
|
|
10
|
+
const BUILDER_SHEET_OPTIONS = symbol("builder.sheetOptions");
|
|
11
|
+
const SHEET_SELECTOR_ANCHOR = "\0sheet";
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region builder/data/is.ts
|
|
14
|
+
function getSlotId(data) {
|
|
15
|
+
return data[BUILDER_SLOT_ID];
|
|
16
|
+
}
|
|
17
|
+
function getScopeTargetSlotId(data) {
|
|
18
|
+
return data[BUILDER_SCOPE_ID];
|
|
19
|
+
}
|
|
20
|
+
function getScopeTargetScope(data) {
|
|
21
|
+
return data[BUILDER_SCOPE];
|
|
22
|
+
}
|
|
23
|
+
function getSelectorSelectors(data) {
|
|
24
|
+
return data[BUILDER_SELECTOR];
|
|
25
|
+
}
|
|
26
|
+
function isStyleData(value) {
|
|
27
|
+
return getBuilderType(value) === 1;
|
|
28
|
+
}
|
|
29
|
+
function isSlotData(value) {
|
|
30
|
+
return getBuilderType(value) === 2;
|
|
31
|
+
}
|
|
32
|
+
function isSlotOverrideData(value) {
|
|
33
|
+
return getBuilderType(value) === 3;
|
|
34
|
+
}
|
|
35
|
+
function isSelectorData(value) {
|
|
36
|
+
return getBuilderType(value) === 7;
|
|
37
|
+
}
|
|
38
|
+
function isSelectorOverrideData(value) {
|
|
39
|
+
return getBuilderType(value) === 8;
|
|
40
|
+
}
|
|
41
|
+
function isSheetData(value) {
|
|
42
|
+
return getBuilderType(value) === 9;
|
|
43
|
+
}
|
|
44
|
+
function isScopeData(value) {
|
|
45
|
+
return getBuilderType(value) === 4;
|
|
46
|
+
}
|
|
47
|
+
function isScopeTargetData(value) {
|
|
48
|
+
return getBuilderType(value) === 5;
|
|
49
|
+
}
|
|
50
|
+
function isThemeData(value) {
|
|
51
|
+
return getBuilderType(value) === 6;
|
|
52
|
+
}
|
|
53
|
+
function getBuilderType(value) {
|
|
54
|
+
if (!value || typeof value !== "object" && typeof value !== "function") return null;
|
|
55
|
+
return value[BUILDER_TYPE];
|
|
56
|
+
}
|
|
57
|
+
function getScopeClassName(className, scopeClassNameFormat) {
|
|
58
|
+
return formatScopeClassName(scopeClassNameFormat || "-(className)", { className });
|
|
59
|
+
}
|
|
60
|
+
function formatScopeClassName(format, info) {
|
|
61
|
+
if (typeof format === "function") return format(info);
|
|
62
|
+
return format.replace(/\[|\]/g, "").replace(/\(className\)/g, info.className);
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region atomic/utils/selector.ts
|
|
66
|
+
function getSelectorText(selector) {
|
|
67
|
+
return stripSheetSelectorAnchor(Array.isArray(selector) ? selector[0] : selector);
|
|
68
|
+
}
|
|
69
|
+
function getSelectorHash(selector) {
|
|
70
|
+
return Array.isArray(selector) ? selector.join("|") : selector;
|
|
71
|
+
}
|
|
72
|
+
function getSelectorPriority(selector) {
|
|
73
|
+
if (!selector) return 0;
|
|
74
|
+
return Array.isArray(selector) ? selector[1] : 0;
|
|
75
|
+
}
|
|
76
|
+
function hasSheetSelectorAnchor(selector) {
|
|
77
|
+
return (selector ? Array.isArray(selector) ? selector[0] : selector : "").startsWith(SHEET_SELECTOR_ANCHOR);
|
|
78
|
+
}
|
|
79
|
+
function getSheetSelectorWeight(selector) {
|
|
80
|
+
const text = selector ? Array.isArray(selector) ? selector[0] : selector : "";
|
|
81
|
+
if (!text.startsWith("\0sheet:")) return null;
|
|
82
|
+
const end = text.indexOf("\0", 6);
|
|
83
|
+
if (end < 0) return null;
|
|
84
|
+
const [weightValue] = text.slice(7, end).split(":");
|
|
85
|
+
const weight = Number(weightValue);
|
|
86
|
+
return Number.isInteger(weight) && weight > 0 ? weight : null;
|
|
87
|
+
}
|
|
88
|
+
function stripSheetSelectorAnchor(selector) {
|
|
89
|
+
if (!selector.startsWith("\0sheet")) return selector;
|
|
90
|
+
if (selector.startsWith("\0sheet:")) {
|
|
91
|
+
const end = selector.indexOf("\0", 6);
|
|
92
|
+
if (end >= 0) return selector.slice(end + 1);
|
|
93
|
+
}
|
|
94
|
+
return selector.slice(6);
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region atomic/value/unitless.ts
|
|
98
|
+
const UnitlessProperties = [
|
|
99
|
+
"animationIterationCount",
|
|
100
|
+
"aspectRatio",
|
|
101
|
+
"borderImageOutset",
|
|
102
|
+
"borderImageSlice",
|
|
103
|
+
"borderImageWidth",
|
|
104
|
+
"boxFlex",
|
|
105
|
+
"boxFlexGroup",
|
|
106
|
+
"boxOrdinalGroup",
|
|
107
|
+
"columnCount",
|
|
108
|
+
"columns",
|
|
109
|
+
"fillOpacity",
|
|
110
|
+
"flex",
|
|
111
|
+
"flexGrow",
|
|
112
|
+
"flexNegative",
|
|
113
|
+
"flexOrder",
|
|
114
|
+
"flexPositive",
|
|
115
|
+
"flexShrink",
|
|
116
|
+
"floodOpacity",
|
|
117
|
+
"fontWeight",
|
|
118
|
+
"gridArea",
|
|
119
|
+
"gridColumn",
|
|
120
|
+
"gridColumnEnd",
|
|
121
|
+
"gridColumnSpan",
|
|
122
|
+
"gridColumnStart",
|
|
123
|
+
"gridRow",
|
|
124
|
+
"gridRowEnd",
|
|
125
|
+
"gridRowSpan",
|
|
126
|
+
"gridRowStart",
|
|
127
|
+
"imageOrientation",
|
|
128
|
+
"lineClamp",
|
|
129
|
+
"lineHeight",
|
|
130
|
+
"opacity",
|
|
131
|
+
"order",
|
|
132
|
+
"orphans",
|
|
133
|
+
"scale",
|
|
134
|
+
"stopOpacity",
|
|
135
|
+
"strokeDasharray",
|
|
136
|
+
"strokeDashoffset",
|
|
137
|
+
"strokeMiterlimit",
|
|
138
|
+
"strokeOpacity",
|
|
139
|
+
"strokeWidth",
|
|
140
|
+
"tabSize",
|
|
141
|
+
"widows",
|
|
142
|
+
"zIndex",
|
|
143
|
+
"zoom"
|
|
144
|
+
];
|
|
145
|
+
//#endregion
|
|
146
|
+
//#region atomic/value/value.ts
|
|
147
|
+
const CSS_NUMBER_VALUE = /^-?(\d+\.?\d*|\.\d+)$/;
|
|
148
|
+
const UNITLESS = new Set(UnitlessProperties);
|
|
149
|
+
function getCssPropertyValue(property, value) {
|
|
150
|
+
if (!value || !shouldAppendCssPx(property)) return value;
|
|
151
|
+
if (CSS_NUMBER_VALUE.test(value)) return value + "px";
|
|
152
|
+
return value;
|
|
153
|
+
}
|
|
154
|
+
function shouldAppendCssPx(property) {
|
|
155
|
+
return !UNITLESS.has(property);
|
|
156
|
+
}
|
|
157
|
+
//#endregion
|
|
158
|
+
export { SHEET_SELECTOR_ANCHOR as A, BUILDER_SCOPE as C, BUILDER_SLOT_ID as D, BUILDER_SHEET_OPTIONS as E, BUILDER_STATE as O, BUILDER_CALLSITE as S, BUILDER_SELECTOR as T, isSheetData as _, getSelectorText as a, isStyleData as b, getScopeClassName as c, getSelectorSelectors as d, getSlotId as f, isSelectorOverrideData as g, isSelectorData as h, getSelectorPriority as i, BUILDER_TYPE as k, getScopeTargetScope as l, isScopeTargetData as m, shouldAppendCssPx as n, getSheetSelectorWeight as o, isScopeData as p, getSelectorHash as r, hasSheetSelectorAnchor as s, getCssPropertyValue as t, getScopeTargetSlotId as u, isSlotData as v, BUILDER_SCOPE_ID as w, isThemeData as x, isSlotOverrideData as y };
|
|
159
|
+
|
|
160
|
+
//# sourceMappingURL=value-CK0-Xbov.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-CK0-Xbov.js","names":[],"sources":["../builder/data/const.ts","../builder/data/is.ts","../atomic/scope.ts","../atomic/utils/selector.ts","../atomic/value/unitless.ts","../atomic/value/value.ts"],"sourcesContent":["import { symbol } from '../../utils/symbol';\n\nexport const BUILDER_TYPE: unique symbol = symbol('builder.type');\nexport const BUILDER_STATE: unique symbol = symbol('builder.state');\nexport const BUILDER_CALLSITE: unique symbol = symbol('builder.callsite');\nexport const BUILDER_SLOT_ID: unique symbol = symbol('builder.slotId');\nexport const BUILDER_SCOPE_ID: unique symbol = symbol('builder.scopeId');\nexport const BUILDER_SCOPE: unique symbol = symbol('builder.scope');\nexport const BUILDER_SELECTOR: unique symbol = symbol('builder.selector');\nexport const BUILDER_SHEET_OPTIONS: unique symbol = symbol('builder.sheetOptions');\n\nexport const BUILDER_TYPE_STYLE = 1;\nexport const BUILDER_TYPE_SLOT = 2;\nexport const BUILDER_TYPE_SLOT_OVERRIDE = 3;\nexport const BUILDER_TYPE_SCOPE = 4;\nexport const BUILDER_TYPE_SCOPE_TARGET = 5;\nexport const BUILDER_TYPE_THEME = 6;\nexport const BUILDER_TYPE_SELECTOR = 7;\nexport const BUILDER_TYPE_SELECTOR_OVERRIDE = 8;\nexport const BUILDER_TYPE_SHEET = 9;\n\nexport const ITEM_RUNTIME_DEV = -1;\nexport const ITEM_RUNTIME_DEV_PLUGIN = -2;\nexport const ITEM_RUNTIME_PROD = -3;\nexport const ITEM_RUNTIME_PROD_PLUGIN = -4;\n\nexport const ITEM_VALUE_TYPE_VARIABLE = 1;\nexport const ITEM_VALUE_TYPE_STYLE_DATA = 2;\nexport const ITEM_VALUE_NUMBER_PX = 1;\nexport const ITEM_VALUE_TYPE_AT_RULE_REF = 3;\n\nexport const SHEET_SELECTOR_ANCHOR = '\\0sheet';\n","import type { StyleValue } from '../../style/types';\nimport {\n BUILDER_SCOPE,\n BUILDER_SCOPE_ID,\n BUILDER_SELECTOR,\n BUILDER_SLOT_ID,\n BUILDER_TYPE,\n BUILDER_TYPE_SCOPE,\n BUILDER_TYPE_SCOPE_TARGET,\n BUILDER_TYPE_SELECTOR,\n BUILDER_TYPE_SELECTOR_OVERRIDE,\n BUILDER_TYPE_SHEET,\n BUILDER_TYPE_SLOT,\n BUILDER_TYPE_SLOT_OVERRIDE,\n BUILDER_TYPE_STYLE,\n BUILDER_TYPE_THEME,\n} from './const';\nimport {\n type BuilderData,\n type ScopeData,\n type ScopeTargetData,\n type SelectorData,\n type SelectorOverrideData,\n type SheetData,\n type SlotData,\n type SlotOverrideData,\n type StyleData,\n type ThemeData,\n} from './data';\n\nexport function getSlotId(data: SlotData | SlotOverrideData) {\n return data[BUILDER_SLOT_ID];\n}\n\nexport function getScopeTargetSlotId(data: ScopeTargetData) {\n return data[BUILDER_SCOPE_ID];\n}\n\nexport function getScopeTargetScope(data: ScopeTargetData) {\n return data[BUILDER_SCOPE];\n}\n\nexport function getSelectorSelectors(data: SelectorData | SelectorOverrideData) {\n return data[BUILDER_SELECTOR];\n}\n\nexport function isStyleValue<T>(value: unknown): value is StyleValue<T> {\n return Array.isArray(value);\n}\n\nexport function isStyleData<Style>(value: unknown): value is StyleData<Style> {\n return getBuilderType(value) === BUILDER_TYPE_STYLE;\n}\n\nexport function isSlotData<Style>(value: unknown): value is SlotData<Style> {\n return getBuilderType(value) === BUILDER_TYPE_SLOT;\n}\n\nexport function isSlotOverrideData<Style>(value: unknown): value is SlotOverrideData<Style> {\n return getBuilderType(value) === BUILDER_TYPE_SLOT_OVERRIDE;\n}\n\nexport function isSelectorData<Style>(value: unknown): value is SelectorData<Style> {\n return getBuilderType(value) === BUILDER_TYPE_SELECTOR;\n}\n\nexport function isSelectorOverrideData<Style>(value: unknown): value is SelectorOverrideData<Style> {\n return getBuilderType(value) === BUILDER_TYPE_SELECTOR_OVERRIDE;\n}\n\nexport function isSheetData<Style>(value: unknown): value is SheetData<Style> {\n return getBuilderType(value) === BUILDER_TYPE_SHEET;\n}\n\nexport function isScopeData(value: unknown): value is ScopeData {\n return getBuilderType(value) === BUILDER_TYPE_SCOPE;\n}\n\nexport function isScopeTargetData(value: unknown): value is ScopeTargetData {\n return getBuilderType(value) === BUILDER_TYPE_SCOPE_TARGET;\n}\n\nexport function isThemeData(value: unknown): value is ThemeData {\n return getBuilderType(value) === BUILDER_TYPE_THEME;\n}\n\nfunction getBuilderType(value: unknown) {\n if (!value || (typeof value !== 'object' && typeof value !== 'function')) return null;\n\n return (value as BuilderData)[BUILDER_TYPE];\n}\n","import type { ScopeClassNameFormat, ScopeClassNameInfo } from '../config/types';\n\nexport const SCOPE_CLASS_NAME_FORMAT = '-(className)';\n\nexport function getScopeClassName(\n className: string,\n scopeClassNameFormat: ScopeClassNameFormat | null,\n) {\n return formatScopeClassName(scopeClassNameFormat || SCOPE_CLASS_NAME_FORMAT, { className });\n}\n\nfunction formatScopeClassName(\n format: ScopeClassNameFormat,\n info: ScopeClassNameInfo,\n) {\n if (typeof format === 'function') return format(info);\n\n return format.replace(/\\[|\\]/g, '').replace(/\\(className\\)/g, info.className);\n}\n","import { SHEET_SELECTOR_ANCHOR } from '../../builder/data/const';\nimport type { ItemSelector } from '../../builder/data/state';\n\nexport function getSelectorText(selector: ItemSelector): string {\n const text = Array.isArray(selector) ? selector[0] : selector;\n return stripSheetSelectorAnchor(text);\n}\n\nexport function getSelectorHash(selector: ItemSelector): string {\n return Array.isArray(selector) ? selector.join('|') : selector;\n}\n\nexport function getSelectorPriority(selector: ItemSelector | null): number {\n if (!selector) return 0;\n return Array.isArray(selector) ? selector[1] : 0;\n}\n\nexport function hasSheetSelectorAnchor(selector: ItemSelector | null): boolean {\n const text = selector ? Array.isArray(selector) ? selector[0] : selector : '';\n return text.startsWith(SHEET_SELECTOR_ANCHOR);\n}\n\nexport function getSheetSelectorWeight(selector: ItemSelector | null): number | null {\n const text = selector ? Array.isArray(selector) ? selector[0] : selector : '';\n if (!text.startsWith(SHEET_SELECTOR_ANCHOR + ':')) return null;\n\n const end = text.indexOf('\\0', SHEET_SELECTOR_ANCHOR.length);\n if (end < 0) return null;\n\n const [weightValue] = text.slice(SHEET_SELECTOR_ANCHOR.length + 1, end).split(':');\n const weight = Number(weightValue);\n return Number.isInteger(weight) && weight > 0 ? weight : null;\n}\n\nfunction stripSheetSelectorAnchor(selector: string) {\n if (!selector.startsWith(SHEET_SELECTOR_ANCHOR)) return selector;\n\n if (selector.startsWith(SHEET_SELECTOR_ANCHOR + ':')) {\n const end = selector.indexOf('\\0', SHEET_SELECTOR_ANCHOR.length);\n if (end >= 0) return selector.slice(end + 1);\n }\n\n return selector.slice(SHEET_SELECTOR_ANCHOR.length);\n}\n","export const UnitlessProperties = [\n 'animationIterationCount',\n 'aspectRatio',\n 'borderImageOutset',\n 'borderImageSlice',\n 'borderImageWidth',\n 'boxFlex',\n 'boxFlexGroup',\n 'boxOrdinalGroup',\n 'columnCount',\n 'columns',\n 'fillOpacity',\n 'flex',\n 'flexGrow',\n 'flexNegative',\n 'flexOrder',\n 'flexPositive',\n 'flexShrink',\n 'floodOpacity',\n 'fontWeight',\n 'gridArea',\n 'gridColumn',\n 'gridColumnEnd',\n 'gridColumnSpan',\n 'gridColumnStart',\n 'gridRow',\n 'gridRowEnd',\n 'gridRowSpan',\n 'gridRowStart',\n 'imageOrientation',\n 'lineClamp',\n 'lineHeight',\n 'opacity',\n 'order',\n 'orphans',\n 'scale',\n 'stopOpacity',\n 'strokeDasharray',\n 'strokeDashoffset',\n 'strokeMiterlimit',\n 'strokeOpacity',\n 'strokeWidth',\n 'tabSize',\n 'widows',\n 'zIndex',\n 'zoom',\n];\n","import { UnitlessProperties } from './unitless';\n\nconst CSS_NUMBER_VALUE = /^-?(\\d+\\.?\\d*|\\.\\d+)$/;\n\nconst UNITLESS = new Set(UnitlessProperties);\n\nexport function getCssPropertyValue(property: string, value: string): string {\n if (!value || !shouldAppendCssPx(property)) return value;\n\n if (CSS_NUMBER_VALUE.test(value)) return value + 'px';\n\n return value;\n}\n\nexport function shouldAppendCssPx(property: string): boolean {\n return !UNITLESS.has(property);\n}\n"],"mappings":";;AAEA,MAAa,eAA8B,OAAO,cAAc;AAChE,MAAa,gBAA+B,OAAO,eAAe;AAClE,MAAa,mBAAkC,OAAO,kBAAkB;A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qB;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;AC5CA,MAAM,mBAAmB;AAEzB,MAAM,WAAW,IAAI,IAAI,kBAAkB;AAE3C,SAAgB,oBAAoB,UAAkB,OAAuB;CAC3E,IAAI,CAAC,SAAS,CAAC,kBAAkB,QAAQ,GAAG,OAAO;CAEnD,IAAI,iBAAiB,KAAK,KAAK,GAAG,OAAO,QAAQ;CAEjD,OAAO;AACT;AAEA,SAAgB,kBAAkB,UAA2B;CAC3D,OAAO,CAAC,SAAS,IAAI,QAAQ;AAC/B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as getStyleRuntimeImportPath } from "./compiler-
|
|
2
|
-
import {
|
|
3
|
-
import { t as getSourcemapSidecar } from "./sidecar-
|
|
4
|
-
import { a as prependWebpackRuntimeEntry, i as hasWebpackCssMarker, n as getStylePackageDistPath, o as replaceWebpackCssMarker, r as getTransformLoaderPath, s as webpackRegistry, t as createWebpackRuntimeModuleSource } from "./utils-
|
|
1
|
+
import { r as getStyleRuntimeImportPath } from "./compiler-C3CEGGtI.mjs";
|
|
2
|
+
import { C as createPluginCompiler, D as DEFAULT_TRANSFORM_INCLUDE, E as DEFAULT_TRANSFORM_EXCLUDE, I as writePluginCacheFile, M as EXTRACTED_CSS_MARKER, P as PLUGIN_NAME, S as createCompilerId, T as invalidateFiles, _ as getStyleRuntimeMode, d as resolvePluginSourcemapFilePath, g as getStyleEntryDefines, h as getPluginBuildDevConfig, j as BUNDLE_CSS_FILE, m as getPluginBuildConfig, t as formatError, u as resolveDevSourcemapMode, w as getPluginCacheDir, y as transformCssOutput } from "./misc-B76PUnWe.mjs";
|
|
3
|
+
import { t as getSourcemapSidecar } from "./sidecar-BhvmXYsD.mjs";
|
|
4
|
+
import { a as prependWebpackRuntimeEntry, i as hasWebpackCssMarker, n as getStylePackageDistPath, o as replaceWebpackCssMarker, r as getTransformLoaderPath, s as webpackRegistry, t as createWebpackRuntimeModuleSource } from "./utils-DND33M6y.mjs";
|
|
5
5
|
//#region plugin/bundler/webpack/plugin.ts
|
|
6
6
|
const WEBPACK_RUNTIME_FILE = "webpack-runtime.js";
|
|
7
7
|
function plugin(options = {}) {
|
|
@@ -104,4 +104,4 @@ function isRspackCompiler(compiler) {
|
|
|
104
104
|
//#endregion
|
|
105
105
|
export { plugin as t };
|
|
106
106
|
|
|
107
|
-
//# sourceMappingURL=webpack-
|
|
107
|
+
//# sourceMappingURL=webpack-D7QO0bKN.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webpack-D7QO0bKN.mjs","names":[],"sources":["../plugin/bundler/webpack/plugin.ts"],"sourcesContent":["import type { Compiler, RuleSetRule, WebpackPluginInstance } from 'webpack';\nimport { getStyleRuntimeImportPath } from '../../../compiler/utils/imports';\nimport {\n BUNDLE_CSS_FILE,\n createCompilerId,\n createPluginCompiler,\n DEFAULT_TRANSFORM_EXCLUDE,\n DEFAULT_TRANSFORM_INCLUDE,\n EXTRACTED_CSS_MARKER,\n getPluginCacheDir,\n invalidateFiles,\n PLUGIN_NAME,\n type PluginOptions,\n resolvePluginSourcemapFilePath,\n transformCssOutput,\n writePluginCacheFile,\n} from '../../utils';\nimport { formatError } from '../../utils/misc';\nimport {\n getPluginBuildConfig,\n getPluginBuildDevConfig,\n getStyleEntryDefines,\n getStyleRuntimeMode,\n} from '../../utils/runtimeEntry';\nimport { getSourcemapSidecar } from '../../utils/sidecar';\nimport { resolveDevSourcemapMode } from '../../utils/sourcemap';\nimport {\n createWebpackRuntimeModuleSource,\n getStylePackageDistPath,\n getTransformLoaderPath,\n hasWebpackCssMarker,\n prependWebpackRuntimeEntry,\n replaceWebpackCssMarker,\n type WebpackLoaderState,\n webpackRegistry,\n} from './utils';\n\nexport { CssPropPresets } from '../../utils';\nexport type { CompilerCssPropOptions, PluginOptions } from '../../utils';\n\nconst WEBPACK_RUNTIME_FILE = 'webpack-runtime.js';\n\nexport default plugin;\n\nexport function plugin(options: PluginOptions = {}) {\n return new WebpackPlugin(options);\n}\n\nclass WebpackPlugin implements WebpackPluginInstance {\n private readonly options: PluginOptions;\n\n constructor(options: PluginOptions = {}) {\n this.options = options;\n }\n\n apply(compiler: Compiler) {\n const dev = compiler.options.mode === 'development';\n const extract = !dev;\n\n const buildConfig = getPluginBuildConfig(this.options);\n const buildDevConfig = getPluginBuildDevConfig(this.options);\n const cacheDir = getPluginCacheDir(compiler.context, this.options.cacheDir);\n const devSourcemap = resolveDevSourcemapMode(this.options.devSourcemap, dev);\n\n const sourcemapSidecar = devSourcemap === 'sidecarServer'\n ? getSourcemapSidecar({ projectDir: compiler.context, cacheDir })\n : null;\n\n const getSourcemapFilePath = resolvePluginSourcemapFilePath(\n this.options.getSourcemapFilePath,\n sourcemapSidecar,\n );\n\n const runtimeMode = getStyleRuntimeMode(dev);\n const useRuntimeSidecarUrl = isRspackCompiler(compiler) && devSourcemap === 'sidecarServer';\n\n const createRuntimeSource = (sidecarUrl: string | null = null) =>\n createWebpackRuntimeModuleSource(\n extract,\n cssFilePath,\n useRuntimeSidecarUrl\n ? {\n runtimeImportPath: getStyleRuntimeImportPath(runtimeMode),\n sidecarUrl,\n }\n : undefined,\n );\n\n const state = createPluginCompiler({\n projectDir: compiler.context,\n cacheDir,\n dev,\n options: { ...this.options, devSourcemap, getSourcemapFilePath },\n runtimeMode,\n });\n\n const cssFilePath = extract\n ? writePluginCacheFile(state, BUNDLE_CSS_FILE, EXTRACTED_CSS_MARKER)\n : null;\n\n const runtimeFilePath = writePluginCacheFile(\n state,\n WEBPACK_RUNTIME_FILE,\n createRuntimeSource(),\n );\n\n const compilerId = createCompilerId('webpack');\n\n webpackRegistry.setEntry<WebpackLoaderState>(compilerId, {\n transform: state.transform,\n });\n\n compiler.options.entry = prependWebpackRuntimeEntry(\n compiler.options.entry,\n runtimeFilePath,\n );\n\n addTransformLoader(compiler, this.options, compilerId);\n\n const entryDefines = getStyleEntryDefines(buildConfig, buildDevConfig, null);\n\n compiler.options.plugins ??= [];\n compiler.options.plugins.push(\n new compiler.webpack.DefinePlugin(entryDefines),\n );\n\n compiler.hooks.beforeRun.tapPromise(PLUGIN_NAME, async () => {\n await sourcemapSidecar?.ensureStarted();\n\n Object.assign(\n entryDefines,\n getStyleEntryDefines(\n buildConfig,\n buildDevConfig,\n sourcemapSidecar?.getBaseUrl() || null,\n ),\n );\n writePluginCacheFile(\n state,\n WEBPACK_RUNTIME_FILE,\n createRuntimeSource(sourcemapSidecar?.getBaseUrl() || null),\n );\n });\n\n compiler.hooks.watchRun.tapPromise(PLUGIN_NAME, async (watchCompiler) => {\n await sourcemapSidecar?.ensureStarted();\n Object.assign(\n entryDefines,\n getStyleEntryDefines(\n buildConfig,\n buildDevConfig,\n sourcemapSidecar?.getBaseUrl() || null,\n ),\n );\n writePluginCacheFile(\n state,\n WEBPACK_RUNTIME_FILE,\n createRuntimeSource(sourcemapSidecar?.getBaseUrl() || null),\n );\n\n const files = watchCompiler.modifiedFiles;\n if (!files || !files.size) return;\n\n invalidateFiles(state.compiler, files);\n state.filter.clear();\n });\n\n compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {\n if (dev) return;\n\n compilation.hooks.processAssets.tapPromise(\n {\n name: PLUGIN_NAME,\n stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,\n },\n async () => {\n const css = await transformCssOutput(\n state.compiler.getExtractedCss(),\n this.options.cssOutput,\n BUNDLE_CSS_FILE,\n );\n if (!css) return;\n\n for (const asset of compilation.getAssets()) {\n if (!asset.name.endsWith('.css')) continue;\n\n const source = asset.source.source().toString();\n if (!hasWebpackCssMarker(source, EXTRACTED_CSS_MARKER)) continue;\n\n compilation.updateAsset(\n asset.name,\n new compiler.webpack.sources.RawSource(\n replaceWebpackCssMarker(source, EXTRACTED_CSS_MARKER, css),\n ),\n );\n\n return;\n }\n\n compilation.warnings.push(\n new Error(formatError(\n 'No CSS asset containing the Fluentic marker was emitted by Webpack, so extracted CSS could not be attached. ' +\n 'Make sure your Webpack config handles CSS imports so Webpack owns the output filename, hashing, and runtime loading.',\n )),\n );\n },\n );\n });\n }\n}\n\nfunction addTransformLoader(\n compiler: Compiler,\n options: PluginOptions,\n compilerId: string,\n) {\n const loader = {\n loader: getTransformLoaderPath(),\n options: { ...options, compilerId },\n };\n\n const rule: RuleSetRule = {\n use: [loader],\n enforce: 'pre',\n test: DEFAULT_TRANSFORM_INCLUDE,\n exclude: options.include ? undefined : [\n DEFAULT_TRANSFORM_EXCLUDE,\n getStylePackageDistPath(),\n ],\n };\n\n compiler.options.module.rules.unshift(rule);\n}\n\nfunction isRspackCompiler(compiler: Compiler) {\n const webpack = compiler.webpack as typeof compiler.webpack & {\n rspackVersion?: unknown;\n };\n\n return typeof webpack.rspackVersion === 'string';\n}\n"],"mappings":";;;;;AAwCA,MAAM,uBAAuB;AAI7B,SAAgB,OAAO,UAAyB,CAAC,GAAG;CAClD,OAAO,IAAI,cAAc,OAAO;AAClC;AAEA,IAAM,gBAAN,MAAqD;CAGnD,YAAY,UAAyB,CAAC,GAAG;EACvC,KAAK,UAAU;CACjB;CAEA,MAAM,UAAoB;EACxB,MAAM,MAAM,SAAS,QAAQ,SAAS;EACtC,MAAM,UAAU,CAAC;EAEjB,MAAM,cAAc,qBAAqB,KAAK,OAAO;EACrD,MAAM,iBAAiB,wBAAwB,KAAK,OAAO;EAC3D,MAAM,WAAW,kBAAkB,SAAS,SAAS,KAAK,QAAQ,QAAQ;EAC1E,MAAM,eAAe,wBAAwB,KAAK,QAAQ,cAAc,GAAG;EAE3E,MAAM,mBAAmB,iBAAiB,kBACtC,oBAAoB;GAAE,YAAY,SAAS;GAAS;EAAS,CAAC,IAC9D;EAEJ,M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
2
|
+
import { getClassName } from '../../../runtime/core/getClassName';
|
|
3
|
+
|
|
4
|
+
export const mergeJsxProps = createMergeJsxProps(getClassName, {
|
|
5
|
+
classProp: 'class',
|
|
6
|
+
styleProp: 'style',
|
|
7
|
+
styleMode: 'react',
|
|
8
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createMergeJsxProps } from '../../../runtime/adapter/utils';
|
|
2
|
+
import { getClassName } from '../../../runtime/core/getClassName';
|
|
3
|
+
|
|
4
|
+
export const mergeJsxProps = createMergeJsxProps(getClassName, {
|
|
5
|
+
classProp: 'className',
|
|
6
|
+
styleProp: 'style',
|
|
7
|
+
styleMode: 'react',
|
|
8
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createMergeJsxProps } from '../../../runtime/adapter/utils';
|
|
2
|
+
import { getClassName } from '../../../runtime/core/getClassName';
|
|
3
|
+
|
|
4
|
+
export const mergeJsxProps = createMergeJsxProps(getClassName, {
|
|
5
|
+
classProp: 'class',
|
|
6
|
+
styleProp: 'style',
|
|
7
|
+
styleMode: 'solid',
|
|
8
|
+
});
|
package/entry/dev/config.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '../shared/
|
|
1
|
+
import '../shared/config_dev';
|
|
2
2
|
import '../shared/dev';
|
package/entry/dev/index.ts
CHANGED
package/entry/dev/jsx_runtime.ts
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createMergeJsxProps } from '../../../runtime/adapter/utils';
|
|
2
|
+
import { getClassName } from '../../../runtime/extract/getClassName';
|
|
3
|
+
|
|
4
|
+
export const mergeJsxProps = createMergeJsxProps(getClassName, {
|
|
5
|
+
classProp: 'class',
|
|
6
|
+
styleProp: 'style',
|
|
7
|
+
styleMode: 'react',
|
|
8
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createMergeJsxProps } from '../../../runtime/adapter/utils';
|
|
2
|
+
import { getClassName } from '../../../runtime/extract/getClassName';
|
|
3
|
+
|
|
4
|
+
export const mergeJsxProps = createMergeJsxProps(getClassName, {
|
|
5
|
+
classProp: 'className',
|
|
6
|
+
styleProp: 'style',
|
|
7
|
+
styleMode: 'react',
|
|
8
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createMergeJsxProps } from '../../../runtime/adapter/utils';
|
|
2
|
+
import { getClassName } from '../../../runtime/extract/getClassName';
|
|
3
|
+
|
|
4
|
+
export const mergeJsxProps = createMergeJsxProps(getClassName, {
|
|
5
|
+
classProp: 'class',
|
|
6
|
+
styleProp: 'style',
|
|
7
|
+
styleMode: 'solid',
|
|
8
|
+
});
|
package/entry/prod/index.ts
CHANGED
package/entry/prod/runtime.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import './config';
|
|
2
2
|
|
|
3
3
|
export type { CombinedStyle } from '../../runtime/core';
|
|
4
|
+
export { type CombinedStyleFor, combineStyle } from '../../runtime/extract/combineStyle';
|
|
4
5
|
export {
|
|
5
6
|
type ClassNameProps,
|
|
6
7
|
type ClassNameResult,
|
|
@@ -8,7 +9,8 @@ export {
|
|
|
8
9
|
mergeClassName,
|
|
9
10
|
mergeStyle,
|
|
10
11
|
} from '../../runtime/extract/getClassName';
|
|
11
|
-
export {
|
|
12
|
-
export
|
|
12
|
+
export { getToken } from '../../runtime/extract/token';
|
|
13
|
+
export { bindScope, combineScope } from '../../runtime/style/scope';
|
|
14
|
+
export type { StyleProp, StyleTheme, StyleTokenInput, TokenTheme } from '../../runtime/types';
|
|
13
15
|
|
|
14
16
|
export type { CSS, CSSProperties, CSSPropertyName, CSSValueExclude } from '../../atomic/utils/types';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createMergeJsxProps } from '../../../runtime/adapter/utils';
|
|
2
|
+
import { getClassName } from '../../../runtime/rsc/getClassName';
|
|
3
|
+
|
|
4
|
+
export const mergeJsxProps = createMergeJsxProps(getClassName, {
|
|
5
|
+
classProp: 'class',
|
|
6
|
+
styleProp: 'style',
|
|
7
|
+
styleMode: 'react',
|
|
8
|
+
preserveResultProps: true,
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createMergeJsxProps } from '../../../runtime/adapter/utils';
|
|
2
|
+
import { getClassName } from '../../../runtime/rsc/getClassName';
|
|
3
|
+
|
|
4
|
+
export const mergeJsxProps = createMergeJsxProps(getClassName, {
|
|
5
|
+
classProp: 'className',
|
|
6
|
+
styleProp: 'style',
|
|
7
|
+
styleMode: 'react',
|
|
8
|
+
preserveResultProps: true,
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createMergeJsxProps } from '../../../runtime/adapter/utils';
|
|
2
|
+
import { getClassName } from '../../../runtime/rsc/getClassName';
|
|
3
|
+
|
|
4
|
+
export const mergeJsxProps = createMergeJsxProps(getClassName, {
|
|
5
|
+
classProp: 'class',
|
|
6
|
+
styleProp: 'style',
|
|
7
|
+
styleMode: 'solid',
|
|
8
|
+
preserveResultProps: true,
|
|
9
|
+
});
|