New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@pandacss/config

Package Overview
Dependencies
Maintainers
1
Versions
1161
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pandacss/config - npm Package Compare versions

Comparing version 0.0.0-dev-20240425193018 to 0.0.0-dev-20240429170712

dist/chunk-F5ESIWB7.mjs

109

dist/index.js

@@ -385,3 +385,3 @@ "use strict";

// src/merge-config.ts
var import_shared4 = require("@pandacss/shared");
var import_shared5 = require("@pandacss/shared");
var import_merge_anything = require("merge-anything");

@@ -502,2 +502,33 @@

// src/validation/utils.ts
var import_shared4 = require("@pandacss/shared");
var REFERENCE_REGEX = /({([^}]*)})/g;
var curlyBracketRegex = /[{}]/g;
var isValidToken = (token) => (0, import_shared4.isObject)(token) && Object.hasOwnProperty.call(token, "value");
var isTokenReference = (value) => typeof value === "string" && REFERENCE_REGEX.test(value);
var formatPath = (path2) => path2;
var SEP = ".";
function getReferences(value) {
if (typeof value !== "string")
return [];
const matches = value.match(REFERENCE_REGEX);
if (!matches)
return [];
return matches.map((match) => match.replace(curlyBracketRegex, "")).map((value2) => {
return value2.trim().split("/")[0];
});
}
var serializeTokenValue = (value) => {
if ((0, import_shared4.isString)(value)) {
return value;
}
if ((0, import_shared4.isObject)(value)) {
return Object.values(value).map((v) => serializeTokenValue(v)).join(" ");
}
if (Array.isArray(value)) {
return value.map((v) => serializeTokenValue(v)).join(" ");
}
return value.toString();
};
// src/merge-config.ts

