@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,204 @@
|
|
|
1
|
+
import { d as globalData, o as getStyleTokenId } from "./token-CKXUECuU.js";
|
|
2
|
+
//#region config/constants.ts
|
|
3
|
+
const LayerPlaceholder = "$layer";
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region config/config/css.ts
|
|
6
|
+
const CSS_CONFIG_DEFAULT = {
|
|
7
|
+
layer: true,
|
|
8
|
+
layers: [LayerPlaceholder],
|
|
9
|
+
layerNamespace: "css"
|
|
10
|
+
};
|
|
11
|
+
const CSS_CONFIG = globalData("config.css", () => ({ ...CSS_CONFIG_DEFAULT }));
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region config/utils.ts
|
|
14
|
+
const SIDECAR_URL_GLOBAL_SYMBOL = "FLUENTIC_STYLE_SIDECAR_URL";
|
|
15
|
+
function getCacheTTL(cache) {
|
|
16
|
+
return cache === true ? 3e5 : cache === false ? 0 : Math.max(cache, 0);
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region config/config/runtime.ts
|
|
20
|
+
const RUNTIME_CONFIG_DEFAULT = {
|
|
21
|
+
changes: 0,
|
|
22
|
+
isPlugin: false,
|
|
23
|
+
isHoist: false,
|
|
24
|
+
isExtracted: false,
|
|
25
|
+
isRSC: false,
|
|
26
|
+
runtimeCacheTTL: getCacheTTL(true)
|
|
27
|
+
};
|
|
28
|
+
const RUNTIME_CONFIG = globalData("config.runtime", () => ({ ...RUNTIME_CONFIG_DEFAULT }));
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region config/build.ts
|
|
31
|
+
const BUILD_CONFIG = globalData("config.build", () => ({ current: null }));
|
|
32
|
+
function setBuildConfig(config) {
|
|
33
|
+
BUILD_CONFIG.current = config;
|
|
34
|
+
RUNTIME_CONFIG.isHoist = config.hoist;
|
|
35
|
+
if (config.css) Object.assign(CSS_CONFIG, config.css);
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region entry/shared/config.ts
|
|
39
|
+
setBuildConfig(JSON.parse(FLUENTIC_STYLE_BUILD_CONFIG));
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region entry/shared/prod.ts
|
|
42
|
+
RUNTIME_CONFIG.isPlugin = true;
|
|
43
|
+
RUNTIME_CONFIG.isExtracted = true;
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region utils/hash.ts
|
|
46
|
+
function hashString(str) {
|
|
47
|
+
let hash = 2166136261;
|
|
48
|
+
for (let i = 0; i < str.length; i++) hash = Math.imul(hash ^ str.charCodeAt(i), 16777619);
|
|
49
|
+
return (hash >>> 0).toString(36).padEnd(7, "0");
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region atomic/utils/css.ts
|
|
53
|
+
function getCssVar(varName, value) {
|
|
54
|
+
return "var(" + varName + ", " + escapeCssValue(value) + ")";
|
|
55
|
+
}
|
|
56
|
+
function getCssVarRawFallback(varName, fallbackCss) {
|
|
57
|
+
return "var(" + varName + ", " + fallbackCss + ")";
|
|
58
|
+
}
|
|
59
|
+
function escapeCssValue(value) {
|
|
60
|
+
if (!value) return "";
|
|
61
|
+
return value.trim().replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/'/g, "\\'").replace(/;/g, "\\;");
|
|
62
|
+
}
|
|
63
|
+
function escapeCssIdent(ident) {
|
|
64
|
+
const escaped = ident.replace(/([[\]():.#,>+~*=!|^$@])/g, "\\$1");
|
|
65
|
+
if (/^[0-9]/.test(escaped)) return "\\3" + escaped[0] + " " + escaped.slice(1);
|
|
66
|
+
if (/^-[0-9]/.test(escaped)) return "-\\3" + escaped[1] + " " + escaped.slice(2);
|
|
67
|
+
return escaped;
|
|
68
|
+
}
|
|
69
|
+
function sanitizeCssIdentName(value, fallback = "") {
|
|
70
|
+
return value.replace(/[^a-zA-Z0-9_-]+/g, "-").replace(/^-+|-+$/g, "") || fallback;
|
|
71
|
+
}
|
|
72
|
+
function getIdentifierSafeHash(value) {
|
|
73
|
+
const hash = hashString(value);
|
|
74
|
+
const first = hash.charCodeAt(0);
|
|
75
|
+
if (first < 48 || first > 57) return hash;
|
|
76
|
+
return String.fromCharCode(97 + first - 48) + hash.slice(1);
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region atomic/utils/format.ts
|
|
80
|
+
const TOKEN_REGEX = /\(([a-zA-Z][a-zA-Z0-9]*)(?::([0-9]+)(!)?)?\)/g;
|
|
81
|
+
const OPTIONAL_REGEX = /\[([^[\]]*)\]/g;
|
|
82
|
+
const HASH_TOKEN = "$hash";
|
|
83
|
+
function createNameFormatter(keys) {
|
|
84
|
+
const keySet = new Set(keys);
|
|
85
|
+
const cache = /* @__PURE__ */ new Map();
|
|
86
|
+
function getFormatFn(format) {
|
|
87
|
+
if (typeof format === "function") return format;
|
|
88
|
+
let fn = cache.get(format);
|
|
89
|
+
if (!fn) {
|
|
90
|
+
fn = compileFormat(format, keySet);
|
|
91
|
+
cache.set(format, fn);
|
|
92
|
+
}
|
|
93
|
+
return fn;
|
|
94
|
+
}
|
|
95
|
+
return function format(format, hash, info) {
|
|
96
|
+
const name = getFormatFn(format)(info);
|
|
97
|
+
if (!hash) return name;
|
|
98
|
+
if (name.includes(HASH_TOKEN)) return name.replace(HASH_TOKEN, hash);
|
|
99
|
+
return name ? name + "-" + hash : hash;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function compileFormat(format, keySet) {
|
|
103
|
+
const segments = compileSegments(format, keySet);
|
|
104
|
+
return (info) => {
|
|
105
|
+
let name = "";
|
|
106
|
+
for (const segment of segments) {
|
|
107
|
+
const text = formatSegment(info, segment);
|
|
108
|
+
if (text === null) {
|
|
109
|
+
if (!segment.optional) return "";
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
name += text;
|
|
113
|
+
}
|
|
114
|
+
return name;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function compileSegments(format, keySet) {
|
|
118
|
+
const segments = [];
|
|
119
|
+
let lastIndex = 0;
|
|
120
|
+
for (const match of format.matchAll(OPTIONAL_REGEX)) {
|
|
121
|
+
const index = match.index ?? 0;
|
|
122
|
+
if (index > lastIndex) segments.push({
|
|
123
|
+
optional: false,
|
|
124
|
+
parts: compileParts(format.slice(lastIndex, index), keySet)
|
|
125
|
+
});
|
|
126
|
+
segments.push({
|
|
127
|
+
optional: true,
|
|
128
|
+
parts: compileParts(match[1], keySet)
|
|
129
|
+
});
|
|
130
|
+
lastIndex = index + match[0].length;
|
|
131
|
+
}
|
|
132
|
+
if (lastIndex < format.length) segments.push({
|
|
133
|
+
optional: false,
|
|
134
|
+
parts: compileParts(format.slice(lastIndex), keySet)
|
|
135
|
+
});
|
|
136
|
+
return segments;
|
|
137
|
+
}
|
|
138
|
+
function compileParts(segment, keySet) {
|
|
139
|
+
const parts = [];
|
|
140
|
+
let lastIndex = 0;
|
|
141
|
+
for (const match of segment.matchAll(TOKEN_REGEX)) {
|
|
142
|
+
const index = match.index ?? 0;
|
|
143
|
+
const key = match[1];
|
|
144
|
+
if (!keySet.has(key)) continue;
|
|
145
|
+
if (index > lastIndex) parts.push({
|
|
146
|
+
type: "text",
|
|
147
|
+
value: segment.slice(lastIndex, index)
|
|
148
|
+
});
|
|
149
|
+
parts.push({
|
|
150
|
+
type: "token",
|
|
151
|
+
key,
|
|
152
|
+
maxLength: match[2] ? Number(match[2]) : null,
|
|
153
|
+
truncate: Boolean(match[3])
|
|
154
|
+
});
|
|
155
|
+
lastIndex = index + match[0].length;
|
|
156
|
+
}
|
|
157
|
+
if (lastIndex < segment.length) parts.push({
|
|
158
|
+
type: "text",
|
|
159
|
+
value: segment.slice(lastIndex)
|
|
160
|
+
});
|
|
161
|
+
return parts;
|
|
162
|
+
}
|
|
163
|
+
function formatSegment(info, segment) {
|
|
164
|
+
let text = "";
|
|
165
|
+
for (const part of segment.parts) {
|
|
166
|
+
if (part.type === "text") {
|
|
167
|
+
text += part.value;
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
const value = formatTokenValue(info[part.key], part.maxLength, part.truncate);
|
|
171
|
+
if (value === null) {
|
|
172
|
+
if (segment.optional) return null;
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
text += value;
|
|
176
|
+
}
|
|
177
|
+
return text;
|
|
178
|
+
}
|
|
179
|
+
function formatTokenValue(value, maxLength, truncate) {
|
|
180
|
+
if (!value) return null;
|
|
181
|
+
if (!maxLength) return value;
|
|
182
|
+
if (!Number.isFinite(maxLength) || maxLength < 0 || value.length <= maxLength) return value;
|
|
183
|
+
return truncate ? value.slice(0, maxLength) : null;
|
|
184
|
+
}
|
|
185
|
+
const formatTokenName = createNameFormatter(["name"]);
|
|
186
|
+
function getTokenVarName(token, format) {
|
|
187
|
+
const id = getStyleTokenId(token);
|
|
188
|
+
return "--" + formatTokenName(format || "token[-(name)]-$hash", getIdentifierSafeHash(id), { name: id });
|
|
189
|
+
}
|
|
190
|
+
function getTokenVar(token, format) {
|
|
191
|
+
return getTokenVarFallback(token, format);
|
|
192
|
+
}
|
|
193
|
+
function getTokenOverrideValue(token, format) {
|
|
194
|
+
return token.ref ? getTokenVar(token.ref, format) : token.value;
|
|
195
|
+
}
|
|
196
|
+
function getTokenVarFallback(token, tokenNameFormat) {
|
|
197
|
+
const varName = getTokenVarName(token, tokenNameFormat);
|
|
198
|
+
if (token.ref) return getCssVarRawFallback(varName, getTokenVarFallback(token.ref, tokenNameFormat));
|
|
199
|
+
return getCssVar(varName, String(token.value ?? ""));
|
|
200
|
+
}
|
|
201
|
+
//#endregion
|
|
202
|
+
export { LayerPlaceholder as _, escapeCssIdent as a, getIdentifierSafeHash as c, BUILD_CONFIG as d, RUNTIME_CONFIG as f, CSS_CONFIG_DEFAULT as g, CSS_CONFIG as h, createNameFormatter as i, sanitizeCssIdentName as l, getCacheTTL as m, getTokenVar as n, escapeCssValue as o, SIDECAR_URL_GLOBAL_SYMBOL as p, getTokenVarName as r, getCssVarRawFallback as s, getTokenOverrideValue as t, hashString as u };
|
|
203
|
+
|
|
204
|
+
//# sourceMappingURL=token-u_tM-mtg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-u_tM-mtg.js","names":[],"sources":["../config/constants.ts","../config/config/css.ts","../config/utils.ts","../config/config/runtime.ts","../config/build.ts","../entry/shared/config.ts","../entry/shared/prod.ts","../utils/hash.ts","../atomic/utils/css.ts","../atomic/utils/format.ts","../atomic/token.ts"],"sourcesContent":["export const LayerPlaceholder = '$layer';\n","import { globalData } from '../../utils/global';\nimport { LayerPlaceholder } from '../constants';\nimport type {\n ClassNameFormat,\n ElementClassNameFormat,\n ScopeClassNameFormat,\n ThemeNameFormat,\n TokenNameFormat,\n} from '../types';\n\nexport type CssConfig = {\n layer: boolean;\n layers?: string[];\n layerNamespace?: string;\n classNameFormat?: ClassNameFormat;\n scopeClassNameFormat?: ScopeClassNameFormat;\n elementClassNameFormat?: ElementClassNameFormat;\n themeNameFormat?: ThemeNameFormat;\n tokenNameFormat?: TokenNameFormat;\n varNameFormat?: TokenNameFormat;\n};\n\nexport const CSS_CONFIG_DEFAULT: CssConfig = {\n layer: true,\n layers: [LayerPlaceholder],\n layerNamespace: 'css',\n};\n\nexport const CSS_CONFIG = globalData<CssConfig>(\n 'config.css',\n () => ({ ...CSS_CONFIG_DEFAULT }),\n);\n","export const SIDECAR_URL_GLOBAL_SYMBOL = 'FLUENTIC_STYLE_SIDECAR_URL';\n\nexport function getCacheTTL(cache: boolean | number) {\n return cache === true ? 300_000 : cache === false ? 0 : Math.max(cache, 0);\n}\n","import { globalData } from '../../utils/global';\nimport { getCacheTTL } from '../utils';\n\nexport type RuntimeConfig = {\n changes: number;\n\n isPlugin: boolean;\n isHoist: boolean;\n isExtracted: boolean;\n isRSC: boolean;\n\n runtimeCacheTTL: number;\n};\n\nexport const RUNTIME_CONFIG_DEFAULT: RuntimeConfig = {\n changes: 0,\n\n isPlugin: false,\n isHoist: false,\n isExtracted: false,\n isRSC: false,\n\n runtimeCacheTTL: getCacheTTL(true),\n};\n\nexport const RUNTIME_CONFIG = globalData<RuntimeConfig>(\n 'config.runtime',\n () => ({ ...RUNTIME_CONFIG_DEFAULT }),\n);\n","import { globalData } from '../utils/global';\nimport type { ReplaceProps } from '../utils/type';\nimport { CSS_CONFIG, type CssConfig } from './config/css';\nimport type { DevRuntimeOptions } from './config/dev';\nimport { RUNTIME_CONFIG } from './config/runtime';\nimport type { CheckSelectorMode } from './types';\n\nexport type BuildCssConfig = Partial<CssConfig>;\n\nexport type BuildDevConfig = ReplaceProps<DevRuntimeOptions, {\n checkSelector?: CheckSelectorMode;\n}>;\n\nexport type BuildConfig = {\n hoist: boolean;\n css: BuildCssConfig;\n};\n\nexport const BUILD_CONFIG = globalData(\n 'config.build',\n () => ({ current: null as BuildConfig | null }),\n);\n\nexport function setBuildConfig(config: BuildConfig) {\n BUILD_CONFIG.current = config;\n\n RUNTIME_CONFIG.isHoist = config.hoist;\n\n if (config.css) {\n Object.assign(CSS_CONFIG, config.css);\n }\n}\n","import { setBuildConfig } from '../../config/build';\n\ndeclare const FLUENTIC_STYLE_BUILD_CONFIG: string;\n\nsetBuildConfig(JSON.parse(FLUENTIC_STYLE_BUILD_CONFIG));\n","import { RUNTIME_CONFIG } from '../../config/config/runtime';\n\nRUNTIME_CONFIG.isPlugin = true;\nRUNTIME_CONFIG.isExtracted = true;\n","const BASE62_CHARS = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\nexport function toBase62(value: number) {\n let result = '';\n\n do {\n result = BASE62_CHARS[value % 62] + result;\n value = Math.floor(value / 62);\n } while (value > 0);\n\n return result;\n}\n\nexport function hashString(str: string) {\n let hash = 0x811c9dc5;\n\n for (let i = 0; i < str.length; i++) {\n hash = Math.imul(hash ^ str.charCodeAt(i), 0x01000193);\n }\n\n return (hash >>> 0).toString(36).padEnd(7, '0');\n}\n","import { hashString } from '../../utils/hash';\n\nexport function getCssVar(varName: string, value: string) {\n return 'var(' + varName + ', ' + escapeCssValue(value) + ')';\n}\n\nexport function getCssVarRawFallback(varName: string, fallbackCss: string) {\n return 'var(' + varName + ', ' + fallbackCss + ')';\n}\n\nexport function escapeCssValue(value: string): string {\n if (!value) return '';\n\n return value\n .trim()\n // Escape existing backslashes first so we don't break them.\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\"/g, '\\\\\"')\n .replace(/'/g, \"\\\\'\")\n .replace(/;/g, '\\\\;');\n}\n\nexport function escapeCssIdent(ident: string): string {\n const escaped = ident.replace(/([[\\]():.#,>+~*=!|^$@])/g, '\\\\$1');\n\n if (/^[0-9]/.test(escaped)) {\n return '\\\\3' + escaped[0] + ' ' + escaped.slice(1);\n }\n\n if (/^-[0-9]/.test(escaped)) {\n return '-\\\\3' + escaped[1] + ' ' + escaped.slice(2);\n }\n\n return escaped;\n}\n\nexport function sanitizeCssIdentName(value: string, fallback: string = '') {\n return value.replace(/[^a-zA-Z0-9_-]+/g, '-').replace(/^-+|-+$/g, '') || fallback;\n}\n\nexport function getIdentifierSafeHash(value: string) {\n const hash = hashString(value);\n\n const first = hash.charCodeAt(0);\n\n if (first < 48 || first > 57) return hash;\n\n return String.fromCharCode(97 + first - 48) + hash.slice(1);\n}\n","type FormatInfo = { [key: string]: string | null; };\n\ntype NameFormatFn<Info> = (info: Info) => string;\ntype NameFormat<Info> = string | NameFormatFn<Info>;\n\ntype CompiledSegment<Key extends string> = {\n optional: boolean;\n parts: CompiledPart<Key>[];\n};\n\ntype CompiledPart<Key extends string> =\n | { type: 'text'; value: string; }\n | {\n type: 'token';\n key: Key;\n maxLength: number | null;\n truncate: boolean;\n };\n\nconst TOKEN_REGEX = /\\(([a-zA-Z][a-zA-Z0-9]*)(?::([0-9]+)(!)?)?\\)/g;\nconst OPTIONAL_REGEX = /\\[([^[\\]]*)\\]/g;\n\nconst HASH_TOKEN = '$hash';\n\nexport type NameFormatter<Info extends object> = ReturnType<typeof createNameFormatter<Info>>;\n\nexport function createNameFormatter<Info extends object>(\n keys: readonly (keyof Info & string)[],\n) {\n const keySet = new Set<string>(keys);\n const cache = new Map<string, NameFormatFn<Info>>();\n\n function getFormatFn(format: NameFormat<Info>) {\n if (typeof format === 'function') return format;\n\n let fn = cache.get(format);\n\n if (!fn) {\n fn = compileFormat(format, keySet);\n cache.set(format, fn);\n }\n\n return fn;\n }\n\n return function format(format: NameFormat<Info>, hash: string | null, info: Info) {\n const name = getFormatFn(format)(info);\n\n if (!hash) return name;\n\n if (name.includes(HASH_TOKEN)) {\n return name.replace(HASH_TOKEN, hash);\n }\n\n return name ? (name + '-' + hash) : hash;\n };\n}\n\nfunction compileFormat<Info extends object>(\n format: string,\n keySet: ReadonlySet<string>,\n): NameFormatFn<Info> {\n type Key = keyof Info & string;\n const segments = compileSegments<Key>(format, keySet);\n\n return (info) => {\n let name = '';\n\n for (const segment of segments) {\n const text = formatSegment(info, segment);\n\n if (text === null) {\n if (!segment.optional) return '';\n continue;\n }\n\n name += text;\n }\n\n return name;\n };\n}\n\nfunction compileSegments<Key extends string>(\n format: string,\n keySet: ReadonlySet<string>,\n) {\n const segments: CompiledSegment<Key>[] = [];\n let lastIndex = 0;\n\n for (const match of format.matchAll(OPTIONAL_REGEX)) {\n const index = match.index ?? 0;\n\n if (index > lastIndex) {\n segments.push({\n optional: false,\n parts: compileParts<Key>(format.slice(lastIndex, index), keySet),\n });\n }\n\n segments.push({\n optional: true,\n parts: compileParts<Key>(match[1], keySet),\n });\n\n lastIndex = index + match[0].length;\n }\n\n if (lastIndex < format.length) {\n segments.push({\n optional: false,\n parts: compileParts<Key>(format.slice(lastIndex), keySet),\n });\n }\n\n return segments;\n}\n\nfunction compileParts<Key extends string>(\n segment: string,\n keySet: ReadonlySet<string>,\n) {\n const parts: CompiledPart<Key>[] = [];\n let lastIndex = 0;\n\n for (const match of segment.matchAll(TOKEN_REGEX)) {\n const index = match.index ?? 0;\n const key = match[1];\n\n if (!keySet.has(key)) continue;\n\n if (index > lastIndex) {\n parts.push({ type: 'text', value: segment.slice(lastIndex, index) });\n }\n\n parts.push({\n type: 'token',\n key: key as Key,\n maxLength: match[2] ? Number(match[2]) : null,\n truncate: Boolean(match[3]),\n });\n\n lastIndex = index + match[0].length;\n }\n\n if (lastIndex < segment.length) {\n parts.push({ type: 'text', value: segment.slice(lastIndex) });\n }\n\n return parts;\n}\n\nfunction formatSegment<Info extends object, Key extends keyof Info & string>(\n info: Info,\n segment: CompiledSegment<Key>,\n) {\n let text = '';\n\n for (const part of segment.parts) {\n if (part.type === 'text') {\n text += part.value;\n continue;\n }\n\n const value = formatTokenValue(\n (info as FormatInfo)[part.key],\n part.maxLength,\n part.truncate,\n );\n if (value === null) {\n if (segment.optional) return null;\n continue;\n }\n\n text += value;\n }\n\n return text;\n}\n\nfunction formatTokenValue(\n value: string | null,\n maxLength: number | null,\n truncate: boolean,\n) {\n if (!value) return null;\n if (!maxLength) return value;\n\n if (!Number.isFinite(maxLength) || maxLength < 0 || value.length <= maxLength) return value;\n\n return truncate ? value.slice(0, maxLength) : null;\n}\n","import type { TokenNameFormat, TokenNameInfo } from '../config/types';\nimport { getStyleTokenId, type StyleTokenData, type StyleTokenOverride } from '../style/token';\nimport { getCssVar, getCssVarRawFallback, getIdentifierSafeHash } from './utils/css';\nimport { createNameFormatter } from './utils/format';\n\nexport const TOKEN_NAME_FORMAT = 'token[-(name)]-$hash';\n\nexport const formatTokenName = createNameFormatter<TokenNameInfo>(['name']);\n\nexport function getTokenVarName(\n token: StyleTokenData | StyleTokenOverride,\n format: TokenNameFormat | null,\n) {\n const id = getStyleTokenId(token);\n\n const name = formatTokenName(\n format || TOKEN_NAME_FORMAT,\n getIdentifierSafeHash(id),\n { name: id },\n );\n\n return '--' + name;\n}\n\nexport function getTokenVar(\n token: StyleTokenData,\n format: TokenNameFormat | null,\n) {\n return getTokenVarFallback(token, format);\n}\n\nexport function getTokenOverrideValue(\n token: StyleTokenOverride,\n format: TokenNameFormat | null,\n) {\n return token.ref ? getTokenVar(token.ref, format) : token.value;\n}\n\nfunction getTokenVarFallback(\n token: StyleTokenData,\n tokenNameFormat: TokenNameFormat | null,\n): string {\n const varName = getTokenVarName(token, tokenNameFormat);\n\n if (token.ref) {\n return getCssVarRawFallback(\n varName,\n getTokenVarFallback(token.ref, tokenNameFormat),\n );\n }\n\n return getCssVar(varName, String(token.value ?? ''));\n}\n"],"mappings":";;AAAA,MAAa,mBAAmB;;;ACsBhC,MAAa,qBAAgC;CAC3C,OAAO;CACP,QAAQ,CAAC,gBAAgB;CACzB,gBAAgB;AAClB;AAEA,MAAa,aAAa,WACxB,qBACO,EAAE,GAAG,mBAAmB,EACjC;;;AC/BA,MAAa,4BAA4B;AAEzC,SAAgB,YAAY,OAAyB;CACnD,OAAO,UAAU,OAAO,MAAU,UAAU,QAAQ,IAAI,KAAK,IAAI,OAAO,CAAC;AAC3E;;;ACUA,MAAa,yBAAwC;CACnD,SAAS;CAET,UAAU;CACV,SAAS;CACT,aAAa;CACb,OAAO;CAEP,iBAAiB,YAAY,IAAI;AACnC;AAEA,MAAa,iBAAiB,WAC5B,yBACO,EAAE,GAAG,uBAAuB,EACrC;;;ACVA,MAAa,eAAe,WAC1B,uBACO,EAAE,SAAS,KAA2B,EAC/C;AAEA,SAAgB,eAAe,QAAqB;CAClD,aAAa,UAAU;CAEvB,eAAe,UAAU,OAAO;CAEhC,IAAI,OAAO,KACT,OAAO,OAAO,YAAY,OAAO,GAAG;AAExC;;;AC3BA,eAAe,KAAK,MAAM,2BAA2B,CAAC;;;ACFtD,eAAe,WAAW;AAC1B,eAAe,cAAc;;;ACU7B,SAAgB,WAAW,KAAa;CACtC,IAAI,OAAO;CAEX,KAAK,IAAI,IAAI,GAAG,IAAI,IAAI,QAAQ,KAC9B,OAAO,KAAK,KAAK,OAAO,IAAI,WAAW,CAAC,GAAG,QAAU;CAGvD,QAAQ,SAAS,GAAG,SAAS,EAAE,EAAE,OAAO,GAAG,GAAG;AAChD;;;ACnBA,SAAgB,UAAU,SAAiB,OAAe;CACxD,OAAO,SAAS,UAAU,OAAO,eAAe,KAAK,IAAI;AAC3D;AAEA,SAAgB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,MAAM,MAAM,YAAY,MAAM,KAAK,MAAM,IAAI,MAAM;AAC5D;AAEA,SAAS,oBACP,OACA,iBACQ;CACR,MAAM,UAAU,gBAAgB,OAAO,eAAe;CAEtD,IAAI,MAAM,KACR,OAAO,qBACL,SACA,oBAAoB,MAAM,KAAK,eAAe,CAChD;CAGF,OAAO,UAAU,SAAS,OAAO,MAAM,SAAS,EAAE,CAAC;AACrD"}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { f as normalizeCallsiteSourceUrl } from "./debug-n2aZQBSa.js";
|
|
2
|
+
import { d as getDevSourcemapTags, m as getSourcemapRuleCallsite, p as createSourceMapComment } from "./elementMarker-Bu7gDAkE.js";
|
|
3
|
+
import { TraceMap, originalPositionFor, sourceContentFor } from "@jridgewell/trace-mapping";
|
|
4
|
+
//#region dev/trace.ts
|
|
5
|
+
const SOURCE_MAPPING_URL_REGEX = /(?:\/\/|\/\*)[#@]\s*sourceMappingURL=([^\s*]+)(?:\s*\*\/)?/g;
|
|
6
|
+
async function traceDevSourcemaps() {
|
|
7
|
+
const activeTags = getDevSourcemapTags().filter((item) => item.sourceMapNode && item.sourceMapNode.parentNode === item.tag);
|
|
8
|
+
const browserWindow = getBrowserWindow();
|
|
9
|
+
const fetcher = browserWindow?.fetch?.bind(browserWindow);
|
|
10
|
+
const sourceMapCache = /* @__PURE__ */ new Map();
|
|
11
|
+
const sourcemaps = /* @__PURE__ */ new Set();
|
|
12
|
+
let rules = 0;
|
|
13
|
+
let remapped = 0;
|
|
14
|
+
let unresolved = 0;
|
|
15
|
+
for (let i = 0, len = activeTags.length; i < len; i++) {
|
|
16
|
+
const item = activeTags[i];
|
|
17
|
+
let touched = false;
|
|
18
|
+
for (let j = 0, ruleLen = item.rules.length; j < ruleLen; j++) {
|
|
19
|
+
const rule = item.rules[j];
|
|
20
|
+
const callsite = getSourcemapRuleCallsite(rule);
|
|
21
|
+
if (!callsite) continue;
|
|
22
|
+
if (isDisplaySourceUrl(callsite.sourceUrl || callsite.filePath)) continue;
|
|
23
|
+
rules++;
|
|
24
|
+
const nextCallsite = await traceCallsiteSourcemap(callsite, fetcher, sourceMapCache);
|
|
25
|
+
if (nextCallsite) {
|
|
26
|
+
if (nextCallsite.sourceMapUrl) sourcemaps.add(nextCallsite.sourceMapUrl);
|
|
27
|
+
rule.callsite = nextCallsite.callsite;
|
|
28
|
+
rule.debug = null;
|
|
29
|
+
rule.debugField = null;
|
|
30
|
+
remapped++;
|
|
31
|
+
} else {
|
|
32
|
+
rule.callsite = createDisplayCallsite(callsite);
|
|
33
|
+
rule.debug = null;
|
|
34
|
+
rule.debugField = null;
|
|
35
|
+
unresolved++;
|
|
36
|
+
}
|
|
37
|
+
touched = true;
|
|
38
|
+
}
|
|
39
|
+
if (touched) rewriteDevSourcemapTag(item);
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
tags: activeTags.length,
|
|
43
|
+
rules,
|
|
44
|
+
remapped,
|
|
45
|
+
unresolved,
|
|
46
|
+
sourcemaps: [...sourcemaps]
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
async function traceCallsiteSourcemap(callsite, fetcher, sourceMapCache) {
|
|
50
|
+
if (!fetcher) return null;
|
|
51
|
+
const generatedUrl = getFetchableGeneratedUrl(callsite.sourceUrl || callsite.filePath);
|
|
52
|
+
if (!generatedUrl) return null;
|
|
53
|
+
let sourceMapPromise = sourceMapCache.get(generatedUrl);
|
|
54
|
+
if (!sourceMapPromise) {
|
|
55
|
+
sourceMapPromise = fetchSourceMap(getGeneratedUrlFetchCandidates(generatedUrl), fetcher);
|
|
56
|
+
sourceMapCache.set(generatedUrl, sourceMapPromise);
|
|
57
|
+
}
|
|
58
|
+
const sourceMap = await sourceMapPromise;
|
|
59
|
+
if (!sourceMap) return null;
|
|
60
|
+
const original = originalPositionFor(sourceMap.map, {
|
|
61
|
+
line: callsite.line,
|
|
62
|
+
column: Math.max(callsite.column - 1, 0)
|
|
63
|
+
});
|
|
64
|
+
if (!original.source || original.line == null || original.column == null) return null;
|
|
65
|
+
const sourceUrl = resolveOriginalSourceUrl(original.source, sourceMap.sourceBaseUrl, sourceMap.sourceRoot);
|
|
66
|
+
const sourceContent = getSourceContent(sourceMap, original.source, sourceUrl);
|
|
67
|
+
const displaySourceUrl = getDisplaySourceUrl(sourceUrl);
|
|
68
|
+
return {
|
|
69
|
+
sourceMapUrl: sourceMap.url,
|
|
70
|
+
callsite: {
|
|
71
|
+
filePath: displaySourceUrl,
|
|
72
|
+
sourceUrl: displaySourceUrl,
|
|
73
|
+
sourceContent,
|
|
74
|
+
line: original.line,
|
|
75
|
+
column: original.column + 1
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function rewriteDevSourcemapTag(item) {
|
|
80
|
+
const document = item.tag.ownerDocument;
|
|
81
|
+
item.tag.textContent = "";
|
|
82
|
+
for (let i = 0, len = item.rules.length; i < len; i++) item.tag.appendChild(document.createTextNode(item.rules[i].css + "\n"));
|
|
83
|
+
item.sourceMapNode = document.createTextNode("\n" + createSourceMapComment(item.rules));
|
|
84
|
+
item.tag.appendChild(item.sourceMapNode);
|
|
85
|
+
}
|
|
86
|
+
function createDisplayCallsite(callsite) {
|
|
87
|
+
const displaySourceUrl = getDisplaySourceUrl(callsite.sourceUrl || callsite.filePath);
|
|
88
|
+
return {
|
|
89
|
+
...callsite,
|
|
90
|
+
filePath: displaySourceUrl,
|
|
91
|
+
sourceUrl: displaySourceUrl
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function isDisplaySourceUrl(sourceUrl) {
|
|
95
|
+
return sourceUrl.match(SOURCE_MAPPING_URL_REGEX);
|
|
96
|
+
}
|
|
97
|
+
async function fetchSourceMap(generatedUrls, fetcher) {
|
|
98
|
+
for (const generatedUrl of generatedUrls) try {
|
|
99
|
+
const response = await fetcher(generatedUrl);
|
|
100
|
+
if (!response.ok) continue;
|
|
101
|
+
const sourceMapUrl = findSourceMapUrl(await response.text(), generatedUrl);
|
|
102
|
+
if (!sourceMapUrl) continue;
|
|
103
|
+
const rawMap = await loadSourceMap(sourceMapUrl, fetcher);
|
|
104
|
+
if (!rawMap) continue;
|
|
105
|
+
const sourceBaseUrl = sourceMapUrl.startsWith("data:") ? normalizeGeneratedUrl(generatedUrl) : sourceMapUrl;
|
|
106
|
+
return {
|
|
107
|
+
url: sourceMapUrl,
|
|
108
|
+
sourceBaseUrl,
|
|
109
|
+
rawMap,
|
|
110
|
+
map: new TraceMap(rawMap, sourceBaseUrl),
|
|
111
|
+
sourceRoot: typeof rawMap.sourceRoot === "string" ? rawMap.sourceRoot : void 0
|
|
112
|
+
};
|
|
113
|
+
} catch {}
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
async function loadSourceMap(sourceMapUrl, fetcher) {
|
|
117
|
+
try {
|
|
118
|
+
if (sourceMapUrl.startsWith("data:")) return parseDataUrlSourceMap(sourceMapUrl);
|
|
119
|
+
const response = await fetcher(sourceMapUrl);
|
|
120
|
+
if (!response.ok) return null;
|
|
121
|
+
return JSON.parse(await response.text());
|
|
122
|
+
} catch {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function findSourceMapUrl(source, generatedUrl) {
|
|
127
|
+
let match = null;
|
|
128
|
+
let sourceMapUrl = null;
|
|
129
|
+
SOURCE_MAPPING_URL_REGEX.lastIndex = 0;
|
|
130
|
+
while (match = SOURCE_MAPPING_URL_REGEX.exec(source)) sourceMapUrl = match[1];
|
|
131
|
+
if (!sourceMapUrl) return null;
|
|
132
|
+
if (sourceMapUrl.startsWith("data:")) return sourceMapUrl;
|
|
133
|
+
try {
|
|
134
|
+
return new URL(sourceMapUrl, generatedUrl).href;
|
|
135
|
+
} catch {
|
|
136
|
+
return null;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
function parseDataUrlSourceMap(sourceMapUrl) {
|
|
140
|
+
const commaIndex = sourceMapUrl.indexOf(",");
|
|
141
|
+
if (commaIndex === -1) return null;
|
|
142
|
+
const meta = sourceMapUrl.slice(0, commaIndex);
|
|
143
|
+
const data = sourceMapUrl.slice(commaIndex + 1);
|
|
144
|
+
const json = meta.endsWith(";base64") ? atob(data) : decodeURIComponent(data);
|
|
145
|
+
return JSON.parse(json);
|
|
146
|
+
}
|
|
147
|
+
function getFetchableGeneratedUrl(source) {
|
|
148
|
+
source = normalizeCallsiteSourceUrl(source);
|
|
149
|
+
if (source.startsWith("webpack://") || source.startsWith("node:")) return null;
|
|
150
|
+
try {
|
|
151
|
+
return new URL(source).href;
|
|
152
|
+
} catch {}
|
|
153
|
+
const base = getBrowserLocationHref();
|
|
154
|
+
if (!base) return null;
|
|
155
|
+
try {
|
|
156
|
+
return new URL(source, base).href;
|
|
157
|
+
} catch {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
function getGeneratedUrlFetchCandidates(url) {
|
|
162
|
+
const normalized = normalizeGeneratedUrl(url);
|
|
163
|
+
return url === normalized ? [url] : [url, normalized];
|
|
164
|
+
}
|
|
165
|
+
function getDisplaySourceUrl(sourceUrl) {
|
|
166
|
+
sourceUrl = normalizeCallsiteSourceUrl(sourceUrl);
|
|
167
|
+
const normalized = normalizeGeneratedUrl(sourceUrl);
|
|
168
|
+
try {
|
|
169
|
+
return "source:///" + new URL(normalized).pathname.replace(/^\/+/, "");
|
|
170
|
+
} catch {
|
|
171
|
+
return "source:///" + normalized.replace(/^\/+/, "");
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
function getSourceContent(sourceMap, originalSource, resolvedSourceUrl) {
|
|
175
|
+
const tracedContent = sourceContentFor(sourceMap.map, originalSource);
|
|
176
|
+
if (tracedContent != null) return tracedContent;
|
|
177
|
+
const rawSources = sourceMap.rawMap.sources;
|
|
178
|
+
const rawSourcesContent = sourceMap.rawMap.sourcesContent;
|
|
179
|
+
if (!rawSources || !rawSourcesContent) return void 0;
|
|
180
|
+
const sourceKeys = getSourceMatchKeys(originalSource, resolvedSourceUrl);
|
|
181
|
+
for (let i = 0, len = rawSources.length; i < len; i++) {
|
|
182
|
+
const rawSource = rawSources[i];
|
|
183
|
+
const rawContent = rawSourcesContent[i];
|
|
184
|
+
if (typeof rawSource !== "string") continue;
|
|
185
|
+
if (typeof rawContent !== "string") continue;
|
|
186
|
+
const rawKeys = getSourceMatchKeys(rawSource, resolveOriginalSourceUrl(rawSource, sourceMap.sourceBaseUrl, sourceMap.sourceRoot));
|
|
187
|
+
for (const key of rawKeys) if (sourceKeys.has(key)) return rawContent;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
function getSourceMatchKeys(...sources) {
|
|
191
|
+
const keys = /* @__PURE__ */ new Set();
|
|
192
|
+
for (const source of sources) {
|
|
193
|
+
if (!source) continue;
|
|
194
|
+
keys.add(source);
|
|
195
|
+
keys.add(normalizeGeneratedUrl(source));
|
|
196
|
+
try {
|
|
197
|
+
const url = new URL(source);
|
|
198
|
+
keys.add(url.pathname);
|
|
199
|
+
keys.add(normalizeGeneratedUrl(url.pathname));
|
|
200
|
+
} catch {}
|
|
201
|
+
}
|
|
202
|
+
return keys;
|
|
203
|
+
}
|
|
204
|
+
function normalizeGeneratedUrl(source) {
|
|
205
|
+
try {
|
|
206
|
+
const url = new URL(source);
|
|
207
|
+
url.search = "";
|
|
208
|
+
url.hash = "";
|
|
209
|
+
return url.href;
|
|
210
|
+
} catch {
|
|
211
|
+
const queryIndex = findFirstIndex(source, ["?", "#"]);
|
|
212
|
+
return queryIndex === -1 ? source : source.slice(0, queryIndex);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
function findFirstIndex(text, needles) {
|
|
216
|
+
let index = -1;
|
|
217
|
+
for (const needle of needles) {
|
|
218
|
+
const next = text.indexOf(needle);
|
|
219
|
+
if (next !== -1 && (index === -1 || next < index)) index = next;
|
|
220
|
+
}
|
|
221
|
+
return index;
|
|
222
|
+
}
|
|
223
|
+
function getBrowserLocationHref() {
|
|
224
|
+
return getBrowserWindow()?.location.href;
|
|
225
|
+
}
|
|
226
|
+
function getBrowserWindow() {
|
|
227
|
+
return typeof window === "undefined" ? null : window;
|
|
228
|
+
}
|
|
229
|
+
function resolveOriginalSourceUrl(source, sourceMapUrl, sourceRoot) {
|
|
230
|
+
if (isAbsoluteSource(source)) return source;
|
|
231
|
+
try {
|
|
232
|
+
if (sourceRoot && !isAbsoluteSource(sourceRoot)) return new URL(sourceRoot.replace(/\/?$/, "/") + source, sourceMapUrl).href;
|
|
233
|
+
if (sourceRoot) return new URL(source, sourceRoot).href;
|
|
234
|
+
return new URL(source, sourceMapUrl).href;
|
|
235
|
+
} catch {
|
|
236
|
+
return sourceRoot ? sourceRoot.replace(/\/?$/, "/") + source : source;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
function isAbsoluteSource(source) {
|
|
240
|
+
return /^[a-zA-Z][a-zA-Z\d+.-]*:/.test(source) || source.startsWith("/");
|
|
241
|
+
}
|
|
242
|
+
//#endregion
|
|
243
|
+
export { traceDevSourcemaps };
|
|
244
|
+
|
|
245
|
+
//# sourceMappingURL=trace-Bu_qOqRy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace-Bu_qOqRy.js","names":[],"sources":["../dev/trace.ts"],"sourcesContent":["import { type EncodedSourceMap, originalPositionFor, sourceContentFor, TraceMap } from '@jridgewell/trace-mapping';\nimport { getDevSourcemapTags } from '../sheet/dev';\nimport { createSourceMapComment, getSourcemapRuleCallsite } from '../sheet/sourcemap';\nimport type { SheetCallsite } from '../sheet/types';\nimport { normalizeCallsiteSourceUrl } from '../utils/trace';\n\nexport type TraceSourcemapResult = {\n tags: number;\n rules: number;\n remapped: number;\n unresolved: number;\n sourcemaps: string[];\n};\n\ntype SourceMapData = {\n url: string;\n sourceBaseUrl: string;\n rawMap: EncodedSourceMap;\n map: TraceMap;\n sourceRoot?: string;\n};\n\nconst SOURCE_MAPPING_URL_REGEX = /(?:\\/\\/|\\/\\*)[#@]\\s*sourceMappingURL=([^\\s*]+)(?:\\s*\\*\\/)?/g;\n\nexport async function traceDevSourcemaps(): Promise<TraceSourcemapResult> {\n const activeTags = getDevSourcemapTags().filter((item) =>\n item.sourceMapNode && item.sourceMapNode.parentNode === item.tag\n );\n const browserWindow = getBrowserWindow();\n const fetcher = browserWindow?.fetch?.bind(browserWindow);\n const sourceMapCache = new Map<string, Promise<SourceMapData | null>>();\n const sourcemaps = new Set<string>();\n let rules = 0;\n let remapped = 0;\n let unresolved = 0;\n\n for (let i = 0, len = activeTags.length; i < len; i++) {\n const item = activeTags[i];\n let touched = false;\n\n for (let j = 0, ruleLen = item.rules.length; j < ruleLen; j++) {\n const rule = item.rules[j];\n const callsite = getSourcemapRuleCallsite(rule);\n\n if (!callsite) continue;\n if (isDisplaySourceUrl(callsite.sourceUrl || callsite.filePath)) continue;\n\n rules++;\n\n const nextCallsite = await traceCallsiteSourcemap(\n callsite,\n fetcher,\n sourceMapCache,\n );\n\n if (nextCallsite) {\n if (nextCallsite.sourceMapUrl) sourcemaps.add(nextCallsite.sourceMapUrl);\n rule.callsite = nextCallsite.callsite;\n rule.debug = null;\n rule.debugField = null;\n remapped++;\n } else {\n rule.callsite = createDisplayCallsite(callsite);\n rule.debug = null;\n rule.debugField = null;\n unresolved++;\n }\n\n touched = true;\n }\n\n if (touched) {\n rewriteDevSourcemapTag(item);\n }\n }\n\n return {\n tags: activeTags.length,\n rules,\n remapped,\n unresolved,\n sourcemaps: [...sourcemaps],\n };\n}\n\nasync function traceCallsiteSourcemap(\n callsite: SheetCallsite,\n fetcher: typeof fetch | undefined,\n sourceMapCache: Map<string, Promise<SourceMapData | null>>,\n): Promise<{ callsite: SheetCallsite; sourceMapUrl: string; } | null> {\n if (!fetcher) return null;\n\n const generatedUrl = getFetchableGeneratedUrl(\n callsite.sourceUrl || callsite.filePath,\n );\n\n if (!generatedUrl) return null;\n\n let sourceMapPromise = sourceMapCache.get(generatedUrl);\n\n if (!sourceMapPromise) {\n sourceMapPromise = fetchSourceMap(getGeneratedUrlFetchCandidates(generatedUrl), fetcher);\n sourceMapCache.set(generatedUrl, sourceMapPromise);\n }\n\n const sourceMap = await sourceMapPromise;\n\n if (!sourceMap) return null;\n\n const original = originalPositionFor(sourceMap.map, {\n line: callsite.line,\n column: Math.max(callsite.column - 1, 0),\n });\n\n if (!original.source || original.line == null || original.column == null) {\n return null;\n }\n\n const sourceUrl = resolveOriginalSourceUrl(\n original.source,\n sourceMap.sourceBaseUrl,\n sourceMap.sourceRoot,\n );\n const sourceContent = getSourceContent(sourceMap, original.source, sourceUrl);\n const displaySourceUrl = getDisplaySourceUrl(sourceUrl);\n\n return {\n sourceMapUrl: sourceMap.url,\n callsite: {\n filePath: displaySourceUrl,\n sourceUrl: displaySourceUrl,\n sourceContent,\n line: original.line,\n column: original.column + 1,\n },\n };\n}\n\nfunction rewriteDevSourcemapTag(item: ReturnType<typeof getDevSourcemapTags>[number]) {\n const document = item.tag.ownerDocument;\n\n item.tag.textContent = '';\n\n for (let i = 0, len = item.rules.length; i < len; i++) {\n item.tag.appendChild(document.createTextNode(item.rules[i].css + '\\n'));\n }\n\n item.sourceMapNode = document.createTextNode('\\n' + createSourceMapComment(item.rules));\n item.tag.appendChild(item.sourceMapNode);\n}\n\nfunction createDisplayCallsite(callsite: SheetCallsite): SheetCallsite {\n const displaySourceUrl = getDisplaySourceUrl(callsite.sourceUrl || callsite.filePath);\n\n return {\n ...callsite,\n filePath: displaySourceUrl,\n sourceUrl: displaySourceUrl,\n };\n}\n\nfunction isDisplaySourceUrl(sourceUrl: string) {\n return sourceUrl.match(SOURCE_MAPPING_URL_REGEX);\n}\n\nasync function fetchSourceMap(\n generatedUrls: string[],\n fetcher: typeof fetch,\n): Promise<SourceMapData | null> {\n for (const generatedUrl of generatedUrls) {\n try {\n const response = await fetcher(generatedUrl);\n\n if (!response.ok) continue;\n\n const source = await response.text();\n const sourceMapUrl = findSourceMapUrl(source, generatedUrl);\n\n if (!sourceMapUrl) continue;\n\n const rawMap = await loadSourceMap(sourceMapUrl, fetcher);\n\n if (!rawMap) continue;\n\n const sourceBaseUrl = sourceMapUrl.startsWith('data:')\n ? normalizeGeneratedUrl(generatedUrl)\n : sourceMapUrl;\n\n return {\n url: sourceMapUrl,\n sourceBaseUrl,\n rawMap,\n map: new TraceMap(rawMap, sourceBaseUrl),\n sourceRoot: typeof rawMap.sourceRoot === 'string' ? rawMap.sourceRoot : undefined,\n };\n } catch {\n // Try the next generated URL variant.\n }\n }\n\n return null;\n}\n\nasync function loadSourceMap(sourceMapUrl: string, fetcher: typeof fetch) {\n try {\n if (sourceMapUrl.startsWith('data:')) {\n return parseDataUrlSourceMap(sourceMapUrl);\n }\n\n const response = await fetcher(sourceMapUrl);\n\n if (!response.ok) return null;\n\n return JSON.parse(await response.text()) as EncodedSourceMap;\n } catch {\n return null;\n }\n}\n\nfunction findSourceMapUrl(source: string, generatedUrl: string) {\n let match: RegExpExecArray | null = null;\n let sourceMapUrl: string | null = null;\n\n SOURCE_MAPPING_URL_REGEX.lastIndex = 0;\n\n while ((match = SOURCE_MAPPING_URL_REGEX.exec(source))) {\n sourceMapUrl = match[1];\n }\n\n if (!sourceMapUrl) return null;\n if (sourceMapUrl.startsWith('data:')) return sourceMapUrl;\n\n try {\n return new URL(sourceMapUrl, generatedUrl).href;\n } catch {\n return null;\n }\n}\n\nfunction parseDataUrlSourceMap(sourceMapUrl: string) {\n const commaIndex = sourceMapUrl.indexOf(',');\n\n if (commaIndex === -1) return null;\n\n const meta = sourceMapUrl.slice(0, commaIndex);\n const data = sourceMapUrl.slice(commaIndex + 1);\n const json = meta.endsWith(';base64') ? atob(data) : decodeURIComponent(data);\n\n return JSON.parse(json) as EncodedSourceMap;\n}\n\nfunction getFetchableGeneratedUrl(\n source: string,\n): string | null {\n source = normalizeCallsiteSourceUrl(source);\n\n if (source.startsWith('webpack://') || source.startsWith('node:')) {\n return null;\n }\n\n try {\n return new URL(source).href;\n } catch {\n // Continue with a browser-relative resolution below.\n }\n\n const base = getBrowserLocationHref();\n\n if (!base) return null;\n\n try {\n return new URL(source, base).href;\n } catch {\n return null;\n }\n}\n\nfunction getGeneratedUrlFetchCandidates(url: string) {\n const normalized = normalizeGeneratedUrl(url);\n\n return url === normalized ? [url] : [url, normalized];\n}\n\nfunction getDisplaySourceUrl(sourceUrl: string) {\n sourceUrl = normalizeCallsiteSourceUrl(sourceUrl);\n const normalized = normalizeGeneratedUrl(sourceUrl);\n\n try {\n const url = new URL(normalized);\n return 'source:///' + url.pathname.replace(/^\\/+/, '');\n } catch {\n return 'source:///' + normalized.replace(/^\\/+/, '');\n }\n}\n\nfunction getSourceContent(\n sourceMap: SourceMapData,\n originalSource: string,\n resolvedSourceUrl: string,\n) {\n const tracedContent = sourceContentFor(sourceMap.map, originalSource);\n\n if (tracedContent != null) return tracedContent;\n\n const rawSources = sourceMap.rawMap.sources;\n const rawSourcesContent = sourceMap.rawMap.sourcesContent;\n\n if (!rawSources || !rawSourcesContent) return undefined;\n\n const sourceKeys = getSourceMatchKeys(originalSource, resolvedSourceUrl);\n\n for (let i = 0, len = rawSources.length; i < len; i++) {\n const rawSource = rawSources[i];\n const rawContent = rawSourcesContent[i];\n\n if (typeof rawSource !== 'string') continue;\n if (typeof rawContent !== 'string') continue;\n\n const rawSourceUrl = resolveOriginalSourceUrl(\n rawSource,\n sourceMap.sourceBaseUrl,\n sourceMap.sourceRoot,\n );\n const rawKeys = getSourceMatchKeys(rawSource, rawSourceUrl);\n\n for (const key of rawKeys) {\n if (sourceKeys.has(key)) return rawContent;\n }\n }\n\n return undefined;\n}\n\nfunction getSourceMatchKeys(...sources: string[]) {\n const keys = new Set<string>();\n\n for (const source of sources) {\n if (!source) continue;\n\n keys.add(source);\n keys.add(normalizeGeneratedUrl(source));\n\n try {\n const url = new URL(source);\n keys.add(url.pathname);\n keys.add(normalizeGeneratedUrl(url.pathname));\n } catch {\n // Non-URL sources are still useful as exact keys.\n }\n }\n\n return keys;\n}\n\nfunction normalizeGeneratedUrl(source: string) {\n try {\n const url = new URL(source);\n\n url.search = '';\n url.hash = '';\n\n return url.href;\n } catch {\n const queryIndex = findFirstIndex(source, ['?', '#']);\n\n return queryIndex === -1 ? source : source.slice(0, queryIndex);\n }\n}\n\nfunction findFirstIndex(text: string, needles: string[]) {\n let index = -1;\n\n for (const needle of needles) {\n const next = text.indexOf(needle);\n if (next !== -1 && (index === -1 || next < index)) index = next;\n }\n\n return index;\n}\n\nfunction getBrowserLocationHref() {\n return getBrowserWindow()?.location.href;\n}\n\nfunction getBrowserWindow() {\n return typeof window === 'undefined' ? null : window;\n}\n\nfunction resolveOriginalSourceUrl(\n source: string,\n sourceMapUrl: string,\n sourceRoot?: string,\n) {\n if (isAbsoluteSource(source)) return source;\n\n try {\n if (sourceRoot && !isAbsoluteSource(sourceRoot)) {\n return new URL(sourceRoot.replace(/\\/?$/, '/') + source, sourceMapUrl).href;\n }\n\n if (sourceRoot) {\n return new URL(source, sourceRoot).href;\n }\n\n return new URL(source, sourceMapUrl).href;\n } catch {\n return sourceRoot ? sourceRoot.replace(/\\/?$/, '/') + source : source;\n }\n}\n\nfunction isAbsoluteSource(source: string) {\n return /^[a-zA-Z][a-zA-Z\\d+.-]*:/.test(source) || source.startsWith('/');\n}\n"],"mappings":";;;;AAsBA,MAAM,2BAA2B;AAEjC,eAAsB,qBAAoD;CACxE,MAAM,aAAa,oBAAoB,EAAE,QAAQ,SAC/C,KAAK,iBAAiB,KAAK,cAAc,eAAe,KAAK,GAC/D;CACA,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,UAAU,eAAe,OAAO,KAAK,aAAa;CACxD,MAAM,iCAAiB,IAAI,IAA2C;CACtE,MAAM,6BAAa,IAAI,IAAY;CACnC,IAAI,QAAQ;CACZ,IAAI,WAAW;CACf,IAAI,aAAa;CAEjB,KAAK,IAAI,IAAI,GAAG,MAAM,WAAW,QAAQ,IAAI,KAAK,KAAK;EACrD,MAAM,OAAO,WAAW;EACxB,IAAI,UAAU;EAEd,KAAK,I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