@weapp-vite/web 2.0.0 → 2.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 (310) hide show
  1. package/dist/_virtual/_rolldown/runtime.mjs +1 -2
  2. package/dist/compiler/wxml/attributes.mjs +12 -4
  3. package/dist/compiler/wxml/attributes.mjs.map +1 -1
  4. package/dist/compiler/wxml/compile.mjs +33 -39
  5. package/dist/compiler/wxml/compile.mjs.map +1 -1
  6. package/dist/compiler/wxml/dependency.mjs +10 -3
  7. package/dist/compiler/wxml/dependency.mjs.map +1 -1
  8. package/dist/compiler/wxml/interpolation.mjs +13 -3
  9. package/dist/compiler/wxml/interpolation.mjs.map +1 -1
  10. package/dist/compiler/wxml/nativeTags.mjs +60 -0
  11. package/dist/compiler/wxml/nativeTags.mjs.map +1 -0
  12. package/dist/compiler/wxml/navigation.mjs +1 -2
  13. package/dist/compiler/wxml/parser.mjs +1 -2
  14. package/dist/compiler/wxml/prepare.mjs +42 -0
  15. package/dist/compiler/wxml/prepare.mjs.map +1 -0
  16. package/dist/compiler/wxml/renderer.mjs +1 -2
  17. package/dist/compiler/wxml/specialNodes.mjs +1 -2
  18. package/dist/compiler/wxml/types.d.mts +0 -2
  19. package/dist/compiler/wxml/unknownTags.mjs +33 -0
  20. package/dist/compiler/wxml/unknownTags.mjs.map +1 -0
  21. package/dist/compiler/wxs.mjs +1 -2
  22. package/dist/css/wxss.d.mts +2 -19
  23. package/dist/css/wxss.mjs +5 -12
  24. package/dist/css/wxss.mjs.map +1 -1
  25. package/dist/index.d.mts +8 -3
  26. package/dist/index.mjs +8 -5
  27. package/dist/plugin/assets.d.mts +1 -2
  28. package/dist/plugin/assets.mjs +1 -2
  29. package/dist/plugin/constants.mjs +5 -4
  30. package/dist/plugin/constants.mjs.map +1 -1
  31. package/dist/plugin/dependencyScan.mjs +1 -2
  32. package/dist/plugin/entry.mjs +6 -4
  33. package/dist/plugin/entry.mjs.map +1 -1
  34. package/dist/plugin/files.mjs +1 -2
  35. package/dist/plugin/hostTypes.d.mts +1 -2
  36. package/dist/plugin/index.d.mts +0 -2
  37. package/dist/plugin/index.mjs +29 -24
  38. package/dist/plugin/index.mjs.map +1 -1
  39. package/dist/plugin/layout.mjs +1 -2
  40. package/dist/plugin/navigation.mjs +1 -2
  41. package/dist/plugin/packageResolution.mjs +1 -2
  42. package/dist/plugin/path.mjs +1 -2
  43. package/dist/plugin/register.mjs +1 -2
  44. package/dist/plugin/scan.mjs +1 -2
  45. package/dist/plugin/scanConfig.mjs +1 -2
  46. package/dist/plugin/scanSfc.mjs +1 -2
  47. package/dist/plugin/sfcHmr.mjs +28 -10
  48. package/dist/plugin/sfcHmr.mjs.map +1 -1
  49. package/dist/plugin/state.mjs +1 -2
  50. package/dist/plugin/styleModule.mjs +1 -2
  51. package/dist/plugin/types.d.mts +2 -3
  52. package/dist/plugin/vueSfc.mjs +1 -2
  53. package/dist/runtime/appShell/container.mjs +1 -2
  54. package/dist/runtime/appShell/tabBar/index.mjs +1 -2
  55. package/dist/runtime/appShell/tabBar/style.mjs +1 -2
  56. package/dist/runtime/appStyle.mjs +1 -2
  57. package/dist/runtime/button/helpers.mjs +1 -2
  58. package/dist/runtime/button/index.d.mts +0 -2
  59. package/dist/runtime/button/index.mjs +1 -2
  60. package/dist/runtime/button/style.mjs +1 -2
  61. package/dist/runtime/component/behavior.mjs +1 -2
  62. package/dist/runtime/component/constants.mjs +1 -2
  63. package/dist/runtime/component/dom.mjs +1 -2
  64. package/dist/runtime/component/element.mjs +9 -2
  65. package/dist/runtime/component/element.mjs.map +1 -1
  66. package/dist/runtime/component/events.mjs +4 -4
  67. package/dist/runtime/component/events.mjs.map +1 -1
  68. package/dist/runtime/component/index.d.mts +0 -2
  69. package/dist/runtime/component/index.mjs +1 -2
  70. package/dist/runtime/component/observers.mjs +1 -2
  71. package/dist/runtime/component/publicInstance.mjs +1 -2
  72. package/dist/runtime/component/relations.mjs +1 -2
  73. package/dist/runtime/component/slots.mjs +1 -2
  74. package/dist/runtime/component/state.mjs +1 -2
  75. package/dist/runtime/component/types.d.mts +0 -2
  76. package/dist/runtime/component/utils.mjs +1 -2
  77. package/dist/runtime/component/virtualHost.mjs +1 -2
  78. package/dist/runtime/componentEvents.mjs +1 -2
  79. package/dist/runtime/dataset.mjs +49 -0
  80. package/dist/runtime/dataset.mjs.map +1 -0
  81. package/dist/runtime/datasetBinding.d.mts +13 -0
  82. package/dist/runtime/datasetBinding.mjs +40 -0
  83. package/dist/runtime/datasetBinding.mjs.map +1 -0
  84. package/dist/runtime/eventBinding.d.mts +1 -2
  85. package/dist/runtime/eventBinding.mjs +1 -2
  86. package/dist/runtime/execution.d.mts +0 -2
  87. package/dist/runtime/execution.mjs +1 -2
  88. package/dist/runtime/host/index.d.mts +0 -2
  89. package/dist/runtime/host/index.mjs +1 -2
  90. package/dist/runtime/host/types.d.mts +0 -2
  91. package/dist/runtime/hostGlobals.d.mts +1 -2
  92. package/dist/runtime/hostGlobals.mjs +1 -2
  93. package/dist/runtime/index.d.mts +8 -3
  94. package/dist/runtime/index.mjs +9 -7
  95. package/dist/runtime/index.mjs.map +1 -1
  96. package/dist/runtime/inlineStyle.d.mts +5 -0
  97. package/dist/runtime/inlineStyle.mjs +21 -0
  98. package/dist/runtime/inlineStyle.mjs.map +1 -0
  99. package/dist/runtime/inputHandlerResult.mjs +1 -2
  100. package/dist/runtime/legacyTemplate/dataset.mjs +53 -0
  101. package/dist/runtime/legacyTemplate/dataset.mjs.map +1 -0
  102. package/dist/runtime/legacyTemplate/dom.mjs +20 -5
  103. package/dist/runtime/legacyTemplate/dom.mjs.map +1 -1
  104. package/dist/runtime/legacyTemplate/expression.mjs +1 -2
  105. package/dist/runtime/legacyTemplate/index.d.mts +0 -2
  106. package/dist/runtime/legacyTemplate/index.mjs +23 -16
  107. package/dist/runtime/legacyTemplate/index.mjs.map +1 -1
  108. package/dist/runtime/legacyTemplate/types.d.mts +0 -2
  109. package/dist/runtime/nativeComponents/canvas/index.mjs +1 -2
  110. package/dist/runtime/nativeComponents/checkbox.mjs +1 -2
  111. package/dist/runtime/nativeComponents/cover/index.mjs +1 -2
  112. package/dist/runtime/nativeComponents/form.d.mts +0 -2
  113. package/dist/runtime/nativeComponents/form.mjs +1 -2
  114. package/dist/runtime/nativeComponents/formControl.mjs +1 -2
  115. package/dist/runtime/nativeComponents/helpers.mjs +1 -2
  116. package/dist/runtime/nativeComponents/icon/helpers.mjs +1 -2
  117. package/dist/runtime/nativeComponents/icon/index.mjs +1 -2
  118. package/dist/runtime/nativeComponents/icon/style.mjs +1 -2
  119. package/dist/runtime/nativeComponents/image.d.mts +0 -2
  120. package/dist/runtime/nativeComponents/image.mjs +1 -2
  121. package/dist/runtime/nativeComponents/index.d.mts +1 -3
  122. package/dist/runtime/nativeComponents/index.mjs +3 -4
  123. package/dist/runtime/nativeComponents/index.mjs.map +1 -1
  124. package/dist/runtime/nativeComponents/input.d.mts +0 -2
  125. package/dist/runtime/nativeComponents/input.mjs +1 -2
  126. package/dist/runtime/nativeComponents/label.mjs +1 -2
  127. package/dist/runtime/nativeComponents/mediaRegistry.mjs +1 -2
  128. package/dist/runtime/nativeComponents/movable/helpers.mjs +1 -2
  129. package/dist/runtime/nativeComponents/movable/index.mjs +1 -2
  130. package/dist/runtime/nativeComponents/navigator.mjs +1 -2
  131. package/dist/runtime/nativeComponents/picker/editors.mjs +1 -2
  132. package/dist/runtime/nativeComponents/picker/helpers.mjs +1 -2
  133. package/dist/runtime/nativeComponents/picker/index.mjs +1 -2
  134. package/dist/runtime/nativeComponents/picker/style.mjs +1 -2
  135. package/dist/runtime/nativeComponents/pickerView/column.mjs +1 -2
  136. package/dist/runtime/nativeComponents/pickerView/helpers.mjs +1 -2
  137. package/dist/runtime/nativeComponents/pickerView/index.mjs +1 -2
  138. package/dist/runtime/nativeComponents/pickerView/style.mjs +1 -2
  139. package/dist/runtime/nativeComponents/primitives.mjs +1 -2
  140. package/dist/runtime/nativeComponents/progress/helpers.mjs +1 -2
  141. package/dist/runtime/nativeComponents/progress/index.mjs +1 -2
  142. package/dist/runtime/nativeComponents/progress/style.mjs +1 -2
  143. package/dist/runtime/nativeComponents/radio.mjs +1 -2
  144. package/dist/runtime/nativeComponents/richText/index.mjs +3 -4
  145. package/dist/runtime/nativeComponents/richText/index.mjs.map +1 -1
  146. package/dist/runtime/nativeComponents/scrollView/boundaries.mjs +62 -0
  147. package/dist/runtime/nativeComponents/scrollView/boundaries.mjs.map +1 -0
  148. package/dist/runtime/nativeComponents/{scrollView.d.mts → scrollView/helpers.d.mts} +4 -5
  149. package/dist/runtime/nativeComponents/scrollView/helpers.mjs +14 -0
  150. package/dist/runtime/nativeComponents/scrollView/helpers.mjs.map +1 -0
  151. package/dist/runtime/nativeComponents/scrollView/index.mjs +193 -0
  152. package/dist/runtime/nativeComponents/scrollView/index.mjs.map +1 -0
  153. package/dist/runtime/nativeComponents/scrollView/position.mjs +43 -0
  154. package/dist/runtime/nativeComponents/scrollView/position.mjs.map +1 -0
  155. package/dist/runtime/nativeComponents/slider/helpers.mjs +1 -2
  156. package/dist/runtime/nativeComponents/slider/index.mjs +1 -2
  157. package/dist/runtime/nativeComponents/slider/style.mjs +1 -2
  158. package/dist/runtime/nativeComponents/style.mjs +1 -2
  159. package/dist/runtime/nativeComponents/swiper/helpers.mjs +1 -2
  160. package/dist/runtime/nativeComponents/swiper/index.mjs +1 -2
  161. package/dist/runtime/nativeComponents/swiper/item.mjs +1 -2
  162. package/dist/runtime/nativeComponents/swiper/style.mjs +1 -2
  163. package/dist/runtime/nativeComponents/switch.d.mts +0 -2
  164. package/dist/runtime/nativeComponents/switch.mjs +1 -2
  165. package/dist/runtime/nativeComponents/textarea.d.mts +0 -2
  166. package/dist/runtime/nativeComponents/textarea.mjs +1 -2
  167. package/dist/runtime/nativeComponents/video/helpers.d.mts +0 -2
  168. package/dist/runtime/nativeComponents/video/helpers.mjs +1 -2
  169. package/dist/runtime/nativeComponents/video/index.mjs +1 -2
  170. package/dist/runtime/nativeComponents/video/style.mjs +1 -2
  171. package/dist/runtime/navigationBar/index.d.mts +0 -2
  172. package/dist/runtime/navigationBar/index.mjs +1 -2
  173. package/dist/runtime/navigationBar/style.mjs +1 -2
  174. package/dist/runtime/pageLayout.d.mts +1 -2
  175. package/dist/runtime/pageLayout.mjs +1 -2
  176. package/dist/runtime/polyfill/ad.mjs +1 -2
  177. package/dist/runtime/polyfill/animation.mjs +1 -2
  178. package/dist/runtime/polyfill/appState.mjs +1 -2
  179. package/dist/runtime/polyfill/async.d.mts +0 -2
  180. package/dist/runtime/polyfill/async.mjs +1 -2
  181. package/dist/runtime/polyfill/auth.mjs +1 -2
  182. package/dist/runtime/polyfill/authApi.mjs +1 -2
  183. package/dist/runtime/polyfill/background.mjs +1 -2
  184. package/dist/runtime/polyfill/canvasContext.mjs +1 -2
  185. package/dist/runtime/polyfill/capability.mjs +1 -2
  186. package/dist/runtime/polyfill/cloud.mjs +1 -2
  187. package/dist/runtime/polyfill/device.mjs +1 -2
  188. package/dist/runtime/polyfill/deviceApi.mjs +1 -2
  189. package/dist/runtime/polyfill/deviceAuthSystemApi.d.mts +0 -2
  190. package/dist/runtime/polyfill/deviceAuthSystemApi.mjs +1 -2
  191. package/dist/runtime/polyfill/eventBus.mjs +1 -2
  192. package/dist/runtime/polyfill/filePicker.mjs +1 -2
  193. package/dist/runtime/polyfill/fileSystemManager.mjs +1 -2
  194. package/dist/runtime/polyfill/files.mjs +1 -2
  195. package/dist/runtime/polyfill/font.mjs +1 -2
  196. package/dist/runtime/polyfill/index.d.mts +4 -4
  197. package/dist/runtime/polyfill/index.mjs +12 -5
  198. package/dist/runtime/polyfill/index.mjs.map +1 -1
  199. package/dist/runtime/polyfill/interaction.mjs +1 -2
  200. package/dist/runtime/polyfill/interactionApi.mjs +1 -2
  201. package/dist/runtime/polyfill/intersectionObserver.mjs +4 -4
  202. package/dist/runtime/polyfill/intersectionObserver.mjs.map +1 -1
  203. package/dist/runtime/polyfill/lifecycleEvents.d.mts +12 -0
  204. package/dist/runtime/polyfill/lifecycleEvents.mjs +67 -0
  205. package/dist/runtime/polyfill/lifecycleEvents.mjs.map +1 -0
  206. package/dist/runtime/polyfill/locale.mjs +1 -2
  207. package/dist/runtime/polyfill/location.mjs +1 -2
  208. package/dist/runtime/polyfill/locationApi.mjs +1 -2
  209. package/dist/runtime/polyfill/mediaActions.mjs +1 -2
  210. package/dist/runtime/polyfill/mediaApi/file.mjs +1 -2
  211. package/dist/runtime/polyfill/mediaApi/info.mjs +1 -2
  212. package/dist/runtime/polyfill/mediaApi/picker.mjs +1 -2
  213. package/dist/runtime/polyfill/mediaApi/preview.mjs +1 -2
  214. package/dist/runtime/polyfill/mediaApi/process.mjs +1 -2
  215. package/dist/runtime/polyfill/mediaInfo.mjs +1 -2
  216. package/dist/runtime/polyfill/mediaPicker.mjs +1 -2
  217. package/dist/runtime/polyfill/mediaProcess.mjs +1 -2
  218. package/dist/runtime/polyfill/menuApi.mjs +5 -3
  219. package/dist/runtime/polyfill/menuApi.mjs.map +1 -1
  220. package/dist/runtime/polyfill/navigationBarRuntime.mjs +1 -2
  221. package/dist/runtime/polyfill/network/request.mjs +1 -2
  222. package/dist/runtime/polyfill/network/requestBridge.mjs +1 -2
  223. package/dist/runtime/polyfill/network/status.mjs +1 -2
  224. package/dist/runtime/polyfill/platformApi.mjs +1 -2
  225. package/dist/runtime/polyfill/platformRuntime.mjs +1 -2
  226. package/dist/runtime/polyfill/routeRuntime/appLifecycle.mjs +1 -2
  227. package/dist/runtime/polyfill/routeRuntime/dom.mjs +1 -2
  228. package/dist/runtime/polyfill/routeRuntime/events.d.mts +0 -2
  229. package/dist/runtime/polyfill/routeRuntime/events.mjs +1 -2
  230. package/dist/runtime/polyfill/routeRuntime/history.d.mts +0 -2
  231. package/dist/runtime/polyfill/routeRuntime/history.mjs +1 -2
  232. package/dist/runtime/polyfill/routeRuntime/lifecycle.mjs +1 -2
  233. package/dist/runtime/polyfill/routeRuntime/options.d.mts +1 -2
  234. package/dist/runtime/polyfill/routeRuntime/options.mjs +1 -2
  235. package/dist/runtime/polyfill/routeRuntime/result.mjs +1 -2
  236. package/dist/runtime/polyfill/routeRuntime/scroll.mjs +37 -6
  237. package/dist/runtime/polyfill/routeRuntime/scroll.mjs.map +1 -1
  238. package/dist/runtime/polyfill/routeRuntime/stack.mjs +1 -2
  239. package/dist/runtime/polyfill/routeRuntime/url.mjs +1 -2
  240. package/dist/runtime/polyfill/routeRuntime.d.mts +2 -2
  241. package/dist/runtime/polyfill/routeRuntime.mjs +14 -5
  242. package/dist/runtime/polyfill/routeRuntime.mjs.map +1 -1
  243. package/dist/runtime/polyfill/runtimeCapabilityApi.mjs +1 -2
  244. package/dist/runtime/polyfill/runtimeDataApi.d.mts +0 -2
  245. package/dist/runtime/polyfill/runtimeDataApi.mjs +1 -2
  246. package/dist/runtime/polyfill/runtimeInfra.mjs +1 -2
  247. package/dist/runtime/polyfill/runtimeOps.mjs +1 -2
  248. package/dist/runtime/polyfill/selectorQuery.mjs +3 -3
  249. package/dist/runtime/polyfill/selectorQuery.mjs.map +1 -1
  250. package/dist/runtime/polyfill/storage.mjs +1 -2
  251. package/dist/runtime/polyfill/storageAsync.mjs +1 -2
  252. package/dist/runtime/polyfill/subscribe.mjs +1 -2
  253. package/dist/runtime/polyfill/system.mjs +1 -2
  254. package/dist/runtime/polyfill/systemApi.mjs +1 -2
  255. package/dist/runtime/polyfill/types/base.d.mts +0 -2
  256. package/dist/runtime/polyfill/types/common.d.mts +0 -2
  257. package/dist/runtime/polyfill/types/lifecycle.d.mts +12 -0
  258. package/dist/runtime/polyfill/types/locationRuntime.d.mts +0 -2
  259. package/dist/runtime/polyfill/types/mediaAuth.d.mts +0 -2
  260. package/dist/runtime/polyfill/types/platformRuntime.d.mts +0 -2
  261. package/dist/runtime/polyfill/types/systemAuth.d.mts +0 -2
  262. package/dist/runtime/polyfill/types/tabBarRuntime.d.mts +0 -2
  263. package/dist/runtime/polyfill/ui.mjs +1 -2
  264. package/dist/runtime/polyfill/uiFeedback.mjs +19 -5
  265. package/dist/runtime/polyfill/uiFeedback.mjs.map +1 -1
  266. package/dist/runtime/polyfill/uiMediaApi.d.mts +8 -2
  267. package/dist/runtime/polyfill/uiMediaApi.mjs +20 -5
  268. package/dist/runtime/polyfill/uiMediaApi.mjs.map +1 -1
  269. package/dist/runtime/polyfill/videoContext.mjs +1 -2
  270. package/dist/runtime/polyfill/vkSession.mjs +1 -2
  271. package/dist/runtime/polyfill/windowResize.mjs +1 -2
  272. package/dist/runtime/polyfill/worker.mjs +1 -2
  273. package/dist/runtime/polyfill.d.mts +4 -2
  274. package/dist/runtime/renderContext.d.mts +0 -2
  275. package/dist/runtime/renderContext.mjs +5 -4
  276. package/dist/runtime/renderContext.mjs.map +1 -1
  277. package/dist/runtime/rpx.d.mts +0 -2
  278. package/dist/runtime/rpx.mjs +6 -6
  279. package/dist/runtime/rpx.mjs.map +1 -1
  280. package/dist/runtime/seo/index.d.mts +0 -2
  281. package/dist/runtime/seo/index.mjs +1 -2
  282. package/dist/runtime/style.d.mts +0 -2
  283. package/dist/runtime/style.mjs +1 -2
  284. package/dist/runtime/template.d.mts +0 -2
  285. package/dist/runtime/utils/object.mjs +1 -2
  286. package/dist/runtime/viewport/index.d.mts +0 -2
  287. package/dist/runtime/viewport/index.mjs +1 -2
  288. package/dist/runtime/viewport/style.mjs +2 -2
  289. package/dist/runtime/viewport/style.mjs.map +1 -1
  290. package/dist/runtime/viewport/types.d.mts +0 -2
  291. package/dist/runtime/warning.d.mts +0 -2
  292. package/dist/runtime/warning.mjs +1 -2
  293. package/dist/runtime/wevu.d.mts +1 -2
  294. package/dist/runtime/wevu.mjs +1 -2
  295. package/dist/shared/nativeComponents.mjs +10 -3
  296. package/dist/shared/nativeComponents.mjs.map +1 -1
  297. package/dist/shared/slugify.mjs +1 -2
  298. package/dist/shared/styleUnits/options.d.mts +24 -0
  299. package/dist/shared/styleUnits/options.mjs +13 -0
  300. package/dist/shared/styleUnits/options.mjs.map +1 -0
  301. package/dist/shared/styleUnits/value.mjs +63 -0
  302. package/dist/shared/styleUnits/value.mjs.map +1 -0
  303. package/dist/shared/tabBar.d.mts +0 -2
  304. package/dist/shared/tabBar.mjs +1 -2
  305. package/dist/shared/wxml.mjs +1 -2
  306. package/package.json +15 -13
  307. package/dist/runtime/nativeComponents/richText/helpers.mjs +0 -230
  308. package/dist/runtime/nativeComponents/richText/helpers.mjs.map +0 -1
  309. package/dist/runtime/nativeComponents/scrollView.mjs +0 -88
  310. package/dist/runtime/nativeComponents/scrollView.mjs.map +0 -1
