vue-jsx-vapor 2.0.0 → 2.1.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/api.cjs +2 -8
- package/dist/api.d.cts +1 -4
- package/dist/api.d.ts +1 -4
- package/dist/api.js +1 -7
- package/dist/astro.cjs +4 -4
- package/dist/astro.js +3 -3
- package/dist/{chunk-YGTVDW3A.js → chunk-2FXC3LQS.js} +1 -1
- package/dist/{chunk-JGG42DZI.js → chunk-6KXDH742.js} +2 -14
- package/dist/{chunk-I563YEVV.cjs → chunk-BACJ4NJZ.cjs} +2 -2
- package/dist/{chunk-44HSQ6SC.js → chunk-BULCI54A.js} +1 -1
- package/dist/{chunk-M735SGJG.cjs → chunk-FH74ALLC.cjs} +2 -2
- package/dist/{chunk-IZRO67YR.cjs → chunk-GFRKGJDJ.cjs} +2 -14
- package/dist/{chunk-MGTJQG6U.cjs → chunk-H62XZOLW.cjs} +2 -2
- package/dist/{chunk-BPYHZ47Y.js → chunk-MKQCYQ5T.js} +1 -1
- package/dist/chunk-RGJB4EQM.js +26 -0
- package/dist/chunk-VTXOK4UC.cjs +26 -0
- package/dist/esbuild.cjs +4 -4
- package/dist/esbuild.js +3 -3
- package/dist/index.cjs +90 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +89 -0
- package/dist/jsx-runtime.cjs +16 -0
- package/dist/jsx-runtime.d.cts +1361 -0
- package/dist/jsx-runtime.d.ts +1361 -0
- package/dist/jsx-runtime.js +16 -0
- package/dist/nuxt.cjs +7 -7
- package/dist/nuxt.js +5 -5
- package/dist/raw.cjs +3 -3
- package/dist/raw.js +2 -2
- package/dist/rolldown.cjs +4 -4
- package/dist/rolldown.js +3 -3
- package/dist/rollup.cjs +4 -4
- package/dist/rollup.js +3 -3
- package/dist/rspack.cjs +4 -4
- package/dist/rspack.js +3 -3
- package/dist/unplugin.cjs +4 -4
- package/dist/unplugin.js +3 -3
- package/dist/vite.cjs +5 -5
- package/dist/vite.js +4 -4
- package/dist/webpack.cjs +5 -5
- package/dist/webpack.js +4 -4
- package/package.json +26 -7
- package/dist/chunk-2XDZG77D.js +0 -41
- package/dist/chunk-CROZ7JES.cjs +0 -41
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/jsx-runtime.ts
|
|
2
|
+
import { Fragment, h } from "vue";
|
|
3
|
+
function jsx(type, props, key) {
|
|
4
|
+
const { children } = props;
|
|
5
|
+
delete props.children;
|
|
6
|
+
if (arguments.length > 2) {
|
|
7
|
+
props.key = key;
|
|
8
|
+
}
|
|
9
|
+
return h(type, props, children);
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
Fragment,
|
|
13
|
+
jsx,
|
|
14
|
+
jsx as jsxDEV,
|
|
15
|
+
jsx as jsxs
|
|
16
|
+
};
|
package/dist/nuxt.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkBACJ4NJZcjs = require('./chunk-BACJ4NJZ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('./chunk-
|
|
6
|
+
var _chunkFH74ALLCcjs = require('./chunk-FH74ALLC.cjs');
|
|
7
|
+
require('./chunk-H62XZOLW.cjs');
|
|
8
8
|
require('./chunk-GODVM7NB.cjs');
|
|
9
|
-
require('./chunk-
|
|
10
|
-
require('./chunk-
|
|
9
|
+
require('./chunk-GFRKGJDJ.cjs');
|
|
10
|
+
require('./chunk-VTXOK4UC.cjs');
|
|
11
11
|
|
|
12
12
|
// src/nuxt.ts
|
|
13
13
|
var _kit = require('@nuxt/kit');
|
|
@@ -18,8 +18,8 @@ var nuxt_default = _kit.defineNuxtModule.call(void 0, {
|
|
|
18
18
|
configKey: "unpluginStarter"
|
|
19
19
|
},
|
|
20
20
|
setup(options) {
|
|
21
|
-
_kit.addVitePlugin.call(void 0, () =>
|
|
22
|
-
_kit.addWebpackPlugin.call(void 0, () =>
|
|
21
|
+
_kit.addVitePlugin.call(void 0, () => _chunkBACJ4NJZcjs.vite_default.call(void 0, options));
|
|
22
|
+
_kit.addWebpackPlugin.call(void 0, () => _chunkFH74ALLCcjs.webpack_default.call(void 0, options));
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
|
package/dist/nuxt.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
vite_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2FXC3LQS.js";
|
|
4
4
|
import {
|
|
5
5
|
webpack_default
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-BULCI54A.js";
|
|
7
|
+
import "./chunk-MKQCYQ5T.js";
|
|
8
8
|
import "./chunk-JNAGPWSX.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-6KXDH742.js";
|
|
10
|
+
import "./chunk-RGJB4EQM.js";
|
|
11
11
|
|
|
12
12
|
// src/nuxt.ts
|
|
13
13
|
import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
|
package/dist/raw.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkGFRKGJDJcjs = require('./chunk-GFRKGJDJ.cjs');
|
|
4
|
+
require('./chunk-VTXOK4UC.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
exports.default =
|
|
7
|
+
exports.default = _chunkGFRKGJDJcjs.raw_default;
|
|
8
8
|
|
|
9
9
|
module.exports = exports.default;
|
package/dist/raw.js
CHANGED
package/dist/rolldown.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkH62XZOLWcjs = require('./chunk-H62XZOLW.cjs');
|
|
4
4
|
require('./chunk-GODVM7NB.cjs');
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-GFRKGJDJ.cjs');
|
|
6
|
+
require('./chunk-VTXOK4UC.cjs');
|
|
7
7
|
|
|
8
8
|
// src/rolldown.ts
|
|
9
9
|
var _unplugin = require('unplugin');
|
|
10
|
-
var rolldown_default = _unplugin.createRollupPlugin.call(void 0,
|
|
10
|
+
var rolldown_default = _unplugin.createRollupPlugin.call(void 0, _chunkH62XZOLWcjs.unpluginFactory);
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
exports.default = rolldown_default;
|
package/dist/rolldown.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
unpluginFactory
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MKQCYQ5T.js";
|
|
4
4
|
import "./chunk-JNAGPWSX.js";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-6KXDH742.js";
|
|
6
|
+
import "./chunk-RGJB4EQM.js";
|
|
7
7
|
|
|
8
8
|
// src/rolldown.ts
|
|
9
9
|
import { createRollupPlugin } from "unplugin";
|
package/dist/rollup.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkH62XZOLWcjs = require('./chunk-H62XZOLW.cjs');
|
|
4
4
|
require('./chunk-GODVM7NB.cjs');
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-GFRKGJDJ.cjs');
|
|
6
|
+
require('./chunk-VTXOK4UC.cjs');
|
|
7
7
|
|
|
8
8
|
// src/rollup.ts
|
|
9
|
-
var rollup_default =
|
|
9
|
+
var rollup_default = _chunkH62XZOLWcjs.unplugin_default.rollup;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
exports.default = rollup_default;
|
package/dist/rollup.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
unplugin_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MKQCYQ5T.js";
|
|
4
4
|
import "./chunk-JNAGPWSX.js";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-6KXDH742.js";
|
|
6
|
+
import "./chunk-RGJB4EQM.js";
|
|
7
7
|
|
|
8
8
|
// src/rollup.ts
|
|
9
9
|
var rollup_default = unplugin_default.rollup;
|
package/dist/rspack.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkH62XZOLWcjs = require('./chunk-H62XZOLW.cjs');
|
|
4
4
|
require('./chunk-GODVM7NB.cjs');
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-GFRKGJDJ.cjs');
|
|
6
|
+
require('./chunk-VTXOK4UC.cjs');
|
|
7
7
|
|
|
8
8
|
// src/rspack.ts
|
|
9
|
-
var rspack_default =
|
|
9
|
+
var rspack_default = _chunkH62XZOLWcjs.unplugin_default.rspack;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
exports.default = rspack_default;
|
package/dist/rspack.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
unplugin_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MKQCYQ5T.js";
|
|
4
4
|
import "./chunk-JNAGPWSX.js";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-6KXDH742.js";
|
|
6
|
+
import "./chunk-RGJB4EQM.js";
|
|
7
7
|
|
|
8
8
|
// src/rspack.ts
|
|
9
9
|
var rspack_default = unplugin_default.rspack;
|
package/dist/unplugin.cjs
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkH62XZOLWcjs = require('./chunk-H62XZOLW.cjs');
|
|
6
6
|
require('./chunk-GODVM7NB.cjs');
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
7
|
+
require('./chunk-GFRKGJDJ.cjs');
|
|
8
|
+
require('./chunk-VTXOK4UC.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
exports.default =
|
|
13
|
+
exports.default = _chunkH62XZOLWcjs.unplugin_default; exports.unplugin = _chunkH62XZOLWcjs.unplugin; exports.unpluginFactory = _chunkH62XZOLWcjs.unpluginFactory;
|
package/dist/unplugin.js
CHANGED
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
unplugin,
|
|
3
3
|
unpluginFactory,
|
|
4
4
|
unplugin_default
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MKQCYQ5T.js";
|
|
6
6
|
import "./chunk-JNAGPWSX.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-6KXDH742.js";
|
|
8
|
+
import "./chunk-RGJB4EQM.js";
|
|
9
9
|
export {
|
|
10
10
|
unplugin_default as default,
|
|
11
11
|
unplugin,
|
package/dist/vite.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkBACJ4NJZcjs = require('./chunk-BACJ4NJZ.cjs');
|
|
4
|
+
require('./chunk-H62XZOLW.cjs');
|
|
5
5
|
require('./chunk-GODVM7NB.cjs');
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-GFRKGJDJ.cjs');
|
|
7
|
+
require('./chunk-VTXOK4UC.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.default =
|
|
10
|
+
exports.default = _chunkBACJ4NJZcjs.vite_default;
|
|
11
11
|
|
|
12
12
|
module.exports = exports.default;
|
package/dist/vite.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
vite_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-2FXC3LQS.js";
|
|
4
|
+
import "./chunk-MKQCYQ5T.js";
|
|
5
5
|
import "./chunk-JNAGPWSX.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-6KXDH742.js";
|
|
7
|
+
import "./chunk-RGJB4EQM.js";
|
|
8
8
|
export {
|
|
9
9
|
vite_default as default
|
|
10
10
|
};
|
package/dist/webpack.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkFH74ALLCcjs = require('./chunk-FH74ALLC.cjs');
|
|
4
|
+
require('./chunk-H62XZOLW.cjs');
|
|
5
5
|
require('./chunk-GODVM7NB.cjs');
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-GFRKGJDJ.cjs');
|
|
7
|
+
require('./chunk-VTXOK4UC.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.default =
|
|
10
|
+
exports.default = _chunkFH74ALLCcjs.webpack_default;
|
|
11
11
|
|
|
12
12
|
module.exports = exports.default;
|
package/dist/webpack.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
webpack_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-BULCI54A.js";
|
|
4
|
+
import "./chunk-MKQCYQ5T.js";
|
|
5
5
|
import "./chunk-JNAGPWSX.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-6KXDH742.js";
|
|
7
|
+
import "./chunk-RGJB4EQM.js";
|
|
8
8
|
export {
|
|
9
9
|
webpack_default as default
|
|
10
10
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-jsx-vapor",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Convert Vue JSX to Vapor",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -89,6 +89,16 @@
|
|
|
89
89
|
"require": "./dist/unplugin.cjs",
|
|
90
90
|
"import": "./dist/unplugin.js"
|
|
91
91
|
},
|
|
92
|
+
"./jsx-runtime": {
|
|
93
|
+
"dev": "./src/jsx-runtime.ts",
|
|
94
|
+
"require": "./dist/jsx-runtime.cjs",
|
|
95
|
+
"default": "./dist/jsx-runtime.js"
|
|
96
|
+
},
|
|
97
|
+
"./jsx-dev-runtime": {
|
|
98
|
+
"dev": "./src/jsx-runtime.ts",
|
|
99
|
+
"require": "./dist/jsx-runtime.cjs",
|
|
100
|
+
"default": "./dist/jsx-runtime.js"
|
|
101
|
+
},
|
|
92
102
|
"./volar": {
|
|
93
103
|
"dev": "./src/volar.ts",
|
|
94
104
|
"require": "./dist/volar.cjs",
|
|
@@ -153,6 +163,14 @@
|
|
|
153
163
|
"require": "./dist/raw.cjs",
|
|
154
164
|
"import": "./dist/raw.js"
|
|
155
165
|
},
|
|
166
|
+
"./jsx-runtime": {
|
|
167
|
+
"require": "./dist/jsx-runtime.cjs",
|
|
168
|
+
"default": "./dist/jsx-runtime.js"
|
|
169
|
+
},
|
|
170
|
+
"./jsx-dev-runtime": {
|
|
171
|
+
"require": "./dist/jsx-runtime.cjs",
|
|
172
|
+
"default": "./dist/jsx-runtime.js"
|
|
173
|
+
},
|
|
156
174
|
"./volar": {
|
|
157
175
|
"require": "./dist/volar.cjs",
|
|
158
176
|
"import": "./dist/volar.js"
|
|
@@ -190,20 +208,21 @@
|
|
|
190
208
|
"dependencies": {
|
|
191
209
|
"@babel/core": "^7.26.8",
|
|
192
210
|
"@babel/plugin-transform-typescript": "^7.26.8",
|
|
193
|
-
"@vue-macros/volar": "3.0.0-beta.
|
|
211
|
+
"@vue-macros/volar": "^3.0.0-beta.5",
|
|
194
212
|
"magic-string-stack": "^0.1.2",
|
|
195
|
-
"ts-macro": "0.1.
|
|
213
|
+
"ts-macro": "^0.1.25",
|
|
196
214
|
"unplugin": "^1.16.1",
|
|
197
215
|
"unplugin-utils": "^0.2.4",
|
|
198
|
-
"@vue-jsx-vapor/babel": "2.
|
|
199
|
-
"@vue-jsx-vapor/compiler": "2.
|
|
200
|
-
"@vue-jsx-vapor/macros": "2.
|
|
216
|
+
"@vue-jsx-vapor/babel": "2.1.0",
|
|
217
|
+
"@vue-jsx-vapor/compiler": "2.1.0",
|
|
218
|
+
"@vue-jsx-vapor/macros": "2.1.0"
|
|
201
219
|
},
|
|
202
220
|
"devDependencies": {
|
|
203
221
|
"@nuxt/kit": "^3.16.0",
|
|
204
222
|
"@nuxt/schema": "^3.16.0",
|
|
205
223
|
"@types/babel__core": "^7.20.5",
|
|
206
|
-
"
|
|
224
|
+
"csstype": "^3.1.3",
|
|
225
|
+
"vue": "https://pkg.pr.new/vue@34957eb"
|
|
207
226
|
},
|
|
208
227
|
"scripts": {
|
|
209
228
|
"build": "tsup",
|
package/dist/chunk-2XDZG77D.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
// src/core/index.ts
|
|
2
|
-
import { transformSync } from "@babel/core";
|
|
3
|
-
import babelTypescript from "@babel/plugin-transform-typescript";
|
|
4
|
-
import jsx from "@vue-jsx-vapor/babel";
|
|
5
|
-
|
|
6
|
-
// src/core/helper/code.js?raw
|
|
7
|
-
var code_default = 'import {\n effectScope,\n insert,\n isFragment,\n remove,\n renderEffect,\n VaporFragment\n} from "vue";\nfunction createFragment(nodes) {\n const frag = new VaporFragment(nodes);\n frag.anchor = document.createTextNode("");\n return frag;\n}\nfunction normalizeValue(value) {\n return value == null || typeof value === "boolean" ? document.createTextNode("") : value instanceof Node || isFragment(value) ? value : Array.isArray(value) ? createFragment(value.map(normalizeValue)) : document.createTextNode(String(value));\n}\nfunction resolveValue(current, value) {\n const node = normalizeValue(value);\n if (current) {\n if (isFragment(current)) {\n const { anchor } = current;\n if (anchor.parentNode) {\n remove(current.nodes, anchor.parentNode);\n insert(node, anchor.parentNode, anchor);\n anchor.remove();\n }\n } else if (current.nodeType) {\n if (isFragment(node) && current.parentNode) {\n insert(node, current.parentNode, current);\n current.remove();\n } else if (current.nodeType === 3 && node.nodeType === 3) {\n current.textContent = node.textContent;\n return current;\n } else {\n current.parentNode.replaceChild(node, current);\n }\n }\n }\n return node;\n}\nfunction resolveValues(values = []) {\n const nodes = [];\n const scopes = [];\n for (const [index, value] of values.entries()) {\n if (typeof value === "function") {\n renderEffect(() => {\n if (scopes[index]) {\n scopes[index].stop();\n }\n scopes[index] = effectScope();\n scopes[index].run(() => {\n nodes[index] = resolveValue(nodes[index], value());\n });\n });\n } else {\n nodes[index] = resolveValue(nodes[index], value);\n }\n }\n return nodes;\n}\nexport function setText(parent, ...values) {\n insert(resolveValues(values), parent);\n}\nexport function createTextNode(...values) {\n return resolveValues(values);\n}\n';
|
|
8
|
-
|
|
9
|
-
// src/core/helper/index.ts
|
|
10
|
-
var helperPrefix = `vue-jsx-vapor/helper`;
|
|
11
|
-
var helperId = `${helperPrefix}.js`;
|
|
12
|
-
|
|
13
|
-
// src/core/index.ts
|
|
14
|
-
var helperCode = code_default;
|
|
15
|
-
var helperId2 = helperId;
|
|
16
|
-
var helperPrefix2 = helperPrefix;
|
|
17
|
-
function transformVueJsxVapor(code, id, options) {
|
|
18
|
-
const result = transformSync(code, {
|
|
19
|
-
plugins: [
|
|
20
|
-
[jsx, { compile: options?.compile, interop: options?.interop }],
|
|
21
|
-
id.endsWith(".tsx") ? [babelTypescript, { isTSX: true, allowExtensions: true }] : null
|
|
22
|
-
].filter((i) => i !== null),
|
|
23
|
-
filename: id,
|
|
24
|
-
sourceMaps: true,
|
|
25
|
-
sourceFileName: id,
|
|
26
|
-
babelrc: false,
|
|
27
|
-
configFile: false
|
|
28
|
-
});
|
|
29
|
-
if (result?.code)
|
|
30
|
-
return {
|
|
31
|
-
code: result.code,
|
|
32
|
-
map: result.map
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export {
|
|
37
|
-
helperCode,
|
|
38
|
-
helperId2 as helperId,
|
|
39
|
-
helperPrefix2 as helperPrefix,
|
|
40
|
-
transformVueJsxVapor
|
|
41
|
-
};
|
package/dist/chunk-CROZ7JES.cjs
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/core/index.ts
|
|
2
|
-
var _core = require('@babel/core');
|
|
3
|
-
var _plugintransformtypescript = require('@babel/plugin-transform-typescript'); var _plugintransformtypescript2 = _interopRequireDefault(_plugintransformtypescript);
|
|
4
|
-
var _babel = require('@vue-jsx-vapor/babel'); var _babel2 = _interopRequireDefault(_babel);
|
|
5
|
-
|
|
6
|
-
// src/core/helper/code.js?raw
|
|
7
|
-
var code_default = 'import {\n effectScope,\n insert,\n isFragment,\n remove,\n renderEffect,\n VaporFragment\n} from "vue";\nfunction createFragment(nodes) {\n const frag = new VaporFragment(nodes);\n frag.anchor = document.createTextNode("");\n return frag;\n}\nfunction normalizeValue(value) {\n return value == null || typeof value === "boolean" ? document.createTextNode("") : value instanceof Node || isFragment(value) ? value : Array.isArray(value) ? createFragment(value.map(normalizeValue)) : document.createTextNode(String(value));\n}\nfunction resolveValue(current, value) {\n const node = normalizeValue(value);\n if (current) {\n if (isFragment(current)) {\n const { anchor } = current;\n if (anchor.parentNode) {\n remove(current.nodes, anchor.parentNode);\n insert(node, anchor.parentNode, anchor);\n anchor.remove();\n }\n } else if (current.nodeType) {\n if (isFragment(node) && current.parentNode) {\n insert(node, current.parentNode, current);\n current.remove();\n } else if (current.nodeType === 3 && node.nodeType === 3) {\n current.textContent = node.textContent;\n return current;\n } else {\n current.parentNode.replaceChild(node, current);\n }\n }\n }\n return node;\n}\nfunction resolveValues(values = []) {\n const nodes = [];\n const scopes = [];\n for (const [index, value] of values.entries()) {\n if (typeof value === "function") {\n renderEffect(() => {\n if (scopes[index]) {\n scopes[index].stop();\n }\n scopes[index] = effectScope();\n scopes[index].run(() => {\n nodes[index] = resolveValue(nodes[index], value());\n });\n });\n } else {\n nodes[index] = resolveValue(nodes[index], value);\n }\n }\n return nodes;\n}\nexport function setText(parent, ...values) {\n insert(resolveValues(values), parent);\n}\nexport function createTextNode(...values) {\n return resolveValues(values);\n}\n';
|
|
8
|
-
|
|
9
|
-
// src/core/helper/index.ts
|
|
10
|
-
var helperPrefix = `vue-jsx-vapor/helper`;
|
|
11
|
-
var helperId = `${helperPrefix}.js`;
|
|
12
|
-
|
|
13
|
-
// src/core/index.ts
|
|
14
|
-
var helperCode = code_default;
|
|
15
|
-
var helperId2 = helperId;
|
|
16
|
-
var helperPrefix2 = helperPrefix;
|
|
17
|
-
function transformVueJsxVapor(code, id, options) {
|
|
18
|
-
const result = _core.transformSync.call(void 0, code, {
|
|
19
|
-
plugins: [
|
|
20
|
-
[_babel2.default, { compile: _optionalChain([options, 'optionalAccess', _ => _.compile]), interop: _optionalChain([options, 'optionalAccess', _2 => _2.interop]) }],
|
|
21
|
-
id.endsWith(".tsx") ? [_plugintransformtypescript2.default, { isTSX: true, allowExtensions: true }] : null
|
|
22
|
-
].filter((i) => i !== null),
|
|
23
|
-
filename: id,
|
|
24
|
-
sourceMaps: true,
|
|
25
|
-
sourceFileName: id,
|
|
26
|
-
babelrc: false,
|
|
27
|
-
configFile: false
|
|
28
|
-
});
|
|
29
|
-
if (_optionalChain([result, 'optionalAccess', _3 => _3.code]))
|
|
30
|
-
return {
|
|
31
|
-
code: result.code,
|
|
32
|
-
map: result.map
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
exports.helperCode = helperCode; exports.helperId = helperId2; exports.helperPrefix = helperPrefix2; exports.transformVueJsxVapor = transformVueJsxVapor;
|