@vue-jsx-vapor/macros 2.1.4 → 2.1.6

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.
Files changed (41) hide show
  1. package/dist/api.cjs +2 -2
  2. package/dist/api.js +1 -1
  3. package/dist/astro.cjs +5 -5
  4. package/dist/astro.js +4 -4
  5. package/dist/{chunk-Y5EBYHAU.cjs → chunk-35H4MC4N.cjs} +8 -8
  6. package/dist/{chunk-UZ426MO6.cjs → chunk-53TNKVYD.cjs} +1 -4
  7. package/dist/{chunk-ZXRSELD6.js → chunk-DANY2WQD.js} +1 -4
  8. package/dist/{chunk-YRPLEEOM.cjs → chunk-JWJVYLYI.cjs} +2 -2
  9. package/dist/{chunk-JS6XU4SQ.cjs → chunk-LPH34H6O.cjs} +13 -14
  10. package/dist/{chunk-LLVVZVJJ.js → chunk-LVZNHMZC.js} +1 -1
  11. package/dist/{chunk-WWH3HXFC.cjs → chunk-NL4CWOW2.cjs} +2 -2
  12. package/dist/{chunk-75S7E24B.js → chunk-RC5ZHWIN.js} +1 -1
  13. package/dist/{chunk-JKT6AV5O.js → chunk-TWP2JCYQ.js} +13 -14
  14. package/dist/{chunk-IN7QS6NY.js → chunk-WOWB5VHY.js} +2 -2
  15. package/dist/{chunk-3PWNZD2U.js → chunk-WZIZSQGW.js} +1 -1
  16. package/dist/{chunk-KHR56IGI.cjs → chunk-YCL7HGD4.cjs} +2 -2
  17. package/dist/esbuild.cjs +5 -5
  18. package/dist/esbuild.js +4 -4
  19. package/dist/index.cjs +5 -5
  20. package/dist/index.js +4 -4
  21. package/dist/nuxt.cjs +8 -8
  22. package/dist/nuxt.js +6 -6
  23. package/dist/options.cjs +2 -2
  24. package/dist/options.d.cts +1 -2
  25. package/dist/options.d.ts +1 -2
  26. package/dist/options.js +1 -1
  27. package/dist/raw.cjs +4 -4
  28. package/dist/raw.js +3 -3
  29. package/dist/rolldown.cjs +5 -5
  30. package/dist/rolldown.js +4 -4
  31. package/dist/rollup.cjs +5 -5
  32. package/dist/rollup.js +4 -4
  33. package/dist/rspack.cjs +5 -5
  34. package/dist/rspack.js +4 -4
  35. package/dist/vite.cjs +6 -6
  36. package/dist/vite.js +5 -5
  37. package/dist/volar.cjs +11 -5
  38. package/dist/volar.js +10 -4
  39. package/dist/webpack.cjs +6 -6
  40. package/dist/webpack.js +5 -5
  41. package/package.json +5 -5
package/dist/api.cjs CHANGED
@@ -4,11 +4,11 @@
4
4
 
5
5
 
6
6
 
7
- var _chunkJS6XU4SQcjs = require('./chunk-JS6XU4SQ.cjs');
7
+ var _chunkLPH34H6Ocjs = require('./chunk-LPH34H6O.cjs');
8
8
 
9
9
 
10
10
 
11
11
 
12
12
 
13
13
 
