@pandacss/studio 0.0.0-dev-20240201214314 → 0.0.0-dev-20240201231741

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/studio",
3
- "version": "0.0.0-dev-20240201214314",
3
+ "version": "0.0.0-dev-20240201231741",
4
4
  "description": "The automated token documentation for Panda CSS",
5
5
  "main": "dist/studio.js",
6
6
  "module": "dist/studio.mjs",
@@ -48,12 +48,12 @@
48
48
  "react": "18.2.0",
49
49
  "react-dom": "18.2.0",
50
50
  "vite": "5.0.12",
51
- "@pandacss/config": "0.0.0-dev-20240201214314",
52
- "@pandacss/logger": "0.0.0-dev-20240201214314",
53
- "@pandacss/shared": "0.0.0-dev-20240201214314",
54
- "@pandacss/token-dictionary": "0.0.0-dev-20240201214314",
55
- "@pandacss/types": "0.0.0-dev-20240201214314",
56
- "@pandacss/astro-plugin-studio": "0.0.0-dev-20240201214314"
51
+ "@pandacss/config": "0.0.0-dev-20240201231741",
52
+ "@pandacss/logger": "0.0.0-dev-20240201231741",
53
+ "@pandacss/shared": "0.0.0-dev-20240201231741",
54
+ "@pandacss/token-dictionary": "0.0.0-dev-20240201231741",
55
+ "@pandacss/astro-plugin-studio": "0.0.0-dev-20240201231741",
56
+ "@pandacss/types": "0.0.0-dev-20240201231741"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@types/react": "18.2.42",
@@ -87,7 +87,7 @@ function walkObject(target, predicate, options = {}) {
87
87
  if (isObject(value) || Array.isArray(value)) {
88
88
  const result = {};
89
89
  for (const [prop, child] of Object.entries(value)) {
90
- const key = getKey?.(prop) ?? prop;
90
+ const key = getKey?.(prop, child) ?? prop;
91
91
  const childPath = [...path, key];
92
92
  if (stop?.(value, childPath)) {
93
93
  return predicate(value, path);
@@ -121,6 +121,14 @@ function toResponsiveObject(values, breakpoints) {
121
121
  return acc;
122
122
  }, {});
123
123
  }
124
+ function normalizeShorthand(styles, context) {
125
+ const { hasShorthand, resolveShorthand } = context.utility;
126
+ return walkObject(styles, (v) => v, {
127
+ getKey: (prop) => {
128
+ return hasShorthand ? resolveShorthand(prop) : prop;
129
+ }
130
+ });
131
+ }
124
132
  function normalizeStyleObject(styles, context, shorthand = true) {
125
133
  const { utility, conditions } = context;
126
134
  const { hasShorthand, resolveShorthand } = utility;
@@ -183,7 +191,7 @@ function createMergeCss(context) {
183
191
  const allStyles = compactStyles(...styles);
184
192
  if (allStyles.length === 1)
185
193
  return allStyles;
186
- return allStyles.map((style) => normalizeStyleObject(style, context));
194
+ return allStyles.map((style) => normalizeShorthand(style, context));
187
195
  }
188
196
  function mergeCss(...styles) {
189
197
  return mergeProps(...resolve(styles));