@plumeria/utils 19.7.0 → 19.8.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.
Files changed (2) hide show
  1. package/dist/parser.js +10 -5
  2. package/package.json +2 -2
package/dist/parser.js CHANGED
@@ -298,14 +298,19 @@ function objectExpressionToObject(node, staticTable, keyframesHashTable, viewTra
298
298
  }
299
299
  if (!exports.t.isObjectProperty(prop))
300
300
  return;
301
- const key = getPropertyKey(prop.key, staticTable, keyframesHashTable, viewTransitionHashTable, createThemeHashTable, createThemeObjectTable, createStaticHashTable, createStaticObjectTable);
302
- if (!key)
301
+ const rawKey = getPropertyKey(prop.key, staticTable, keyframesHashTable, viewTransitionHashTable, createThemeHashTable, createThemeObjectTable, createStaticHashTable, createStaticObjectTable);
302
+ if (!rawKey)
303
303
  return;
304
+ const key = typeof rawKey === 'string' ? (0, zss_engine_1.stripSelectorComments)(rawKey) : rawKey;
304
305
  if (typeof key === 'string' &&
305
306
  (key.startsWith(':') || key.startsWith('['))) {
306
- const name = (0, zss_engine_1.findSameNameNesting)(key);
307
- if (name)
308
- throw new Error(`[plumeria] "${name}()" cannot be nested inside another "${name}()": "${key}". Rewrite the selector without nesting.`);
307
+ const nesting = (0, zss_engine_1.findInvalidSelector)(key);
308
+ if (nesting?.kind === 'same-name')
309
+ throw new Error(`[plumeria] "${nesting.name}()" cannot be nested inside another "${nesting.name}()": "${key}". Rewrite the selector without nesting.`);
310
+ if (nesting?.kind === 'stray-quote')
311
+ throw new Error(`[plumeria] Unexpected quote in selector: "${key}". Close the string inside brackets or parentheses, or remove the quote.`);
312
+ if (nesting?.kind === 'too-deep')
313
+ throw new Error(`[plumeria] Selector nests deeper than ${zss_engine_1.MAX_SELECTOR_NESTING} levels: "${key}". Rewrite the selector with fewer levels.`);
309
314
  }
310
315
  const val = unwrapExpression(prop.value);
311
316
  if (exports.t.isIdentifier(val) || exports.t.isMemberExpression(val)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/utils",
3
- "version": "19.7.0",
3
+ "version": "19.8.0",
4
4
  "description": "Plumeria Utils",
5
5
  "author": "Refirst 11",
6
6
  "license": "MIT",
@@ -25,7 +25,7 @@
25
25
  "@swc/core": "1.15.47",
26
26
  "lightningcss": "^1.32.0",
27
27
  "postcss": "8.5.26",
28
- "zss-engine": "2.8.2"
28
+ "zss-engine": "2.9.0"
29
29
  },
30
30
  "publishConfig": {
31
31
  "access": "public",