@builder.io/sdk-vue 0.5.9 → 0.6.1-0

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 (1095) hide show
  1. package/README.md +0 -4
  2. package/package.json +145 -22
  3. package/vue2/css/package.json +4 -0
  4. package/vue2/node_modules/@types/node/LICENSE +21 -0
  5. package/vue2/node_modules/@types/node/README.md +16 -0
  6. package/vue2/node_modules/@types/node/assert/strict.d.ts +8 -0
  7. package/vue2/node_modules/@types/node/assert.d.ts +962 -0
  8. package/vue2/node_modules/@types/node/async_hooks.d.ts +497 -0
  9. package/vue2/node_modules/@types/node/buffer.d.ts +2236 -0
  10. package/vue2/node_modules/@types/node/child_process.d.ts +1396 -0
  11. package/vue2/node_modules/@types/node/cluster.d.ts +414 -0
  12. package/vue2/node_modules/@types/node/console.d.ts +412 -0
  13. package/vue2/node_modules/@types/node/constants.d.ts +18 -0
  14. package/vue2/node_modules/@types/node/crypto.d.ts +3869 -0
  15. package/vue2/node_modules/@types/node/dgram.d.ts +545 -0
  16. package/vue2/node_modules/@types/node/diagnostics_channel.d.ts +191 -0
  17. package/vue2/node_modules/@types/node/dns/promises.d.ts +369 -0
  18. package/vue2/node_modules/@types/node/dns.d.ts +655 -0
  19. package/vue2/node_modules/@types/node/domain.d.ts +170 -0
  20. package/vue2/node_modules/@types/node/events.d.ts +641 -0
  21. package/vue2/node_modules/@types/node/fs/promises.d.ts +1094 -0
  22. package/vue2/node_modules/@types/node/fs.d.ts +3803 -0
  23. package/vue2/node_modules/@types/node/globals.d.ts +287 -0
  24. package/vue2/node_modules/@types/node/globals.global.d.ts +1 -0
  25. package/vue2/node_modules/@types/node/http.d.ts +1504 -0
  26. package/vue2/node_modules/@types/node/http2.d.ts +2100 -0
  27. package/vue2/node_modules/@types/node/https.d.ts +532 -0
  28. package/vue2/node_modules/@types/node/index.d.ts +131 -0
  29. package/vue2/node_modules/@types/node/inspector.d.ts +2745 -0
  30. package/vue2/node_modules/@types/node/module.d.ts +115 -0
  31. package/vue2/node_modules/@types/node/net.d.ts +828 -0
  32. package/vue2/node_modules/@types/node/os.d.ts +455 -0
  33. package/vue2/node_modules/@types/node/package.json +232 -0
  34. package/vue2/node_modules/@types/node/path.d.ts +191 -0
  35. package/vue2/node_modules/@types/node/perf_hooks.d.ts +586 -0
  36. package/vue2/node_modules/@types/node/process.d.ts +1481 -0
  37. package/vue2/node_modules/@types/node/punycode.d.ts +117 -0
  38. package/vue2/node_modules/@types/node/querystring.d.ts +131 -0
  39. package/vue2/node_modules/@types/node/readline.d.ts +543 -0
  40. package/vue2/node_modules/@types/node/repl.d.ts +424 -0
  41. package/vue2/node_modules/@types/node/stream/consumers.d.ts +12 -0
  42. package/vue2/node_modules/@types/node/stream/promises.d.ts +42 -0
  43. package/vue2/node_modules/@types/node/stream/web.d.ts +392 -0
  44. package/vue2/node_modules/@types/node/stream.d.ts +1363 -0
  45. package/vue2/node_modules/@types/node/string_decoder.d.ts +67 -0
  46. package/vue2/node_modules/@types/node/test.d.ts +190 -0
  47. package/vue2/node_modules/@types/node/timers/promises.d.ts +93 -0
  48. package/vue2/node_modules/@types/node/timers.d.ts +94 -0
  49. package/vue2/node_modules/@types/node/tls.d.ts +1019 -0
  50. package/vue2/node_modules/@types/node/trace_events.d.ts +161 -0
  51. package/vue2/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
  52. package/vue2/node_modules/@types/node/ts4.8/assert.d.ts +962 -0
  53. package/vue2/node_modules/@types/node/ts4.8/async_hooks.d.ts +497 -0
  54. package/vue2/node_modules/@types/node/ts4.8/buffer.d.ts +2236 -0
  55. package/vue2/node_modules/@types/node/ts4.8/child_process.d.ts +1396 -0
  56. package/vue2/node_modules/@types/node/ts4.8/cluster.d.ts +414 -0
  57. package/vue2/node_modules/@types/node/ts4.8/console.d.ts +412 -0
  58. package/vue2/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
  59. package/vue2/node_modules/@types/node/ts4.8/crypto.d.ts +3866 -0
  60. package/vue2/node_modules/@types/node/ts4.8/dgram.d.ts +545 -0
  61. package/vue2/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +191 -0
  62. package/vue2/node_modules/@types/node/ts4.8/dns/promises.d.ts +368 -0
  63. package/vue2/node_modules/@types/node/ts4.8/dns.d.ts +654 -0
  64. package/vue2/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
  65. package/vue2/node_modules/@types/node/ts4.8/events.d.ts +641 -0
  66. package/vue2/node_modules/@types/node/ts4.8/fs/promises.d.ts +1094 -0
  67. package/vue2/node_modules/@types/node/ts4.8/fs.d.ts +3802 -0
  68. package/vue2/node_modules/@types/node/ts4.8/globals.d.ts +284 -0
  69. package/vue2/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
  70. package/vue2/node_modules/@types/node/ts4.8/http.d.ts +1503 -0
  71. package/vue2/node_modules/@types/node/ts4.8/http2.d.ts +2100 -0
  72. package/vue2/node_modules/@types/node/ts4.8/https.d.ts +532 -0
  73. package/vue2/node_modules/@types/node/ts4.8/index.d.ts +86 -0
  74. package/vue2/node_modules/@types/node/ts4.8/inspector.d.ts +2745 -0
  75. package/vue2/node_modules/@types/node/ts4.8/module.d.ts +115 -0
  76. package/vue2/node_modules/@types/node/ts4.8/net.d.ts +828 -0
  77. package/vue2/node_modules/@types/node/ts4.8/os.d.ts +456 -0
  78. package/vue2/node_modules/@types/node/ts4.8/path.d.ts +191 -0
  79. package/vue2/node_modules/@types/node/ts4.8/perf_hooks.d.ts +586 -0
  80. package/vue2/node_modules/@types/node/ts4.8/process.d.ts +1481 -0
  81. package/vue2/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
  82. package/vue2/node_modules/@types/node/ts4.8/querystring.d.ts +131 -0
  83. package/vue2/node_modules/@types/node/ts4.8/readline.d.ts +543 -0
  84. package/vue2/node_modules/@types/node/ts4.8/repl.d.ts +424 -0
  85. package/vue2/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
  86. package/vue2/node_modules/@types/node/ts4.8/stream/promises.d.ts +42 -0
  87. package/vue2/node_modules/@types/node/ts4.8/stream/web.d.ts +392 -0
  88. package/vue2/node_modules/@types/node/ts4.8/stream.d.ts +1363 -0
  89. package/vue2/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
  90. package/vue2/node_modules/@types/node/ts4.8/test.d.ts +190 -0
  91. package/vue2/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
  92. package/vue2/node_modules/@types/node/ts4.8/timers.d.ts +94 -0
  93. package/vue2/node_modules/@types/node/ts4.8/tls.d.ts +1019 -0
  94. package/vue2/node_modules/@types/node/ts4.8/trace_events.d.ts +161 -0
  95. package/vue2/node_modules/@types/node/ts4.8/tty.d.ts +204 -0
  96. package/vue2/node_modules/@types/node/ts4.8/url.d.ts +855 -0
  97. package/vue2/node_modules/@types/node/ts4.8/util.d.ts +1594 -0
  98. package/vue2/node_modules/@types/node/ts4.8/v8.d.ts +472 -0
  99. package/vue2/node_modules/@types/node/ts4.8/vm.d.ts +507 -0
  100. package/vue2/node_modules/@types/node/ts4.8/wasi.d.ts +158 -0
  101. package/vue2/node_modules/@types/node/ts4.8/worker_threads.d.ts +649 -0
  102. package/vue2/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
  103. package/vue2/node_modules/@types/node/tty.d.ts +204 -0
  104. package/vue2/node_modules/@types/node/url.d.ts +855 -0
  105. package/vue2/node_modules/@types/node/util.d.ts +1594 -0
  106. package/vue2/node_modules/@types/node/v8.d.ts +472 -0
  107. package/vue2/node_modules/@types/node/vm.d.ts +507 -0
  108. package/vue2/node_modules/@types/node/wasi.d.ts +158 -0
  109. package/vue2/node_modules/@types/node/worker_threads.d.ts +649 -0
  110. package/vue2/node_modules/@types/node/zlib.d.ts +517 -0
  111. package/vue2/node_modules/@vitejs/plugin-vue2/LICENSE +21 -0
  112. package/vue2/node_modules/@vitejs/plugin-vue2/README.md +115 -0
  113. package/vue2/node_modules/@vitejs/plugin-vue2/package.json +65 -0
  114. package/vue2/node_modules/@vue/compiler-sfc/LICENSE +21 -0
  115. package/vue2/node_modules/@vue/compiler-sfc/package.json +34 -0
  116. package/vue2/node_modules/@vue/tsconfig/README.md +31 -0
  117. package/vue2/node_modules/@vue/tsconfig/package.json +35 -0
  118. package/vue2/node_modules/@vue/tsconfig/tsconfig.json +40 -0
  119. package/vue2/node_modules/@vue/tsconfig/tsconfig.node.json +17 -0
  120. package/vue2/node_modules/@vue/tsconfig/tsconfig.web.json +19 -0
  121. package/vue2/node_modules/rollup/LICENSE.md +695 -0
  122. package/vue2/node_modules/rollup/README.md +125 -0
  123. package/vue2/node_modules/rollup/package.json +178 -0
  124. package/vue2/node_modules/vite/LICENSE.md +3396 -0
  125. package/vue2/node_modules/vite/README.md +20 -0
  126. package/vue2/node_modules/vite/bin/openChrome.applescript +95 -0
  127. package/vue2/node_modules/vite/bin/vite.js +61 -0
  128. package/vue2/node_modules/vite/client.d.ts +281 -0
  129. package/vue2/node_modules/vite/index.cjs +34 -0
  130. package/vue2/node_modules/vite/package.json +170 -0
  131. package/vue2/node_modules/vite-plugin-dts/LICENSE +21 -0
  132. package/vue2/node_modules/vite-plugin-dts/README.md +368 -0
  133. package/vue2/node_modules/vite-plugin-dts/README.zh-CN.md +368 -0
  134. package/vue2/node_modules/vite-plugin-dts/node_modules/vue-tsc/LICENSE +21 -0
  135. package/vue2/node_modules/vite-plugin-dts/node_modules/vue-tsc/README.md +36 -0
  136. package/vue2/node_modules/vite-plugin-dts/node_modules/vue-tsc/bin/vue-tsc.js +67 -0
  137. package/vue2/node_modules/vite-plugin-dts/node_modules/vue-tsc/out/index.d.ts +16 -0
  138. package/vue2/node_modules/vite-plugin-dts/node_modules/vue-tsc/out/index.js +120 -0
  139. package/vue2/node_modules/vite-plugin-dts/node_modules/vue-tsc/out/shared.d.ts +8 -0
  140. package/vue2/node_modules/vite-plugin-dts/node_modules/vue-tsc/out/shared.js +5 -0
  141. package/vue2/node_modules/vite-plugin-dts/node_modules/vue-tsc/package.json +28 -0
  142. package/vue2/node_modules/vite-plugin-dts/package.json +103 -0
  143. package/vue2/node_modules/vue/LICENSE +21 -0
  144. package/vue2/node_modules/vue/README.md +118 -0
  145. package/vue2/node_modules/vue/compiler-sfc/index.d.ts +1 -0
  146. package/vue2/node_modules/vue/compiler-sfc/index.js +1 -0
  147. package/vue2/node_modules/vue/compiler-sfc/index.mjs +1 -0
  148. package/vue2/node_modules/vue/compiler-sfc/package.json +5 -0
  149. package/vue2/node_modules/vue/package.json +132 -0
  150. package/vue2/node_modules/vue/packages/compiler-sfc/api-extractor.json +64 -0
  151. package/vue2/node_modules/vue/packages/compiler-sfc/node_modules/.bin/lessc +17 -0
  152. package/vue2/node_modules/vue/packages/compiler-sfc/node_modules/.bin/parser +17 -0
  153. package/vue2/node_modules/vue/packages/compiler-sfc/node_modules/.bin/sass +17 -0
  154. package/vue2/node_modules/vue/packages/compiler-sfc/node_modules/.bin/stylus +17 -0
  155. package/vue2/node_modules/vue/packages/compiler-sfc/package.json +34 -0
  156. package/vue2/node_modules/vue/packages/compiler-sfc/src/babelUtils.ts +423 -0
  157. package/vue2/node_modules/vue/packages/compiler-sfc/src/compileScript.ts +1911 -0
  158. package/vue2/node_modules/vue/packages/compiler-sfc/src/compileStyle.ts +147 -0
  159. package/vue2/node_modules/vue/packages/compiler-sfc/src/compileTemplate.ts +205 -0
  160. package/vue2/node_modules/vue/packages/compiler-sfc/src/cssVars.ts +179 -0
  161. package/vue2/node_modules/vue/packages/compiler-sfc/src/index.ts +31 -0
  162. package/vue2/node_modules/vue/packages/compiler-sfc/src/parse.ts +129 -0
  163. package/vue2/node_modules/vue/packages/compiler-sfc/src/parseComponent.ts +220 -0
  164. package/vue2/node_modules/vue/packages/compiler-sfc/src/prefixIdentifiers.ts +82 -0
  165. package/vue2/node_modules/vue/packages/compiler-sfc/src/rewriteDefault.ts +115 -0
  166. package/vue2/node_modules/vue/packages/compiler-sfc/src/stylePlugins/scoped.ts +203 -0
  167. package/vue2/node_modules/vue/packages/compiler-sfc/src/stylePlugins/trim.ts +18 -0
  168. package/vue2/node_modules/vue/packages/compiler-sfc/src/stylePreprocessors.ts +135 -0
  169. package/vue2/node_modules/vue/packages/compiler-sfc/src/templateCompilerModules/assetUrl.ts +84 -0
  170. package/vue2/node_modules/vue/packages/compiler-sfc/src/templateCompilerModules/srcset.ts +76 -0
  171. package/vue2/node_modules/vue/packages/compiler-sfc/src/templateCompilerModules/utils.ts +86 -0
  172. package/vue2/node_modules/vue/packages/compiler-sfc/src/types.ts +69 -0
  173. package/vue2/node_modules/vue/packages/compiler-sfc/src/warn.ts +16 -0
  174. package/vue2/node_modules/vue/packages/compiler-sfc/test/__snapshots__/compileScript.spec.ts.snap +925 -0
  175. package/vue2/node_modules/vue/packages/compiler-sfc/test/__snapshots__/cssVars.spec.ts.snap +189 -0
  176. package/vue2/node_modules/vue/packages/compiler-sfc/test/compileScript.spec.ts +1594 -0
  177. package/vue2/node_modules/vue/packages/compiler-sfc/test/compileStyle.spec.ts +203 -0
  178. package/vue2/node_modules/vue/packages/compiler-sfc/test/compileTemplate.spec.ts +258 -0
  179. package/vue2/node_modules/vue/packages/compiler-sfc/test/cssVars.spec.ts +247 -0
  180. package/vue2/node_modules/vue/packages/compiler-sfc/test/parseComponent.spec.ts +269 -0
  181. package/vue2/node_modules/vue/packages/compiler-sfc/test/prefixIdentifiers.spec.ts +97 -0
  182. package/vue2/node_modules/vue/packages/compiler-sfc/test/rewriteDefault.spec.ts +245 -0
  183. package/vue2/node_modules/vue/packages/compiler-sfc/test/stylePluginScoped.spec.ts +137 -0
  184. package/vue2/node_modules/vue/packages/compiler-sfc/test/tsconfig.json +7 -0
  185. package/vue2/node_modules/vue/packages/compiler-sfc/test/util.ts +35 -0
  186. package/vue2/node_modules/vue/src/compiler/codeframe.ts +52 -0
  187. package/vue2/node_modules/vue/src/compiler/codegen/events.ts +170 -0
  188. package/vue2/node_modules/vue/src/compiler/codegen/index.ts +668 -0
  189. package/vue2/node_modules/vue/src/compiler/create-compiler.ts +83 -0
  190. package/vue2/node_modules/vue/src/compiler/directives/bind.ts +9 -0
  191. package/vue2/node_modules/vue/src/compiler/directives/index.ts +9 -0
  192. package/vue2/node_modules/vue/src/compiler/directives/model.ts +145 -0
  193. package/vue2/node_modules/vue/src/compiler/directives/on.ts +9 -0
  194. package/vue2/node_modules/vue/src/compiler/error-detector.ts +158 -0
  195. package/vue2/node_modules/vue/src/compiler/helpers.ts +243 -0
  196. package/vue2/node_modules/vue/src/compiler/index.ts +24 -0
  197. package/vue2/node_modules/vue/src/compiler/optimizer.ts +135 -0
  198. package/vue2/node_modules/vue/src/compiler/parser/entity-decoder.ts +9 -0
  199. package/vue2/node_modules/vue/src/compiler/parser/filter-parser.ts +116 -0
  200. package/vue2/node_modules/vue/src/compiler/parser/html-parser.ts +341 -0
  201. package/vue2/node_modules/vue/src/compiler/parser/index.ts +999 -0
  202. package/vue2/node_modules/vue/src/compiler/parser/text-parser.ts +52 -0
  203. package/vue2/node_modules/vue/src/compiler/to-function.ts +119 -0
  204. package/vue2/node_modules/vue/src/core/components/index.ts +5 -0
  205. package/vue2/node_modules/vue/src/core/components/keep-alive.ts +165 -0
  206. package/vue2/node_modules/vue/src/core/config.ts +128 -0
  207. package/vue2/node_modules/vue/src/core/global-api/assets.ts +35 -0
  208. package/vue2/node_modules/vue/src/core/global-api/extend.ts +94 -0
  209. package/vue2/node_modules/vue/src/core/global-api/index.ts +68 -0
  210. package/vue2/node_modules/vue/src/core/global-api/mixin.ts +9 -0
  211. package/vue2/node_modules/vue/src/core/global-api/use.ts +23 -0
  212. package/vue2/node_modules/vue/src/core/index.ts +27 -0
  213. package/vue2/node_modules/vue/src/core/instance/events.ts +160 -0
  214. package/vue2/node_modules/vue/src/core/instance/index.ts +27 -0
  215. package/vue2/node_modules/vue/src/core/instance/init.ts +140 -0
  216. package/vue2/node_modules/vue/src/core/instance/inject.ts +80 -0
  217. package/vue2/node_modules/vue/src/core/instance/lifecycle.ts +415 -0
  218. package/vue2/node_modules/vue/src/core/instance/proxy.ts +97 -0
  219. package/vue2/node_modules/vue/src/core/instance/render-helpers/bind-dynamic-keys.ts +36 -0
  220. package/vue2/node_modules/vue/src/core/instance/render-helpers/bind-object-listeners.ts +18 -0
  221. package/vue2/node_modules/vue/src/core/instance/render-helpers/bind-object-props.ts +59 -0
  222. package/vue2/node_modules/vue/src/core/instance/render-helpers/check-keycodes.ts +33 -0
  223. package/vue2/node_modules/vue/src/core/instance/render-helpers/index.ts +31 -0
  224. package/vue2/node_modules/vue/src/core/instance/render-helpers/render-list.ts +49 -0
  225. package/vue2/node_modules/vue/src/core/instance/render-helpers/render-slot.ts +39 -0
  226. package/vue2/node_modules/vue/src/core/instance/render-helpers/render-static.ts +57 -0
  227. package/vue2/node_modules/vue/src/core/instance/render-helpers/resolve-filter.ts +8 -0
  228. package/vue2/node_modules/vue/src/core/instance/render-helpers/resolve-scoped-slots.ts +30 -0
  229. package/vue2/node_modules/vue/src/core/instance/render-helpers/resolve-slots.ts +51 -0
  230. package/vue2/node_modules/vue/src/core/instance/render.ts +173 -0
  231. package/vue2/node_modules/vue/src/core/instance/state.ts +387 -0
  232. package/vue2/node_modules/vue/src/core/observer/array.ts +54 -0
  233. package/vue2/node_modules/vue/src/core/observer/dep.ts +108 -0
  234. package/vue2/node_modules/vue/src/core/observer/index.ts +338 -0
  235. package/vue2/node_modules/vue/src/core/observer/scheduler.ts +199 -0
  236. package/vue2/node_modules/vue/src/core/observer/traverse.ts +47 -0
  237. package/vue2/node_modules/vue/src/core/observer/watcher.ts +278 -0
  238. package/vue2/node_modules/vue/src/core/util/debug.ts +105 -0
  239. package/vue2/node_modules/vue/src/core/util/env.ts +93 -0
  240. package/vue2/node_modules/vue/src/core/util/error.ts +81 -0
  241. package/vue2/node_modules/vue/src/core/util/index.ts +9 -0
  242. package/vue2/node_modules/vue/src/core/util/lang.ts +45 -0
  243. package/vue2/node_modules/vue/src/core/util/next-tick.ts +117 -0
  244. package/vue2/node_modules/vue/src/core/util/options.ts +489 -0
  245. package/vue2/node_modules/vue/src/core/util/perf.ts +28 -0
  246. package/vue2/node_modules/vue/src/core/util/props.ts +254 -0
  247. package/vue2/node_modules/vue/src/core/vdom/create-component.ts +275 -0
  248. package/vue2/node_modules/vue/src/core/vdom/create-element.ts +172 -0
  249. package/vue2/node_modules/vue/src/core/vdom/create-functional-component.ts +180 -0
  250. package/vue2/node_modules/vue/src/core/vdom/helpers/extract-props.ts +75 -0
  251. package/vue2/node_modules/vue/src/core/vdom/helpers/get-first-component-child.ts +16 -0
  252. package/vue2/node_modules/vue/src/core/vdom/helpers/index.ts +7 -0
  253. package/vue2/node_modules/vue/src/core/vdom/helpers/is-async-placeholder.ts +6 -0
  254. package/vue2/node_modules/vue/src/core/vdom/helpers/merge-hook.ts +40 -0
  255. package/vue2/node_modules/vue/src/core/vdom/helpers/normalize-children.ts +99 -0
  256. package/vue2/node_modules/vue/src/core/vdom/helpers/normalize-scoped-slots.ts +97 -0
  257. package/vue2/node_modules/vue/src/core/vdom/helpers/resolve-async-component.ts +157 -0
  258. package/vue2/node_modules/vue/src/core/vdom/helpers/update-listeners.ts +101 -0
  259. package/vue2/node_modules/vue/src/core/vdom/modules/directives.ts +137 -0
  260. package/vue2/node_modules/vue/src/core/vdom/modules/index.ts +4 -0
  261. package/vue2/node_modules/vue/src/core/vdom/modules/template-ref.ts +94 -0
  262. package/vue2/node_modules/vue/src/core/vdom/patch.ts +904 -0
  263. package/vue2/node_modules/vue/src/core/vdom/vnode.ts +119 -0
  264. package/vue2/node_modules/vue/src/global.d.ts +17 -0
  265. package/vue2/node_modules/vue/src/platforms/web/compiler/directives/html.ts +8 -0
  266. package/vue2/node_modules/vue/src/platforms/web/compiler/directives/index.ts +9 -0
  267. package/vue2/node_modules/vue/src/platforms/web/compiler/directives/model.ts +181 -0
  268. package/vue2/node_modules/vue/src/platforms/web/compiler/directives/text.ts +8 -0
  269. package/vue2/node_modules/vue/src/platforms/web/compiler/index.ts +6 -0
  270. package/vue2/node_modules/vue/src/platforms/web/compiler/modules/class.ts +44 -0
  271. package/vue2/node_modules/vue/src/platforms/web/compiler/modules/index.ts +5 -0
  272. package/vue2/node_modules/vue/src/platforms/web/compiler/modules/model.ts +89 -0
  273. package/vue2/node_modules/vue/src/platforms/web/compiler/modules/style.ts +47 -0
  274. package/vue2/node_modules/vue/src/platforms/web/compiler/options.ts +25 -0
  275. package/vue2/node_modules/vue/src/platforms/web/compiler/util.ts +22 -0
  276. package/vue2/node_modules/vue/src/platforms/web/entry-compiler.ts +4 -0
  277. package/vue2/node_modules/vue/src/platforms/web/entry-runtime-esm.ts +5 -0
  278. package/vue2/node_modules/vue/src/platforms/web/entry-runtime-with-compiler-esm.ts +5 -0
  279. package/vue2/node_modules/vue/src/platforms/web/entry-runtime-with-compiler.ts +10 -0
  280. package/vue2/node_modules/vue/src/platforms/web/entry-runtime.ts +7 -0
  281. package/vue2/node_modules/vue/src/platforms/web/runtime/class-util.ts +61 -0
  282. package/vue2/node_modules/vue/src/platforms/web/runtime/components/index.ts +7 -0
  283. package/vue2/node_modules/vue/src/platforms/web/runtime/components/transition-group.ts +204 -0
  284. package/vue2/node_modules/vue/src/platforms/web/runtime/components/transition.ts +205 -0
  285. package/vue2/node_modules/vue/src/platforms/web/runtime/directives/index.ts +7 -0
  286. package/vue2/node_modules/vue/src/platforms/web/runtime/directives/model.ts +148 -0
  287. package/vue2/node_modules/vue/src/platforms/web/runtime/directives/show.ts +61 -0
  288. package/vue2/node_modules/vue/src/platforms/web/runtime/index.ts +75 -0
  289. package/vue2/node_modules/vue/src/platforms/web/runtime/modules/attrs.ts +115 -0
  290. package/vue2/node_modules/vue/src/platforms/web/runtime/modules/class.ts +37 -0
  291. package/vue2/node_modules/vue/src/platforms/web/runtime/modules/dom-props.ts +123 -0
  292. package/vue2/node_modules/vue/src/platforms/web/runtime/modules/events.ts +127 -0
  293. package/vue2/node_modules/vue/src/platforms/web/runtime/modules/index.ts +8 -0
  294. package/vue2/node_modules/vue/src/platforms/web/runtime/modules/style.ts +104 -0
  295. package/vue2/node_modules/vue/src/platforms/web/runtime/modules/transition.ts +341 -0
  296. package/vue2/node_modules/vue/src/platforms/web/runtime/node-ops.ts +66 -0
  297. package/vue2/node_modules/vue/src/platforms/web/runtime/patch.ts +10 -0
  298. package/vue2/node_modules/vue/src/platforms/web/runtime/transition-util.ts +215 -0
  299. package/vue2/node_modules/vue/src/platforms/web/runtime-with-compiler.ts +110 -0
  300. package/vue2/node_modules/vue/src/platforms/web/util/attrs.ts +58 -0
  301. package/vue2/node_modules/vue/src/platforms/web/util/class.ts +87 -0
  302. package/vue2/node_modules/vue/src/platforms/web/util/compat.ts +16 -0
  303. package/vue2/node_modules/vue/src/platforms/web/util/element.ts +76 -0
  304. package/vue2/node_modules/vue/src/platforms/web/util/index.ts +21 -0
  305. package/vue2/node_modules/vue/src/platforms/web/util/style.ts +71 -0
  306. package/vue2/node_modules/vue/src/shared/constants.ts +20 -0
  307. package/vue2/node_modules/vue/src/shared/util.ts +372 -0
  308. package/vue2/node_modules/vue/src/v3/apiAsyncComponent.ts +117 -0
  309. package/vue2/node_modules/vue/src/v3/apiInject.ts +71 -0
  310. package/vue2/node_modules/vue/src/v3/apiLifecycle.ts +68 -0
  311. package/vue2/node_modules/vue/src/v3/apiSetup.ts +246 -0
  312. package/vue2/node_modules/vue/src/v3/apiWatch.ts +349 -0
  313. package/vue2/node_modules/vue/src/v3/currentInstance.ts +23 -0
  314. package/vue2/node_modules/vue/src/v3/debug.ts +21 -0
  315. package/vue2/node_modules/vue/src/v3/h.ts +18 -0
  316. package/vue2/node_modules/vue/src/v3/index.ts +96 -0
  317. package/vue2/node_modules/vue/src/v3/reactivity/computed.ts +100 -0
  318. package/vue2/node_modules/vue/src/v3/reactivity/effect.ts +20 -0
  319. package/vue2/node_modules/vue/src/v3/reactivity/effectScope.ts +137 -0
  320. package/vue2/node_modules/vue/src/v3/reactivity/operations.ts +14 -0
  321. package/vue2/node_modules/vue/src/v3/reactivity/reactive.ts +137 -0
  322. package/vue2/node_modules/vue/src/v3/reactivity/readonly.ts +127 -0
  323. package/vue2/node_modules/vue/src/v3/reactivity/ref.ts +296 -0
  324. package/vue2/node_modules/vue/src/v3/sfc-helpers/useCssModule.ts +24 -0
  325. package/vue2/node_modules/vue/src/v3/sfc-helpers/useCssVars.ts +34 -0
  326. package/vue2/package.json +49 -0
  327. package/vue2/src/blocks/BaseText.vue +25 -0
  328. package/vue2/src/blocks/button/button.vue +68 -0
  329. package/vue2/src/blocks/button/component-info.ts +35 -0
  330. package/vue2/src/blocks/columns/columns.vue +238 -0
  331. package/vue2/src/blocks/columns/component-info.ts +219 -0
  332. package/vue2/src/blocks/custom-code/component-info.ts +24 -0
  333. package/vue2/src/blocks/custom-code/custom-code.vue +88 -0
  334. package/vue2/src/blocks/embed/component-info.ts +38 -0
  335. package/vue2/src/blocks/embed/embed.vue +71 -0
  336. package/vue2/src/blocks/embed/helpers.ts +2 -0
  337. package/vue2/src/blocks/form/component-info.ts +233 -0
  338. package/vue2/src/blocks/form/form.vue +7 -0
  339. package/vue2/src/blocks/fragment/component-info.ts +8 -0
  340. package/vue2/src/blocks/fragment/fragment.vue +19 -0
  341. package/vue2/src/blocks/helpers.ts +43 -0
  342. package/vue2/src/blocks/image/component-info.ts +124 -0
  343. package/vue2/src/blocks/image/image.helpers.ts +47 -0
  344. package/vue2/src/blocks/image/image.vue +174 -0
  345. package/vue2/src/blocks/img/component-info.ts +16 -0
  346. package/vue2/src/blocks/img/img.vue +59 -0
  347. package/vue2/src/blocks/input/component-info.ts +47 -0
  348. package/vue2/src/blocks/input/input.vue +52 -0
  349. package/vue2/src/blocks/raw-text/component-info.ts +11 -0
  350. package/vue2/src/blocks/raw-text/raw-text.vue +35 -0
  351. package/vue2/src/blocks/section/component-info.ts +41 -0
  352. package/vue2/src/blocks/section/section.vue +47 -0
  353. package/vue2/src/blocks/select/component-info.ts +44 -0
  354. package/vue2/src/blocks/select/select.vue +50 -0
  355. package/vue2/src/blocks/submit-button/component-info.ts +27 -0
  356. package/vue2/src/blocks/submit-button/submit-button.vue +34 -0
  357. package/vue2/src/blocks/symbol/component-info.ts +35 -0
  358. package/vue2/src/blocks/symbol/symbol.helpers.ts +47 -0
  359. package/vue2/src/blocks/symbol/symbol.vue +143 -0
  360. package/vue2/src/blocks/text/component-info.ts +20 -0
  361. package/vue2/src/blocks/text/text.vue +23 -0
  362. package/vue2/src/blocks/textarea/component-info.ts +38 -0
  363. package/vue2/src/blocks/textarea/textarea.vue +38 -0
  364. package/vue2/src/blocks/video/component-info.ts +83 -0
  365. package/vue2/src/blocks/video/video.vue +105 -0
  366. package/vue2/src/components/block/block.helpers.ts +89 -0
  367. package/vue2/src/components/block/block.vue +203 -0
  368. package/vue2/src/components/block/components/block-styles.vue +110 -0
  369. package/vue2/src/components/block/components/block-wrapper.vue +83 -0
  370. package/vue2/src/components/block/components/component-ref/component-ref.helpers.ts +52 -0
  371. package/vue2/src/components/block/components/component-ref/component-ref.vue +97 -0
  372. package/vue2/src/components/block/components/interactive-element.vue +48 -0
  373. package/vue2/src/components/block/components/repeated-block.vue +51 -0
  374. package/vue2/src/components/block/types.ts +6 -0
  375. package/vue2/src/components/blocks/blocks-wrapper.vue +91 -0
  376. package/vue2/src/components/blocks/blocks.vue +99 -0
  377. package/vue2/src/components/content/components/enable-editor.vue +418 -0
  378. package/vue2/src/components/content/components/styles.helpers.ts +77 -0
  379. package/vue2/src/components/content/components/styles.vue +60 -0
  380. package/vue2/src/components/content/content.helpers.ts +42 -0
  381. package/vue2/src/components/content/content.types.ts +23 -0
  382. package/vue2/src/components/content/content.vue +205 -0
  383. package/vue2/src/components/content/index.ts +1 -0
  384. package/vue2/src/components/content/wrap-component-ref.ts +6 -0
  385. package/vue2/src/components/content-variants/content-variants.types.ts +20 -0
  386. package/vue2/src/components/content-variants/content-variants.vue +177 -0
  387. package/vue2/src/components/content-variants/helpers.ts +207 -0
  388. package/vue2/src/components/inlined-script.vue +18 -0
  389. package/vue2/src/components/inlined-styles.vue +18 -0
  390. package/vue2/src/constants/builder-registered-components.ts +62 -0
  391. package/vue2/src/constants/device-sizes.ts +59 -0
  392. package/vue2/src/constants/sdk-version.ts +1 -0
  393. package/vue2/src/constants/target.ts +4 -0
  394. package/vue2/src/context/builder.context.ts +16 -0
  395. package/vue2/src/context/components.context.ts +6 -0
  396. package/vue2/src/context/types.ts +36 -0
  397. package/vue2/src/functions/apply-patch-with-mutation.ts +61 -0
  398. package/vue2/src/functions/camel-to-kebab-case.ts +1 -0
  399. package/vue2/src/functions/deopt.ts +6 -0
  400. package/vue2/src/functions/evaluate/browser-runtime/browser.ts +41 -0
  401. package/vue2/src/functions/evaluate/browser-runtime/index.ts +1 -0
  402. package/vue2/src/functions/evaluate/edge-runtime/acorn-interpreter.ts +2891 -0
  403. package/vue2/src/functions/evaluate/edge-runtime/edge-runtime.ts +96 -0
  404. package/vue2/src/functions/evaluate/edge-runtime/index.ts +1 -0
  405. package/vue2/src/functions/evaluate/evaluate.ts +66 -0
  406. package/vue2/src/functions/evaluate/helpers.ts +32 -0
  407. package/vue2/src/functions/evaluate/index.ts +1 -0
  408. package/vue2/src/functions/evaluate/node-runtime/index.ts +1 -0
  409. package/vue2/src/functions/evaluate/placeholder-runtime.ts +4 -0
  410. package/vue2/src/functions/event-handler-name.ts +1 -0
  411. package/vue2/src/functions/extract-text-styles.ts +24 -0
  412. package/vue2/src/functions/fast-clone.ts +4 -0
  413. package/vue2/src/functions/fetch-builder-props.ts +62 -0
  414. package/vue2/src/functions/get-block-actions-handler.ts +16 -0
  415. package/vue2/src/functions/get-block-actions.ts +36 -0
  416. package/vue2/src/functions/get-block-component-options.ts +11 -0
  417. package/vue2/src/functions/get-block-properties.ts +82 -0
  418. package/vue2/src/functions/get-builder-search-params/index.ts +40 -0
  419. package/vue2/src/functions/get-content/generate-content-url.ts +45 -0
  420. package/vue2/src/functions/get-content/index.ts +110 -0
  421. package/vue2/src/functions/get-content/types.ts +62 -0
  422. package/vue2/src/functions/get-fetch.ts +11 -0
  423. package/vue2/src/functions/get-global-this.ts +16 -0
  424. package/vue2/src/functions/get-processed-block.ts +69 -0
  425. package/vue2/src/functions/get-react-native-block-styles.ts +27 -0
  426. package/vue2/src/functions/is-browser.ts +3 -0
  427. package/vue2/src/functions/is-edge-runtime.ts +9 -0
  428. package/vue2/src/functions/is-editing.ts +5 -0
  429. package/vue2/src/functions/is-iframe.ts +4 -0
  430. package/vue2/src/functions/is-previewing.ts +11 -0
  431. package/vue2/src/functions/on-change.ts +29 -0
  432. package/vue2/src/functions/register-component.ts +48 -0
  433. package/vue2/src/functions/register.ts +44 -0
  434. package/vue2/src/functions/sanitize-react-native-block-styles.ts +58 -0
  435. package/vue2/src/functions/set-editor-settings.ts +15 -0
  436. package/vue2/src/functions/set.ts +14 -0
  437. package/vue2/src/functions/track/helpers.ts +51 -0
  438. package/vue2/src/functions/track/index.ts +131 -0
  439. package/vue2/src/functions/track/interaction.ts +63 -0
  440. package/vue2/src/functions/transform-block-properties.ts +18 -0
  441. package/vue2/src/functions/transform-block.ts +6 -0
  442. package/vue2/src/helpers/ab-tests.ts +166 -0
  443. package/vue2/src/helpers/canTrack.ts +2 -0
  444. package/vue2/src/helpers/cookie.ts +81 -0
  445. package/vue2/src/helpers/css.ts +33 -0
  446. package/vue2/src/helpers/flatten.ts +19 -0
  447. package/vue2/src/helpers/localStorage.ts +36 -0
  448. package/vue2/src/helpers/logger.ts +7 -0
  449. package/vue2/src/helpers/nullable.ts +2 -0
  450. package/vue2/src/helpers/preview-lru-cache/get.ts +4 -0
  451. package/vue2/src/helpers/preview-lru-cache/helpers.ts +0 -0
  452. package/vue2/src/helpers/preview-lru-cache/init.ts +7 -0
  453. package/vue2/src/helpers/preview-lru-cache/set.ts +12 -0
  454. package/vue2/src/helpers/preview-lru-cache/types.ts +0 -0
  455. package/vue2/src/helpers/sessionId.ts +37 -0
  456. package/vue2/src/helpers/time.ts +2 -0
  457. package/vue2/src/helpers/url.ts +15 -0
  458. package/vue2/src/helpers/uuid.ts +17 -0
  459. package/vue2/src/helpers/visitorId.ts +37 -0
  460. package/vue2/src/index-helpers/blocks-exports.ts +20 -0
  461. package/vue2/src/index-helpers/top-of-file.ts +4 -0
  462. package/vue2/src/index.ts +8 -0
  463. package/vue2/src/scripts/init-editing.ts +113 -0
  464. package/vue2/src/server-index.ts +15 -0
  465. package/vue2/tsconfig.config.json +8 -0
  466. package/vue2/tsconfig.json +16 -0
  467. package/vue2/vite.config.js +31 -0
  468. package/vue3/css/package.json +4 -0
  469. package/vue3/node_modules/@types/node/LICENSE +21 -0
  470. package/vue3/node_modules/@types/node/README.md +16 -0
  471. package/vue3/node_modules/@types/node/assert/strict.d.ts +8 -0
  472. package/vue3/node_modules/@types/node/assert.d.ts +962 -0
  473. package/vue3/node_modules/@types/node/async_hooks.d.ts +497 -0
  474. package/vue3/node_modules/@types/node/buffer.d.ts +2236 -0
  475. package/vue3/node_modules/@types/node/child_process.d.ts +1396 -0
  476. package/vue3/node_modules/@types/node/cluster.d.ts +414 -0
  477. package/vue3/node_modules/@types/node/console.d.ts +412 -0
  478. package/vue3/node_modules/@types/node/constants.d.ts +18 -0
  479. package/vue3/node_modules/@types/node/crypto.d.ts +3869 -0
  480. package/vue3/node_modules/@types/node/dgram.d.ts +545 -0
  481. package/vue3/node_modules/@types/node/diagnostics_channel.d.ts +191 -0
  482. package/vue3/node_modules/@types/node/dns/promises.d.ts +369 -0
  483. package/vue3/node_modules/@types/node/dns.d.ts +655 -0
  484. package/vue3/node_modules/@types/node/domain.d.ts +170 -0
  485. package/vue3/node_modules/@types/node/events.d.ts +641 -0
  486. package/vue3/node_modules/@types/node/fs/promises.d.ts +1094 -0
  487. package/vue3/node_modules/@types/node/fs.d.ts +3803 -0
  488. package/vue3/node_modules/@types/node/globals.d.ts +287 -0
  489. package/vue3/node_modules/@types/node/globals.global.d.ts +1 -0
  490. package/vue3/node_modules/@types/node/http.d.ts +1504 -0
  491. package/vue3/node_modules/@types/node/http2.d.ts +2100 -0
  492. package/vue3/node_modules/@types/node/https.d.ts +532 -0
  493. package/vue3/node_modules/@types/node/index.d.ts +131 -0
  494. package/vue3/node_modules/@types/node/inspector.d.ts +2745 -0
  495. package/vue3/node_modules/@types/node/module.d.ts +115 -0
  496. package/vue3/node_modules/@types/node/net.d.ts +828 -0
  497. package/vue3/node_modules/@types/node/os.d.ts +455 -0
  498. package/vue3/node_modules/@types/node/package.json +232 -0
  499. package/vue3/node_modules/@types/node/path.d.ts +191 -0
  500. package/vue3/node_modules/@types/node/perf_hooks.d.ts +586 -0
  501. package/vue3/node_modules/@types/node/process.d.ts +1481 -0
  502. package/vue3/node_modules/@types/node/punycode.d.ts +117 -0
  503. package/vue3/node_modules/@types/node/querystring.d.ts +131 -0
  504. package/vue3/node_modules/@types/node/readline.d.ts +543 -0
  505. package/vue3/node_modules/@types/node/repl.d.ts +424 -0
  506. package/vue3/node_modules/@types/node/stream/consumers.d.ts +12 -0
  507. package/vue3/node_modules/@types/node/stream/promises.d.ts +42 -0
  508. package/vue3/node_modules/@types/node/stream/web.d.ts +392 -0
  509. package/vue3/node_modules/@types/node/stream.d.ts +1363 -0
  510. package/vue3/node_modules/@types/node/string_decoder.d.ts +67 -0
  511. package/vue3/node_modules/@types/node/test.d.ts +190 -0
  512. package/vue3/node_modules/@types/node/timers/promises.d.ts +93 -0
  513. package/vue3/node_modules/@types/node/timers.d.ts +94 -0
  514. package/vue3/node_modules/@types/node/tls.d.ts +1019 -0
  515. package/vue3/node_modules/@types/node/trace_events.d.ts +161 -0
  516. package/vue3/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
  517. package/vue3/node_modules/@types/node/ts4.8/assert.d.ts +962 -0
  518. package/vue3/node_modules/@types/node/ts4.8/async_hooks.d.ts +497 -0
  519. package/vue3/node_modules/@types/node/ts4.8/buffer.d.ts +2236 -0
  520. package/vue3/node_modules/@types/node/ts4.8/child_process.d.ts +1396 -0
  521. package/vue3/node_modules/@types/node/ts4.8/cluster.d.ts +414 -0
  522. package/vue3/node_modules/@types/node/ts4.8/console.d.ts +412 -0
  523. package/vue3/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
  524. package/vue3/node_modules/@types/node/ts4.8/crypto.d.ts +3866 -0
  525. package/vue3/node_modules/@types/node/ts4.8/dgram.d.ts +545 -0
  526. package/vue3/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +191 -0
  527. package/vue3/node_modules/@types/node/ts4.8/dns/promises.d.ts +368 -0
  528. package/vue3/node_modules/@types/node/ts4.8/dns.d.ts +654 -0
  529. package/vue3/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
  530. package/vue3/node_modules/@types/node/ts4.8/events.d.ts +641 -0
  531. package/vue3/node_modules/@types/node/ts4.8/fs/promises.d.ts +1094 -0
  532. package/vue3/node_modules/@types/node/ts4.8/fs.d.ts +3802 -0
  533. package/vue3/node_modules/@types/node/ts4.8/globals.d.ts +284 -0
  534. package/vue3/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
  535. package/vue3/node_modules/@types/node/ts4.8/http.d.ts +1503 -0
  536. package/vue3/node_modules/@types/node/ts4.8/http2.d.ts +2100 -0
  537. package/vue3/node_modules/@types/node/ts4.8/https.d.ts +532 -0
  538. package/vue3/node_modules/@types/node/ts4.8/index.d.ts +86 -0
  539. package/vue3/node_modules/@types/node/ts4.8/inspector.d.ts +2745 -0
  540. package/vue3/node_modules/@types/node/ts4.8/module.d.ts +115 -0
  541. package/vue3/node_modules/@types/node/ts4.8/net.d.ts +828 -0
  542. package/vue3/node_modules/@types/node/ts4.8/os.d.ts +456 -0
  543. package/vue3/node_modules/@types/node/ts4.8/path.d.ts +191 -0
  544. package/vue3/node_modules/@types/node/ts4.8/perf_hooks.d.ts +586 -0
  545. package/vue3/node_modules/@types/node/ts4.8/process.d.ts +1481 -0
  546. package/vue3/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
  547. package/vue3/node_modules/@types/node/ts4.8/querystring.d.ts +131 -0
  548. package/vue3/node_modules/@types/node/ts4.8/readline.d.ts +543 -0
  549. package/vue3/node_modules/@types/node/ts4.8/repl.d.ts +424 -0
  550. package/vue3/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
  551. package/vue3/node_modules/@types/node/ts4.8/stream/promises.d.ts +42 -0
  552. package/vue3/node_modules/@types/node/ts4.8/stream/web.d.ts +392 -0
  553. package/vue3/node_modules/@types/node/ts4.8/stream.d.ts +1363 -0
  554. package/vue3/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
  555. package/vue3/node_modules/@types/node/ts4.8/test.d.ts +190 -0
  556. package/vue3/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
  557. package/vue3/node_modules/@types/node/ts4.8/timers.d.ts +94 -0
  558. package/vue3/node_modules/@types/node/ts4.8/tls.d.ts +1019 -0
  559. package/vue3/node_modules/@types/node/ts4.8/trace_events.d.ts +161 -0
  560. package/vue3/node_modules/@types/node/ts4.8/tty.d.ts +204 -0
  561. package/vue3/node_modules/@types/node/ts4.8/url.d.ts +855 -0
  562. package/vue3/node_modules/@types/node/ts4.8/util.d.ts +1594 -0
  563. package/vue3/node_modules/@types/node/ts4.8/v8.d.ts +472 -0
  564. package/vue3/node_modules/@types/node/ts4.8/vm.d.ts +507 -0
  565. package/vue3/node_modules/@types/node/ts4.8/wasi.d.ts +158 -0
  566. package/vue3/node_modules/@types/node/ts4.8/worker_threads.d.ts +649 -0
  567. package/vue3/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
  568. package/vue3/node_modules/@types/node/tty.d.ts +204 -0
  569. package/vue3/node_modules/@types/node/url.d.ts +855 -0
  570. package/vue3/node_modules/@types/node/util.d.ts +1594 -0
  571. package/vue3/node_modules/@types/node/v8.d.ts +472 -0
  572. package/vue3/node_modules/@types/node/vm.d.ts +507 -0
  573. package/vue3/node_modules/@types/node/wasi.d.ts +158 -0
  574. package/vue3/node_modules/@types/node/worker_threads.d.ts +649 -0
  575. package/vue3/node_modules/@types/node/zlib.d.ts +517 -0
  576. package/vue3/node_modules/@vitejs/plugin-vue/LICENSE +21 -0
  577. package/vue3/node_modules/@vitejs/plugin-vue/README.md +171 -0
  578. package/vue3/node_modules/@vitejs/plugin-vue/package.json +51 -0
  579. package/vue3/node_modules/@vue/server-renderer/LICENSE +21 -0
  580. package/vue3/node_modules/@vue/server-renderer/README.md +178 -0
  581. package/vue3/node_modules/@vue/server-renderer/index.js +7 -0
  582. package/vue3/node_modules/@vue/server-renderer/package.json +41 -0
  583. package/vue3/node_modules/@vue/tsconfig/README.md +31 -0
  584. package/vue3/node_modules/@vue/tsconfig/package.json +35 -0
  585. package/vue3/node_modules/@vue/tsconfig/tsconfig.json +40 -0
  586. package/vue3/node_modules/@vue/tsconfig/tsconfig.node.json +17 -0
  587. package/vue3/node_modules/@vue/tsconfig/tsconfig.web.json +19 -0
  588. package/vue3/node_modules/esbuild/LICENSE.md +21 -0
  589. package/vue3/node_modules/esbuild/README.md +3 -0
  590. package/vue3/node_modules/esbuild/bin/esbuild +212 -0
  591. package/vue3/node_modules/esbuild/install.js +245 -0
  592. package/vue3/node_modules/esbuild/package.json +42 -0
  593. package/vue3/node_modules/vite/LICENSE.md +3450 -0
  594. package/vue3/node_modules/vite/README.md +20 -0
  595. package/vue3/node_modules/vite/bin/openChrome.applescript +95 -0
  596. package/vue3/node_modules/vite/bin/vite.js +61 -0
  597. package/vue3/node_modules/vite/client.d.ts +248 -0
  598. package/vue3/node_modules/vite/index.cjs +34 -0
  599. package/vue3/node_modules/vite/package.json +154 -0
  600. package/vue3/node_modules/vite-plugin-dts/LICENSE +21 -0
  601. package/vue3/node_modules/vite-plugin-dts/README.md +368 -0
  602. package/vue3/node_modules/vite-plugin-dts/README.zh-CN.md +368 -0
  603. package/vue3/node_modules/vite-plugin-dts/node_modules/vue-tsc/LICENSE +21 -0
  604. package/vue3/node_modules/vite-plugin-dts/node_modules/vue-tsc/README.md +36 -0
  605. package/vue3/node_modules/vite-plugin-dts/node_modules/vue-tsc/bin/vue-tsc.js +67 -0
  606. package/vue3/node_modules/vite-plugin-dts/node_modules/vue-tsc/out/index.d.ts +16 -0
  607. package/vue3/node_modules/vite-plugin-dts/node_modules/vue-tsc/out/index.js +120 -0
  608. package/vue3/node_modules/vite-plugin-dts/node_modules/vue-tsc/out/shared.d.ts +8 -0
  609. package/vue3/node_modules/vite-plugin-dts/node_modules/vue-tsc/out/shared.js +5 -0
  610. package/vue3/node_modules/vite-plugin-dts/node_modules/vue-tsc/package.json +28 -0
  611. package/vue3/node_modules/vite-plugin-dts/package.json +103 -0
  612. package/vue3/node_modules/vue/LICENSE +21 -0
  613. package/vue3/node_modules/vue/README.md +54 -0
  614. package/vue3/node_modules/vue/compiler-sfc/index.d.mts +1 -0
  615. package/vue3/node_modules/vue/compiler-sfc/index.d.ts +1 -0
  616. package/vue3/node_modules/vue/compiler-sfc/index.js +3 -0
  617. package/vue3/node_modules/vue/compiler-sfc/index.mjs +3 -0
  618. package/vue3/node_modules/vue/compiler-sfc/package.json +4 -0
  619. package/vue3/node_modules/vue/compiler-sfc/register-ts.js +5 -0
  620. package/vue3/node_modules/vue/index.js +7 -0
  621. package/vue3/node_modules/vue/index.mjs +1 -0
  622. package/vue3/node_modules/vue/jsx-runtime/index.d.ts +29 -0
  623. package/vue3/node_modules/vue/jsx-runtime/index.js +15 -0
  624. package/vue3/node_modules/vue/jsx-runtime/index.mjs +17 -0
  625. package/vue3/node_modules/vue/jsx-runtime/package.json +5 -0
  626. package/vue3/node_modules/vue/jsx.d.ts +26 -0
  627. package/vue3/node_modules/vue/macros-global.d.ts +19 -0
  628. package/vue3/node_modules/vue/macros.d.ts +112 -0
  629. package/vue3/node_modules/vue/package.json +103 -0
  630. package/vue3/node_modules/vue/ref-macros.d.ts +2 -0
  631. package/vue3/node_modules/vue/server-renderer/index.d.mts +1 -0
  632. package/vue3/node_modules/vue/server-renderer/index.d.ts +1 -0
  633. package/vue3/node_modules/vue/server-renderer/index.js +1 -0
  634. package/vue3/node_modules/vue/server-renderer/index.mjs +1 -0
  635. package/vue3/node_modules/vue/server-renderer/package.json +4 -0
  636. package/vue3/node_modules/vue-tsc/LICENSE +21 -0
  637. package/vue3/node_modules/vue-tsc/README.md +44 -0
  638. package/vue3/node_modules/vue-tsc/bin/vue-tsc.js +48 -0
  639. package/vue3/node_modules/vue-tsc/out/proxy.d.ts +4 -0
  640. package/vue3/node_modules/vue-tsc/out/proxy.js +110 -0
  641. package/vue3/node_modules/vue-tsc/package.json +26 -0
  642. package/vue3/package.json +48 -0
  643. package/vue3/src/blocks/BaseText.vue +25 -0
  644. package/vue3/src/blocks/button/button.vue +71 -0
  645. package/vue3/src/blocks/button/component-info.ts +35 -0
  646. package/vue3/src/blocks/columns/columns.vue +220 -0
  647. package/vue3/src/blocks/columns/component-info.ts +219 -0
  648. package/vue3/src/blocks/custom-code/component-info.ts +24 -0
  649. package/vue3/src/blocks/custom-code/custom-code.vue +88 -0
  650. package/vue3/src/blocks/embed/component-info.ts +38 -0
  651. package/vue3/src/blocks/embed/embed.vue +71 -0
  652. package/vue3/src/blocks/embed/helpers.ts +2 -0
  653. package/vue3/src/blocks/form/component-info.ts +233 -0
  654. package/vue3/src/blocks/form/form.vue +7 -0
  655. package/vue3/src/blocks/fragment/component-info.ts +8 -0
  656. package/vue3/src/blocks/fragment/fragment.vue +19 -0
  657. package/vue3/src/blocks/helpers.ts +43 -0
  658. package/vue3/src/blocks/image/component-info.ts +124 -0
  659. package/vue3/src/blocks/image/image.helpers.ts +47 -0
  660. package/vue3/src/blocks/image/image.vue +172 -0
  661. package/vue3/src/blocks/img/component-info.ts +16 -0
  662. package/vue3/src/blocks/img/img.vue +59 -0
  663. package/vue3/src/blocks/input/component-info.ts +47 -0
  664. package/vue3/src/blocks/input/input.vue +52 -0
  665. package/vue3/src/blocks/raw-text/component-info.ts +11 -0
  666. package/vue3/src/blocks/raw-text/raw-text.vue +35 -0
  667. package/vue3/src/blocks/section/component-info.ts +41 -0
  668. package/vue3/src/blocks/section/section.vue +47 -0
  669. package/vue3/src/blocks/select/component-info.ts +44 -0
  670. package/vue3/src/blocks/select/select.vue +46 -0
  671. package/vue3/src/blocks/submit-button/component-info.ts +27 -0
  672. package/vue3/src/blocks/submit-button/submit-button.vue +34 -0
  673. package/vue3/src/blocks/symbol/component-info.ts +35 -0
  674. package/vue3/src/blocks/symbol/symbol.helpers.ts +47 -0
  675. package/vue3/src/blocks/symbol/symbol.vue +134 -0
  676. package/vue3/src/blocks/text/component-info.ts +20 -0
  677. package/vue3/src/blocks/text/text.vue +23 -0
  678. package/vue3/src/blocks/textarea/component-info.ts +38 -0
  679. package/vue3/src/blocks/textarea/textarea.vue +38 -0
  680. package/vue3/src/blocks/video/component-info.ts +83 -0
  681. package/vue3/src/blocks/video/video.vue +105 -0
  682. package/vue3/src/components/block/block.helpers.ts +89 -0
  683. package/vue3/src/components/block/block.vue +214 -0
  684. package/vue3/src/components/block/components/block-styles.vue +100 -0
  685. package/vue3/src/components/block/components/block-wrapper.vue +86 -0
  686. package/vue3/src/components/block/components/component-ref/component-ref.helpers.ts +52 -0
  687. package/vue3/src/components/block/components/component-ref/component-ref.vue +74 -0
  688. package/vue3/src/components/block/components/interactive-element.vue +48 -0
  689. package/vue3/src/components/block/components/repeated-block.vue +51 -0
  690. package/vue3/src/components/block/types.ts +6 -0
  691. package/vue3/src/components/blocks/blocks-wrapper.vue +91 -0
  692. package/vue3/src/components/blocks/blocks.vue +78 -0
  693. package/vue3/src/components/content/components/enable-editor.vue +419 -0
  694. package/vue3/src/components/content/components/styles.helpers.ts +77 -0
  695. package/vue3/src/components/content/components/styles.vue +51 -0
  696. package/vue3/src/components/content/content.helpers.ts +42 -0
  697. package/vue3/src/components/content/content.types.ts +23 -0
  698. package/vue3/src/components/content/content.vue +169 -0
  699. package/vue3/src/components/content/index.ts +1 -0
  700. package/vue3/src/components/content/wrap-component-ref.ts +7 -0
  701. package/vue3/src/components/content-variants/content-variants.types.ts +20 -0
  702. package/vue3/src/components/content-variants/content-variants.vue +151 -0
  703. package/vue3/src/components/content-variants/helpers.ts +207 -0
  704. package/vue3/src/components/inlined-script.vue +12 -0
  705. package/vue3/src/components/inlined-styles.vue +12 -0
  706. package/vue3/src/constants/builder-registered-components.ts +62 -0
  707. package/vue3/src/constants/device-sizes.ts +59 -0
  708. package/vue3/src/constants/sdk-version.ts +1 -0
  709. package/vue3/src/constants/target.ts +4 -0
  710. package/vue3/src/context/builder.context.ts +16 -0
  711. package/vue3/src/context/components.context.ts +6 -0
  712. package/vue3/src/context/types.ts +36 -0
  713. package/vue3/src/functions/apply-patch-with-mutation.ts +61 -0
  714. package/vue3/src/functions/camel-to-kebab-case.ts +1 -0
  715. package/vue3/src/functions/deopt.ts +6 -0
  716. package/vue3/src/functions/evaluate/browser-runtime/browser.ts +41 -0
  717. package/vue3/src/functions/evaluate/browser-runtime/index.ts +1 -0
  718. package/vue3/src/functions/evaluate/edge-runtime/acorn-interpreter.ts +2891 -0
  719. package/vue3/src/functions/evaluate/edge-runtime/edge-runtime.ts +96 -0
  720. package/vue3/src/functions/evaluate/edge-runtime/index.ts +1 -0
  721. package/vue3/src/functions/evaluate/evaluate.ts +66 -0
  722. package/vue3/src/functions/evaluate/helpers.ts +32 -0
  723. package/vue3/src/functions/evaluate/index.ts +1 -0
  724. package/vue3/src/functions/evaluate/node-runtime/index.ts +1 -0
  725. package/vue3/src/functions/evaluate/placeholder-runtime.ts +4 -0
  726. package/vue3/src/functions/event-handler-name.ts +1 -0
  727. package/vue3/src/functions/extract-text-styles.ts +24 -0
  728. package/vue3/src/functions/fast-clone.ts +4 -0
  729. package/vue3/src/functions/fetch-builder-props.ts +62 -0
  730. package/vue3/src/functions/get-block-actions-handler.ts +16 -0
  731. package/vue3/src/functions/get-block-actions.ts +36 -0
  732. package/vue3/src/functions/get-block-component-options.ts +11 -0
  733. package/vue3/src/functions/get-block-properties.ts +82 -0
  734. package/vue3/src/functions/get-builder-search-params/index.ts +40 -0
  735. package/vue3/src/functions/get-content/generate-content-url.ts +45 -0
  736. package/vue3/src/functions/get-content/index.ts +110 -0
  737. package/vue3/src/functions/get-content/types.ts +62 -0
  738. package/vue3/src/functions/get-fetch.ts +11 -0
  739. package/vue3/src/functions/get-global-this.ts +16 -0
  740. package/vue3/src/functions/get-processed-block.ts +69 -0
  741. package/vue3/src/functions/get-react-native-block-styles.ts +27 -0
  742. package/vue3/src/functions/is-browser.ts +3 -0
  743. package/vue3/src/functions/is-edge-runtime.ts +9 -0
  744. package/vue3/src/functions/is-editing.ts +5 -0
  745. package/vue3/src/functions/is-iframe.ts +4 -0
  746. package/vue3/src/functions/is-previewing.ts +11 -0
  747. package/vue3/src/functions/on-change.ts +29 -0
  748. package/vue3/src/functions/register-component.ts +48 -0
  749. package/vue3/src/functions/register.ts +44 -0
  750. package/vue3/src/functions/sanitize-react-native-block-styles.ts +58 -0
  751. package/vue3/src/functions/set-editor-settings.ts +15 -0
  752. package/vue3/src/functions/set.ts +14 -0
  753. package/vue3/src/functions/track/helpers.ts +51 -0
  754. package/vue3/src/functions/track/index.ts +131 -0
  755. package/vue3/src/functions/track/interaction.ts +63 -0
  756. package/vue3/src/functions/transform-block-properties.ts +18 -0
  757. package/vue3/src/functions/transform-block.ts +6 -0
  758. package/vue3/src/helpers/ab-tests.ts +166 -0
  759. package/vue3/src/helpers/canTrack.ts +2 -0
  760. package/vue3/src/helpers/cookie.ts +81 -0
  761. package/vue3/src/helpers/css.ts +33 -0
  762. package/vue3/src/helpers/flatten.ts +19 -0
  763. package/vue3/src/helpers/localStorage.ts +36 -0
  764. package/vue3/src/helpers/logger.ts +7 -0
  765. package/vue3/src/helpers/nullable.ts +2 -0
  766. package/vue3/src/helpers/preview-lru-cache/get.ts +4 -0
  767. package/vue3/src/helpers/preview-lru-cache/helpers.ts +0 -0
  768. package/vue3/src/helpers/preview-lru-cache/init.ts +7 -0
  769. package/vue3/src/helpers/preview-lru-cache/set.ts +12 -0
  770. package/vue3/src/helpers/preview-lru-cache/types.ts +0 -0
  771. package/vue3/src/helpers/sessionId.ts +37 -0
  772. package/vue3/src/helpers/time.ts +2 -0
  773. package/vue3/src/helpers/url.ts +15 -0
  774. package/vue3/src/helpers/uuid.ts +17 -0
  775. package/vue3/src/helpers/visitorId.ts +37 -0
  776. package/vue3/src/index-helpers/blocks-exports.ts +20 -0
  777. package/vue3/src/index-helpers/top-of-file.ts +4 -0
  778. package/vue3/src/index.ts +8 -0
  779. package/vue3/src/scripts/init-editing.ts +113 -0
  780. package/vue3/src/server-index.ts +15 -0
  781. package/vue3/tsconfig.config.json +8 -0
  782. package/vue3/tsconfig.json +17 -0
  783. package/vue3/vite.config.js +31 -0
  784. package/packages/_vue2/dist/block-styles.2f2d681c.js +0 -78
  785. package/packages/_vue2/dist/block-styles.e0c362f1.cjs +0 -1
  786. package/packages/_vue2/dist/block-wrapper.60491ece.cjs +0 -1
  787. package/packages/_vue2/dist/block-wrapper.675417b1.js +0 -66
  788. package/packages/_vue2/dist/block.2b1ac86c.cjs +0 -3
  789. package/packages/_vue2/dist/block.b10ffc8d.js +0 -179
  790. package/packages/_vue2/dist/blocks-wrapper.1f4e53ec.js +0 -72
  791. package/packages/_vue2/dist/blocks-wrapper.87c356a1.cjs +0 -1
  792. package/packages/_vue2/dist/component-ref.d1a3e1db.js +0 -98
  793. package/packages/_vue2/dist/component-ref.e0e18275.cjs +0 -1
  794. package/packages/_vue2/dist/content.4dd9bed9.js +0 -913
  795. package/packages/_vue2/dist/content.e0c272e6.cjs +0 -1
  796. package/packages/_vue2/dist/css.3b52add0.js +0 -21
  797. package/packages/_vue2/dist/css.5b6afc6e.cjs +0 -6
  798. package/packages/_vue2/dist/enable-editor.29678a79.cjs +0 -1
  799. package/packages/_vue2/dist/enable-editor.c8c377d7.js +0 -427
  800. package/packages/_vue2/dist/evaluate.585803ce.cjs +0 -1
  801. package/packages/_vue2/dist/evaluate.b622b309.js +0 -97
  802. package/packages/_vue2/dist/get-block-actions.17f0418a.js +0 -36
  803. package/packages/_vue2/dist/get-block-actions.cc26a1a3.cjs +0 -1
  804. package/packages/_vue2/dist/get-block-properties.3a4c9314.js +0 -48
  805. package/packages/_vue2/dist/get-block-properties.fbe48fae.cjs +0 -1
  806. package/packages/_vue2/dist/get-processed-block.5937bfa6.cjs +0 -1
  807. package/packages/_vue2/dist/get-processed-block.92e6395c.js +0 -53
  808. package/packages/_vue2/dist/index.04a22940.cjs +0 -32
  809. package/packages/_vue2/dist/index.835b8ee0.js +0 -1413
  810. package/packages/_vue2/dist/inlined-script.0c7f9ce3.cjs +0 -1
  811. package/packages/_vue2/dist/inlined-script.3ec95873.js +0 -23
  812. package/packages/_vue2/dist/inlined-styles.89ce41e1.cjs +0 -1
  813. package/packages/_vue2/dist/inlined-styles.ccff7c47.js +0 -23
  814. package/packages/_vue2/dist/interactive-element.fa779554.js +0 -42
  815. package/packages/_vue2/dist/interactive-element.fdd261bc.cjs +0 -1
  816. package/packages/_vue2/dist/non-node-runtime.ddfeed94.cjs +0 -21
  817. package/packages/_vue2/dist/non-node-runtime.eb7f6595.js +0 -2477
  818. package/packages/_vue2/dist/repeated-block.3c989659.js +0 -38
  819. package/packages/_vue2/dist/repeated-block.48fbaaab.cjs +0 -1
  820. package/packages/_vue2/dist/sdk.cjs +0 -1
  821. package/packages/_vue2/dist/sdk.d.ts +0 -1
  822. package/packages/_vue2/dist/sdk.js +0 -29
  823. package/packages/_vue2/dist/set.87eb0329.cjs +0 -1
  824. package/packages/_vue2/dist/set.b219ab0e.js +0 -9
  825. package/packages/_vue2/dist/src/blocks/button/button.vue.d.ts +0 -17
  826. package/packages/_vue2/dist/src/blocks/button/component-info.d.ts +0 -2
  827. package/packages/_vue2/dist/src/blocks/columns/columns.vue.d.ts +0 -44
  828. package/packages/_vue2/dist/src/blocks/columns/component-info.d.ts +0 -2
  829. package/packages/_vue2/dist/src/blocks/custom-code/component-info.d.ts +0 -2
  830. package/packages/_vue2/dist/src/blocks/custom-code/custom-code.vue.d.ts +0 -14
  831. package/packages/_vue2/dist/src/blocks/embed/component-info.d.ts +0 -2
  832. package/packages/_vue2/dist/src/blocks/embed/embed.vue.d.ts +0 -18
  833. package/packages/_vue2/dist/src/blocks/embed/helpers.d.ts +0 -1
  834. package/packages/_vue2/dist/src/blocks/fragment/component-info.d.ts +0 -2
  835. package/packages/_vue2/dist/src/blocks/fragment/fragment.vue.d.ts +0 -7
  836. package/packages/_vue2/dist/src/blocks/helpers.d.ts +0 -13
  837. package/packages/_vue2/dist/src/blocks/image/component-info.d.ts +0 -2
  838. package/packages/_vue2/dist/src/blocks/image/image.helpers.d.ts +0 -1
  839. package/packages/_vue2/dist/src/blocks/image/image.vue.d.ts +0 -72
  840. package/packages/_vue2/dist/src/blocks/img/component-info.d.ts +0 -2
  841. package/packages/_vue2/dist/src/blocks/img/img.vue.d.ts +0 -38
  842. package/packages/_vue2/dist/src/blocks/section/component-info.d.ts +0 -2
  843. package/packages/_vue2/dist/src/blocks/section/section.vue.d.ts +0 -22
  844. package/packages/_vue2/dist/src/blocks/symbol/component-info.d.ts +0 -2
  845. package/packages/_vue2/dist/src/blocks/symbol/symbol.helpers.d.ts +0 -14
  846. package/packages/_vue2/dist/src/blocks/symbol/symbol.vue.d.ts +0 -37
  847. package/packages/_vue2/dist/src/blocks/text/component-info.d.ts +0 -2
  848. package/packages/_vue2/dist/src/blocks/text/text.vue.d.ts +0 -11
  849. package/packages/_vue2/dist/src/blocks/video/component-info.d.ts +0 -2
  850. package/packages/_vue2/dist/src/blocks/video/video.vue.d.ts +0 -64
  851. package/packages/_vue2/dist/src/components/block/block.helpers.d.ts +0 -13
  852. package/packages/_vue2/dist/src/components/block/block.vue.d.ts +0 -9
  853. package/packages/_vue2/dist/src/components/block/components/block-styles.vue.d.ts +0 -23
  854. package/packages/_vue2/dist/src/components/block/components/block-wrapper.vue.d.ts +0 -29
  855. package/packages/_vue2/dist/src/components/block/components/component-ref/component-ref.helpers.d.ts +0 -30
  856. package/packages/_vue2/dist/src/components/block/components/component-ref/component-ref.vue.d.ts +0 -2
  857. package/packages/_vue2/dist/src/components/block/components/interactive-element.vue.d.ts +0 -30
  858. package/packages/_vue2/dist/src/components/block/components/repeated-block.vue.d.ts +0 -16
  859. package/packages/_vue2/dist/src/components/block/types.d.ts +0 -6
  860. package/packages/_vue2/dist/src/components/blocks/blocks-wrapper.vue.d.ts +0 -30
  861. package/packages/_vue2/dist/src/components/blocks/blocks.vue.d.ts +0 -29
  862. package/packages/_vue2/dist/src/components/content/components/enable-editor.vue.d.ts +0 -56
  863. package/packages/_vue2/dist/src/components/content/components/styles.helpers.d.ts +0 -15
  864. package/packages/_vue2/dist/src/components/content/components/styles.vue.d.ts +0 -16
  865. package/packages/_vue2/dist/src/components/content/content.helpers.d.ts +0 -7
  866. package/packages/_vue2/dist/src/components/content/content.types.d.ts +0 -24
  867. package/packages/_vue2/dist/src/components/content/content.vue.d.ts +0 -26
  868. package/packages/_vue2/dist/src/components/content/wrap-component-ref.d.ts +0 -6
  869. package/packages/_vue2/dist/src/components/content-variants/content-variants.types.d.ts +0 -20
  870. package/packages/_vue2/dist/src/components/content-variants/content-variants.vue.d.ts +0 -50
  871. package/packages/_vue2/dist/src/components/content-variants/helpers.d.ts +0 -18
  872. package/packages/_vue2/dist/src/components/inlined-script.vue.d.ts +0 -11
  873. package/packages/_vue2/dist/src/components/inlined-styles.vue.d.ts +0 -11
  874. package/packages/_vue2/dist/src/constants/builder-registered-components.d.ts +0 -6
  875. package/packages/_vue2/dist/src/constants/device-sizes.d.ts +0 -13
  876. package/packages/_vue2/dist/src/constants/sdk-version.d.ts +0 -1
  877. package/packages/_vue2/dist/src/constants/target.d.ts +0 -2
  878. package/packages/_vue2/dist/src/context/builder.context.d.ts +0 -15
  879. package/packages/_vue2/dist/src/context/components.context.d.ts +0 -7
  880. package/packages/_vue2/dist/src/context/types.d.ts +0 -35
  881. package/packages/_vue2/dist/src/functions/camel-to-kebab-case.d.ts +0 -1
  882. package/packages/_vue2/dist/src/functions/evaluate/browser-runtime/browser.d.ts +0 -4
  883. package/packages/_vue2/dist/src/functions/evaluate/evaluate.d.ts +0 -6
  884. package/packages/_vue2/dist/src/functions/evaluate/helpers.d.ts +0 -18
  885. package/packages/_vue2/dist/src/functions/evaluate/index.d.ts +0 -1
  886. package/packages/_vue2/dist/src/functions/evaluate/non-node-runtime/acorn-interpreter.d.ts +0 -2
  887. package/packages/_vue2/dist/src/functions/evaluate/non-node-runtime/index.d.ts +0 -6
  888. package/packages/_vue2/dist/src/functions/evaluate/non-node-runtime/non-node-runtime.d.ts +0 -2
  889. package/packages/_vue2/dist/src/functions/event-handler-name.d.ts +0 -1
  890. package/packages/_vue2/dist/src/functions/extract-text-styles.d.ts +0 -4
  891. package/packages/_vue2/dist/src/functions/fast-clone.d.ts +0 -4
  892. package/packages/_vue2/dist/src/functions/fetch-builder-props.d.ts +0 -39
  893. package/packages/_vue2/dist/src/functions/get-block-actions-handler.d.ts +0 -8
  894. package/packages/_vue2/dist/src/functions/get-block-actions.d.ts +0 -10
  895. package/packages/_vue2/dist/src/functions/get-block-component-options.d.ts +0 -2
  896. package/packages/_vue2/dist/src/functions/get-block-properties.d.ts +0 -6
  897. package/packages/_vue2/dist/src/functions/get-builder-search-params/index.d.ts +0 -12
  898. package/packages/_vue2/dist/src/functions/get-content/generate-content-url.d.ts +0 -2
  899. package/packages/_vue2/dist/src/functions/get-content/index.d.ts +0 -29
  900. package/packages/_vue2/dist/src/functions/get-content/types.d.ts +0 -51
  901. package/packages/_vue2/dist/src/functions/get-fetch.d.ts +0 -1
  902. package/packages/_vue2/dist/src/functions/get-processed-block.d.ts +0 -10
  903. package/packages/_vue2/dist/src/functions/get-react-native-block-styles.d.ts +0 -7
  904. package/packages/_vue2/dist/src/functions/is-browser.d.ts +0 -1
  905. package/packages/_vue2/dist/src/functions/is-editing.d.ts +0 -1
  906. package/packages/_vue2/dist/src/functions/is-iframe.d.ts +0 -1
  907. package/packages/_vue2/dist/src/functions/is-non-node-server.d.ts +0 -4
  908. package/packages/_vue2/dist/src/functions/is-previewing.d.ts +0 -1
  909. package/packages/_vue2/dist/src/functions/register-component.d.ts +0 -15
  910. package/packages/_vue2/dist/src/functions/register.d.ts +0 -16
  911. package/packages/_vue2/dist/src/functions/sanitize-react-native-block-styles.d.ts +0 -3
  912. package/packages/_vue2/dist/src/functions/set-editor-settings.d.ts +0 -4
  913. package/packages/_vue2/dist/src/functions/set.d.ts +0 -7
  914. package/packages/_vue2/dist/src/functions/track/helpers.d.ts +0 -5
  915. package/packages/_vue2/dist/src/functions/track/index.d.ts +0 -51
  916. package/packages/_vue2/dist/src/functions/track/interaction.d.ts +0 -13
  917. package/packages/_vue2/dist/src/functions/transform-block-properties.d.ts +0 -2
  918. package/packages/_vue2/dist/src/functions/transform-block.d.ts +0 -2
  919. package/packages/_vue2/dist/src/helpers/ab-tests.d.ts +0 -9
  920. package/packages/_vue2/dist/src/helpers/canTrack.d.ts +0 -1
  921. package/packages/_vue2/dist/src/helpers/cookie.d.ts +0 -19
  922. package/packages/_vue2/dist/src/helpers/css.d.ts +0 -7
  923. package/packages/_vue2/dist/src/helpers/flatten.d.ts +0 -6
  924. package/packages/_vue2/dist/src/helpers/localStorage.d.ts +0 -9
  925. package/packages/_vue2/dist/src/helpers/logger.d.ts +0 -6
  926. package/packages/_vue2/dist/src/helpers/nullable.d.ts +0 -2
  927. package/packages/_vue2/dist/src/helpers/preview-lru-cache/get.d.ts +0 -2
  928. package/packages/_vue2/dist/src/helpers/preview-lru-cache/set.d.ts +0 -7
  929. package/packages/_vue2/dist/src/helpers/sessionId.d.ts +0 -6
  930. package/packages/_vue2/dist/src/helpers/url.d.ts +0 -6
  931. package/packages/_vue2/dist/src/helpers/uuid.d.ts +0 -8
  932. package/packages/_vue2/dist/src/helpers/visitorId.d.ts +0 -6
  933. package/packages/_vue2/dist/src/index-helpers/blocks-exports.d.ts +0 -88
  934. package/packages/_vue2/dist/src/index-helpers/top-of-file.d.ts +0 -1
  935. package/packages/_vue2/dist/src/index.d.ts +0 -7
  936. package/packages/_vue2/dist/src/scripts/init-editing.d.ts +0 -6
  937. package/packages/_vue2/dist/src/server-index.d.ts +0 -15
  938. package/packages/_vue2/dist/src/types/api-version.d.ts +0 -2
  939. package/packages/_vue2/dist/src/types/builder-block.d.ts +0 -66
  940. package/packages/_vue2/dist/src/types/builder-content.d.ts +0 -44
  941. package/packages/_vue2/dist/src/types/builder-props.d.ts +0 -9
  942. package/packages/_vue2/dist/src/types/can-track.d.ts +0 -3
  943. package/packages/_vue2/dist/src/types/components.d.ts +0 -111
  944. package/packages/_vue2/dist/src/types/deep-partial.d.ts +0 -3
  945. package/packages/_vue2/dist/src/types/element.d.ts +0 -59
  946. package/packages/_vue2/dist/src/types/enforced-partials.d.ts +0 -21
  947. package/packages/_vue2/dist/src/types/input.d.ts +0 -121
  948. package/packages/_vue2/dist/src/types/targets.d.ts +0 -1
  949. package/packages/_vue2/dist/src/types/typescript.d.ts +0 -11
  950. package/packages/_vue2/dist/style.css +0 -1
  951. package/packages/_vue2/dist/styles.22b87564.js +0 -89
  952. package/packages/_vue2/dist/styles.a3209286.cjs +0 -31
  953. package/packages/_vue3/dist/block-wrapper.4abbfa5d.cjs +0 -1
  954. package/packages/_vue3/dist/block-wrapper.e6a959ca.js +0 -54
  955. package/packages/_vue3/dist/component-ref.16c18e90.cjs +0 -1
  956. package/packages/_vue3/dist/component-ref.b3232d22.js +0 -111
  957. package/packages/_vue3/dist/get-block-actions.48118020.js +0 -79
  958. package/packages/_vue3/dist/get-block-actions.83a66ea4.cjs +0 -1
  959. package/packages/_vue3/dist/index.ee80c2d7.js +0 -3262
  960. package/packages/_vue3/dist/index.f36face2.cjs +0 -69
  961. package/packages/_vue3/dist/non-node-runtime.15581a63.js +0 -2475
  962. package/packages/_vue3/dist/non-node-runtime.fb2b33d0.cjs +0 -21
  963. package/packages/_vue3/dist/repeated-block.33f567b4.cjs +0 -1
  964. package/packages/_vue3/dist/repeated-block.53ae8c41.js +0 -33
  965. package/packages/_vue3/dist/sdk.cjs +0 -1
  966. package/packages/_vue3/dist/sdk.d.ts +0 -1
  967. package/packages/_vue3/dist/sdk.js +0 -29
  968. package/packages/_vue3/dist/src/blocks/button/button.vue.d.ts +0 -30
  969. package/packages/_vue3/dist/src/blocks/button/component-info.d.ts +0 -2
  970. package/packages/_vue3/dist/src/blocks/columns/columns.vue.d.ts +0 -69
  971. package/packages/_vue3/dist/src/blocks/columns/component-info.d.ts +0 -2
  972. package/packages/_vue3/dist/src/blocks/custom-code/component-info.d.ts +0 -2
  973. package/packages/_vue3/dist/src/blocks/custom-code/custom-code.vue.d.ts +0 -21
  974. package/packages/_vue3/dist/src/blocks/embed/component-info.d.ts +0 -2
  975. package/packages/_vue3/dist/src/blocks/embed/embed.vue.d.ts +0 -22
  976. package/packages/_vue3/dist/src/blocks/embed/helpers.d.ts +0 -1
  977. package/packages/_vue3/dist/src/blocks/fragment/component-info.d.ts +0 -2
  978. package/packages/_vue3/dist/src/blocks/fragment/fragment.vue.d.ts +0 -7
  979. package/packages/_vue3/dist/src/blocks/helpers.d.ts +0 -13
  980. package/packages/_vue3/dist/src/blocks/image/component-info.d.ts +0 -2
  981. package/packages/_vue3/dist/src/blocks/image/image.helpers.d.ts +0 -1
  982. package/packages/_vue3/dist/src/blocks/image/image.vue.d.ts +0 -72
  983. package/packages/_vue3/dist/src/blocks/img/component-info.d.ts +0 -2
  984. package/packages/_vue3/dist/src/blocks/img/img.vue.d.ts +0 -38
  985. package/packages/_vue3/dist/src/blocks/section/component-info.d.ts +0 -2
  986. package/packages/_vue3/dist/src/blocks/section/section.vue.d.ts +0 -22
  987. package/packages/_vue3/dist/src/blocks/symbol/component-info.d.ts +0 -2
  988. package/packages/_vue3/dist/src/blocks/symbol/symbol.helpers.d.ts +0 -14
  989. package/packages/_vue3/dist/src/blocks/symbol/symbol.vue.d.ts +0 -56
  990. package/packages/_vue3/dist/src/blocks/text/component-info.d.ts +0 -2
  991. package/packages/_vue3/dist/src/blocks/text/text.vue.d.ts +0 -11
  992. package/packages/_vue3/dist/src/blocks/video/component-info.d.ts +0 -2
  993. package/packages/_vue3/dist/src/blocks/video/video.vue.d.ts +0 -64
  994. package/packages/_vue3/dist/src/components/block/block.helpers.d.ts +0 -13
  995. package/packages/_vue3/dist/src/components/block/block.vue.d.ts +0 -9
  996. package/packages/_vue3/dist/src/components/block/components/block-styles.vue.d.ts +0 -23
  997. package/packages/_vue3/dist/src/components/block/components/block-wrapper.vue.d.ts +0 -29
  998. package/packages/_vue3/dist/src/components/block/components/component-ref/component-ref.helpers.d.ts +0 -30
  999. package/packages/_vue3/dist/src/components/block/components/component-ref/component-ref.vue.d.ts +0 -2
  1000. package/packages/_vue3/dist/src/components/block/components/interactive-element.vue.d.ts +0 -30
  1001. package/packages/_vue3/dist/src/components/block/components/repeated-block.vue.d.ts +0 -16
  1002. package/packages/_vue3/dist/src/components/block/types.d.ts +0 -6
  1003. package/packages/_vue3/dist/src/components/blocks/blocks-wrapper.vue.d.ts +0 -30
  1004. package/packages/_vue3/dist/src/components/blocks/blocks.vue.d.ts +0 -29
  1005. package/packages/_vue3/dist/src/components/content/components/enable-editor.vue.d.ts +0 -90
  1006. package/packages/_vue3/dist/src/components/content/components/styles.helpers.d.ts +0 -15
  1007. package/packages/_vue3/dist/src/components/content/components/styles.vue.d.ts +0 -16
  1008. package/packages/_vue3/dist/src/components/content/content.helpers.d.ts +0 -7
  1009. package/packages/_vue3/dist/src/components/content/content.types.d.ts +0 -24
  1010. package/packages/_vue3/dist/src/components/content/content.vue.d.ts +0 -69
  1011. package/packages/_vue3/dist/src/components/content/wrap-component-ref.d.ts +0 -6
  1012. package/packages/_vue3/dist/src/components/content-variants/content-variants.types.d.ts +0 -20
  1013. package/packages/_vue3/dist/src/components/content-variants/content-variants.vue.d.ts +0 -73
  1014. package/packages/_vue3/dist/src/components/content-variants/helpers.d.ts +0 -41
  1015. package/packages/_vue3/dist/src/components/inlined-script.vue.d.ts +0 -11
  1016. package/packages/_vue3/dist/src/components/inlined-styles.vue.d.ts +0 -11
  1017. package/packages/_vue3/dist/src/constants/builder-registered-components.d.ts +0 -6
  1018. package/packages/_vue3/dist/src/constants/device-sizes.d.ts +0 -13
  1019. package/packages/_vue3/dist/src/constants/sdk-version.d.ts +0 -1
  1020. package/packages/_vue3/dist/src/constants/target.d.ts +0 -2
  1021. package/packages/_vue3/dist/src/context/builder.context.d.ts +0 -15
  1022. package/packages/_vue3/dist/src/context/components.context.d.ts +0 -7
  1023. package/packages/_vue3/dist/src/context/types.d.ts +0 -35
  1024. package/packages/_vue3/dist/src/functions/camel-to-kebab-case.d.ts +0 -1
  1025. package/packages/_vue3/dist/src/functions/evaluate/browser-runtime/browser.d.ts +0 -4
  1026. package/packages/_vue3/dist/src/functions/evaluate/evaluate.d.ts +0 -6
  1027. package/packages/_vue3/dist/src/functions/evaluate/helpers.d.ts +0 -18
  1028. package/packages/_vue3/dist/src/functions/evaluate/index.d.ts +0 -1
  1029. package/packages/_vue3/dist/src/functions/evaluate/non-node-runtime/acorn-interpreter.d.ts +0 -2
  1030. package/packages/_vue3/dist/src/functions/evaluate/non-node-runtime/index.d.ts +0 -6
  1031. package/packages/_vue3/dist/src/functions/evaluate/non-node-runtime/non-node-runtime.d.ts +0 -2
  1032. package/packages/_vue3/dist/src/functions/event-handler-name.d.ts +0 -1
  1033. package/packages/_vue3/dist/src/functions/extract-text-styles.d.ts +0 -4
  1034. package/packages/_vue3/dist/src/functions/fast-clone.d.ts +0 -4
  1035. package/packages/_vue3/dist/src/functions/fetch-builder-props.d.ts +0 -39
  1036. package/packages/_vue3/dist/src/functions/get-block-actions-handler.d.ts +0 -8
  1037. package/packages/_vue3/dist/src/functions/get-block-actions.d.ts +0 -10
  1038. package/packages/_vue3/dist/src/functions/get-block-component-options.d.ts +0 -2
  1039. package/packages/_vue3/dist/src/functions/get-block-properties.d.ts +0 -6
  1040. package/packages/_vue3/dist/src/functions/get-builder-search-params/index.d.ts +0 -12
  1041. package/packages/_vue3/dist/src/functions/get-content/generate-content-url.d.ts +0 -2
  1042. package/packages/_vue3/dist/src/functions/get-content/index.d.ts +0 -29
  1043. package/packages/_vue3/dist/src/functions/get-content/types.d.ts +0 -51
  1044. package/packages/_vue3/dist/src/functions/get-fetch.d.ts +0 -1
  1045. package/packages/_vue3/dist/src/functions/get-processed-block.d.ts +0 -10
  1046. package/packages/_vue3/dist/src/functions/get-react-native-block-styles.d.ts +0 -7
  1047. package/packages/_vue3/dist/src/functions/is-browser.d.ts +0 -1
  1048. package/packages/_vue3/dist/src/functions/is-editing.d.ts +0 -1
  1049. package/packages/_vue3/dist/src/functions/is-iframe.d.ts +0 -1
  1050. package/packages/_vue3/dist/src/functions/is-non-node-server.d.ts +0 -4
  1051. package/packages/_vue3/dist/src/functions/is-previewing.d.ts +0 -1
  1052. package/packages/_vue3/dist/src/functions/register-component.d.ts +0 -15
  1053. package/packages/_vue3/dist/src/functions/register.d.ts +0 -16
  1054. package/packages/_vue3/dist/src/functions/sanitize-react-native-block-styles.d.ts +0 -3
  1055. package/packages/_vue3/dist/src/functions/set-editor-settings.d.ts +0 -4
  1056. package/packages/_vue3/dist/src/functions/set.d.ts +0 -7
  1057. package/packages/_vue3/dist/src/functions/track/helpers.d.ts +0 -5
  1058. package/packages/_vue3/dist/src/functions/track/index.d.ts +0 -51
  1059. package/packages/_vue3/dist/src/functions/track/interaction.d.ts +0 -13
  1060. package/packages/_vue3/dist/src/functions/transform-block-properties.d.ts +0 -2
  1061. package/packages/_vue3/dist/src/functions/transform-block.d.ts +0 -2
  1062. package/packages/_vue3/dist/src/helpers/ab-tests.d.ts +0 -9
  1063. package/packages/_vue3/dist/src/helpers/canTrack.d.ts +0 -1
  1064. package/packages/_vue3/dist/src/helpers/cookie.d.ts +0 -19
  1065. package/packages/_vue3/dist/src/helpers/css.d.ts +0 -7
  1066. package/packages/_vue3/dist/src/helpers/flatten.d.ts +0 -6
  1067. package/packages/_vue3/dist/src/helpers/localStorage.d.ts +0 -9
  1068. package/packages/_vue3/dist/src/helpers/logger.d.ts +0 -6
  1069. package/packages/_vue3/dist/src/helpers/nullable.d.ts +0 -2
  1070. package/packages/_vue3/dist/src/helpers/preview-lru-cache/get.d.ts +0 -2
  1071. package/packages/_vue3/dist/src/helpers/preview-lru-cache/set.d.ts +0 -7
  1072. package/packages/_vue3/dist/src/helpers/sessionId.d.ts +0 -6
  1073. package/packages/_vue3/dist/src/helpers/url.d.ts +0 -6
  1074. package/packages/_vue3/dist/src/helpers/uuid.d.ts +0 -8
  1075. package/packages/_vue3/dist/src/helpers/visitorId.d.ts +0 -6
  1076. package/packages/_vue3/dist/src/index-helpers/blocks-exports.d.ts +0 -111
  1077. package/packages/_vue3/dist/src/index-helpers/top-of-file.d.ts +0 -1
  1078. package/packages/_vue3/dist/src/index.d.ts +0 -7
  1079. package/packages/_vue3/dist/src/scripts/init-editing.d.ts +0 -6
  1080. package/packages/_vue3/dist/src/server-index.d.ts +0 -15
  1081. package/packages/_vue3/dist/src/types/api-version.d.ts +0 -2
  1082. package/packages/_vue3/dist/src/types/builder-block.d.ts +0 -66
  1083. package/packages/_vue3/dist/src/types/builder-content.d.ts +0 -44
  1084. package/packages/_vue3/dist/src/types/builder-props.d.ts +0 -9
  1085. package/packages/_vue3/dist/src/types/can-track.d.ts +0 -3
  1086. package/packages/_vue3/dist/src/types/components.d.ts +0 -111
  1087. package/packages/_vue3/dist/src/types/deep-partial.d.ts +0 -3
  1088. package/packages/_vue3/dist/src/types/element.d.ts +0 -59
  1089. package/packages/_vue3/dist/src/types/enforced-partials.d.ts +0 -21
  1090. package/packages/_vue3/dist/src/types/input.d.ts +0 -121
  1091. package/packages/_vue3/dist/src/types/targets.d.ts +0 -1
  1092. package/packages/_vue3/dist/src/types/typescript.d.ts +0 -11
  1093. package/packages/_vue3/dist/style.css +0 -1
  1094. /package/{packages/_vue2/dist → vue2}/env.d.ts +0 -0
  1095. /package/{packages/_vue3/dist → vue3}/env.d.ts +0 -0
