@pandacss/config 0.37.1 → 0.38.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/{chunk-GR4POVOJ.mjs → chunk-F5ESIWB7.mjs} +55 -13
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +57 -52
- package/dist/index.mjs +10 -35
- package/dist/merge-config.js +26 -17
- package/dist/merge-config.mjs +1 -1
- package/dist/resolve-ts-path-pattern.d.mts +1 -1
- package/dist/resolve-ts-path-pattern.d.ts +1 -1
- package/package.json +6 -6
- /package/dist/{ts-config-paths-2lh9mwzL.d.mts → ts-config-paths-qwrwgu2Q.d.mts} +0 -0
- /package/dist/{ts-config-paths-2lh9mwzL.d.ts → ts-config-paths-qwrwgu2Q.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/merge-config.ts
|
|
2
|
-
import { assign,
|
|
2
|
+
import { assign, mergeWith, walkObject } from "@pandacss/shared";
|
|
3
3
|
import { mergeAndConcat } from "merge-anything";
|
|
4
4
|
|
|
5
5
|
// src/merge-hooks.ts
|
|
@@ -115,6 +115,37 @@ var tryCatch = (name, fn) => {
|
|
|
115
115
|
};
|
|
116
116
|
};
|
|
117
117
|
|
|
118
|
+
// src/validation/utils.ts
|
|
119
|
+
import { isObject, isString } from "@pandacss/shared";
|
|
120
|
+
var REFERENCE_REGEX = /({([^}]*)})/g;
|
|
121
|
+
var curlyBracketRegex = /[{}]/g;
|
|
122
|
+
var isValidToken = (token) => isObject(token) && Object.hasOwnProperty.call(token, "value");
|
|
123
|
+
var isTokenReference = (value) => typeof value === "string" && REFERENCE_REGEX.test(value);
|
|
124
|
+
var formatPath = (path) => path;
|
|
125
|
+
var SEP = ".";
|
|
126
|
+
function getReferences(value) {
|
|
127
|
+
if (typeof value !== "string")
|
|
128
|
+
return [];
|
|
129
|
+
const matches = value.match(REFERENCE_REGEX);
|
|
130
|
+
if (!matches)
|
|
131
|
+
return [];
|
|
132
|
+
return matches.map((match) => match.replace(curlyBracketRegex, "")).map((value2) => {
|
|
133
|
+
return value2.trim().split("/")[0];
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
var serializeTokenValue = (value) => {
|
|
137
|
+
if (isString(value)) {
|
|
138
|
+
return value;
|
|
139
|
+
}
|
|
140
|
+
if (isObject(value)) {
|
|
141
|
+
return Object.values(value).map((v) => serializeTokenValue(v)).join(" ");
|
|
142
|
+
}
|
|
143
|
+
if (Array.isArray(value)) {
|
|
144
|
+
return value.map((v) => serializeTokenValue(v)).join(" ");
|
|
145
|
+
}
|
|
146
|
+
return value.toString();
|
|
147
|
+
};
|
|
148
|
+
|
|
118
149
|
// src/merge-config.ts
|
|
119
150
|
function getExtends(items) {
|
|
120
151
|
return items.reduce((merged, { extend }) => {
|
|
@@ -155,7 +186,7 @@ var compact = (obj) => {
|
|
|
155
186
|
return acc;
|
|
156
187
|
}, {});
|
|
157
188
|
};
|
|
158
|
-
var tokenKeys = ["description", "extensions", "type", "value"];
|
|
189
|
+
var tokenKeys = ["description", "extensions", "type", "value", "deprecated"];
|
|
159
190
|
function mergeConfigs(configs) {
|
|
160
191
|
const [userConfig] = configs;
|
|
161
192
|
const pluginHooks = userConfig.plugins ?? [];
|
|
@@ -178,18 +209,23 @@ function mergeConfigs(configs) {
|
|
|
178
209
|
);
|
|
179
210
|
const withoutEmpty = compact(mergedResult);
|
|
180
211
|
if (withoutEmpty.theme?.tokens) {
|
|
181
|
-
|
|
182
|
-
stop(
|
|
183
|
-
if (
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
|
|
212
|
+
walkObject(withoutEmpty.theme.tokens, (args) => args, {
|
|
213
|
+
stop(token) {
|
|
214
|
+
if (!isValidToken(token))
|
|
215
|
+
return false;
|
|
216
|
+
const keys = Object.keys(token);
|
|
217
|
+
const nestedKeys = keys.filter((k) => !tokenKeys.includes(k));
|
|
218
|
+
const nested = nestedKeys.length > 0;
|
|
219
|
+
if (nested) {
|
|
220
|
+
token.DEFAULT ||= {};
|
|
221
|
+
tokenKeys.forEach((key) => {
|
|
222
|
+
if (token[key] == null)
|
|
223
|
+
return;
|
|
224
|
+
token.DEFAULT[key] ||= token[key];
|
|
225
|
+
delete token[key];
|
|
226
|
+
});
|
|
191
227
|
}
|
|
192
|
-
return
|
|
228
|
+
return true;
|
|
193
229
|
}
|
|
194
230
|
});
|
|
195
231
|
}
|
|
@@ -197,5 +233,11 @@ function mergeConfigs(configs) {
|
|
|
197
233
|
}
|
|
198
234
|
|
|
199
235
|
export {
|
|
236
|
+
isValidToken,
|
|
237
|
+
isTokenReference,
|
|
238
|
+
formatPath,
|
|
239
|
+
SEP,
|
|
240
|
+
getReferences,
|
|
241
|
+
serializeTokenValue,
|
|
200
242
|
mergeConfigs
|
|
201
243
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _pandacss_types from '@pandacss/types';
|
|
2
2
|
import { Config, ConfigTsOptions, LoadConfigResult } from '@pandacss/types';
|
|
3
3
|
export { diffConfigs } from './diff-config.mjs';
|
|
4
|
-
import { P as PathMapping } from './ts-config-paths-
|
|
5
|
-
export { c as convertTsPathsToRegexes } from './ts-config-paths-
|
|
4
|
+
import { P as PathMapping } from './ts-config-paths-qwrwgu2Q.mjs';
|
|
5
|
+
export { c as convertTsPathsToRegexes } from './ts-config-paths-qwrwgu2Q.mjs';
|
|
6
6
|
import { TSConfig } from 'pkg-types';
|
|
7
7
|
export { mergeConfigs } from './merge-config.mjs';
|
|
8
8
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _pandacss_types from '@pandacss/types';
|
|
2
2
|
import { Config, ConfigTsOptions, LoadConfigResult } from '@pandacss/types';
|
|
3
3
|
export { diffConfigs } from './diff-config.js';
|
|
4
|
-
import { P as PathMapping } from './ts-config-paths-
|
|
5
|
-
export { c as convertTsPathsToRegexes } from './ts-config-paths-
|
|
4
|
+
import { P as PathMapping } from './ts-config-paths-qwrwgu2Q.js';
|
|
5
|
+
export { c as convertTsPathsToRegexes } from './ts-config-paths-qwrwgu2Q.js';
|
|
6
6
|
import { TSConfig } from 'pkg-types';
|
|
7
7
|
export { mergeConfigs } from './merge-config.js';
|
|
8
8
|
|
package/dist/index.js
CHANGED
|
@@ -382,7 +382,7 @@ function getConfigDependencies(filePath, tsOptions = { pathMappings: [] }, compi
|
|
|
382
382
|
}
|
|
383
383
|
|
|
384
384
|
// src/merge-config.ts
|
|
385
|
-
var
|
|
385
|
+
var import_shared5 = require("@pandacss/shared");
|
|
386
386
|
var import_merge_anything = require("merge-anything");
|
|
387
387
|
|
|
388
388
|
// src/merge-hooks.ts
|
|
@@ -498,12 +498,43 @@ var tryCatch = (name, fn) => {
|
|
|
498
498
|
};
|
|
499
499
|
};
|
|
500
500
|
|
|
501
|
+
// src/validation/utils.ts
|
|
502
|
+
var import_shared4 = require("@pandacss/shared");
|
|
503
|
+
var REFERENCE_REGEX = /({([^}]*)})/g;
|
|
504
|
+
var curlyBracketRegex = /[{}]/g;
|
|
505
|
+
var isValidToken = (token) => (0, import_shared4.isObject)(token) && Object.hasOwnProperty.call(token, "value");
|
|
506
|
+
var isTokenReference = (value) => typeof value === "string" && REFERENCE_REGEX.test(value);
|
|
507
|
+
var formatPath = (path2) => path2;
|
|
508
|
+
var SEP = ".";
|
|
509
|
+
function getReferences(value) {
|
|
510
|
+
if (typeof value !== "string")
|
|
511
|
+
return [];
|
|
512
|
+
const matches = value.match(REFERENCE_REGEX);
|
|
513
|
+
if (!matches)
|
|
514
|
+
return [];
|
|
515
|
+
return matches.map((match) => match.replace(curlyBracketRegex, "")).map((value2) => {
|
|
516
|
+
return value2.trim().split("/")[0];
|
|
517
|
+
});
|
|
518
|
+
}
|
|
519
|
+
var serializeTokenValue = (value) => {
|
|
520
|
+
if ((0, import_shared4.isString)(value)) {
|
|
521
|
+
return value;
|
|
522
|
+
}
|
|
523
|
+
if ((0, import_shared4.isObject)(value)) {
|
|
524
|
+
return Object.values(value).map((v) => serializeTokenValue(v)).join(" ");
|
|
525
|
+
}
|
|
526
|
+
if (Array.isArray(value)) {
|
|
527
|
+
return value.map((v) => serializeTokenValue(v)).join(" ");
|
|
528
|
+
}
|
|
529
|
+
return value.toString();
|
|
530
|
+
};
|
|
531
|
+
|
|
501
532
|
// src/merge-config.ts
|
|
502
533
|
function getExtends(items) {
|
|
503
534
|
return items.reduce((merged, { extend }) => {
|
|
504
535
|
if (!extend)
|
|
505
536
|
return merged;
|
|
506
|
-
return (0,
|
|
537
|
+
return (0, import_shared5.mergeWith)(merged, extend, (originalValue, newValue) => {
|
|
507
538
|
if (newValue === void 0) {
|
|
508
539
|
return originalValue ?? [];
|
|
509
540
|
}
|
|
@@ -519,13 +550,13 @@ function getExtends(items) {
|
|
|
519
550
|
}
|
|
520
551
|
function mergeRecords(records) {
|
|
521
552
|
return {
|
|
522
|
-
...records.reduce((acc, record) => (0,
|
|
553
|
+
...records.reduce((acc, record) => (0, import_shared5.assign)(acc, record), {}),
|
|
523
554
|
extend: getExtends(records)
|
|
524
555
|
};
|
|
525
556
|
}
|
|
526
557
|
function mergeExtensions(records) {
|
|
527
558
|
const { extend = [], ...restProps } = mergeRecords(records);
|
|
528
|
-
return (0,
|
|
559
|
+
return (0, import_shared5.mergeWith)(restProps, extend, (obj, extensions) => {
|
|
529
560
|
return (0, import_merge_anything.mergeAndConcat)({}, obj, ...extensions);
|
|
530
561
|
});
|
|
531
562
|
}
|
|
@@ -538,14 +569,14 @@ var compact = (obj) => {
|
|
|
538
569
|
return acc;
|
|
539
570
|
}, {});
|
|
540
571
|
};
|
|
541
|
-
var tokenKeys = ["description", "extensions", "type", "value"];
|
|
572
|
+
var tokenKeys = ["description", "extensions", "type", "value", "deprecated"];
|
|
542
573
|
function mergeConfigs(configs2) {
|
|
543
574
|
const [userConfig] = configs2;
|
|
544
575
|
const pluginHooks = userConfig.plugins ?? [];
|
|
545
576
|
if (userConfig.hooks) {
|
|
546
577
|
pluginHooks.push({ name: "__panda.config__", hooks: userConfig.hooks });
|
|
547
578
|
}
|
|
548
|
-
const mergedResult = (0,
|
|
579
|
+
const mergedResult = (0, import_shared5.assign)(
|
|
549
580
|
{
|
|
550
581
|
conditions: mergeExtensions(configs2.map((config) => config.conditions ?? {})),
|
|
551
582
|
theme: mergeExtensions(configs2.map((config) => config.theme ?? {})),
|
|
@@ -561,18 +592,23 @@ function mergeConfigs(configs2) {
|
|
|
561
592
|
);
|
|
562
593
|
const withoutEmpty = compact(mergedResult);
|
|
563
594
|
if (withoutEmpty.theme?.tokens) {
|
|
564
|
-
(0,
|
|
565
|
-
stop(
|
|
566
|
-
if ((
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
}
|
|
573
|
-
|
|
595
|
+
(0, import_shared5.walkObject)(withoutEmpty.theme.tokens, (args) => args, {
|
|
596
|
+
stop(token) {
|
|
597
|
+
if (!isValidToken(token))
|
|
598
|
+
return false;
|
|
599
|
+
const keys = Object.keys(token);
|
|
600
|
+
const nestedKeys = keys.filter((k) => !tokenKeys.includes(k));
|
|
601
|
+
const nested = nestedKeys.length > 0;
|
|
602
|
+
if (nested) {
|
|
603
|
+
token.DEFAULT ||= {};
|
|
604
|
+
tokenKeys.forEach((key) => {
|
|
605
|
+
if (token[key] == null)
|
|
606
|
+
return;
|
|
607
|
+
token.DEFAULT[key] ||= token[key];
|
|
608
|
+
delete token[key];
|
|
609
|
+
});
|
|
574
610
|
}
|
|
575
|
-
return
|
|
611
|
+
return true;
|
|
576
612
|
}
|
|
577
613
|
});
|
|
578
614
|
}
|
|
@@ -638,14 +674,14 @@ var validateArtifactNames = (names, addError) => {
|
|
|
638
674
|
};
|
|
639
675
|
|
|
640
676
|
// src/validation/validate-breakpoints.ts
|
|
641
|
-
var
|
|
677
|
+
var import_shared6 = require("@pandacss/shared");
|
|
642
678
|
var validateBreakpoints = (breakpoints, addError) => {
|
|
643
679
|
if (!breakpoints)
|
|
644
680
|
return;
|
|
645
681
|
const units = /* @__PURE__ */ new Set();
|
|
646
682
|
const values = Object.values(breakpoints);
|
|
647
683
|
for (const value of values) {
|
|
648
|
-
const unit = (0,
|
|
684
|
+
const unit = (0, import_shared6.getUnit)(value) ?? "px";
|
|
649
685
|
units.add(unit);
|
|
650
686
|
}
|
|
651
687
|
if (units.size > 1) {
|
|
@@ -654,12 +690,12 @@ var validateBreakpoints = (breakpoints, addError) => {
|
|
|
654
690
|
};
|
|
655
691
|
|
|
656
692
|
// src/validation/validate-condition.ts
|
|
657
|
-
var
|
|
693
|
+
var import_shared7 = require("@pandacss/shared");
|
|
658
694
|
var validateConditions = (conditions, addError) => {
|
|
659
695
|
if (!conditions)
|
|
660
696
|
return;
|
|
661
697
|
Object.values(conditions).forEach((condition) => {
|
|
662
|
-
if ((0,
|
|
698
|
+
if ((0, import_shared7.isString)(condition)) {
|
|
663
699
|
if (!condition.startsWith("@") && !condition.includes("&")) {
|
|
664
700
|
addError("conditions", `Selectors should contain the \`&\` character: \`${condition}\``);
|
|
665
701
|
}
|
|
@@ -706,37 +742,6 @@ var validateRecipes = (options) => {
|
|
|
706
742
|
// src/validation/validate-tokens.ts
|
|
707
743
|
var import_shared8 = require("@pandacss/shared");
|
|
708
744
|
|
|
709
|
-
// src/validation/utils.ts
|
|
710
|
-
var import_shared7 = require("@pandacss/shared");
|
|
711
|
-
var REFERENCE_REGEX = /({([^}]*)})/g;
|
|
712
|
-
var curlyBracketRegex = /[{}]/g;
|
|
713
|
-
var isValidToken = (token) => Object.hasOwnProperty.call(token, "value");
|
|
714
|
-
var isTokenReference = (value) => typeof value === "string" && REFERENCE_REGEX.test(value);
|
|
715
|
-
var formatPath = (path2) => path2;
|
|
716
|
-
var SEP = ".";
|
|
717
|
-
function getReferences(value) {
|
|
718
|
-
if (typeof value !== "string")
|
|
719
|
-
return [];
|
|
720
|
-
const matches = value.match(REFERENCE_REGEX);
|
|
721
|
-
if (!matches)
|
|
722
|
-
return [];
|
|
723
|
-
return matches.map((match) => match.replace(curlyBracketRegex, "")).map((value2) => {
|
|
724
|
-
return value2.trim().split("/")[0];
|
|
725
|
-
});
|
|
726
|
-
}
|
|
727
|
-
var serializeTokenValue = (value) => {
|
|
728
|
-
if ((0, import_shared7.isString)(value)) {
|
|
729
|
-
return value;
|
|
730
|
-
}
|
|
731
|
-
if ((0, import_shared7.isObject)(value)) {
|
|
732
|
-
return Object.values(value).map((v) => serializeTokenValue(v)).join(" ");
|
|
733
|
-
}
|
|
734
|
-
if (Array.isArray(value)) {
|
|
735
|
-
return value.map((v) => serializeTokenValue(v)).join(" ");
|
|
736
|
-
}
|
|
737
|
-
return value.toString();
|
|
738
|
-
};
|
|
739
|
-
|
|
740
745
|
// src/validation/validate-token-references.ts
|
|
741
746
|
var validateTokenReferences = (props) => {
|
|
742
747
|
const { valueAtPath, refsByPath, addError, typeByPath } = props;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
SEP,
|
|
3
|
+
formatPath,
|
|
4
|
+
getReferences,
|
|
5
|
+
isTokenReference,
|
|
6
|
+
isValidToken,
|
|
7
|
+
mergeConfigs,
|
|
8
|
+
serializeTokenValue
|
|
9
|
+
} from "./chunk-F5ESIWB7.mjs";
|
|
4
10
|
import {
|
|
5
11
|
diffConfigs
|
|
6
12
|
} from "./chunk-D3CL3VYD.mjs";
|
|
@@ -318,38 +324,7 @@ var validateRecipes = (options) => {
|
|
|
318
324
|
};
|
|
319
325
|
|
|
320
326
|
// src/validation/validate-tokens.ts
|
|
321
|
-
import { isObject
|
|
322
|
-
|
|
323
|
-
// src/validation/utils.ts
|
|
324
|
-
import { isObject, isString as isString2 } from "@pandacss/shared";
|
|
325
|
-
var REFERENCE_REGEX = /({([^}]*)})/g;
|
|
326
|
-
var curlyBracketRegex = /[{}]/g;
|
|
327
|
-
var isValidToken = (token) => Object.hasOwnProperty.call(token, "value");
|
|
328
|
-
var isTokenReference = (value) => typeof value === "string" && REFERENCE_REGEX.test(value);
|
|
329
|
-
var formatPath = (path2) => path2;
|
|
330
|
-
var SEP = ".";
|
|
331
|
-
function getReferences(value) {
|
|
332
|
-
if (typeof value !== "string")
|
|
333
|
-
return [];
|
|
334
|
-
const matches = value.match(REFERENCE_REGEX);
|
|
335
|
-
if (!matches)
|
|
336
|
-
return [];
|
|
337
|
-
return matches.map((match) => match.replace(curlyBracketRegex, "")).map((value2) => {
|
|
338
|
-
return value2.trim().split("/")[0];
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
var serializeTokenValue = (value) => {
|
|
342
|
-
if (isString2(value)) {
|
|
343
|
-
return value;
|
|
344
|
-
}
|
|
345
|
-
if (isObject(value)) {
|
|
346
|
-
return Object.values(value).map((v) => serializeTokenValue(v)).join(" ");
|
|
347
|
-
}
|
|
348
|
-
if (Array.isArray(value)) {
|
|
349
|
-
return value.map((v) => serializeTokenValue(v)).join(" ");
|
|
350
|
-
}
|
|
351
|
-
return value.toString();
|
|
352
|
-
};
|
|
327
|
+
import { isObject, walkObject } from "@pandacss/shared";
|
|
353
328
|
|
|
354
329
|
// src/validation/validate-token-references.ts
|
|
355
330
|
var validateTokenReferences = (props) => {
|
|
@@ -488,7 +463,7 @@ var validateTokens = (options) => {
|
|
|
488
463
|
addError("tokens", `Token key must not contain spaces: \`theme.tokens.${formattedPath}\``);
|
|
489
464
|
return;
|
|
490
465
|
}
|
|
491
|
-
if (!
|
|
466
|
+
if (!isObject(value) && !path2.includes("value")) {
|
|
492
467
|
addError("tokens", `Token must contain 'value': \`theme.semanticTokens.${formattedPath}\``);
|
|
493
468
|
}
|
|
494
469
|
});
|
package/dist/merge-config.js
CHANGED
|
@@ -23,7 +23,7 @@ __export(merge_config_exports, {
|
|
|
23
23
|
mergeConfigs: () => mergeConfigs
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(merge_config_exports);
|
|
26
|
-
var
|
|
26
|
+
var import_shared2 = require("@pandacss/shared");
|
|
27
27
|
var import_merge_anything = require("merge-anything");
|
|
28
28
|
|
|
29
29
|
// src/merge-hooks.ts
|
|
@@ -139,12 +139,16 @@ var tryCatch = (name, fn) => {
|
|
|
139
139
|
};
|
|
140
140
|
};
|
|
141
141
|
|
|
142
|
+
// src/validation/utils.ts
|
|
143
|
+
var import_shared = require("@pandacss/shared");
|
|
144
|
+
var isValidToken = (token) => (0, import_shared.isObject)(token) && Object.hasOwnProperty.call(token, "value");
|
|
145
|
+
|
|
142
146
|
// src/merge-config.ts
|
|
143
147
|
function getExtends(items) {
|
|
144
148
|
return items.reduce((merged, { extend }) => {
|
|
145
149
|
if (!extend)
|
|
146
150
|
return merged;
|
|
147
|
-
return (0,
|
|
151
|
+
return (0, import_shared2.mergeWith)(merged, extend, (originalValue, newValue) => {
|
|
148
152
|
if (newValue === void 0) {
|
|
149
153
|
return originalValue ?? [];
|
|
150
154
|
}
|
|
@@ -160,13 +164,13 @@ function getExtends(items) {
|
|
|
160
164
|
}
|
|
161
165
|
function mergeRecords(records) {
|
|
162
166
|
return {
|
|
163
|
-
...records.reduce((acc, record) => (0,
|
|
167
|
+
...records.reduce((acc, record) => (0, import_shared2.assign)(acc, record), {}),
|
|
164
168
|
extend: getExtends(records)
|
|
165
169
|
};
|
|
166
170
|
}
|
|
167
171
|
function mergeExtensions(records) {
|
|
168
172
|
const { extend = [], ...restProps } = mergeRecords(records);
|
|
169
|
-
return (0,
|
|
173
|
+
return (0, import_shared2.mergeWith)(restProps, extend, (obj, extensions) => {
|
|
170
174
|
return (0, import_merge_anything.mergeAndConcat)({}, obj, ...extensions);
|
|
171
175
|
});
|
|
172
176
|
}
|
|
@@ -179,14 +183,14 @@ var compact = (obj) => {
|
|
|
179
183
|
return acc;
|
|
180
184
|
}, {});
|
|
181
185
|
};
|
|
182
|
-
var tokenKeys = ["description", "extensions", "type", "value"];
|
|
186
|
+
var tokenKeys = ["description", "extensions", "type", "value", "deprecated"];
|
|
183
187
|
function mergeConfigs(configs) {
|
|
184
188
|
const [userConfig] = configs;
|
|
185
189
|
const pluginHooks = userConfig.plugins ?? [];
|
|
186
190
|
if (userConfig.hooks) {
|
|
187
191
|
pluginHooks.push({ name: "__panda.config__", hooks: userConfig.hooks });
|
|
188
192
|
}
|
|
189
|
-
const mergedResult = (0,
|
|
193
|
+
const mergedResult = (0, import_shared2.assign)(
|
|
190
194
|
{
|
|
191
195
|
conditions: mergeExtensions(configs.map((config) => config.conditions ?? {})),
|
|
192
196
|
theme: mergeExtensions(configs.map((config) => config.theme ?? {})),
|
|
@@ -202,18 +206,23 @@ function mergeConfigs(configs) {
|
|
|
202
206
|
);
|
|
203
207
|
const withoutEmpty = compact(mergedResult);
|
|
204
208
|
if (withoutEmpty.theme?.tokens) {
|
|
205
|
-
(0,
|
|
206
|
-
stop(
|
|
207
|
-
if ((
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
214
|
-
|
|
209
|
+
(0, import_shared2.walkObject)(withoutEmpty.theme.tokens, (args) => args, {
|
|
210
|
+
stop(token) {
|
|
211
|
+
if (!isValidToken(token))
|
|
212
|
+
return false;
|
|
213
|
+
const keys = Object.keys(token);
|
|
214
|
+
const nestedKeys = keys.filter((k) => !tokenKeys.includes(k));
|
|
215
|
+
const nested = nestedKeys.length > 0;
|
|
216
|
+
if (nested) {
|
|
217
|
+
token.DEFAULT ||= {};
|
|
218
|
+
tokenKeys.forEach((key) => {
|
|
219
|
+
if (token[key] == null)
|
|
220
|
+
return;
|
|
221
|
+
token.DEFAULT[key] ||= token[key];
|
|
222
|
+
delete token[key];
|
|
223
|
+
});
|
|
215
224
|
}
|
|
216
|
-
return
|
|
225
|
+
return true;
|
|
217
226
|
}
|
|
218
227
|
});
|
|
219
228
|
}
|
package/dist/merge-config.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PathMapping } from './ts-config-paths-
|
|
1
|
+
import { P as PathMapping } from './ts-config-paths-qwrwgu2Q.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @see https://github.com/aleclarson/vite-tsconfig-paths/blob/e8f0acf7adfcfbf77edbe937f64b4e5d39557ad0/src/index.ts#LL231C57-L231C57
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PathMapping } from './ts-config-paths-
|
|
1
|
+
import { P as PathMapping } from './ts-config-paths-qwrwgu2Q.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @see https://github.com/aleclarson/vite-tsconfig-paths/blob/e8f0acf7adfcfbf77edbe937f64b4e5d39557ad0/src/index.ts#LL231C57-L231C57
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"description": "Find and load panda config",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -73,11 +73,11 @@
|
|
|
73
73
|
"merge-anything": "5.1.7",
|
|
74
74
|
"microdiff": "1.3.2",
|
|
75
75
|
"typescript": "5.3.3",
|
|
76
|
-
"@pandacss/logger": "0.
|
|
77
|
-
"@pandacss/preset-base": "0.
|
|
78
|
-
"@pandacss/preset-panda": "0.
|
|
79
|
-
"@pandacss/shared": "0.
|
|
80
|
-
"@pandacss/types": "0.
|
|
76
|
+
"@pandacss/logger": "0.38.0",
|
|
77
|
+
"@pandacss/preset-base": "0.38.0",
|
|
78
|
+
"@pandacss/preset-panda": "0.38.0",
|
|
79
|
+
"@pandacss/shared": "0.38.0",
|
|
80
|
+
"@pandacss/types": "0.38.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"pkg-types": "1.0.3"
|
|
File without changes
|
|
File without changes
|