@pandacss/shared 0.44.0 → 0.45.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/dist/index.js +9 -5
- package/dist/index.mjs +9 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -512,17 +512,15 @@ function cssVar(name, options = {}) {
|
|
|
512
512
|
var deepSet = (target, path, value) => {
|
|
513
513
|
const isValueObject = isObject(value);
|
|
514
514
|
if (!path.length && isValueObject) {
|
|
515
|
-
return
|
|
515
|
+
return mergeProps(target, value);
|
|
516
516
|
}
|
|
517
517
|
let current = target;
|
|
518
518
|
for (let i = 0; i < path.length; i++) {
|
|
519
519
|
const key = path[i];
|
|
520
|
-
|
|
521
|
-
current[key] = {};
|
|
522
|
-
}
|
|
520
|
+
current[key] ||= {};
|
|
523
521
|
if (i === path.length - 1) {
|
|
524
522
|
if (isValueObject && isObject(current[key])) {
|
|
525
|
-
current[key] =
|
|
523
|
+
current[key] = mergeProps(current[key], value);
|
|
526
524
|
} else {
|
|
527
525
|
current[key] = value;
|
|
528
526
|
}
|
|
@@ -584,11 +582,17 @@ var esc2 = (sel) => {
|
|
|
584
582
|
};
|
|
585
583
|
|
|
586
584
|
// src/flatten.ts
|
|
585
|
+
function filterDefault(path) {
|
|
586
|
+
if (path[0] === "DEFAULT")
|
|
587
|
+
return path;
|
|
588
|
+
return path.filter((item) => item !== "DEFAULT");
|
|
589
|
+
}
|
|
587
590
|
function flatten(values, stop) {
|
|
588
591
|
const result = {};
|
|
589
592
|
walkObject(
|
|
590
593
|
values,
|
|
591
594
|
(token, paths) => {
|
|
595
|
+
paths = filterDefault(paths);
|
|
592
596
|
if (token) {
|
|
593
597
|
result[paths.join(".")] = token.value;
|
|
594
598
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -420,17 +420,15 @@ function cssVar(name, options = {}) {
|
|
|
420
420
|
var deepSet = (target, path, value) => {
|
|
421
421
|
const isValueObject = isObject(value);
|
|
422
422
|
if (!path.length && isValueObject) {
|
|
423
|
-
return
|
|
423
|
+
return mergeProps(target, value);
|
|
424
424
|
}
|
|
425
425
|
let current = target;
|
|
426
426
|
for (let i = 0; i < path.length; i++) {
|
|
427
427
|
const key = path[i];
|
|
428
|
-
|
|
429
|
-
current[key] = {};
|
|
430
|
-
}
|
|
428
|
+
current[key] ||= {};
|
|
431
429
|
if (i === path.length - 1) {
|
|
432
430
|
if (isValueObject && isObject(current[key])) {
|
|
433
|
-
current[key] =
|
|
431
|
+
current[key] = mergeProps(current[key], value);
|
|
434
432
|
} else {
|
|
435
433
|
current[key] = value;
|
|
436
434
|
}
|
|
@@ -492,11 +490,17 @@ var esc2 = (sel) => {
|
|
|
492
490
|
};
|
|
493
491
|
|
|
494
492
|
// src/flatten.ts
|
|
493
|
+
function filterDefault(path) {
|
|
494
|
+
if (path[0] === "DEFAULT")
|
|
495
|
+
return path;
|
|
496
|
+
return path.filter((item) => item !== "DEFAULT");
|
|
497
|
+
}
|
|
495
498
|
function flatten(values, stop) {
|
|
496
499
|
const result = {};
|
|
497
500
|
walkObject(
|
|
498
501
|
values,
|
|
499
502
|
(token, paths) => {
|
|
503
|
+
paths = filterDefault(paths);
|
|
500
504
|
if (token) {
|
|
501
505
|
result[paths.join(".")] = token.value;
|
|
502
506
|
}
|