@@ -0,0 +1,1594 @@
1
+ import { BindingTypes } from '../src/types'
2
+ import { compile, assertCode } from './util'
3
+
4
+ describe('SFC compile <script setup>', () => {
5
+ test('should expose top level declarations', () => {
6
+ const { content, bindings } = compile(`
7
+ <script setup>
8
+ import { x } from './x'
9
+ let a = 1
10
+ const b = 2
11
+ function c() {}
12
+ class d {}
13
+ </script>
14
+
15
+ <script>
16
+ import { xx } from './x'
17
+ let aa = 1
18
+ const bb = 2
19
+ function cc() {}
20
+ class dd {}
21
+ </script>
22
+ `)
23
+ expect(content).toMatch('return { aa, bb, cc, dd, a, b, c, d, xx, x }')
24
+ expect(bindings).toStrictEqual({
25
+ x: BindingTypes.SETUP_MAYBE_REF,
26
+ a: BindingTypes.SETUP_LET,
27
+ b: BindingTypes.SETUP_CONST,
28
+ c: BindingTypes.SETUP_CONST,
29
+ d: BindingTypes.SETUP_CONST,
30
+ xx: BindingTypes.SETUP_MAYBE_REF,
31
+ aa: BindingTypes.SETUP_LET,
32
+ bb: BindingTypes.SETUP_CONST,
33
+ cc: BindingTypes.SETUP_CONST,
34
+ dd: BindingTypes.SETUP_CONST
35
+ })
36
+ assertCode(content)
37
+ })
38
+
39
+ test('binding analysis for destructure', () => {
40
+ const { content, bindings } = compile(`
41
+ <script setup>
42
+ const { foo, b: bar, ['x' + 'y']: baz, x: { y, zz: { z }}} = {}
43
+ </script>
44
+ `)
45
+ expect(content).toMatch('return { foo, bar, baz, y, z }')
46
+ expect(bindings).toStrictEqual({
47
+ foo: BindingTypes.SETUP_MAYBE_REF,
48
+ bar: BindingTypes.SETUP_MAYBE_REF,
49
+ baz: BindingTypes.SETUP_MAYBE_REF,
50
+ y: BindingTypes.SETUP_MAYBE_REF,
51
+ z: BindingTypes.SETUP_MAYBE_REF
52
+ })
53
+ assertCode(content)
54
+ })
55
+
56
+ test('defineProps()', () => {
57
+ const { content, bindings } = compile(`
58
+ <script setup>
59
+ const props = defineProps({
60
+ foo: String
61
+ })
62
+ const bar = 1
63
+ </script>
64
+ `)
65
+ // should generate working code
66
+ assertCode(content)
67
+ // should analyze bindings
68
+ expect(bindings).toStrictEqual({
69
+ foo: BindingTypes.PROPS,
70
+ bar: BindingTypes.SETUP_CONST,
71
+ props: BindingTypes.SETUP_REACTIVE_CONST
72
+ })
73
+
74
+ // should remove defineOptions import and call
75
+ expect(content).not.toMatch('defineProps')
76
+ // should generate correct setup signature
77
+ expect(content).toMatch(`setup(__props) {`)
78
+ // should assign user identifier to it
79
+ expect(content).toMatch(`const props = __props`)
80
+ // should include context options in default export
81
+ expect(content).toMatch(`export default {
82
+ props: {
83
+ foo: String
84
+ },`)
85
+ })
86
+
87
+ test('defineProps w/ external definition', () => {
88
+ const { content } = compile(`
89
+ <script setup>
90
+ import { propsModel } from './props'
91
+ const props = defineProps(propsModel)
92
+ </script>
93
+ `)
94
+ assertCode(content)
95
+ expect(content).toMatch(`export default {
96
+ props: propsModel,`)
97
+ })
98
+
99
+ // #4764
100
+ test('defineProps w/ leading code', () => {
101
+ const { content } = compile(`
102
+ <script setup>import { x } from './x'
103
+ const props = defineProps({})
104
+ </script>
105
+ `)
106
+ // props declaration should be inside setup, not moved along with the import
107
+ expect(content).not.toMatch(`const props = __props\nimport`)
108
+ assertCode(content)
109
+ })
110
+
111
+ test('defineEmits()', () => {
112
+ const { content, bindings } = compile(`
113
+ <script setup>
114
+ const myEmit = defineEmits(['foo', 'bar'])
115
+ </script>
116
+ `)
117
+ assertCode(content)
118
+ expect(bindings).toStrictEqual({
119
+ myEmit: BindingTypes.SETUP_CONST
120
+ })
121
+ // should remove defineOptions import and call
122
+ expect(content).not.toMatch('defineEmits')
123
+ // should generate correct setup signature
124
+ expect(content).toMatch(`setup(__props, { emit: myEmit }) {`)
125
+ // should include context options in default export
126
+ expect(content).toMatch(`export default {
127
+ emits: ['foo', 'bar'],`)
128
+ })
129
+
130
+ test('defineProps/defineEmits in multi-variable declaration', () => {
131
+ const { content } = compile(`
132
+ <script setup>
133
+ const props = defineProps(['item']),
134
+ a = 1,
135
+ emit = defineEmits(['a']);
136
+ </script>
137
+ `)
138
+ assertCode(content)
139
+ expect(content).toMatch(`const a = 1;`) // test correct removal
140
+ expect(content).toMatch(`props: ['item'],`)
141
+ expect(content).toMatch(`emits: ['a'],`)
142
+ })
143
+
144
+ test('defineProps/defineEmits in multi-variable declaration (full removal)', () => {
145
+ const { content } = compile(`
146
+ <script setup>
147
+ const props = defineProps(['item']),
148
+ emit = defineEmits(['a']);
149
+ </script>
150
+ `)
151
+ assertCode(content)
152
+ expect(content).toMatch(`props: ['item'],`)
153
+ expect(content).toMatch(`emits: ['a'],`)
154
+ })
155
+
156
+ test('defineExpose()', () => {
157
+ const { content } = compile(`
158
+ <script setup>
159
+ defineExpose({ foo: 123 })
160
+ </script>
161
+ `)
162
+ assertCode(content)
163
+ // should remove defineOptions import and call
164
+ expect(content).not.toMatch('defineExpose')
165
+ // should generate correct setup signature
166
+ expect(content).toMatch(`setup(__props, { expose }) {`)
167
+ // should replace callee
168
+ expect(content).toMatch(/\bexpose\(\{ foo: 123 \}\)/)
169
+ })
170
+
171
+ test('<script> after <script setup> the script content not end with `\\n`', () => {
172
+ const { content } = compile(`
173
+ <script setup>
174
+ import { x } from './x'
175
+ </script>
176
+ <script>const n = 1</script>
177
+ `)
178
+ assertCode(content)
179
+ })
180
+
181
+ describe('<script> and <script setup> co-usage', () => {
182
+ test('script first', () => {
183
+ const { content } = compile(`
184
+ <script>
185
+ export const n = 1
186
+
187
+ export default {}
188
+ </script>
189
+ <script setup>
190
+ import { x } from './x'
191
+ x()
192
+ </script>
193
+ `)
194
+ assertCode(content)
195
+ })
196
+
197
+ test('script setup first', () => {
198
+ const { content } = compile(`
199
+ <script setup>
200
+ import { x } from './x'
201
+ x()
202
+ </script>
203
+ <script>
204
+ export const n = 1
205
+ export default {}
206
+ </script>
207
+ `)
208
+ assertCode(content)
209
+ })
210
+
211
+ test('script setup first, named default export', () => {
212
+ const { content } = compile(`
213
+ <script setup>
214
+ import { x } from './x'
215
+ x()
216
+ </script>
217
+ <script>
218
+ export const n = 1
219
+ const def = {}
220
+ export { def as default }
221
+ </script>
222
+ `)
223
+ assertCode(content)
224
+ })
225
+
226
+ // #4395
227
+ test('script setup first, lang="ts", script block content export default', () => {
228
+ const { content } = compile(`
229
+ <script setup lang="ts">
230
+ import { x } from './x'
231
+ x()
232
+ </script>
233
+ <script lang="ts">
234
+ export default {
235
+ name: "test"
236
+ }
237
+ </script>
238
+ `)
239
+ // ensure __default__ is declared before used
240
+ expect(content).toMatch(/const __default__[\S\s]*\.\.\.__default__/m)
241
+ assertCode(content)
242
+ })
243
+
244
+ describe('spaces in ExportDefaultDeclaration node', () => {
245
+ // #4371
246
+ test('with many spaces and newline', () => {
247
+ // #4371
248
+ const { content } = compile(`
249
+ <script>
250
+ export const n = 1
251
+ export default
252
+ {
253
+ some:'option'
254
+ }
255
+ </script>
256
+ <script setup>
257
+ import { x } from './x'
258
+ x()
259
+ </script>
260
+ `)
261
+ assertCode(content)
262
+ })
263
+
264
+ test('with minimal spaces', () => {
265
+ const { content } = compile(`
266
+ <script>
267
+ export const n = 1
268
+ export default{
269
+ some:'option'
270
+ }
271
+ </script>
272
+ <script setup>
273
+ import { x } from './x'
274
+ x()
275
+ </script>
276
+ `)
277
+ assertCode(content)
278
+ })
279
+ })
280
+ })
281
+
282
+ describe('imports', () => {
283
+ test('should hoist and expose imports', () => {
284
+ assertCode(
285
+ compile(`<script setup>
286
+ import { ref } from 'vue'
287
+ import 'foo/css'
288
+ </script>`).content
289
+ )
290
+ })
291
+
292
+ test('should extract comment for import or type declarations', () => {
293
+ assertCode(
294
+ compile(`
295
+ <script setup>
296
+ import a from 'a' // comment
297
+ import b from 'b'
298
+ </script>
299
+ `).content
300
+ )
301
+ })
302
+
303
+ // #2740
304
+ test('should allow defineProps/Emit at the start of imports', () => {
305
+ assertCode(
306
+ compile(`<script setup>
307
+ import { ref } from 'vue'
308
+ defineProps(['foo'])
309
+ defineEmits(['bar'])
310
+ const r = ref(0)
311
+ </script>`).content
312
+ )
313
+ })
314
+
315
+ test('import dedupe between <script> and <script setup>', () => {
316
+ const { content } = compile(`
317
+ <script>
318
+ import { x } from './x'
319
+ </script>
320
+ <script setup>
321
+ import { x } from './x'
322
+ x()
323
+ </script>
324
+ `)
325
+ assertCode(content)
326
+ expect(content.indexOf(`import { x }`)).toEqual(
327
+ content.lastIndexOf(`import { x }`)
328
+ )
329
+ })
330
+ })
331
+
332
+ // in dev mode, declared bindings are returned as an object from setup()
333
+ // when using TS, users may import types which should not be returned as
334
+ // values, so we need to check import usage in the template to determine
335
+ // what to be returned.
336
+ describe('dev mode import usage check', () => {
337
+ test('components', () => {
338
+ const { content } = compile(`
339
+ <script setup lang="ts">
340
+ import { FooBar, FooBaz, FooQux, foo } from './x'
341
+ const fooBar: FooBar = 1
342
+ </script>
343
+ <template>
344
+ <FooBaz></FooBaz>
345
+ <foo-qux/>
346
+ <foo/>
347
+ FooBar
348
+ </template>
349
+ `)
350
+ // FooBar: should not be matched by plain text or incorrect case
351
+ // FooBaz: used as PascalCase component
352
+ // FooQux: used as kebab-case component
353
+ // foo: lowercase component
354
+ expect(content).toMatch(`return { fooBar, FooBaz, FooQux, foo }`)
355
+ assertCode(content)
356
+ })
357
+
358
+ test('directive', () => {
359
+ const { content } = compile(`
360
+ <script setup lang="ts">
361
+ import { vMyDir } from './x'
362
+ </script>
363
+ <template>
364
+ <div v-my-dir></div>
365
+ </template>
366
+ `)
367
+ expect(content).toMatch(`return { vMyDir }`)
368
+ assertCode(content)
369
+ })
370
+
371
+ // https://github.com/vuejs/core/issues/4599
372
+ test('attribute expressions', () => {
373
+ const { content } = compile(`
374
+ <script setup lang="ts">
375
+ import { bar, baz } from './x'
376
+ const cond = true
377
+ </script>
378
+ <template>
379
+ <div :class="[cond ? '' : bar(), 'default']" :style="baz"></div>
380
+ </template>
381
+ `)
382
+ expect(content).toMatch(`return { cond, bar, baz }`)
383
+ assertCode(content)
384
+ })
385
+
386
+ test('vue interpolations', () => {
387
+ const { content } = compile(`
388
+ <script setup lang="ts">
389
+ import { x, y, z, x$y } from './x'
390
+ </script>
391
+ <template>
392
+ <div :id="z + 'y'">{{ x }} {{ yy }} {{ x$y }}</div>
393
+ </template>
394
+ `)
395
+ // x: used in interpolation
396
+ // y: should not be matched by {{ yy }} or 'y' in binding exps
397
+ // x$y: #4274 should escape special chars when creating Regex
398
+ expect(content).toMatch(`return { x, z, x$y }`)
399
+ assertCode(content)
400
+ })
401
+
402
+ // #4340 interpolations in template strings
403
+ test('js template string interpolations', () => {
404
+ const { content } = compile(`
405
+ <script setup lang="ts">
406
+ import { VAR, VAR2, VAR3 } from './x'
407
+ </script>
408
+ <template>
409
+ {{ \`\${VAR}VAR2\${VAR3}\` }}
410
+ </template>
411
+ `)
412
+ // VAR2 should not be matched
413
+ expect(content).toMatch(`return { VAR, VAR3 }`)
414
+ assertCode(content)
415
+ })
416
+
417
+ // edge case: last tag in template
418
+ test('last tag', () => {
419
+ const { content } = compile(`
420
+ <script setup lang="ts">
421
+ import { FooBaz, Last } from './x'
422
+ </script>
423
+ <template>
424
+ <FooBaz></FooBaz>
425
+ <Last/>
426
+ </template>
427
+ `)
428
+ expect(content).toMatch(`return { FooBaz, Last }`)
429
+ assertCode(content)
430
+ })
431
+
432
+ test('TS annotations', () => {
433
+ const { content } = compile(`
434
+ <script setup lang="ts">
435
+ import { Foo, Baz, Qux, Fred } from './x'
436
+ const a = 1
437
+ function b() {}
438
+ </script>
439
+ <template>
440
+ {{ a as Foo }}
441
+ {{ Baz }}
442
+ <Comp v-slot="{ data }: Qux">{{ data }}</Comp>
443
+ <div v-for="{ z = x as Qux } in list as Fred"/>
444
+ </template>
445
+ `)
446
+
447
+ expect(content).toMatch(`return { a, b, Baz }`)
448
+ assertCode(content)
449
+ })
450
+ })
451
+
452
+ // describe('inlineTemplate mode', () => {
453
+ // test('should work', () => {
454
+ // const { content } = compile(
455
+ // `
456
+ // <script setup>
457
+ // import { ref } from 'vue'
458
+ // const count = ref(0)
459
+ // </script>
460
+ // <template>
461
+ // <div>{{ count }}</div>
462
+ // <div>static</div>
463
+ // </template>
464
+ // `,
465
+ // { inlineTemplate: true }
466
+ // )
467
+ // // check snapshot and make sure helper imports and
468
+ // // hoists are placed correctly.
469
+ // assertCode(content)
470
+ // // in inline mode, no need to call expose() since nothing is exposed
471
+ // // anyway!
472
+ // expect(content).not.toMatch(`expose()`)
473
+ // })
474
+
475
+ // test('with defineExpose()', () => {
476
+ // const { content } = compile(
477
+ // `
478
+ // <script setup>
479
+ // const count = ref(0)
480
+ // defineExpose({ count })
481
+ // </script>
482
+ // `,
483
+ // { inlineTemplate: true }
484
+ // )
485
+ // assertCode(content)
486
+ // expect(content).toMatch(`setup(__props, { expose })`)
487
+ // expect(content).toMatch(`expose({ count })`)
488
+ // })
489
+
490
+ // test('referencing scope components and directives', () => {
491
+ // const { content } = compile(
492
+ // `
493
+ // <script setup>
494
+ // import ChildComp from './Child.vue'
495
+ // import SomeOtherComp from './Other.vue'
496
+ // import vMyDir from './my-dir'
497
+ // </script>
498
+ // <template>
499
+ // <div v-my-dir></div>
500
+ // <ChildComp/>
501
+ // <some-other-comp/>
502
+ // </template>
503
+ // `,
504
+ // { inlineTemplate: true }
505
+ // )
506
+ // expect(content).toMatch('[_unref(vMyDir)]')
507
+ // expect(content).toMatch('_createVNode(ChildComp)')
508
+ // // kebab-case component support
509
+ // expect(content).toMatch('_createVNode(SomeOtherComp)')
510
+ // assertCode(content)
511
+ // })
512
+
513
+ // test('avoid unref() when necessary', () => {
514
+ // // function, const, component import
515
+ // const { content } = compile(
516
+ // `<script setup>
517
+ // import { ref } from 'vue'
518
+ // import Foo, { bar } from './Foo.vue'
519
+ // import other from './util'
520
+ // import * as tree from './tree'
521
+ // const count = ref(0)
522
+ // const constant = {}
523
+ // const maybe = foo()
524
+ // let lett = 1
525
+ // function fn() {}
526
+ // </script>
527
+ // <template>
528
+ // <Foo>{{ bar }}</Foo>
529
+ // <div @click="fn">{{ count }} {{ constant }} {{ maybe }} {{ lett }} {{ other }}</div>
530
+ // {{ tree.foo() }}
531
+ // </template>
532
+ // `,
533
+ // { inlineTemplate: true }
534
+ // )
535
+ // // no need to unref vue component import
536
+ // expect(content).toMatch(`createVNode(Foo,`)
537
+ // // #2699 should unref named imports from .vue
538
+ // expect(content).toMatch(`unref(bar)`)
539
+ // // should unref other imports
540
+ // expect(content).toMatch(`unref(other)`)
541
+ // // no need to unref constant literals
542
+ // expect(content).not.toMatch(`unref(constant)`)
543
+ // // should directly use .value for known refs
544
+ // expect(content).toMatch(`count.value`)
545
+ // // should unref() on const bindings that may be refs
546
+ // expect(content).toMatch(`unref(maybe)`)
547
+ // // should unref() on let bindings
548
+ // expect(content).toMatch(`unref(lett)`)
549
+ // // no need to unref namespace import (this also preserves tree-shaking)
550
+ // expect(content).toMatch(`tree.foo()`)
551
+ // // no need to unref function declarations
552
+ // expect(content).toMatch(`{ onClick: fn }`)
553
+ // // no need to mark constant fns in patch flag
554
+ // expect(content).not.toMatch(`PROPS`)
555
+ // assertCode(content)
556
+ // })
557
+
558
+ // test('v-model codegen', () => {
559
+ // const { content } = compile(
560
+ // `<script setup>
561
+ // import { ref } from 'vue'
562
+ // const count = ref(0)
563
+ // const maybe = foo()
564
+ // let lett = 1
565
+ // </script>
566
+ // <template>
567
+ // <input v-model="count">
568
+ // <input v-model="maybe">
569
+ // <input v-model="lett">
570
+ // </template>
571
+ // `,
572
+ // { inlineTemplate: true }
573
+ // )
574
+ // // known const ref: set value
575
+ // expect(content).toMatch(`(count).value = $event`)
576
+ // // const but maybe ref: assign if ref, otherwise do nothing
577
+ // expect(content).toMatch(`_isRef(maybe) ? (maybe).value = $event : null`)
578
+ // // let: handle both cases
579
+ // expect(content).toMatch(
580
+ // `_isRef(lett) ? (lett).value = $event : lett = $event`
581
+ // )
582
+ // assertCode(content)
583
+ // })
584
+
585
+ // test('template assignment expression codegen', () => {
586
+ // const { content } = compile(
587
+ // `<script setup>
588
+ // import { ref } from 'vue'
589
+ // const count = ref(0)
590
+ // const maybe = foo()
591
+ // let lett = 1
592
+ // let v = ref(1)
593
+ // </script>
594
+ // <template>
595
+ // <div @click="count = 1"/>
596
+ // <div @click="maybe = count"/>
597
+ // <div @click="lett = count"/>
598
+ // <div @click="v += 1"/>
599
+ // <div @click="v -= 1"/>
600
+ // <div @click="() => {
601
+ // let a = '' + lett
602
+ // v = a
603
+ // }"/>
604
+ // <div @click="() => {
605
+ // // nested scopes
606
+ // (()=>{
607
+ // let x = a
608
+ // (()=>{
609
+ // let z = x
610
+ // let z2 = z
611
+ // })
612
+ // let lz = z
613
+ // })
614
+ // v = a
615
+ // }"/>
616
+ // </template>
617
+ // `,
618
+ // { inlineTemplate: true }
619
+ // )
620
+ // // known const ref: set value
621
+ // expect(content).toMatch(`count.value = 1`)
622
+ // // const but maybe ref: only assign after check
623
+ // expect(content).toMatch(`maybe.value = count.value`)
624
+ // // let: handle both cases
625
+ // expect(content).toMatch(
626
+ // `_isRef(lett) ? lett.value = count.value : lett = count.value`
627
+ // )
628
+ // expect(content).toMatch(`_isRef(v) ? v.value += 1 : v += 1`)
629
+ // expect(content).toMatch(`_isRef(v) ? v.value -= 1 : v -= 1`)
630
+ // expect(content).toMatch(`_isRef(v) ? v.value = a : v = a`)
631
+ // expect(content).toMatch(`_isRef(v) ? v.value = _ctx.a : v = _ctx.a`)
632
+ // assertCode(content)
633
+ // })
634
+
635
+ // test('template update expression codegen', () => {
636
+ // const { content } = compile(
637
+ // `<script setup>
638
+ // import { ref } from 'vue'
639
+ // const count = ref(0)
640
+ // const maybe = foo()
641
+ // let lett = 1
642
+ // </script>
643
+ // <template>
644
+ // <div @click="count++"/>
645
+ // <div @click="--count"/>
646
+ // <div @click="maybe++"/>
647
+ // <div @click="--maybe"/>
648
+ // <div @click="lett++"/>
649
+ // <div @click="--lett"/>
650
+ // </template>
651
+ // `,
652
+ // { inlineTemplate: true }
653
+ // )
654
+ // // known const ref: set value
655
+ // expect(content).toMatch(`count.value++`)
656
+ // expect(content).toMatch(`--count.value`)
657
+ // // const but maybe ref (non-ref case ignored)
658
+ // expect(content).toMatch(`maybe.value++`)
659
+ // expect(content).toMatch(`--maybe.value`)
660
+ // // let: handle both cases
661
+ // expect(content).toMatch(`_isRef(lett) ? lett.value++ : lett++`)
662
+ // expect(content).toMatch(`_isRef(lett) ? --lett.value : --lett`)
663
+ // assertCode(content)
664
+ // })
665
+
666
+ // test('template destructure assignment codegen', () => {
667
+ // const { content } = compile(
668
+ // `<script setup>
669
+ // import { ref } from 'vue'
670
+ // const val = {}
671
+ // const count = ref(0)
672
+ // const maybe = foo()
673
+ // let lett = 1
674
+ // </script>
675
+ // <template>
676
+ // <div @click="({ count } = val)"/>
677
+ // <div @click="[maybe] = val"/>
678
+ // <div @click="({ lett } = val)"/>
679
+ // </template>
680
+ // `,
681
+ // { inlineTemplate: true }
682
+ // )
683
+ // // known const ref: set value
684
+ // expect(content).toMatch(`({ count: count.value } = val)`)
685
+ // // const but maybe ref (non-ref case ignored)
686
+ // expect(content).toMatch(`[maybe.value] = val`)
687
+ // // let: assumes non-ref
688
+ // expect(content).toMatch(`{ lett: lett } = val`)
689
+ // assertCode(content)
690
+ // })
691
+
692
+ // test('ssr codegen', () => {
693
+ // const { content } = compile(
694
+ // `
695
+ // <script setup>
696
+ // import { ref } from 'vue'
697
+ // const count = ref(0)
698
+ // </script>
699
+ // <template>
700
+ // <div>{{ count }}</div>
701
+ // <div>static</div>
702
+ // </template>
703
+ // <style>
704
+ // div { color: v-bind(count) }
705
+ // </style>
706
+ // `,
707
+ // {
708
+ // inlineTemplate: true,
709
+ // templateOptions: {
710
+ // ssr: true
711
+ // }
712
+ // }
713
+ // )
714
+ // expect(content).toMatch(`\n __ssrInlineRender: true,\n`)
715
+ // expect(content).toMatch(`return (_ctx, _push`)
716
+ // expect(content).toMatch(`ssrInterpolate`)
717
+ // expect(content).not.toMatch(`useCssVars`)
718
+ // expect(content).toMatch(`"--${mockId}-count": (count.value)`)
719
+ // assertCode(content)
720
+ // })
721
+ // })
722
+
723
+ describe('with TypeScript', () => {
724
+ test('hoist type declarations', () => {
725
+ const { content } = compile(`
726
+ <script setup lang="ts">
727
+ export interface Foo {}
728
+ type Bar = {}
729
+ </script>`)
730
+ assertCode(content)
731
+ })
732
+
733
+ test('defineProps/Emit w/ runtime options', () => {
734
+ const { content } = compile(`
735
+ <script setup lang="ts">
736
+ const props = defineProps({ foo: String })
737
+ const emit = defineEmits(['a', 'b'])
738
+ </script>
739
+ `)
740
+ assertCode(content)
741
+ expect(content).toMatch(`export default /*#__PURE__*/_defineComponent({
742
+ props: { foo: String },
743
+ emits: ['a', 'b'],
744
+ setup(__props, { emit }) {`)
745
+ })
746
+
747
+ test('defineProps w/ type', () => {
748
+ const { content, bindings } = compile(`
749
+ <script setup lang="ts">
750
+ interface Test {}
751
+
752
+ type Alias = number[]
753
+
754
+ defineProps<{
755
+ string: string
756
+ number: number
757
+ boolean: boolean
758
+ object: object
759
+ objectLiteral: { a: number }
760
+ fn: (n: number) => void
761
+ functionRef: Function
762
+ objectRef: Object
763
+ dateTime: Date
764
+ array: string[]
765
+ arrayRef: Array<any>
766
+ tuple: [number, number]
767
+ set: Set<string>
768
+ literal: 'foo'
769
+ optional?: any
770
+ recordRef: Record<string, null>
771
+ interface: Test
772
+ alias: Alias
773
+ method(): void
774
+ symbol: symbol
775
+
776
+ union: string | number
777
+ literalUnion: 'foo' | 'bar'
778
+ literalUnionNumber: 1 | 2 | 3 | 4 | 5
779
+ literalUnionMixed: 'foo' | 1 | boolean
780
+ intersection: Test & {}
781
+ foo: ((item: any) => boolean) | null
782
+ }>()
783
+ </script>`)
784
+ assertCode(content)
785
+ expect(content).toMatch(`string: { type: String, required: true }`)
786
+ expect(content).toMatch(`number: { type: Number, required: true }`)
787
+ expect(content).toMatch(`boolean: { type: Boolean, required: true }`)
788
+ expect(content).toMatch(`object: { type: Object, required: true }`)
789
+ expect(content).toMatch(`objectLiteral: { type: Object, required: true }`)
790
+ expect(content).toMatch(`fn: { type: Function, required: true }`)
791
+ expect(content).toMatch(`functionRef: { type: Function, required: true }`)
792
+ expect(content).toMatch(`objectRef: { type: Object, required: true }`)
793
+ expect(content).toMatch(`dateTime: { type: Date, required: true }`)
794
+ expect(content).toMatch(`array: { type: Array, required: true }`)
795
+ expect(content).toMatch(`arrayRef: { type: Array, required: true }`)
796
+ expect(content).toMatch(`tuple: { type: Array, required: true }`)
797
+ expect(content).toMatch(`set: { type: Set, required: true }`)
798
+ expect(content).toMatch(`literal: { type: String, required: true }`)
799
+ expect(content).toMatch(`optional: { type: null, required: false }`)
800
+ expect(content).toMatch(`recordRef: { type: Object, required: true }`)
801
+ expect(content).toMatch(`interface: { type: Object, required: true }`)
802
+ expect(content).toMatch(`alias: { type: Array, required: true }`)
803
+ expect(content).toMatch(`method: { type: Function, required: true }`)
804
+ expect(content).toMatch(`symbol: { type: Symbol, required: true }`)
805
+ expect(content).toMatch(
806
+ `union: { type: [String, Number], required: true }`
807
+ )
808
+ expect(content).toMatch(`literalUnion: { type: String, required: true }`)
809
+ expect(content).toMatch(
810
+ `literalUnionNumber: { type: Number, required: true }`
811
+ )
812
+ expect(content).toMatch(
813
+ `literalUnionMixed: { type: [String, Number, Boolean], required: true }`
814
+ )
815
+ expect(content).toMatch(`intersection: { type: Object, required: true }`)
816
+ expect(content).toMatch(`foo: { type: [Function, null], required: true }`)
817
+ expect(bindings).toStrictEqual({
818
+ string: BindingTypes.PROPS,
819
+ number: BindingTypes.PROPS,
820
+ boolean: BindingTypes.PROPS,
821
+ object: BindingTypes.PROPS,
822
+ objectLiteral: BindingTypes.PROPS,
823
+ fn: BindingTypes.PROPS,
824
+ functionRef: BindingTypes.PROPS,
825
+ objectRef: BindingTypes.PROPS,
826
+ dateTime: BindingTypes.PROPS,
827
+ array: BindingTypes.PROPS,
828
+ arrayRef: BindingTypes.PROPS,
829
+ tuple: BindingTypes.PROPS,
830
+ set: BindingTypes.PROPS,
831
+ literal: BindingTypes.PROPS,
832
+ optional: BindingTypes.PROPS,
833
+ recordRef: BindingTypes.PROPS,
834
+ interface: BindingTypes.PROPS,
835
+ alias: BindingTypes.PROPS,
836
+ method: BindingTypes.PROPS,
837
+ symbol: BindingTypes.PROPS,
838
+ union: BindingTypes.PROPS,
839
+ literalUnion: BindingTypes.PROPS,
840
+ literalUnionNumber: BindingTypes.PROPS,
841
+ literalUnionMixed: BindingTypes.PROPS,
842
+ intersection: BindingTypes.PROPS,
843
+ foo: BindingTypes.PROPS
844
+ })
845
+ })
846
+
847
+ test('defineProps w/ interface', () => {
848
+ const { content, bindings } = compile(`
849
+ <script setup lang="ts">
850
+ interface Props { x?: number }
851
+ defineProps<Props>()
852
+ </script>
853
+ `)
854
+ assertCode(content)
855
+ expect(content).toMatch(`x: { type: Number, required: false }`)
856
+ expect(bindings).toStrictEqual({
857
+ x: BindingTypes.PROPS
858
+ })
859
+ })
860
+
861
+ test('defineProps w/ exported interface', () => {
862
+ const { content, bindings } = compile(`
863
+ <script setup lang="ts">
864
+ export interface Props { x?: number }
865
+ defineProps<Props>()
866
+ </script>
867
+ `)
868
+ assertCode(content)
869
+ expect(content).toMatch(`x: { type: Number, required: false }`)
870
+ expect(bindings).toStrictEqual({
871
+ x: BindingTypes.PROPS
872
+ })
873
+ })
874
+
875
+ test('defineProps w/ exported interface in normal script', () => {
876
+ const { content, bindings } = compile(`
877
+ <script lang="ts">
878
+ export interface Props { x?: number }
879
+ </script>
880
+ <script setup lang="ts">
881
+ defineProps<Props>()
882
+ </script>
883
+ `)
884
+ assertCode(content)
885
+ expect(content).toMatch(`x: { type: Number, required: false }`)
886
+ expect(bindings).toStrictEqual({
887
+ x: BindingTypes.PROPS
888
+ })
889
+ })
890
+
891
+ test('defineProps w/ type alias', () => {
892
+ const { content, bindings } = compile(`
893
+ <script setup lang="ts">
894
+ type Props = { x?: number }
895
+ defineProps<Props>()
896
+ </script>
897
+ `)
898
+ assertCode(content)
899
+ expect(content).toMatch(`x: { type: Number, required: false }`)
900
+ expect(bindings).toStrictEqual({
901
+ x: BindingTypes.PROPS
902
+ })
903
+ })
904
+
905
+ test('defineProps w/ exported type alias', () => {
906
+ const { content, bindings } = compile(`
907
+ <script setup lang="ts">
908
+ export type Props = { x?: number }
909
+ defineProps<Props>()
910
+ </script>
911
+ `)
912
+ assertCode(content)
913
+ expect(content).toMatch(`x: { type: Number, required: false }`)
914
+ expect(bindings).toStrictEqual({
915
+ x: BindingTypes.PROPS
916
+ })
917
+ })
918
+
919
+ test('withDefaults (static)', () => {
920
+ const { content, bindings } = compile(`
921
+ <script setup lang="ts">
922
+ const props = withDefaults(defineProps<{
923
+ foo?: string
924
+ bar?: number;
925
+ baz: boolean;
926
+ qux?(): number
927
+ }>(), {
928
+ foo: 'hi',
929
+ qux() { return 1 }
930
+ })
931
+ </script>
932
+ `)
933
+ assertCode(content)
934
+ expect(content).toMatch(
935
+ `foo: { type: String, required: false, default: 'hi' }`
936
+ )
937
+ expect(content).toMatch(`bar: { type: Number, required: false }`)
938
+ expect(content).toMatch(`baz: { type: Boolean, required: true }`)
939
+ expect(content).toMatch(
940
+ `qux: { type: Function, required: false, default() { return 1 } }`
941
+ )
942
+ expect(content).toMatch(
943
+ `{ foo: string, bar?: number, baz: boolean, qux(): number }`
944
+ )
945
+ expect(content).toMatch(`const props = __props`)
946
+ expect(bindings).toStrictEqual({
947
+ foo: BindingTypes.PROPS,
948
+ bar: BindingTypes.PROPS,
949
+ baz: BindingTypes.PROPS,
950
+ qux: BindingTypes.PROPS,
951
+ props: BindingTypes.SETUP_CONST
952
+ })
953
+ })
954
+
955
+ test('withDefaults (dynamic)', () => {
956
+ const { content } = compile(`
957
+ <script setup lang="ts">
958
+ import { defaults } from './foo'
959
+ const props = withDefaults(defineProps<{
960
+ foo?: string
961
+ bar?: number
962
+ baz: boolean
963
+ }>(), { ...defaults })
964
+ </script>
965
+ `)
966
+ assertCode(content)
967
+ expect(content).toMatch(`import { mergeDefaults as _mergeDefaults`)
968
+ expect(content).toMatch(
969
+ `
970
+ _mergeDefaults({
971
+ foo: { type: String, required: false },
972
+ bar: { type: Number, required: false },
973
+ baz: { type: Boolean, required: true }
974
+ }, { ...defaults })`.trim()
975
+ )
976
+ })
977
+
978
+ test('defineEmits w/ type', () => {
979
+ const { content } = compile(`
980
+ <script setup lang="ts">
981
+ const emit = defineEmits<(e: 'foo' | 'bar') => void>()
982
+ </script>
983
+ `)
984
+ assertCode(content)
985
+ expect(content).toMatch(`emit: ((e: 'foo' | 'bar') => void),`)
986
+ expect(content).toMatch(`emits: ["foo", "bar"]`)
987
+ })
988
+
989
+ test('defineEmits w/ type (union)', () => {
990
+ const type = `((e: 'foo' | 'bar') => void) | ((e: 'baz', id: number) => void)`
991
+ expect(() =>
992
+ compile(`
993
+ <script setup lang="ts">
994
+ const emit = defineEmits<${type}>()
995
+ </script>
996
+ `)
997
+ ).toThrow()
998
+ })
999
+
1000
+ test('defineEmits w/ type (type literal w/ call signatures)', () => {
1001
+ const type = `{(e: 'foo' | 'bar'): void; (e: 'baz', id: number): void;}`
1002
+ const { content } = compile(`
1003
+ <script setup lang="ts">
1004
+ const emit = defineEmits<${type}>()
1005
+ </script>
1006
+ `)
1007
+ assertCode(content)
1008
+ expect(content).toMatch(`emit: (${type}),`)
1009
+ expect(content).toMatch(`emits: ["foo", "bar", "baz"]`)
1010
+ })
1011
+
1012
+ test('defineEmits w/ type (interface)', () => {
1013
+ const { content } = compile(`
1014
+ <script setup lang="ts">
1015
+ interface Emits { (e: 'foo' | 'bar'): void }
1016
+ const emit = defineEmits<Emits>()
1017
+ </script>
1018
+ `)
1019
+ assertCode(content)
1020
+ expect(content).toMatch(`emit: ({ (e: 'foo' | 'bar'): void }),`)
1021
+ expect(content).toMatch(`emits: ["foo", "bar"]`)
1022
+ })
1023
+
1024
+ test('defineEmits w/ type (exported interface)', () => {
1025
+ const { content } = compile(`
1026
+ <script setup lang="ts">
1027
+ export interface Emits { (e: 'foo' | 'bar'): void }
1028
+ const emit = defineEmits<Emits>()
1029
+ </script>
1030
+ `)
1031
+ assertCode(content)
1032
+ expect(content).toMatch(`emit: ({ (e: 'foo' | 'bar'): void }),`)
1033
+ expect(content).toMatch(`emits: ["foo", "bar"]`)
1034
+ })
1035
+
1036
+ test('defineEmits w/ type (type alias)', () => {
1037
+ const { content } = compile(`
1038
+ <script setup lang="ts">
1039
+ type Emits = { (e: 'foo' | 'bar'): void }
1040
+ const emit = defineEmits<Emits>()
1041
+ </script>
1042
+ `)
1043
+ assertCode(content)
1044
+ expect(content).toMatch(`emit: ({ (e: 'foo' | 'bar'): void }),`)
1045
+ expect(content).toMatch(`emits: ["foo", "bar"]`)
1046
+ })
1047
+
1048
+ test('defineEmits w/ type (exported type alias)', () => {
1049
+ const { content } = compile(`
1050
+ <script setup lang="ts">
1051
+ export type Emits = { (e: 'foo' | 'bar'): void }
1052
+ const emit = defineEmits<Emits>()
1053
+ </script>
1054
+ `)
1055
+ assertCode(content)
1056
+ expect(content).toMatch(`emit: ({ (e: 'foo' | 'bar'): void }),`)
1057
+ expect(content).toMatch(`emits: ["foo", "bar"]`)
1058
+ })
1059
+
1060
+ test('defineEmits w/ type (referenced function type)', () => {
1061
+ const { content } = compile(`
1062
+ <script setup lang="ts">
1063
+ type Emits = (e: 'foo' | 'bar') => void
1064
+ const emit = defineEmits<Emits>()
1065
+ </script>
1066
+ `)
1067
+ assertCode(content)
1068
+ expect(content).toMatch(`emit: ((e: 'foo' | 'bar') => void),`)
1069
+ expect(content).toMatch(`emits: ["foo", "bar"]`)
1070
+ })
1071
+
1072
+ test('defineEmits w/ type (referenced exported function type)', () => {
1073
+ const { content } = compile(`
1074
+ <script setup lang="ts">
1075
+ export type Emits = (e: 'foo' | 'bar') => void
1076
+ const emit = defineEmits<Emits>()
1077
+ </script>
1078
+ `)
1079
+ assertCode(content)
1080
+ expect(content).toMatch(`emit: ((e: 'foo' | 'bar') => void),`)
1081
+ expect(content).toMatch(`emits: ["foo", "bar"]`)
1082
+ })
1083
+
1084
+ test('runtime Enum', () => {
1085
+ const { content, bindings } = compile(
1086
+ `<script setup lang="ts">
1087
+ enum Foo { A = 123 }
1088
+ </script>`
1089
+ )
1090
+ assertCode(content)
1091
+ expect(bindings).toStrictEqual({
1092
+ Foo: BindingTypes.SETUP_CONST
1093
+ })
1094
+ })
1095
+
1096
+ test('runtime Enum in normal script', () => {
1097
+ const { content, bindings } = compile(
1098
+ `<script lang="ts">
1099
+ export enum D { D = "D" }
1100
+ const enum C { C = "C" }
1101
+ enum B { B = "B" }
1102
+ </script>
1103
+ <script setup lang="ts">
1104
+ enum Foo { A = 123 }
1105
+ </script>`
1106
+ )
1107
+ assertCode(content)
1108
+ expect(bindings).toStrictEqual({
1109
+ D: BindingTypes.SETUP_CONST,
1110
+ C: BindingTypes.SETUP_CONST,
1111
+ B: BindingTypes.SETUP_CONST,
1112
+ Foo: BindingTypes.SETUP_CONST
1113
+ })
1114
+ })
1115
+
1116
+ test('const Enum', () => {
1117
+ const { content, bindings } = compile(
1118
+ `<script setup lang="ts">
1119
+ const enum Foo { A = 123 }
1120
+ </script>`
1121
+ )
1122
+ assertCode(content)
1123
+ expect(bindings).toStrictEqual({
1124
+ Foo: BindingTypes.SETUP_CONST
1125
+ })
1126
+ })
1127
+
1128
+ test('import type', () => {
1129
+ const { content } = compile(
1130
+ `<script setup lang="ts">
1131
+ import type { Foo } from './main.ts'
1132
+ import { type Bar, Baz } from './main.ts'
1133
+ </script>`
1134
+ )
1135
+ expect(content).toMatch(`return { Baz }`)
1136
+ assertCode(content)
1137
+ })
1138
+ })
1139
+
1140
+ describe('errors', () => {
1141
+ test('<script> and <script setup> must have same lang', () => {
1142
+ expect(() =>
1143
+ compile(`<script>foo()</script><script setup lang="ts">bar()</script>`)
1144
+ ).toThrow(`<script> and <script setup> must have the same language type`)
1145
+ })
1146
+
1147
+ const moduleErrorMsg = `cannot contain ES module exports`
1148
+
1149
+ test('non-type named exports', () => {
1150
+ expect(() =>
1151
+ compile(`<script setup>
1152
+ export const a = 1
1153
+ </script>`)
1154
+ ).toThrow(moduleErrorMsg)
1155
+
1156
+ expect(() =>
1157
+ compile(`<script setup>
1158
+ export * from './foo'
1159
+ </script>`)
1160
+ ).toThrow(moduleErrorMsg)
1161
+
1162
+ expect(() =>
1163
+ compile(`<script setup>
1164
+ const bar = 1
1165
+ export { bar as default }
1166
+ </script>`)
1167
+ ).toThrow(moduleErrorMsg)
1168
+ })
1169
+
1170
+ test('defineProps/Emit() w/ both type and non-type args', () => {
1171
+ expect(() => {
1172
+ compile(`<script setup lang="ts">
1173
+ defineProps<{}>({})
1174
+ </script>`)
1175
+ }).toThrow(`cannot accept both type and non-type arguments`)
1176
+
1177
+ expect(() => {
1178
+ compile(`<script setup lang="ts">
1179
+ defineEmits<{}>({})
1180
+ </script>`)
1181
+ }).toThrow(`cannot accept both type and non-type arguments`)
1182
+ })
1183
+
1184
+ test('defineProps/Emit() referencing local var', () => {
1185
+ expect(() =>
1186
+ compile(`<script setup>
1187
+ const bar = 1
1188
+ defineProps({
1189
+ foo: {
1190
+ default: () => bar
1191
+ }
1192
+ })
1193
+ </script>`)
1194
+ ).toThrow(`cannot reference locally declared variables`)
1195
+
1196
+ expect(() =>
1197
+ compile(`<script setup>
1198
+ const bar = 'hello'
1199
+ defineEmits([bar])
1200
+ </script>`)
1201
+ ).toThrow(`cannot reference locally declared variables`)
1202
+
1203
+ // #4644
1204
+ expect(() =>
1205
+ compile(`
1206
+ <script>const bar = 1</script>
1207
+ <script setup>
1208
+ defineProps({
1209
+ foo: {
1210
+ default: () => bar
1211
+ }
1212
+ })
1213
+ </script>`)
1214
+ ).not.toThrow(`cannot reference locally declared variables`)
1215
+ })
1216
+
1217
+ test('should allow defineProps/Emit() referencing scope var', () => {
1218
+ assertCode(
1219
+ compile(`<script setup>
1220
+ const bar = 1
1221
+ defineProps({
1222
+ foo: {
1223
+ default: bar => bar + 1
1224
+ }
1225
+ })
1226
+ defineEmits({
1227
+ foo: bar => bar > 1
1228
+ })
1229
+ </script>`).content
1230
+ )
1231
+ })
1232
+
1233
+ test('should allow defineProps/Emit() referencing imported binding', () => {
1234
+ assertCode(
1235
+ compile(`<script setup>
1236
+ import { bar } from './bar'
1237
+ defineProps({
1238
+ foo: {
1239
+ default: () => bar
1240
+ }
1241
+ })
1242
+ defineEmits({
1243
+ foo: () => bar > 1
1244
+ })
1245
+ </script>`).content
1246
+ )
1247
+ })
1248
+ })
1249
+ })
1250
+
1251
+ describe('SFC analyze <script> bindings', () => {
1252
+ it('can parse decorators syntax in typescript block', () => {
1253
+ const { scriptAst } = compile(`
1254
+ <script lang="ts">
1255
+ import { Options, Vue } from 'vue-class-component';
1256
+ @Options({
1257
+ components: {
1258
+ HelloWorld,
1259
+ },
1260
+ props: ['foo', 'bar']
1261
+ })
1262
+ export default class Home extends Vue {}
1263
+ </script>
1264
+ `)
1265
+
1266
+ expect(scriptAst).toBeDefined()
1267
+ })
1268
+
1269
+ it('recognizes props array declaration', () => {
1270
+ const { bindings } = compile(`
1271
+ <script>
1272
+ export default {
1273
+ props: ['foo', 'bar']
1274
+ }
1275
+ </script>
1276
+ `)
1277
+ expect(bindings).toStrictEqual({
1278
+ foo: BindingTypes.PROPS,
1279
+ bar: BindingTypes.PROPS
1280
+ })
1281
+ expect(bindings!.__isScriptSetup).toBe(false)
1282
+ })
1283
+
1284
+ it('recognizes props object declaration', () => {
1285
+ const { bindings } = compile(`
1286
+ <script>
1287
+ export default {
1288
+ props: {
1289
+ foo: String,
1290
+ bar: {
1291
+ type: String,
1292
+ },
1293
+ baz: null,
1294
+ qux: [String, Number]
1295
+ }
1296
+ }
1297
+ </script>
1298
+ `)
1299
+ expect(bindings).toStrictEqual({
1300
+ foo: BindingTypes.PROPS,
1301
+ bar: BindingTypes.PROPS,
1302
+ baz: BindingTypes.PROPS,
1303
+ qux: BindingTypes.PROPS
1304
+ })
1305
+ expect(bindings!.__isScriptSetup).toBe(false)
1306
+ })
1307
+
1308
+ it('recognizes setup return', () => {
1309
+ const { bindings } = compile(`
1310
+ <script>
1311
+ const bar = 2
1312
+ export default {
1313
+ setup() {
1314
+ return {
1315
+ foo: 1,
1316
+ bar
1317
+ }
1318
+ }
1319
+ }
1320
+ </script>
1321
+ `)
1322
+ expect(bindings).toStrictEqual({
1323
+ foo: BindingTypes.SETUP_MAYBE_REF,
1324
+ bar: BindingTypes.SETUP_MAYBE_REF
1325
+ })
1326
+ expect(bindings!.__isScriptSetup).toBe(false)
1327
+ })
1328
+
1329
+ it('recognizes exported vars', () => {
1330
+ const { bindings } = compile(`
1331
+ <script>
1332
+ export const foo = 2
1333
+ </script>
1334
+ <script setup>
1335
+ console.log(foo)
1336
+ </script>
1337
+ `)
1338
+ expect(bindings).toStrictEqual({
1339
+ foo: BindingTypes.SETUP_CONST
1340
+ })
1341
+ })
1342
+
1343
+ it('recognizes async setup return', () => {
1344
+ const { bindings } = compile(`
1345
+ <script>
1346
+ const bar = 2
1347
+ export default {
1348
+ async setup() {
1349
+ return {
1350
+ foo: 1,
1351
+ bar
1352
+ }
1353
+ }
1354
+ }
1355
+ </script>
1356
+ `)
1357
+ expect(bindings).toStrictEqual({
1358
+ foo: BindingTypes.SETUP_MAYBE_REF,
1359
+ bar: BindingTypes.SETUP_MAYBE_REF
1360
+ })
1361
+ expect(bindings!.__isScriptSetup).toBe(false)
1362
+ })
1363
+
1364
+ it('recognizes data return', () => {
1365
+ const { bindings } = compile(`
1366
+ <script>
1367
+ const bar = 2
1368
+ export default {
1369
+ data() {
1370
+ return {
1371
+ foo: null,
1372
+ bar
1373
+ }
1374
+ }
1375
+ }
1376
+ </script>
1377
+ `)
1378
+ expect(bindings).toStrictEqual({
1379
+ foo: BindingTypes.DATA,
1380
+ bar: BindingTypes.DATA
1381
+ })
1382
+ })
1383
+
1384
+ it('recognizes methods', () => {
1385
+ const { bindings } = compile(`
1386
+ <script>
1387
+ export default {
1388
+ methods: {
1389
+ foo() {}
1390
+ }
1391
+ }
1392
+ </script>
1393
+ `)
1394
+ expect(bindings).toStrictEqual({ foo: BindingTypes.OPTIONS })
1395
+ })
1396
+
1397
+ it('recognizes computeds', () => {
1398
+ const { bindings } = compile(`
1399
+ <script>
1400
+ export default {
1401
+ computed: {
1402
+ foo() {},
1403
+ bar: {
1404
+ get() {},
1405
+ set() {},
1406
+ }
1407
+ }
1408
+ }
1409
+ </script>
1410
+ `)
1411
+ expect(bindings).toStrictEqual({
1412
+ foo: BindingTypes.OPTIONS,
1413
+ bar: BindingTypes.OPTIONS
1414
+ })
1415
+ })
1416
+
1417
+ it('recognizes injections array declaration', () => {
1418
+ const { bindings } = compile(`
1419
+ <script>
1420
+ export default {
1421
+ inject: ['foo', 'bar']
1422
+ }
1423
+ </script>
1424
+ `)
1425
+ expect(bindings).toStrictEqual({
1426
+ foo: BindingTypes.OPTIONS,
1427
+ bar: BindingTypes.OPTIONS
1428
+ })
1429
+ })
1430
+
1431
+ it('recognizes injections object declaration', () => {
1432
+ const { bindings } = compile(`
1433
+ <script>
1434
+ export default {
1435
+ inject: {
1436
+ foo: {},
1437
+ bar: {},
1438
+ }
1439
+ }
1440
+ </script>
1441
+ `)
1442
+ expect(bindings).toStrictEqual({
1443
+ foo: BindingTypes.OPTIONS,
1444
+ bar: BindingTypes.OPTIONS
1445
+ })
1446
+ })
1447
+
1448
+ it('works for mixed bindings', () => {
1449
+ const { bindings } = compile(`
1450
+ <script>
1451
+ export default {
1452
+ inject: ['foo'],
1453
+ props: {
1454
+ bar: String,
1455
+ },
1456
+ setup() {
1457
+ return {
1458
+ baz: null,
1459
+ }
1460
+ },
1461
+ data() {
1462
+ return {
1463
+ qux: null
1464
+ }
1465
+ },
1466
+ methods: {
1467
+ quux() {}
1468
+ },
1469
+ computed: {
1470
+ quuz() {}
1471
+ }
1472
+ }
1473
+ </script>
1474
+ `)
1475
+ expect(bindings).toStrictEqual({
1476
+ foo: BindingTypes.OPTIONS,
1477
+ bar: BindingTypes.PROPS,
1478
+ baz: BindingTypes.SETUP_MAYBE_REF,
1479
+ qux: BindingTypes.DATA,
1480
+ quux: BindingTypes.OPTIONS,
1481
+ quuz: BindingTypes.OPTIONS
1482
+ })
1483
+ })
1484
+
1485
+ it('works for script setup', () => {
1486
+ const { bindings } = compile(`
1487
+ <script setup>
1488
+ import { ref as r } from 'vue'
1489
+ defineProps({
1490
+ foo: String
1491
+ })
1492
+
1493
+ const a = r(1)
1494
+ let b = 2
1495
+ const c = 3
1496
+ const { d } = someFoo()
1497
+ let { e } = someBar()
1498
+ </script>
1499
+ `)
1500
+
1501
+ expect(bindings).toStrictEqual({
1502
+ r: BindingTypes.SETUP_CONST,
1503
+ a: BindingTypes.SETUP_REF,
1504
+ b: BindingTypes.SETUP_LET,
1505
+ c: BindingTypes.SETUP_CONST,
1506
+ d: BindingTypes.SETUP_MAYBE_REF,
1507
+ e: BindingTypes.SETUP_LET,
1508
+ foo: BindingTypes.PROPS
1509
+ })
1510
+ })
1511
+
1512
+ describe('auto name inference', () => {
1513
+ test('basic', () => {
1514
+ const { content } = compile(
1515
+ `<script setup>const a = 1</script>
1516
+ <template>{{ a }}</template>`,
1517
+ undefined,
1518
+ {
1519
+ filename: 'FooBar.vue'
1520
+ }
1521
+ )
1522
+ expect(content).toMatch(`export default {
1523
+ __name: 'FooBar'`)
1524
+ assertCode(content)
1525
+ })
1526
+
1527
+ test('do not overwrite manual name (object)', () => {
1528
+ const { content } = compile(
1529
+ `<script>
1530
+ export default {
1531
+ name: 'Baz'
1532
+ }
1533
+ </script>
1534
+ <script setup>const a = 1</script>
1535
+ <template>{{ a }}</template>`,
1536
+ undefined,
1537
+ {
1538
+ filename: 'FooBar.vue'
1539
+ }
1540
+ )
1541
+ expect(content).not.toMatch(`name: 'FooBar'`)
1542
+ expect(content).toMatch(`name: 'Baz'`)
1543
+ assertCode(content)
1544
+ })
1545
+
1546
+ test('do not overwrite manual name (call)', () => {
1547
+ const { content } = compile(
1548
+ `<script>
1549
+ import { defineComponent } from 'vue'
1550
+ export default defineComponent({
1551
+ name: 'Baz'
1552
+ })
1553
+ </script>
1554
+ <script setup>const a = 1</script>
1555
+ <template>{{ a }}</template>`,
1556
+ undefined,
1557
+ {
1558
+ filename: 'FooBar.vue'
1559
+ }
1560
+ )
1561
+ expect(content).not.toMatch(`name: 'FooBar'`)
1562
+ expect(content).toMatch(`name: 'Baz'`)
1563
+ assertCode(content)
1564
+ })
1565
+
1566
+ // #12591
1567
+ test('should not error when performing ts expression check for v-on inline statement', () => {
1568
+ compile(`
1569
+ <script setup lang="ts">
1570
+ import { foo } from './foo'
1571
+ </script>
1572
+ <template>
1573
+ <div @click="$emit('update:a');"></div>
1574
+ </template>
1575
+ `)
1576
+ })
1577
+
1578
+ // #12841
1579
+ test('should not error when performing ts expression check for v-slot destructured default value', () => {
1580
+ compile(`
1581
+ <script setup lang="ts">
1582
+ import FooComp from './Foo.vue'
1583
+ </script>
1584
+ <template>
1585
+ <FooComp>
1586
+ <template #bar="{ bar = { baz: '' } }">
1587
+ {{ bar.baz }}
1588
+ </template>
1589
+ </FooComp>
1590
+ </template>
1591
+ `)
1592
+ })
1593
+ })
1594
+ })