vue-jsx-vapor 2.3.0 → 2.3.2
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 -5
- package/dist/api.d.cts +6 -7
- package/dist/api.d.ts +6 -7
- package/dist/api.js +3 -6
- package/dist/astro.cjs +14 -18
- package/dist/astro.d.cts +4 -5
- package/dist/astro.d.ts +4 -5
- package/dist/astro.js +13 -17
- package/dist/chunk-BCwAaXi7.cjs +31 -0
- package/dist/core-B29W1zp3.cjs +32 -0
- package/dist/core-BDE4GLH8.js +25 -0
- package/dist/esbuild.cjs +12 -14
- package/dist/esbuild.d.cts +6 -7
- package/dist/esbuild.d.ts +6 -7
- package/dist/esbuild.js +8 -10
- package/dist/index.cjs +66 -78
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +59 -80
- package/dist/jsx-runtime.cjs +14 -13
- package/dist/jsx-runtime.d.cts +24 -23
- package/dist/jsx-runtime.d.ts +24 -23
- package/dist/jsx-runtime.js +9 -13
- package/dist/nuxt.cjs +23 -26
- package/dist/nuxt.d.cts +6 -7
- package/dist/nuxt.d.ts +6 -7
- package/dist/nuxt.js +19 -23
- package/dist/options-HYvLzmlg.js +0 -0
- package/dist/options.cjs +1 -1
- package/dist/options.d-BAyccQwr.d.ts +20 -0
- package/dist/options.d-CA70vgwp.d.cts +20 -0
- package/dist/options.d.cts +2 -17
- package/dist/options.d.ts +2 -17
- package/dist/options.js +1 -1
- package/dist/raw-C8eD8f6a.js +214 -0
- package/dist/raw-Dr3UcxgN.cjs +221 -0
- package/dist/raw.cjs +4 -8
- package/dist/raw.d.cts +5 -6
- package/dist/raw.d.ts +5 -6
- package/dist/raw.js +4 -7
- package/dist/rolldown.cjs +14 -15
- package/dist/rolldown.d.cts +6 -7
- package/dist/rolldown.d.ts +6 -7
- package/dist/rolldown.js +9 -11
- package/dist/rollup.cjs +12 -14
- package/dist/rollup.d.cts +6 -7
- package/dist/rollup.d.ts +6 -7
- package/dist/rollup.js +8 -10
- package/dist/rspack.cjs +12 -14
- package/dist/rspack.d.cts +4 -5
- package/dist/rspack.d.ts +4 -5
- package/dist/rspack.js +8 -10
- package/dist/unplugin-BMMTjSOs.js +32 -0
- package/dist/unplugin-ChZxAtQ0.cjs +51 -0
- package/dist/unplugin.cjs +9 -13
- package/dist/unplugin.d.cts +6 -8
- package/dist/unplugin.d.ts +6 -8
- package/dist/unplugin.js +6 -13
- package/dist/vite-BSUI3W42.js +7 -0
- package/dist/vite-D_zoULH4.cjs +13 -0
- package/dist/vite.cjs +8 -12
- package/dist/vite.d.cts +6 -7
- package/dist/vite.d.ts +6 -7
- package/dist/vite.js +7 -10
- package/dist/volar.cjs +18 -18
- package/dist/volar.d.cts +5 -6
- package/dist/volar.d.ts +5 -6
- package/dist/volar.js +12 -13
- package/dist/webpack-BXmoWpIv.cjs +13 -0
- package/dist/webpack-CeYJ9dJv.js +7 -0
- package/dist/webpack.cjs +8 -12
- package/dist/webpack.d.cts +6 -7
- package/dist/webpack.d.ts +6 -7
- package/dist/webpack.js +7 -10
- package/package.json +9 -9
- package/dist/chunk-4HP6QVER.js +0 -10
- package/dist/chunk-F7CI4ATH.cjs +0 -43
- package/dist/chunk-G2KD2VHX.js +0 -43
- package/dist/chunk-GODVM7NB.cjs +0 -1
- package/dist/chunk-GY6DSRCV.cjs +0 -22
- package/dist/chunk-HNBQ42EP.js +0 -10
- package/dist/chunk-M4VKLZSB.cjs +0 -10
- package/dist/chunk-QBIU4H54.cjs +0 -10
- package/dist/chunk-SAJ6WS2A.js +0 -22
- package/dist/chunk-T3F6TYMY.js +0 -265
- package/dist/chunk-VSS2IZIS.cjs +0 -265
- /package/dist/{chunk-JNAGPWSX.js → options-CulFO0WS.cjs} +0 -0
package/dist/api.cjs
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
const require_core = require('./core-B29W1zp3.cjs');
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.transformVueJsxVapor = _chunkGY6DSRCVcjs.transformVueJsxVapor;
|
|
3
|
+
exports.transformVueJsxVapor = require_core.transformVueJsxVapor
|
package/dist/api.d.cts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import '@vue-jsx-vapor/compiler';
|
|
4
|
-
import '@vue-jsx-vapor/macros';
|
|
5
|
-
import 'unplugin-utils';
|
|
1
|
+
import { Options } from "./options.d-CA70vgwp.cjs";
|
|
2
|
+
import { BabelFileResult } from "@babel/core";
|
|
6
3
|
|
|
7
|
-
|
|
4
|
+
//#region src/core/index.d.ts
|
|
5
|
+
declare function transformVueJsxVapor(code: string, id: string, options?: Options, needSourceMap?: boolean): BabelFileResult | null;
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
//#endregion
|
|
8
|
+
export { Options, transformVueJsxVapor };
|
package/dist/api.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import '@vue-jsx-vapor/compiler';
|
|
4
|
-
import '@vue-jsx-vapor/macros';
|
|
5
|
-
import 'unplugin-utils';
|
|
1
|
+
import { Options } from "./options.d-BAyccQwr.js";
|
|
2
|
+
import { BabelFileResult } from "@babel/core";
|
|
6
3
|
|
|
7
|
-
|
|
4
|
+
//#region src/core/index.d.ts
|
|
5
|
+
declare function transformVueJsxVapor(code: string, id: string, options?: Options, needSourceMap?: boolean): BabelFileResult | null;
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
//#endregion
|
|
8
|
+
export { Options, transformVueJsxVapor };
|
package/dist/api.js
CHANGED
package/dist/astro.cjs
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
+
require('./core-B29W1zp3.cjs');
|
|
4
|
+
require('./raw-Dr3UcxgN.cjs');
|
|
5
|
+
require('./options-CulFO0WS.cjs');
|
|
6
|
+
const require_unplugin = require('./unplugin-ChZxAtQ0.cjs');
|
|
2
7
|
|
|
3
|
-
|
|
4
|
-
require('./chunk-GODVM7NB.cjs');
|
|
5
|
-
require('./chunk-VSS2IZIS.cjs');
|
|
6
|
-
require('./chunk-GY6DSRCV.cjs');
|
|
7
|
-
|
|
8
|
-
// src/astro.ts
|
|
8
|
+
//#region src/astro.ts
|
|
9
9
|
var astro_default = (options) => ({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
}
|
|
10
|
+
name: "vue-jsx-vapor",
|
|
11
|
+
hooks: { "astro:config:setup": (astro) => {
|
|
12
|
+
astro.config.vite.plugins ||= [];
|
|
13
|
+
astro.config.vite.plugins.push(require_unplugin.unplugin_default.vite(options));
|
|
14
|
+
} }
|
|
17
15
|
});
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
exports.default = astro_default
|
|
21
|
-
|
|
22
|
-
module.exports = exports.default;
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.default = astro_default
|
package/dist/astro.d.cts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { Options } from
|
|
2
|
-
import '@vue-jsx-vapor/compiler';
|
|
3
|
-
import '@vue-jsx-vapor/macros';
|
|
4
|
-
import 'unplugin-utils';
|
|
1
|
+
import { Options } from "./options.d-CA70vgwp.cjs";
|
|
5
2
|
|
|
3
|
+
//#region src/astro.d.ts
|
|
6
4
|
declare const _default: (options: Options) => {
|
|
7
5
|
name: string;
|
|
8
6
|
hooks: {
|
|
@@ -10,4 +8,5 @@ declare const _default: (options: Options) => {
|
|
|
10
8
|
};
|
|
11
9
|
};
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
//#endregion
|
|
12
|
+
export { _default as default };
|
package/dist/astro.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { Options } from
|
|
2
|
-
import '@vue-jsx-vapor/compiler';
|
|
3
|
-
import '@vue-jsx-vapor/macros';
|
|
4
|
-
import 'unplugin-utils';
|
|
1
|
+
import { Options } from "./options.d-BAyccQwr.js";
|
|
5
2
|
|
|
3
|
+
//#region src/astro.d.ts
|
|
6
4
|
declare const _default: (options: Options) => {
|
|
7
5
|
name: string;
|
|
8
6
|
hooks: {
|
|
@@ -10,4 +8,5 @@ declare const _default: (options: Options) => {
|
|
|
10
8
|
};
|
|
11
9
|
};
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
//#endregion
|
|
12
|
+
export { _default as default };
|
package/dist/astro.js
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import "./
|
|
5
|
-
import "./chunk-T3F6TYMY.js";
|
|
6
|
-
import "./chunk-SAJ6WS2A.js";
|
|
1
|
+
import "./core-BDE4GLH8.js";
|
|
2
|
+
import "./raw-C8eD8f6a.js";
|
|
3
|
+
import "./options-HYvLzmlg.js";
|
|
4
|
+
import { unplugin_default } from "./unplugin-BMMTjSOs.js";
|
|
7
5
|
|
|
8
|
-
|
|
6
|
+
//#region src/astro.ts
|
|
9
7
|
var astro_default = (options) => ({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
}
|
|
8
|
+
name: "vue-jsx-vapor",
|
|
9
|
+
hooks: { "astro:config:setup": (astro) => {
|
|
10
|
+
astro.config.vite.plugins ||= [];
|
|
11
|
+
astro.config.vite.plugins.push(unplugin_default.vite(options));
|
|
12
|
+
} }
|
|
17
13
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { astro_default as default };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//#region rolldown:runtime
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
13
|
+
get: ((k) => from[k]).bind(null, key),
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
20
|
+
value: mod,
|
|
21
|
+
enumerable: true
|
|
22
|
+
}) : target, mod));
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
|
|
26
|
+
Object.defineProperty(exports, '__toESM', {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () {
|
|
29
|
+
return __toESM;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const require_chunk = require('./chunk-BCwAaXi7.cjs');
|
|
3
|
+
const __babel_core = require_chunk.__toESM(require("@babel/core"));
|
|
4
|
+
const __babel_plugin_transform_typescript = require_chunk.__toESM(require("@babel/plugin-transform-typescript"));
|
|
5
|
+
const __vue_jsx_vapor_babel = require_chunk.__toESM(require("@vue-jsx-vapor/babel"));
|
|
6
|
+
|
|
7
|
+
//#region src/core/index.ts
|
|
8
|
+
function transformVueJsxVapor(code, id, options, needSourceMap = false) {
|
|
9
|
+
return (0, __babel_core.transformSync)(code, {
|
|
10
|
+
plugins: [[__vue_jsx_vapor_babel.default, {
|
|
11
|
+
compile: options?.compile,
|
|
12
|
+
interop: options?.interop
|
|
13
|
+
}], ...id.endsWith(".tsx") ? [[__babel_plugin_transform_typescript.default, {
|
|
14
|
+
isTSX: true,
|
|
15
|
+
allowExtensions: true
|
|
16
|
+
}]] : []],
|
|
17
|
+
filename: id,
|
|
18
|
+
sourceMaps: needSourceMap,
|
|
19
|
+
sourceFileName: id,
|
|
20
|
+
babelrc: false,
|
|
21
|
+
configFile: false,
|
|
22
|
+
ast: true
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
Object.defineProperty(exports, 'transformVueJsxVapor', {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () {
|
|
30
|
+
return transformVueJsxVapor;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { transformSync } from "@babel/core";
|
|
2
|
+
import babelTypescript from "@babel/plugin-transform-typescript";
|
|
3
|
+
import jsx from "@vue-jsx-vapor/babel";
|
|
4
|
+
|
|
5
|
+
//#region src/core/index.ts
|
|
6
|
+
function transformVueJsxVapor(code, id, options, needSourceMap = false) {
|
|
7
|
+
return transformSync(code, {
|
|
8
|
+
plugins: [[jsx, {
|
|
9
|
+
compile: options?.compile,
|
|
10
|
+
interop: options?.interop
|
|
11
|
+
}], ...id.endsWith(".tsx") ? [[babelTypescript, {
|
|
12
|
+
isTSX: true,
|
|
13
|
+
allowExtensions: true
|
|
14
|
+
}]] : []],
|
|
15
|
+
filename: id,
|
|
16
|
+
sourceMaps: needSourceMap,
|
|
17
|
+
sourceFileName: id,
|
|
18
|
+
babelrc: false,
|
|
19
|
+
configFile: false,
|
|
20
|
+
ast: true
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { transformVueJsxVapor };
|
package/dist/esbuild.cjs
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
require('./
|
|
5
|
-
require('./
|
|
6
|
-
require('./
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var esbuild_default =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
exports.default = esbuild_default
|
|
13
|
-
|
|
14
|
-
module.exports = exports.default;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
+
require('./core-B29W1zp3.cjs');
|
|
4
|
+
require('./raw-Dr3UcxgN.cjs');
|
|
5
|
+
require('./options-CulFO0WS.cjs');
|
|
6
|
+
const require_unplugin = require('./unplugin-ChZxAtQ0.cjs');
|
|
7
|
+
|
|
8
|
+
//#region src/esbuild.ts
|
|
9
|
+
var esbuild_default = require_unplugin.unplugin_default.esbuild;
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.default = esbuild_default
|
package/dist/esbuild.d.cts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import '@vue-jsx-vapor/compiler';
|
|
4
|
-
import '@vue-jsx-vapor/macros';
|
|
5
|
-
import 'unplugin-utils';
|
|
1
|
+
import { Options } from "./options.d-CA70vgwp.cjs";
|
|
2
|
+
import { Plugin } from "esbuild";
|
|
6
3
|
|
|
7
|
-
|
|
4
|
+
//#region src/esbuild.d.ts
|
|
5
|
+
declare const _default: (options?: Options | undefined) => Plugin;
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
//#endregion
|
|
8
|
+
export { _default as default };
|
package/dist/esbuild.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import '@vue-jsx-vapor/compiler';
|
|
4
|
-
import '@vue-jsx-vapor/macros';
|
|
5
|
-
import 'unplugin-utils';
|
|
1
|
+
import { Options } from "./options.d-BAyccQwr.js";
|
|
2
|
+
import { Plugin } from "esbuild";
|
|
6
3
|
|
|
7
|
-
|
|
4
|
+
//#region src/esbuild.d.ts
|
|
5
|
+
declare const _default: (options?: Options | undefined) => Plugin;
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
//#endregion
|
|
8
|
+
export { _default as default };
|
package/dist/esbuild.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import "./
|
|
5
|
-
import "./chunk-T3F6TYMY.js";
|
|
6
|
-
import "./chunk-SAJ6WS2A.js";
|
|
1
|
+
import "./core-BDE4GLH8.js";
|
|
2
|
+
import "./raw-C8eD8f6a.js";
|
|
3
|
+
import "./options-HYvLzmlg.js";
|
|
4
|
+
import { unplugin_default } from "./unplugin-BMMTjSOs.js";
|
|
7
5
|
|
|
8
|
-
|
|
6
|
+
//#region src/esbuild.ts
|
|
9
7
|
var esbuild_default = unplugin_default.esbuild;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { esbuild_default as default };
|
package/dist/index.cjs
CHANGED
|
@@ -1,92 +1,80 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _vue = require('vue');
|
|
1
|
+
"use strict";
|
|
2
|
+
const require_chunk = require('./chunk-BCwAaXi7.cjs');
|
|
3
|
+
const vue = require_chunk.__toESM(require("vue"));
|
|
10
4
|
|
|
5
|
+
//#region src/core/runtime.ts
|
|
11
6
|
function createFragment(nodes, anchor = document.createTextNode("")) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
const frag = new vue.VaporFragment(nodes);
|
|
8
|
+
frag.anchor = anchor;
|
|
9
|
+
return frag;
|
|
15
10
|
}
|
|
16
11
|
function normalizeValue(value, anchor) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return anchor;
|
|
31
|
-
} else {
|
|
32
|
-
return document.createTextNode(result);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
12
|
+
if (value instanceof Node || (0, vue.isFragment)(value)) {
|
|
13
|
+
anchor && (anchor.textContent = "");
|
|
14
|
+
return value;
|
|
15
|
+
} else if (Array.isArray(value)) {
|
|
16
|
+
anchor && (anchor.textContent = "");
|
|
17
|
+
return createFragment(value.map((i) => normalizeValue(i)), anchor);
|
|
18
|
+
} else {
|
|
19
|
+
const result = value == null || typeof value === "boolean" ? "" : String(value);
|
|
20
|
+
if (anchor) {
|
|
21
|
+
anchor.textContent = result;
|
|
22
|
+
return anchor;
|
|
23
|
+
} else return document.createTextNode(result);
|
|
24
|
+
}
|
|
35
25
|
}
|
|
36
26
|
function resolveValue(current, value, anchor) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
return node;
|
|
27
|
+
const node = normalizeValue(value, anchor);
|
|
28
|
+
if (current) {
|
|
29
|
+
if ((0, vue.isFragment)(current)) {
|
|
30
|
+
const { anchor: anchor$1 } = current;
|
|
31
|
+
if (anchor$1 && anchor$1.parentNode) {
|
|
32
|
+
(0, vue.remove)(current.nodes, anchor$1.parentNode);
|
|
33
|
+
(0, vue.insert)(node, anchor$1.parentNode, anchor$1);
|
|
34
|
+
anchor$1.remove();
|
|
35
|
+
}
|
|
36
|
+
} else if (current instanceof Node) {
|
|
37
|
+
if ((0, vue.isFragment)(node) && current.parentNode) {
|
|
38
|
+
(0, vue.insert)(node, current.parentNode, current);
|
|
39
|
+
current.remove();
|
|
40
|
+
} else if (node instanceof Node) {
|
|
41
|
+
if (current.nodeType === 3 && node.nodeType === 3) {
|
|
42
|
+
current.textContent = node.textContent;
|
|
43
|
+
return current;
|
|
44
|
+
} else if (current.parentNode) current.parentNode.replaceChild(node, current);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return node;
|
|
61
49
|
}
|
|
62
50
|
function resolveValues(values = [], _anchor) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
} else {
|
|
76
|
-
nodes[index] = resolveValue(nodes[index], value, anchor);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return nodes;
|
|
51
|
+
const nodes = [];
|
|
52
|
+
const scopes = [];
|
|
53
|
+
for (const [index, value] of values.entries()) {
|
|
54
|
+
const anchor = index === values.length - 1 ? _anchor : void 0;
|
|
55
|
+
if (typeof value === "function") (0, vue.renderEffect)(() => {
|
|
56
|
+
if (scopes[index]) scopes[index].stop();
|
|
57
|
+
scopes[index] = (0, vue.effectScope)();
|
|
58
|
+
nodes[index] = scopes[index].run(() => resolveValue(nodes[index], value(), anchor));
|
|
59
|
+
});
|
|
60
|
+
else nodes[index] = resolveValue(nodes[index], value, anchor);
|
|
61
|
+
}
|
|
62
|
+
return nodes;
|
|
80
63
|
}
|
|
81
64
|
function setNodes(anchor, ...values) {
|
|
82
|
-
|
|
83
|
-
|
|
65
|
+
const resolvedValues = resolveValues(values, anchor);
|
|
66
|
+
anchor.parentNode && (0, vue.insert)(resolvedValues, anchor.parentNode, anchor);
|
|
84
67
|
}
|
|
85
68
|
function createNodes(...values) {
|
|
86
|
-
|
|
69
|
+
return resolveValues(values);
|
|
87
70
|
}
|
|
88
71
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
72
|
+
//#endregion
|
|
73
|
+
exports.createNodes = createNodes
|
|
74
|
+
exports.setNodes = setNodes
|
|
75
|
+
Object.defineProperty(exports, 'useRef', {
|
|
76
|
+
enumerable: true,
|
|
77
|
+
get: function () {
|
|
78
|
+
return vue.shallowRef;
|
|
79
|
+
}
|
|
80
|
+
});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { shallowRef as useRef } from 'vue';
|
|
1
|
+
import { shallowRef as useRef } from "vue";
|
|
3
2
|
|
|
3
|
+
//#region src/core/runtime.d.ts
|
|
4
4
|
declare function setNodes(anchor: Element, ...values: any[]): void;
|
|
5
5
|
declare function createNodes(...values: any[]): Block[];
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
//#endregion
|
|
8
|
+
export { createNodes, setNodes, useRef };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { shallowRef as useRef } from 'vue';
|
|
1
|
+
import { shallowRef as useRef } from "vue";
|
|
3
2
|
|
|
3
|
+
//#region src/core/runtime.d.ts
|
|
4
4
|
declare function setNodes(anchor: Element, ...values: any[]): void;
|
|
5
5
|
declare function createNodes(...values: any[]): Block[];
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
//#endregion
|
|
8
|
+
export { createNodes, setNodes, useRef };
|