@plumeria/compiler 0.18.4 → 0.19.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/extract.js +19 -19
- package/package.json +1 -1
package/dist/extract.js
CHANGED
|
@@ -187,9 +187,9 @@ function extractCssKeyframes(code) {
|
|
|
187
187
|
}
|
|
188
188
|
return cssCreateMatches.join('\n');
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function extractCssViewTransition(code) {
|
|
191
191
|
const cssCreateMatches = [];
|
|
192
|
-
const regex = /(?:(?:\s*const\s+[a-zA-Z0-9_$]+\s*=\s*css\.
|
|
192
|
+
const regex = /(?:(?:\s*const\s+[a-zA-Z0-9_$]+\s*=\s*css\.viewTransition\([\s\S]*?\);\s*))/g;
|
|
193
193
|
let match;
|
|
194
194
|
while ((match = regex.exec(code))) {
|
|
195
195
|
if (isInComment(code, match.index) ||
|
|
@@ -201,9 +201,9 @@ function extractCssDefineConsts(code) {
|
|
|
201
201
|
}
|
|
202
202
|
return cssCreateMatches.join('\n');
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function extractCssDefineConsts(code) {
|
|
205
205
|
const cssCreateMatches = [];
|
|
206
|
-
const regex = /(?:(?:\s*const\s+[a-zA-Z0-9_$]+\s*=\s*css\.
|
|
206
|
+
const regex = /(?:(?:\s*const\s+[a-zA-Z0-9_$]+\s*=\s*css\.defineConsts\([\s\S]*?\);\s*))/g;
|
|
207
207
|
let match;
|
|
208
208
|
while ((match = regex.exec(code))) {
|
|
209
209
|
if (isInComment(code, match.index) ||
|
|
@@ -215,9 +215,9 @@ function extractCssDefineVars(code) {
|
|
|
215
215
|
}
|
|
216
216
|
return cssCreateMatches.join('\n');
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function extractCssDefineTokens(code) {
|
|
219
219
|
const cssCreateMatches = [];
|
|
220
|
-
const regex = /(?:(?:\s*const\s+[a-zA-Z0-9_$]+\s*=\s*css\.
|
|
220
|
+
const regex = /(?:(?:\s*const\s+[a-zA-Z0-9_$]+\s*=\s*css\.defineTokens\([\s\S]*?\);\s*))/g;
|
|
221
221
|
let match;
|
|
222
222
|
while ((match = regex.exec(code))) {
|
|
223
223
|
if (isInComment(code, match.index) ||
|
|
@@ -286,9 +286,9 @@ async function extractVueAndSvelte(filePath) {
|
|
|
286
286
|
const staticVariableSection = extractStaticStringLiteralVariable(tsCode);
|
|
287
287
|
const cssCreateSection = extractCssCreate(tsCode);
|
|
288
288
|
const cssKeyframesSection = extractCssKeyframes(tsCode);
|
|
289
|
+
const cssViewTransitionSection = extractCssViewTransition(tsCode);
|
|
289
290
|
const cssDefineConstsSection = extractCssDefineConsts(tsCode);
|
|
290
|
-
const
|
|
291
|
-
const cssDefineThemeSection = extractCssDefineTheme(tsCode);
|
|
291
|
+
const cssDefineTokensSection = extractCssDefineTokens(tsCode);
|
|
292
292
|
let finalCode = '';
|
|
293
293
|
if (importSection) {
|
|
294
294
|
finalCode += importSection + '\n';
|
|
@@ -299,14 +299,14 @@ async function extractVueAndSvelte(filePath) {
|
|
|
299
299
|
if (cssKeyframesSection) {
|
|
300
300
|
finalCode += cssKeyframesSection + '\n';
|
|
301
301
|
}
|
|
302
|
+
if (cssViewTransitionSection) {
|
|
303
|
+
finalCode += cssViewTransitionSection + '\n';
|
|
304
|
+
}
|
|
302
305
|
if (cssDefineConstsSection) {
|
|
303
306
|
finalCode += cssDefineConstsSection + '\n';
|
|
304
307
|
}
|
|
305
|
-
if (
|
|
306
|
-
finalCode +=
|
|
307
|
-
}
|
|
308
|
-
if (cssDefineThemeSection) {
|
|
309
|
-
finalCode += cssDefineThemeSection + '\n';
|
|
308
|
+
if (cssDefineTokensSection) {
|
|
309
|
+
finalCode += cssDefineTokensSection + '\n';
|
|
310
310
|
}
|
|
311
311
|
if (cssCreateSection) {
|
|
312
312
|
finalCode += cssCreateSection + '\n';
|
|
@@ -327,9 +327,9 @@ async function extractTSFile(filePath) {
|
|
|
327
327
|
const staticVariableSection = extractStaticStringLiteralVariable(code);
|
|
328
328
|
const cssCreateSection = extractCssCreate(code);
|
|
329
329
|
const cssKeyframesSection = extractCssKeyframes(code);
|
|
330
|
+
const cssViewTransitionSection = extractCssViewTransition(code);
|
|
330
331
|
const cssDefineConstsSection = extractCssDefineConsts(code);
|
|
331
|
-
const
|
|
332
|
-
const cssDefineThemeSection = extractCssDefineTheme(code);
|
|
332
|
+
const cssDefineTokensSection = extractCssDefineTokens(code);
|
|
333
333
|
const propsMatches = extractCssProps(code);
|
|
334
334
|
const calls = propsMatches
|
|
335
335
|
.filter(Boolean)
|
|
@@ -342,12 +342,12 @@ async function extractTSFile(filePath) {
|
|
|
342
342
|
finalCode += staticVariableSection + '\n';
|
|
343
343
|
if (cssKeyframesSection)
|
|
344
344
|
finalCode += cssKeyframesSection + '\n';
|
|
345
|
+
if (cssViewTransitionSection)
|
|
346
|
+
finalCode += cssViewTransitionSection + '\n';
|
|
345
347
|
if (cssDefineConstsSection)
|
|
346
348
|
finalCode += cssDefineConstsSection + '\n';
|
|
347
|
-
if (
|
|
348
|
-
finalCode +=
|
|
349
|
-
if (cssDefineThemeSection)
|
|
350
|
-
finalCode += cssDefineThemeSection + '\n';
|
|
349
|
+
if (cssDefineTokensSection)
|
|
350
|
+
finalCode += cssDefineTokensSection + '\n';
|
|
351
351
|
if (cssCreateSection)
|
|
352
352
|
finalCode += cssCreateSection + '\n';
|
|
353
353
|
finalCode += calls;
|