@vue-jsx-vapor/macros 2.1.5 → 2.1.7
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 -2
- package/dist/api.js +1 -1
- package/dist/astro.cjs +5 -5
- package/dist/astro.js +4 -4
- package/dist/{chunk-Y5EBYHAU.cjs → chunk-35H4MC4N.cjs} +8 -8
- package/dist/{chunk-UZ426MO6.cjs → chunk-53TNKVYD.cjs} +1 -4
- package/dist/{chunk-ZXRSELD6.js → chunk-DANY2WQD.js} +1 -4
- package/dist/{chunk-YRPLEEOM.cjs → chunk-JWJVYLYI.cjs} +2 -2
- package/dist/{chunk-JS6XU4SQ.cjs → chunk-LPH34H6O.cjs} +13 -14
- package/dist/{chunk-LLVVZVJJ.js → chunk-LVZNHMZC.js} +1 -1
- package/dist/{chunk-WWH3HXFC.cjs → chunk-NL4CWOW2.cjs} +2 -2
- package/dist/{chunk-75S7E24B.js → chunk-RC5ZHWIN.js} +1 -1
- package/dist/{chunk-JKT6AV5O.js → chunk-TWP2JCYQ.js} +13 -14
- package/dist/{chunk-IN7QS6NY.js → chunk-WOWB5VHY.js} +2 -2
- package/dist/{chunk-3PWNZD2U.js → chunk-WZIZSQGW.js} +1 -1
- package/dist/{chunk-KHR56IGI.cjs → chunk-YCL7HGD4.cjs} +2 -2
- package/dist/esbuild.cjs +5 -5
- package/dist/esbuild.js +4 -4
- package/dist/index.cjs +5 -5
- package/dist/index.js +4 -4
- package/dist/nuxt.cjs +8 -8
- package/dist/nuxt.js +6 -6
- package/dist/options.cjs +2 -2
- package/dist/options.d.cts +1 -2
- package/dist/options.d.ts +1 -2
- package/dist/options.js +1 -1
- package/dist/raw.cjs +4 -4
- package/dist/raw.js +3 -3
- package/dist/rolldown.cjs +5 -5
- package/dist/rolldown.js +4 -4
- package/dist/rollup.cjs +5 -5
- package/dist/rollup.js +4 -4
- package/dist/rspack.cjs +5 -5
- package/dist/rspack.js +4 -4
- package/dist/vite.cjs +6 -6
- package/dist/vite.js +5 -5
- package/dist/volar.cjs +14 -7
- package/dist/volar.js +13 -6
- package/dist/webpack.cjs +6 -6
- package/dist/webpack.js +5 -5
- package/package.json +5 -5
package/dist/api.cjs
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkLPH34H6Ocjs = require('./chunk-LPH34H6O.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.getMacroExpression =
|
|
14
|
+
exports.getMacroExpression = _chunkLPH34H6Ocjs.getMacroExpression; exports.getParamsStart = _chunkLPH34H6Ocjs.getParamsStart; exports.isFunctionalNode = _chunkLPH34H6Ocjs.isFunctionalNode; exports.restructure = _chunkLPH34H6Ocjs.restructure; exports.transformJsxMacros = _chunkLPH34H6Ocjs.transformJsxMacros;
|
package/dist/api.js
CHANGED
package/dist/astro.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
3
|
+
var _chunkJWJVYLYIcjs = require('./chunk-JWJVYLYI.cjs');
|
|
4
|
+
require('./chunk-35H4MC4N.cjs');
|
|
5
|
+
require('./chunk-LPH34H6O.cjs');
|
|
6
|
+
require('./chunk-53TNKVYD.cjs');
|
|
7
7
|
|
|
8
8
|
// src/astro.ts
|
|
9
9
|
var astro_default = (options) => ({
|
|
@@ -11,7 +11,7 @@ var astro_default = (options) => ({
|
|
|
11
11
|
hooks: {
|
|
12
12
|
"astro:config:setup": (astro) => {
|
|
13
13
|
astro.config.vite.plugins ||= [];
|
|
14
|
-
astro.config.vite.plugins.push(
|
|
14
|
+
astro.config.vite.plugins.push(_chunkJWJVYLYIcjs.index_default.vite(options));
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
});
|
package/dist/astro.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
index_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-LVZNHMZC.js";
|
|
4
|
+
import "./chunk-WOWB5VHY.js";
|
|
5
|
+
import "./chunk-TWP2JCYQ.js";
|
|
6
|
+
import "./chunk-DANY2WQD.js";
|
|
7
7
|
|
|
8
8
|
// src/astro.ts
|
|
9
9
|
var astro_default = (options) => ({
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkLPH34H6Ocjs = require('./chunk-LPH34H6O.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunk53TNKVYDcjs = require('./chunk-53TNKVYD.cjs');
|
|
12
12
|
|
|
13
13
|
// src/raw.ts
|
|
14
14
|
var _common = require('@vue-macros/common');
|
|
@@ -30,22 +30,22 @@ async function transformStyle(code, id, options) {
|
|
|
30
30
|
// src/raw.ts
|
|
31
31
|
var name = "@vue-jsx-vapor/macros";
|
|
32
32
|
var plugin = (userOptions = {}) => {
|
|
33
|
-
const options =
|
|
33
|
+
const options = _chunk53TNKVYDcjs.resolveOptions.call(void 0, userOptions);
|
|
34
34
|
const filter = _common.createFilter.call(void 0, options);
|
|
35
35
|
const importMap = /* @__PURE__ */ new Map();
|
|
36
36
|
return {
|
|
37
37
|
name,
|
|
38
38
|
enforce: "pre",
|
|
39
39
|
resolveId(id) {
|
|
40
|
-
if (_common.normalizePath.call(void 0, id).startsWith(
|
|
40
|
+
if (_common.normalizePath.call(void 0, id).startsWith(_chunkLPH34H6Ocjs.helperPrefix)) return id;
|
|
41
41
|
},
|
|
42
42
|
loadInclude(id) {
|
|
43
|
-
return _common.normalizePath.call(void 0, id).startsWith(
|
|
43
|
+
return _common.normalizePath.call(void 0, id).startsWith(_chunkLPH34H6Ocjs.helperPrefix);
|
|
44
44
|
},
|
|
45
45
|
load(_id) {
|
|
46
46
|
const id = _common.normalizePath.call(void 0, _id);
|
|
47
|
-
if (id ===
|
|
48
|
-
else if (id ===
|
|
47
|
+
if (id === _chunkLPH34H6Ocjs.useModelHelperId) return _chunkLPH34H6Ocjs.use_model_default;
|
|
48
|
+
else if (id === _chunkLPH34H6Ocjs.withDefaultsHelperId) return _chunkLPH34H6Ocjs.with_defaults_default;
|
|
49
49
|
else if (importMap.get(id)) return importMap.get(id);
|
|
50
50
|
},
|
|
51
51
|
transformInclude(id) {
|
|
@@ -54,7 +54,7 @@ var plugin = (userOptions = {}) => {
|
|
|
54
54
|
},
|
|
55
55
|
transform(code, id) {
|
|
56
56
|
if (importMap.get(id)) return transformStyle(code, id, options);
|
|
57
|
-
return
|
|
57
|
+
return _chunkLPH34H6Ocjs.transformJsxMacros.call(void 0, code, id, importMap, options);
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
};
|
|
@@ -3,17 +3,14 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
var _common = require('@vue-macros/common');
|
|
8
7
|
function resolveOptions(options) {
|
|
9
|
-
const version = options.version ||
|
|
10
|
-
const lib = options.lib || "vue/vapor";
|
|
8
|
+
const version = options.version || 3.6;
|
|
11
9
|
return {
|
|
12
10
|
include: [_common.REGEX_SRC_FILE],
|
|
13
11
|
exclude: [_common.REGEX_SETUP_SFC, _common.REGEX_NODE_MODULES],
|
|
14
12
|
...options,
|
|
15
13
|
version,
|
|
16
|
-
lib,
|
|
17
14
|
defineComponent: {
|
|
18
15
|
alias: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _ => _.defineComponent, 'optionalAccess', _2 => _2.alias]), () => ( [
|
|
19
16
|
"defineComponent",
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
// src/options.ts
|
|
2
2
|
import {
|
|
3
|
-
detectVueVersion,
|
|
4
3
|
REGEX_NODE_MODULES,
|
|
5
4
|
REGEX_SETUP_SFC,
|
|
6
5
|
REGEX_SRC_FILE
|
|
7
6
|
} from "@vue-macros/common";
|
|
8
7
|
function resolveOptions(options) {
|
|
9
|
-
const version = options.version ||
|
|
10
|
-
const lib = options.lib || "vue/vapor";
|
|
8
|
+
const version = options.version || 3.6;
|
|
11
9
|
return {
|
|
12
10
|
include: [REGEX_SRC_FILE],
|
|
13
11
|
exclude: [REGEX_SETUP_SFC, REGEX_NODE_MODULES],
|
|
14
12
|
...options,
|
|
15
13
|
version,
|
|
16
|
-
lib,
|
|
17
14
|
defineComponent: {
|
|
18
15
|
alias: options?.defineComponent?.alias ?? [
|
|
19
16
|
"defineComponent",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk35H4MC4Ncjs = require('./chunk-35H4MC4N.cjs');
|
|
4
4
|
|
|
5
5
|
// src/index.ts
|
|
6
6
|
var _unplugin = require('unplugin');
|
|
7
|
-
var unplugin = _unplugin.createUnplugin.call(void 0,
|
|
7
|
+
var unplugin = _unplugin.createUnplugin.call(void 0, _chunk35H4MC4Ncjs.raw_default);
|
|
8
8
|
var index_default = unplugin;
|
|
9
9
|
|
|
10
10
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } 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/helper/use-model.ts?raw
|
|
2
|
-
var use_model_default = 'import { customRef, watchSyncEffect } from "vue";\nexport function useModel(props, name, options = {}) {\n const res = customRef((track, trigger) => {\n let localValue = options && options.default;\n let prevEmittedValue;\n watchSyncEffect(() => {\n const propValue = props[name];\n if (!Object.is(prevEmittedValue, propValue)) {\n localValue = propValue;\n trigger();\n }\n });\n return {\n get() {\n track();\n return options.get ? options.get(localValue) : localValue;\n },\n set(value) {\n if (Object.is(value, localValue)) return;\n localValue = value;\n trigger();\n const emittedValue = prevEmittedValue = options.set ? options.set(value) : value;\n for (const emit of [props[`onUpdate:${name}`]].flat()) {\n if (typeof emit === "function") emit(emittedValue);\n }\n }\n };\n });\n
|
|
2
|
+
var use_model_default = 'import { customRef, watchSyncEffect } from "vue";\nexport function useModel(props, name, options = {}) {\n const res = customRef((track, trigger) => {\n let localValue = options && options.default;\n let prevEmittedValue;\n watchSyncEffect(() => {\n const propValue = props[name];\n if (!Object.is(prevEmittedValue, propValue)) {\n localValue = propValue;\n trigger();\n }\n });\n return {\n get() {\n track();\n return options.get ? options.get(localValue) : localValue;\n },\n set(value) {\n if (Object.is(value, localValue)) return;\n localValue = value;\n trigger();\n const emittedValue = prevEmittedValue = options.set ? options.set(value) : value;\n for (const emit of [props[`onUpdate:${name}`]].flat()) {\n if (typeof emit === "function") emit(emittedValue);\n }\n }\n };\n });\n res[Symbol.iterator] = () => {\n let i = 0;\n return {\n next() {\n if (i < 2) {\n return {\n value: i++ ? props[`${name}Modifiers`] || {} : res,\n done: false\n };\n } else {\n return { done: true };\n }\n }\n };\n };\n return res;\n}\n';
|
|
3
3
|
|
|
4
4
|
// src/core/helper/with-defaults.ts?raw
|
|
5
5
|
var with_defaults_default = "function resolveDefaultProps(paths) {\n const result = {};\n for (const path of Object.keys(paths)) {\n const segments = path.split(/[.?[\\]]/).filter(Boolean);\n let current = result;\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n if (i === segments.length - 1) {\n current[segment] = paths[path];\n } else {\n if (!current[segment]) {\n current[segment] = Number.isNaN(Number(segments[i + 1])) ? {} : [];\n }\n current = current[segment];\n }\n }\n }\n return result;\n}\nexport function createPropsDefaultProxy(props, defaults) {\n const defaultProps = resolveDefaultProps(defaults);\n const result = {};\n for (const key of [\n .../* @__PURE__ */ new Set([...Object.keys(props), ...Object.keys(defaultProps)])\n ]) {\n Object.defineProperty(result, key, {\n enumerable: true,\n get: () => props[key] === void 0 ? defaultProps[key] : props[key]\n });\n }\n return result;\n}\n";
|
|
@@ -49,6 +49,7 @@ function restructure(s, node, options = {}) {
|
|
|
49
49
|
s,
|
|
50
50
|
0,
|
|
51
51
|
"createPropsDefaultProxy",
|
|
52
|
+
void 0,
|
|
52
53
|
_nullishCoalesce(options.withDefaultsFrom, () => ( withDefaultsHelperId))
|
|
53
54
|
);
|
|
54
55
|
const resolvedPath = path.replace(
|
|
@@ -73,8 +74,7 @@ const ${path} = ${createPropsDefaultProxy}(${resolvedPath}, {${resolvedValues}})
|
|
|
73
74
|
const ${rest.name} = ${_common.importHelperFn.call(void 0,
|
|
74
75
|
s,
|
|
75
76
|
0,
|
|
76
|
-
"createPropsRestProxy"
|
|
77
|
-
"vue"
|
|
77
|
+
"createPropsRestProxy"
|
|
78
78
|
)}(${rest.path}, [${rest.value}])`))
|
|
79
79
|
);
|
|
80
80
|
}
|
|
@@ -227,8 +227,7 @@ function processAwait(s, node, needSemi, isStatement) {
|
|
|
227
227
|
([__temp,__restore] = ${_common.importHelperFn.call(void 0,
|
|
228
228
|
s,
|
|
229
229
|
0,
|
|
230
|
-
`withAsyncContext
|
|
231
|
-
"vue"
|
|
230
|
+
`withAsyncContext`
|
|
232
231
|
)}(${containsNestedAwait ? `async ` : ``}() => `
|
|
233
232
|
);
|
|
234
233
|
s.appendLeft(
|
|
@@ -246,7 +245,7 @@ function transformDefineComponent(root, propsName, map, s) {
|
|
|
246
245
|
if (!map.defineComponent) return;
|
|
247
246
|
const defineComponentName = s.sliceNode(map.defineComponent.callee);
|
|
248
247
|
if (defineComponentName && !["defineComponent", "defineVaporComponent"].includes(defineComponentName)) {
|
|
249
|
-
_common.importHelperFn.call(void 0, s, 0, "defineComponent",
|
|
248
|
+
_common.importHelperFn.call(void 0, s, 0, "defineComponent", defineComponentName);
|
|
250
249
|
}
|
|
251
250
|
let hasRestProp = false;
|
|
252
251
|
const props = {};
|
|
@@ -258,7 +257,7 @@ function transformDefineComponent(root, propsName, map, s) {
|
|
|
258
257
|
generateRestProps: (restPropsName, index, list) => {
|
|
259
258
|
if (index === list.length - 1) {
|
|
260
259
|
hasRestProp = true;
|
|
261
|
-
const useAttrs = _common.importHelperFn.call(void 0, s, 0, "useAttrs"
|
|
260
|
+
const useAttrs = _common.importHelperFn.call(void 0, s, 0, "useAttrs");
|
|
262
261
|
return `const ${restPropsName} = ${useAttrs}()`;
|
|
263
262
|
}
|
|
264
263
|
}
|
|
@@ -325,11 +324,11 @@ function getWalkedIds(root, propsName) {
|
|
|
325
324
|
|
|
326
325
|
// src/core/define-expose.ts
|
|
327
326
|
|
|
328
|
-
function transformDefineExpose(node, s,
|
|
327
|
+
function transformDefineExpose(node, s, version) {
|
|
329
328
|
s.overwriteNode(node.callee, ";");
|
|
330
329
|
s.appendRight(
|
|
331
330
|
_optionalChain([node, 'access', _28 => _28.arguments, 'access', _29 => _29[0], 'optionalAccess', _30 => _30.start]) || node.end - 1,
|
|
332
|
-
|
|
331
|
+
version >= 3.6 ? `${_common.importHelperFn.call(void 0, s, 0, "currentInstance")}.exposed = ` : `${_common.importHelperFn.call(void 0, s, 0, "getCurrentInstance")}().exposed = `
|
|
333
332
|
);
|
|
334
333
|
}
|
|
335
334
|
|
|
@@ -338,7 +337,7 @@ function transformDefineExpose(node, s, lib) {
|
|
|
338
337
|
function transformDefineModel(node, propsName, s) {
|
|
339
338
|
s.overwriteNode(
|
|
340
339
|
node.callee,
|
|
341
|
-
_common.importHelperFn.call(void 0, s, 0, "useModel", useModelHelperId)
|
|
340
|
+
_common.importHelperFn.call(void 0, s, 0, "useModel", void 0, useModelHelperId)
|
|
342
341
|
);
|
|
343
342
|
s.appendRight(
|
|
344
343
|
_optionalChain([node, 'access', _31 => _31.arguments, 'access', _32 => _32[0], 'optionalAccess', _33 => _33.start]) || node.end - 1,
|
|
@@ -348,13 +347,13 @@ function transformDefineModel(node, propsName, s) {
|
|
|
348
347
|
|
|
349
348
|
// src/core/define-slots.ts
|
|
350
349
|
|
|
351
|
-
function transformDefineSlots(node,
|
|
350
|
+
function transformDefineSlots(node, s) {
|
|
352
351
|
s.overwrite(
|
|
353
352
|
node.start,
|
|
354
353
|
_optionalChain([node, 'access', _37 => _37.arguments, 'access', _38 => _38[0], 'optionalAccess', _39 => _39.start]) && node.arguments[0].start - 1 || _optionalChain([node, 'access', _40 => _40.typeArguments, 'optionalAccess', _41 => _41.end]) || node.callee.end,
|
|
355
354
|
`Object.assign`
|
|
356
355
|
);
|
|
357
|
-
const slots =
|
|
356
|
+
const slots = `${_common.importHelperFn.call(void 0, s, 0, "useSlots")}()`;
|
|
358
357
|
s.appendLeft(node.end - 1, `${node.arguments[0] ? "," : "{}, "}${slots}`);
|
|
359
358
|
}
|
|
360
359
|
|
|
@@ -472,10 +471,10 @@ function transformJsxMacros(code, id, importMap, options) {
|
|
|
472
471
|
});
|
|
473
472
|
}
|
|
474
473
|
if (map.defineSlots) {
|
|
475
|
-
transformDefineSlots(map.defineSlots,
|
|
474
|
+
transformDefineSlots(map.defineSlots, s);
|
|
476
475
|
}
|
|
477
476
|
if (map.defineExpose) {
|
|
478
|
-
transformDefineExpose(map.defineExpose, s, options.
|
|
477
|
+
transformDefineExpose(map.defineExpose, s, options.version);
|
|
479
478
|
}
|
|
480
479
|
}
|
|
481
480
|
return _common.generateTransform.call(void 0, s, id);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkJWJVYLYIcjs = require('./chunk-JWJVYLYI.cjs');
|
|
4
4
|
|
|
5
5
|
// src/webpack.ts
|
|
6
|
-
var webpack_default =
|
|
6
|
+
var webpack_default = _chunkJWJVYLYIcjs.index_default.webpack;
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/core/helper/use-model.ts?raw
|
|
2
|
-
var use_model_default = 'import { customRef, watchSyncEffect } from "vue";\nexport function useModel(props, name, options = {}) {\n const res = customRef((track, trigger) => {\n let localValue = options && options.default;\n let prevEmittedValue;\n watchSyncEffect(() => {\n const propValue = props[name];\n if (!Object.is(prevEmittedValue, propValue)) {\n localValue = propValue;\n trigger();\n }\n });\n return {\n get() {\n track();\n return options.get ? options.get(localValue) : localValue;\n },\n set(value) {\n if (Object.is(value, localValue)) return;\n localValue = value;\n trigger();\n const emittedValue = prevEmittedValue = options.set ? options.set(value) : value;\n for (const emit of [props[`onUpdate:${name}`]].flat()) {\n if (typeof emit === "function") emit(emittedValue);\n }\n }\n };\n });\n
|
|
2
|
+
var use_model_default = 'import { customRef, watchSyncEffect } from "vue";\nexport function useModel(props, name, options = {}) {\n const res = customRef((track, trigger) => {\n let localValue = options && options.default;\n let prevEmittedValue;\n watchSyncEffect(() => {\n const propValue = props[name];\n if (!Object.is(prevEmittedValue, propValue)) {\n localValue = propValue;\n trigger();\n }\n });\n return {\n get() {\n track();\n return options.get ? options.get(localValue) : localValue;\n },\n set(value) {\n if (Object.is(value, localValue)) return;\n localValue = value;\n trigger();\n const emittedValue = prevEmittedValue = options.set ? options.set(value) : value;\n for (const emit of [props[`onUpdate:${name}`]].flat()) {\n if (typeof emit === "function") emit(emittedValue);\n }\n }\n };\n });\n res[Symbol.iterator] = () => {\n let i = 0;\n return {\n next() {\n if (i < 2) {\n return {\n value: i++ ? props[`${name}Modifiers`] || {} : res,\n done: false\n };\n } else {\n return { done: true };\n }\n }\n };\n };\n return res;\n}\n';
|
|
3
3
|
|
|
4
4
|
// src/core/helper/with-defaults.ts?raw
|
|
5
5
|
var with_defaults_default = "function resolveDefaultProps(paths) {\n const result = {};\n for (const path of Object.keys(paths)) {\n const segments = path.split(/[.?[\\]]/).filter(Boolean);\n let current = result;\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n if (i === segments.length - 1) {\n current[segment] = paths[path];\n } else {\n if (!current[segment]) {\n current[segment] = Number.isNaN(Number(segments[i + 1])) ? {} : [];\n }\n current = current[segment];\n }\n }\n }\n return result;\n}\nexport function createPropsDefaultProxy(props, defaults) {\n const defaultProps = resolveDefaultProps(defaults);\n const result = {};\n for (const key of [\n .../* @__PURE__ */ new Set([...Object.keys(props), ...Object.keys(defaultProps)])\n ]) {\n Object.defineProperty(result, key, {\n enumerable: true,\n get: () => props[key] === void 0 ? defaultProps[key] : props[key]\n });\n }\n return result;\n}\n";
|
|
@@ -49,6 +49,7 @@ function restructure(s, node, options = {}) {
|
|
|
49
49
|
s,
|
|
50
50
|
0,
|
|
51
51
|
"createPropsDefaultProxy",
|
|
52
|
+
void 0,
|
|
52
53
|
options.withDefaultsFrom ?? withDefaultsHelperId
|
|
53
54
|
);
|
|
54
55
|
const resolvedPath = path.replace(
|
|
@@ -73,8 +74,7 @@ const ${path} = ${createPropsDefaultProxy}(${resolvedPath}, {${resolvedValues}})
|
|
|
73
74
|
const ${rest.name} = ${importHelperFn(
|
|
74
75
|
s,
|
|
75
76
|
0,
|
|
76
|
-
"createPropsRestProxy"
|
|
77
|
-
"vue"
|
|
77
|
+
"createPropsRestProxy"
|
|
78
78
|
)}(${rest.path}, [${rest.value}])`
|
|
79
79
|
);
|
|
80
80
|
}
|
|
@@ -227,8 +227,7 @@ function processAwait(s, node, needSemi, isStatement) {
|
|
|
227
227
|
([__temp,__restore] = ${importHelperFn2(
|
|
228
228
|
s,
|
|
229
229
|
0,
|
|
230
|
-
`withAsyncContext
|
|
231
|
-
"vue"
|
|
230
|
+
`withAsyncContext`
|
|
232
231
|
)}(${containsNestedAwait ? `async ` : ``}() => `
|
|
233
232
|
);
|
|
234
233
|
s.appendLeft(
|
|
@@ -246,7 +245,7 @@ function transformDefineComponent(root, propsName, map, s) {
|
|
|
246
245
|
if (!map.defineComponent) return;
|
|
247
246
|
const defineComponentName = s.sliceNode(map.defineComponent.callee);
|
|
248
247
|
if (defineComponentName && !["defineComponent", "defineVaporComponent"].includes(defineComponentName)) {
|
|
249
|
-
importHelperFn3(s, 0, "defineComponent",
|
|
248
|
+
importHelperFn3(s, 0, "defineComponent", defineComponentName);
|
|
250
249
|
}
|
|
251
250
|
let hasRestProp = false;
|
|
252
251
|
const props = {};
|
|
@@ -258,7 +257,7 @@ function transformDefineComponent(root, propsName, map, s) {
|
|
|
258
257
|
generateRestProps: (restPropsName, index, list) => {
|
|
259
258
|
if (index === list.length - 1) {
|
|
260
259
|
hasRestProp = true;
|
|
261
|
-
const useAttrs = importHelperFn3(s, 0, "useAttrs"
|
|
260
|
+
const useAttrs = importHelperFn3(s, 0, "useAttrs");
|
|
262
261
|
return `const ${restPropsName} = ${useAttrs}()`;
|
|
263
262
|
}
|
|
264
263
|
}
|
|
@@ -325,11 +324,11 @@ function getWalkedIds(root, propsName) {
|
|
|
325
324
|
|
|
326
325
|
// src/core/define-expose.ts
|
|
327
326
|
import { importHelperFn as importHelperFn4 } from "@vue-macros/common";
|
|
328
|
-
function transformDefineExpose(node, s,
|
|
327
|
+
function transformDefineExpose(node, s, version) {
|
|
329
328
|
s.overwriteNode(node.callee, ";");
|
|
330
329
|
s.appendRight(
|
|
331
330
|
node.arguments[0]?.start || node.end - 1,
|
|
332
|
-
|
|
331
|
+
version >= 3.6 ? `${importHelperFn4(s, 0, "currentInstance")}.exposed = ` : `${importHelperFn4(s, 0, "getCurrentInstance")}().exposed = `
|
|
333
332
|
);
|
|
334
333
|
}
|
|
335
334
|
|
|
@@ -338,7 +337,7 @@ import { importHelperFn as importHelperFn5 } from "@vue-macros/common";
|
|
|
338
337
|
function transformDefineModel(node, propsName, s) {
|
|
339
338
|
s.overwriteNode(
|
|
340
339
|
node.callee,
|
|
341
|
-
importHelperFn5(s, 0, "useModel", useModelHelperId)
|
|
340
|
+
importHelperFn5(s, 0, "useModel", void 0, useModelHelperId)
|
|
342
341
|
);
|
|
343
342
|
s.appendRight(
|
|
344
343
|
node.arguments[0]?.start || node.end - 1,
|
|
@@ -348,13 +347,13 @@ function transformDefineModel(node, propsName, s) {
|
|
|
348
347
|
|
|
349
348
|
// src/core/define-slots.ts
|
|
350
349
|
import { importHelperFn as importHelperFn6 } from "@vue-macros/common";
|
|
351
|
-
function transformDefineSlots(node,
|
|
350
|
+
function transformDefineSlots(node, s) {
|
|
352
351
|
s.overwrite(
|
|
353
352
|
node.start,
|
|
354
353
|
node.arguments[0]?.start && node.arguments[0].start - 1 || node.typeArguments?.end || node.callee.end,
|
|
355
354
|
`Object.assign`
|
|
356
355
|
);
|
|
357
|
-
const slots =
|
|
356
|
+
const slots = `${importHelperFn6(s, 0, "useSlots")}()`;
|
|
358
357
|
s.appendLeft(node.end - 1, `${node.arguments[0] ? "," : "{}, "}${slots}`);
|
|
359
358
|
}
|
|
360
359
|
|
|
@@ -472,10 +471,10 @@ function transformJsxMacros(code, id, importMap, options) {
|
|
|
472
471
|
});
|
|
473
472
|
}
|
|
474
473
|
if (map.defineSlots) {
|
|
475
|
-
transformDefineSlots(map.defineSlots,
|
|
474
|
+
transformDefineSlots(map.defineSlots, s);
|
|
476
475
|
}
|
|
477
476
|
if (map.defineExpose) {
|
|
478
|
-
transformDefineExpose(map.defineExpose, s, options.
|
|
477
|
+
transformDefineExpose(map.defineExpose, s, options.version);
|
|
479
478
|
}
|
|
480
479
|
}
|
|
481
480
|
return generateTransform(s, id);
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
use_model_default,
|
|
6
6
|
withDefaultsHelperId,
|
|
7
7
|
with_defaults_default
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-TWP2JCYQ.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveOptions
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-DANY2WQD.js";
|
|
12
12
|
|
|
13
13
|
// src/raw.ts
|
|
14
14
|
import { createFilter, normalizePath } from "@vue-macros/common";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkJWJVYLYIcjs = require('./chunk-JWJVYLYI.cjs');
|
|
4
4
|
|
|
5
5
|
// src/vite.ts
|
|
6
|
-
var vite_default =
|
|
6
|
+
var vite_default = _chunkJWJVYLYIcjs.index_default.vite;
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
package/dist/esbuild.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
3
|
+
var _chunkJWJVYLYIcjs = require('./chunk-JWJVYLYI.cjs');
|
|
4
|
+
require('./chunk-35H4MC4N.cjs');
|
|
5
|
+
require('./chunk-LPH34H6O.cjs');
|
|
6
|
+
require('./chunk-53TNKVYD.cjs');
|
|
7
7
|
|
|
8
8
|
// src/esbuild.ts
|
|
9
|
-
var esbuild_default =
|
|
9
|
+
var esbuild_default = _chunkJWJVYLYIcjs.index_default.esbuild;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
exports.default = esbuild_default;
|
package/dist/esbuild.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
index_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-LVZNHMZC.js";
|
|
4
|
+
import "./chunk-WOWB5VHY.js";
|
|
5
|
+
import "./chunk-TWP2JCYQ.js";
|
|
6
|
+
import "./chunk-DANY2WQD.js";
|
|
7
7
|
|
|
8
8
|
// src/esbuild.ts
|
|
9
9
|
var esbuild_default = index_default.esbuild;
|
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var _chunkJWJVYLYIcjs = require('./chunk-JWJVYLYI.cjs');
|
|
4
|
+
require('./chunk-35H4MC4N.cjs');
|
|
5
|
+
require('./chunk-LPH34H6O.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunk53TNKVYDcjs = require('./chunk-53TNKVYD.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.default =
|
|
12
|
+
exports.default = _chunkJWJVYLYIcjs.index_default; exports.resolveOptions = _chunk53TNKVYDcjs.resolveOptions;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
index_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-LVZNHMZC.js";
|
|
4
|
+
import "./chunk-WOWB5VHY.js";
|
|
5
|
+
import "./chunk-TWP2JCYQ.js";
|
|
6
6
|
import {
|
|
7
7
|
resolveOptions
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DANY2WQD.js";
|
|
9
9
|
export {
|
|
10
10
|
index_default as default,
|
|
11
11
|
resolveOptions
|
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 _chunkYCL7HGD4cjs = require('./chunk-YCL7HGD4.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
10
|
-
require('./chunk-
|
|
6
|
+
var _chunkNL4CWOW2cjs = require('./chunk-NL4CWOW2.cjs');
|
|
7
|
+
require('./chunk-JWJVYLYI.cjs');
|
|
8
|
+
require('./chunk-35H4MC4N.cjs');
|
|
9
|
+
require('./chunk-LPH34H6O.cjs');
|
|
10
|
+
require('./chunk-53TNKVYD.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, () => _chunkYCL7HGD4cjs.vite_default.call(void 0, options));
|
|
22
|
+
_kit.addWebpackPlugin.call(void 0, () => _chunkNL4CWOW2cjs.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-RC5ZHWIN.js";
|
|
4
4
|
import {
|
|
5
5
|
webpack_default
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-WZIZSQGW.js";
|
|
7
|
+
import "./chunk-LVZNHMZC.js";
|
|
8
|
+
import "./chunk-WOWB5VHY.js";
|
|
9
|
+
import "./chunk-TWP2JCYQ.js";
|
|
10
|
+
import "./chunk-DANY2WQD.js";
|
|
11
11
|
|
|
12
12
|
// src/nuxt.ts
|
|
13
13
|
import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
|
package/dist/options.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk53TNKVYDcjs = require('./chunk-53TNKVYD.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
exports.resolveOptions =
|
|
6
|
+
exports.resolveOptions = _chunk53TNKVYDcjs.resolveOptions;
|
package/dist/options.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { MarkRequired, BaseOptions } from '@vue-macros/common';
|
|
2
2
|
|
|
3
3
|
type Options = BaseOptions & {
|
|
4
|
-
lib?: 'vue' | 'vue/vapor' | (string & {});
|
|
5
4
|
defineComponent?: {
|
|
6
5
|
alias: string[];
|
|
7
6
|
};
|
|
@@ -18,7 +17,7 @@ type Options = BaseOptions & {
|
|
|
18
17
|
alias: string[];
|
|
19
18
|
};
|
|
20
19
|
};
|
|
21
|
-
type OptionsResolved = MarkRequired<Options, 'include' | 'version' | '
|
|
20
|
+
type OptionsResolved = MarkRequired<Options, 'include' | 'version' | 'defineComponent' | 'defineModel' | 'defineExpose' | 'defineSlots' | 'defineStyle'>;
|
|
22
21
|
declare function resolveOptions(options: Options): OptionsResolved;
|
|
23
22
|
|
|
24
23
|
export { type Options, type OptionsResolved, resolveOptions };
|
package/dist/options.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { MarkRequired, BaseOptions } from '@vue-macros/common';
|
|
2
2
|
|
|
3
3
|
type Options = BaseOptions & {
|
|
4
|
-
lib?: 'vue' | 'vue/vapor' | (string & {});
|
|
5
4
|
defineComponent?: {
|
|
6
5
|
alias: string[];
|
|
7
6
|
};
|
|
@@ -18,7 +17,7 @@ type Options = BaseOptions & {
|
|
|
18
17
|
alias: string[];
|
|
19
18
|
};
|
|
20
19
|
};
|
|
21
|
-
type OptionsResolved = MarkRequired<Options, 'include' | 'version' | '
|
|
20
|
+
type OptionsResolved = MarkRequired<Options, 'include' | 'version' | 'defineComponent' | 'defineModel' | 'defineExpose' | 'defineSlots' | 'defineStyle'>;
|
|
22
21
|
declare function resolveOptions(options: Options): OptionsResolved;
|
|
23
22
|
|
|
24
23
|
export { type Options, type OptionsResolved, resolveOptions };
|
package/dist/options.js
CHANGED
package/dist/raw.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var _chunk35H4MC4Ncjs = require('./chunk-35H4MC4N.cjs');
|
|
4
|
+
require('./chunk-LPH34H6O.cjs');
|
|
5
|
+
require('./chunk-53TNKVYD.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.default =
|
|
8
|
+
exports.default = _chunk35H4MC4Ncjs.raw_default;
|
|
9
9
|
|
|
10
10
|
module.exports = exports.default;
|
package/dist/raw.js
CHANGED
package/dist/rolldown.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
3
|
+
var _chunkJWJVYLYIcjs = require('./chunk-JWJVYLYI.cjs');
|
|
4
|
+
require('./chunk-35H4MC4N.cjs');
|
|
5
|
+
require('./chunk-LPH34H6O.cjs');
|
|
6
|
+
require('./chunk-53TNKVYD.cjs');
|
|
7
7
|
|
|
8
8
|
// src/rolldown.ts
|
|
9
|
-
var rolldown_default =
|
|
9
|
+
var rolldown_default = _chunkJWJVYLYIcjs.index_default.rolldown;
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
exports.default = rolldown_default;
|
package/dist/rolldown.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
index_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-LVZNHMZC.js";
|
|
4
|
+
import "./chunk-WOWB5VHY.js";
|
|
5
|
+
import "./chunk-TWP2JCYQ.js";
|
|
6
|
+
import "./chunk-DANY2WQD.js";
|
|
7
7
|
|
|
8
8
|
// src/rolldown.ts
|
|
9
9
|
var rolldown_default = index_default.rolldown;
|
package/dist/rollup.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
3
|
+
var _chunkJWJVYLYIcjs = require('./chunk-JWJVYLYI.cjs');
|
|
4
|
+
require('./chunk-35H4MC4N.cjs');
|
|
5
|
+
require('./chunk-LPH34H6O.cjs');
|
|
6
|
+
require('./chunk-53TNKVYD.cjs');
|
|
7
7
|
|
|
8
8
|
// src/rollup.ts
|
|
9
|
-
var rollup_default =
|
|
9
|
+
var rollup_default = _chunkJWJVYLYIcjs.index_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
|
index_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-LVZNHMZC.js";
|
|
4
|
+
import "./chunk-WOWB5VHY.js";
|
|
5
|
+
import "./chunk-TWP2JCYQ.js";
|
|
6
|
+
import "./chunk-DANY2WQD.js";
|
|
7
7
|
|
|
8
8
|
// src/rollup.ts
|
|
9
9
|
var rollup_default = index_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
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
3
|
+
var _chunkJWJVYLYIcjs = require('./chunk-JWJVYLYI.cjs');
|
|
4
|
+
require('./chunk-35H4MC4N.cjs');
|
|
5
|
+
require('./chunk-LPH34H6O.cjs');
|
|
6
|
+
require('./chunk-53TNKVYD.cjs');
|
|
7
7
|
|
|
8
8
|
// src/rspack.ts
|
|
9
|
-
var rspack_default =
|
|
9
|
+
var rspack_default = _chunkJWJVYLYIcjs.index_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
|
index_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-LVZNHMZC.js";
|
|
4
|
+
import "./chunk-WOWB5VHY.js";
|
|
5
|
+
import "./chunk-TWP2JCYQ.js";
|
|
6
|
+
import "./chunk-DANY2WQD.js";
|
|
7
7
|
|
|
8
8
|
// src/rspack.ts
|
|
9
9
|
var rspack_default = index_default.rspack;
|
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-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
3
|
+
var _chunkYCL7HGD4cjs = require('./chunk-YCL7HGD4.cjs');
|
|
4
|
+
require('./chunk-JWJVYLYI.cjs');
|
|
5
|
+
require('./chunk-35H4MC4N.cjs');
|
|
6
|
+
require('./chunk-LPH34H6O.cjs');
|
|
7
|
+
require('./chunk-53TNKVYD.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.default =
|
|
10
|
+
exports.default = _chunkYCL7HGD4cjs.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-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-RC5ZHWIN.js";
|
|
4
|
+
import "./chunk-LVZNHMZC.js";
|
|
5
|
+
import "./chunk-WOWB5VHY.js";
|
|
6
|
+
import "./chunk-TWP2JCYQ.js";
|
|
7
|
+
import "./chunk-DANY2WQD.js";
|
|
8
8
|
export {
|
|
9
9
|
vite_default as default
|
|
10
10
|
};
|
package/dist/volar.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } 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; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk53TNKVYDcjs = require('./chunk-53TNKVYD.cjs');
|
|
4
4
|
|
|
5
5
|
// src/volar.ts
|
|
6
6
|
var _common = require('@vue-macros/common');
|
|
@@ -118,15 +118,16 @@ function transformJsxMacros(rootMap, options) {
|
|
|
118
118
|
)]);
|
|
119
119
|
if (asyncModifier && map.defineComponent)
|
|
120
120
|
_tsmacro.replaceRange.call(void 0, codes, asyncModifier.pos, asyncModifier.end);
|
|
121
|
-
const result = `({}) as __VLS_PickNotAny<
|
|
121
|
+
const result = `({}) as __VLS_PickNotAny<typeof ${_common.HELPER_PREFIX}ctx.render, {}> & { __ctx: typeof ${_common.HELPER_PREFIX}ctx }`;
|
|
122
122
|
const propsType = _optionalChain([root, 'access', _8 => _8.parameters, 'access', _9 => _9[0], 'optionalAccess', _10 => _10.type]) ? String(root.parameters[0].type.getText(ast)) : "{}";
|
|
123
123
|
_tsmacro.replaceRange.call(void 0,
|
|
124
124
|
codes,
|
|
125
125
|
root.parameters.pos,
|
|
126
126
|
root.parameters.pos,
|
|
127
127
|
ts.isArrowFunction(root) && root.parameters.pos === root.pos ? "(" : "",
|
|
128
|
-
`${_common.HELPER_PREFIX}props:
|
|
128
|
+
`${_common.HELPER_PREFIX}props: typeof ${_common.HELPER_PREFIX}ctx.props & ${propsType}, `,
|
|
129
129
|
`${_common.HELPER_PREFIX}placeholder?: {}, `,
|
|
130
|
+
`${_common.HELPER_PREFIX}ctx = {} as Awaited<ReturnType<typeof ${_common.HELPER_PREFIX}setup>>, `,
|
|
130
131
|
`${_common.HELPER_PREFIX}setup = (${asyncModifier ? "async" : ""}(`
|
|
131
132
|
);
|
|
132
133
|
if (ts.isArrowFunction(root)) {
|
|
@@ -166,7 +167,7 @@ props: {} as { ${props.join(", ")} }`,
|
|
|
166
167
|
`,
|
|
167
168
|
slots: {} as ${_nullishCoalesce(map.defineSlots, () => ( "{}"))}`,
|
|
168
169
|
`,
|
|
169
|
-
expose: (exposed:
|
|
170
|
+
expose: (exposed: import('vue').ShallowUnwrapRef<${_nullishCoalesce(map.defineExpose, () => ( "{}"))}>) => {}`,
|
|
170
171
|
`,
|
|
171
172
|
render: `,
|
|
172
173
|
shouldWrapByCall ? "(" : ""
|
|
@@ -321,17 +322,23 @@ function getRootMap(options) {
|
|
|
321
322
|
}
|
|
322
323
|
const id = toValidAssetId(modelName, `${_common.HELPER_PREFIX}model`);
|
|
323
324
|
const typeString = `import('vue').UnwrapRef<typeof ${id}>`;
|
|
324
|
-
|
|
325
|
+
const defineModel = rootMap.get(root).defineModel ??= [];
|
|
326
|
+
defineModel.push(
|
|
325
327
|
`${modelName.includes("-") ? `'${modelName}'` : modelName}${isRequired ? ":" : "?:"} ${typeString}`,
|
|
326
328
|
`'onUpdate:${modelName}'?: ($event: ${typeString}) => any`
|
|
327
329
|
);
|
|
330
|
+
if (_optionalChain([expression, 'access', _11 => _11.typeArguments, 'optionalAccess', _12 => _12[1]])) {
|
|
331
|
+
defineModel.push(
|
|
332
|
+
`${modelName}Modifiers?: Partial<Record<${expression.typeArguments[1].getText(ast)}, boolean>>`
|
|
333
|
+
);
|
|
334
|
+
}
|
|
328
335
|
_tsmacro.replaceRange.call(void 0,
|
|
329
336
|
codes,
|
|
330
337
|
initializer.getStart(ast),
|
|
331
338
|
initializer.getStart(ast),
|
|
332
339
|
`// @ts-ignore
|
|
333
340
|
${id};
|
|
334
|
-
let ${id}
|
|
341
|
+
let ${id} = `
|
|
335
342
|
);
|
|
336
343
|
} else if (options.defineSlots.alias.includes(macroName)) {
|
|
337
344
|
_tsmacro.replaceRange.call(void 0,
|
|
@@ -367,7 +374,7 @@ function toValidAssetId(name, type) {
|
|
|
367
374
|
// src/volar.ts
|
|
368
375
|
var plugin = _tsmacro.createPlugin.call(void 0,
|
|
369
376
|
({ ts }, userOptions = {}) => {
|
|
370
|
-
const resolvedOptions =
|
|
377
|
+
const resolvedOptions = _chunk53TNKVYDcjs.resolveOptions.call(void 0, userOptions);
|
|
371
378
|
const filter = _common.createFilter.call(void 0, resolvedOptions);
|
|
372
379
|
return {
|
|
373
380
|
name: "@vue-jsx-vapor/macros",
|
package/dist/volar.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveOptions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DANY2WQD.js";
|
|
4
4
|
|
|
5
5
|
// src/volar.ts
|
|
6
6
|
import { createFilter } from "@vue-macros/common";
|
|
@@ -118,15 +118,16 @@ function transformJsxMacros(rootMap, options) {
|
|
|
118
118
|
);
|
|
119
119
|
if (asyncModifier && map.defineComponent)
|
|
120
120
|
replaceRange3(codes, asyncModifier.pos, asyncModifier.end);
|
|
121
|
-
const result = `({}) as __VLS_PickNotAny<
|
|
121
|
+
const result = `({}) as __VLS_PickNotAny<typeof ${HELPER_PREFIX2}ctx.render, {}> & { __ctx: typeof ${HELPER_PREFIX2}ctx }`;
|
|
122
122
|
const propsType = root.parameters[0]?.type ? String(root.parameters[0].type.getText(ast)) : "{}";
|
|
123
123
|
replaceRange3(
|
|
124
124
|
codes,
|
|
125
125
|
root.parameters.pos,
|
|
126
126
|
root.parameters.pos,
|
|
127
127
|
ts.isArrowFunction(root) && root.parameters.pos === root.pos ? "(" : "",
|
|
128
|
-
`${HELPER_PREFIX2}props:
|
|
128
|
+
`${HELPER_PREFIX2}props: typeof ${HELPER_PREFIX2}ctx.props & ${propsType}, `,
|
|
129
129
|
`${HELPER_PREFIX2}placeholder?: {}, `,
|
|
130
|
+
`${HELPER_PREFIX2}ctx = {} as Awaited<ReturnType<typeof ${HELPER_PREFIX2}setup>>, `,
|
|
130
131
|
`${HELPER_PREFIX2}setup = (${asyncModifier ? "async" : ""}(`
|
|
131
132
|
);
|
|
132
133
|
if (ts.isArrowFunction(root)) {
|
|
@@ -166,7 +167,7 @@ props: {} as { ${props.join(", ")} }`,
|
|
|
166
167
|
`,
|
|
167
168
|
slots: {} as ${map.defineSlots ?? "{}"}`,
|
|
168
169
|
`,
|
|
169
|
-
expose: (exposed:
|
|
170
|
+
expose: (exposed: import('vue').ShallowUnwrapRef<${map.defineExpose ?? "{}"}>) => {}`,
|
|
170
171
|
`,
|
|
171
172
|
render: `,
|
|
172
173
|
shouldWrapByCall ? "(" : ""
|
|
@@ -321,17 +322,23 @@ function getRootMap(options) {
|
|
|
321
322
|
}
|
|
322
323
|
const id = toValidAssetId(modelName, `${HELPER_PREFIX4}model`);
|
|
323
324
|
const typeString = `import('vue').UnwrapRef<typeof ${id}>`;
|
|
324
|
-
|
|
325
|
+
const defineModel = rootMap.get(root).defineModel ??= [];
|
|
326
|
+
defineModel.push(
|
|
325
327
|
`${modelName.includes("-") ? `'${modelName}'` : modelName}${isRequired ? ":" : "?:"} ${typeString}`,
|
|
326
328
|
`'onUpdate:${modelName}'?: ($event: ${typeString}) => any`
|
|
327
329
|
);
|
|
330
|
+
if (expression.typeArguments?.[1]) {
|
|
331
|
+
defineModel.push(
|
|
332
|
+
`${modelName}Modifiers?: Partial<Record<${expression.typeArguments[1].getText(ast)}, boolean>>`
|
|
333
|
+
);
|
|
334
|
+
}
|
|
328
335
|
replaceRange4(
|
|
329
336
|
codes,
|
|
330
337
|
initializer.getStart(ast),
|
|
331
338
|
initializer.getStart(ast),
|
|
332
339
|
`// @ts-ignore
|
|
333
340
|
${id};
|
|
334
|
-
let ${id}
|
|
341
|
+
let ${id} = `
|
|
335
342
|
);
|
|
336
343
|
} else if (options.defineSlots.alias.includes(macroName)) {
|
|
337
344
|
replaceRange4(
|
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-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
3
|
+
var _chunkNL4CWOW2cjs = require('./chunk-NL4CWOW2.cjs');
|
|
4
|
+
require('./chunk-JWJVYLYI.cjs');
|
|
5
|
+
require('./chunk-35H4MC4N.cjs');
|
|
6
|
+
require('./chunk-LPH34H6O.cjs');
|
|
7
|
+
require('./chunk-53TNKVYD.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.default =
|
|
10
|
+
exports.default = _chunkNL4CWOW2cjs.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-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-WZIZSQGW.js";
|
|
4
|
+
import "./chunk-LVZNHMZC.js";
|
|
5
|
+
import "./chunk-WOWB5VHY.js";
|
|
6
|
+
import "./chunk-TWP2JCYQ.js";
|
|
7
|
+
import "./chunk-DANY2WQD.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/macros",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.7",
|
|
4
4
|
"description": "Macros for Vue JSX Vapor",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -167,8 +167,8 @@
|
|
|
167
167
|
}
|
|
168
168
|
},
|
|
169
169
|
"dependencies": {
|
|
170
|
-
"@vue-macros/common": "3.0.0-beta.
|
|
171
|
-
"@vue/compiler-sfc": "https://pkg.pr.new/@vue/compiler-sfc@
|
|
170
|
+
"@vue-macros/common": "^3.0.0-beta.7",
|
|
171
|
+
"@vue/compiler-sfc": "https://pkg.pr.new/@vue/compiler-sfc@b43f4f5",
|
|
172
172
|
"@vue/language-core": "^2.2.8",
|
|
173
173
|
"hash-sum": "^2.0.0",
|
|
174
174
|
"ts-macro": "^0.1.25",
|
|
@@ -179,8 +179,8 @@
|
|
|
179
179
|
"@nuxt/kit": "^3.16.0",
|
|
180
180
|
"@nuxt/schema": "^3.16.0",
|
|
181
181
|
"@types/hash-sum": "^1.0.2",
|
|
182
|
-
"@vue-macros/test-utils": "3.0.0-beta.
|
|
183
|
-
"vue": "https://pkg.pr.new/vue@
|
|
182
|
+
"@vue-macros/test-utils": "^3.0.0-beta.7",
|
|
183
|
+
"vue": "https://pkg.pr.new/vue@b43f4f5"
|
|
184
184
|
},
|
|
185
185
|
"scripts": {
|
|
186
186
|
"build": "tsup",
|