14
- exports.getMacroExpression = _chunkJS6XU4SQcjs.getMacroExpression; exports.getParamsStart = _chunkJS6XU4SQcjs.getParamsStart; exports.isFunctionalNode = _chunkJS6XU4SQcjs.isFunctionalNode; exports.restructure = _chunkJS6XU4SQcjs.restructure; exports.transformJsxMacros = _chunkJS6XU4SQcjs.transformJsxMacros;
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
@@ -4,7 +4,7 @@ import {
4
4
  isFunctionalNode,
5
5
  restructure,
6
6
  transformJsxMacros
7
- } from "./chunk-JKT6AV5O.js";
7
+ } from "./chunk-TWP2JCYQ.js";
8
8
  export {
9
9
  getMacroExpression,
10
10
  getParamsStart,
package/dist/astro.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkYRPLEEOMcjs = require('./chunk-YRPLEEOM.cjs');
4
- require('./chunk-Y5EBYHAU.cjs');
5
- require('./chunk-JS6XU4SQ.cjs');
6
- require('./chunk-UZ426MO6.cjs');
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(_chunkYRPLEEOMcjs.index_default.vite(options));
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-LLVVZVJJ.js";
4
- import "./chunk-IN7QS6NY.js";
5
- import "./chunk-JKT6AV5O.js";
6
- import "./chunk-ZXRSELD6.js";
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 _chunkJS6XU4SQcjs = require('./chunk-JS6XU4SQ.cjs');
8
+ var _chunkLPH34H6Ocjs = require('./chunk-LPH34H6O.cjs');
9
9
 
10
10
 
11
- var _chunkUZ426MO6cjs = require('./chunk-UZ426MO6.cjs');
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 = _chunkUZ426MO6cjs.resolveOptions.call(void 0, userOptions);
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(_chunkJS6XU4SQcjs.helperPrefix)) return id;
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(_chunkJS6XU4SQcjs.helperPrefix);
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 === _chunkJS6XU4SQcjs.useModelHelperId) return _chunkJS6XU4SQcjs.use_model_default;
48
- else if (id === _chunkJS6XU4SQcjs.withDefaultsHelperId) return _chunkJS6XU4SQcjs.with_defaults_default;
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 _chunkJS6XU4SQcjs.transformJsxMacros.call(void 0, code, id, importMap, options);
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 || _common.detectVueVersion.call(void 0, );
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 || detectVueVersion();
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 _chunkY5EBYHAUcjs = require('./chunk-Y5EBYHAU.cjs');
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, _chunkY5EBYHAUcjs.raw_default);
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 const modifiers = name === "modelValue" ? props.modelModifiers : props[`${name}Modifiers`];\n res[Symbol.iterator] = () => {\n let i = 0;\n return {\n next() {\n if (i < 2) {\n return { value: i++ ? modifiers || {} : res, done: false };\n } else {\n return { done: true };\n }\n }\n };\n };\n return res;\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", "vue", false, defineComponentName);
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", "vue");
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, lib) {
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
- lib.includes("vapor") ? `${_common.importHelperFn.call(void 0, s, 0, "currentInstance", "vue")}.exposed = ` : `${_common.importHelperFn.call(void 0, s, 0, "getCurrentInstance", "vue")}().exposed = `
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, propsName, s, lib) {
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 = lib.includes("vue") ? `${_common.importHelperFn.call(void 0, s, 0, "useSlots", "vue")}()` : `${propsName}.vSlots`;
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, propsName, s, options.lib);
474
+ transformDefineSlots(map.defineSlots, s);
476
475
  }
477
476
  if (map.defineExpose) {
478
- transformDefineExpose(map.defineExpose, s, options.lib);
477
+ transformDefineExpose(map.defineExpose, s, options.version);
479
478
  }
480
479
  }
481
480
  return _common.generateTransform.call(void 0, s, id);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raw_default
3
- } from "./chunk-IN7QS6NY.js";
3
+ } from "./chunk-WOWB5VHY.js";
4
4
 
5
5
  // src/index.ts
6
6
  import { createUnplugin } from "unplugin";
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkYRPLEEOMcjs = require('./chunk-YRPLEEOM.cjs');
3
+ var _chunkJWJVYLYIcjs = require('./chunk-JWJVYLYI.cjs');
4
4
 
5
5
  // src/webpack.ts
6
- var webpack_default = _chunkYRPLEEOMcjs.index_default.webpack;
6
+ var webpack_default = _chunkJWJVYLYIcjs.index_default.webpack;
7
7
 
8
8
 
9
9
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  index_default
3
- } from "./chunk-LLVVZVJJ.js";
3
+ } from "./chunk-LVZNHMZC.js";
4
4
 
5
5
  // src/vite.ts
6
6
  var vite_default = index_default.vite;
@@ -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 const modifiers = name === "modelValue" ? props.modelModifiers : props[`${name}Modifiers`];\n res[Symbol.iterator] = () => {\n let i = 0;\n return {\n next() {\n if (i < 2) {\n return { value: i++ ? modifiers || {} : res, done: false };\n } else {\n return { done: true };\n }\n }\n };\n };\n return res;\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", "vue", false, defineComponentName);
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", "vue");
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, lib) {
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
- lib.includes("vapor") ? `${importHelperFn4(s, 0, "currentInstance", "vue")}.exposed = ` : `${importHelperFn4(s, 0, "getCurrentInstance", "vue")}().exposed = `
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, propsName, s, lib) {
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 = lib.includes("vue") ? `${importHelperFn6(s, 0, "useSlots", "vue")}()` : `${propsName}.vSlots`;
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, propsName, s, options.lib);
474
+ transformDefineSlots(map.defineSlots, s);
476
475
  }
477
476
  if (map.defineExpose) {
478
- transformDefineExpose(map.defineExpose, s, options.lib);
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-JKT6AV5O.js";
8
+ } from "./chunk-TWP2JCYQ.js";
9
9
  import {
10
10
  resolveOptions
11
- } from "./chunk-ZXRSELD6.js";
11
+ } from "./chunk-DANY2WQD.js";
12
12
 
13
13
  // src/raw.ts
14
14
  import { createFilter, normalizePath } from "@vue-macros/common";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  index_default
3
- } from "./chunk-LLVVZVJJ.js";
3
+ } from "./chunk-LVZNHMZC.js";
4
4
 
5
5
  // src/webpack.ts
6
6
  var webpack_default = index_default.webpack;
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkYRPLEEOMcjs = require('./chunk-YRPLEEOM.cjs');
3
+ var _chunkJWJVYLYIcjs = require('./chunk-JWJVYLYI.cjs');
4
4
 
5
5
  // src/vite.ts
6
- var vite_default = _chunkYRPLEEOMcjs.index_default.vite;
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 _chunkYRPLEEOMcjs = require('./chunk-YRPLEEOM.cjs');
4
- require('./chunk-Y5EBYHAU.cjs');
5
- require('./chunk-JS6XU4SQ.cjs');
6
- require('./chunk-UZ426MO6.cjs');
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 = _chunkYRPLEEOMcjs.index_default.esbuild;
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-LLVVZVJJ.js";
4
- import "./chunk-IN7QS6NY.js";
5
- import "./chunk-JKT6AV5O.js";
6
- import "./chunk-ZXRSELD6.js";
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 _chunkYRPLEEOMcjs = require('./chunk-YRPLEEOM.cjs');
4
- require('./chunk-Y5EBYHAU.cjs');
5
- require('./chunk-JS6XU4SQ.cjs');
3
+ var _chunkJWJVYLYIcjs = require('./chunk-JWJVYLYI.cjs');
4
+ require('./chunk-35H4MC4N.cjs');
5
+ require('./chunk-LPH34H6O.cjs');
6
6
 
7
7
 
8
- var _chunkUZ426MO6cjs = require('./chunk-UZ426MO6.cjs');
8
+ var _chunk53TNKVYDcjs = require('./chunk-53TNKVYD.cjs');
9
9
 
10
10
 
11
11
 
12
- exports.default = _chunkYRPLEEOMcjs.index_default; exports.resolveOptions = _chunkUZ426MO6cjs.resolveOptions;
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-LLVVZVJJ.js";
4
- import "./chunk-IN7QS6NY.js";
5
- import "./chunk-JKT6AV5O.js";
3
+ } from "./chunk-LVZNHMZC.js";
4
+ import "./chunk-WOWB5VHY.js";
5
+ import "./chunk-TWP2JCYQ.js";
6
6
  import {
7
7
  resolveOptions
8
- } from "./chunk-ZXRSELD6.js";
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 _chunkKHR56IGIcjs = require('./chunk-KHR56IGI.cjs');
3
+ var _chunkYCL7HGD4cjs = require('./chunk-YCL7HGD4.cjs');
4
4
 
5
5
 
6
- var _chunkWWH3HXFCcjs = require('./chunk-WWH3HXFC.cjs');
7
- require('./chunk-YRPLEEOM.cjs');
8
- require('./chunk-Y5EBYHAU.cjs');
9
- require('./chunk-JS6XU4SQ.cjs');
10
- require('./chunk-UZ426MO6.cjs');
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, () => _chunkKHR56IGIcjs.vite_default.call(void 0, options));
22
- _kit.addWebpackPlugin.call(void 0, () => _chunkWWH3HXFCcjs.webpack_default.call(void 0, options));
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-75S7E24B.js";
3
+ } from "./chunk-RC5ZHWIN.js";
4
4
  import {
5
5
  webpack_default
6
- } from "./chunk-3PWNZD2U.js";
7
- import "./chunk-LLVVZVJJ.js";
8
- import "./chunk-IN7QS6NY.js";
9
- import "./chunk-JKT6AV5O.js";
10
- import "./chunk-ZXRSELD6.js";
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 _chunkUZ426MO6cjs = require('./chunk-UZ426MO6.cjs');
3
+ var _chunk53TNKVYDcjs = require('./chunk-53TNKVYD.cjs');
4
4
 
5
5
 
6
- exports.resolveOptions = _chunkUZ426MO6cjs.resolveOptions;
6
+ exports.resolveOptions = _chunk53TNKVYDcjs.resolveOptions;
@@ -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' | 'lib' | 'defineComponent' | 'defineModel' | 'defineExpose' | 'defineSlots' | 'defineStyle'>;
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' | 'lib' | 'defineComponent' | 'defineModel' | 'defineExpose' | 'defineSlots' | 'defineStyle'>;
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
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveOptions
3
- } from "./chunk-ZXRSELD6.js";
3
+ } from "./chunk-DANY2WQD.js";
4
4
  export {
5
5
  resolveOptions
6
6
  };
package/dist/raw.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkY5EBYHAUcjs = require('./chunk-Y5EBYHAU.cjs');
4
- require('./chunk-JS6XU4SQ.cjs');
5
- require('./chunk-UZ426MO6.cjs');
3
+ var _chunk35H4MC4Ncjs = require('./chunk-35H4MC4N.cjs');
4
+ require('./chunk-LPH34H6O.cjs');
5
+ require('./chunk-53TNKVYD.cjs');
6
6
 
7
7
 
8
- exports.default = _chunkY5EBYHAUcjs.raw_default;
8
+ exports.default = _chunk35H4MC4Ncjs.raw_default;
9
9
 
10
10
  module.exports = exports.default;
package/dist/raw.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  raw_default
3
- } from "./chunk-IN7QS6NY.js";
4
- import "./chunk-JKT6AV5O.js";
5
- import "./chunk-ZXRSELD6.js";
3
+ } from "./chunk-WOWB5VHY.js";
4
+ import "./chunk-TWP2JCYQ.js";
5
+ import "./chunk-DANY2WQD.js";
6
6
  export {
7
7
  raw_default as default
8
8
  };
package/dist/rolldown.cjs CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkYRPLEEOMcjs = require('./chunk-YRPLEEOM.cjs');
4
- require('./chunk-Y5EBYHAU.cjs');
5
- require('./chunk-JS6XU4SQ.cjs');
6
- require('./chunk-UZ426MO6.cjs');
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 = _chunkYRPLEEOMcjs.index_default.rolldown;
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-LLVVZVJJ.js";
4
- import "./chunk-IN7QS6NY.js";
5
- import "./chunk-JKT6AV5O.js";
6
- import "./chunk-ZXRSELD6.js";
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 _chunkYRPLEEOMcjs = require('./chunk-YRPLEEOM.cjs');
4
- require('./chunk-Y5EBYHAU.cjs');
5
- require('./chunk-JS6XU4SQ.cjs');
6
- require('./chunk-UZ426MO6.cjs');
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 = _chunkYRPLEEOMcjs.index_default.rollup;
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-LLVVZVJJ.js";
4
- import "./chunk-IN7QS6NY.js";
5
- import "./chunk-JKT6AV5O.js";
6
- import "./chunk-ZXRSELD6.js";
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 _chunkYRPLEEOMcjs = require('./chunk-YRPLEEOM.cjs');
4
- require('./chunk-Y5EBYHAU.cjs');
5
- require('./chunk-JS6XU4SQ.cjs');
6
- require('./chunk-UZ426MO6.cjs');
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 = _chunkYRPLEEOMcjs.index_default.rspack;
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-LLVVZVJJ.js";
4
- import "./chunk-IN7QS6NY.js";
5
- import "./chunk-JKT6AV5O.js";
6
- import "./chunk-ZXRSELD6.js";
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 _chunkKHR56IGIcjs = require('./chunk-KHR56IGI.cjs');
4
- require('./chunk-YRPLEEOM.cjs');
5
- require('./chunk-Y5EBYHAU.cjs');
6
- require('./chunk-JS6XU4SQ.cjs');
7
- require('./chunk-UZ426MO6.cjs');
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 = _chunkKHR56IGIcjs.vite_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-75S7E24B.js";
4
- import "./chunk-LLVVZVJJ.js";
5
- import "./chunk-IN7QS6NY.js";
6
- import "./chunk-JKT6AV5O.js";
7
- import "./chunk-ZXRSELD6.js";
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 _chunkUZ426MO6cjs = require('./chunk-UZ426MO6.cjs');
3
+ var _chunk53TNKVYDcjs = require('./chunk-53TNKVYD.cjs');
4
4
 
5
5
  // src/volar.ts
6
6
  var _common = require('@vue-macros/common');
@@ -166,7 +166,7 @@ props: {} as { ${props.join(", ")} }`,
166
166
  `,
167
167
  slots: {} as ${_nullishCoalesce(map.defineSlots, () => ( "{}"))}`,
168
168
  `,
169
- expose: (exposed: ${options.lib === "vue" ? `import('vue').ShallowUnwrapRef` : "NonNullable"}<${_nullishCoalesce(map.defineExpose, () => ( "{}"))}>) => {}`,
169
+ expose: (exposed: import('vue').ShallowUnwrapRef<${_nullishCoalesce(map.defineExpose, () => ( "{}"))}>) => {}`,
170
170
  `,
171
171
  render: `,
172
172
  shouldWrapByCall ? "(" : ""
@@ -321,17 +321,23 @@ function getRootMap(options) {
321
321
  }
322
322
  const id = toValidAssetId(modelName, `${_common.HELPER_PREFIX}model`);
323
323
  const typeString = `import('vue').UnwrapRef<typeof ${id}>`;
324
- (rootMap.get(root).defineModel ??= []).push(
324
+ const defineModel = rootMap.get(root).defineModel ??= [];
325
+ defineModel.push(
325
326
  `${modelName.includes("-") ? `'${modelName}'` : modelName}${isRequired ? ":" : "?:"} ${typeString}`,
326
327
  `'onUpdate:${modelName}'?: ($event: ${typeString}) => any`
327
328
  );
329
+ if (_optionalChain([expression, 'access', _11 => _11.typeArguments, 'optionalAccess', _12 => _12[1]])) {
330
+ defineModel.push(
331
+ `${modelName}Modifiers?: Partial<Record<${expression.typeArguments[1].getText(ast)}, boolean>>`
332
+ );
333
+ }
328
334
  _tsmacro.replaceRange.call(void 0,
329
335
  codes,
330
336
  initializer.getStart(ast),
331
337
  initializer.getStart(ast),
332
338
  `// @ts-ignore
333
339
  ${id};
334
- let ${id} =`
340
+ let ${id} = `
335
341
  );
336
342
  } else if (options.defineSlots.alias.includes(macroName)) {
337
343
  _tsmacro.replaceRange.call(void 0,
@@ -367,7 +373,7 @@ function toValidAssetId(name, type) {
367
373
  // src/volar.ts
368
374
  var plugin = _tsmacro.createPlugin.call(void 0,
369
375
  ({ ts }, userOptions = {}) => {
370
- const resolvedOptions = _chunkUZ426MO6cjs.resolveOptions.call(void 0, userOptions);
376
+ const resolvedOptions = _chunk53TNKVYDcjs.resolveOptions.call(void 0, userOptions);
371
377
  const filter = _common.createFilter.call(void 0, resolvedOptions);
372
378
  return {
373
379
  name: "@vue-jsx-vapor/macros",
package/dist/volar.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveOptions
3
- } from "./chunk-ZXRSELD6.js";
3
+ } from "./chunk-DANY2WQD.js";
4
4
 
5
5
  // src/volar.ts
6
6
  import { createFilter } from "@vue-macros/common";
@@ -166,7 +166,7 @@ props: {} as { ${props.join(", ")} }`,
166
166
  `,
167
167
  slots: {} as ${map.defineSlots ?? "{}"}`,
168
168
  `,
169
- expose: (exposed: ${options.lib === "vue" ? `import('vue').ShallowUnwrapRef` : "NonNullable"}<${map.defineExpose ?? "{}"}>) => {}`,
169
+ expose: (exposed: import('vue').ShallowUnwrapRef<${map.defineExpose ?? "{}"}>) => {}`,
170
170
  `,
171
171
  render: `,
172
172
  shouldWrapByCall ? "(" : ""
@@ -321,17 +321,23 @@ function getRootMap(options) {
321
321
  }
322
322
  const id = toValidAssetId(modelName, `${HELPER_PREFIX4}model`);
323
323
  const typeString = `import('vue').UnwrapRef<typeof ${id}>`;
324
- (rootMap.get(root).defineModel ??= []).push(
324
+ const defineModel = rootMap.get(root).defineModel ??= [];
325
+ defineModel.push(
325
326
  `${modelName.includes("-") ? `'${modelName}'` : modelName}${isRequired ? ":" : "?:"} ${typeString}`,
326
327
  `'onUpdate:${modelName}'?: ($event: ${typeString}) => any`
327
328
  );
329
+ if (expression.typeArguments?.[1]) {
330
+ defineModel.push(
331
+ `${modelName}Modifiers?: Partial<Record<${expression.typeArguments[1].getText(ast)}, boolean>>`
332
+ );
333
+ }
328
334
  replaceRange4(
329
335
  codes,
330
336
  initializer.getStart(ast),
331
337
  initializer.getStart(ast),
332
338
  `// @ts-ignore
333
339
  ${id};
334
- let ${id} =`
340
+ let ${id} = `
335
341
  );
336
342
  } else if (options.defineSlots.alias.includes(macroName)) {
337
343
  replaceRange4(
package/dist/webpack.cjs CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkWWH3HXFCcjs = require('./chunk-WWH3HXFC.cjs');
4
- require('./chunk-YRPLEEOM.cjs');
5
- require('./chunk-Y5EBYHAU.cjs');
6
- require('./chunk-JS6XU4SQ.cjs');
7
- require('./chunk-UZ426MO6.cjs');
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 = _chunkWWH3HXFCcjs.webpack_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-3PWNZD2U.js";
4
- import "./chunk-LLVVZVJJ.js";
5
- import "./chunk-IN7QS6NY.js";
6
- import "./chunk-JKT6AV5O.js";
7
- import "./chunk-ZXRSELD6.js";
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.4",
3
+ "version": "2.1.6",
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.4",
171
- "@vue/compiler-sfc": "https://pkg.pr.new/@vue/compiler-sfc@eeab9c4",
170
+ "@vue-macros/common": "^3.0.0-beta.6",
171
+ "@vue/compiler-sfc": "https://pkg.pr.new/@vue/compiler-sfc@3e7464f",
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.4",
183
- "vue": "https://pkg.pr.new/vue@eeab9c4"
182
+ "@vue-macros/test-utils": "^3.0.0-beta.6",
183
+ "vue": "https://pkg.pr.new/vue@3e7464f"
184
184
  },
185
185
  "scripts": {
186
186
  "build": "tsup",