@plumeria/utils 19.6.2 → 19.7.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/parser.js +6 -0
- package/dist/stylePropFilter.js +4 -3
- package/package.json +2 -2
package/dist/parser.js
CHANGED
|
@@ -301,6 +301,12 @@ function objectExpressionToObject(node, staticTable, keyframesHashTable, viewTra
|
|
|
301
301
|
const key = getPropertyKey(prop.key, staticTable, keyframesHashTable, viewTransitionHashTable, createThemeHashTable, createThemeObjectTable, createStaticHashTable, createStaticObjectTable);
|
|
302
302
|
if (!key)
|
|
303
303
|
return;
|
|
304
|
+
if (typeof key === 'string' &&
|
|
305
|
+
(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.`);
|
|
309
|
+
}
|
|
304
310
|
const val = unwrapExpression(prop.value);
|
|
305
311
|
if (exports.t.isIdentifier(val) || exports.t.isMemberExpression(val)) {
|
|
306
312
|
if (resolveVariable && exports.t.isMemberExpression(val)) {
|
package/dist/stylePropFilter.js
CHANGED
|
@@ -5,7 +5,7 @@ const CORE = '@plumeria/core';
|
|
|
5
5
|
const isIdentifierStart = (c) => (c >= 65 && c <= 90) || (c >= 97 && c <= 122) || c === 95 || c === 36;
|
|
6
6
|
const isNameChar = (c) => isIdentifierStart(c) || (c >= 48 && c <= 57) || c === 46 || c === 45;
|
|
7
7
|
const isSpace = (c) => c === 32 || (c >= 9 && c <= 13);
|
|
8
|
-
const EXPRESSION_BEFORE = new Set(Array.from('(,=:[!&|?{}
|
|
8
|
+
const EXPRESSION_BEFORE = new Set(Array.from('(,=:[!&|?{};+-*%<>~^/', (c) => c.charCodeAt(0)));
|
|
9
9
|
const EXPRESSION_WORDS = new Set([
|
|
10
10
|
'return',
|
|
11
11
|
'yield',
|
|
@@ -202,7 +202,7 @@ const writesAttribute = (source, name) => {
|
|
|
202
202
|
if (end === -1)
|
|
203
203
|
return true;
|
|
204
204
|
i = end;
|
|
205
|
-
previous = 96;
|
|
205
|
+
previous = source.charCodeAt(i) === 123 ? 123 : 96;
|
|
206
206
|
continue;
|
|
207
207
|
}
|
|
208
208
|
if (c === 123) {
|
|
@@ -217,7 +217,7 @@ const writesAttribute = (source, name) => {
|
|
|
217
217
|
if (end === -1)
|
|
218
218
|
return true;
|
|
219
219
|
i = end;
|
|
220
|
-
previous = 96;
|
|
220
|
+
previous = source.charCodeAt(i) === 123 ? 123 : 96;
|
|
221
221
|
continue;
|
|
222
222
|
}
|
|
223
223
|
if (kind === 'attribute') {
|
|
@@ -237,6 +237,7 @@ const writesAttribute = (source, name) => {
|
|
|
237
237
|
source.charCodeAt(previousEnd - 2) === previous;
|
|
238
238
|
const expressionStart = previous === 0 ||
|
|
239
239
|
(EXPRESSION_BEFORE.has(previous) && !afterUpdate) ||
|
|
240
|
+
(previous === 46 && source.startsWith('...', previousEnd - 3)) ||
|
|
240
241
|
(isNameChar(previous) &&
|
|
241
242
|
EXPRESSION_WORDS.has(wordBefore(source, previousEnd)));
|
|
242
243
|
if (c === 47 && expressionStart) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/utils",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.7.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.
|
|
28
|
+
"zss-engine": "2.8.2"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public",
|