@fluentic/style 0.1.0-beta.17 → 0.1.0-beta.19
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 +18 -0
- package/atomic/utils/types.ts +4 -2
- package/compiler/compiler/cache_identity.ts +115 -0
- package/compiler/compiler/compiler.ts +21 -1
- package/compiler/compiler/persistent_cache.ts +310 -0
- package/compiler/compiler/types.ts +12 -0
- package/compiler/extract/collector.ts +2 -2
- package/compiler/transform/evaluator/metadata_cache.ts +124 -0
- package/compiler/transform/evaluator/tracer.ts +71 -63
- package/compiler/transform/extract/plugin.ts +2 -0
- package/compiler/utils/check_diagnostics.ts +18 -0
- package/compiler/utils/file_resolver.ts +24 -0
- package/dist/{combine-BpOQWCtM.js → combine-B5AnX0Gb.js} +2 -2
- package/dist/{combine-BpOQWCtM.js.map → combine-B5AnX0Gb.js.map} +1 -1
- package/dist/compiler/index.mjs +1 -1
- package/dist/{compiler-Cat8TmMk.mjs → compiler-Dpd41bCS.mjs} +552 -41
- package/dist/compiler-Dpd41bCS.mjs.map +1 -0
- package/dist/{config-B70LIQhi.js → config-VS1lyh3Z.js} +2 -2
- package/dist/{config-B70LIQhi.js.map → config-VS1lyh3Z.js.map} +1 -1
- package/dist/{css-C7tcD3IO.js → css-CMuUcsWb.js} +99 -21
- package/dist/css-CMuUcsWb.js.map +1 -0
- package/dist/{css-Cdxkur4h.js → css-ivddFxoH.js} +6 -6
- package/dist/{css-Cdxkur4h.js.map → css-ivddFxoH.js.map} +1 -1
- package/dist/{css-BkNqUfLD.js → css-tUcQKLko.js} +5 -5
- package/dist/{css-BkNqUfLD.js.map → css-tUcQKLko.js.map} +1 -1
- package/dist/css.js +1 -1
- package/dist/{css_extra-BC1Z_hDy.js → css_extra-FjU7uCIO.js} +2 -2
- package/dist/{css_extra-BC1Z_hDy.js.map → css_extra-FjU7uCIO.js.map} +1 -1
- package/dist/dev/rsc.js +5 -5
- package/dist/{dev-BoEgFs_x.js → dev-CZUGQ_Ps.js} +3 -3
- package/dist/{dev-BoEgFs_x.js.map → dev-CZUGQ_Ps.js.map} +1 -1
- package/dist/dev.js +1 -1
- package/dist/{elementMarker-nYeJnJPQ.js → elementMarker-BCL0sycL.js} +99 -21
- package/dist/elementMarker-BCL0sycL.js.map +1 -0
- package/dist/entry/dev/adapter/preact.js +1 -1
- package/dist/entry/dev/adapter/react.js +1 -1
- package/dist/entry/dev/adapter/solid.js +1 -1
- package/dist/entry/dev/css.js +1 -1
- package/dist/entry/dev/jsx-dev-runtime.js +1 -1
- package/dist/entry/dev/jsx-runtime.js +1 -1
- package/dist/entry/dev.js +5 -5
- package/dist/entry/prod/css.js +2 -2
- package/dist/entry/prod.js +2 -2
- package/dist/entry/rsc-dev/adapter/preact.js +1 -1
- package/dist/entry/rsc-dev/adapter/react.js +1 -1
- package/dist/entry/rsc-dev/adapter/solid.js +1 -1
- package/dist/entry/rsc-dev/css.js +3 -3
- package/dist/entry/rsc-dev/dev.js +4 -4
- package/dist/entry/rsc-dev/jsx-dev-runtime.js +3 -3
- package/dist/entry/rsc-dev/jsx-runtime.js +2 -2
- package/dist/entry/rsc-dev.js +6 -6
- package/dist/entry/rsc-dev.js.map +1 -1
- package/dist/entry/rsc-prod/css.js +2 -2
- package/dist/entry/rsc-prod.js +2 -2
- package/dist/{env-BcNl1tsJ.js → env-CljhzScj.js} +2 -2
- package/dist/{env-BcNl1tsJ.js.map → env-CljhzScj.js.map} +1 -1
- package/dist/{getClassName-B3azD1TO.js → getClassName-DKk03IJU.js} +3 -3
- package/dist/{getClassName-B3azD1TO.js.map → getClassName-DKk03IJU.js.map} +1 -1
- package/dist/{getClassName-CkTq92nR.js → getClassName-a1SH7I2q.js} +3 -3
- package/dist/{getClassName-CkTq92nR.js.map → getClassName-a1SH7I2q.js.map} +1 -1
- package/dist/{globalSheet-CdgVpvCb.js → globalSheet-CjX0Df0w.js} +3 -3
- package/dist/globalSheet-CjX0Df0w.js.map +1 -0
- package/dist/index.js +4 -4
- package/dist/jsx/jsx-dev-runtime.js +1 -1
- package/dist/jsx/jsx-dev-runtime.server.js +1 -1
- package/dist/jsx/jsx-runtime.js +1 -1
- package/dist/jsx/jsx-runtime.server.js +1 -1
- package/dist/{jsx-DA1LD8nU.js → jsx-Gs5YwesA.js} +3 -3
- package/dist/{jsx-DA1LD8nU.js.map → jsx-Gs5YwesA.js.map} +1 -1
- package/dist/{jsx_runtime-pt7DOZOE.js → jsx_runtime-D3Dc1XfC.js} +3 -3
- package/dist/{jsx_runtime-pt7DOZOE.js.map → jsx_runtime-D3Dc1XfC.js.map} +1 -1
- package/dist/{loader-Cvz2pKYV.mjs → loader-CR_NH6ub.mjs} +3 -3
- package/dist/{loader-Cvz2pKYV.mjs.map → loader-CR_NH6ub.mjs.map} +1 -1
- package/dist/{misc-BKaSZF14.mjs → misc-D5AjOWP-.mjs} +3 -3
- package/dist/misc-D5AjOWP-.mjs.map +1 -0
- package/dist/plugin/farm/index.mjs +4 -4
- package/dist/plugin/farm/index.mjs.map +1 -1
- package/dist/plugin/nextjs/index.mjs +5 -5
- package/dist/plugin/nextjs/index.mjs.map +1 -1
- package/dist/plugin/nextjs/loader.mjs +4 -4
- package/dist/plugin/parcel/index.cjs +1 -1
- package/dist/plugin/parcel/index.mjs +2 -2
- package/dist/plugin/parcel/optimizer.cjs +1 -1
- package/dist/plugin/parcel/optimizer.mjs +2 -2
- 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 +2 -2
- package/dist/plugin/vite/index.mjs +6 -6
- package/dist/plugin/vite/index.mjs.map +1 -1
- package/dist/plugin/webpack/index.mjs +2 -2
- package/dist/plugin/webpack/loader.mjs +2 -2
- package/dist/{registry-Bbxm5X90.mjs → registry-CdSHrX-o.mjs} +2 -2
- package/dist/{registry-Bbxm5X90.mjs.map → registry-CdSHrX-o.mjs.map} +1 -1
- package/dist/{resolveClassNameRuntime-B6vKNL5y.js → resolveClassNameRuntime-BBI9nYtq.js} +2 -2
- package/dist/{resolveClassNameRuntime-B6vKNL5y.js.map → resolveClassNameRuntime-BBI9nYtq.js.map} +1 -1
- package/dist/server.js +7 -7
- package/dist/{shared-L-63tURh.cjs → shared-CcB1KDFI.cjs} +557 -47
- package/dist/shared-CcB1KDFI.cjs.map +1 -0
- package/dist/{shared-BVciI9ew.mjs → shared-CobOEWzt.mjs} +5 -5
- package/dist/shared-CobOEWzt.mjs.map +1 -0
- package/dist/sheet-AV0Sl7e2.js +1 -0
- package/dist/sheet-Bf09AL2O.js +7 -0
- package/dist/{sheet-D_grHnaJ.js.map → sheet-Bf09AL2O.js.map} +1 -1
- package/dist/{sheet-C6ymGhKV.js → sheet-CcwxBK3r.js} +2 -2
- package/dist/{sheet-C6ymGhKV.js.map → sheet-CcwxBK3r.js.map} +1 -1
- package/dist/{sidecar-B7Q2P71F.mjs → sidecar-CHDVQqN_.mjs} +3 -3
- package/dist/{sidecar-B7Q2P71F.mjs.map → sidecar-CHDVQqN_.mjs.map} +1 -1
- package/dist/{style-CRs-vfY1.js → style-DY3v7k9y.js} +3 -3
- package/dist/style-DY3v7k9y.js.map +1 -0
- package/dist/{styleStore-D1IEmq1v.js → styleStore-BpkbvtBI.js} +99 -21
- package/dist/styleStore-BpkbvtBI.js.map +1 -0
- package/dist/{styleStore-HI4V2puu.js → styleStore-DWEAtd8z.js} +3 -3
- package/dist/{styleStore-HI4V2puu.js.map → styleStore-DWEAtd8z.js.map} +1 -1
- package/dist/{trace-DdFJPELS.js → trace-BxvaCfGx.js} +2 -2
- package/dist/{trace-DdFJPELS.js.map → trace-BxvaCfGx.js.map} +1 -1
- package/dist/{trace-uHVvnYiw.js → trace-Db5et6nx.js} +2 -2
- package/dist/{trace-uHVvnYiw.js.map → trace-Db5et6nx.js.map} +1 -1
- package/dist/transform-BZ4jPwy3.js.map +1 -1
- package/dist/types/atomic/utils/types.d.ts +3 -2
- package/dist/types/builder/utils.d.ts +1 -1
- package/dist/types/compiler/compiler/cache_identity.d.ts +4 -0
- package/dist/types/compiler/compiler/compiler.d.ts +12 -0
- package/dist/types/compiler/compiler/persistent_cache.d.ts +14 -0
- package/dist/types/compiler/compiler/types.d.ts +11 -0
- package/dist/types/compiler/extract/collector.d.ts +1 -1
- package/dist/types/compiler/transform/evaluator/metadata_cache.d.ts +13 -0
- package/dist/types/compiler/transform/evaluator/tracer.d.ts +6 -0
- package/dist/types/compiler/utils/check_diagnostics.d.ts +7 -0
- package/dist/types/compiler/utils/file_resolver.d.ts +4 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/plugin/bundler/vite/state.d.ts +24 -0
- package/dist/types/plugin/utils/compiler.d.ts +12 -1
- package/dist/types/style/tokens.d.ts +1 -1
- package/dist/types/style/transform.d.ts +4 -3
- package/dist/{utils-CB70kIh6.js → utils-B3O2b3Ly.js} +3 -3
- package/dist/{utils-CB70kIh6.js.map → utils-B3O2b3Ly.js.map} +1 -1
- package/dist/{utils-sG7IWYP6.js → utils-BeJmRz7x.js} +99 -21
- package/dist/utils-BeJmRz7x.js.map +1 -0
- package/dist/{utils-D2QdzQkX.mjs → utils-CICsXGqS.mjs} +5 -5
- package/dist/utils-CICsXGqS.mjs.map +1 -0
- package/dist/{utils-D3KR1ht8.mjs → utils-XfsnoteV.mjs} +3 -3
- package/dist/{utils-D3KR1ht8.mjs.map → utils-XfsnoteV.mjs.map} +1 -1
- package/dist/{webpack-DRegoWgj.mjs → webpack-BAflvDbq.mjs} +6 -6
- package/dist/webpack-BAflvDbq.mjs.map +1 -0
- package/index.ts +1 -0
- package/package.json +2 -2
- package/plugin/bundler/farm/plugin.ts +1 -1
- package/plugin/bundler/parcel/shared.ts +1 -1
- package/plugin/bundler/vite/state.ts +5 -6
- package/plugin/bundler/webpack/plugin.ts +1 -1
- package/plugin/nextjs/plugin.ts +1 -1
- package/plugin/nextjs/utils.ts +1 -1
- package/plugin/utils/compiler.ts +1 -2
- package/sheet/dev/dev_layer.ts +55 -11
- package/sheet/dev/dev_sort.ts +16 -9
- package/sheet/ordered.ts +43 -6
- package/style/tokens.ts +2 -1
- package/style/transform.ts +4 -3
- package/dist/compiler-Cat8TmMk.mjs.map +0 -1
- package/dist/css-C7tcD3IO.js.map +0 -1
- package/dist/elementMarker-nYeJnJPQ.js.map +0 -1
- package/dist/globalSheet-CdgVpvCb.js.map +0 -1
- package/dist/misc-BKaSZF14.mjs.map +0 -1
- package/dist/shared-BVciI9ew.mjs.map +0 -1
- package/dist/shared-L-63tURh.cjs.map +0 -1
- package/dist/sheet-Biw_rI4_.js +0 -1
- package/dist/sheet-D_grHnaJ.js +0 -7
- package/dist/style-CRs-vfY1.js.map +0 -1
- package/dist/styleStore-D1IEmq1v.js.map +0 -1
- package/dist/utils-D2QdzQkX.mjs.map +0 -1
- package/dist/utils-sG7IWYP6.js.map +0 -1
- package/dist/webpack-DRegoWgj.mjs.map +0 -1
|
@@ -662,11 +662,14 @@ function createOrderedSheet(create, options, dev) {
|
|
|
662
662
|
let header = null;
|
|
663
663
|
let serial = 0;
|
|
664
664
|
let dirty = false;
|
|
665
|
+
let orderingDirty = true;
|
|
666
|
+
let order = "";
|
|
665
667
|
let mode = DEV_CONFIG.stylePriorityMode;
|
|
666
668
|
const pending = /* @__PURE__ */ new Set();
|
|
667
669
|
const regular = getGroup("regular");
|
|
668
670
|
const refresh = () => {
|
|
669
671
|
dirty = true;
|
|
672
|
+
orderingDirty = true;
|
|
670
673
|
flush();
|
|
671
674
|
};
|
|
672
675
|
if (dev) refreshers.add(refresh);
|
|
@@ -678,6 +681,7 @@ function createOrderedSheet(create, options, dev) {
|
|
|
678
681
|
name,
|
|
679
682
|
tagName,
|
|
680
683
|
rules: [],
|
|
684
|
+
ordering: /* @__PURE__ */ new Map(),
|
|
681
685
|
sheet: create({
|
|
682
686
|
...options,
|
|
683
687
|
tagName
|
|
@@ -706,10 +710,32 @@ function createOrderedSheet(create, options, dev) {
|
|
|
706
710
|
const group = getGroup(sheetRuleGroup(item));
|
|
707
711
|
const previous = group.rules[group.rules.length - 1];
|
|
708
712
|
group.rules.push(item);
|
|
709
|
-
|
|
713
|
+
trackOrdering(group, item);
|
|
714
|
+
if (!dev && enabled && previous && compareSheetRules(previous, item) > 0) pending.add(group);
|
|
710
715
|
if (!pending.has(group)) group.sheet.insert(route(item));
|
|
711
716
|
dirty = true;
|
|
712
717
|
}
|
|
718
|
+
function trackOrdering(group, rule) {
|
|
719
|
+
const key = JSON.stringify([
|
|
720
|
+
rule.layer ?? "style",
|
|
721
|
+
rule.priority ?? [
|
|
722
|
+
0,
|
|
723
|
+
0,
|
|
724
|
+
0,
|
|
725
|
+
0,
|
|
726
|
+
0,
|
|
727
|
+
0,
|
|
728
|
+
0
|
|
729
|
+
],
|
|
730
|
+
!!rule.sheet,
|
|
731
|
+
!!rule.important,
|
|
732
|
+
!!rule.importantNative,
|
|
733
|
+
rule.globalSheet?.order
|
|
734
|
+
]);
|
|
735
|
+
if (group.ordering.has(key)) return;
|
|
736
|
+
group.ordering.set(key, rule);
|
|
737
|
+
orderingDirty = true;
|
|
738
|
+
}
|
|
713
739
|
function rebuild(group) {
|
|
714
740
|
pending.delete(group);
|
|
715
741
|
group.sheet.destroy?.();
|
|
@@ -719,6 +745,9 @@ function createOrderedSheet(create, options, dev) {
|
|
|
719
745
|
});
|
|
720
746
|
group.sheet.updateLayers(activeLayers ?? []);
|
|
721
747
|
group.rules.sort((a, b) => compareSheetRules(a, b));
|
|
748
|
+
group.ordering.clear();
|
|
749
|
+
orderingDirty = true;
|
|
750
|
+
for (const rule of group.rules) trackOrdering(group, rule);
|
|
722
751
|
for (const rule of group.rules) group.sheet.insert(route(rule));
|
|
723
752
|
group.sheet.flush();
|
|
724
753
|
dirty = true;
|
|
@@ -742,16 +771,22 @@ function createOrderedSheet(create, options, dev) {
|
|
|
742
771
|
if (dev && mode !== DEV_CONFIG.stylePriorityMode) {
|
|
743
772
|
mode = DEV_CONFIG.stylePriorityMode;
|
|
744
773
|
dirty = true;
|
|
774
|
+
orderingDirty = true;
|
|
745
775
|
}
|
|
746
776
|
for (const group of pending) rebuild(group);
|
|
747
777
|
pending.clear();
|
|
748
778
|
for (const group of groups.values()) group.sheet.flush();
|
|
749
779
|
if (!enabled || !dirty) return;
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
780
|
+
if (orderingDirty) {
|
|
781
|
+
const config = {
|
|
782
|
+
...CSS_CONFIG,
|
|
783
|
+
layers: activeLayers ? [...activeLayers] : void 0
|
|
784
|
+
};
|
|
785
|
+
const all = [];
|
|
786
|
+
for (const group of groups.values()) for (const rule of group.ordering.values()) all.push(rule);
|
|
787
|
+
order = sheetOrderingPreamble(all, config, dev ? DEV_CONFIG.stylePriorityMode : "layer");
|
|
788
|
+
orderingDirty = false;
|
|
789
|
+
}
|
|
755
790
|
const head = document.head || document.documentElement;
|
|
756
791
|
const groupTags = collectTags();
|
|
757
792
|
if (!header) {
|
|
@@ -784,6 +819,7 @@ function createOrderedSheet(create, options, dev) {
|
|
|
784
819
|
updateLayers(layers) {
|
|
785
820
|
if (activeLayers?.length === layers.length && layers.every((name, index) => activeLayers[index] === name)) return;
|
|
786
821
|
activeLayers = [...layers];
|
|
822
|
+
orderingDirty = true;
|
|
787
823
|
for (const group of groups.values()) group.sheet.updateLayers(layers);
|
|
788
824
|
dirty = true;
|
|
789
825
|
},
|
|
@@ -1199,8 +1235,8 @@ function createDevLayerSheet(options = {}) {
|
|
|
1199
1235
|
const queued = [];
|
|
1200
1236
|
let layerText = "";
|
|
1201
1237
|
let activeLayers = CSS_CONFIG.layers ?? CSS_CONFIG_DEFAULT.layers ?? [];
|
|
1202
|
-
|
|
1203
|
-
|
|
1238
|
+
const groups = [];
|
|
1239
|
+
const groupLookup = /* @__PURE__ */ new Map();
|
|
1204
1240
|
let hasSheetLayer = false;
|
|
1205
1241
|
const namedLayers = /* @__PURE__ */ new Set();
|
|
1206
1242
|
if (options.top) insertStyleTagAtTop(document, layerTag);
|
|
@@ -1233,12 +1269,13 @@ function createDevLayerSheet(options = {}) {
|
|
|
1233
1269
|
if (key) inserted.add(key);
|
|
1234
1270
|
queued.push({
|
|
1235
1271
|
css,
|
|
1236
|
-
rule: typeof rule === "string" ? null : rule
|
|
1272
|
+
rule: typeof rule === "string" ? null : rule,
|
|
1273
|
+
group: getGroup(typeof rule === "string" ? { css: rule } : rule)
|
|
1237
1274
|
});
|
|
1238
1275
|
},
|
|
1239
1276
|
flush() {
|
|
1240
1277
|
if (!queued.length) return;
|
|
1241
|
-
const touched =
|
|
1278
|
+
const touched = /* @__PURE__ */ new Set();
|
|
1242
1279
|
let fragment = null;
|
|
1243
1280
|
let fragmentTag = null;
|
|
1244
1281
|
const flushFragment = () => {
|
|
@@ -1250,15 +1287,32 @@ function createDevLayerSheet(options = {}) {
|
|
|
1250
1287
|
};
|
|
1251
1288
|
for (let i = 0, len = queued.length; i < len; i++) {
|
|
1252
1289
|
const item = queued[i];
|
|
1290
|
+
const group = item.group;
|
|
1291
|
+
let active = group.tags[group.tags.length - 1];
|
|
1253
1292
|
if (!active || active.count >= maxRules) {
|
|
1254
1293
|
flushFragment();
|
|
1255
|
-
|
|
1294
|
+
const index = groups.indexOf(group);
|
|
1295
|
+
let before;
|
|
1296
|
+
let previous = layerTag;
|
|
1297
|
+
for (let i = index + 1; i < groups.length; i++) if (groups[i].tags.length) {
|
|
1298
|
+
before = groups[i].tags[0].tag;
|
|
1299
|
+
break;
|
|
1300
|
+
}
|
|
1301
|
+
for (let i = index; i >= 0; i--) {
|
|
1302
|
+
const tags = groups[i].tags;
|
|
1303
|
+
if (tags.length) {
|
|
1304
|
+
previous = tags[tags.length - 1].tag;
|
|
1305
|
+
break;
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
active = createDevTag(document, previous, {
|
|
1309
|
+
before,
|
|
1256
1310
|
sourcemap,
|
|
1257
1311
|
nonce: options.nonce,
|
|
1258
1312
|
className: tagPrefix + "rules",
|
|
1259
1313
|
top: options.top
|
|
1260
1314
|
});
|
|
1261
|
-
|
|
1315
|
+
group.tags.push(active);
|
|
1262
1316
|
}
|
|
1263
1317
|
if (fragmentTag !== active) {
|
|
1264
1318
|
flushFragment();
|
|
@@ -1266,14 +1320,29 @@ function createDevLayerSheet(options = {}) {
|
|
|
1266
1320
|
fragment = document.createDocumentFragment();
|
|
1267
1321
|
}
|
|
1268
1322
|
insertDevRule(document, active, fragment, item.css, item.rule);
|
|
1269
|
-
|
|
1323
|
+
touched.add(active);
|
|
1270
1324
|
}
|
|
1271
1325
|
flushFragment();
|
|
1272
1326
|
queued.length = 0;
|
|
1273
1327
|
if (!sourcemap) return;
|
|
1274
|
-
for (
|
|
1328
|
+
for (const tag of touched) tag.updateSourceMap();
|
|
1275
1329
|
}
|
|
1276
1330
|
};
|
|
1331
|
+
function getGroup(rule) {
|
|
1332
|
+
const layer = rule.layer ?? "style";
|
|
1333
|
+
const key = (layer === false || layer === "style" && !isStyleLayerEnabled() ? 2 : layer === "style" || typeof layer === "object" && layer.name === getStyleLayerName() ? 0 : 1) + ":" + getSheetRulePriority(rule.priority).join(",");
|
|
1334
|
+
const cached = groupLookup.get(key);
|
|
1335
|
+
if (cached) return cached;
|
|
1336
|
+
const group = {
|
|
1337
|
+
rule,
|
|
1338
|
+
tags: []
|
|
1339
|
+
};
|
|
1340
|
+
const index = groups.findIndex((existing) => compareSheetRules(rule, existing.rule) < 0);
|
|
1341
|
+
if (index < 0) groups.push(group);
|
|
1342
|
+
else groups.splice(index, 0, group);
|
|
1343
|
+
groupLookup.set(key, group);
|
|
1344
|
+
return group;
|
|
1345
|
+
}
|
|
1277
1346
|
}
|
|
1278
1347
|
//#endregion
|
|
1279
1348
|
//#region sheet/dev/dev_sort.ts
|
|
@@ -1285,6 +1354,7 @@ function createDevSortSheet(options = {}) {
|
|
|
1285
1354
|
const inserted = /* @__PURE__ */ new Set();
|
|
1286
1355
|
const queued = [];
|
|
1287
1356
|
const groups = [];
|
|
1357
|
+
const groupLookup = /* @__PURE__ */ new Map();
|
|
1288
1358
|
const shouldLayer = isStyleLayerEnabled();
|
|
1289
1359
|
const layerName = getStyleLayerName();
|
|
1290
1360
|
const tagPrefix = options.tagName ? options.tagName + " " : "";
|
|
@@ -1324,7 +1394,7 @@ function createDevSortSheet(options = {}) {
|
|
|
1324
1394
|
},
|
|
1325
1395
|
flush() {
|
|
1326
1396
|
if (!queued.length) return;
|
|
1327
|
-
const touched =
|
|
1397
|
+
const touched = /* @__PURE__ */ new Set();
|
|
1328
1398
|
let fragment = null;
|
|
1329
1399
|
let fragmentTag = null;
|
|
1330
1400
|
const flushFragment = () => {
|
|
@@ -1337,7 +1407,7 @@ function createDevSortSheet(options = {}) {
|
|
|
1337
1407
|
queued.sort((a, b) => compareLayerPriority(a.priority, b.priority));
|
|
1338
1408
|
for (let i = 0, len = queued.length; i < len; i++) {
|
|
1339
1409
|
const item = queued[i];
|
|
1340
|
-
const group = ensureGroup(groups, item.priority, item.layer);
|
|
1410
|
+
const group = ensureGroup(groups, groupLookup, item.priority, item.layer);
|
|
1341
1411
|
let active = group.tags[group.tags.length - 1] ?? null;
|
|
1342
1412
|
if (!active || active.count >= maxRules) {
|
|
1343
1413
|
flushFragment();
|
|
@@ -1356,12 +1426,12 @@ function createDevSortSheet(options = {}) {
|
|
|
1356
1426
|
fragment = document.createDocumentFragment();
|
|
1357
1427
|
}
|
|
1358
1428
|
insertDevRule(document, active, fragment, item.css, item.rule);
|
|
1359
|
-
|
|
1429
|
+
touched.add(active);
|
|
1360
1430
|
}
|
|
1361
1431
|
flushFragment();
|
|
1362
1432
|
queued.length = 0;
|
|
1363
1433
|
if (!sourcemap) return;
|
|
1364
|
-
for (
|
|
1434
|
+
for (const tag of touched) tag.updateSourceMap();
|
|
1365
1435
|
}
|
|
1366
1436
|
};
|
|
1367
1437
|
function updateLayerText() {
|
|
@@ -1383,12 +1453,18 @@ function createDevSortSheet(options = {}) {
|
|
|
1383
1453
|
else insertStyleTagAfter(document, layerTag, null);
|
|
1384
1454
|
}
|
|
1385
1455
|
}
|
|
1386
|
-
function ensureGroup(groups, priority, layer) {
|
|
1456
|
+
function ensureGroup(groups, lookup, priority, layer) {
|
|
1387
1457
|
const key = (typeof layer === "object" ? "named-" + layer.name + "-" : layer === "sheet" ? "sheet-" : "") + getPriorityKey(priority);
|
|
1458
|
+
const lookupKey = JSON.stringify([layer, priority]);
|
|
1459
|
+
const cached = lookup.get(lookupKey);
|
|
1460
|
+
if (cached) return cached;
|
|
1388
1461
|
for (let i = 0, len = groups.length; i < len; i++) {
|
|
1389
1462
|
const group = groups[i];
|
|
1390
1463
|
const order = getLayerRank(layer) - getLayerRank(group.layer) || compareLayerPriority(priority, group.priority);
|
|
1391
|
-
if (order === 0 && key === group.key && layer === false === (group.layer === false))
|
|
1464
|
+
if (order === 0 && key === group.key && layer === false === (group.layer === false)) {
|
|
1465
|
+
lookup.set(lookupKey, group);
|
|
1466
|
+
return group;
|
|
1467
|
+
}
|
|
1392
1468
|
if (order < 0) {
|
|
1393
1469
|
const next = {
|
|
1394
1470
|
key,
|
|
@@ -1397,6 +1473,7 @@ function ensureGroup(groups, priority, layer) {
|
|
|
1397
1473
|
layer
|
|
1398
1474
|
};
|
|
1399
1475
|
groups.splice(i, 0, next);
|
|
1476
|
+
lookup.set(lookupKey, next);
|
|
1400
1477
|
return next;
|
|
1401
1478
|
}
|
|
1402
1479
|
}
|
|
@@ -1407,6 +1484,7 @@ function ensureGroup(groups, priority, layer) {
|
|
|
1407
1484
|
layer
|
|
1408
1485
|
};
|
|
1409
1486
|
groups.push(group);
|
|
1487
|
+
lookup.set(lookupKey, group);
|
|
1410
1488
|
return group;
|
|
1411
1489
|
}
|
|
1412
1490
|
function getLayerRank(layer) {
|
|
@@ -3357,4 +3435,4 @@ function getRscStyleStore() {
|
|
|
3357
3435
|
//#endregion
|
|
3358
3436
|
export { TOKEN_NAME as $, normalizePropertyName as $t, createCombinedStyleTokenWrapper as A, isElementMarkerRule as At, isCombinedStyle as B, getDebugFieldCallsite as Bt, resolveStylePropRuntime as C, getGlobalData as Cn, GLOBAL_SHEET_SELECTOR_ANCHOR as Ct, createCacheTreeNode as D, createElementMarkerRuleFromDebug as Dt, getCssVarRawFallback as E, createElementMarkerClassName as Et, finishTokenValues as F, refreshDevSourcemapTags as Ft, resetStyleTokenIdCounter as G, traceCallsite as Gt, createStyleToken as H, getTraceCallsiteId as Ht, mergeTokenOverrides as I, createSourceMapComment as It, getStyleTokenName as J, createNoopSheet as Jt, getChildStyleTokenName as K, traceError as Kt, mergeTokenValues as L, getSourcemapRuleCallsite as Lt, addTokenOverride as M, createStyleSheet as Mt, addTokenValues as N, refreshDevStyleTags as Nt, getCacheTreeChild as O, getElementMarkerClassNameFromRule as Ot, createMutableTokenValues as P, getDevSourcemapTags as Pt, TOKEN_ID as Q, normalizeDebugKeywordValue as Qt, getCombinedStyleScopes as R, getDebugCallsite as Rt, getCssPropertyName as S, clearGlobalData as Sn, BUILDER_TYPE as St, getTokenVar as T, symbol as Tn, clearElementMarkers as Tt, createStyleTokenOverride as U, isDebugData as Ut, TOKEN_DEBUG as V, getDebugFieldVarName as Vt, getStyleTokenOverrideDebug as W, normalizeCallsiteSourceUrl as Wt, isStyleTokenData as X, getIdentifierSafeHash as Xt, getStyleTokenVarName as Y, LayerDefaultLayers as Yt, isStyleTokenOverrideData as Z, createNameFormatter as Zt, getCssPropertyValue as _, isStyleLayerEnabled as _n, BUILDER_SCOPE_ID as _t, isServerRSC as a, getBuildDevConfig as an, getScopeTargetSlotId as at, getSelectorText as b, RUNTIME_CONFIG as bn, BUILDER_SLOT_ID as bt, GLOBAL_SEED_ATTR as c, hasOwn as cn, isScopeTargetData as ct, SEED_STYLE_TAG_HREF as d, DEBUG_CONFIG as dn, isSheetData as dt, sanitizeDebugPropertyName as en, TOKEN_OVERRIDE as et, collectStylePropItemsSheetRulesWithThemes as f, setBuildDebugClassName as fn, isSlotData as ft, createThemeClassName as g, isSheetLayerOption as gn, BUILDER_SCOPE as gt, insertRuntimeThemeRule as h, CSS_CONFIG_DEFAULT as hn, BUILDER_CALLSITE as ht, IS_SERVER_RUNTIME as i, DEV_CONFIG as in, getScopeTargetScope as it, getStyleTokenValues as j, splitElementMarkerStyleProp as jt, createCombinedStyleFacade as k, insertElementMarkerSheetRule as kt, PRECOLLECT_LINK_TAG_ATTR as l, set as ln, isSelectorData as lt, walkStylePropItemsSheetRules as m, CSS_CONFIG as mn, isStyleData as mt, getRscStyleRules as n, getRuntimeDocument as nn, getExtractedTokenBoundData as nt, ELEMENT_CSS_DATA_ATTR as o, setBuildDevConfig as on, getSelectorSelectors as ot, collectStylePropSheetRules as p, setBuildConfig as pn, isSlotOverrideData as pt, getStyleTokenId as q, traceMarker as qt, serializeRscRules as r, onRuntimeDocumentChange as rn, isExtractedTokenBoundData as rt, GLOBAL_RULES_ATTR as s, setDevUtilsRuntimeOptions as sn, isScopeData as st, addRscStyleRules as t, configureStyleRuntime as tn, TOKEN_VAR_NAME as tt, SEED_STYLE_TAG_ATTR as u, hashString as un, isSelectorOverrideData as ut, shouldAppendCssPx as v, LayerPlaceholder as vn, BUILDER_SELECTOR as vt, runtimeTokenValueResolver as w, globalData as wn, SHEET_SELECTOR_ANCHOR as wt, hasSheetSelectorAnchor as x, SIDECAR_URL_GLOBAL_SYMBOL as xn, BUILDER_STATE as xt, getSelectorHash as y, CHECK_CONFIG as yn, BUILDER_SHEET_OPTIONS as yt, getCombinedStyleStyles as z, getDebugCallsiteId as zt };
|
|
3359
3437
|
|
|
3360
|
-
//# sourceMappingURL=styleStore-
|
|
3438
|
+
//# sourceMappingURL=styleStore-BpkbvtBI.js.map
|