@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,762 @@
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(`vModelRadio`);
12
+ const V_MODEL_CHECKBOX = Symbol(`vModelCheckbox`);
13
+ const V_MODEL_TEXT = Symbol(`vModelText`);
14
+ const V_MODEL_SELECT = Symbol(`vModelSelect`);
15
+ const V_MODEL_DYNAMIC = Symbol(`vModelDynamic`);
16
+ const V_ON_WITH_MODIFIERS = Symbol(`vOnModifiersGuard`);
17
+ const V_ON_WITH_KEYS = Symbol(`vOnKeysGuard`);
18
+ const V_SHOW = Symbol(`vShow`);
19
+ const TRANSITION = Symbol(`Transition`);
20
+ const TRANSITION_GROUP = Symbol(`TransitionGroup`);
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
+ function checkDuplicatedValue() {
161
+ const value = (0, _vue_compiler_core.findDir)(node, "bind");
162
+ if (value && (0, _vue_compiler_core.isStaticArgOf)(value.arg, "value")) context.onError(createDOMCompilerError(61, value.loc));
163
+ }
164
+ const { tag } = node;
165
+ const isCustomElement = context.isCustomElement(tag);
166
+ if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) {
167
+ let directiveToUse = V_MODEL_TEXT;
168
+ let isInvalidType = false;
169
+ if (tag === "input" || isCustomElement) {
170
+ const type = (0, _vue_compiler_core.findProp)(node, `type`);
171
+ if (type) {
172
+ if (type.type === 7) directiveToUse = V_MODEL_DYNAMIC;
173
+ else if (type.value) switch (type.value.content) {
174
+ case "radio":
175
+ directiveToUse = V_MODEL_RADIO;
176
+ break;
177
+ case "checkbox":
178
+ directiveToUse = V_MODEL_CHECKBOX;
179
+ break;
180
+ case "file":
181
+ isInvalidType = true;
182
+ context.onError(createDOMCompilerError(60, dir.loc));
183
+ break;
184
+ default:
185
+ checkDuplicatedValue();
186
+ break;
187
+ }
188
+ } else if ((0, _vue_compiler_core.hasDynamicKeyVBind)(node)) directiveToUse = V_MODEL_DYNAMIC;
189
+ else checkDuplicatedValue();
190
+ } else if (tag === "select") directiveToUse = V_MODEL_SELECT;
191
+ else checkDuplicatedValue();
192
+ if (!isInvalidType) baseResult.needRuntime = context.helper(directiveToUse);
193
+ } else context.onError(createDOMCompilerError(58, dir.loc));
194
+ baseResult.props = baseResult.props.filter((p) => !(p.key.type === 4 && p.key.content === "modelValue"));
195
+ return baseResult;
196
+ };
197
+
198
+ //#endregion
199
+ //#region packages/compiler-dom/src/transforms/vOn.ts
200
+ const isEventOptionModifier = /* @__PURE__ */ (0, _vue_shared.makeMap)(`passive,once,capture`);
201
+ const isNonKeyModifier = /* @__PURE__ */ (0, _vue_shared.makeMap)("stop,prevent,self,ctrl,shift,alt,meta,exact,middle");
202
+ const maybeKeyModifier = /* @__PURE__ */ (0, _vue_shared.makeMap)("left,right");
203
+ const isKeyboardEvent = /* @__PURE__ */ (0, _vue_shared.makeMap)(`onkeyup,onkeydown,onkeypress`);
204
+ const resolveModifiers = (key, modifiers, context, loc) => {
205
+ const keyModifiers = [];
206
+ const nonKeyModifiers = [];
207
+ const eventOptionModifiers = [];
208
+ for (let i = 0; i < modifiers.length; i++) {
209
+ const modifier = modifiers[i].content;
210
+ if (modifier === "native" && context && (0, _vue_compiler_core.checkCompatEnabled)("COMPILER_V_ON_NATIVE", context, loc)) eventOptionModifiers.push(modifier);
211
+ else if (isEventOptionModifier(modifier)) eventOptionModifiers.push(modifier);
212
+ else {
213
+ const keyString = (0, _vue_shared.isString)(key) ? key : (0, _vue_compiler_core.isStaticExp)(key) ? key.content : null;
214
+ if (maybeKeyModifier(modifier)) if (keyString) if (isKeyboardEvent(keyString.toLowerCase())) keyModifiers.push(modifier);
215
+ else nonKeyModifiers.push(modifier);
216
+ else {
217
+ keyModifiers.push(modifier);
218
+ nonKeyModifiers.push(modifier);
219
+ }
220
+ else if (isNonKeyModifier(modifier)) nonKeyModifiers.push(modifier);
221
+ else keyModifiers.push(modifier);
222
+ }
223
+ }
224
+ return {
225
+ keyModifiers,
226
+ nonKeyModifiers,
227
+ eventOptionModifiers
228
+ };
229
+ };
230
+ const transformClick = (key, event) => {
231
+ 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)([
232
+ `(`,
233
+ key,
234
+ `) === "onClick" ? "${event}" : (`,
235
+ key,
236
+ `)`
237
+ ]) : key;
238
+ };
239
+ const transformOn = (dir, node, context) => {
240
+ return (0, _vue_compiler_core.transformOn)(dir, node, context, (baseResult) => {
241
+ const { modifiers } = dir;
242
+ if (!modifiers.length) return baseResult;
243
+ let { key, value: handlerExp } = baseResult.props[0];
244
+ const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc);
245
+ if (nonKeyModifiers.includes("right")) key = transformClick(key, `onContextmenu`);
246
+ if (nonKeyModifiers.includes("middle")) key = transformClick(key, `onMouseup`);
247
+ if (nonKeyModifiers.length) handlerExp = (0, _vue_compiler_core.createCallExpression)(context.helper(V_ON_WITH_MODIFIERS), [handlerExp, JSON.stringify(nonKeyModifiers)]);
248
+ 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)]);
249
+ if (eventOptionModifiers.length) {
250
+ const modifierPostfix = eventOptionModifiers.map(_vue_shared.capitalize).join("");
251
+ key = (0, _vue_compiler_core.isStaticExp)(key) ? (0, _vue_compiler_core.createSimpleExpression)(`${key.content}${modifierPostfix}`, true) : (0, _vue_compiler_core.createCompoundExpression)([
252
+ `(`,
253
+ key,
254
+ `) + "${modifierPostfix}"`
255
+ ]);
256
+ }
257
+ return { props: [(0, _vue_compiler_core.createObjectProperty)(key, handlerExp)] };
258
+ });
259
+ };
260
+
261
+ //#endregion
262
+ //#region packages/compiler-dom/src/transforms/vShow.ts
263
+ const transformShow = (dir, node, context) => {
264
+ const { exp, loc } = dir;
265
+ if (!exp) context.onError(createDOMCompilerError(62, loc));
266
+ return {
267
+ props: [],
268
+ needRuntime: context.helper(V_SHOW)
269
+ };
270
+ };
271
+
272
+ //#endregion
273
+ //#region packages/compiler-dom/src/transforms/Transition.ts
274
+ const transformTransition = (node, context) => {
275
+ if (node.type === 1 && node.tagType === 1) {
276
+ if (context.isBuiltInComponent(node.tag) === TRANSITION) return postTransformTransition(node, context.onError);
277
+ }
278
+ };
279
+ function postTransformTransition(node, onError, hasMultipleChildren = defaultHasMultipleChildren) {
280
+ return () => {
281
+ if (!node.children.length) return;
282
+ if (hasMultipleChildren(node)) onError(createDOMCompilerError(63, {
283
+ start: node.children[0].loc.start,
284
+ end: node.children[node.children.length - 1].loc.end,
285
+ source: ""
286
+ }));
287
+ const child = node.children[0];
288
+ if (child.type === 1) {
289
+ for (const p of child.props) if (p.type === 7 && p.name === "show") node.props.push({
290
+ type: 6,
291
+ name: "persisted",
292
+ nameLoc: node.loc,
293
+ value: void 0,
294
+ loc: node.loc
295
+ });
296
+ }
297
+ };
298
+ }
299
+ function defaultHasMultipleChildren(node) {
300
+ const children = node.children = node.children.filter((c) => !(0, _vue_compiler_core.isCommentOrWhitespace)(c));
301
+ const child = children[0];
302
+ return children.length !== 1 || child.type === 11 || child.type === 9 && child.branches.some(defaultHasMultipleChildren);
303
+ }
304
+
305
+ //#endregion
306
+ //#region packages/compiler-dom/src/transforms/stringifyStatic.ts
307
+ /**
308
+ * This module is Node-only.
309
+ */
310
+ /**
311
+ * Regex for replacing placeholders for embedded constant variables
312
+ * (e.g. import URL string constants generated by compiler-sfc)
313
+ */
314
+ const expReplaceRE = /__VUE_EXP_START__(.*?)__VUE_EXP_END__/g;
315
+ /**
316
+ * Turn eligible hoisted static trees into stringified static nodes, e.g.
317
+ *
318
+ * ```js
319
+ * const _hoisted_1 = createStaticVNode(`<div class="foo">bar</div>`)
320
+ * ```
321
+ *
322
+ * A single static vnode can contain stringified content for **multiple**
323
+ * consecutive nodes (element and plain text), called a "chunk".
324
+ * `@vue/runtime-dom` will create the content via innerHTML in a hidden
325
+ * container element and insert all the nodes in place. The call must also
326
+ * provide the number of nodes contained in the chunk so that during hydration
327
+ * we can know how many nodes the static vnode should adopt.
328
+ *
329
+ * The optimization scans a children list that contains hoisted nodes, and
330
+ * tries to find the largest chunk of consecutive hoisted nodes before running
331
+ * into a non-hoisted node or the end of the list. A chunk is then converted
332
+ * into a single static vnode and replaces the hoisted expression of the first
333
+ * node in the chunk. Other nodes in the chunk are considered "merged" and
334
+ * therefore removed from both the hoist list and the children array.
335
+ *
336
+ * This optimization is only performed in Node.js.
337
+ */
338
+ const stringifyStatic = (children, context, parent) => {
339
+ if (context.scopes.vSlot > 0) return;
340
+ 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;
341
+ let nc = 0;
342
+ let ec = 0;
343
+ const currentChunk = [];
344
+ const stringifyCurrentChunk = (currentIndex) => {
345
+ if (nc >= 20 || ec >= 5) {
346
+ 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)]);
347
+ const deleteCount = currentChunk.length - 1;
348
+ if (isParentCached) children.splice(currentIndex - currentChunk.length, currentChunk.length, staticCall);
349
+ else {
350
+ currentChunk[0].codegenNode.value = staticCall;
351
+ if (currentChunk.length > 1) {
352
+ children.splice(currentIndex - currentChunk.length + 1, deleteCount);
353
+ const cacheIndex = context.cached.indexOf(currentChunk[currentChunk.length - 1].codegenNode);
354
+ if (cacheIndex > -1) {
355
+ for (let i = cacheIndex; i < context.cached.length; i++) {
356
+ const c = context.cached[i];
357
+ if (c) c.index -= deleteCount;
358
+ }
359
+ context.cached.splice(cacheIndex - deleteCount + 1, deleteCount);
360
+ }
361
+ }
362
+ }
363
+ return deleteCount;
364
+ }
365
+ return 0;
366
+ };
367
+ let i = 0;
368
+ for (; i < children.length; i++) {
369
+ const child = children[i];
370
+ if (isParentCached || getCachedNode(child)) {
371
+ const result = analyzeNode(child);
372
+ if (result) {
373
+ nc += result[0];
374
+ ec += result[1];
375
+ currentChunk.push(child);
376
+ continue;
377
+ }
378
+ }
379
+ i -= stringifyCurrentChunk(i);
380
+ nc = 0;
381
+ ec = 0;
382
+ currentChunk.length = 0;
383
+ }
384
+ stringifyCurrentChunk(i);
385
+ };
386
+ const getCachedNode = (node) => {
387
+ if ((node.type === 1 && node.tagType === 0 || node.type === 12) && node.codegenNode && node.codegenNode.type === 20) return node.codegenNode;
388
+ };
389
+ const dataAriaRE = /^(?:data|aria)-/;
390
+ const isStringifiableAttr = (name, ns) => {
391
+ 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);
392
+ };
393
+ const isNonStringifiable = /* @__PURE__ */ (0, _vue_shared.makeMap)(`caption,thead,tr,th,tbody,td,tfoot,colgroup,col`);
394
+ /**
395
+ * for a cached node, analyze it and return:
396
+ * - false: bailed (contains non-stringifiable props or runtime constant)
397
+ * - [nc, ec] where
398
+ * - nc is the number of nodes inside
399
+ * - ec is the number of element with bindings inside
400
+ */
401
+ function analyzeNode(node) {
402
+ if (node.type === 1 && isNonStringifiable(node.tag)) return false;
403
+ if (node.type === 1 && (0, _vue_compiler_core.findDir)(node, "once", true)) return false;
404
+ if (node.type === 12) return [1, 0];
405
+ let nc = 1;
406
+ let ec = node.props.length > 0 ? 1 : 0;
407
+ let bailed = false;
408
+ const bail = () => {
409
+ bailed = true;
410
+ return false;
411
+ };
412
+ function walk(node) {
413
+ const isOptionTag = node.tag === "option" && node.ns === 0;
414
+ for (let i = 0; i < node.props.length; i++) {
415
+ const p = node.props[i];
416
+ if (p.type === 6 && !isStringifiableAttr(p.name, node.ns)) return bail();
417
+ if (p.type === 7 && p.name === "bind") {
418
+ if (p.arg && (p.arg.type === 8 || p.arg.isStatic && !isStringifiableAttr(p.arg.content, node.ns))) return bail();
419
+ if (p.exp && (p.exp.type === 8 || p.exp.constType < 3)) return bail();
420
+ if (isOptionTag && (0, _vue_compiler_core.isStaticArgOf)(p.arg, "value") && p.exp && !p.exp.isStatic) return bail();
421
+ }
422
+ }
423
+ for (let i = 0; i < node.children.length; i++) {
424
+ nc++;
425
+ const child = node.children[i];
426
+ if (child.type === 1) {
427
+ if (child.props.length > 0) ec++;
428
+ walk(child);
429
+ if (bailed) return false;
430
+ }
431
+ }
432
+ return true;
433
+ }
434
+ return walk(node) ? [nc, ec] : false;
435
+ }
436
+ function stringifyNode(node, context) {
437
+ if ((0, _vue_shared.isString)(node)) return node;
438
+ if ((0, _vue_shared.isSymbol)(node)) return ``;
439
+ switch (node.type) {
440
+ case 1: return stringifyElement(node, context);
441
+ case 2: return (0, _vue_shared.escapeHtml)(node.content);
442
+ case 3: return `<!--${(0, _vue_shared.escapeHtml)(node.content)}-->`;
443
+ case 5: return (0, _vue_shared.escapeHtml)((0, _vue_shared.toDisplayString)(evaluateConstant(node.content)));
444
+ case 8: return (0, _vue_shared.escapeHtml)(evaluateConstant(node));
445
+ case 12: return stringifyNode(node.content, context);
446
+ default: return "";
447
+ }
448
+ }
449
+ function stringifyElement(node, context) {
450
+ let res = `<${node.tag}`;
451
+ let innerHTML = "";
452
+ for (let i = 0; i < node.props.length; i++) {
453
+ const p = node.props[i];
454
+ if (p.type === 6) {
455
+ res += ` ${p.name}`;
456
+ if (p.value) res += `="${(0, _vue_shared.escapeHtml)(p.value.content)}"`;
457
+ } else if (p.type === 7) {
458
+ if (p.name === "bind") {
459
+ const exp = p.exp;
460
+ if (exp.content[0] === "_") {
461
+ res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`;
462
+ continue;
463
+ }
464
+ if ((0, _vue_shared.isBooleanAttr)(p.arg.content) && exp.content === "false") continue;
465
+ let evaluated = evaluateConstant(exp);
466
+ if (evaluated != null) {
467
+ const arg = p.arg && p.arg.content;
468
+ if (arg === "class") evaluated = (0, _vue_shared.normalizeClass)(evaluated);
469
+ else if (arg === "style") evaluated = (0, _vue_shared.stringifyStyle)((0, _vue_shared.normalizeStyle)(evaluated));
470
+ res += ` ${p.arg.content}="${(0, _vue_shared.escapeHtml)(evaluated)}"`;
471
+ }
472
+ } else if (p.name === "html") innerHTML = evaluateConstant(p.exp);
473
+ else if (p.name === "text") innerHTML = (0, _vue_shared.escapeHtml)((0, _vue_shared.toDisplayString)(evaluateConstant(p.exp)));
474
+ }
475
+ }
476
+ if (context.scopeId) res += ` ${context.scopeId}`;
477
+ res += `>`;
478
+ if (innerHTML) res += innerHTML;
479
+ else for (let i = 0; i < node.children.length; i++) res += stringifyNode(node.children[i], context);
480
+ if (!(0, _vue_shared.isVoidTag)(node.tag)) res += `</${node.tag}>`;
481
+ return res;
482
+ }
483
+ function evaluateConstant(exp) {
484
+ if (exp.type === 4) return new Function(`return (${exp.content})`)();
485
+ else {
486
+ let res = ``;
487
+ exp.children.forEach((c) => {
488
+ if ((0, _vue_shared.isString)(c) || (0, _vue_shared.isSymbol)(c)) return;
489
+ if (c.type === 2) res += c.content;
490
+ else if (c.type === 5) res += (0, _vue_shared.toDisplayString)(evaluateConstant(c.content));
491
+ else res += evaluateConstant(c);
492
+ });
493
+ return res;
494
+ }
495
+ }
496
+
497
+ //#endregion
498
+ //#region packages/compiler-dom/src/transforms/ignoreSideEffectTags.ts
499
+ const ignoreSideEffectTags = (node, context) => {
500
+ if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) {
501
+ context.onError(createDOMCompilerError(64, node.loc));
502
+ context.removeNode();
503
+ }
504
+ };
505
+
506
+ //#endregion
507
+ //#region packages/compiler-dom/src/htmlNesting.ts
508
+ /**
509
+ * Copied from https://github.com/MananTank/validate-html-nesting
510
+ * with ISC license
511
+ *
512
+ * To avoid runtime dependency on validate-html-nesting
513
+ * This file should not change very often in the original repo
514
+ * but we may need to keep it up-to-date from time to time.
515
+ */
516
+ /**
517
+ * returns true if given parent-child nesting is valid HTML
518
+ */
519
+ function isValidHTMLNesting(parent, child) {
520
+ if (parent === "template") return true;
521
+ if (parent in onlyValidChildren) return onlyValidChildren[parent].has(child);
522
+ if (child in onlyValidParents) return onlyValidParents[child].has(parent);
523
+ if (parent in knownInvalidChildren) {
524
+ if (knownInvalidChildren[parent].has(child)) return false;
525
+ }
526
+ if (child in knownInvalidParents) {
527
+ if (knownInvalidParents[child].has(parent)) return false;
528
+ }
529
+ return true;
530
+ }
531
+ const headings = new Set([
532
+ "h1",
533
+ "h2",
534
+ "h3",
535
+ "h4",
536
+ "h5",
537
+ "h6"
538
+ ]);
539
+ const emptySet = /* @__PURE__ */ new Set([]);
540
+ /**
541
+ * maps element to set of elements that can be it's children, no other */
542
+ const onlyValidChildren = {
543
+ head: new Set([
544
+ "base",
545
+ "basefront",
546
+ "bgsound",
547
+ "link",
548
+ "meta",
549
+ "title",
550
+ "noscript",
551
+ "noframes",
552
+ "style",
553
+ "script",
554
+ "template"
555
+ ]),
556
+ optgroup: new Set(["option"]),
557
+ select: new Set([
558
+ "optgroup",
559
+ "option",
560
+ "hr"
561
+ ]),
562
+ table: new Set([
563
+ "caption",
564
+ "colgroup",
565
+ "tbody",
566
+ "tfoot",
567
+ "thead"
568
+ ]),
569
+ tr: new Set(["td", "th"]),
570
+ colgroup: new Set(["col"]),
571
+ tbody: new Set(["tr"]),
572
+ thead: new Set(["tr"]),
573
+ tfoot: new Set(["tr"]),
574
+ script: emptySet,
575
+ iframe: emptySet,
576
+ option: emptySet,
577
+ textarea: emptySet,
578
+ style: emptySet,
579
+ title: emptySet
580
+ };
581
+ /** maps elements to set of elements which can be it's parent, no other */
582
+ const onlyValidParents = {
583
+ html: emptySet,
584
+ body: new Set(["html"]),
585
+ head: new Set(["html"]),
586
+ td: new Set(["tr"]),
587
+ colgroup: new Set(["table"]),
588
+ caption: new Set(["table"]),
589
+ tbody: new Set(["table"]),
590
+ tfoot: new Set(["table"]),
591
+ col: new Set(["colgroup"]),
592
+ th: new Set(["tr"]),
593
+ thead: new Set(["table"]),
594
+ tr: new Set([
595
+ "tbody",
596
+ "thead",
597
+ "tfoot"
598
+ ]),
599
+ dd: new Set(["dl", "div"]),
600
+ dt: new Set(["dl", "div"]),
601
+ figcaption: new Set(["figure"]),
602
+ summary: new Set(["details"]),
603
+ area: new Set(["map"])
604
+ };
605
+ /** maps element to set of elements that can not be it's children, others can */
606
+ const knownInvalidChildren = {
607
+ p: new Set([
608
+ "address",
609
+ "article",
610
+ "aside",
611
+ "blockquote",
612
+ "center",
613
+ "details",
614
+ "dialog",
615
+ "dir",
616
+ "div",
617
+ "dl",
618
+ "fieldset",
619
+ "figure",
620
+ "footer",
621
+ "form",
622
+ "h1",
623
+ "h2",
624
+ "h3",
625
+ "h4",
626
+ "h5",
627
+ "h6",
628
+ "header",
629
+ "hgroup",
630
+ "hr",
631
+ "li",
632
+ "main",
633
+ "nav",
634
+ "menu",
635
+ "ol",
636
+ "p",
637
+ "pre",
638
+ "section",
639
+ "table",
640
+ "ul"
641
+ ]),
642
+ svg: new Set([
643
+ "b",
644
+ "blockquote",
645
+ "br",
646
+ "code",
647
+ "dd",
648
+ "div",
649
+ "dl",
650
+ "dt",
651
+ "em",
652
+ "embed",
653
+ "h1",
654
+ "h2",
655
+ "h3",
656
+ "h4",
657
+ "h5",
658
+ "h6",
659
+ "hr",
660
+ "i",
661
+ "img",
662
+ "li",
663
+ "menu",
664
+ "meta",
665
+ "ol",
666
+ "p",
667
+ "pre",
668
+ "ruby",
669
+ "s",
670
+ "small",
671
+ "span",
672
+ "strong",
673
+ "sub",
674
+ "sup",
675
+ "table",
676
+ "u",
677
+ "ul",
678
+ "var"
679
+ ])
680
+ };
681
+ /** maps element to set of elements that can not be it's parent, others can */
682
+ const knownInvalidParents = {
683
+ a: new Set(["a"]),
684
+ button: new Set(["button"]),
685
+ dd: new Set(["dd", "dt"]),
686
+ dt: new Set(["dd", "dt"]),
687
+ form: new Set(["form"]),
688
+ li: new Set(["li"]),
689
+ h1: headings,
690
+ h2: headings,
691
+ h3: headings,
692
+ h4: headings,
693
+ h5: headings,
694
+ h6: headings
695
+ };
696
+
697
+ //#endregion
698
+ //#region packages/compiler-dom/src/transforms/validateHtmlNesting.ts
699
+ const validateHtmlNesting = (node, context) => {
700
+ if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) {
701
+ const error = /* @__PURE__ */ new SyntaxError(`<${node.tag}> cannot be child of <${context.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`);
702
+ error.loc = node.loc;
703
+ context.onWarn(error);
704
+ }
705
+ };
706
+
707
+ //#endregion
708
+ //#region packages/compiler-dom/src/index.ts
709
+ const DOMNodeTransforms = [transformStyle, ...[transformTransition, validateHtmlNesting]];
710
+ const DOMDirectiveTransforms = {
711
+ cloak: _vue_compiler_core.noopDirectiveTransform,
712
+ html: transformVHtml,
713
+ text: transformVText,
714
+ model: transformModel,
715
+ on: transformOn,
716
+ show: transformShow
717
+ };
718
+ function compile(src, options = {}) {
719
+ return (0, _vue_compiler_core.baseCompile)(src, (0, _vue_shared.extend)({}, parserOptions, options, {
720
+ nodeTransforms: [
721
+ ignoreSideEffectTags,
722
+ ...DOMNodeTransforms,
723
+ ...options.nodeTransforms || []
724
+ ],
725
+ directiveTransforms: (0, _vue_shared.extend)({}, DOMDirectiveTransforms, options.directiveTransforms || {}),
726
+ transformHoist: stringifyStatic
727
+ }));
728
+ }
729
+ function parse(template, options = {}) {
730
+ return (0, _vue_compiler_core.baseParse)(template, (0, _vue_shared.extend)({}, parserOptions, options));
731
+ }
732
+
733
+ //#endregion
734
+ exports.DOMDirectiveTransforms = DOMDirectiveTransforms;
735
+ exports.DOMErrorCodes = DOMErrorCodes;
736
+ exports.DOMErrorMessages = DOMErrorMessages;
737
+ exports.DOMNodeTransforms = DOMNodeTransforms;
738
+ exports.TRANSITION = TRANSITION;
739
+ exports.TRANSITION_GROUP = TRANSITION_GROUP;
740
+ exports.V_MODEL_CHECKBOX = V_MODEL_CHECKBOX;
741
+ exports.V_MODEL_DYNAMIC = V_MODEL_DYNAMIC;
742
+ exports.V_MODEL_RADIO = V_MODEL_RADIO;
743
+ exports.V_MODEL_SELECT = V_MODEL_SELECT;
744
+ exports.V_MODEL_TEXT = V_MODEL_TEXT;
745
+ exports.V_ON_WITH_KEYS = V_ON_WITH_KEYS;
746
+ exports.V_ON_WITH_MODIFIERS = V_ON_WITH_MODIFIERS;
747
+ exports.V_SHOW = V_SHOW;
748
+ exports.compile = compile;
749
+ exports.createDOMCompilerError = createDOMCompilerError;
750
+ exports.isKeyboardEvent = isKeyboardEvent;
751
+ exports.isValidHTMLNesting = isValidHTMLNesting;
752
+ exports.parse = parse;
753
+ exports.parserOptions = parserOptions;
754
+ exports.postTransformTransition = postTransformTransition;
755
+ exports.resolveModifiers = resolveModifiers;
756
+ exports.transformStyle = transformStyle;
757
+ Object.keys(_vue_compiler_core).forEach(function (k) {
758
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
759
+ enumerable: true,
760
+ get: function () { return _vue_compiler_core[k]; }
761
+ });
762
+ });