@@ -508,3 +539,3 @@ function getExtends(items) {

return merged;
return (0, import_shared4.mergeWith)(merged, extend, (originalValue, newValue) => {
return (0, import_shared5.mergeWith)(merged, extend, (originalValue, newValue) => {
if (newValue === void 0) {

@@ -525,3 +556,3 @@ return originalValue ?? [];

return {
...records.reduce((acc, record) => (0, import_shared4.assign)(acc, record), {}),
...records.reduce((acc, record) => (0, import_shared5.assign)(acc, record), {}),
extend: getExtends(records)

@@ -532,3 +563,3 @@ };

const { extend = [], ...restProps } = mergeRecords(records);
return (0, import_shared4.mergeWith)(restProps, extend, (obj, extensions) => {
return (0, import_shared5.mergeWith)(restProps, extend, (obj, extensions) => {
return (0, import_merge_anything.mergeAndConcat)({}, obj, ...extensions);

@@ -546,3 +577,3 @@ });

};
var tokenKeys = ["description", "extensions", "type", "value"];
var tokenKeys = ["description", "extensions", "type", "value", "deprecated"];
function mergeConfigs(configs2) {

@@ -554,3 +585,3 @@ const [userConfig] = configs2;

}
const mergedResult = (0, import_shared4.assign)(
const mergedResult = (0, import_shared5.assign)(
{

@@ -571,14 +602,19 @@ conditions: mergeExtensions(configs2.map((config) => config.conditions ?? {})),

if (withoutEmpty.theme?.tokens) {
(0, import_shared4.traverse)(withoutEmpty.theme.tokens, (args) => args, {
stop(args) {
if ((0, import_shared4.isObject)(args.value) && "value" in args.value) {
const keys = Object.keys(args.value);
if (keys.filter((k) => !tokenKeys.includes(k)).length) {
const { type: _type, description: _description, extensions: _extensions, value, DEFAULT } = args.value;
args.value.DEFAULT = { value: DEFAULT?.value ?? value };
delete args.value.value;
}
return true;
(0, import_shared5.walkObject)(withoutEmpty.theme.tokens, (args) => args, {
stop(token) {
if (!isValidToken(token))
return false;
const keys = Object.keys(token);
const nestedKeys = keys.filter((k) => !tokenKeys.includes(k));
const nested = nestedKeys.length > 0;
if (nested) {
token.DEFAULT ||= {};
tokenKeys.forEach((key) => {
if (token[key] == null)
return;
token.DEFAULT[key] ||= token[key];
delete token[key];
});
}
return false;
return true;
}

@@ -649,3 +685,3 @@ });

// src/validation/validate-breakpoints.ts
var import_shared5 = require("@pandacss/shared");
var import_shared6 = require("@pandacss/shared");
var validateBreakpoints = (breakpoints, addError) => {

@@ -657,3 +693,3 @@ if (!breakpoints)

for (const value of values) {
const unit = (0, import_shared5.getUnit)(value) ?? "px";
const unit = (0, import_shared6.getUnit)(value) ?? "px";
units.add(unit);

@@ -667,3 +703,3 @@ }

// src/validation/validate-condition.ts
var import_shared6 = require("@pandacss/shared");
var import_shared7 = require("@pandacss/shared");
var validateConditions = (conditions, addError) => {

@@ -673,3 +709,3 @@ if (!conditions)

Object.values(conditions).forEach((condition) => {
if ((0, import_shared6.isString)(condition)) {
if ((0, import_shared7.isString)(condition)) {
if (!condition.startsWith("@") && !condition.includes("&")) {

@@ -721,33 +757,2 @@ addError("conditions", `Selectors should contain the \`&\` character: \`${condition}\``);

// src/validation/utils.ts
var import_shared7 = require("@pandacss/shared");
var REFERENCE_REGEX = /({([^}]*)})/g;
var curlyBracketRegex = /[{}]/g;
var isValidToken = (token) => Object.hasOwnProperty.call(token, "value");
var isTokenReference = (value) => typeof value === "string" && REFERENCE_REGEX.test(value);
var formatPath = (path2) => path2;
var SEP = ".";
function getReferences(value) {
if (typeof value !== "string")
return [];
const matches = value.match(REFERENCE_REGEX);
if (!matches)
return [];
return matches.map((match) => match.replace(curlyBracketRegex, "")).map((value2) => {
return value2.trim().split("/")[0];
});
}
var serializeTokenValue = (value) => {
if ((0, import_shared7.isString)(value)) {
return value;
}
if ((0, import_shared7.isObject)(value)) {
return Object.values(value).map((v) => serializeTokenValue(v)).join(" ");
}
if (Array.isArray(value)) {
return value.map((v) => serializeTokenValue(v)).join(" ");
}
return value.toString();
};
// src/validation/validate-token-references.ts

@@ -754,0 +759,0 @@ var validateTokenReferences = (props) => {

@@ -26,3 +26,3 @@ "use strict";

module.exports = __toCommonJS(merge_config_exports);
var import_shared = require("@pandacss/shared");
var import_shared2 = require("@pandacss/shared");
var import_merge_anything = require("merge-anything");

@@ -143,2 +143,6 @@

// src/validation/utils.ts
var import_shared = require("@pandacss/shared");
var isValidToken = (token) => (0, import_shared.isObject)(token) && Object.hasOwnProperty.call(token, "value");
// src/merge-config.ts

@@ -149,3 +153,3 @@ function getExtends(items) {

return merged;
return (0, import_shared.mergeWith)(merged, extend, (originalValue, newValue) => {
return (0, import_shared2.mergeWith)(merged, extend, (originalValue, newValue) => {
if (newValue === void 0) {

@@ -166,3 +170,3 @@ return originalValue ?? [];

return {
...records.reduce((acc, record) => (0, import_shared.assign)(acc, record), {}),
...records.reduce((acc, record) => (0, import_shared2.assign)(acc, record), {}),
extend: getExtends(records)

@@ -173,3 +177,3 @@ };

const { extend = [], ...restProps } = mergeRecords(records);
return (0, import_shared.mergeWith)(restProps, extend, (obj, extensions) => {
return (0, import_shared2.mergeWith)(restProps, extend, (obj, extensions) => {
return (0, import_merge_anything.mergeAndConcat)({}, obj, ...extensions);

@@ -187,3 +191,3 @@ });

};
var tokenKeys = ["description", "extensions", "type", "value"];
var tokenKeys = ["description", "extensions", "type", "value", "deprecated"];
function mergeConfigs(configs) {

@@ -195,3 +199,3 @@ const [userConfig] = configs;

}
const mergedResult = (0, import_shared.assign)(
const mergedResult = (0, import_shared2.assign)(
{

@@ -212,14 +216,19 @@ conditions: mergeExtensions(configs.map((config) => config.conditions ?? {})),

if (withoutEmpty.theme?.tokens) {
(0, import_shared.traverse)(withoutEmpty.theme.tokens, (args) => args, {
stop(args) {
if ((0, import_shared.isObject)(args.value) && "value" in args.value) {
const keys = Object.keys(args.value);
if (keys.filter((k) => !tokenKeys.includes(k)).length) {
const { type: _type, description: _description, extensions: _extensions, value, DEFAULT } = args.value;
args.value.DEFAULT = { value: DEFAULT?.value ?? value };
delete args.value.value;
}
return true;
(0, import_shared2.walkObject)(withoutEmpty.theme.tokens, (args) => args, {
stop(token) {
if (!isValidToken(token))
return false;
const keys = Object.keys(token);
const nestedKeys = keys.filter((k) => !tokenKeys.includes(k));
const nested = nestedKeys.length > 0;
if (nested) {
token.DEFAULT ||= {};
tokenKeys.forEach((key) => {
if (token[key] == null)
return;
token.DEFAULT[key] ||= token[key];
delete token[key];
});
}
return false;
return true;
}

@@ -226,0 +235,0 @@ });

{
"name": "@pandacss/config",
"version": "0.0.0-dev-20240425193018",
"version": "0.0.0-dev-20240429170712",
"description": "Find and load panda config",

@@ -76,7 +76,7 @@ "main": "dist/index.js",

"typescript": "5.3.3",
"@pandacss/logger": "0.0.0-dev-20240425193018",
"@pandacss/preset-base": "0.0.0-dev-20240425193018",
"@pandacss/preset-panda": "0.0.0-dev-20240425193018",
"@pandacss/shared": "0.0.0-dev-20240425193018",
"@pandacss/types": "0.0.0-dev-20240425193018"
"@pandacss/logger": "0.0.0-dev-20240429170712",
"@pandacss/preset-base": "0.0.0-dev-20240429170712",
"@pandacss/preset-panda": "0.0.0-dev-20240429170712",
"@pandacss/shared": "0.0.0-dev-20240429170712",
"@pandacss/types": "0.0.0-dev-20240429170712"
},

@@ -83,0 +83,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc