@dcloudio/uni-cli-shared 3.0.0-4080720251210001 → 3.0.0-5000320260312001

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 (145) hide show
  1. package/dist/constants.d.ts +3 -0
  2. package/dist/constants.js +6 -1
  3. package/dist/deps.js +6 -1
  4. package/dist/dom2/index.d.ts +1 -0
  5. package/dist/dom2/index.js +17 -0
  6. package/dist/dom2/sharedData.d.ts +2 -0
  7. package/dist/dom2/sharedData.js +19 -0
  8. package/dist/easycom.js +34 -5
  9. package/dist/env/define.d.ts +3 -0
  10. package/dist/env/define.js +12 -0
  11. package/dist/hbx/alias.js +15 -17
  12. package/dist/hbx/index.d.ts +1 -1
  13. package/dist/hbx/index.js +4 -2
  14. package/dist/hbx/log.d.ts +5 -0
  15. package/dist/hbx/log.js +44 -1
  16. package/dist/i18n.js +4 -0
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.js +1 -0
  19. package/dist/json/app/manifest/index.d.ts +1 -0
  20. package/dist/json/app/manifest/index.js +3 -1
  21. package/dist/json/mp/pages.js +0 -5
  22. package/dist/json/pages.d.ts +2 -2
  23. package/dist/json/pages.js +4 -1
  24. package/dist/json/uni-x/index.d.ts +1 -1
  25. package/dist/json/utils.js +31 -22
  26. package/dist/logs/console.js +1 -1
  27. package/dist/logs/index.d.ts +11 -0
  28. package/dist/logs/index.js +34 -1
  29. package/dist/messages/en.d.ts +6 -3
  30. package/dist/messages/en.js +6 -3
  31. package/dist/messages/index.d.ts +11 -5
  32. package/dist/messages/zh_CN.d.ts +5 -2
  33. package/dist/messages/zh_CN.js +5 -2
  34. package/dist/mp/assets.d.ts +1 -0
  35. package/dist/mp/assets.js +27 -1
  36. package/dist/mp/externalClasses.d.ts +38 -2
  37. package/dist/mp/externalClasses.js +90 -4
  38. package/dist/mp/index.d.ts +4 -3
  39. package/dist/mp/index.js +11 -1
  40. package/dist/mp/plugin.d.ts +1 -0
  41. package/dist/mp/plugin.js +14 -1
  42. package/dist/mp/style.d.ts +1 -0
  43. package/dist/mp/style.js +8 -1
  44. package/dist/mp/usingComponents.d.ts +1 -0
  45. package/dist/mp/usingComponents.js +17 -1
  46. package/dist/postcss/index.d.ts +2 -0
  47. package/dist/postcss/index.js +3 -1
  48. package/dist/postcss/plugins/stylePluginExternal.d.ts +17 -0
  49. package/dist/postcss/plugins/stylePluginExternal.js +127 -0
  50. package/dist/postcss/plugins/stylePluginScoped.js +30 -0
  51. package/dist/preprocess/context.js +2 -0
  52. package/dist/preprocess/index.d.ts +9 -6
  53. package/dist/preprocess/index.js +33 -8
  54. package/dist/resolve.js +5 -1
  55. package/dist/uni_modules.js +20 -4
  56. package/dist/utils.d.ts +2 -2
  57. package/dist/utils.js +9 -6
  58. package/dist/utsUtils.d.ts +1 -0
  59. package/dist/utsUtils.js +2 -1
  60. package/dist/vite/autoImport.js +91 -6
  61. package/dist/vite/plugins/console.js +1 -1
  62. package/dist/vite/plugins/cssScoped.js +2 -1
  63. package/dist/vite/plugins/easycom.js +7 -0
  64. package/dist/vite/plugins/json.js +69 -2
  65. package/dist/vite/plugins/pre.js +4 -2
  66. package/dist/vite/plugins/sfc.js +1 -1
  67. package/dist/vite/plugins/stats.js +32 -0
  68. package/dist/vite/plugins/uts/ext-api.js +1 -1
  69. package/dist/vite/plugins/uts/uni_modules.js +12 -0
  70. package/dist/vite/plugins/uts/uvue.js +7 -2
  71. package/dist/vite/plugins/vitejs/plugins/asset.d.ts +1 -0
  72. package/dist/vite/plugins/vitejs/plugins/asset.js +19 -1
  73. package/dist/vite/plugins/vitejs/plugins/css.d.ts +2 -1
  74. package/dist/vite/plugins/vitejs/plugins/css.js +27 -10
  75. package/dist/vite/utils/ast.d.ts +2 -1
  76. package/dist/vite/utils/ast.js +5 -1
  77. package/dist/vue/parse.d.ts +2 -0
  78. package/dist/vue/parse.js +3 -1
  79. package/dist/vue/transforms/index.d.ts +1 -0
  80. package/dist/vue/transforms/index.js +1 -0
  81. package/dist/vue/transforms/transformLineBreak.d.ts +2 -0
  82. package/dist/vue/transforms/transformLineBreak.js +15 -0
  83. package/dist/vue/transforms/transformTag.d.ts +1 -1
  84. package/dist/vue/transforms/transformTag.js +5 -0
  85. package/dist/vue/transforms/x/transformMPBuiltInTag.js +2 -2
  86. package/dist/vue/utils.js +8 -1
  87. package/lib/@vue/compiler-core/dist/compiler-core.cjs.js +42 -23
  88. package/lib/@vue/compiler-core/dist/compiler-core.cjs.prod.js +42 -23
  89. package/lib/@vue/compiler-core/dist/compiler-core.esm-bundler.js +39 -19
  90. package/lib/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +4635 -1024
  91. package/lib/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +8762 -7849
  92. package/lib/dom2/app/@vitejs/plugin-vue/LICENSE +21 -0
  93. package/lib/dom2/app/@vitejs/plugin-vue/README.md +278 -0
  94. package/lib/dom2/app/@vitejs/plugin-vue/dist/index.cjs +3353 -0
  95. package/lib/dom2/app/@vitejs/plugin-vue/dist/index.d.cts +113 -0
  96. package/lib/dom2/app/@vitejs/plugin-vue/dist/index.d.mts +111 -0
  97. package/lib/dom2/app/@vitejs/plugin-vue/dist/index.d.ts +113 -0
  98. package/lib/dom2/app/@vitejs/plugin-vue/dist/index.mjs +3338 -0
  99. package/lib/dom2/app/@vitejs/plugin-vue/package.json +50 -0
  100. package/lib/dom2/app/@vue/compiler-core/LICENSE +21 -0
  101. package/lib/dom2/app/@vue/compiler-core/README.md +1 -0
  102. package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.cjs.js +5492 -0
  103. package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.cjs.prod.js +5436 -0
  104. package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.d.ts +1187 -0
  105. package/lib/dom2/app/@vue/compiler-core/dist/compiler-core.esm-bundler.js +4335 -0
  106. package/lib/dom2/app/@vue/compiler-core/index.js +7 -0
  107. package/lib/dom2/app/@vue/compiler-core/package.json +58 -0
  108. package/lib/dom2/app/@vue/compiler-dom/LICENSE +21 -0
  109. package/lib/dom2/app/@vue/compiler-dom/README.md +1 -0
  110. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.cjs.js +762 -0
  111. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +736 -0
  112. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.d.ts +73 -0
  113. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-browser.js +5051 -0
  114. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js +11 -0
  115. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js +557 -0
  116. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.global.js +5234 -0
  117. package/lib/dom2/app/@vue/compiler-dom/dist/compiler-dom.global.prod.js +11 -0
  118. package/lib/dom2/app/@vue/compiler-dom/index.js +7 -0
  119. package/lib/dom2/app/@vue/compiler-dom/package.json +57 -0
  120. package/lib/dom2/app/@vue/compiler-sfc/LICENSE +21 -0
  121. package/lib/dom2/app/@vue/compiler-sfc/README.md +80 -0
  122. package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +15528 -0
  123. package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.d.ts +11595 -0
  124. package/lib/dom2/app/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +41525 -0
  125. package/lib/dom2/app/@vue/compiler-sfc/package.json +68 -0
  126. package/lib/dom2/app/@vue/compiler-vapor/LICENSE +21 -0
  127. package/lib/dom2/app/@vue/compiler-vapor/README.md +1 -0
  128. package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.cjs.js +3584 -0
  129. package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.d.ts +22858 -0
  130. package/lib/dom2/app/@vue/compiler-vapor/dist/compiler-vapor.esm-browser.js +22438 -0
  131. package/lib/dom2/app/@vue/compiler-vapor/package.json +51 -0
  132. package/lib/dom2/app/@vue/compiler-vapor-dom2/dist/compiler-vapor-dom2.cjs.js +1 -0
  133. package/lib/dom2/app/@vue/compiler-vapor-dom2/package.json +56 -0
  134. package/lib/dom2/app/@vue/shared/LICENSE +21 -0
  135. package/lib/dom2/app/@vue/shared/README.md +3 -0
  136. package/lib/dom2/app/@vue/shared/dist/shared.cjs.js +773 -0
  137. package/lib/dom2/app/@vue/shared/dist/shared.cjs.prod.js +773 -0
  138. package/lib/dom2/app/@vue/shared/dist/shared.d.ts +412 -0
  139. package/lib/dom2/app/@vue/shared/dist/shared.esm-bundler.js +688 -0
  140. package/lib/dom2/app/@vue/shared/index.js +7 -0
  141. package/lib/dom2/app/@vue/shared/package.json +47 -0
  142. package/lib/preprocess/lib/preprocess.js +9 -3
  143. package/lib/vapor/@vue/compiler-core/dist/compiler-core.cjs.js +1 -1
  144. package/lib/vapor/@vue/compiler-core/dist/compiler-core.cjs.prod.js +1 -1
  145. package/package.json +8 -6
@@ -0,0 +1,736 @@
1
+ /**
2
+ * @vue/compiler-dom v3.6.0-beta.5
3
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
+ * @license MIT
5
+ **/
6
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
7
+ let _vue_compiler_core = require("@vue/compiler-core");
8
+ let _vue_shared = require("@vue/shared");
9
+
10
+ //#region packages/compiler-dom/src/runtimeHelpers.ts
11
+ const V_MODEL_RADIO = Symbol(``);
12
+ const V_MODEL_CHECKBOX = Symbol(``);
13
+ const V_MODEL_TEXT = Symbol(``);
14
+ const V_MODEL_SELECT = Symbol(``);
15
+ const V_MODEL_DYNAMIC = Symbol(``);
16
+ const V_ON_WITH_MODIFIERS = Symbol(``);
17
+ const V_ON_WITH_KEYS = Symbol(``);
18
+ const V_SHOW = Symbol(``);
19
+ const TRANSITION = Symbol(``);
20
+ const TRANSITION_GROUP = Symbol(``);
21
+ (0, _vue_compiler_core.registerRuntimeHelpers)({
22
+ [V_MODEL_RADIO]: `vModelRadio`,
23
+ [V_MODEL_CHECKBOX]: `vModelCheckbox`,
24
+ [V_MODEL_TEXT]: `vModelText`,
25
+ [V_MODEL_SELECT]: `vModelSelect`,
26
+ [V_MODEL_DYNAMIC]: `vModelDynamic`,
27
+ [V_ON_WITH_MODIFIERS]: `withModifiers`,
28
+ [V_ON_WITH_KEYS]: `withKeys`,
29
+ [V_SHOW]: `vShow`,
30
+ [TRANSITION]: `Transition`,
31
+ [TRANSITION_GROUP]: `TransitionGroup`
32
+ });
33
+
34
+ //#endregion
35
+ //#region packages/compiler-dom/src/parserOptions.ts
36
+ const parserOptions = {
37
+ parseMode: "html",
38
+ isVoidTag: _vue_shared.isVoidTag,
39
+ isNativeTag: (tag) => (0, _vue_shared.isHTMLTag)(tag) || (0, _vue_shared.isSVGTag)(tag) || (0, _vue_shared.isMathMLTag)(tag),
40
+ isPreTag: (tag) => tag === "pre",
41
+ isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea",
42
+ decodeEntities: void 0,
43
+ isBuiltInComponent: (tag) => {
44
+ if (tag === "Transition" || tag === "transition") return TRANSITION;
45
+ else if (tag === "TransitionGroup" || tag === "transition-group") return TRANSITION_GROUP;
46
+ },
47
+ getNamespace(tag, parent, rootNamespace) {
48
+ let ns = parent ? parent.ns : rootNamespace;
49
+ if (parent && ns === 2) {
50
+ if (parent.tag === "annotation-xml") {
51
+ if ((0, _vue_shared.isSVGTag)(tag)) return 1;
52
+ if (parent.props.some((a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml"))) ns = 0;
53
+ } else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") ns = 0;
54
+ } else if (parent && ns === 1) {
55
+ if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") ns = 0;
56
+ }
57
+ if (ns === 0) {
58
+ if ((0, _vue_shared.isSVGTag)(tag)) return 1;
59
+ if ((0, _vue_shared.isMathMLTag)(tag)) return 2;
60
+ }
61
+ return ns;
62
+ }
63
+ };
64
+
65
+ //#endregion
66
+ //#region packages/compiler-dom/src/transforms/transformStyle.ts
67
+ const transformStyle = (node) => {
68
+ if (node.type === 1) node.props.forEach((p, i) => {
69
+ if (p.type === 6 && p.name === "style" && p.value) node.props[i] = {
70
+ type: 7,
71
+ name: `bind`,
72
+ arg: (0, _vue_compiler_core.createSimpleExpression)(`style`, true, p.loc),
73
+ exp: parseInlineCSS(p.value.content, p.loc),
74
+ modifiers: [],
75
+ loc: p.loc
76
+ };
77
+ });
78
+ };
79
+ const parseInlineCSS = (cssText, loc) => {
80
+ const normalized = (0, _vue_shared.parseStringStyle)(cssText);
81
+ return (0, _vue_compiler_core.createSimpleExpression)(JSON.stringify(normalized), false, loc, 3);
82
+ };
83
+
84
+ //#endregion
85
+ //#region packages/compiler-dom/src/errors.ts
86
+ function createDOMCompilerError(code, loc) {
87
+ return (0, _vue_compiler_core.createCompilerError)(code, loc, DOMErrorMessages);
88
+ }
89
+ const DOMErrorCodes = {
90
+ "X_V_HTML_NO_EXPRESSION": 54,
91
+ "54": "X_V_HTML_NO_EXPRESSION",
92
+ "X_V_HTML_WITH_CHILDREN": 55,
93
+ "55": "X_V_HTML_WITH_CHILDREN",
94
+ "X_V_TEXT_NO_EXPRESSION": 56,
95
+ "56": "X_V_TEXT_NO_EXPRESSION",
96
+ "X_V_TEXT_WITH_CHILDREN": 57,
97
+ "57": "X_V_TEXT_WITH_CHILDREN",
98
+ "X_V_MODEL_ON_INVALID_ELEMENT": 58,
99
+ "58": "X_V_MODEL_ON_INVALID_ELEMENT",
100
+ "X_V_MODEL_ARG_ON_ELEMENT": 59,
101
+ "59": "X_V_MODEL_ARG_ON_ELEMENT",
102
+ "X_V_MODEL_ON_FILE_INPUT_ELEMENT": 60,
103
+ "60": "X_V_MODEL_ON_FILE_INPUT_ELEMENT",
104
+ "X_V_MODEL_UNNECESSARY_VALUE": 61,
105
+ "61": "X_V_MODEL_UNNECESSARY_VALUE",
106
+ "X_V_SHOW_NO_EXPRESSION": 62,
107
+ "62": "X_V_SHOW_NO_EXPRESSION",
108
+ "X_TRANSITION_INVALID_CHILDREN": 63,
109
+ "63": "X_TRANSITION_INVALID_CHILDREN",
110
+ "X_IGNORED_SIDE_EFFECT_TAG": 64,
111
+ "64": "X_IGNORED_SIDE_EFFECT_TAG",
112
+ "__EXTEND_POINT__": 65,
113
+ "65": "__EXTEND_POINT__"
114
+ };
115
+ const DOMErrorMessages = {
116
+ [54]: `v-html is missing expression.`,
117
+ [55]: `v-html will override element children.`,
118
+ [56]: `v-text is missing expression.`,
119
+ [57]: `v-text will override element children.`,
120
+ [58]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
121
+ [59]: `v-model argument is not supported on plain elements.`,
122
+ [60]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
123
+ [61]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
124
+ [62]: `v-show is missing expression.`,
125
+ [63]: `<Transition> expects exactly one child element or component.`,
126
+ [64]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`,
127
+ [65]: ``
128
+ };
129
+
130
+ //#endregion
131
+ //#region packages/compiler-dom/src/transforms/vHtml.ts
132
+ const transformVHtml = (dir, node, context) => {
133
+ const { exp, loc } = dir;
134
+ if (!exp) context.onError(createDOMCompilerError(54, loc));
135
+ if (node.children.length) {
136
+ context.onError(createDOMCompilerError(55, loc));
137
+ node.children.length = 0;
138
+ }
139
+ return { props: [(0, _vue_compiler_core.createObjectProperty)((0, _vue_compiler_core.createSimpleExpression)(`innerHTML`, true, loc), exp || (0, _vue_compiler_core.createSimpleExpression)("", true))] };
140
+ };
141
+
142
+ //#endregion
143
+ //#region packages/compiler-dom/src/transforms/vText.ts
144
+ const transformVText = (dir, node, context) => {
145
+ const { exp, loc } = dir;
146
+ if (!exp) context.onError(createDOMCompilerError(56, loc));
147
+ if (node.children.length) {
148
+ context.onError(createDOMCompilerError(57, loc));
149
+ node.children.length = 0;
150
+ }
151
+ return { props: [(0, _vue_compiler_core.createObjectProperty)((0, _vue_compiler_core.createSimpleExpression)(`textContent`, true), exp ? (0, _vue_compiler_core.getConstantType)(exp, context) > 0 ? exp : (0, _vue_compiler_core.createCallExpression)(context.helperString(_vue_compiler_core.TO_DISPLAY_STRING), [exp], loc) : (0, _vue_compiler_core.createSimpleExpression)("", true))] };
152
+ };
153
+
154
+ //#endregion
155
+ //#region packages/compiler-dom/src/transforms/vModel.ts
156
+ const transformModel = (dir, node, context) => {
157
+ const baseResult = (0, _vue_compiler_core.transformModel)(dir, node, context);
158
+ if (!baseResult.props.length || node.tagType === 1) return baseResult;
159
+ if (dir.arg) context.onError(createDOMCompilerError(59, dir.arg.loc));
160
+ const { tag } = node;
161
+ const isCustomElement = context.isCustomElement(tag);
162
+ if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) {
163
+ let directiveToUse = V_MODEL_TEXT;
164
+ let isInvalidType = false;
165
+ if (tag === "input" || isCustomElement) {
166
+ const type = (0, _vue_compiler_core.findProp)(node, `type`);
167
+ if (type) {
168
+ if (type.type === 7) directiveToUse = V_MODEL_DYNAMIC;
169
+ else if (type.value) switch (type.value.content) {
170
+ case "radio":
171
+ directiveToUse = V_MODEL_RADIO;
172
+ break;
173
+ case "checkbox":
174
+ directiveToUse = V_MODEL_CHECKBOX;
175
+ break;
176
+ case "file":
177
+ isInvalidType = true;
178
+ context.onError(createDOMCompilerError(60, dir.loc));
179
+ break;
180
+ default: break;
181
+ }
182
+ } else if ((0, _vue_compiler_core.hasDynamicKeyVBind)(node)) directiveToUse = V_MODEL_DYNAMIC;
183
+ } else if (tag === "select") directiveToUse = V_MODEL_SELECT;
184
+ if (!isInvalidType) baseResult.needRuntime = context.helper(directiveToUse);
185
+ } else context.onError(createDOMCompilerError(58, dir.loc));
186
+ baseResult.props = baseResult.props.filter((p) => !(p.key.type === 4 && p.key.content === "modelValue"));
187
+ return baseResult;
188
+ };
189
+
190
+ //#endregion
191
+ //#region packages/compiler-dom/src/transforms/vOn.ts
192
+ const isEventOptionModifier = /* @__PURE__ */ (0, _vue_shared.makeMap)(`passive,once,capture`);
193
+ const isNonKeyModifier = /* @__PURE__ */ (0, _vue_shared.makeMap)("stop,prevent,self,ctrl,shift,alt,meta,exact,middle");
194
+ const maybeKeyModifier = /* @__PURE__ */ (0, _vue_shared.makeMap)("left,right");
195
+ const isKeyboardEvent = /* @__PURE__ */ (0, _vue_shared.makeMap)(`onkeyup,onkeydown,onkeypress`);
196
+ const resolveModifiers = (key, modifiers, context, loc) => {
197
+ const keyModifiers = [];
198
+ const nonKeyModifiers = [];
199
+ const eventOptionModifiers = [];
200
+ for (let i = 0; i < modifiers.length; i++) {
201
+ const modifier = modifiers[i].content;
202
+ if (modifier === "native" && context && (0, _vue_compiler_core.checkCompatEnabled)("COMPILER_V_ON_NATIVE", context, loc)) eventOptionModifiers.push(modifier);
203
+ else if (isEventOptionModifier(modifier)) eventOptionModifiers.push(modifier);
204
+ else {
205
+ const keyString = (0, _vue_shared.isString)(key) ? key : (0, _vue_compiler_core.isStaticExp)(key) ? key.content : null;
206
+ if (maybeKeyModifier(modifier)) if (keyString) if (isKeyboardEvent(keyString.toLowerCase())) keyModifiers.push(modifier);
207
+ else nonKeyModifiers.push(modifier);
208
+ else {
209
+ keyModifiers.push(modifier);
210
+ nonKeyModifiers.push(modifier);
211
+ }
212
+ else if (isNonKeyModifier(modifier)) nonKeyModifiers.push(modifier);
213
+ else keyModifiers.push(modifier);
214
+ }
215
+ }
216
+ return {
217
+ keyModifiers,
218
+ nonKeyModifiers,
219
+ eventOptionModifiers
220
+ };
221
+ };
222
+ const transformClick = (key, event) => {
223
+ return (0, _vue_compiler_core.isStaticExp)(key) && key.content.toLowerCase() === "onclick" ? (0, _vue_compiler_core.createSimpleExpression)(event, true) : key.type !== 4 ? (0, _vue_compiler_core.createCompoundExpression)([
224
+ `(`,
225
+ key,
226
+ `) === "onClick" ? "${event}" : (`,
227
+ key,
228
+ `)`
229
+ ]) : key;
230
+ };
231
+ const transformOn = (dir, node, context) => {
232
+ return (0, _vue_compiler_core.transformOn)(dir, node, context, (baseResult) => {
233
+ const { modifiers } = dir;
234
+ if (!modifiers.length) return baseResult;
235
+ let { key, value: handlerExp } = baseResult.props[0];
236
+ const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc);
237
+ if (nonKeyModifiers.includes("right")) key = transformClick(key, `onContextmenu`);
238
+ if (nonKeyModifiers.includes("middle")) key = transformClick(key, `onMouseup`);
239
+ if (nonKeyModifiers.length) handlerExp = (0, _vue_compiler_core.createCallExpression)(context.helper(V_ON_WITH_MODIFIERS), [handlerExp, JSON.stringify(nonKeyModifiers)]);
240
+ if (keyModifiers.length && (!(0, _vue_compiler_core.isStaticExp)(key) || isKeyboardEvent(key.content.toLowerCase()))) handlerExp = (0, _vue_compiler_core.createCallExpression)(context.helper(V_ON_WITH_KEYS), [handlerExp, JSON.stringify(keyModifiers)]);
241
+ if (eventOptionModifiers.length) {
242
+ const modifierPostfix = eventOptionModifiers.map(_vue_shared.capitalize).join("");
243
+ key = (0, _vue_compiler_core.isStaticExp)(key) ? (0, _vue_compiler_core.createSimpleExpression)(`${key.content}${modifierPostfix}`, true) : (0, _vue_compiler_core.createCompoundExpression)([
244
+ `(`,
245
+ key,
246
+ `) + "${modifierPostfix}"`
247
+ ]);
248
+ }
249
+ return { props: [(0, _vue_compiler_core.createObjectProperty)(key, handlerExp)] };
250
+ });
251
+ };
252
+
253
+ //#endregion
254
+ //#region packages/compiler-dom/src/transforms/vShow.ts
255
+ const transformShow = (dir, node, context) => {
256
+ const { exp, loc } = dir;
257
+ if (!exp) context.onError(createDOMCompilerError(62, loc));
258
+ return {
259
+ props: [],
260
+ needRuntime: context.helper(V_SHOW)
261
+ };
262
+ };
263
+
264
+ //#endregion
265
+ //#region packages/compiler-dom/src/transforms/Transition.ts
266
+ function postTransformTransition(node, onError, hasMultipleChildren = defaultHasMultipleChildren) {
267
+ return () => {
268
+ if (!node.children.length) return;
269
+ if (hasMultipleChildren(node)) onError(createDOMCompilerError(63, {
270
+ start: node.children[0].loc.start,
271
+ end: node.children[node.children.length - 1].loc.end,
272
+ source: ""
273
+ }));
274
+ const child = node.children[0];
275
+ if (child.type === 1) {
276
+ for (const p of child.props) if (p.type === 7 && p.name === "show") node.props.push({
277
+ type: 6,
278
+ name: "persisted",
279
+ nameLoc: node.loc,
280
+ value: void 0,
281
+ loc: node.loc
282
+ });
283
+ }
284
+ };
285
+ }
286
+ function defaultHasMultipleChildren(node) {
287
+ const children = node.children = node.children.filter((c) => !(0, _vue_compiler_core.isCommentOrWhitespace)(c));
288
+ const child = children[0];
289
+ return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(defaultHasMultipleChildren);
290
+ }
291
+
292
+ //#endregion
293
+ //#region packages/compiler-dom/src/transforms/stringifyStatic.ts
294
+ /**
295
+ * This module is Node-only.
296
+ */
297
+ /**
298
+ * Regex for replacing placeholders for embedded constant variables
299
+ * (e.g. import URL string constants generated by compiler-sfc)
300
+ */
301
+ const expReplaceRE = /__VUE_EXP_START__(.*?)__VUE_EXP_END__/g;
302
+ /**
303
+ * Turn eligible hoisted static trees into stringified static nodes, e.g.
304
+ *
305
+ * ```js
306
+ * const _hoisted_1 = createStaticVNode(`<div class="foo">bar</div>`)
307
+ * ```
308
+ *
309
+ * A single static vnode can contain stringified content for **multiple**
310
+ * consecutive nodes (element and plain text), called a "chunk".
311
+ * `@vue/runtime-dom` will create the content via innerHTML in a hidden
312
+ * container element and insert all the nodes in place. The call must also
313
+ * provide the number of nodes contained in the chunk so that during hydration
314
+ * we can know how many nodes the static vnode should adopt.
315
+ *
316
+ * The optimization scans a children list that contains hoisted nodes, and
317
+ * tries to find the largest chunk of consecutive hoisted nodes before running
318
+ * into a non-hoisted node or the end of the list. A chunk is then converted
319
+ * into a single static vnode and replaces the hoisted expression of the first
320
+ * node in the chunk. Other nodes in the chunk are considered "merged" and
321
+ * therefore removed from both the hoist list and the children array.
322
+ *
323
+ * This optimization is only performed in Node.js.
324
+ */
325
+ const stringifyStatic = (children, context, parent) => {
326
+ if (context.scopes.vSlot > 0) return;
327
+ const isParentCached = parent.type === 1 && parent.codegenNode && parent.codegenNode.type === 13 && parent.codegenNode.children && !(0, _vue_shared.isArray)(parent.codegenNode.children) && parent.codegenNode.children.type === 20;
328
+ let nc = 0;
329
+ let ec = 0;
330
+ const currentChunk = [];
331
+ const stringifyCurrentChunk = (currentIndex) => {
332
+ if (nc >= 20 || ec >= 5) {
333
+ const staticCall = (0, _vue_compiler_core.createCallExpression)(context.helper(_vue_compiler_core.CREATE_STATIC), [JSON.stringify(currentChunk.map((node) => stringifyNode(node, context)).join("")).replace(expReplaceRE, `" + $1 + "`), String(currentChunk.length)]);
334
+ const deleteCount = currentChunk.length - 1;
335
+ if (isParentCached) children.splice(currentIndex - currentChunk.length, currentChunk.length, staticCall);
336
+ else {
337
+ currentChunk[0].codegenNode.value = staticCall;
338
+ if (currentChunk.length > 1) {
339
+ children.splice(currentIndex - currentChunk.length + 1, deleteCount);
340
+ const cacheIndex = context.cached.indexOf(currentChunk[currentChunk.length - 1].codegenNode);
341
+ if (cacheIndex > -1) {
342
+ for (let i = cacheIndex; i < context.cached.length; i++) {
343
+ const c = context.cached[i];
344
+ if (c) c.index -= deleteCount;
345
+ }
346
+ context.cached.splice(cacheIndex - deleteCount + 1, deleteCount);
347
+ }
348
+ }
349
+ }
350
+ return deleteCount;
351
+ }
352
+ return 0;
353
+ };
354
+ let i = 0;
355
+ for (; i < children.length; i++) {
356
+ const child = children[i];
357
+ if (isParentCached || getCachedNode(child)) {
358
+ const result = analyzeNode(child);
359
+ if (result) {
360
+ nc += result[0];
361
+ ec += result[1];
362
+ currentChunk.push(child);
363
+ continue;
364
+ }
365
+ }
366
+ i -= stringifyCurrentChunk(i);
367
+ nc = 0;
368
+ ec = 0;
369
+ currentChunk.length = 0;
370
+ }
371
+ stringifyCurrentChunk(i);
372
+ };
373
+ const getCachedNode = (node) => {
374
+ if ((node.type === 1 && node.tagType === 0 || node.type === 12) && node.codegenNode && node.codegenNode.type === 20) return node.codegenNode;
375
+ };
376
+ const dataAriaRE = /^(?:data|aria)-/;
377
+ const isStringifiableAttr = (name, ns) => {
378
+ return (ns === 0 ? (0, _vue_shared.isKnownHtmlAttr)(name) : ns === 1 ? (0, _vue_shared.isKnownSvgAttr)(name) : ns === 2 ? (0, _vue_shared.isKnownMathMLAttr)(name) : false) || dataAriaRE.test(name);
379
+ };
380
+ const isNonStringifiable = /* @__PURE__ */ (0, _vue_shared.makeMap)(`caption,thead,tr,th,tbody,td,tfoot,colgroup,col`);
381
+ /**
382
+ * for a cached node, analyze it and return:
383
+ * - false: bailed (contains non-stringifiable props or runtime constant)
384
+ * - [nc, ec] where
385
+ * - nc is the number of nodes inside
386
+ * - ec is the number of element with bindings inside
387
+ */
388
+ function analyzeNode(node) {
389
+ if (node.type === 1 && isNonStringifiable(node.tag)) return false;
390
+ if (node.type === 1 && (0, _vue_compiler_core.findDir)(node, "once", true)) return false;
391
+ if (node.type === 12) return [1, 0];
392
+ let nc = 1;
393
+ let ec = node.props.length > 0 ? 1 : 0;
394
+ let bailed = false;
395
+ const bail = () => {
396
+ bailed = true;
397
+ return false;
398
+ };
399
+ function walk(node) {
400
+ const isOptionTag = node.tag === "option" && node.ns === 0;
401
+ for (let i = 0; i < node.props.length; i++) {
402
+ const p = node.props[i];
403
+ if (p.type === 6 && !isStringifiableAttr(p.name, node.ns)) return bail();
404
+ if (p.type === 7 && p.name === "bind") {
405
+ if (p.arg && (p.arg.type === 8 || p.arg.isStatic && !isStringifiableAttr(p.arg.content, node.ns))) return bail();
406
+ if (p.exp && (p.exp.type === 8 || p.exp.constType < 3)) return bail();
407
+ if (isOptionTag && (0, _vue_compiler_core.isStaticArgOf)(p.arg, "value") && p.exp && !p.exp.isStatic) return bail();
408
+ }
409
+ }
410
+ for (let i = 0; i < node.children.length; i++) {
411
+ nc++;
412
+ const child = node.children[i];
413
+ if (child.type === 1) {
414
+ if (child.props.length > 0) ec++;
415
+ walk(child);
416
+ if (bailed) return false;
417
+ }
418
+ }
419
+ return true;
420
+ }
421
+ return walk(node) ? [nc, ec] : false;
422
+ }
423
+ function stringifyNode(node, context) {
424
+ if ((0, _vue_shared.isString)(node)) return node;
425
+ if ((0, _vue_shared.isSymbol)(node)) return ``;
426
+ switch (node.type) {
427
+ case 1: return stringifyElement(node, context);
428
+ case 2: return (0, _vue_shared.escapeHtml)(node.content);
429
+ case 3: return `<!--${(0, _vue_shared.escapeHtml)(node.content)}-->`;
430
+ case 5: return (0, _vue_shared.escapeHtml)((0, _vue_shared.toDisplayString)(evaluateConstant(node.content)));
431
+ case 8: return (0, _vue_shared.escapeHtml)(evaluateConstant(node));
432
+ case 12: return stringifyNode(node.content, context);
433
+ default: return "";
434
+ }
435
+ }
436
+ function stringifyElement(node, context) {
437
+ let res = `<${node.tag}`;
438
+ let innerHTML = "";
439
+ for (let i = 0; i < node.props.length; i++) {
440
+ const p = node.props[i];
441
+ if (p.type === 6) {
442
+ res += ` ${p.name}`;
443
+ if (p.value) res += `="${(0, _vue_shared.escapeHtml)(p.value.content)}"`;
444
+ } else if (p.type === 7) {
445
+ if (p.name === "bind") {
446
+ const exp = p.exp;
447
+ if (exp.content[0] === "_") {
448
+ res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`;
449
+ continue;
450
+ }
451
+ if ((0, _vue_shared.isBooleanAttr)(p.arg.content) && exp.content === "false") continue;
452
+ let evaluated = evaluateConstant(exp);
453
+ if (evaluated != null) {
454
+ const arg = p.arg && p.arg.content;
455
+ if (arg === "class") evaluated = (0, _vue_shared.normalizeClass)(evaluated);
456
+ else if (arg === "style") evaluated = (0, _vue_shared.stringifyStyle)((0, _vue_shared.normalizeStyle)(evaluated));
457
+ res += ` ${p.arg.content}="${(0, _vue_shared.escapeHtml)(evaluated)}"`;
458
+ }
459
+ } else if (p.name === "html") innerHTML = evaluateConstant(p.exp);
460
+ else if (p.name === "text") innerHTML = (0, _vue_shared.escapeHtml)((0, _vue_shared.toDisplayString)(evaluateConstant(p.exp)));
461
+ }
462
+ }
463
+ if (context.scopeId) res += ` ${context.scopeId}`;
464
+ res += `>`;
465
+ if (innerHTML) res += innerHTML;
466
+ else for (let i = 0; i < node.children.length; i++) res += stringifyNode(node.children[i], context);
467
+ if (!(0, _vue_shared.isVoidTag)(node.tag)) res += `</${node.tag}>`;
468
+ return res;
469
+ }
470
+ function evaluateConstant(exp) {
471
+ if (exp.type === 4) return new Function(`return (${exp.content})`)();
472
+ else {
473
+ let res = ``;
474
+ exp.children.forEach((c) => {
475
+ if ((0, _vue_shared.isString)(c) || (0, _vue_shared.isSymbol)(c)) return;
476
+ if (c.type === 2) res += c.content;
477
+ else if (c.type === 5) res += (0, _vue_shared.toDisplayString)(evaluateConstant(c.content));
478
+ else res += evaluateConstant(c);
479
+ });
480
+ return res;
481
+ }
482
+ }
483
+
484
+ //#endregion
485
+ //#region packages/compiler-dom/src/transforms/ignoreSideEffectTags.ts
486
+ const ignoreSideEffectTags = (node, context) => {
487
+ if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) context.removeNode();
488
+ };
489
+
490
+ //#endregion
491
+ //#region packages/compiler-dom/src/htmlNesting.ts
492
+ /**
493
+ * Copied from https://github.com/MananTank/validate-html-nesting
494
+ * with ISC license
495
+ *
496
+ * To avoid runtime dependency on validate-html-nesting
497
+ * This file should not change very often in the original repo
498
+ * but we may need to keep it up-to-date from time to time.
499
+ */
500
+ /**
501
+ * returns true if given parent-child nesting is valid HTML
502
+ */
503
+ function isValidHTMLNesting(parent, child) {
504
+ if (parent === "template") return true;
505
+ if (parent in onlyValidChildren) return onlyValidChildren[parent].has(child);
506
+ if (child in onlyValidParents) return onlyValidParents[child].has(parent);
507
+ if (parent in knownInvalidChildren) {
508
+ if (knownInvalidChildren[parent].has(child)) return false;
509
+ }
510
+ if (child in knownInvalidParents) {
511
+ if (knownInvalidParents[child].has(parent)) return false;
512
+ }
513
+ return true;
514
+ }
515
+ const headings = new Set([
516
+ "h1",
517
+ "h2",
518
+ "h3",
519
+ "h4",
520
+ "h5",
521
+ "h6"
522
+ ]);
523
+ const emptySet = /* @__PURE__ */ new Set([]);
524
+ /**
525
+ * maps element to set of elements that can be it's children, no other */
526
+ const onlyValidChildren = {
527
+ head: new Set([
528
+ "base",
529
+ "basefront",
530
+ "bgsound",
531
+ "link",
532
+ "meta",
533
+ "title",
534
+ "noscript",
535
+ "noframes",
536
+ "style",
537
+ "script",
538
+ "template"
539
+ ]),
540
+ optgroup: new Set(["option"]),
541
+ select: new Set([
542
+ "optgroup",
543
+ "option",
544
+ "hr"
545
+ ]),
546
+ table: new Set([
547
+ "caption",
548
+ "colgroup",
549
+ "tbody",
550
+ "tfoot",
551
+ "thead"
552
+ ]),
553
+ tr: new Set(["td", "th"]),
554
+ colgroup: new Set(["col"]),
555
+ tbody: new Set(["tr"]),
556
+ thead: new Set(["tr"]),
557
+ tfoot: new Set(["tr"]),
558
+ script: emptySet,
559
+ iframe: emptySet,
560
+ option: emptySet,
561
+ textarea: emptySet,
562
+ style: emptySet,
563
+ title: emptySet
564
+ };
565
+ /** maps elements to set of elements which can be it's parent, no other */
566
+ const onlyValidParents = {
567
+ html: emptySet,
568
+ body: new Set(["html"]),
569
+ head: new Set(["html"]),
570
+ td: new Set(["tr"]),
571
+ colgroup: new Set(["table"]),
572
+ caption: new Set(["table"]),
573
+ tbody: new Set(["table"]),
574
+ tfoot: new Set(["table"]),
575
+ col: new Set(["colgroup"]),
576
+ th: new Set(["tr"]),
577
+ thead: new Set(["table"]),
578
+ tr: new Set([
579
+ "tbody",
580
+ "thead",
581
+ "tfoot"
582
+ ]),
583
+ dd: new Set(["dl", "div"]),
584
+ dt: new Set(["dl", "div"]),
585
+ figcaption: new Set(["figure"]),
586
+ summary: new Set(["details"]),
587
+ area: new Set(["map"])
588
+ };
589
+ /** maps element to set of elements that can not be it's children, others can */
590
+ const knownInvalidChildren = {
591
+ p: new Set([
592
+ "address",
593
+ "article",
594
+ "aside",
595
+ "blockquote",
596
+ "center",
597
+ "details",
598
+ "dialog",
599
+ "dir",
600
+ "div",
601
+ "dl",
602
+ "fieldset",
603
+ "figure",
604
+ "footer",
605
+ "form",
606
+ "h1",
607
+ "h2",
608
+ "h3",
609
+ "h4",
610
+ "h5",
611
+ "h6",
612
+ "header",
613
+ "hgroup",
614
+ "hr",
615
+ "li",
616
+ "main",
617
+ "nav",
618
+ "menu",
619
+ "ol",
620
+ "p",
621
+ "pre",
622
+ "section",
623
+ "table",
624
+ "ul"
625
+ ]),
626
+ svg: new Set([
627
+ "b",
628
+ "blockquote",
629
+ "br",
630
+ "code",
631
+ "dd",
632
+ "div",
633
+ "dl",
634
+ "dt",
635
+ "em",
636
+ "embed",
637
+ "h1",
638
+ "h2",
639
+ "h3",
640
+ "h4",
641
+ "h5",
642
+ "h6",
643
+ "hr",
644
+ "i",
645
+ "img",
646
+ "li",
647
+ "menu",
648
+ "meta",
649
+ "ol",
650
+ "p",
651
+ "pre",
652
+ "ruby",
653
+ "s",
654
+ "small",
655
+ "span",
656
+ "strong",
657
+ "sub",
658
+ "sup",
659
+ "table",
660
+ "u",
661
+ "ul",
662
+ "var"
663
+ ])
664
+ };
665
+ /** maps element to set of elements that can not be it's parent, others can */
666
+ const knownInvalidParents = {
667
+ a: new Set(["a"]),
668
+ button: new Set(["button"]),
669
+ dd: new Set(["dd", "dt"]),
670
+ dt: new Set(["dd", "dt"]),
671
+ form: new Set(["form"]),
672
+ li: new Set(["li"]),
673
+ h1: headings,
674
+ h2: headings,
675
+ h3: headings,
676
+ h4: headings,
677
+ h5: headings,
678
+ h6: headings
679
+ };
680
+
681
+ //#endregion
682
+ //#region packages/compiler-dom/src/index.ts
683
+ const DOMNodeTransforms = [transformStyle, ...[]];
684
+ const DOMDirectiveTransforms = {
685
+ cloak: _vue_compiler_core.noopDirectiveTransform,
686
+ html: transformVHtml,
687
+ text: transformVText,
688
+ model: transformModel,
689
+ on: transformOn,
690
+ show: transformShow
691
+ };
692
+ function compile(src, options = {}) {
693
+ return (0, _vue_compiler_core.baseCompile)(src, (0, _vue_shared.extend)({}, parserOptions, options, {
694
+ nodeTransforms: [
695
+ ignoreSideEffectTags,
696
+ ...DOMNodeTransforms,
697
+ ...options.nodeTransforms || []
698
+ ],
699
+ directiveTransforms: (0, _vue_shared.extend)({}, DOMDirectiveTransforms, options.directiveTransforms || {}),
700
+ transformHoist: stringifyStatic
701
+ }));
702
+ }
703
+ function parse(template, options = {}) {
704
+ return (0, _vue_compiler_core.baseParse)(template, (0, _vue_shared.extend)({}, parserOptions, options));
705
+ }
706
+
707
+ //#endregion
708
+ exports.DOMDirectiveTransforms = DOMDirectiveTransforms;
709
+ exports.DOMErrorCodes = DOMErrorCodes;
710
+ exports.DOMErrorMessages = DOMErrorMessages;
711
+ exports.DOMNodeTransforms = DOMNodeTransforms;
712
+ exports.TRANSITION = TRANSITION;
713
+ exports.TRANSITION_GROUP = TRANSITION_GROUP;
714
+ exports.V_MODEL_CHECKBOX = V_MODEL_CHECKBOX;
715
+ exports.V_MODEL_DYNAMIC = V_MODEL_DYNAMIC;
716
+ exports.V_MODEL_RADIO = V_MODEL_RADIO;
717
+ exports.V_MODEL_SELECT = V_MODEL_SELECT;
718
+ exports.V_MODEL_TEXT = V_MODEL_TEXT;
719
+ exports.V_ON_WITH_KEYS = V_ON_WITH_KEYS;
720
+ exports.V_ON_WITH_MODIFIERS = V_ON_WITH_MODIFIERS;
721
+ exports.V_SHOW = V_SHOW;
722
+ exports.compile = compile;
723
+ exports.createDOMCompilerError = createDOMCompilerError;
724
+ exports.isKeyboardEvent = isKeyboardEvent;
725
+ exports.isValidHTMLNesting = isValidHTMLNesting;
726
+ exports.parse = parse;
727
+ exports.parserOptions = parserOptions;
728
+ exports.postTransformTransition = postTransformTransition;
729
+ exports.resolveModifiers = resolveModifiers;
730
+ exports.transformStyle = transformStyle;
731
+ Object.keys(_vue_compiler_core).forEach(function (k) {
732
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
733
+ enumerable: true,
734
+ get: function () { return _vue_compiler_core[k]; }
735
+ });
736
+ });