@bamboocss/parser 1.14.0 → 1.15.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/index.cjs +16 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.mjs +16 -0
- package/package.json +10 -10
package/dist/index.cjs
CHANGED
|
@@ -482,6 +482,7 @@ var ParserResult = class {
|
|
|
482
482
|
cva = /* @__PURE__ */ new Set();
|
|
483
483
|
sva = /* @__PURE__ */ new Set();
|
|
484
484
|
token = /* @__PURE__ */ new Set();
|
|
485
|
+
viewTransition = /* @__PURE__ */ new Set();
|
|
485
486
|
recipe = /* @__PURE__ */ new Map();
|
|
486
487
|
pattern = /* @__PURE__ */ new Map();
|
|
487
488
|
filePath;
|
|
@@ -560,6 +561,11 @@ var ParserResult = class {
|
|
|
560
561
|
setToken(result) {
|
|
561
562
|
this.token.add(this.append(Object.assign({ type: "token" }, result)));
|
|
562
563
|
}
|
|
564
|
+
setViewTransition(result) {
|
|
565
|
+
this.viewTransition.add(this.append(Object.assign({ type: "viewTransition" }, result)));
|
|
566
|
+
const encoder = this.encoder;
|
|
567
|
+
result.data.forEach((obj) => encoder.processViewTransition(obj));
|
|
568
|
+
}
|
|
563
569
|
setJsx(result) {
|
|
564
570
|
this.jsx.add(this.append(Object.assign({ type: "jsx" }, result)));
|
|
565
571
|
const encoder = this.encoder;
|
|
@@ -601,6 +607,7 @@ var ParserResult = class {
|
|
|
601
607
|
result.cva.forEach((item) => this.cva.add(this.append(item)));
|
|
602
608
|
result.sva.forEach((item) => this.sva.add(this.append(item)));
|
|
603
609
|
result.token.forEach((item) => this.token.add(this.append(item)));
|
|
610
|
+
result.viewTransition.forEach((item) => this.viewTransition.add(this.append(item)));
|
|
604
611
|
result.jsx.forEach((item) => this.jsx.add(this.append(item)));
|
|
605
612
|
result.recipe.forEach((items, name) => {
|
|
606
613
|
const set = (0, _bamboocss_shared.getOrCreateSet)(this.recipe, name);
|
|
@@ -621,6 +628,7 @@ var ParserResult = class {
|
|
|
621
628
|
cva: Array.from(this.cva),
|
|
622
629
|
sva: Array.from(this.sva),
|
|
623
630
|
token: Array.from(this.token),
|
|
631
|
+
viewTransition: Array.from(this.viewTransition),
|
|
624
632
|
jsx: Array.from(this.jsx),
|
|
625
633
|
recipe: Object.fromEntries(Array.from(this.recipe.entries()).map(([key, value]) => [key, Array.from(value)])),
|
|
626
634
|
pattern: Object.fromEntries(Array.from(this.pattern.entries()).map(([key, value]) => [key, Array.from(value)]))
|
|
@@ -754,6 +762,14 @@ function createParser(context) {
|
|
|
754
762
|
data: combineResult((0, _bamboocss_extractor.unbox)(query.box.value[0]))
|
|
755
763
|
});
|
|
756
764
|
});
|
|
765
|
+
}).when((name) => syntax !== "template-literal" && file.isViewTransitionFn(name), (name) => {
|
|
766
|
+
result.queryList.forEach((query) => {
|
|
767
|
+
if (query.kind === "call-expression") parserResult.setViewTransition({
|
|
768
|
+
name,
|
|
769
|
+
box: query.box.value[0] ?? _bamboocss_extractor.box.fallback(query.box),
|
|
770
|
+
data: combineResult((0, _bamboocss_extractor.unbox)(query.box.value[0]))
|
|
771
|
+
});
|
|
772
|
+
});
|
|
757
773
|
}).when(jsx.isJsxFactory, () => {
|
|
758
774
|
result.queryList.forEach((query) => {
|
|
759
775
|
if (query.kind === "call-expression" && query.box.value[1]) {
|
package/dist/index.d.cts
CHANGED
|
@@ -129,6 +129,7 @@ declare class ParserResult implements ParserResultInterface {
|
|
|
129
129
|
cva: Set<ResultItem>;
|
|
130
130
|
sva: Set<ResultItem>;
|
|
131
131
|
token: Set<ResultItem>;
|
|
132
|
+
viewTransition: Set<ResultItem>;
|
|
132
133
|
recipe: Map<string, Set<ResultItem>>;
|
|
133
134
|
pattern: Map<string, Set<ResultItem>>;
|
|
134
135
|
filePath: string | undefined;
|
|
@@ -140,6 +141,7 @@ declare class ParserResult implements ParserResultInterface {
|
|
|
140
141
|
setCva(result: ResultItem): void;
|
|
141
142
|
setSva(result: ResultItem): void;
|
|
142
143
|
setToken(result: ResultItem): void;
|
|
144
|
+
setViewTransition(result: ResultItem): void;
|
|
143
145
|
setJsx(result: ResultItem): void;
|
|
144
146
|
setPattern(name: string, result: ResultItem): void;
|
|
145
147
|
setRecipe(recipeName: string, result: ResultItem): void;
|
|
@@ -152,6 +154,7 @@ declare class ParserResult implements ParserResultInterface {
|
|
|
152
154
|
cva: ResultItem[];
|
|
153
155
|
sva: ResultItem[];
|
|
154
156
|
token: ResultItem[];
|
|
157
|
+
viewTransition: ResultItem[];
|
|
155
158
|
jsx: ResultItem[];
|
|
156
159
|
recipe: {
|
|
157
160
|
[k: string]: ResultItem[];
|
package/dist/index.d.mts
CHANGED
|
@@ -129,6 +129,7 @@ declare class ParserResult implements ParserResultInterface {
|
|
|
129
129
|
cva: Set<ResultItem>;
|
|
130
130
|
sva: Set<ResultItem>;
|
|
131
131
|
token: Set<ResultItem>;
|
|
132
|
+
viewTransition: Set<ResultItem>;
|
|
132
133
|
recipe: Map<string, Set<ResultItem>>;
|
|
133
134
|
pattern: Map<string, Set<ResultItem>>;
|
|
134
135
|
filePath: string | undefined;
|
|
@@ -140,6 +141,7 @@ declare class ParserResult implements ParserResultInterface {
|
|
|
140
141
|
setCva(result: ResultItem): void;
|
|
141
142
|
setSva(result: ResultItem): void;
|
|
142
143
|
setToken(result: ResultItem): void;
|
|
144
|
+
setViewTransition(result: ResultItem): void;
|
|
143
145
|
setJsx(result: ResultItem): void;
|
|
144
146
|
setPattern(name: string, result: ResultItem): void;
|
|
145
147
|
setRecipe(recipeName: string, result: ResultItem): void;
|
|
@@ -152,6 +154,7 @@ declare class ParserResult implements ParserResultInterface {
|
|
|
152
154
|
cva: ResultItem[];
|
|
153
155
|
sva: ResultItem[];
|
|
154
156
|
token: ResultItem[];
|
|
157
|
+
viewTransition: ResultItem[];
|
|
155
158
|
jsx: ResultItem[];
|
|
156
159
|
recipe: {
|
|
157
160
|
[k: string]: ResultItem[];
|
package/dist/index.mjs
CHANGED
|
@@ -481,6 +481,7 @@ var ParserResult = class {
|
|
|
481
481
|
cva = /* @__PURE__ */ new Set();
|
|
482
482
|
sva = /* @__PURE__ */ new Set();
|
|
483
483
|
token = /* @__PURE__ */ new Set();
|
|
484
|
+
viewTransition = /* @__PURE__ */ new Set();
|
|
484
485
|
recipe = /* @__PURE__ */ new Map();
|
|
485
486
|
pattern = /* @__PURE__ */ new Map();
|
|
486
487
|
filePath;
|
|
@@ -559,6 +560,11 @@ var ParserResult = class {
|
|
|
559
560
|
setToken(result) {
|
|
560
561
|
this.token.add(this.append(Object.assign({ type: "token" }, result)));
|
|
561
562
|
}
|
|
563
|
+
setViewTransition(result) {
|
|
564
|
+
this.viewTransition.add(this.append(Object.assign({ type: "viewTransition" }, result)));
|
|
565
|
+
const encoder = this.encoder;
|
|
566
|
+
result.data.forEach((obj) => encoder.processViewTransition(obj));
|
|
567
|
+
}
|
|
562
568
|
setJsx(result) {
|
|
563
569
|
this.jsx.add(this.append(Object.assign({ type: "jsx" }, result)));
|
|
564
570
|
const encoder = this.encoder;
|
|
@@ -600,6 +606,7 @@ var ParserResult = class {
|
|
|
600
606
|
result.cva.forEach((item) => this.cva.add(this.append(item)));
|
|
601
607
|
result.sva.forEach((item) => this.sva.add(this.append(item)));
|
|
602
608
|
result.token.forEach((item) => this.token.add(this.append(item)));
|
|
609
|
+
result.viewTransition.forEach((item) => this.viewTransition.add(this.append(item)));
|
|
603
610
|
result.jsx.forEach((item) => this.jsx.add(this.append(item)));
|
|
604
611
|
result.recipe.forEach((items, name) => {
|
|
605
612
|
const set = getOrCreateSet(this.recipe, name);
|
|
@@ -620,6 +627,7 @@ var ParserResult = class {
|
|
|
620
627
|
cva: Array.from(this.cva),
|
|
621
628
|
sva: Array.from(this.sva),
|
|
622
629
|
token: Array.from(this.token),
|
|
630
|
+
viewTransition: Array.from(this.viewTransition),
|
|
623
631
|
jsx: Array.from(this.jsx),
|
|
624
632
|
recipe: Object.fromEntries(Array.from(this.recipe.entries()).map(([key, value]) => [key, Array.from(value)])),
|
|
625
633
|
pattern: Object.fromEntries(Array.from(this.pattern.entries()).map(([key, value]) => [key, Array.from(value)]))
|
|
@@ -753,6 +761,14 @@ function createParser(context) {
|
|
|
753
761
|
data: combineResult(unbox(query.box.value[0]))
|
|
754
762
|
});
|
|
755
763
|
});
|
|
764
|
+
}).when((name) => syntax !== "template-literal" && file.isViewTransitionFn(name), (name) => {
|
|
765
|
+
result.queryList.forEach((query) => {
|
|
766
|
+
if (query.kind === "call-expression") parserResult.setViewTransition({
|
|
767
|
+
name,
|
|
768
|
+
box: query.box.value[0] ?? box.fallback(query.box),
|
|
769
|
+
data: combineResult(unbox(query.box.value[0]))
|
|
770
|
+
});
|
|
771
|
+
});
|
|
756
772
|
}).when(jsx.isJsxFactory, () => {
|
|
757
773
|
result.queryList.forEach((query) => {
|
|
758
774
|
if (query.kind === "call-expression" && query.box.value[1]) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bamboocss/parser",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0",
|
|
4
4
|
"description": "The static parser for bamboo css",
|
|
5
5
|
"homepage": "https://bamboocss.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,17 +34,17 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"ts-morph": "28.0.0",
|
|
36
36
|
"ts-pattern": "5.9.0",
|
|
37
|
-
"@bamboocss/
|
|
38
|
-
"@bamboocss/
|
|
39
|
-
"@bamboocss/
|
|
40
|
-
"@bamboocss/shared": "1.
|
|
41
|
-
"@bamboocss/
|
|
42
|
-
"@bamboocss/types": "1.
|
|
37
|
+
"@bamboocss/config": "^1.15.0",
|
|
38
|
+
"@bamboocss/core": "^1.15.0",
|
|
39
|
+
"@bamboocss/extractor": "1.15.0",
|
|
40
|
+
"@bamboocss/shared": "1.15.0",
|
|
41
|
+
"@bamboocss/logger": "1.15.0",
|
|
42
|
+
"@bamboocss/types": "1.15.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@bamboocss/generator": "1.
|
|
46
|
-
"@bamboocss/plugin-svelte": "1.
|
|
47
|
-
"@bamboocss/plugin-vue": "1.
|
|
45
|
+
"@bamboocss/generator": "1.15.0",
|
|
46
|
+
"@bamboocss/plugin-svelte": "1.15.0",
|
|
47
|
+
"@bamboocss/plugin-vue": "1.15.0"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "tsdown src/index.ts --format=esm,cjs --dts",
|