@barocss/browser 0.8.2 → 0.9.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/README.md +25 -0
- package/dist/cdn/barocss.js +1 -1
- package/dist/cdn/barocss.js.map +1 -1
- package/dist/cdn/barocss.umd.cjs +1 -1
- package/dist/cdn/barocss.umd.cjs.map +1 -1
- package/dist/index.cjs +8 -2
- package/dist/index.d.cts +33 -4
- package/dist/index.d.ts +33 -4
- package/dist/index.es.js +272 -31
- package/dist/index.umd.js +8 -2
- package/package.json +2 -2
package/dist/index.es.js
CHANGED
|
@@ -198,12 +198,12 @@ var d = class {
|
|
|
198
198
|
}), t?.scan && this.scanExistingClasses(e, t), this.observer);
|
|
199
199
|
}
|
|
200
200
|
scanExistingClasses(e, t) {
|
|
201
|
-
let n = /* @__PURE__ */ new Set();
|
|
202
|
-
|
|
201
|
+
let n = /* @__PURE__ */ new Set(), r = e.className;
|
|
202
|
+
r && u(r).forEach((e) => {
|
|
203
203
|
this.incrementalParser.isProcessed(e) || n.add(e);
|
|
204
204
|
});
|
|
205
|
-
let
|
|
206
|
-
for (let e of
|
|
205
|
+
let i = e.querySelectorAll("[class]");
|
|
206
|
+
for (let e of i) if (e.className) {
|
|
207
207
|
let t = u(e.className);
|
|
208
208
|
for (let e of t) this.incrementalParser.isProcessed(e) || n.add(e);
|
|
209
209
|
}
|
|
@@ -265,7 +265,7 @@ var _ = class {
|
|
|
265
265
|
this.host = e, this.graceMs = t, this.maxRules = n, this.now = r, this.counts = /* @__PURE__ */ new Map(), this.counted = /* @__PURE__ */ new WeakMap(), this.candidates = /* @__PURE__ */ new Map(), this.timer = null, this.root = null;
|
|
266
266
|
}
|
|
267
267
|
setRoot(e) {
|
|
268
|
-
this.counts.clear(), this.counted = /* @__PURE__ */ new WeakMap(), this.candidates.clear(), this.cancel(), this.root = e, this.reconcileTree(e);
|
|
268
|
+
this.counts.clear(), this.counted = /* @__PURE__ */ new WeakMap(), this.candidates.clear(), this.cancel(), this.root = e, e.nodeType === 1 ? this.reconcileTree(e) : e.querySelectorAll("[class]").forEach((e) => this.reconcile(e));
|
|
269
269
|
}
|
|
270
270
|
count(e) {
|
|
271
271
|
return this.counts.get(e) ?? 0;
|
|
@@ -314,6 +314,7 @@ var _ = class {
|
|
|
314
314
|
inDom(e) {
|
|
315
315
|
let t = this.root;
|
|
316
316
|
if (!t) return !1;
|
|
317
|
+
if (t.nodeType !== 1) return Array.from(t.querySelectorAll("[class]")).some((t) => t.classList.contains(e));
|
|
317
318
|
let n = t.ownerDocument ?? document;
|
|
318
319
|
return t.classList.contains(e) || n.documentElement.classList.contains(e) || n.getElementsByClassName(e).length > 0;
|
|
319
320
|
}
|
|
@@ -326,9 +327,224 @@ var _ = class {
|
|
|
326
327
|
candidates: this.candidates.size
|
|
327
328
|
};
|
|
328
329
|
}
|
|
329
|
-
}
|
|
330
|
+
};
|
|
331
|
+
//#endregion
|
|
332
|
+
//#region src/shadow-root-sheet.ts
|
|
333
|
+
function v(e) {
|
|
334
|
+
let t = [], n = e.replace(/\/\*[\s\S]*?\*\//g, "");
|
|
335
|
+
return n = n.replace(/(?<=^|[{};])(\s*)([^{};@\s][^{};]*?)\{([^{}]*)\}/g, (e, n, r, i) => {
|
|
336
|
+
let a = r.split(",").map((e) => e.trim()).filter(Boolean);
|
|
337
|
+
if (a.includes("body")) for (let e of i.split(";").map((e) => e.trim()).filter(Boolean)) /^(min-height|scroll-behavior)\s*:/.test(e) || t.push(e);
|
|
338
|
+
let o = Array.from(new Set(a.filter((e) => e !== "body").map((e) => e === "html" || e === ":root" ? ":host" : e)));
|
|
339
|
+
return o.length === 0 ? "" : `${n}${o.join(", ")} {${i}}`;
|
|
340
|
+
}), t.length && (n += `\n@layer base {\n:host {\n ${t.join(";\n ")};\n}\n}\n`), n;
|
|
341
|
+
}
|
|
342
|
+
function y(e) {
|
|
343
|
+
return JSON.stringify(e, (e, t) => typeof t == "function" ? `fn:${String(t)}` : t instanceof RegExp ? `re:${t}` : t) ?? "";
|
|
344
|
+
}
|
|
345
|
+
function b(e) {
|
|
346
|
+
let t = 2166136261;
|
|
347
|
+
for (let n = 0; n < e.length; n++) t ^= e.charCodeAt(n), t = Math.imul(t, 16777619);
|
|
348
|
+
return (t >>> 0).toString(36);
|
|
349
|
+
}
|
|
350
|
+
function x() {
|
|
351
|
+
try {
|
|
352
|
+
return typeof ShadowRoot < "u" && "adoptedStyleSheets" in ShadowRoot.prototype && typeof CSSStyleSheet == "function" && typeof new CSSStyleSheet().replaceSync == "function";
|
|
353
|
+
} catch {
|
|
354
|
+
return !1;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
var S = (e) => e.replace(/\\\//g, "\\/"), C = class {
|
|
358
|
+
constructor(e, t, n = e) {
|
|
359
|
+
this.results = /* @__PURE__ */ new Map(), this.generations = 0, this.prologueSheet = null, this.rulesSheet = null, this.prologue = {
|
|
360
|
+
preflight: "",
|
|
361
|
+
vars: ""
|
|
362
|
+
}, this.segments = /* @__PURE__ */ new Map([["root", {
|
|
363
|
+
rules: [],
|
|
364
|
+
keys: []
|
|
365
|
+
}], ["", {
|
|
366
|
+
rules: [],
|
|
367
|
+
keys: []
|
|
368
|
+
}]]), this.refs = /* @__PURE__ */ new Map(), this.attached = [], this.key = e, this.fullKey = n, this.context = r(t), this.constructable = x(), this.constructable && (this.prologueSheet = new CSSStyleSheet(), this.rulesSheet = new CSSStyleSheet());
|
|
369
|
+
}
|
|
370
|
+
get rootCount() {
|
|
371
|
+
return this.attached.length;
|
|
372
|
+
}
|
|
373
|
+
get ruleCount() {
|
|
374
|
+
return this.refs.size;
|
|
375
|
+
}
|
|
376
|
+
attach(e) {
|
|
377
|
+
if (this.attached.some((t) => t.root === e)) return;
|
|
378
|
+
if (this.prologueSheet && this.rulesSheet) {
|
|
379
|
+
let t = [this.prologueSheet, this.rulesSheet];
|
|
380
|
+
e.adoptedStyleSheets = [...e.adoptedStyleSheets.filter((e) => !t.includes(e)), ...t], this.attached.push({ root: e });
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
let t = e.ownerDocument ?? document, n = t.createElement("style"), r = t.createElement("style");
|
|
384
|
+
n.setAttribute("data-barocss", "root-prologue"), r.setAttribute("data-barocss", "root"), n.textContent = this.prologueText(), r.textContent = this.allRules().join("\n"), e.insertBefore(r, e.firstChild), e.insertBefore(n, r), this.attached.push({
|
|
385
|
+
root: e,
|
|
386
|
+
styles: [n, r]
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
detach(e) {
|
|
390
|
+
let t = this.attached.findIndex((t) => t.root === e);
|
|
391
|
+
if (t === -1) return;
|
|
392
|
+
let [n] = this.attached.splice(t, 1);
|
|
393
|
+
n.styles ? n.styles.forEach((e) => e.remove()) : e.adoptedStyleSheets &&= e.adoptedStyleSheets.filter((e) => e !== this.prologueSheet && e !== this.rulesSheet);
|
|
394
|
+
}
|
|
395
|
+
setPrologue(e, t) {
|
|
396
|
+
if (this.prologue[e] === t) return;
|
|
397
|
+
this.prologue[e] = t;
|
|
398
|
+
let n = this.prologueText();
|
|
399
|
+
this.prologueSheet && this.prologueSheet.replaceSync(n);
|
|
400
|
+
for (let e of this.attached) e.styles && (e.styles[0].textContent = n);
|
|
401
|
+
}
|
|
402
|
+
prologueText() {
|
|
403
|
+
return [this.prologue.preflight, this.prologue.vars].filter(Boolean).join("\n");
|
|
404
|
+
}
|
|
405
|
+
allRules() {
|
|
406
|
+
return Array.from(this.segments.values()).flatMap((e) => e.rules);
|
|
407
|
+
}
|
|
408
|
+
offset(e) {
|
|
409
|
+
let t = 0;
|
|
410
|
+
for (let n of this.segments.values()) {
|
|
411
|
+
if (n === e) return t;
|
|
412
|
+
t += n.rules.length;
|
|
413
|
+
}
|
|
414
|
+
return t;
|
|
415
|
+
}
|
|
416
|
+
retain(e, t) {
|
|
417
|
+
let n = this.refs.get(e);
|
|
418
|
+
if (n !== void 0) return this.refs.set(e, n + 1), !0;
|
|
419
|
+
let r = this.segments.get(t);
|
|
420
|
+
r || (r = {
|
|
421
|
+
rules: [],
|
|
422
|
+
keys: []
|
|
423
|
+
}, this.segments.set(t, r));
|
|
424
|
+
let a = t === "root", c = o(e), l = a ? r.rules.length : s(r.keys, c), u = this.offset(r) + l;
|
|
425
|
+
try {
|
|
426
|
+
this.insertAt(e, u);
|
|
427
|
+
} catch (t) {
|
|
428
|
+
return i() && console.warn(`[BrowserRuntime] Failed to insert rule into shadow root sheet: ${e}`, t), !1;
|
|
429
|
+
}
|
|
430
|
+
return r.rules.splice(l, 0, e), r.keys.splice(l, 0, c), this.refs.set(e, 1), !0;
|
|
431
|
+
}
|
|
432
|
+
release(e) {
|
|
433
|
+
let t = this.refs.get(e);
|
|
434
|
+
if (t !== void 0) {
|
|
435
|
+
if (t > 1) {
|
|
436
|
+
this.refs.set(e, t - 1);
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
this.refs.delete(e);
|
|
440
|
+
for (let t of this.segments.values()) {
|
|
441
|
+
let n = t.rules.indexOf(e);
|
|
442
|
+
if (n === -1) continue;
|
|
443
|
+
let r = this.offset(t) + n;
|
|
444
|
+
t.rules.splice(n, 1), t.keys.splice(n, 1), this.deleteAt(r);
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
insertAt(e, t) {
|
|
450
|
+
let n = S(e);
|
|
451
|
+
if (this.rulesSheet) {
|
|
452
|
+
this.rulesSheet.insertRule(n, t);
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
let r = this.allRules().length;
|
|
456
|
+
for (let i of this.attached) {
|
|
457
|
+
let a = i.styles[1], o = a.sheet;
|
|
458
|
+
if (o && o.cssRules.length === r) o.insertRule(n, t);
|
|
459
|
+
else {
|
|
460
|
+
let n = this.allRules();
|
|
461
|
+
n.splice(t, 0, e), a.textContent = n.join("\n");
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
deleteAt(e) {
|
|
466
|
+
if (this.rulesSheet) {
|
|
467
|
+
this.rulesSheet.deleteRule(e);
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
let t = this.allRules().length;
|
|
471
|
+
for (let n of this.attached) {
|
|
472
|
+
let r = n.styles[1], i = r.sheet;
|
|
473
|
+
i && i.cssRules.length === t + 1 ? i.deleteRule(e) : r.textContent = this.allRules().join("\n");
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
cssText() {
|
|
477
|
+
return [this.prologueText(), ...this.allRules()].join("\n");
|
|
478
|
+
}
|
|
479
|
+
}, w = /* @__PURE__ */ new Map();
|
|
480
|
+
function T(e, t = b) {
|
|
481
|
+
let n = y(e), r = w.get(n);
|
|
482
|
+
return r || (r = new C(t(n), e, n), w.set(n, r)), r;
|
|
483
|
+
}
|
|
484
|
+
function E(e) {
|
|
485
|
+
e.rootCount === 0 && w.get(e.fullKey) === e && w.delete(e.fullKey);
|
|
486
|
+
}
|
|
487
|
+
var D = class extends e {
|
|
488
|
+
constructor(e) {
|
|
489
|
+
super(e.context), this.shared = e;
|
|
490
|
+
}
|
|
491
|
+
processClass(e) {
|
|
492
|
+
if (this.isProcessed(e)) return null;
|
|
493
|
+
let t = this.shared.results.get(e);
|
|
494
|
+
if (t) return this.markProcessed(e), t;
|
|
495
|
+
let n = super.processClass(e);
|
|
496
|
+
return n && (this.shared.results.set(e, n), this.shared.generations++), n;
|
|
497
|
+
}
|
|
498
|
+
}, O = class {
|
|
499
|
+
constructor(e, t, n = (e) => a(e).utility?.category) {
|
|
500
|
+
this.shared = e, this.root = t, this.getCategory = n, this.owned = /* @__PURE__ */ new Set(), e.attach(t);
|
|
501
|
+
}
|
|
502
|
+
hasDetachedPartitions() {
|
|
503
|
+
return !1;
|
|
504
|
+
}
|
|
505
|
+
updateRuleContent(e, t) {
|
|
506
|
+
e === "preflight" ? this.shared.setPrologue("preflight", v(t)) : e === "css-vars" && this.shared.setPrologue("vars", t);
|
|
507
|
+
}
|
|
508
|
+
take(e, t) {
|
|
509
|
+
return this.owned.has(e) || !this.shared.retain(e, t) ? !1 : (this.owned.add(e), !0);
|
|
510
|
+
}
|
|
511
|
+
addRule(e) {
|
|
512
|
+
return this.take(e, "");
|
|
513
|
+
}
|
|
514
|
+
addCategoryRule(e, t) {
|
|
515
|
+
return this.take(e, `c:${t}`);
|
|
516
|
+
}
|
|
517
|
+
addRootRules(e) {
|
|
518
|
+
let t = 0;
|
|
519
|
+
for (let n of e) this.take(n, "root") && t++;
|
|
520
|
+
return {
|
|
521
|
+
success: t,
|
|
522
|
+
failed: e.length - t
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
addRules(e) {
|
|
526
|
+
let t = 0, n = 0;
|
|
527
|
+
for (let r of e) {
|
|
528
|
+
let e = this.getCategory(r.cls);
|
|
529
|
+
for (let i of r.cssList) (e ? this.addCategoryRule(i, e) : this.addRule(i)) ? t++ : n++;
|
|
530
|
+
}
|
|
531
|
+
return {
|
|
532
|
+
success: t,
|
|
533
|
+
failed: n
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
removeRule(e, t) {
|
|
537
|
+
return this.owned.delete(e) ? (this.shared.release(e), !0) : !1;
|
|
538
|
+
}
|
|
539
|
+
get ruleCount() {
|
|
540
|
+
return this.owned.size;
|
|
541
|
+
}
|
|
542
|
+
cleanup() {
|
|
543
|
+
this.owned.forEach((e) => this.shared.release(e)), this.owned.clear(), this.shared.detach(this.root), E(this.shared);
|
|
544
|
+
}
|
|
545
|
+
}, k = "style[data-barocss-ssr]", A = "@layer theme, base, components, utilities;", j = class {
|
|
330
546
|
constructor(t = {}) {
|
|
331
|
-
this.cache = /* @__PURE__ */ new Map(), this.rootCache = /* @__PURE__ */ new Set(), this.isDestroyed = !1, this.existing = null, this.existingKeyframes = /* @__PURE__ */ new Set(), this.existingSheetCount = -1, this.pinned = /* @__PURE__ */ new Set(), this.gc = null, this.reclaimedCount = 0, this.ssrRules = [], this.ssrClasses = /* @__PURE__ */ new Set(), this.observedOnce = !1, this.getCategory = (e) => a(e, this.context).utility?.category;
|
|
547
|
+
this.cache = /* @__PURE__ */ new Map(), this.rootCache = /* @__PURE__ */ new Set(), this.shadowRoot = null, this.isDestroyed = !1, this.existing = null, this.existingKeyframes = /* @__PURE__ */ new Set(), this.existingSheetCount = -1, this.pinned = /* @__PURE__ */ new Set(), this.gc = null, this.reclaimedCount = 0, this.ssrRules = [], this.ssrClasses = /* @__PURE__ */ new Set(), this.observedOnce = !1, this.getCategory = (e) => a(e, this.context).utility?.category;
|
|
332
548
|
let n = {};
|
|
333
549
|
this.options = {
|
|
334
550
|
config: t.config || n,
|
|
@@ -339,11 +555,24 @@ var _ = class {
|
|
|
339
555
|
gc: t.gc ?? !0,
|
|
340
556
|
gcGraceMs: t.gcGraceMs ?? 3e3,
|
|
341
557
|
maxRules: t.maxRules ?? Infinity
|
|
342
|
-
}
|
|
558
|
+
};
|
|
559
|
+
let i = t.root;
|
|
560
|
+
if (i && i.nodeType === 11 && (this.shadowRoot = i), this.shadowRoot) {
|
|
561
|
+
let e = T(this.options.config);
|
|
562
|
+
this.context = e.context, this.incrementalParser = new D(e);
|
|
563
|
+
} else this.context = r(this.options.config), this.incrementalParser = new e(this.context);
|
|
564
|
+
this.changeDetector = new d(this.incrementalParser, this, this.getCategory), this.stylePartitionManager = this.createStyles(), this.options.gc && (this.gc = new _({
|
|
343
565
|
reclaim: (e) => this.reclaim(e),
|
|
344
566
|
isPermanent: (e) => this.isPermanent(e),
|
|
345
567
|
cachedCount: () => this.cache.size
|
|
346
|
-
}, this.options.gcGraceMs, this.options.maxRules), this.changeDetector.setGc(this.gc)), this.init();
|
|
568
|
+
}, this.options.gcGraceMs, this.options.maxRules), this.changeDetector.setGc(this.gc)), this.init(), this.shadowRoot && this.observe(this.shadowRoot, { scan: !0 });
|
|
569
|
+
}
|
|
570
|
+
createStyles() {
|
|
571
|
+
if (this.shadowRoot) {
|
|
572
|
+
let e = this.incrementalParser.shared, t = T(this.options.config);
|
|
573
|
+
return t !== e && (e = t, this.context = e.context, this.incrementalParser = new D(e), this.changeDetector?.setParser(this.incrementalParser)), new O(e, this.shadowRoot, this.getCategory);
|
|
574
|
+
}
|
|
575
|
+
return new c(this.getInsertionPoint(), this.options.maxRulesPerPartition, `${this.options.styleId}-partition`, this.getCategory);
|
|
347
576
|
}
|
|
348
577
|
debugLog(e, t, n) {
|
|
349
578
|
i() && (console[e] || console.log)(`[BrowserRuntime:${e.toUpperCase()}] ${t}`, n || "");
|
|
@@ -352,10 +581,10 @@ var _ = class {
|
|
|
352
581
|
this.debugLog("debug", "init"), this.injectPreflightCSS(), this.ensureCssVars(), this.adoptSsrSheets();
|
|
353
582
|
}
|
|
354
583
|
adoptSsrSheets() {
|
|
355
|
-
if (typeof document > "u") return;
|
|
584
|
+
if (typeof document > "u" || this.shadowRoot) return;
|
|
356
585
|
let e = [];
|
|
357
586
|
if (document.head) {
|
|
358
|
-
for (let t of Array.from(document.head.querySelectorAll(`${
|
|
587
|
+
for (let t of Array.from(document.head.querySelectorAll(`${k}:not([data-barocss-adopted])`))) {
|
|
359
588
|
let n = t.sheet;
|
|
360
589
|
if (!n) continue;
|
|
361
590
|
t.setAttribute("data-barocss-adopted", "");
|
|
@@ -382,7 +611,7 @@ var _ = class {
|
|
|
382
611
|
let e = this.options.config.preflight ?? !0;
|
|
383
612
|
if (e) {
|
|
384
613
|
let t = this.context.getPreflightCSS(e);
|
|
385
|
-
this.stylePartitionManager.updateRuleContent("preflight", `${
|
|
614
|
+
this.stylePartitionManager.updateRuleContent("preflight", `${A}\n@layer base {\n${t}\n}`, !0);
|
|
386
615
|
}
|
|
387
616
|
}
|
|
388
617
|
ensureCssVars() {
|
|
@@ -414,7 +643,7 @@ var _ = class {
|
|
|
414
643
|
}
|
|
415
644
|
applyParseResults(e, t) {
|
|
416
645
|
if (this.isDestroyed) return;
|
|
417
|
-
if (this.getInsertionPoint().isConnected && this.stylePartitionManager.hasDetachedPartitions()) {
|
|
646
|
+
if (!this.shadowRoot && this.getInsertionPoint().isConnected && this.stylePartitionManager.hasDetachedPartitions()) {
|
|
418
647
|
let t = Array.from(this.cache.values());
|
|
419
648
|
this.reset(), e = [...t, ...e], e.forEach((e) => this.incrementalParser.markProcessed(e.cls));
|
|
420
649
|
}
|
|
@@ -437,7 +666,7 @@ var _ = class {
|
|
|
437
666
|
});
|
|
438
667
|
}
|
|
439
668
|
isPermanent(e) {
|
|
440
|
-
return this.pinned.has(e) || this.ssrClasses.has(e)
|
|
669
|
+
return this.pinned.has(e) || this.ssrClasses.has(e) ? !0 : this.shadowRoot ? !1 : typeof document > "u" || this.getExistingClasses().has(e);
|
|
441
670
|
}
|
|
442
671
|
reclaim(e) {
|
|
443
672
|
if (this.isDestroyed) return;
|
|
@@ -474,7 +703,7 @@ var _ = class {
|
|
|
474
703
|
}
|
|
475
704
|
return this.existingKeyframes = r, this.existing = n, this.existingSheetCount = t.length, n;
|
|
476
705
|
}
|
|
477
|
-
observe(e = document.body, t) {
|
|
706
|
+
observe(e = this.shadowRoot ?? document.body, t) {
|
|
478
707
|
return this.observedOnce || (this.observedOnce = !0, this.adoptSsrSheets()), this.changeDetector.observe(e, t);
|
|
479
708
|
}
|
|
480
709
|
normalizeClasses(e) {
|
|
@@ -507,15 +736,20 @@ var _ = class {
|
|
|
507
736
|
};
|
|
508
737
|
}
|
|
509
738
|
clearCaches() {
|
|
510
|
-
this.isDestroyed || (this.cache.clear(), this.rootCache.clear(), t(this.context), this.incrementalParser.clearProcessed(), this.stylePartitionManager.cleanup(), this.stylePartitionManager =
|
|
739
|
+
this.isDestroyed || (this.cache.clear(), this.rootCache.clear(), t(this.context), this.incrementalParser.clearProcessed(), this.stylePartitionManager.cleanup(), this.stylePartitionManager = this.createStyles(), this.injectPreflightCSS(), this.ensureCssVars(), this.insertSsrRules(this.ssrRules));
|
|
511
740
|
}
|
|
512
741
|
reset() {
|
|
513
|
-
this.isDestroyed || (this.cache.clear(), this.rootCache.clear(), this.incrementalParser.clearProcessed(), this.stylePartitionManager.cleanup(), this.stylePartitionManager =
|
|
742
|
+
this.isDestroyed || (this.cache.clear(), this.rootCache.clear(), this.incrementalParser.clearProcessed(), this.stylePartitionManager.cleanup(), this.stylePartitionManager = this.createStyles(), this.injectPreflightCSS(), this.ensureCssVars(), this.insertSsrRules(this.ssrRules));
|
|
514
743
|
}
|
|
515
744
|
updateConfig(t) {
|
|
516
745
|
if (this.isDestroyed) return;
|
|
517
746
|
let n = Array.from(this.cache.keys());
|
|
518
|
-
this.options.config = t, this.
|
|
747
|
+
if (this.options.config = t, this.shadowRoot) {
|
|
748
|
+
this.stylePartitionManager.cleanup();
|
|
749
|
+
let e = T(t);
|
|
750
|
+
this.context = e.context, this.incrementalParser = new D(e);
|
|
751
|
+
} else this.context = r(t), this.incrementalParser = new e(this.context);
|
|
752
|
+
this.changeDetector.setParser(this.incrementalParser), this.reset(), n.length > 0 && this.addClass(n);
|
|
519
753
|
}
|
|
520
754
|
removeClass(e) {
|
|
521
755
|
if (this.isDestroyed) return;
|
|
@@ -531,16 +765,23 @@ var _ = class {
|
|
|
531
765
|
styleElementId: this.options.styleId,
|
|
532
766
|
isDestroyed: this.isDestroyed,
|
|
533
767
|
config: this.options.config,
|
|
534
|
-
cacheStats: this.getCacheStats()
|
|
768
|
+
cacheStats: this.getCacheStats(),
|
|
769
|
+
sharedSheet: this.shadowRoot && this.stylePartitionManager instanceof O ? {
|
|
770
|
+
roots: this.stylePartitionManager.shared.rootCount,
|
|
771
|
+
rules: this.stylePartitionManager.shared.ruleCount,
|
|
772
|
+
generations: this.stylePartitionManager.shared.generations,
|
|
773
|
+
constructable: this.stylePartitionManager.shared.constructable
|
|
774
|
+
} : null
|
|
535
775
|
};
|
|
536
776
|
}
|
|
537
|
-
},
|
|
538
|
-
function
|
|
539
|
-
return !
|
|
777
|
+
}, M = null, N;
|
|
778
|
+
function P(e = {}) {
|
|
779
|
+
return !M || M.getStats().isDestroyed ? (M = new j(e), N = e.config) : e.config && e.config !== N && (M.updateConfig(e.config), N = e.config), M;
|
|
540
780
|
}
|
|
541
|
-
function
|
|
781
|
+
function F({ loadingClassName: e = "baro-boot", ...t } = {}) {
|
|
782
|
+
if (t.root && t.root.nodeType === 11) return new j(t);
|
|
542
783
|
if (!document.body) {
|
|
543
|
-
document.addEventListener("DOMContentLoaded", () =>
|
|
784
|
+
document.addEventListener("DOMContentLoaded", () => F({
|
|
544
785
|
loadingClassName: e,
|
|
545
786
|
...t
|
|
546
787
|
}), { once: !0 });
|
|
@@ -548,7 +789,7 @@ function w({ loadingClassName: e = "baro-boot", ...t } = {}) {
|
|
|
548
789
|
}
|
|
549
790
|
let n = `${e}-doing`, r = `${e}-done`;
|
|
550
791
|
try {
|
|
551
|
-
document.body.classList.add(n),
|
|
792
|
+
document.body.classList.add(n), P(t).observe(document.body, {
|
|
552
793
|
scan: !0,
|
|
553
794
|
onReady: () => {
|
|
554
795
|
document.body.classList.remove(n), document.body.classList.add(r);
|
|
@@ -558,10 +799,10 @@ function w({ loadingClassName: e = "baro-boot", ...t } = {}) {
|
|
|
558
799
|
document.body?.classList.remove(n), console.error("BaroCSS boot failed:", e);
|
|
559
800
|
}
|
|
560
801
|
}
|
|
561
|
-
var
|
|
802
|
+
var I = F;
|
|
562
803
|
//#endregion
|
|
563
804
|
//#region src/json-render-preload.ts
|
|
564
|
-
function
|
|
805
|
+
function L(e) {
|
|
565
806
|
if (!e || typeof e != "object" || Array.isArray(e)) return [];
|
|
566
807
|
let t = e.elements;
|
|
567
808
|
if (!t || typeof t != "object" || Array.isArray(t)) return [];
|
|
@@ -576,11 +817,11 @@ function E(e) {
|
|
|
576
817
|
}
|
|
577
818
|
return Array.from(n);
|
|
578
819
|
}
|
|
579
|
-
function
|
|
580
|
-
let n =
|
|
820
|
+
function R(e, t) {
|
|
821
|
+
let n = L(e);
|
|
581
822
|
n.length > 0 && t.addClass(n);
|
|
582
823
|
}
|
|
583
|
-
var
|
|
824
|
+
var z = {
|
|
584
825
|
colors: Object.fromEntries((/* @__PURE__ */ "background.foreground.card.card-foreground.popover.popover-foreground.primary.primary-foreground.secondary.secondary-foreground.muted.muted-foreground.accent.accent-foreground.destructive.border.input.ring.chart-1.chart-2.chart-3.chart-4.chart-5.sidebar.sidebar-foreground.sidebar-primary.sidebar-primary-foreground.sidebar-accent.sidebar-accent-foreground.sidebar-border.sidebar-ring".split(".")).map((e) => [e, `var(--${e})`])),
|
|
585
826
|
borderRadius: {
|
|
586
827
|
sm: "calc(var(--radius) - 4px)",
|
|
@@ -590,4 +831,4 @@ var O = {
|
|
|
590
831
|
}
|
|
591
832
|
};
|
|
592
833
|
//#endregion
|
|
593
|
-
export {
|
|
834
|
+
export { j as BrowserRuntime, d as ChangeDetector, A as LAYER_ORDER, k as SSR_STYLE_SELECTOR, c as StylePartitionManager, F as baroBoot, I as baroStart, L as collectJsonRenderClassNames, P as getRuntime, l as normalizeClassName, u as normalizeClassNameList, R as preloadJsonRenderClasses, z as shadcnTheme };
|
package/dist/index.umd.js
CHANGED
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
`}catch(n){return(0,t.isDebug)()&&console.warn(`[StylePartitionManager] Failed to insert rule in category: root ${e.join(`
|
|
5
5
|
`)}`,n),{success:0,failed:e.length}}return{success:e.length,failed:0}}addRules(e){let t=0,n=0;for(let r of e){let e=this.getCategory(r.cls);if(e)for(let t of r.cssList)this.addCategoryRule(t,e);else for(let e of r.cssList)this.addRule(e)?t++:n++}return{success:t,failed:n}}removeRule(e,t){let n;if(t){if(this.classToCategoryPartitionMap.get(e)!==t)return!1;n=this.categoryPartitions.get(t)}else{let t=this.classToPartitionMap.get(e);n=t===void 0?void 0:this.partitions[t]}if(!n)return!1;let r=n.styles.indexOf(e);if(r===-1)return!1;let i=n.styleElement.sheet,a=!!i&&i.cssRules.length===n.styles.length;return n.styles.splice(r,1),n.keys?.splice(r,1),a&&i?i.deleteRule(r):n.styleElement.textContent=n.styles.length?n.styles.join(`
|
|
6
6
|
`)+`
|
|
7
|
-
`:``,t?this.classToCategoryPartitionMap.delete(e):this.classToPartitionMap.delete(e),!0}get ruleCount(){return this.classToPartitionMap.size+this.classToCategoryPartitionMap.size}findRulePartition(e){let t=this.classToPartitionMap.get(e);if(t!==void 0&&this.partitions[t])return this.partitions[t];let n=this.classToCategoryPartitionMap.get(e);return n===void 0?null:this.categoryPartitions.get(n)||null}updateRuleContent(e,n,r=!1){let i=this.getCategoryPartition(e);if(i)i.styleElement.textContent=n;else{let i=this.createNewCategoryPartition(e,r);(0,t.isDebug)()&&console.log(`[StylePartitionManager] Created new partition for category: ${e}`),i.styleElement.textContent=n}}cleanup(){this.partitions.forEach(e=>{e.styleElement.parentNode&&e.styleElement.parentNode.removeChild(e.styleElement)}),this.categoryPartitions.forEach(e=>{e.styleElement.parentNode&&e.styleElement.parentNode.removeChild(e.styleElement)}),this.partitions=[],this.categoryPartitions.clear(),this.partitionCounter=0,this.classToPartitionMap.clear(),this.classToCategoryPartitionMap.clear()}};function r(e){return e?typeof e==`object`&&typeof e.baseVal==`string`?e.baseVal:e.toString():``}function i(e){return e?r(e).split(/\s+/).filter(Boolean):[]}var a=class{constructor(e,n,r=e=>(0,t.parseClassName)(e).utility?.category){this.observer=null,this.gc=null,this.incrementalParser=e,this.BrowserRuntime=n,this.getCategory=r}setGc(e){this.gc=e}setParser(e){this.incrementalParser=e}observe(e=document.body,t){return typeof window>`u`?new MutationObserver(()=>{}):(this.observer&&this.observer.disconnect(),this.gc?.setRoot(e),this.observer=new MutationObserver(t=>{let n=new Set,r=this.gc;if(t.forEach(t=>{if(r&&(t.type===`attributes`?r.reconcile(t.target):t.type===`childList`&&(t.removedNodes.forEach(e=>r.reconcileTree(e)),t.addedNodes.forEach(e=>r.reconcileTree(e)))),t.type===`attributes`&&t.attributeName===`class`&&e.contains(t.target)){let e=t.target;e.className&&i(e.className).forEach(e=>{this.incrementalParser.isProcessed(e)||n.add(e)})}t.type===`childList`&&t.addedNodes.forEach(t=>{if(t.nodeType===Node.ELEMENT_NODE&&e.contains(t)){let e=t;this.processElement(e,n),e.querySelectorAll(`[class]`).forEach(e=>{this.processElement(e,n)})}})}),n.size>0){let e=Array.from(n),t=this.incrementalParser.processClasses(e);this.BrowserRuntime?.applyParseResults(t)}else this.BrowserRuntime?.applyParseResults([]);r?.afterBatch()}),this.observer.observe(e,{attributes:!0,subtree:!0,attributeFilter:[`class`],childList:!0}),t?.scan&&this.scanExistingClasses(e,t),this.observer)}scanExistingClasses(e,t){let n=new Set;e.className&&i(e.className).forEach(e=>{this.incrementalParser.isProcessed(e)||n.add(e)});let r=e.querySelectorAll(`[class]`);for(let e of r)if(e.className){let t=i(e.className);for(let e of t)this.incrementalParser.isProcessed(e)||n.add(e)}if(n.size>0){let e=Array.from(n),r=this.incrementalParser.processClasses(e),i=r.filter(e=>this.getCategory(e.cls)===`layout`),a=r.filter(e=>this.getCategory(e.cls)!==`layout`);this.BrowserRuntime?.applyParseResults(i),t?.onReady?.(),this.BrowserRuntime?.applyParseResults(a)}else t?.onReady?.()}processElement(e,t){e.className&&i(e.className).forEach(e=>{this.incrementalParser.isProcessed(e)||t.add(e)})}disconnect(){this.observer&&=(this.observer.disconnect(),null)}};function o(e){return e.replace(/\\([0-9a-fA-F]{1,6})\s?|\\(.)/g,(e,t,n)=>t?String.fromCodePoint(parseInt(t,16)):n)}var s=/^\s*(?::(?:where|is)\(\s*)?\.((?:\\[0-9a-fA-F]{1,6}\s?|\\.|[\w-]|[^\x00-\x7F])+)/;function c(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`\\`?i++:a===`(`||a===`[`?n++:a===`)`||a===`]`?n--:a===`,`&&n===0&&(t.push(e.slice(r,i)),r=i+1)}return t.push(e.slice(r)),t}function l(e,t=new Set){for(let n of Array.from(e)){if(n.type===7&&typeof n.name==`string`){t.add(n.name);continue}let e=n.cssRules;e&&e.length&&l(e,t)}return t}function u(e,t=new Set){for(let n of Array.from(e)){let e=n.selectorText;if(typeof e==`string`)for(let n of c(e)){let e=s.exec(n);e&&t.add(o(e[1]))}let r=n.cssRules;r&&r.length&&u(r,t)}return t}var d=class{constructor(e,t,n,r=()=>Date.now()){this.host=e,this.graceMs=t,this.maxRules=n,this.now=r,this.counts=new Map,this.counted=new WeakMap,this.candidates=new Map,this.timer=null,this.root=null}setRoot(e){this.counts.clear(),this.counted=new WeakMap,this.candidates.clear(),this.cancel(),this.root=e,this.reconcileTree(e)}count(e){return this.counts.get(e)??0}reconcileTree(e){if(e.nodeType!==1)return;let t=e;this.reconcile(t),t.querySelectorAll(`[class]`).forEach(e=>this.reconcile(e))}reconcile(e){let t=this.root,n=t&&t.contains(e)?Array.from(new Set(i(e.getAttribute(`class`)))):[],r=this.counted.get(e);if(!r&&n.length===0)return;let a=new Set(r??[]),o=new Set(n);for(let e of o){if(a.has(e))continue;let t=(this.counts.get(e)??0)+1;this.counts.set(e,t),this.candidates.delete(e)}for(let e of a){if(o.has(e))continue;let t=(this.counts.get(e)??0)-1;t>0?this.counts.set(e,t):(this.counts.delete(e),this.candidates.delete(e),this.candidates.set(e,this.now()))}n.length?this.counted.set(e,n):this.counted.delete(e)}afterBatch(){this.candidates.size!==0&&(this.host.cachedCount()>this.maxRules?this.schedule(0):this.schedule(this.graceMs))}schedule(e){if(this.timer!==null){if(e>0)return;clearTimeout(this.timer)}this.timer=setTimeout(()=>{this.timer=null,this.sweep()},e)}sweep(){let e=this.now(),t=Math.max(0,this.host.cachedCount()-this.maxRules),n=[],r=0;for(let[i,a]of this.candidates){let o=e-a>=this.graceMs;!o&&r>=t||(this.candidates.delete(i),!(this.count(i)>0||this.inDom(i)||this.host.isPermanent(i))&&(n.push(i),o||r++))}n.length&&this.host.reclaim(n),this.candidates.size&&this.schedule(this.graceMs)}inDom(e){let t=this.root;if(!t)return!1;let n=t.ownerDocument??document;return t.classList.contains(e)||n.documentElement.classList.contains(e)||n.getElementsByClassName(e).length>0}cancel(){this.timer!==null&&clearTimeout(this.timer),this.timer=null}stats(){return{trackedClasses:this.counts.size,candidates:this.candidates.size}}},f=`style[data-barocss-ssr]`,p=`@layer theme, base, components, utilities;`,m=class{constructor(e={}){this.cache=new Map,this.rootCache=new Set,this.isDestroyed=!1,this.existing=null,this.existingKeyframes=new Set,this.existingSheetCount=-1,this.pinned=new Set,this.gc=null,this.reclaimedCount=0,this.ssrRules=[],this.ssrClasses=new Set,this.observedOnce=!1,this.getCategory=e=>(0,t.parseClassName)(e,this.context).utility?.category;let r={};this.options={config:e.config||r,styleId:e.styleId||`barocss-runtime`,insertionPoint:e.insertionPoint||`head`,maxRulesPerPartition:e.maxRulesPerPartition||50,skipExisting:e.skipExisting??!1,gc:e.gc??!0,gcGraceMs:e.gcGraceMs??3e3,maxRules:e.maxRules??1/0},this.context=(0,t.createContext)(this.options.config),this.incrementalParser=new t.IncrementalParser(this.context),this.changeDetector=new a(this.incrementalParser,this,this.getCategory),this.stylePartitionManager=new n(this.getInsertionPoint(),this.options.maxRulesPerPartition,`${this.options.styleId}-partition`,this.getCategory),this.options.gc&&(this.gc=new d({reclaim:e=>this.reclaim(e),isPermanent:e=>this.isPermanent(e),cachedCount:()=>this.cache.size},this.options.gcGraceMs,this.options.maxRules),this.changeDetector.setGc(this.gc)),this.init()}debugLog(e,n,r){(0,t.isDebug)()&&(console[e]||console.log)(`[BrowserRuntime:${e.toUpperCase()}] ${n}`,r||``)}init(){this.debugLog(`debug`,`init`),this.injectPreflightCSS(),this.ensureCssVars(),this.adoptSsrSheets()}adoptSsrSheets(){if(typeof document>`u`)return;let e=[];if(document.head){for(let t of Array.from(document.head.querySelectorAll(`${f}:not([data-barocss-adopted])`))){let n=t.sheet;if(!n)continue;t.setAttribute(`data-barocss-adopted`,``);let r=[];for(let e=n.cssRules.length-1;e>=0;e--){let t=n.cssRules[e],i=u([t]);i.size!==0&&(i.forEach(e=>this.ssrClasses.add(e)),r.unshift({css:t.cssText,cls:i.values().next().value}),n.deleteRule(e))}e.push(...r)}e.length!==0&&(this.ssrRules.push(...e),this.insertSsrRules(e))}}insertSsrRules(e){for(let{css:t,cls:n}of e){let e=this.getCategory(n);e?this.stylePartitionManager.addCategoryRule(t,e):this.stylePartitionManager.addRule(t)}}injectPreflightCSS(){let e=this.options.config.preflight??!0;if(e){let t=this.context.getPreflightCSS(e);this.stylePartitionManager.updateRuleContent(`preflight`,`${p}\n@layer base {\n${t}\n}`,!0)}}ensureCssVars(){if(this.isDestroyed)return;let e=this.context.themeToCssVars?this.context.themeToCssVars():`:root { /* CSS Variables will be generated here */ }`;this.stylePartitionManager.updateRuleContent(`css-vars`,e)}getInsertionPoint(){if(typeof this.options.insertionPoint!=`string`)return this.options.insertionPoint;switch(this.options.insertionPoint){case`body`:return document.body||document.head;default:return document.head}}addClass(e){if(this.isDestroyed)return;let t=this.normalizeClasses(e).filter(Boolean);t.forEach(e=>this.pinned.add(e)),this.processClasses(t)}processClasses(e){this.processClassesIncremental(e)}processClassesIncremental(e){let t=typeof window<`u`,n=this.incrementalParser.processClasses(e);this.debugLog(`debug`,`results`,{results:n,classList:e}),this.applyParseResults(n,{isBrowser:t})}applyParseResults(e,t){if(this.isDestroyed)return;if(this.getInsertionPoint().isConnected&&this.stylePartitionManager.hasDetachedPartitions()){let t=Array.from(this.cache.values());this.reset(),e=[...t,...e],e.forEach(e=>this.incrementalParser.markProcessed(e.cls))}if(this.ssrClasses.size>0&&(e=e.filter(e=>!this.ssrClasses.has(e.cls))),this.options.skipExisting&&e.length>0&&typeof document<`u`){let t=this.getExistingClasses();e=e.filter(e=>!t.has(e.cls))}if(e.length===0)return;let n=[],r=[],i=this.options.skipExisting&&typeof document<`u`?(this.getExistingClasses(),this.existingKeyframes):null;for(let t of e)if(t.css&&Array.isArray(t.cssList)&&(n.push(t),this.cache.set(t.cls,t)),t.rootCss&&Array.isArray(t.rootCssList))for(let e of t.rootCssList){if(i?.size){let t=/^\s*@keyframes\s+([^\s{]+)/.exec(e)?.[1];if(t&&i.has(t))continue}this.rootCache.has(e)||(this.rootCache.add(e),r.push(e))}r.length>0&&this.stylePartitionManager.addRootRules(r.filter(Boolean)),n.length>0&&this.stylePartitionManager.addRules(n),this.debugLog(`info`,`Applied ${e.length} parser results`,{cssRuleCount:n.length,rootCssCount:r.length})}isPermanent(e){return this.pinned.has(e)||this.ssrClasses.has(e)||typeof document>`u`?!0:this.getExistingClasses().has(e)}reclaim(e){if(this.isDestroyed)return;let t=e.filter(e=>this.cache.has(e));if(t.length===0)return;let n=t.map(e=>this.cache.get(e));t.forEach(e=>{this.cache.delete(e),this.incrementalParser.unmarkProcessed(e)});let r=new Set;for(let e of this.cache.values())e.cssList.forEach(e=>r.add(e));for(let e of n){let t=this.getCategory(e.cls);for(let n of e.cssList)r.has(n)||this.stylePartitionManager.removeRule(n,t)}this.reclaimedCount+=t.length}getExistingClasses(){let e=new Set(Array.from(document.querySelectorAll(`style[data-barocss]`),e=>e.sheet)),t=Array.from(document.styleSheets).filter(t=>{if(e.has(t))return!1;let n=t.ownerNode;return!(n&&typeof n.hasAttribute==`function`&&(n.hasAttribute(`data-barocss`)||(n.id||``).startsWith(this.options.styleId)))});if(this.existing&&t.length===this.existingSheetCount)return this.existing;let n=new Set,r=new Set;for(let e of t){let t;try{t=e.cssRules}catch{continue}u(t,n),l(t,r)}return this.existingKeyframes=r,this.existing=n,this.existingSheetCount=t.length,n}observe(e=document.body,t){return this.observedOnce||(this.observedOnce=!0,this.adoptSsrSheets()),this.changeDetector.observe(e,t)}normalizeClasses(e){return Array.isArray(e)?e.flatMap(e=>e.split(/\s+/)):e.split(/\s+/)}has(e){return this.cache.has(e)}getCss(e){return this.cache.get(e)?.cssList.join(`
|
|
7
|
+
`:``,t?this.classToCategoryPartitionMap.delete(e):this.classToPartitionMap.delete(e),!0}get ruleCount(){return this.classToPartitionMap.size+this.classToCategoryPartitionMap.size}findRulePartition(e){let t=this.classToPartitionMap.get(e);if(t!==void 0&&this.partitions[t])return this.partitions[t];let n=this.classToCategoryPartitionMap.get(e);return n===void 0?null:this.categoryPartitions.get(n)||null}updateRuleContent(e,n,r=!1){let i=this.getCategoryPartition(e);if(i)i.styleElement.textContent=n;else{let i=this.createNewCategoryPartition(e,r);(0,t.isDebug)()&&console.log(`[StylePartitionManager] Created new partition for category: ${e}`),i.styleElement.textContent=n}}cleanup(){this.partitions.forEach(e=>{e.styleElement.parentNode&&e.styleElement.parentNode.removeChild(e.styleElement)}),this.categoryPartitions.forEach(e=>{e.styleElement.parentNode&&e.styleElement.parentNode.removeChild(e.styleElement)}),this.partitions=[],this.categoryPartitions.clear(),this.partitionCounter=0,this.classToPartitionMap.clear(),this.classToCategoryPartitionMap.clear()}};function r(e){return e?typeof e==`object`&&typeof e.baseVal==`string`?e.baseVal:e.toString():``}function i(e){return e?r(e).split(/\s+/).filter(Boolean):[]}var a=class{constructor(e,n,r=e=>(0,t.parseClassName)(e).utility?.category){this.observer=null,this.gc=null,this.incrementalParser=e,this.BrowserRuntime=n,this.getCategory=r}setGc(e){this.gc=e}setParser(e){this.incrementalParser=e}observe(e=document.body,t){return typeof window>`u`?new MutationObserver(()=>{}):(this.observer&&this.observer.disconnect(),this.gc?.setRoot(e),this.observer=new MutationObserver(t=>{let n=new Set,r=this.gc;if(t.forEach(t=>{if(r&&(t.type===`attributes`?r.reconcile(t.target):t.type===`childList`&&(t.removedNodes.forEach(e=>r.reconcileTree(e)),t.addedNodes.forEach(e=>r.reconcileTree(e)))),t.type===`attributes`&&t.attributeName===`class`&&e.contains(t.target)){let e=t.target;e.className&&i(e.className).forEach(e=>{this.incrementalParser.isProcessed(e)||n.add(e)})}t.type===`childList`&&t.addedNodes.forEach(t=>{if(t.nodeType===Node.ELEMENT_NODE&&e.contains(t)){let e=t;this.processElement(e,n),e.querySelectorAll(`[class]`).forEach(e=>{this.processElement(e,n)})}})}),n.size>0){let e=Array.from(n),t=this.incrementalParser.processClasses(e);this.BrowserRuntime?.applyParseResults(t)}else this.BrowserRuntime?.applyParseResults([]);r?.afterBatch()}),this.observer.observe(e,{attributes:!0,subtree:!0,attributeFilter:[`class`],childList:!0}),t?.scan&&this.scanExistingClasses(e,t),this.observer)}scanExistingClasses(e,t){let n=new Set,r=e.className;r&&i(r).forEach(e=>{this.incrementalParser.isProcessed(e)||n.add(e)});let a=e.querySelectorAll(`[class]`);for(let e of a)if(e.className){let t=i(e.className);for(let e of t)this.incrementalParser.isProcessed(e)||n.add(e)}if(n.size>0){let e=Array.from(n),r=this.incrementalParser.processClasses(e),i=r.filter(e=>this.getCategory(e.cls)===`layout`),a=r.filter(e=>this.getCategory(e.cls)!==`layout`);this.BrowserRuntime?.applyParseResults(i),t?.onReady?.(),this.BrowserRuntime?.applyParseResults(a)}else t?.onReady?.()}processElement(e,t){e.className&&i(e.className).forEach(e=>{this.incrementalParser.isProcessed(e)||t.add(e)})}disconnect(){this.observer&&=(this.observer.disconnect(),null)}};function o(e){return e.replace(/\\([0-9a-fA-F]{1,6})\s?|\\(.)/g,(e,t,n)=>t?String.fromCodePoint(parseInt(t,16)):n)}var s=/^\s*(?::(?:where|is)\(\s*)?\.((?:\\[0-9a-fA-F]{1,6}\s?|\\.|[\w-]|[^\x00-\x7F])+)/;function c(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`\\`?i++:a===`(`||a===`[`?n++:a===`)`||a===`]`?n--:a===`,`&&n===0&&(t.push(e.slice(r,i)),r=i+1)}return t.push(e.slice(r)),t}function l(e,t=new Set){for(let n of Array.from(e)){if(n.type===7&&typeof n.name==`string`){t.add(n.name);continue}let e=n.cssRules;e&&e.length&&l(e,t)}return t}function u(e,t=new Set){for(let n of Array.from(e)){let e=n.selectorText;if(typeof e==`string`)for(let n of c(e)){let e=s.exec(n);e&&t.add(o(e[1]))}let r=n.cssRules;r&&r.length&&u(r,t)}return t}var d=class{constructor(e,t,n,r=()=>Date.now()){this.host=e,this.graceMs=t,this.maxRules=n,this.now=r,this.counts=new Map,this.counted=new WeakMap,this.candidates=new Map,this.timer=null,this.root=null}setRoot(e){this.counts.clear(),this.counted=new WeakMap,this.candidates.clear(),this.cancel(),this.root=e,e.nodeType===1?this.reconcileTree(e):e.querySelectorAll(`[class]`).forEach(e=>this.reconcile(e))}count(e){return this.counts.get(e)??0}reconcileTree(e){if(e.nodeType!==1)return;let t=e;this.reconcile(t),t.querySelectorAll(`[class]`).forEach(e=>this.reconcile(e))}reconcile(e){let t=this.root,n=t&&t.contains(e)?Array.from(new Set(i(e.getAttribute(`class`)))):[],r=this.counted.get(e);if(!r&&n.length===0)return;let a=new Set(r??[]),o=new Set(n);for(let e of o){if(a.has(e))continue;let t=(this.counts.get(e)??0)+1;this.counts.set(e,t),this.candidates.delete(e)}for(let e of a){if(o.has(e))continue;let t=(this.counts.get(e)??0)-1;t>0?this.counts.set(e,t):(this.counts.delete(e),this.candidates.delete(e),this.candidates.set(e,this.now()))}n.length?this.counted.set(e,n):this.counted.delete(e)}afterBatch(){this.candidates.size!==0&&(this.host.cachedCount()>this.maxRules?this.schedule(0):this.schedule(this.graceMs))}schedule(e){if(this.timer!==null){if(e>0)return;clearTimeout(this.timer)}this.timer=setTimeout(()=>{this.timer=null,this.sweep()},e)}sweep(){let e=this.now(),t=Math.max(0,this.host.cachedCount()-this.maxRules),n=[],r=0;for(let[i,a]of this.candidates){let o=e-a>=this.graceMs;!o&&r>=t||(this.candidates.delete(i),!(this.count(i)>0||this.inDom(i)||this.host.isPermanent(i))&&(n.push(i),o||r++))}n.length&&this.host.reclaim(n),this.candidates.size&&this.schedule(this.graceMs)}inDom(e){let t=this.root;if(!t)return!1;if(t.nodeType!==1)return Array.from(t.querySelectorAll(`[class]`)).some(t=>t.classList.contains(e));let n=t.ownerDocument??document;return t.classList.contains(e)||n.documentElement.classList.contains(e)||n.getElementsByClassName(e).length>0}cancel(){this.timer!==null&&clearTimeout(this.timer),this.timer=null}stats(){return{trackedClasses:this.counts.size,candidates:this.candidates.size}}};function f(e){let t=[],n=e.replace(/\/\*[\s\S]*?\*\//g,``);return n=n.replace(/(?<=^|[{};])(\s*)([^{};@\s][^{};]*?)\{([^{}]*)\}/g,(e,n,r,i)=>{let a=r.split(`,`).map(e=>e.trim()).filter(Boolean);if(a.includes(`body`))for(let e of i.split(`;`).map(e=>e.trim()).filter(Boolean))/^(min-height|scroll-behavior)\s*:/.test(e)||t.push(e);let o=Array.from(new Set(a.filter(e=>e!==`body`).map(e=>e===`html`||e===`:root`?`:host`:e)));return o.length===0?``:`${n}${o.join(`, `)} {${i}}`}),t.length&&(n+=`\n@layer base {\n:host {\n ${t.join(`;
|
|
8
|
+
`)};\n}\n}\n`),n}function p(e){return JSON.stringify(e,(e,t)=>typeof t==`function`?`fn:${String(t)}`:t instanceof RegExp?`re:${t}`:t)??``}function m(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function h(){try{return typeof ShadowRoot<`u`&&`adoptedStyleSheets`in ShadowRoot.prototype&&typeof CSSStyleSheet==`function`&&typeof new CSSStyleSheet().replaceSync==`function`}catch{return!1}}var g=e=>e.replace(/\\\//g,`\\/`),_=class{constructor(e,n,r=e){this.results=new Map,this.generations=0,this.prologueSheet=null,this.rulesSheet=null,this.prologue={preflight:``,vars:``},this.segments=new Map([[`root`,{rules:[],keys:[]}],[``,{rules:[],keys:[]}]]),this.refs=new Map,this.attached=[],this.key=e,this.fullKey=r,this.context=(0,t.createContext)(n),this.constructable=h(),this.constructable&&(this.prologueSheet=new CSSStyleSheet,this.rulesSheet=new CSSStyleSheet)}get rootCount(){return this.attached.length}get ruleCount(){return this.refs.size}attach(e){if(this.attached.some(t=>t.root===e))return;if(this.prologueSheet&&this.rulesSheet){let t=[this.prologueSheet,this.rulesSheet];e.adoptedStyleSheets=[...e.adoptedStyleSheets.filter(e=>!t.includes(e)),...t],this.attached.push({root:e});return}let t=e.ownerDocument??document,n=t.createElement(`style`),r=t.createElement(`style`);n.setAttribute(`data-barocss`,`root-prologue`),r.setAttribute(`data-barocss`,`root`),n.textContent=this.prologueText(),r.textContent=this.allRules().join(`
|
|
9
|
+
`),e.insertBefore(r,e.firstChild),e.insertBefore(n,r),this.attached.push({root:e,styles:[n,r]})}detach(e){let t=this.attached.findIndex(t=>t.root===e);if(t===-1)return;let[n]=this.attached.splice(t,1);n.styles?n.styles.forEach(e=>e.remove()):e.adoptedStyleSheets&&=e.adoptedStyleSheets.filter(e=>e!==this.prologueSheet&&e!==this.rulesSheet)}setPrologue(e,t){if(this.prologue[e]===t)return;this.prologue[e]=t;let n=this.prologueText();this.prologueSheet&&this.prologueSheet.replaceSync(n);for(let e of this.attached)e.styles&&(e.styles[0].textContent=n)}prologueText(){return[this.prologue.preflight,this.prologue.vars].filter(Boolean).join(`
|
|
10
|
+
`)}allRules(){return Array.from(this.segments.values()).flatMap(e=>e.rules)}offset(e){let t=0;for(let n of this.segments.values()){if(n===e)return t;t+=n.rules.length}return t}retain(e,n){let r=this.refs.get(e);if(r!==void 0)return this.refs.set(e,r+1),!0;let i=this.segments.get(n);i||(i={rules:[],keys:[]},this.segments.set(n,i));let a=n===`root`,o=(0,t.ruleSortKey)(e),s=a?i.rules.length:(0,t.upperBound)(i.keys,o),c=this.offset(i)+s;try{this.insertAt(e,c)}catch(n){return(0,t.isDebug)()&&console.warn(`[BrowserRuntime] Failed to insert rule into shadow root sheet: ${e}`,n),!1}return i.rules.splice(s,0,e),i.keys.splice(s,0,o),this.refs.set(e,1),!0}release(e){let t=this.refs.get(e);if(t!==void 0){if(t>1){this.refs.set(e,t-1);return}this.refs.delete(e);for(let t of this.segments.values()){let n=t.rules.indexOf(e);if(n===-1)continue;let r=this.offset(t)+n;t.rules.splice(n,1),t.keys.splice(n,1),this.deleteAt(r);return}}}insertAt(e,t){let n=g(e);if(this.rulesSheet){this.rulesSheet.insertRule(n,t);return}let r=this.allRules().length;for(let i of this.attached){let a=i.styles[1],o=a.sheet;if(o&&o.cssRules.length===r)o.insertRule(n,t);else{let n=this.allRules();n.splice(t,0,e),a.textContent=n.join(`
|
|
11
|
+
`)}}}deleteAt(e){if(this.rulesSheet){this.rulesSheet.deleteRule(e);return}let t=this.allRules().length;for(let n of this.attached){let r=n.styles[1],i=r.sheet;i&&i.cssRules.length===t+1?i.deleteRule(e):r.textContent=this.allRules().join(`
|
|
12
|
+
`)}}cssText(){return[this.prologueText(),...this.allRules()].join(`
|
|
13
|
+
`)}},v=new Map;function y(e,t=m){let n=p(e),r=v.get(n);return r||(r=new _(t(n),e,n),v.set(n,r)),r}function b(e){e.rootCount===0&&v.get(e.fullKey)===e&&v.delete(e.fullKey)}var x=class extends t.IncrementalParser{constructor(e){super(e.context),this.shared=e}processClass(e){if(this.isProcessed(e))return null;let t=this.shared.results.get(e);if(t)return this.markProcessed(e),t;let n=super.processClass(e);return n&&(this.shared.results.set(e,n),this.shared.generations++),n}},S=class{constructor(e,n,r=e=>(0,t.parseClassName)(e).utility?.category){this.shared=e,this.root=n,this.getCategory=r,this.owned=new Set,e.attach(n)}hasDetachedPartitions(){return!1}updateRuleContent(e,t){e===`preflight`?this.shared.setPrologue(`preflight`,f(t)):e===`css-vars`&&this.shared.setPrologue(`vars`,t)}take(e,t){return this.owned.has(e)||!this.shared.retain(e,t)?!1:(this.owned.add(e),!0)}addRule(e){return this.take(e,``)}addCategoryRule(e,t){return this.take(e,`c:${t}`)}addRootRules(e){let t=0;for(let n of e)this.take(n,`root`)&&t++;return{success:t,failed:e.length-t}}addRules(e){let t=0,n=0;for(let r of e){let e=this.getCategory(r.cls);for(let i of r.cssList)(e?this.addCategoryRule(i,e):this.addRule(i))?t++:n++}return{success:t,failed:n}}removeRule(e,t){return this.owned.delete(e)?(this.shared.release(e),!0):!1}get ruleCount(){return this.owned.size}cleanup(){this.owned.forEach(e=>this.shared.release(e)),this.owned.clear(),this.shared.detach(this.root),b(this.shared)}},C=`style[data-barocss-ssr]`,w=`@layer theme, base, components, utilities;`,T=class{constructor(e={}){this.cache=new Map,this.rootCache=new Set,this.shadowRoot=null,this.isDestroyed=!1,this.existing=null,this.existingKeyframes=new Set,this.existingSheetCount=-1,this.pinned=new Set,this.gc=null,this.reclaimedCount=0,this.ssrRules=[],this.ssrClasses=new Set,this.observedOnce=!1,this.getCategory=e=>(0,t.parseClassName)(e,this.context).utility?.category;let n={};this.options={config:e.config||n,styleId:e.styleId||`barocss-runtime`,insertionPoint:e.insertionPoint||`head`,maxRulesPerPartition:e.maxRulesPerPartition||50,skipExisting:e.skipExisting??!1,gc:e.gc??!0,gcGraceMs:e.gcGraceMs??3e3,maxRules:e.maxRules??1/0};let r=e.root;if(r&&r.nodeType===11&&(this.shadowRoot=r),this.shadowRoot){let e=y(this.options.config);this.context=e.context,this.incrementalParser=new x(e)}else this.context=(0,t.createContext)(this.options.config),this.incrementalParser=new t.IncrementalParser(this.context);this.changeDetector=new a(this.incrementalParser,this,this.getCategory),this.stylePartitionManager=this.createStyles(),this.options.gc&&(this.gc=new d({reclaim:e=>this.reclaim(e),isPermanent:e=>this.isPermanent(e),cachedCount:()=>this.cache.size},this.options.gcGraceMs,this.options.maxRules),this.changeDetector.setGc(this.gc)),this.init(),this.shadowRoot&&this.observe(this.shadowRoot,{scan:!0})}createStyles(){if(this.shadowRoot){let e=this.incrementalParser.shared,t=y(this.options.config);return t!==e&&(e=t,this.context=e.context,this.incrementalParser=new x(e),this.changeDetector?.setParser(this.incrementalParser)),new S(e,this.shadowRoot,this.getCategory)}return new n(this.getInsertionPoint(),this.options.maxRulesPerPartition,`${this.options.styleId}-partition`,this.getCategory)}debugLog(e,n,r){(0,t.isDebug)()&&(console[e]||console.log)(`[BrowserRuntime:${e.toUpperCase()}] ${n}`,r||``)}init(){this.debugLog(`debug`,`init`),this.injectPreflightCSS(),this.ensureCssVars(),this.adoptSsrSheets()}adoptSsrSheets(){if(typeof document>`u`||this.shadowRoot)return;let e=[];if(document.head){for(let t of Array.from(document.head.querySelectorAll(`${C}:not([data-barocss-adopted])`))){let n=t.sheet;if(!n)continue;t.setAttribute(`data-barocss-adopted`,``);let r=[];for(let e=n.cssRules.length-1;e>=0;e--){let t=n.cssRules[e],i=u([t]);i.size!==0&&(i.forEach(e=>this.ssrClasses.add(e)),r.unshift({css:t.cssText,cls:i.values().next().value}),n.deleteRule(e))}e.push(...r)}e.length!==0&&(this.ssrRules.push(...e),this.insertSsrRules(e))}}insertSsrRules(e){for(let{css:t,cls:n}of e){let e=this.getCategory(n);e?this.stylePartitionManager.addCategoryRule(t,e):this.stylePartitionManager.addRule(t)}}injectPreflightCSS(){let e=this.options.config.preflight??!0;if(e){let t=this.context.getPreflightCSS(e);this.stylePartitionManager.updateRuleContent(`preflight`,`${w}\n@layer base {\n${t}\n}`,!0)}}ensureCssVars(){if(this.isDestroyed)return;let e=this.context.themeToCssVars?this.context.themeToCssVars():`:root { /* CSS Variables will be generated here */ }`;this.stylePartitionManager.updateRuleContent(`css-vars`,e)}getInsertionPoint(){if(typeof this.options.insertionPoint!=`string`)return this.options.insertionPoint;switch(this.options.insertionPoint){case`body`:return document.body||document.head;default:return document.head}}addClass(e){if(this.isDestroyed)return;let t=this.normalizeClasses(e).filter(Boolean);t.forEach(e=>this.pinned.add(e)),this.processClasses(t)}processClasses(e){this.processClassesIncremental(e)}processClassesIncremental(e){let t=typeof window<`u`,n=this.incrementalParser.processClasses(e);this.debugLog(`debug`,`results`,{results:n,classList:e}),this.applyParseResults(n,{isBrowser:t})}applyParseResults(e,t){if(this.isDestroyed)return;if(!this.shadowRoot&&this.getInsertionPoint().isConnected&&this.stylePartitionManager.hasDetachedPartitions()){let t=Array.from(this.cache.values());this.reset(),e=[...t,...e],e.forEach(e=>this.incrementalParser.markProcessed(e.cls))}if(this.ssrClasses.size>0&&(e=e.filter(e=>!this.ssrClasses.has(e.cls))),this.options.skipExisting&&e.length>0&&typeof document<`u`){let t=this.getExistingClasses();e=e.filter(e=>!t.has(e.cls))}if(e.length===0)return;let n=[],r=[],i=this.options.skipExisting&&typeof document<`u`?(this.getExistingClasses(),this.existingKeyframes):null;for(let t of e)if(t.css&&Array.isArray(t.cssList)&&(n.push(t),this.cache.set(t.cls,t)),t.rootCss&&Array.isArray(t.rootCssList))for(let e of t.rootCssList){if(i?.size){let t=/^\s*@keyframes\s+([^\s{]+)/.exec(e)?.[1];if(t&&i.has(t))continue}this.rootCache.has(e)||(this.rootCache.add(e),r.push(e))}r.length>0&&this.stylePartitionManager.addRootRules(r.filter(Boolean)),n.length>0&&this.stylePartitionManager.addRules(n),this.debugLog(`info`,`Applied ${e.length} parser results`,{cssRuleCount:n.length,rootCssCount:r.length})}isPermanent(e){return this.pinned.has(e)||this.ssrClasses.has(e)?!0:this.shadowRoot?!1:typeof document>`u`||this.getExistingClasses().has(e)}reclaim(e){if(this.isDestroyed)return;let t=e.filter(e=>this.cache.has(e));if(t.length===0)return;let n=t.map(e=>this.cache.get(e));t.forEach(e=>{this.cache.delete(e),this.incrementalParser.unmarkProcessed(e)});let r=new Set;for(let e of this.cache.values())e.cssList.forEach(e=>r.add(e));for(let e of n){let t=this.getCategory(e.cls);for(let n of e.cssList)r.has(n)||this.stylePartitionManager.removeRule(n,t)}this.reclaimedCount+=t.length}getExistingClasses(){let e=new Set(Array.from(document.querySelectorAll(`style[data-barocss]`),e=>e.sheet)),t=Array.from(document.styleSheets).filter(t=>{if(e.has(t))return!1;let n=t.ownerNode;return!(n&&typeof n.hasAttribute==`function`&&(n.hasAttribute(`data-barocss`)||(n.id||``).startsWith(this.options.styleId)))});if(this.existing&&t.length===this.existingSheetCount)return this.existing;let n=new Set,r=new Set;for(let e of t){let t;try{t=e.cssRules}catch{continue}u(t,n),l(t,r)}return this.existingKeyframes=r,this.existing=n,this.existingSheetCount=t.length,n}observe(e=this.shadowRoot??document.body,t){return this.observedOnce||(this.observedOnce=!0,this.adoptSsrSheets()),this.changeDetector.observe(e,t)}normalizeClasses(e){return Array.isArray(e)?e.flatMap(e=>e.split(/\s+/)):e.split(/\s+/)}has(e){return this.cache.has(e)}getCss(e){return this.cache.get(e)?.cssList.join(`
|
|
8
14
|
`)}getAllCss(){return[...this.rootCache,...Array.from(this.cache.values()).flatMap(e=>e.cssList)].join(`
|
|
9
|
-
`)}getClasses(){return Array.from(this.cache.keys())}getCacheStats(){let e=this.incrementalParser.getStats();return{runtime:{cachedClasses:this.cache.size,rootCacheSize:this.rootCache.size,ruleCount:this.stylePartitionManager.ruleCount,reclaimedClasses:this.reclaimedCount,gc:this.gc?.stats()??null},ast:e.cacheStats.ast,incremental:e}}clearCaches(){this.isDestroyed||(this.cache.clear(),this.rootCache.clear(),(0,t.clearAstCache)(this.context),this.incrementalParser.clearProcessed(),this.stylePartitionManager.cleanup(),this.stylePartitionManager=
|
|
15
|
+
`)}getClasses(){return Array.from(this.cache.keys())}getCacheStats(){let e=this.incrementalParser.getStats();return{runtime:{cachedClasses:this.cache.size,rootCacheSize:this.rootCache.size,ruleCount:this.stylePartitionManager.ruleCount,reclaimedClasses:this.reclaimedCount,gc:this.gc?.stats()??null},ast:e.cacheStats.ast,incremental:e}}clearCaches(){this.isDestroyed||(this.cache.clear(),this.rootCache.clear(),(0,t.clearAstCache)(this.context),this.incrementalParser.clearProcessed(),this.stylePartitionManager.cleanup(),this.stylePartitionManager=this.createStyles(),this.injectPreflightCSS(),this.ensureCssVars(),this.insertSsrRules(this.ssrRules))}reset(){this.isDestroyed||(this.cache.clear(),this.rootCache.clear(),this.incrementalParser.clearProcessed(),this.stylePartitionManager.cleanup(),this.stylePartitionManager=this.createStyles(),this.injectPreflightCSS(),this.ensureCssVars(),this.insertSsrRules(this.ssrRules))}updateConfig(e){if(this.isDestroyed)return;let n=Array.from(this.cache.keys());if(this.options.config=e,this.shadowRoot){this.stylePartitionManager.cleanup();let t=y(e);this.context=t.context,this.incrementalParser=new x(t)}else this.context=(0,t.createContext)(e),this.incrementalParser=new t.IncrementalParser(this.context);this.changeDetector.setParser(this.incrementalParser),this.reset(),n.length>0&&this.addClass(n)}removeClass(e){if(this.isDestroyed)return;let t=new Set(this.normalizeClasses(e)),n=Array.from(this.cache.values()).filter(e=>!t.has(e.cls));n.length!==this.cache.size&&(this.reset(),n.forEach(e=>this.incrementalParser.markProcessed(e.cls)),this.applyParseResults(n))}destroy(){this.isDestroyed||=(this.changeDetector.disconnect(),this.gc?.cancel(),this.stylePartitionManager.cleanup(),this.cache.clear(),this.rootCache.clear(),!0)}getStats(){return{cachedClasses:this.cache.size,styleElementId:this.options.styleId,isDestroyed:this.isDestroyed,config:this.options.config,cacheStats:this.getCacheStats(),sharedSheet:this.shadowRoot&&this.stylePartitionManager instanceof S?{roots:this.stylePartitionManager.shared.rootCount,rules:this.stylePartitionManager.shared.ruleCount,generations:this.stylePartitionManager.shared.generations,constructable:this.stylePartitionManager.shared.constructable}:null}}},E=null,D;function O(e={}){return!E||E.getStats().isDestroyed?(E=new T(e),D=e.config):e.config&&e.config!==D&&(E.updateConfig(e.config),D=e.config),E}function k({loadingClassName:e=`baro-boot`,...t}={}){if(t.root&&t.root.nodeType===11)return new T(t);if(!document.body){document.addEventListener(`DOMContentLoaded`,()=>k({loadingClassName:e,...t}),{once:!0});return}let n=`${e}-doing`,r=`${e}-done`;try{document.body.classList.add(n),O(t).observe(document.body,{scan:!0,onReady:()=>{document.body.classList.remove(n),document.body.classList.add(r)}})}catch(e){document.body?.classList.remove(n),console.error(`BaroCSS boot failed:`,e)}}var A=k;function j(e){if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e.elements;if(!t||typeof t!=`object`||Array.isArray(t))return[];let n=new Set;for(let e of Object.keys(t)){let r=t[e];if(!r||typeof r!=`object`||Array.isArray(r))continue;let i=r.props;if(!i||typeof i!=`object`||Array.isArray(i))continue;let a=i.className;if(typeof a==`string`)for(let e of a.split(/\s+/))e&&n.add(e)}return Array.from(n)}function M(e,t){let n=j(e);n.length>0&&t.addClass(n)}var N={colors:Object.fromEntries(`background.foreground.card.card-foreground.popover.popover-foreground.primary.primary-foreground.secondary.secondary-foreground.muted.muted-foreground.accent.accent-foreground.destructive.border.input.ring.chart-1.chart-2.chart-3.chart-4.chart-5.sidebar.sidebar-foreground.sidebar-primary.sidebar-primary-foreground.sidebar-accent.sidebar-accent-foreground.sidebar-border.sidebar-ring`.split(`.`).map(e=>[e,`var(--${e})`])),borderRadius:{sm:`calc(var(--radius) - 4px)`,md:`calc(var(--radius) - 2px)`,lg:`var(--radius)`,xl:`calc(var(--radius) + 4px)`}};e.BrowserRuntime=T,e.ChangeDetector=a,e.LAYER_ORDER=w,e.SSR_STYLE_SELECTOR=C,e.StylePartitionManager=n,e.baroBoot=k,e.baroStart=A,e.collectJsonRenderClassNames=j,e.getRuntime=O,e.normalizeClassName=r,e.normalizeClassNameList=i,e.preloadJsonRenderClasses=M,e.shadcnTheme=N});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barocss/browser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/barocss/barocss.git",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@barocss/kit": "0.
|
|
33
|
+
"@barocss/kit": "0.9.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"jsdom": "^26.1.0",
|