@@ -1,5 +1,3 @@
1
- //#region src/runtime/style.d.ts
2
1
  export declare function removeStyle(id: string): void;
3
2
  export declare function injectStyle(css: string, id?: string): () => void;
4
- //#endregion
5
3
  //# sourceMappingURL=style.d.mts.map
@@ -1,4 +1,4 @@
1
- //#region src/runtime/style.ts
1
+ // src/runtime/style.ts
2
2
  const injected = /* @__PURE__ */ new Map();
3
3
  function createStyleId(css) {
4
4
  let hash = 2166136261;
@@ -32,6 +32,5 @@ function injectStyle(css, id) {
32
32
  return () => removeStyle(styleId);
33
33
  }
34
34
 
35
- //#endregion
36
35
  export { injectStyle, removeStyle };
37
36
  //# sourceMappingURL=style.mjs.map
@@ -1,9 +1,7 @@
1
1
  import { RenderContext } from "./renderContext.mjs";
2
2
  import { createTemplate, renderTemplate } from "./legacyTemplate/index.mjs";
3
3
  import { TemplateResult } from "lit";
4
- //#region src/runtime/template.d.ts
5
4
  export type TemplateScope = Record<string, any>;
6
5
  export type TemplateRenderer = (scope: TemplateScope, ctx: RenderContext) => TemplateResult | string | unknown;
7
- //#endregion
8
6
  export { createTemplate, renderTemplate };
9
7
  //# sourceMappingURL=template.d.mts.map
@@ -1,8 +1,7 @@
1
- //#region src/runtime/utils/object.ts
1
+ // src/runtime/utils/object.ts
2
2
  function hasOwn(source, key) {
3
3
  return Object.prototype.hasOwnProperty.call(source, key);
4
4
  }
5
5
 
6
- //#endregion
7
6
  export { hasOwn };
8
7
  //# sourceMappingURL=object.mjs.map
@@ -1,5 +1,4 @@
1
1
  import { ResolvedWebViewportConfig, WebViewportConfig } from "./types.mjs";
2
- //#region src/runtime/viewport/index.d.ts
3
2
  export declare function resolveWebViewportConfig(config?: WebViewportConfig): ResolvedWebViewportConfig;
4
3
  export declare function setupWebViewport(config?: WebViewportConfig): {
5
4
  mode: "mini-program" | "responsive";
@@ -7,6 +6,5 @@ export declare function setupWebViewport(config?: WebViewportConfig): {
7
6
  desktopBreakpoint: number;
8
7
  };
9
8
  export declare function getWebViewportWidth(): number;
10
- //#endregion
11
9
  export type { ResolvedWebViewportConfig, WebViewportConfig };
12
10
  //# sourceMappingURL=index.d.mts.map
@@ -1,6 +1,6 @@
1
1
  import { WEB_VIEWPORT_STYLE_ID, createWebViewportStyle } from "./style.mjs";
2
2
 
3
- //#region src/runtime/viewport/index.ts
3
+ // src/runtime/viewport/index.ts
4
4
  const DEFAULT_VIEWPORT_CONFIG = {
5
5
  mode: "mini-program",
6
6
  maxWidth: 375,
@@ -39,6 +39,5 @@ function getWebViewportWidth() {
39
39
  return documentWidth || (typeof window !== "undefined" ? window.innerWidth : 0);
40
40
  }
41
41
 
42
- //#endregion
43
42
  export { getWebViewportWidth, resolveWebViewportConfig, setupWebViewport };
44
43
  //# sourceMappingURL=index.mjs.map
@@ -1,10 +1,11 @@
1
- //#region src/runtime/viewport/style.ts
1
+ // src/runtime/viewport/style.ts
2
2
  const WEB_VIEWPORT_STYLE_ID = "weapp-web-viewport-style";
3
3
  function createWebViewportStyle(config) {
4
4
  const maxWidth = `${config.maxWidth}px`;
5
5
  return `
6
6
  :root {
7
7
  --weapp-viewport-width: 100vw;
8
+ --weapp-viewport-height: 100dvh;
8
9
  --weapp-viewport-max-width: ${maxWidth};
9
10
  --weapp-viewport-left: 0px;
10
11
  --weapp-viewport-right: 0px;
@@ -57,6 +58,5 @@ body {
57
58
  `;
58
59
  }
59
60
 
60
- //#endregion
61
61
  export { WEB_VIEWPORT_STYLE_ID, createWebViewportStyle };
62
62
  //# sourceMappingURL=style.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"style.mjs","names":[],"sources":["../../../src/runtime/viewport/style.ts"],"sourcesContent":["import type { ResolvedWebViewportConfig } from './types'\n\nexport const WEB_VIEWPORT_STYLE_ID = 'weapp-web-viewport-style'\n\nexport function createWebViewportStyle(config: ResolvedWebViewportConfig) {\n const maxWidth = `${config.maxWidth}px`\n const breakpoint = `${config.desktopBreakpoint}px`\n return `\n:root {\n --weapp-viewport-width: 100vw;\n --weapp-viewport-max-width: ${maxWidth};\n --weapp-viewport-left: 0px;\n --weapp-viewport-right: 0px;\n --weapp-safe-area-inset-top: env(safe-area-inset-top, 0px);\n --weapp-safe-area-inset-right: env(safe-area-inset-right, 0px);\n --weapp-safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);\n --weapp-safe-area-inset-left: env(safe-area-inset-left, 0px);\n}\n\nhtml,\nbody {\n min-width: 0;\n height: 100%;\n margin: 0;\n overflow: hidden;\n}\n\nbody {\n background: #f2f2f2;\n font-family: Helvetica, -apple-system, BlinkMacSystemFont, \"Helvetica Neue\", Arial, sans-serif;\n}\n\n#app {\n --weapp-tab-bar-inset: 0px;\n --weapp-tab-bar-top-inset: 0px;\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: 100dvh;\n min-height: 0;\n margin: 0 auto;\n overflow: auto;\n overscroll-behavior: contain;\n background: #ffffff;\n contain: layout paint;\n transform: translateZ(0);\n}\n\n@media (min-width: ${breakpoint}) {\n html[data-weapp-viewport-mode=\"mini-program\"] {\n --weapp-viewport-width: ${maxWidth};\n --weapp-viewport-left: calc((100vw - ${maxWidth}) / 2);\n --weapp-viewport-right: calc((100vw - ${maxWidth}) / 2);\n }\n\n html[data-weapp-viewport-mode=\"mini-program\"] #app {\n width: ${maxWidth};\n }\n}\n`\n}\n"],"mappings":";AAEA,MAAa,wBAAwB;AAErC,SAAgB,uBAAuB,QAAmC;CACxE,MAAM,WAAW,GAAG,OAAO,SAAS;CAEpC,OAAO;;;gCAGuB,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAsCpB,GA1CG,OAAO,kBAAkB,IA0CjB;;8BAEF,SAAS;2CACI,SAAS;4CACR,SAAS;;;;aAIxC,SAAS;;;;AAItB"}
1
+ {"version":3,"file":"style.mjs","names":[],"sources":["../../../src/runtime/viewport/style.ts"],"sourcesContent":["import type { ResolvedWebViewportConfig } from './types'\n\nexport const WEB_VIEWPORT_STYLE_ID = 'weapp-web-viewport-style'\n\nexport function createWebViewportStyle(config: ResolvedWebViewportConfig) {\n const maxWidth = `${config.maxWidth}px`\n const breakpoint = `${config.desktopBreakpoint}px`\n return `\n:root {\n --weapp-viewport-width: 100vw;\n --weapp-viewport-height: 100dvh;\n --weapp-viewport-max-width: ${maxWidth};\n --weapp-viewport-left: 0px;\n --weapp-viewport-right: 0px;\n --weapp-safe-area-inset-top: env(safe-area-inset-top, 0px);\n --weapp-safe-area-inset-right: env(safe-area-inset-right, 0px);\n --weapp-safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);\n --weapp-safe-area-inset-left: env(safe-area-inset-left, 0px);\n}\n\nhtml,\nbody {\n min-width: 0;\n height: 100%;\n margin: 0;\n overflow: hidden;\n}\n\nbody {\n background: #f2f2f2;\n font-family: Helvetica, -apple-system, BlinkMacSystemFont, \"Helvetica Neue\", Arial, sans-serif;\n}\n\n#app {\n --weapp-tab-bar-inset: 0px;\n --weapp-tab-bar-top-inset: 0px;\n position: relative;\n box-sizing: border-box;\n width: 100%;\n height: 100dvh;\n min-height: 0;\n margin: 0 auto;\n overflow: auto;\n overscroll-behavior: contain;\n background: #ffffff;\n contain: layout paint;\n transform: translateZ(0);\n}\n\n@media (min-width: ${breakpoint}) {\n html[data-weapp-viewport-mode=\"mini-program\"] {\n --weapp-viewport-width: ${maxWidth};\n --weapp-viewport-left: calc((100vw - ${maxWidth}) / 2);\n --weapp-viewport-right: calc((100vw - ${maxWidth}) / 2);\n }\n\n html[data-weapp-viewport-mode=\"mini-program\"] #app {\n width: ${maxWidth};\n }\n}\n`\n}\n"],"mappings":";AAEA,MAAa,wBAAwB;AAErC,SAAgB,uBAAuB,QAAmC;CACxE,MAAM,WAAW,GAAG,OAAO,SAAS;CAEpC,OAAO;;;;gCAIuB,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAsCpB,GA3CG,OAAO,kBAAkB,IA2CjB;;8BAEF,SAAS;2CACI,SAAS;4CACR,SAAS;;;;aAIxC,SAAS;;;;AAItB"}
@@ -1,4 +1,3 @@
1
- //#region src/runtime/viewport/types.d.ts
2
1
  export interface WebViewportConfig {
3
2
  mode?: 'mini-program' | 'responsive';
4
3
  maxWidth?: number;
@@ -9,5 +8,4 @@ export interface ResolvedWebViewportConfig {
9
8
  maxWidth: number;
10
9
  desktopBreakpoint: number;
11
10
  }
12
- //#endregion
13
11
  //# sourceMappingURL=types.d.mts.map
@@ -1,9 +1,7 @@
1
- //#region src/runtime/warning.d.ts
2
1
  export type RuntimeWarningLevel = 'off' | 'warn' | 'error';
3
2
  export interface RuntimeWarningOptions {
4
3
  level?: RuntimeWarningLevel;
5
4
  dedupe?: boolean;
6
5
  }
7
6
  export declare function setRuntimeWarningOptions(options?: RuntimeWarningOptions): void;
8
- //#endregion
9
7
  //# sourceMappingURL=warning.d.mts.map
@@ -1,4 +1,4 @@
1
- //#region src/runtime/warning.ts
1
+ // src/runtime/warning.ts
2
2
  const defaultWarningOptions = {
3
3
  level: "warn",
4
4
  dedupe: true
@@ -38,6 +38,5 @@ function emitRuntimeWarning(message, options = {}) {
38
38
  if (typeof logger.warn === "function") logger.warn(normalized);
39
39
  }
40
40
 
41
- //#endregion
42
41
  export { emitRuntimeWarning, setRuntimeWarningOptions };
43
42
  //# sourceMappingURL=warning.mjs.map
@@ -1,5 +1,4 @@
1
1
  import { RegisterMeta } from "./polyfill/routeRuntime/options.mjs";
2
- //#region src/runtime/wevu.d.ts
3
2
  interface WevuRegisterMeta extends RegisterMeta {
4
3
  kind: 'app' | 'page' | 'component';
5
4
  }
@@ -19,5 +18,5 @@ export declare function registerWebWevuComponentFactory<TArgs extends unknown[],
19
18
  * 在原生模块同步求值期间安装带页面元数据的宿主注册函数。
20
19
  */
21
20
  export declare function installWebModuleRegistration(meta: WevuRegisterMeta, target?: Record<string, any>): () => void;
22
- //#endregion
21
+ export {};
23
22
  //# sourceMappingURL=wevu.d.mts.map
@@ -2,7 +2,7 @@ import { setAppStyle } from "./appStyle.mjs";
2
2
  import { registerApp, registerComponent, registerPage } from "./polyfill/routeRuntime.mjs";
3
3
  import { createApp, createWevuComponent, takePendingRuntimeAppRegistration } from "wevu/internal-runtime";
4
4
 
5
- //#region src/runtime/wevu.ts
5
+ // src/runtime/wevu.ts
6
6
  function createRuntimeConstructor(meta, name) {
7
7
  return (definition) => {
8
8
  if (name === "App") registerApp(definition, meta);
@@ -81,6 +81,5 @@ function installWebModuleRegistration(meta, target = globalThis) {
81
81
  };
82
82
  }
83
83
 
84
- //#endregion
85
84
  export { installWebModuleRegistration, registerWebWevuApp, registerWebWevuComponent, registerWebWevuComponentFactory };
86
85
  //# sourceMappingURL=wevu.mjs.map
@@ -1,4 +1,4 @@
1
- //#region src/shared/nativeComponents.ts
1
+ // src/shared/nativeComponents.ts
2
2
  const NATIVE_COMPONENT_DESCRIPTORS = Object.freeze([
3
3
  {
4
4
  name: "view",
@@ -238,7 +238,15 @@ const NATIVE_COMPONENT_DESCRIPTORS = Object.freeze([
238
238
  "scroll-x",
239
239
  "scroll-y",
240
240
  "scroll-top",
241
- "scroll-left"
241
+ "scroll-left",
242
+ "upper-threshold",
243
+ "lower-threshold",
244
+ "scroll-into-view",
245
+ "scroll-into-view-offset",
246
+ "scroll-into-view-alignment",
247
+ "enable-flex",
248
+ "enhanced",
249
+ "show-scrollbar"
242
250
  ],
243
251
  defaultStyle: "display: block; box-sizing: border-box;"
244
252
  },
@@ -396,6 +404,5 @@ function isKnownUnsupportedNativeComponent(name) {
396
404
  return KNOWN_UNSUPPORTED_NATIVE_COMPONENTS.has(name.toLowerCase());
397
405
  }
398
406
 
399
- //#endregion
400
407
  export { NATIVE_COMPONENT_DESCRIPTORS, getNativeComponentDescriptor, isKnownUnsupportedNativeComponent, resolveNativeComponentPropertyAttributes, resolveNativeComponentWebTag };
401
408
  //# sourceMappingURL=nativeComponents.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"nativeComponents.mjs","names":[],"sources":["../../src/shared/nativeComponents.ts"],"sourcesContent":["export interface NativeComponentDescriptor {\n name: string\n webTag: string\n attributes: readonly string[]\n propertyAttributes?: readonly string[]\n defaultStyle: string\n}\n\nexport const NATIVE_COMPONENT_DESCRIPTORS = Object.freeze([\n {\n name: 'view',\n webTag: 'weapp-view',\n attributes: [],\n defaultStyle: 'display: block; box-sizing: border-box;',\n },\n {\n name: 'text',\n webTag: 'weapp-text',\n attributes: ['selectable', 'user-select', 'space', 'decode'],\n defaultStyle: 'display: inline; box-sizing: border-box; white-space: pre-wrap;',\n },\n {\n name: 'image',\n webTag: 'weapp-image',\n attributes: ['src', 'mode', 'lazy-load', 'alt'],\n defaultStyle: 'display: inline-block; box-sizing: border-box; width: 320px; height: 240px; overflow: hidden; vertical-align: middle;',\n },\n {\n name: 'button',\n webTag: 'weapp-button',\n attributes: ['type', 'size', 'plain', 'disabled', 'loading', 'form-type', 'open-type'],\n defaultStyle: 'display: block; box-sizing: border-box;',\n },\n {\n name: 'input',\n webTag: 'weapp-input',\n attributes: ['name', 'value', 'type', 'password', 'placeholder', 'disabled', 'maxlength', 'confirm-type', 'focus'],\n defaultStyle: 'display: block; box-sizing: border-box; min-height: 1.4em;',\n },\n {\n name: 'textarea',\n webTag: 'weapp-textarea',\n attributes: ['name', 'value', 'placeholder', 'disabled', 'maxlength', 'confirm-type', 'auto-focus', 'focus', 'auto-height'],\n defaultStyle: 'display: block; box-sizing: border-box; width: 300px; height: 150px;',\n },\n {\n name: 'form',\n webTag: 'weapp-form',\n attributes: [],\n defaultStyle: 'display: inline; box-sizing: border-box;',\n },\n {\n name: 'label',\n webTag: 'weapp-label',\n attributes: ['for'],\n defaultStyle: 'display: inline; box-sizing: border-box; cursor: pointer;',\n },\n {\n name: 'checkbox-group',\n webTag: 'weapp-checkbox-group',\n attributes: ['name'],\n defaultStyle: 'display: block; box-sizing: border-box;',\n },\n {\n name: 'checkbox',\n webTag: 'weapp-checkbox',\n attributes: ['value', 'checked', 'disabled', 'color'],\n defaultStyle: 'display: inline-flex; box-sizing: border-box; align-items: center; vertical-align: middle;',\n },\n {\n name: 'radio-group',\n webTag: 'weapp-radio-group',\n attributes: ['name'],\n defaultStyle: 'display: block; box-sizing: border-box;',\n },\n {\n name: 'radio',\n webTag: 'weapp-radio',\n attributes: ['value', 'checked', 'disabled', 'color'],\n defaultStyle: 'display: inline-flex; box-sizing: border-box; align-items: center; vertical-align: middle;',\n },\n {\n name: 'switch',\n webTag: 'weapp-switch',\n attributes: ['name', 'checked', 'disabled', 'type', 'color'],\n defaultStyle: 'display: inline-flex; box-sizing: border-box; align-items: center; vertical-align: middle;',\n },\n {\n name: 'picker',\n webTag: 'weapp-picker',\n attributes: ['name', 'header-text', 'mode', 'range', 'range-key', 'value', 'start', 'end', 'fields', 'custom-item', 'level', 'disabled'],\n propertyAttributes: ['range', 'value'],\n defaultStyle: 'display: block; box-sizing: border-box;',\n },\n {\n name: 'picker-view',\n webTag: 'weapp-picker-view',\n attributes: ['value', 'mask-class', 'indicator-style', 'indicator-class', 'mask-style', 'immediate-change'],\n propertyAttributes: ['value'],\n defaultStyle: 'position: relative; display: flex; box-sizing: border-box; height: 225px; overflow: hidden;',\n },\n {\n name: 'picker-view-column',\n webTag: 'weapp-picker-view-column',\n attributes: ['indicator-style'],\n defaultStyle: 'display: block; box-sizing: border-box; min-width: 0; height: 100%; flex: 1;',\n },\n {\n name: 'slider',\n webTag: 'weapp-slider',\n attributes: ['name', 'min', 'max', 'step', 'disabled', 'value', 'color', 'selected-color', 'active-color', 'background-color', 'block-size', 'block-color', 'show-value'],\n defaultStyle: 'display: block; box-sizing: border-box; margin: 10px 18px;',\n },\n {\n name: 'icon',\n webTag: 'weapp-icon',\n attributes: ['type', 'size', 'color'],\n defaultStyle: 'display: inline-flex; box-sizing: border-box; align-items: center; justify-content: center; vertical-align: middle;',\n },\n {\n name: 'progress',\n webTag: 'weapp-progress',\n attributes: ['percent', 'show-info', 'stroke-width', 'color', 'active-color', 'background-color', 'active', 'active-mode', 'duration', 'border-radius', 'font-size'],\n defaultStyle: 'display: flex; box-sizing: border-box; align-items: center;',\n },\n {\n name: 'rich-text',\n webTag: 'weapp-rich-text',\n attributes: ['nodes', 'space', 'user-select'],\n propertyAttributes: ['nodes'],\n defaultStyle: 'display: block; box-sizing: border-box;',\n },\n {\n name: 'scroll-view',\n webTag: 'weapp-scroll-view',\n attributes: ['scroll-x', 'scroll-y', 'scroll-top', 'scroll-left'],\n defaultStyle: 'display: block; box-sizing: border-box;',\n },\n {\n name: 'navigator',\n webTag: 'weapp-navigator',\n attributes: [\n 'url',\n 'open-type',\n 'delta',\n 'target',\n 'app-id',\n 'path',\n 'extra-data',\n 'version',\n 'short-link',\n 'aria-label',\n 'hover-class',\n 'hover-start-time',\n 'hover-stay-time',\n 'hover-stop-propagation',\n ],\n propertyAttributes: ['extra-data'],\n defaultStyle: 'display: block; box-sizing: border-box;',\n },\n {\n name: 'swiper',\n webTag: 'weapp-swiper',\n attributes: [\n 'current',\n 'current-item-id',\n 'autoplay',\n 'interval',\n 'duration',\n 'circular',\n 'vertical',\n 'indicator-dots',\n 'indicator-color',\n 'indicator-active-color',\n 'display-multiple-items',\n 'previous-margin',\n 'next-margin',\n 'disable-touch',\n 'easing-function',\n ],\n defaultStyle: 'display: block; box-sizing: border-box; height: 150px; overflow: hidden;',\n },\n {\n name: 'swiper-item',\n webTag: 'weapp-swiper-item',\n attributes: ['item-id'],\n defaultStyle: 'display: block; box-sizing: border-box; width: 100%; height: 100%; overflow: hidden;',\n },\n {\n name: 'canvas',\n webTag: 'weapp-canvas',\n attributes: ['id', 'canvas-id', 'type', 'disable-scroll', 'width', 'height'],\n defaultStyle: 'display: block; box-sizing: border-box; width: 300px; height: 150px; overflow: hidden;',\n },\n {\n name: 'video',\n webTag: 'weapp-video',\n attributes: ['id', 'src', 'poster', 'autoplay', 'loop', 'muted', 'controls', 'initial-time', 'object-fit'],\n defaultStyle: 'display: block; box-sizing: border-box; width: 300px; height: 225px; overflow: hidden;',\n },\n {\n name: 'cover-view',\n webTag: 'weapp-cover-view',\n attributes: [],\n defaultStyle: 'position: absolute; z-index: 2; display: block; box-sizing: border-box; pointer-events: auto;',\n },\n {\n name: 'cover-image',\n webTag: 'weapp-cover-image',\n attributes: ['src', 'mode', 'lazy-load', 'alt'],\n defaultStyle: 'position: absolute; z-index: 2; display: block; box-sizing: border-box; width: 100%; height: 100%; overflow: hidden; pointer-events: auto;',\n },\n {\n name: 'movable-area',\n webTag: 'weapp-movable-area',\n attributes: [],\n defaultStyle: 'position: relative; display: block; box-sizing: border-box; overflow: hidden;',\n },\n {\n name: 'movable-view',\n webTag: 'weapp-movable-view',\n attributes: ['direction', 'inertia', 'out-of-bounds', 'x', 'y', 'damping', 'friction', 'disabled', 'scale', 'scale-min', 'scale-max', 'scale-value', 'animation'],\n defaultStyle: 'position: absolute; top: 0; left: 0; display: block; box-sizing: border-box; width: 10px; height: 10px; touch-action: none; user-select: none;',\n },\n] as const satisfies readonly NativeComponentDescriptor[])\n\nexport type SupportedNativeComponentName = typeof NATIVE_COMPONENT_DESCRIPTORS[number]['name']\nexport type NativeComponentWebTag = typeof NATIVE_COMPONENT_DESCRIPTORS[number]['webTag']\n\nconst descriptorMap = new Map<string, NativeComponentDescriptor>(\n NATIVE_COMPONENT_DESCRIPTORS.map(descriptor => [descriptor.name, descriptor]),\n)\n\nconst KNOWN_UNSUPPORTED_NATIVE_COMPONENTS = new Set([\n 'editor',\n 'keyboard-accessory',\n 'match-media',\n 'root-portal',\n 'page-container',\n 'share-element',\n 'audio',\n 'camera',\n 'live-player',\n 'live-pusher',\n 'map',\n 'web-view',\n 'ad',\n 'official-account',\n 'open-data',\n])\n\nexport function getNativeComponentDescriptor(name: string) {\n return descriptorMap.get(name.toLowerCase())\n}\n\nexport function resolveNativeComponentWebTag(name: string) {\n return getNativeComponentDescriptor(name)?.webTag\n}\n\nexport function resolveNativeComponentPropertyAttributes(name: string) {\n return getNativeComponentDescriptor(name)?.propertyAttributes ?? []\n}\n\nexport function isKnownUnsupportedNativeComponent(name: string) {\n return KNOWN_UNSUPPORTED_NATIVE_COMPONENTS.has(name.toLowerCase())\n}\n"],"mappings":";AAQA,MAAa,+BAA+B,OAAO,OAAO;CACxD;EACE,MAAM;EACN,QAAQ;EACR,YAAY,CAAC;EACb,cAAc;CAChB;CACA;EACE,MAAM;EACN,QAAQ;EACR,YAAY;GAAC;GAAc;GAAe;GAAS;EAAQ;EAC3D,cAAc;CAChB;CACA;EACE,MAAM;EACN,QAAQ;EACR,YAAY;GAAC;GAAO;GAAQ;GAAa;EAAK;EAC9C,cAAc;CAChB;CACA;EACE,MAAM;EACN,QAAQ;EACR,YAAY;GAAC;GAAQ;GAAQ;GAAS;GAAY;GAAW;GAAa;EAAW;EACrF,cAAc;CAChB;CACA;EACE,MAAM;EACN,QAAQ;EACR,YAAY;GAAC;GAAQ;GAAS;GAAQ;GAAY;GAAe;GAAY;GAAa;GAAgB;EAAO;EACjH,cAAc;CAChB;CACA;EACE,MAAM;EACN,QAAQ;EACR,YAAY;GAAC;GAAQ;GAAS;GAAe;GAAY;GAAa;GAAgB;GAAc;GAAS;EAAa;EAC1H,cAAc;CAChB;CACA;EACE,MAAM;EACN,QAAQ;EACR,YAAY,CAAC;EACb,cAAc;CAChB;CACA;EACE,MAAM;EACN,QAAQ;EACR,YAAY,CAAC,KAAK;EAClB,cAAc;CAChB;CACA;EACE,MAAM;EACN,QAAQ;EACR,YAAY,CAAC,MAAM;EACnB,cAAc;CAChB;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c,IAAI,KAAK,YAAY,CAAC;AAC7C;AAEA,SAAgB,6BAA6B,MAAc;CACzD,OAAO,6BAA6B,IAAI,CAAC,EAAE;AAC7C;AAEA,SAAgB,yCAAyC,MAAc;CACrE,OAAO,6BAA6B,IAAI,CAAC,EAAE,sBAAsB,CAAC;AACpE;AAEA,SAAgB,kCAAkC,MAAc;CAC9D,OAAO,oCAAoC,IAAI,KAAK,YAAY,CAAC;AACnE"}
1
+ {"version":3,"file":"nativeComponents.mjs","names":[],"sources":["../../src/shared/nativeComponents.ts"],"sourcesContent":["export interface NativeComponentDescriptor {\n name: string\n webTag: string\n attributes: readonly string[]\n propertyAttributes?: readonly string[]\n defaultStyle: string\n}\n\nexport const NATIVE_COMPONENT_DESCRIPTORS = Object.freeze([\n {\n name: 'view',\n webTag: 'weapp-view',\n attributes: [],\n defaultStyle: 'display: block; box-sizing: border-box;',\n },\n {\n name: 'text',\n webTag: 'weapp-text',\n attributes: ['selectable', 'user-select', 'space', 'decode'],\n defaultStyle: 'display: inline; box-sizing: border-box; white-space: pre-wrap;',\n },\n {\n name: 'image',\n webTag: 'weapp-image',\n attributes: ['src', 'mode', 'lazy-load', 'alt'],\n defaultStyle: 'display: inline-block; box-sizing: border-box; width: 320px; height: 240px; overflow: hidden; vertical-align: middle;',\n },\n {\n name: 'button',\n webTag: 'weapp-button',\n attributes: ['type', 'size', 'plain', 'disabled', 'loading', 'form-type', 'open-type'],\n defaultStyle: 'display: block; box-sizing: border-box;',\n },\n {\n name: 'input',\n webTag: 'weapp-input',\n attributes: ['name', 'value', 'type', 'password', 'placeholder', 'disabled', 'maxlength', 'confirm-type', 'focus'],\n defaultStyle: 'display: block; box-sizing: border-box; min-height: 1.4em;',\n },\n {\n name: 'textarea',\n webTag: 'weapp-textarea',\n attributes: ['name', 'value', 'placeholder', 'disabled', 'maxlength', 'confirm-type', 'auto-focus', 'focus', 'auto-height'],\n defaultStyle: 'display: block; box-sizing: border-box; width: 300px; height: 150px;',\n },\n {\n name: 'form',\n webTag: 'weapp-form',\n attributes: [],\n defaultStyle: 'display: inline; box-sizing: border-box;',\n },\n {\n name: 'label',\n webTag: 'weapp-label',\n attributes: ['for'],\n defaultStyle: 'display: inline; box-sizing: border-box; cursor: pointer;',\n },\n {\n name: 'checkbox-group',\n webTag: 'weapp-checkbox-group',\n attributes: ['name'],\n defaultStyle: 'display: block; box-sizing: border-box;',\n },\n {\n name: 'checkbox',\n webTag: 'weapp-checkbox',\n attributes: ['value', 'checked', 'disabled', 'color'],\n defaultStyle: 'display: inline-flex; box-sizing: border-box; align-items: center; vertical-align: middle;',\n },\n {\n name: 'radio-group',\n webTag: 'weapp-radio-group',\n attributes: ['name'],\n defaultStyle: 'display: block; box-sizing: border-box;',\n },\n {\n name: 'radio',\n webTag: 'weapp-radio',\n attributes: ['value', 'checked', 'disabled', 'color'],\n defaultStyle: 'display: inline-flex; box-sizing: border-box; align-items: center; vertical-align: middle;',\n },\n {\n name: 'switch',\n webTag: 'weapp-switch',\n attributes: ['name', 'checked', 'disabled', 'type', 'color'],\n defaultStyle: 'display: inline-flex; box-sizing: border-box; align-items: center; vertical-align: middle;',\n },\n {\n name: 'picker',\n webTag: 'weapp-picker',\n attributes: ['name', 'header-text', 'mode', 'range', 'range-key', 'value', 'start', 'end', 'fields', 'custom-item', 'level', 'disabled'],\n propertyAttributes: ['range', 'value'],\n defaultStyle: 'display: block; box-sizing: border-box;',\n },\n {\n name: 'picker-view',\n webTag: 'weapp-picker-view',\n attributes: ['value', 'mask-class', 'indicator-style', 'indicator-class', 'mask-style', 'immediate-change'],\n propertyAttributes: ['value'],\n defaultStyle: 'position: relative; display: flex; box-sizing: border-box; height: 225px; overflow: hidden;',\n },\n {\n name: 'picker-view-column',\n webTag: 'weapp-picker-view-column',\n attributes: ['indicator-style'],\n defaultStyle: 'display: block; box-sizing: border-box; min-width: 0; height: 100%; flex: 1;',\n },\n {\n name: 'slider',\n webTag: 'weapp-slider',\n attributes: ['name', 'min', 'max', 'step', 'disabled', 'value', 'color', 'selected-color', 'active-color', 'background-color', 'block-size', 'block-color', 'show-value'],\n defaultStyle: 'display: block; box-sizing: border-box; margin: 10px 18px;',\n },\n {\n name: 'icon',\n webTag: 'weapp-icon',\n attributes: ['type', 'size', 'color'],\n defaultStyle: 'display: inline-flex; box-sizing: border-box; align-items: center; justify-content: center; vertical-align: middle;',\n },\n {\n name: 'progress',\n webTag: 'weapp-progress',\n attributes: ['percent', 'show-info', 'stroke-width', 'color', 'active-color', 'background-color', 'active', 'active-mode', 'duration', 'border-radius', 'font-size'],\n defaultStyle: 'display: flex; box-sizing: border-box; align-items: center;',\n },\n {\n name: 'rich-text',\n webTag: 'weapp-rich-text',\n attributes: ['nodes', 'space', 'user-select'],\n propertyAttributes: ['nodes'],\n defaultStyle: 'display: block; box-sizing: border-box;',\n },\n {\n name: 'scroll-view',\n webTag: 'weapp-scroll-view',\n attributes: [\n 'scroll-x',\n 'scroll-y',\n 'scroll-top',\n 'scroll-left',\n 'upper-threshold',\n 'lower-threshold',\n 'scroll-into-view',\n 'scroll-into-view-offset',\n 'scroll-into-view-alignment',\n 'enable-flex',\n 'enhanced',\n 'show-scrollbar',\n ],\n defaultStyle: 'display: block; box-sizing: border-box;',\n },\n {\n name: 'navigator',\n webTag: 'weapp-navigator',\n attributes: [\n 'url',\n 'open-type',\n 'delta',\n 'target',\n 'app-id',\n 'path',\n 'extra-data',\n 'version',\n 'short-link',\n 'aria-label',\n 'hover-class',\n 'hover-start-time',\n 'hover-stay-time',\n 'hover-stop-propagation',\n ],\n propertyAttributes: ['extra-data'],\n defaultStyle: 'display: block; box-sizing: border-box;',\n },\n {\n name: 'swiper',\n webTag: 'weapp-swiper',\n attributes: [\n 'current',\n 'current-item-id',\n 'autoplay',\n 'interval',\n 'duration',\n 'circular',\n 'vertical',\n 'indicator-dots',\n 'indicator-color',\n 'indicator-active-color',\n 'display-multiple-items',\n 'previous-margin',\n 'next-margin',\n 'disable-touch',\n 'easing-function',\n ],\n defaultStyle: 'display: block; box-sizing: border-box; height: 150px; overflow: hidden;',\n },\n {\n name: 'swiper-item',\n webTag: 'weapp-swiper-item',\n attributes: ['item-id'],\n defaultStyle: 'display: block; box-sizing: border-box; width: 100%; height: 100%; overflow: hidden;',\n },\n {\n name: 'canvas',\n webTag: 'weapp-canvas',\n attributes: ['id', 'canvas-id', 'type', 'disable-scroll', 'width', 'height'],\n defaultStyle: 'display: block; box-sizing: border-box; width: 300px; height: 150px; overflow: hidden;',\n },\n {\n name: 'video',\n webTag: 'weapp-video',\n attributes: ['id', 'src', 'poster', 'autoplay', 'loop', 'muted', 'controls', 'initial-time', 'object-fit'],\n defaultStyle: 'display: block; box-sizing: border-box; width: 300px; height: 225px; overflow: hidden;',\n },\n {\n name: 'cover-view',\n webTag: 'weapp-cover-view',\n attributes: [],\n defaultStyle: 'position: absolute; z-index: 2; display: block; box-sizing: border-box; pointer-events: auto;',\n },\n {\n name: 'cover-image',\n webTag: 'weapp-cover-image',\n attributes: ['src', 'mode', 'lazy-load', 'alt'],\n defaultStyle: 'position: absolute; z-index: 2; display: block; box-sizing: border-box; width: 100%; height: 100%; overflow: hidden; pointer-events: auto;',\n },\n {\n name: 'movable-area',\n webTag: 'weapp-movable-area',\n attributes: [],\n defaultStyle: 'position: relative; display: block; box-sizing: border-box; overflow: hidden;',\n },\n {\n name: 'movable-view',\n webTag: 'weapp-movable-view',\n attributes: ['direction', 'inertia', 'out-of-bounds', 'x', 'y', 'damping', 'friction', 'disabled', 'scale', 'scale-min', 'scale-max', 'scale-value', 'animation'],\n defaultStyle: 'position: absolute; top: 0; left: 0; display: block; box-sizing: border-box; width: 10px; height: 10px; touch-action: none; user-select: none;',\n },\n] as const satisfies readonly NativeComponentDescriptor[])\n\nexport type SupportedNativeComponentName = typeof NATIVE_COMPONENT_DESCRIPTORS[number]['name']\nexport type NativeComponentWebTag = typeof NATIVE_COMPONENT_DESCRIPTORS[number]['webTag']\n\nconst descriptorMap = new Map<string, NativeComponentDescriptor>(\n NATIVE_COMPONENT_DESCRIPTORS.map(descriptor => [descriptor.name, descriptor]),\n)\n\nconst KNOWN_UNSUPPORTED_NATIVE_COMPONENTS = new Set([\n 'editor',\n 'keyboard-accessory',\n 'match-media',\n 'root-portal',\n 'page-container',\n 'share-element',\n 'audio',\n 'camera',\n 'live-player',\n 'live-pusher',\n 'map',\n 'web-view',\n 'ad',\n 'official-account',\n 'open-data',\n])\n\nexport function getNativeComponentDescriptor(name: string) {\n return descriptorMap.get(name.toLowerCase())\n}\n\nexport function resolveNativeComponentWebTag(name: string) {\n return getNativeComponentDescriptor(name)?.webTag\n}\n\nexport function resolveNativeComponentPropertyAttributes(name: string) {\n return getNativeComponentDescriptor(name)?.propertyAttributes ?? []\n}\n\nexport function isKnownUnsupportedNativeComponent(name: string) {\n return KNOWN_UNSUPPORTED_NATIVE_COMPONENTS.has(name.toLowerCase())\n}\n"],"mappings":";AAQA,MAAa,+BAA+B,OAAO,OAAO;CACxD;EACE,MAAM;EACN,QAAQ;EACR,YAAY,CAAC;EACb,cAAc;CAChB;CACA;EACE,MAAM;EACN,QAAQ;EACR,YAAY;GAAC;GAAc;GAAe;GAAS;EAAQ;EAC3D,cAAc;CAChB;CACA;EACE,MAAM;EACN,QAAQ;EACR,YAAY;GAAC;GAAO;GAAQ;GAAa;EAAK;EAC9C,cAAc;CAChB;CACA;EACE,MAAM;EACN,QAAQ;EACR,YAAY;GAAC;GAAQ;GAAQ;GAAS;GAAY;GAAW;GAAa;EAAW;EACrF,cAAc;CAChB;CACA;EACE,MAAM;EACN,QAAQ;EACR,YAAY;GAAC;GAAQ;GAAS;GAAQ;GAAY;GAAe;GAAY;GAAa;GAAgB;EAAO;EACjH,cAAc;CAChB;CACA;EACE,MAAM;EACN,QAAQ;EACR,YAAY;GAAC;GAAQ;GAAS;GAAe;GAAY;GAAa;GAAgB;GAAc;GAAS;EAAa;EAC1H,cAAc;CAChB;CACA;EACE,MAAM;EACN,QAAQ;EACR,YAAY,CAAC;EACb,cAAc;CAChB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AC,CAC9E;AAEA,MAAM,sDAAsC,IAAI,IAAI;CAClD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,SAAgB,6BAA6B,MAAc;CACzD,OAAO,cAAc,IAAI,KAAK,YAAY,CAAC;AAC7C;AAEA,SAAgB,6BAA6B,MAAc;CACzD,OAAO,6BAA6B,IAAI,CAAC,EAAE;AAC7C;AAEA,SAAgB,yCAAyC,MAAc;CACrE,OAAO,6BAA6B,IAAI,CAAC,EAAE,sBAAsB,CAAC;AACpE;AAEA,SAAgB,kCAAkC,MAAc;CAC9D,OAAO,oCAAoC,IAAI,KAAK,YAAY,CAAC;AACnE"}
@@ -1,8 +1,7 @@
1
- //#region src/shared/slugify.ts
1
+ // src/shared/slugify.ts
2
2
  function slugify(id, prefix) {
3
3
  return `${prefix}-${id.replace(/[^a-z0-9]+/gi, "-").replace(/^-+|-+$/g, "").toLowerCase() || "index"}`;
4
4
  }
5
5
 
6
- //#endregion
7
6
  export { slugify };
8
7
  //# sourceMappingURL=slugify.mjs.map
@@ -0,0 +1,24 @@
1
+ export interface WxssTransformOptions {
2
+ /**
3
+ * 1rpx 对应的 CSS 像素数。
4
+ * 默认值近似于 750rpx 设计稿在 375px 屏幕上的换算。
5
+ */
6
+ pxPerRpx?: number;
7
+ /**
8
+ * rpx 换算的设计宽度。传入后会把 rpx 转为
9
+ * `calc(var(--rpx) * N)` 以实现响应式缩放。
10
+ */
11
+ designWidth?: number;
12
+ /**
13
+ * 用于存储运行时 rpx 大小的 CSS 变量名。
14
+ * @default "--rpx"
15
+ */
16
+ rpxVar?: string;
17
+ }
18
+ export interface ResolvedStyleUnitOptions {
19
+ useVariable: boolean;
20
+ rpxVar: string;
21
+ ratio: number;
22
+ designWidth: number;
23
+ }
24
+ //# sourceMappingURL=options.d.mts.map
@@ -0,0 +1,13 @@
1
+ // src/shared/styleUnits/options.ts
2
+ /** 编译端与运行时共用显式配置;有限设计宽度优先启用变量模式。 */
3
+ function resolveStyleUnitOptions(options) {
4
+ return {
5
+ useVariable: options?.pxPerRpx === void 0 || typeof options.designWidth === "number" && Number.isFinite(options.designWidth),
6
+ rpxVar: options?.rpxVar ?? "--rpx",
7
+ ratio: options?.pxPerRpx ?? .5,
8
+ designWidth: options?.designWidth ?? 750
9
+ };
10
+ }
11
+
12
+ export { resolveStyleUnitOptions };
13
+ //# sourceMappingURL=options.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.mjs","names":[],"sources":["../../../src/shared/styleUnits/options.ts"],"sourcesContent":["export interface WxssTransformOptions {\n /**\n * 1rpx 对应的 CSS 像素数。\n * 默认值近似于 750rpx 设计稿在 375px 屏幕上的换算。\n */\n pxPerRpx?: number\n /**\n * rpx 换算的设计宽度。传入后会把 rpx 转为\n * `calc(var(--rpx) * N)` 以实现响应式缩放。\n */\n designWidth?: number\n /**\n * 用于存储运行时 rpx 大小的 CSS 变量名。\n * @default \"--rpx\"\n */\n rpxVar?: string\n}\n\nexport interface ResolvedStyleUnitOptions {\n useVariable: boolean\n rpxVar: string\n ratio: number\n designWidth: number\n}\n\n/** 编译端与运行时共用显式配置;有限设计宽度优先启用变量模式。 */\nexport function resolveStyleUnitOptions(options?: WxssTransformOptions): ResolvedStyleUnitOptions {\n return {\n useVariable: options?.pxPerRpx === undefined\n || (typeof options.designWidth === 'number' && Number.isFinite(options.designWidth)),\n rpxVar: options?.rpxVar ?? '--rpx',\n ratio: options?.pxPerRpx ?? 0.5,\n designWidth: options?.designWidth ?? 750,\n }\n}\n"],"mappings":";;AA0BA,SAAgB,wBAAwB,SAA0D;CAChG,OAAO;EACL,aAAa,SAAS,aAAa,UAC7B,OAAO,QAAQ,gBAAgB,YAAY,OAAO,SAAS,QAAQ,WAAW;EACpF,QAAQ,SAAS,UAAU;EAC3B,OAAO,SAAS,YAAY;EAC5B,aAAa,SAAS,eAAe;CACvC;AACF"}
@@ -0,0 +1,63 @@
1
+ import { TokenType, tokenize } from "@csstools/css-tokenizer";
2
+
3
+ // src/shared/styleUnits/value.ts
4
+ function resolveViewportUnitBase(unit) {
5
+ if (unit === "vw") return "var(--weapp-viewport-width)";
6
+ if (unit === "vh") return "var(--weapp-viewport-height)";
7
+ if (unit === "vmin") return "min(var(--weapp-viewport-width), var(--weapp-viewport-height))";
8
+ return "max(var(--weapp-viewport-width), var(--weapp-viewport-height))";
9
+ }
10
+ function nextSignificantToken(tokens, from) {
11
+ let index = from;
12
+ while (tokens[index]?.[0] === TokenType.Whitespace || tokens[index]?.[0] === TokenType.Comment) index += 1;
13
+ return index;
14
+ }
15
+ function functionArgument(tokens, from) {
16
+ const index = nextSignificantToken(tokens, from + 1);
17
+ const token = tokens[index];
18
+ const following = tokens[nextSignificantToken(tokens, index + 1)];
19
+ if (token?.[0] === TokenType.Ident && (following?.[0] === TokenType.Comma || following?.[0] === TokenType.CloseParen)) return {
20
+ index,
21
+ value: token[4].value
22
+ };
23
+ }
24
+ /** 仅转换完整单位 token;字面量及运行时视口变量的浏览器 fallback 保持原样。 */
25
+ function transformStyleValue(value, options) {
26
+ const tokens = tokenize({ css: value });
27
+ const replacements = /* @__PURE__ */ new Map();
28
+ let protectedDepth = 0;
29
+ return tokens.map((token, index) => {
30
+ if (protectedDepth > 0) {
31
+ if (token[0] === TokenType.Function || token[0] === TokenType.OpenParen) protectedDepth += 1;
32
+ else if (token[0] === TokenType.CloseParen) protectedDepth -= 1;
33
+ return token[1];
34
+ }
35
+ if (token[0] === TokenType.Function) {
36
+ const name = token[4].value.toLowerCase();
37
+ const argument = functionArgument(tokens, index);
38
+ if (name === "url" || name === "var" && (argument?.value === "--weapp-viewport-width" || argument?.value === "--weapp-viewport-height")) {
39
+ protectedDepth = 1;
40
+ return token[1];
41
+ }
42
+ if (name === "env" && argument && /^safe-area-inset-(?:top|right|bottom|left)$/i.test(argument.value)) {
43
+ replacements.set(argument.index, `--weapp-${argument.value.toLowerCase()}`);
44
+ return "var(";
45
+ }
46
+ }
47
+ const replacement = replacements.get(index);
48
+ if (replacement !== void 0) return replacement;
49
+ if (token[0] !== TokenType.Dimension || !Number.isFinite(token[4].value)) return token[1];
50
+ const numeric = token[4].value;
51
+ const unit = token[4].unit.toLowerCase();
52
+ if (unit === "rpx") {
53
+ if (options.useVariable) return `calc(var(${options.rpxVar}) * ${numeric})`;
54
+ return `${Math.round(numeric * options.ratio * 1e3) / 1e3}px`;
55
+ }
56
+ if (!options.useVariable || !/^(?:vw|vh|vmin|vmax)$/.test(unit)) return token[1];
57
+ const base = resolveViewportUnitBase(unit);
58
+ return numeric === 0 ? "0px" : numeric === 100 ? base : `calc(${base} * ${numeric} / 100)`;
59
+ }).join("");
60
+ }
61
+
62
+ export { transformStyleValue };
63
+ //# sourceMappingURL=value.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"value.mjs","names":[],"sources":["../../../src/shared/styleUnits/value.ts"],"sourcesContent":["import type { CSSToken } from '@csstools/css-tokenizer'\nimport type { ResolvedStyleUnitOptions } from './options'\nimport { tokenize, TokenType } from '@csstools/css-tokenizer'\n\nfunction resolveViewportUnitBase(unit: string) {\n if (unit === 'vw') {\n return 'var(--weapp-viewport-width)'\n }\n if (unit === 'vh') {\n return 'var(--weapp-viewport-height)'\n }\n if (unit === 'vmin') {\n return 'min(var(--weapp-viewport-width), var(--weapp-viewport-height))'\n }\n return 'max(var(--weapp-viewport-width), var(--weapp-viewport-height))'\n}\n\nfunction nextSignificantToken(tokens: CSSToken[], from: number) {\n let index = from\n while (tokens[index]?.[0] === TokenType.Whitespace || tokens[index]?.[0] === TokenType.Comment) {\n index += 1\n }\n return index\n}\n\nfunction functionArgument(tokens: CSSToken[], from: number) {\n const index = nextSignificantToken(tokens, from + 1)\n const token = tokens[index]\n const following = tokens[nextSignificantToken(tokens, index + 1)]\n if (token?.[0] === TokenType.Ident && (following?.[0] === TokenType.Comma || following?.[0] === TokenType.CloseParen)) {\n return { index, value: token[4].value }\n }\n}\n\n/** 仅转换完整单位 token;字面量及运行时视口变量的浏览器 fallback 保持原样。 */\nexport function transformStyleValue(value: string, options: ResolvedStyleUnitOptions) {\n const tokens = tokenize({ css: value })\n const replacements = new Map<number, string>()\n let protectedDepth = 0\n return tokens.map((token, index) => {\n if (protectedDepth > 0) {\n if (token[0] === TokenType.Function || token[0] === TokenType.OpenParen) {\n protectedDepth += 1\n }\n else if (token[0] === TokenType.CloseParen) {\n protectedDepth -= 1\n }\n return token[1]\n }\n if (token[0] === TokenType.Function) {\n const name = token[4].value.toLowerCase()\n const argument = functionArgument(tokens, index)\n if (name === 'url' || (name === 'var' && (argument?.value === '--weapp-viewport-width' || argument?.value === '--weapp-viewport-height'))) {\n protectedDepth = 1\n return token[1]\n }\n if (name === 'env' && argument && /^safe-area-inset-(?:top|right|bottom|left)$/i.test(argument.value)) {\n replacements.set(argument.index, `--weapp-${argument.value.toLowerCase()}`)\n return 'var('\n }\n }\n const replacement = replacements.get(index)\n if (replacement !== undefined) {\n return replacement\n }\n if (token[0] !== TokenType.Dimension || !Number.isFinite(token[4].value)) {\n return token[1]\n }\n const numeric = token[4].value\n const unit = token[4].unit.toLowerCase()\n if (unit === 'rpx') {\n if (options.useVariable) {\n return `calc(var(${options.rpxVar}) * ${numeric})`\n }\n return `${Math.round(numeric * options.ratio * 1000) / 1000}px`\n }\n if (!options.useVariable || !/^(?:vw|vh|vmin|vmax)$/.test(unit)) {\n return token[1]\n }\n const base = resolveViewportUnitBase(unit)\n return numeric === 0 ? '0px' : numeric === 100 ? base : `calc(${base} * ${numeric} / 100)`\n }).join('')\n}\n"],"mappings":";;;AAIA,SAAS,wBAAwB,MAAc;CAC7C,IAAI,SAAS,MACX,OAAO;CAET,IAAI,SAAS,MACX,OAAO;CAET,IAAI,SAAS,QACX,OAAO;CAET,OAAO;AACT;AAEA,SAAS,qBAAqB,QAAoB,MAAc;CAC9D,IAAI,QAAQ;CACZ,OAAO,OAAO,MAAM,GAAG,OAAO,UAAU,cAAc,OAAO,MAAM,GAAG,OAAO,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AM,UAAU,MAAM,EAAE,CAAC;EACzB,MAAM,OAAO,MAAM,EAAE,CAAC,KAAK,YAAY;EACvC,IAAI,SAAS,OAAO;GAClB,IAAI,QAAQ,aACV,OAAO,YAAY,QAAQ,OAAO,MAAM,QAAQ;GAElD,OAAO,GAAG,KAAK,MAAM,UAAU,QAAQ,QAAQ,GAAI,IAAI,IAAK;EAC9D;EACA,IAAI,CAAC,QAAQ,eAAe,CAAC,wBAAwB,KAAK,IAAI,GAC5D,OAAO,MAAM;EAEf,MAAM,OAAO,wBAAwB,IAAI;EACzC,OAAO,YAAY,IAAI,QAAQ,YAAY,MAAM,OAAO,QAAQ,KAAK,KAAK,QAAQ;CACpF,CAAC,CAAC,CAAC,KAAK,EAAE;AACZ"}
@@ -1,4 +1,3 @@
1
- //#region src/shared/tabBar.d.ts
2
1
  export interface WebTabBarItem {
3
2
  pagePath: string;
4
3
  text: string;
@@ -14,5 +13,4 @@ export interface WebTabBarConfig {
14
13
  custom: boolean;
15
14
  list: WebTabBarItem[];
16
15
  }
17
- //#endregion
18
16
  //# sourceMappingURL=tabBar.d.mts.map
@@ -1,4 +1,4 @@
1
- //#region src/shared/tabBar.ts
1
+ // src/shared/tabBar.ts
2
2
  function normalizeOptionalString(value) {
3
3
  return typeof value === "string" && value.trim() ? value : void 0;
4
4
  }
@@ -32,6 +32,5 @@ function normalizeWebTabBarConfig(value) {
32
32
  };
33
33
  }
34
34
 
35
- //#endregion
36
35
  export { normalizeWebTabBarConfig };
37
36
  //# sourceMappingURL=tabBar.mjs.map
@@ -1,7 +1,7 @@
1
1
  import { resolveNativeComponentWebTag } from "./nativeComponents.mjs";
2
2
  import { getSupportedMiniProgramDirectivePrefixes } from "@weapp-core/shared/platforms/runtime";
3
3
 
4
- //#region src/shared/wxml.ts
4
+ // src/shared/wxml.ts
5
5
  const CONTROL_ATTR_SUFFIXES = [
6
6
  "if",
7
7
  "elif",
@@ -65,6 +65,5 @@ function normalizeAttributeName(name) {
65
65
  return name.replace(/[A-Z]/g, (match) => `-${match.toLowerCase()}`);
66
66
  }
67
67
 
68
- //#endregion
69
68
  export { CONTROL_ATTRS, CONTROL_ATTR_PREFIXES, EVENT_KIND_ALIAS, EVENT_PREFIX_RE, SELF_CLOSING_TAGS, TEMPLATE_IMPORT_TAG_NAMES, TEMPLATE_INCLUDE_TAG_NAMES, hasControlAttribute, normalizeAttributeName, normalizeTagName, resolveControlAttributeName, resolveControlAttributeValue };
70
69
  //# sourceMappingURL=wxml.mjs.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weapp-vite/web",
3
3
  "type": "module",
4
- "version": "2.0.0",
4
+ "version": "2.1.0",
5
5
  "description": "Experimental web runtime for weapp-vite templates",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -52,7 +52,7 @@
52
52
  "dist"
53
53
  ],
54
54
  "engines": {
55
- "node": "^22.18.0 || ^24.11.0 || >=26.0.0"
55
+ "node": "^22.23.4 || ^24.22.1 || >=26.12.1"
56
56
  },
57
57
  "tsd": {
58
58
  "compilerOptions": {
@@ -62,26 +62,28 @@
62
62
  }
63
63
  },
64
64
  "dependencies": {
65
- "@babel/parser": "^8.0.7",
65
+ "@babel/parser": "^8.0.8",
66
66
  "@babel/traverse": "^8.0.7",
67
- "@babel/types": "^8.0.6",
68
- "@weapp-core/constants": "0.3.1",
69
- "@weapp-core/shared": "3.2.8",
67
+ "@babel/types": "^8.0.8",
68
+ "@csstools/css-tokenizer": "4.0.2",
69
+ "@vue/shared": "^3.5.44",
70
+ "@weapp-core/constants": "0.5.0",
71
+ "@weapp-core/shared": "3.4.0",
70
72
  "domhandler": "^6.0.1",
71
73
  "esbuild": "^0.28.2",
72
74
  "htmlparser2": "^12.0.0",
73
75
  "lit": "^3.3.3",
74
76
  "magic-string": "^1.4.3",
75
77
  "pathe": "^2.0.3",
76
- "postcss": "^8.5.29",
77
- "postcss-selector-parser": "^7.1.6",
78
- "rolldown": "1.2.13",
79
- "rolldown-require": "2.0.35",
80
- "vite": "8.3.4",
81
- "wevu": "7.5.0"
78
+ "postcss": "^8.5.31",
79
+ "postcss-selector-parser": "^7.1.7",
80
+ "rolldown": "1.2.15",
81
+ "rolldown-require": "2.1.0",
82
+ "vite": "8.3.5",
83
+ "wevu": "7.7.0"
82
84
  },
83
85
  "devDependencies": {
84
- "happy-dom": "^20.14.5"
86
+ "happy-dom": "^21.0.4"
85
87
  },
86
88
  "publishConfig": {
87
89
  "access": "public",