@weapp-vite/web 1.3.15 → 1.3.17

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 (243) hide show
  1. package/README.md +2 -2
  2. package/dist/_virtual/_rolldown/runtime.mjs +18 -0
  3. package/dist/compiler/wxml/attributes.mjs +93 -0
  4. package/dist/compiler/wxml/attributes.mjs.map +1 -0
  5. package/dist/compiler/wxml/compile.mjs +158 -0
  6. package/dist/compiler/wxml/compile.mjs.map +1 -0
  7. package/dist/compiler/wxml/dependency.mjs +31 -0
  8. package/dist/compiler/wxml/dependency.mjs.map +1 -0
  9. package/dist/compiler/wxml/interpolation.mjs +142 -0
  10. package/dist/compiler/wxml/interpolation.mjs.map +1 -0
  11. package/dist/compiler/wxml/navigation.mjs +85 -0
  12. package/dist/compiler/wxml/navigation.mjs.map +1 -0
  13. package/dist/compiler/wxml/parser.mjs +41 -0
  14. package/dist/compiler/wxml/parser.mjs.map +1 -0
  15. package/dist/compiler/wxml/renderer.mjs +114 -0
  16. package/dist/compiler/wxml/renderer.mjs.map +1 -0
  17. package/dist/compiler/wxml/specialNodes.mjs +85 -0
  18. package/dist/compiler/wxml/specialNodes.mjs.map +1 -0
  19. package/dist/compiler/wxs.mjs +83 -0
  20. package/dist/compiler/wxs.mjs.map +1 -0
  21. package/dist/css/wxss.d.mts +25 -0
  22. package/dist/css/wxss.mjs +17 -0
  23. package/dist/css/wxss.mjs.map +1 -0
  24. package/dist/index.d.mts +18 -2
  25. package/dist/index.mjs +18 -3
  26. package/dist/plugin/constants.mjs +43 -0
  27. package/dist/plugin/constants.mjs.map +1 -0
  28. package/dist/plugin/entry.mjs +29 -0
  29. package/dist/plugin/entry.mjs.map +1 -0
  30. package/dist/plugin/files.mjs +58 -0
  31. package/dist/plugin/files.mjs.map +1 -0
  32. package/dist/plugin/index.d.mts +33 -0
  33. package/dist/plugin/index.mjs +188 -0
  34. package/dist/plugin/index.mjs.map +1 -0
  35. package/dist/plugin/navigation.mjs +20 -0
  36. package/dist/plugin/navigation.mjs.map +1 -0
  37. package/dist/plugin/path.mjs +85 -0
  38. package/dist/plugin/path.mjs.map +1 -0
  39. package/dist/plugin/register.mjs +83 -0
  40. package/dist/plugin/register.mjs.map +1 -0
  41. package/dist/plugin/scan.mjs +195 -0
  42. package/dist/plugin/scan.mjs.map +1 -0
  43. package/dist/plugin/scanConfig.mjs +45 -0
  44. package/dist/plugin/scanConfig.mjs.map +1 -0
  45. package/dist/plugin/state.mjs +22 -0
  46. package/dist/plugin/state.mjs.map +1 -0
  47. package/dist/plugin/types.d.mts +46 -0
  48. package/dist/plugin.d.mts +3 -2
  49. package/dist/plugin.mjs +3 -2
  50. package/dist/runtime/button/helpers.mjs +92 -0
  51. package/dist/runtime/button/helpers.mjs.map +1 -0
  52. package/dist/runtime/button/index.d.mts +9 -0
  53. package/dist/runtime/button/index.mjs +198 -0
  54. package/dist/runtime/button/index.mjs.map +1 -0
  55. package/dist/runtime/button/style.mjs +168 -0
  56. package/dist/runtime/button/style.mjs.map +1 -0
  57. package/dist/runtime/component/behavior.mjs +98 -0
  58. package/dist/runtime/component/behavior.mjs.map +1 -0
  59. package/dist/runtime/component/constants.mjs +13 -0
  60. package/dist/runtime/component/constants.mjs.map +1 -0
  61. package/dist/runtime/component/dom.mjs +32 -0
  62. package/dist/runtime/component/dom.mjs.map +1 -0
  63. package/dist/runtime/component/element.mjs +208 -0
  64. package/dist/runtime/component/element.mjs.map +1 -0
  65. package/dist/runtime/component/events.mjs +49 -0
  66. package/dist/runtime/component/events.mjs.map +1 -0
  67. package/dist/runtime/component/index.d.mts +7 -0
  68. package/dist/runtime/component/index.mjs +44 -0
  69. package/dist/runtime/component/index.mjs.map +1 -0
  70. package/dist/runtime/component/state.mjs +63 -0
  71. package/dist/runtime/component/state.mjs.map +1 -0
  72. package/dist/runtime/component/types.d.mts +49 -0
  73. package/dist/runtime/component/utils.mjs +39 -0
  74. package/dist/runtime/component/utils.mjs.map +1 -0
  75. package/dist/runtime/execution.d.mts +7 -0
  76. package/dist/runtime/execution.mjs +37 -0
  77. package/dist/runtime/execution.mjs.map +1 -0
  78. package/dist/runtime/index.d.mts +16 -2
  79. package/dist/runtime/index.mjs +16 -2
  80. package/dist/runtime/legacyTemplate/dom.mjs +76 -0
  81. package/dist/runtime/legacyTemplate/dom.mjs.map +1 -0
  82. package/dist/runtime/legacyTemplate/expression.mjs +113 -0
  83. package/dist/runtime/legacyTemplate/expression.mjs.map +1 -0
  84. package/dist/runtime/legacyTemplate/index.d.mts +9 -0
  85. package/dist/runtime/legacyTemplate/index.mjs +132 -0
  86. package/dist/runtime/legacyTemplate/index.mjs.map +1 -0
  87. package/dist/runtime/legacyTemplate/types.d.mts +6 -0
  88. package/dist/runtime/navigationBar/index.d.mts +10 -0
  89. package/dist/runtime/navigationBar/index.mjs +162 -0
  90. package/dist/runtime/navigationBar/index.mjs.map +1 -0
  91. package/dist/runtime/navigationBar/style.mjs +108 -0
  92. package/dist/runtime/navigationBar/style.mjs.map +1 -0
  93. package/dist/runtime/polyfill/ad.mjs +150 -0
  94. package/dist/runtime/polyfill/ad.mjs.map +1 -0
  95. package/dist/runtime/polyfill/appState.mjs +31 -0
  96. package/dist/runtime/polyfill/appState.mjs.map +1 -0
  97. package/dist/runtime/polyfill/async.mjs +31 -0
  98. package/dist/runtime/polyfill/async.mjs.map +1 -0
  99. package/dist/runtime/polyfill/auth.mjs +120 -0
  100. package/dist/runtime/polyfill/auth.mjs.map +1 -0
  101. package/dist/runtime/polyfill/authApi.mjs +101 -0
  102. package/dist/runtime/polyfill/authApi.mjs.map +1 -0
  103. package/dist/runtime/polyfill/background.mjs +31 -0
  104. package/dist/runtime/polyfill/background.mjs.map +1 -0
  105. package/dist/runtime/polyfill/canvasContext.mjs +115 -0
  106. package/dist/runtime/polyfill/canvasContext.mjs.map +1 -0
  107. package/dist/runtime/polyfill/capability.mjs +20 -0
  108. package/dist/runtime/polyfill/capability.mjs.map +1 -0
  109. package/dist/runtime/polyfill/cloud.mjs +39 -0
  110. package/dist/runtime/polyfill/cloud.mjs.map +1 -0
  111. package/dist/runtime/polyfill/device.mjs +44 -0
  112. package/dist/runtime/polyfill/device.mjs.map +1 -0
  113. package/dist/runtime/polyfill/deviceApi.mjs +31 -0
  114. package/dist/runtime/polyfill/deviceApi.mjs.map +1 -0
  115. package/dist/runtime/polyfill/deviceAuthSystemApi.d.mts +102 -0
  116. package/dist/runtime/polyfill/deviceAuthSystemApi.mjs +144 -0
  117. package/dist/runtime/polyfill/deviceAuthSystemApi.mjs.map +1 -0
  118. package/dist/runtime/polyfill/filePicker.mjs +158 -0
  119. package/dist/runtime/polyfill/filePicker.mjs.map +1 -0
  120. package/dist/runtime/polyfill/fileSystemManager.mjs +45 -0
  121. package/dist/runtime/polyfill/fileSystemManager.mjs.map +1 -0
  122. package/dist/runtime/polyfill/files.mjs +118 -0
  123. package/dist/runtime/polyfill/files.mjs.map +1 -0
  124. package/dist/runtime/polyfill/index.d.mts +40 -0
  125. package/dist/runtime/polyfill/index.mjs +110 -0
  126. package/dist/runtime/polyfill/index.mjs.map +1 -0
  127. package/dist/runtime/polyfill/interaction.mjs +38 -0
  128. package/dist/runtime/polyfill/interaction.mjs.map +1 -0
  129. package/dist/runtime/polyfill/interactionApi.mjs +54 -0
  130. package/dist/runtime/polyfill/interactionApi.mjs.map +1 -0
  131. package/dist/runtime/polyfill/location.mjs +106 -0
  132. package/dist/runtime/polyfill/location.mjs.map +1 -0
  133. package/dist/runtime/polyfill/locationApi.mjs +120 -0
  134. package/dist/runtime/polyfill/locationApi.mjs.map +1 -0
  135. package/dist/runtime/polyfill/mediaActions.mjs +52 -0
  136. package/dist/runtime/polyfill/mediaActions.mjs.map +1 -0
  137. package/dist/runtime/polyfill/mediaApi/file.mjs +63 -0
  138. package/dist/runtime/polyfill/mediaApi/file.mjs.map +1 -0
  139. package/dist/runtime/polyfill/mediaApi/info.mjs +59 -0
  140. package/dist/runtime/polyfill/mediaApi/info.mjs.map +1 -0
  141. package/dist/runtime/polyfill/mediaApi/picker.mjs +82 -0
  142. package/dist/runtime/polyfill/mediaApi/picker.mjs.map +1 -0
  143. package/dist/runtime/polyfill/mediaApi/preview.mjs +39 -0
  144. package/dist/runtime/polyfill/mediaApi/preview.mjs.map +1 -0
  145. package/dist/runtime/polyfill/mediaApi/process.mjs +46 -0
  146. package/dist/runtime/polyfill/mediaApi/process.mjs.map +1 -0
  147. package/dist/runtime/polyfill/mediaInfo.mjs +136 -0
  148. package/dist/runtime/polyfill/mediaInfo.mjs.map +1 -0
  149. package/dist/runtime/polyfill/mediaPicker.mjs +213 -0
  150. package/dist/runtime/polyfill/mediaPicker.mjs.map +1 -0
  151. package/dist/runtime/polyfill/mediaProcess.mjs +65 -0
  152. package/dist/runtime/polyfill/mediaProcess.mjs.map +1 -0
  153. package/dist/runtime/polyfill/menuApi.mjs +70 -0
  154. package/dist/runtime/polyfill/menuApi.mjs.map +1 -0
  155. package/dist/runtime/polyfill/navigationBarRuntime.mjs +66 -0
  156. package/dist/runtime/polyfill/navigationBarRuntime.mjs.map +1 -0
  157. package/dist/runtime/polyfill/network/request.mjs +162 -0
  158. package/dist/runtime/polyfill/network/request.mjs.map +1 -0
  159. package/dist/runtime/polyfill/network/requestBridge.mjs +49 -0
  160. package/dist/runtime/polyfill/network/requestBridge.mjs.map +1 -0
  161. package/dist/runtime/polyfill/network/status.mjs +55 -0
  162. package/dist/runtime/polyfill/network/status.mjs.map +1 -0
  163. package/dist/runtime/polyfill/platformApi.mjs +33 -0
  164. package/dist/runtime/polyfill/platformApi.mjs.map +1 -0
  165. package/dist/runtime/polyfill/platformRuntime.mjs +120 -0
  166. package/dist/runtime/polyfill/platformRuntime.mjs.map +1 -0
  167. package/dist/runtime/polyfill/routeRuntime/dom.mjs +36 -0
  168. package/dist/runtime/polyfill/routeRuntime/dom.mjs.map +1 -0
  169. package/dist/runtime/polyfill/routeRuntime/lifecycle.mjs +83 -0
  170. package/dist/runtime/polyfill/routeRuntime/lifecycle.mjs.map +1 -0
  171. package/dist/runtime/polyfill/routeRuntime/options.d.mts +33 -0
  172. package/dist/runtime/polyfill/routeRuntime/options.mjs +76 -0
  173. package/dist/runtime/polyfill/routeRuntime/options.mjs.map +1 -0
  174. package/dist/runtime/polyfill/routeRuntime/url.mjs +35 -0
  175. package/dist/runtime/polyfill/routeRuntime/url.mjs.map +1 -0
  176. package/dist/runtime/polyfill/routeRuntime.d.mts +43 -0
  177. package/dist/runtime/polyfill/routeRuntime.mjs +202 -0
  178. package/dist/runtime/polyfill/routeRuntime.mjs.map +1 -0
  179. package/dist/runtime/polyfill/runtimeCapabilityApi.mjs +26 -0
  180. package/dist/runtime/polyfill/runtimeCapabilityApi.mjs.map +1 -0
  181. package/dist/runtime/polyfill/runtimeDataApi.d.mts +79 -0
  182. package/dist/runtime/polyfill/runtimeDataApi.mjs +134 -0
  183. package/dist/runtime/polyfill/runtimeDataApi.mjs.map +1 -0
  184. package/dist/runtime/polyfill/runtimeInfra.mjs +40 -0
  185. package/dist/runtime/polyfill/runtimeInfra.mjs.map +1 -0
  186. package/dist/runtime/polyfill/runtimeOps.mjs +62 -0
  187. package/dist/runtime/polyfill/runtimeOps.mjs.map +1 -0
  188. package/dist/runtime/polyfill/selectorQuery.mjs +204 -0
  189. package/dist/runtime/polyfill/selectorQuery.mjs.map +1 -0
  190. package/dist/runtime/polyfill/storage.mjs +103 -0
  191. package/dist/runtime/polyfill/storage.mjs.map +1 -0
  192. package/dist/runtime/polyfill/storageAsync.mjs +62 -0
  193. package/dist/runtime/polyfill/storageAsync.mjs.map +1 -0
  194. package/dist/runtime/polyfill/subscribe.mjs +30 -0
  195. package/dist/runtime/polyfill/subscribe.mjs.map +1 -0
  196. package/dist/runtime/polyfill/system.mjs +111 -0
  197. package/dist/runtime/polyfill/system.mjs.map +1 -0
  198. package/dist/runtime/polyfill/systemApi.mjs +65 -0
  199. package/dist/runtime/polyfill/systemApi.mjs.map +1 -0
  200. package/dist/runtime/polyfill/types/base.d.mts +12 -0
  201. package/dist/runtime/polyfill/types/common.d.mts +126 -0
  202. package/dist/runtime/polyfill/types/locationRuntime.d.mts +151 -0
  203. package/dist/runtime/polyfill/types/mediaAuth.d.mts +152 -0
  204. package/dist/runtime/polyfill/types/platformRuntime.d.mts +141 -0
  205. package/dist/runtime/polyfill/types/systemAuth.d.mts +122 -0
  206. package/dist/runtime/polyfill/ui.mjs +135 -0
  207. package/dist/runtime/polyfill/ui.mjs.map +1 -0
  208. package/dist/runtime/polyfill/uiFeedback.mjs +35 -0
  209. package/dist/runtime/polyfill/uiFeedback.mjs.map +1 -0
  210. package/dist/runtime/polyfill/uiMediaApi.d.mts +172 -0
  211. package/dist/runtime/polyfill/uiMediaApi.mjs +162 -0
  212. package/dist/runtime/polyfill/uiMediaApi.mjs.map +1 -0
  213. package/dist/runtime/polyfill/videoContext.mjs +56 -0
  214. package/dist/runtime/polyfill/videoContext.mjs.map +1 -0
  215. package/dist/runtime/polyfill/vkSession.mjs +58 -0
  216. package/dist/runtime/polyfill/vkSession.mjs.map +1 -0
  217. package/dist/runtime/polyfill/windowResize.mjs +39 -0
  218. package/dist/runtime/polyfill/windowResize.mjs.map +1 -0
  219. package/dist/runtime/polyfill/worker.mjs +77 -0
  220. package/dist/runtime/polyfill/worker.mjs.map +1 -0
  221. package/dist/runtime/polyfill.d.mts +5 -0
  222. package/dist/runtime/renderContext.d.mts +21 -0
  223. package/dist/runtime/renderContext.mjs +147 -0
  224. package/dist/runtime/renderContext.mjs.map +1 -0
  225. package/dist/runtime/rpx.d.mts +9 -0
  226. package/dist/runtime/rpx.mjs +27 -0
  227. package/dist/runtime/rpx.mjs.map +1 -0
  228. package/dist/runtime/style.d.mts +6 -0
  229. package/dist/runtime/style.mjs +37 -0
  230. package/dist/runtime/style.mjs.map +1 -0
  231. package/dist/runtime/template.d.mts +10 -0
  232. package/dist/runtime/warning.d.mts +10 -0
  233. package/dist/runtime/warning.mjs +43 -0
  234. package/dist/runtime/warning.mjs.map +1 -0
  235. package/dist/{slugify-B4l45KNs.mjs → shared/slugify.mjs} +3 -1
  236. package/dist/shared/slugify.mjs.map +1 -0
  237. package/dist/shared/wxml.mjs +83 -0
  238. package/dist/shared/wxml.mjs.map +1 -0
  239. package/package.json +2 -2
  240. package/dist/index-w9xxIH-l.d.mts +0 -1229
  241. package/dist/plugin-BARxSPO8.mjs +0 -1567
  242. package/dist/plugin-DP2iPVmw.d.mts +0 -96
  243. package/dist/runtime-D6j2_x_N.mjs +0 -6251
@@ -1,2 +1,16 @@
1
- import { $ as clearStorage, $t as getSystemInfoSync, A as hideTabBar, At as navigateBack, B as saveFile, Bt as checkSession, C as chooseVideo, Ct as setStorageSync, D as getImageInfo, Dt as getEnterOptionsSync, E as getClipboardData, Et as uploadFile, F as openVideoEditor, Ft as registerComponent, G as setClipboardData, Gt as getBatteryInfoSync, H as saveImageToPhotosAlbum, Ht as getAppAuthorizeSetting, I as previewImage, It as registerPage, J as showModal, Jt as getLocation, K as showActionSheet, Kt as getDeviceInfo, L as previewMedia, Lt as switchTab, M as openCustomerServiceChat, Mt as reLaunch, N as openDocument, Nt as redirectTo, O as getVideoInfo, Ot as getLaunchOptionsSync, P as openLocation, Pt as registerApp, Q as updateShareMenu, Qt as getSystemInfo, R as requestPayment, Rt as setupRpx, S as chooseMessageFile, St as setStorage, T as compressVideo, Tt as stopPullDownRefresh, U as saveVideoToPhotosAlbum, Ut as getAppBaseInfo, V as saveFileToDisk, Vt as getAccountInfoSync, W as scanCode, Wt as getBatteryInfo, X as showTabBar, Xt as getNetworkType, Y as showShareMenu, Yt as getMenuButtonBoundingClientRect, Z as showToast, Zt as getSetting, _ as chooseAddress, _n as setRuntimeWarningOptions, _t as pageScrollTo, a as createRewardedVideoAd, an as offNetworkStatusChange, at as createWorker, b as chooseLocation, bn as injectStyle, bt as removeStorageSync, c as getLogManager, cn as onWindowResize, ct as getFileSystemManager, d as reportAnalytics, dn as vibrateShort, dt as getStorageInfoSync, en as getSystemSetting, et as clearStorageSync, f as setBackgroundColor, fn as setNavigationBarMetrics, ft as getStorageSync, g as showNavigationBarLoading, gn as setRuntimeExecutionMode, gt as nextTick, h as setNavigationBarTitle, hn as getRuntimeExecutionMode, ht as navigateToMiniProgram, i as createInterstitialAd, in as login, it as createVideoContext, j as makePhoneCall, jt as navigateTo, k as hideLoading, kt as initializePageRoutes, l as getUpdateManager, ln as openAppAuthorizeSetting, lt as getStorage, m as setNavigationBarColor, mn as createRenderContext, mt as loadSubPackage, n as renderTemplate, nn as getUserProfile, nt as createSelectorQuery, o as getExtConfig, on as offWindowResize, ot as downloadFile, p as setBackgroundTextStyle, pn as defineComponent, pt as hideKeyboard, q as showLoading, qt as getFuzzyLocation, r as canIUse, rn as getWindowInfo, rt as createVKSession, s as getExtConfigSync, sn as onNetworkStatusChange, st as exitMiniProgram, t as createTemplate, tn as getUserInfo, tt as createCanvasContext, u as hideNavigationBarLoading, un as openSetting, ut as getStorageInfo, v as chooseFile, vn as ensureButtonDefined, vt as preloadSubpackage, w as compressImage, wt as startPullDownRefresh, x as chooseMedia, xn as removeStyle, xt as request, y as chooseImage, yn as setButtonFormConfig, yt as removeStorage, z as requestSubscribeMessage, zt as authorize } from "../runtime-D6j2_x_N.mjs";
2
- export { authorize, canIUse, checkSession, chooseAddress, chooseFile, chooseImage, chooseLocation, chooseMedia, chooseMessageFile, chooseVideo, clearStorage, clearStorageSync, compressImage, compressVideo, createCanvasContext, createInterstitialAd, createRenderContext, createRewardedVideoAd, createSelectorQuery, createTemplate, createVKSession, createVideoContext, createWorker, defineComponent, downloadFile, ensureButtonDefined, exitMiniProgram, getAccountInfoSync, getAppAuthorizeSetting, getAppBaseInfo, getBatteryInfo, getBatteryInfoSync, getClipboardData, getDeviceInfo, getEnterOptionsSync, getExtConfig, getExtConfigSync, getFileSystemManager, getFuzzyLocation, getImageInfo, getLaunchOptionsSync, getLocation, getLogManager, getMenuButtonBoundingClientRect, getNetworkType, getRuntimeExecutionMode, getSetting, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, getSystemInfo, getSystemInfoSync, getSystemSetting, getUpdateManager, getUserInfo, getUserProfile, getVideoInfo, getWindowInfo, hideKeyboard, hideLoading, hideNavigationBarLoading, hideTabBar, initializePageRoutes, injectStyle, loadSubPackage, login, makePhoneCall, navigateBack, navigateTo, navigateToMiniProgram, nextTick, offNetworkStatusChange, offWindowResize, onNetworkStatusChange, onWindowResize, openAppAuthorizeSetting, openCustomerServiceChat, openDocument, openLocation, openSetting, openVideoEditor, pageScrollTo, preloadSubpackage, previewImage, previewMedia, reLaunch, redirectTo, registerApp, registerComponent, registerPage, removeStorage, removeStorageSync, removeStyle, renderTemplate, reportAnalytics, request, requestPayment, requestSubscribeMessage, saveFile, saveFileToDisk, saveImageToPhotosAlbum, saveVideoToPhotosAlbum, scanCode, setBackgroundColor, setBackgroundTextStyle, setButtonFormConfig, setClipboardData, setNavigationBarColor, setNavigationBarMetrics, setNavigationBarTitle, setRuntimeExecutionMode, setRuntimeWarningOptions, setStorage, setStorageSync, setupRpx, showActionSheet, showLoading, showModal, showNavigationBarLoading, showShareMenu, showTabBar, showToast, startPullDownRefresh, stopPullDownRefresh, switchTab, updateShareMenu, uploadFile, vibrateShort };
1
+ import { injectStyle, removeStyle } from "./style.mjs";
2
+ import { ensureButtonDefined, setButtonFormConfig } from "./button/index.mjs";
3
+ import { setRuntimeWarningOptions } from "./warning.mjs";
4
+ import { getRuntimeExecutionMode, setRuntimeExecutionMode } from "./execution.mjs";
5
+ import { createRenderContext } from "./renderContext.mjs";
6
+ import { defineComponent } from "./component/index.mjs";
7
+ import { setNavigationBarMetrics } from "./navigationBar/index.mjs";
8
+ import { authorize, checkSession, getAccountInfoSync, getAppAuthorizeSetting, getAppBaseInfo, getBatteryInfo, getBatteryInfoSync, getDeviceInfo, getFuzzyLocation, getLocation, getMenuButtonBoundingClientRect, getNetworkType, getSetting, getSystemInfo, getSystemInfoSync, getSystemSetting, getUserInfo, getUserProfile, getWindowInfo, login, offNetworkStatusChange, offWindowResize, onNetworkStatusChange, onWindowResize, openAppAuthorizeSetting, openSetting, vibrateShort } from "./polyfill/deviceAuthSystemApi.mjs";
9
+ import { setupRpx } from "./rpx.mjs";
10
+ import { getEnterOptionsSync, getLaunchOptionsSync, initializePageRoutes, navigateBack, navigateTo, reLaunch, redirectTo, registerApp, registerComponent, registerPage, switchTab } from "./polyfill/routeRuntime.mjs";
11
+ import { clearStorage, clearStorageSync, createCanvasContext, createSelectorQuery, createVKSession, createVideoContext, createWorker, downloadFile, exitMiniProgram, getFileSystemManager, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, hideKeyboard, loadSubPackage, navigateToMiniProgram, nextTick, pageScrollTo, preloadSubpackage, removeStorage, removeStorageSync, request, setStorage, setStorageSync, startPullDownRefresh, stopPullDownRefresh, uploadFile } from "./polyfill/runtimeDataApi.mjs";
12
+ import { chooseAddress, chooseFile, chooseImage, chooseLocation, chooseMedia, chooseMessageFile, chooseVideo, compressImage, compressVideo, getClipboardData, getImageInfo, getVideoInfo, hideLoading, hideTabBar, makePhoneCall, openCustomerServiceChat, openDocument, openLocation, openVideoEditor, previewImage, previewMedia, requestPayment, requestSubscribeMessage, saveFile, saveFileToDisk, saveImageToPhotosAlbum, saveVideoToPhotosAlbum, scanCode, setClipboardData, showActionSheet, showLoading, showModal, showShareMenu, showTabBar, showToast, updateShareMenu } from "./polyfill/uiMediaApi.mjs";
13
+ import { canIUse, createInterstitialAd, createRewardedVideoAd, getExtConfig, getExtConfigSync, getLogManager, getUpdateManager, hideNavigationBarLoading, reportAnalytics, setBackgroundColor, setBackgroundTextStyle, setNavigationBarColor, setNavigationBarTitle, showNavigationBarLoading } from "./polyfill/index.mjs";
14
+ import { createTemplate, renderTemplate } from "./legacyTemplate/index.mjs";
15
+
16
+ export { authorize, canIUse, checkSession, chooseAddress, chooseFile, chooseImage, chooseLocation, chooseMedia, chooseMessageFile, chooseVideo, clearStorage, clearStorageSync, compressImage, compressVideo, createCanvasContext, createInterstitialAd, createRenderContext, createRewardedVideoAd, createSelectorQuery, createTemplate, createVKSession, createVideoContext, createWorker, defineComponent, downloadFile, ensureButtonDefined, exitMiniProgram, getAccountInfoSync, getAppAuthorizeSetting, getAppBaseInfo, getBatteryInfo, getBatteryInfoSync, getClipboardData, getDeviceInfo, getEnterOptionsSync, getExtConfig, getExtConfigSync, getFileSystemManager, getFuzzyLocation, getImageInfo, getLaunchOptionsSync, getLocation, getLogManager, getMenuButtonBoundingClientRect, getNetworkType, getRuntimeExecutionMode, getSetting, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, getSystemInfo, getSystemInfoSync, getSystemSetting, getUpdateManager, getUserInfo, getUserProfile, getVideoInfo, getWindowInfo, hideKeyboard, hideLoading, hideNavigationBarLoading, hideTabBar, initializePageRoutes, injectStyle, loadSubPackage, login, makePhoneCall, navigateBack, navigateTo, navigateToMiniProgram, nextTick, offNetworkStatusChange, offWindowResize, onNetworkStatusChange, onWindowResize, openAppAuthorizeSetting, openCustomerServiceChat, openDocument, openLocation, openSetting, openVideoEditor, pageScrollTo, preloadSubpackage, previewImage, previewMedia, reLaunch, redirectTo, registerApp, registerComponent, registerPage, removeStorage, removeStorageSync, removeStyle, renderTemplate, reportAnalytics, request, requestPayment, requestSubscribeMessage, saveFile, saveFileToDisk, saveImageToPhotosAlbum, saveVideoToPhotosAlbum, scanCode, setBackgroundColor, setBackgroundTextStyle, setButtonFormConfig, setClipboardData, setNavigationBarColor, setNavigationBarMetrics, setNavigationBarTitle, setRuntimeExecutionMode, setRuntimeWarningOptions, setStorage, setStorageSync, setupRpx, showActionSheet, showLoading, showModal, showNavigationBarLoading, showShareMenu, showTabBar, showToast, startPullDownRefresh, stopPullDownRefresh, switchTab, updateShareMenu, uploadFile, vibrateShort };
@@ -0,0 +1,76 @@
1
+ import { CONTROL_ATTRS, hasControlAttribute, normalizeAttributeName, resolveControlAttributeValue } from "../../shared/wxml.mjs";
2
+ import { MINI_PROGRAM_EVENT_ATTRIBUTE_PREFIX, MINI_PROGRAM_EVENT_FLAG_ATTRIBUTE_PREFIX } from "../component/constants.mjs";
3
+ import { escapeAttribute, resolveAttributeValue } from "./expression.mjs";
4
+
5
+ //#region src/runtime/legacyTemplate/dom.ts
6
+ const EVENT_PREFIX_RE = /^(bind|catch|mut-bind|capture-bind|capture-catch)([\w-]+)$/;
7
+ const EVENT_KIND_ALIAS = {
8
+ tap: "click",
9
+ longtap: "contextmenu",
10
+ longpress: "contextmenu"
11
+ };
12
+ const EVENT_PREFIX_FLAGS = {
13
+ "bind": {},
14
+ "catch": { catch: true },
15
+ "mut-bind": {},
16
+ "capture-bind": { capture: true },
17
+ "capture-catch": {
18
+ capture: true,
19
+ catch: true
20
+ }
21
+ };
22
+ function extractFor(attribs) {
23
+ const expr = resolveControlAttributeValue(attribs, "for");
24
+ const restAttribs = {};
25
+ const itemName = resolveControlAttributeValue(attribs, "for-item")?.trim() || "item";
26
+ let indexName = resolveControlAttributeValue(attribs, "for-index")?.trim() || "index";
27
+ for (const [key, val] of Object.entries(attribs)) {
28
+ if (CONTROL_ATTRS.has(key)) continue;
29
+ restAttribs[key] = val;
30
+ }
31
+ if (itemName === indexName) indexName = `${indexName}Index`;
32
+ return {
33
+ expr,
34
+ itemName,
35
+ indexName,
36
+ restAttribs
37
+ };
38
+ }
39
+ function buildAttributeString(attribs, scope) {
40
+ let result = "";
41
+ for (const [name, rawValue] of Object.entries(attribs)) {
42
+ if (CONTROL_ATTRS.has(name)) continue;
43
+ const eventMatch = EVENT_PREFIX_RE.exec(name);
44
+ if (eventMatch) {
45
+ const [, prefix, rawEvent] = eventMatch;
46
+ const event = rawEvent.toLowerCase();
47
+ const handlerName = resolveAttributeValue(rawValue, scope).trim();
48
+ if (!handlerName) continue;
49
+ const runtimeEvent = EVENT_KIND_ALIAS[event] ?? event;
50
+ const flags = EVENT_PREFIX_FLAGS[prefix] ?? {};
51
+ result += ` ${MINI_PROGRAM_EVENT_ATTRIBUTE_PREFIX}${runtimeEvent}="${escapeAttribute(handlerName)}"`;
52
+ const flagTokens = [flags.capture ? "capture" : "", flags.catch ? "catch" : ""].filter(Boolean);
53
+ if (flagTokens.length) result += ` ${MINI_PROGRAM_EVENT_FLAG_ATTRIBUTE_PREFIX}${runtimeEvent}="${flagTokens.join(",")}"`;
54
+ continue;
55
+ }
56
+ const value = resolveAttributeValue(rawValue, scope);
57
+ if (value === "") continue;
58
+ const normalizedName = normalizeAttributeName(name);
59
+ result += ` ${normalizedName}="${escapeAttribute(value)}"`;
60
+ }
61
+ return result;
62
+ }
63
+ function stripControlAttributes(attribs) {
64
+ const result = {};
65
+ for (const [name, value] of Object.entries(attribs)) if (!CONTROL_ATTRS.has(name)) result[name] = value;
66
+ return result;
67
+ }
68
+ function isConditionalElement(node) {
69
+ if (node.type !== "tag") return false;
70
+ const attribs = node.attribs ?? {};
71
+ return hasControlAttribute(attribs, "if") || hasControlAttribute(attribs, "elif") || hasControlAttribute(attribs, "else");
72
+ }
73
+
74
+ //#endregion
75
+ export { buildAttributeString, extractFor, isConditionalElement, stripControlAttributes };
76
+ //# sourceMappingURL=dom.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom.mjs","names":[],"sources":["../../../src/runtime/legacyTemplate/dom.ts"],"sourcesContent":["import type { Element, Node } from 'domhandler'\nimport type { ExtractForResult, LegacyTemplateScope } from './types'\nimport {\n CONTROL_ATTRS,\n hasControlAttribute,\n normalizeAttributeName,\n resolveControlAttributeValue,\n} from '../../shared/wxml'\nimport {\n MINI_PROGRAM_EVENT_ATTRIBUTE_PREFIX,\n MINI_PROGRAM_EVENT_FLAG_ATTRIBUTE_PREFIX,\n} from '../component/constants'\nimport { escapeAttribute, resolveAttributeValue } from './expression'\n\nconst EVENT_PREFIX_RE = /^(bind|catch|mut-bind|capture-bind|capture-catch)([\\w-]+)$/\nconst EVENT_KIND_ALIAS: Record<string, string> = {\n tap: 'click',\n longtap: 'contextmenu',\n longpress: 'contextmenu',\n}\n\nconst EVENT_PREFIX_FLAGS: Record<string, { catch?: boolean, capture?: boolean }> = {\n 'bind': {},\n 'catch': { catch: true },\n 'mut-bind': {},\n 'capture-bind': { capture: true },\n 'capture-catch': { capture: true, catch: true },\n}\n\nexport function extractFor(attribs: Record<string, string>): ExtractForResult {\n const expr = resolveControlAttributeValue(attribs, 'for')\n const restAttribs: Record<string, string> = {}\n const itemName = resolveControlAttributeValue(attribs, 'for-item')?.trim() || 'item'\n let indexName = resolveControlAttributeValue(attribs, 'for-index')?.trim() || 'index'\n\n for (const [key, val] of Object.entries(attribs)) {\n if (CONTROL_ATTRS.has(key)) {\n continue\n }\n restAttribs[key] = val\n }\n\n if (itemName === indexName) {\n indexName = `${indexName}Index`\n }\n\n return {\n expr,\n itemName,\n indexName,\n restAttribs,\n }\n}\n\nexport function buildAttributeString(\n attribs: Record<string, string>,\n scope: LegacyTemplateScope,\n) {\n let result = ''\n for (const [name, rawValue] of Object.entries(attribs)) {\n if (CONTROL_ATTRS.has(name)) {\n continue\n }\n\n const eventMatch = EVENT_PREFIX_RE.exec(name)\n if (eventMatch) {\n const [, prefix, rawEvent] = eventMatch\n const event = rawEvent.toLowerCase()\n const handlerName = resolveAttributeValue(rawValue, scope).trim()\n if (!handlerName) {\n continue\n }\n const runtimeEvent = EVENT_KIND_ALIAS[event] ?? event\n const flags = EVENT_PREFIX_FLAGS[prefix] ?? {}\n result += ` ${MINI_PROGRAM_EVENT_ATTRIBUTE_PREFIX}${runtimeEvent}=\"${escapeAttribute(handlerName)}\"`\n const flagTokens = [\n flags.capture ? 'capture' : '',\n flags.catch ? 'catch' : '',\n ].filter(Boolean)\n if (flagTokens.length) {\n result += ` ${MINI_PROGRAM_EVENT_FLAG_ATTRIBUTE_PREFIX}${runtimeEvent}=\"${flagTokens.join(',')}\"`\n }\n continue\n }\n\n const value = resolveAttributeValue(rawValue, scope)\n if (value === '') {\n continue\n }\n const normalizedName = normalizeAttributeName(name)\n result += ` ${normalizedName}=\"${escapeAttribute(value)}\"`\n }\n return result\n}\n\nexport function stripControlAttributes(attribs: Record<string, string>) {\n const result: Record<string, string> = {}\n for (const [name, value] of Object.entries(attribs)) {\n if (!CONTROL_ATTRS.has(name)) {\n result[name] = value\n }\n }\n return result\n}\n\nexport function isConditionalElement(node: Node): node is Element {\n if (node.type !== 'tag') {\n return false\n }\n const attribs = (node as Element).attribs ?? {}\n return hasControlAttribute(attribs, 'if')\n || hasControlAttribute(attribs, 'elif')\n || hasControlAttribute(attribs, 'else')\n}\n"],"mappings":";;;;;AAcA,MAAM,kBAAkB;AACxB,MAAM,mBAA2C;CAC/C,KAAK;CACL,SAAS;CACT,WAAW;CACZ;AAED,MAAM,qBAA6E;CACjF,QAAQ,EAAE;CACV,SAAS,EAAE,OAAO,MAAM;CACxB,YAAY,EAAE;CACd,gBAAgB,EAAE,SAAS,MAAM;CACjC,iBAAiB;EAAE,SAAS;EAAM,OAAO;EAAM;CAChD;AAED,SAAgB,WAAW,SAAmD;CAC5E,MAAM,OAAO,6BAA6B,SAAS,MAAM;CACzD,MAAM,cAAsC,EAAE;CAC9C,MAAM,WAAW,6BAA6B,SAAS,WAAW,EAAE,MAAM,IAAI;CAC9E,IAAI,YAAY,6BAA6B,SAAS,YAAY,EAAE,MAAM,IAAI;AAE9E,MAAK,MAAM,CAAC,KAAK,QAAQ,OAAO,QAAQ,QAAQ,EAAE;AAChD,MAAI,cAAc,IAAI,IAAI,CACxB;AAEF,cAAY,OAAO;;AAGrB,KAAI,aAAa,UACf,aAAY,GAAG,UAAU;AAG3B,QAAO;EACL;EACA;EACA;EACA;EACD;;AAGH,SAAgB,qBACd,SACA,OACA;CACA,IAAI,SAAS;AACb,MAAK,MAAM,CAAC,MAAM,aAAa,OAAO,QAAQ,QAAQ,EAAE;AACtD,MAAI,cAAc,IAAI,KAAK,CACzB;EAGF,MAAM,aAAa,gBAAgB,KAAK,KAAK;AAC7C,MAAI,YAAY;GACd,MAAM,GAAG,QAAQ,YAAY;GAC7B,MAAM,QAAQ,SAAS,aAAa;GACpC,MAAM,cAAc,sBAAsB,UAAU,MAAM,CAAC,MAAM;AACjE,OAAI,CAAC,YACH;GAEF,MAAM,eAAe,iBAAiB,UAAU;GAChD,MAAM,QAAQ,mBAAmB,WAAW,EAAE;AAC9C,aAAU,IAAI,sCAAsC,aAAa,IAAI,gBAAgB,YAAY,CAAC;GAClG,MAAM,aAAa,CACjB,MAAM,UAAU,YAAY,IAC5B,MAAM,QAAQ,UAAU,GACzB,CAAC,OAAO,QAAQ;AACjB,OAAI,WAAW,OACb,WAAU,IAAI,2CAA2C,aAAa,IAAI,WAAW,KAAK,IAAI,CAAC;AAEjG;;EAGF,MAAM,QAAQ,sBAAsB,UAAU,MAAM;AACpD,MAAI,UAAU,GACZ;EAEF,MAAM,iBAAiB,uBAAuB,KAAK;AACnD,YAAU,IAAI,eAAe,IAAI,gBAAgB,MAAM,CAAC;;AAE1D,QAAO;;AAGT,SAAgB,uBAAuB,SAAiC;CACtE,MAAM,SAAiC,EAAE;AACzC,MAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,QAAQ,CACjD,KAAI,CAAC,cAAc,IAAI,KAAK,CAC1B,QAAO,QAAQ;AAGnB,QAAO;;AAGT,SAAgB,qBAAqB,MAA6B;AAChE,KAAI,KAAK,SAAS,MAChB,QAAO;CAET,MAAM,UAAW,KAAiB,WAAW,EAAE;AAC/C,QAAO,oBAAoB,SAAS,KAAK,IACpC,oBAAoB,SAAS,OAAO,IACpC,oBAAoB,SAAS,OAAO"}
@@ -0,0 +1,113 @@
1
+ import { getRuntimeExecutionMode, warnRuntimeExecutionOnce } from "../execution.mjs";
2
+
3
+ //#region src/runtime/legacyTemplate/expression.ts
4
+ const expressionCache = /* @__PURE__ */ new Map();
5
+ function createScope(initial) {
6
+ return Object.assign(Object.create(null), initial ?? {});
7
+ }
8
+ function createChildScope(parent) {
9
+ return Object.assign(Object.create(parent), {});
10
+ }
11
+ function normalizeList(value) {
12
+ if (Array.isArray(value)) return value;
13
+ if (value == null) return [];
14
+ if (typeof value === "number" && Number.isFinite(value)) {
15
+ const length = Math.max(0, Math.floor(value));
16
+ return Array.from({ length }, (_, index) => index);
17
+ }
18
+ if (typeof value === "object") return Object.values(value);
19
+ return [];
20
+ }
21
+ function escapeHtml(value) {
22
+ return value.replace(/[&<>"']/g, (match) => {
23
+ switch (match) {
24
+ case "&": return "&amp;";
25
+ case "<": return "&lt;";
26
+ case ">": return "&gt;";
27
+ case "\"": return "&quot;";
28
+ case "'": return "&#39;";
29
+ default: return match;
30
+ }
31
+ });
32
+ }
33
+ function escapeAttribute(value) {
34
+ return escapeHtml(value);
35
+ }
36
+ function toDisplayString(value) {
37
+ if (value == null) return "";
38
+ if (typeof value === "object") {
39
+ if (value instanceof Date) return value.toISOString();
40
+ try {
41
+ return JSON.stringify(value);
42
+ } catch {
43
+ return String(value);
44
+ }
45
+ }
46
+ return String(value);
47
+ }
48
+ function unwrapExpression(expression) {
49
+ const trimmed = expression.trim();
50
+ if (trimmed.startsWith("{{") && trimmed.endsWith("}}")) return trimmed.slice(2, -2).trim();
51
+ return trimmed;
52
+ }
53
+ function evaluateExpression(expression, scope) {
54
+ if (!expression) return;
55
+ const trimmed = unwrapExpression(expression);
56
+ if (!trimmed) return;
57
+ let evaluator = expressionCache.get(trimmed);
58
+ if (!evaluator) {
59
+ try {
60
+ evaluator = new Function("scope", `with(scope){ return (${trimmed}); }`);
61
+ } catch (error) {
62
+ const reason = error instanceof Error ? error.message : String(error);
63
+ if (getRuntimeExecutionMode() === "safe") {
64
+ warnRuntimeExecutionOnce(`safe-legacy-expression-parse:${trimmed}`, `[@weapp-vite/web] safe 模式下忽略表达式解析错误 "${trimmed}": ${reason}`);
65
+ evaluator = () => void 0;
66
+ } else throw new SyntaxError(`[@weapp-vite/web] 无法解析表达式 "${trimmed}": ${reason}`);
67
+ }
68
+ if (evaluator) expressionCache.set(trimmed, evaluator);
69
+ }
70
+ try {
71
+ return evaluator?.(scope);
72
+ } catch (error) {
73
+ const mode = getRuntimeExecutionMode();
74
+ if (mode === "strict") {
75
+ const reason = error instanceof Error ? error.message : String(error);
76
+ throw new Error(`[@weapp-vite/web] strict 模式下表达式执行失败 "${trimmed}": ${reason}`);
77
+ }
78
+ if (mode === "safe") {
79
+ const reason = error instanceof Error ? error.message : String(error);
80
+ warnRuntimeExecutionOnce(`safe-legacy-expression-runtime:${trimmed}`, `[@weapp-vite/web] safe 模式下忽略表达式执行错误 "${trimmed}": ${reason}`);
81
+ }
82
+ return;
83
+ }
84
+ }
85
+ function interpolateText(source, scope, escapeResult) {
86
+ if (!source.includes("{{")) return escapeResult ? escapeHtml(source) : source;
87
+ let cursor = 0;
88
+ let buffer = "";
89
+ while (cursor < source.length) {
90
+ const start = source.indexOf("{{", cursor);
91
+ if (start === -1) {
92
+ buffer += source.slice(cursor);
93
+ break;
94
+ }
95
+ buffer += source.slice(cursor, start);
96
+ const end = source.indexOf("}}", start + 2);
97
+ if (end === -1) {
98
+ buffer += source.slice(start);
99
+ break;
100
+ }
101
+ const evaluated = toDisplayString(evaluateExpression(source.slice(start + 2, end).trim(), scope));
102
+ buffer += evaluated;
103
+ cursor = end + 2;
104
+ }
105
+ return escapeResult ? escapeHtml(buffer) : buffer;
106
+ }
107
+ function resolveAttributeValue(value, scope) {
108
+ return interpolateText(value ?? "", scope, false);
109
+ }
110
+
111
+ //#endregion
112
+ export { createChildScope, createScope, escapeAttribute, evaluateExpression, interpolateText, normalizeList, resolveAttributeValue };
113
+ //# sourceMappingURL=expression.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expression.mjs","names":[],"sources":["../../../src/runtime/legacyTemplate/expression.ts"],"sourcesContent":["import type { LegacyTemplateScope } from './types'\nimport { getRuntimeExecutionMode, warnRuntimeExecutionOnce } from '../execution'\n\nconst expressionCache = new Map<string, (scope: LegacyTemplateScope) => any>()\n\nexport function createScope(initial?: LegacyTemplateScope) {\n return Object.assign(Object.create(null), initial ?? {})\n}\n\nexport function createChildScope(parent: LegacyTemplateScope) {\n return Object.assign(Object.create(parent), {})\n}\n\nexport function normalizeList(value: any): any[] {\n if (Array.isArray(value)) {\n return value\n }\n if (value == null) {\n return []\n }\n if (typeof value === 'number' && Number.isFinite(value)) {\n const length = Math.max(0, Math.floor(value))\n return Array.from({ length }, (_, index) => index)\n }\n if (typeof value === 'object') {\n return Object.values(value)\n }\n return []\n}\n\nexport function escapeHtml(value: string) {\n return value.replace(/[&<>\"']/g, (match) => {\n switch (match) {\n case '&':\n return '&amp;'\n case '<':\n return '&lt;'\n case '>':\n return '&gt;'\n case '\"':\n return '&quot;'\n case '\\'':\n return '&#39;'\n default:\n return match\n }\n })\n}\n\nexport function escapeAttribute(value: string) {\n return escapeHtml(value)\n}\n\nfunction toDisplayString(value: any) {\n if (value == null) {\n return ''\n }\n if (typeof value === 'object') {\n if (value instanceof Date) {\n return value.toISOString()\n }\n try {\n return JSON.stringify(value)\n }\n catch {\n return String(value)\n }\n }\n return String(value)\n}\n\nfunction unwrapExpression(expression: string) {\n const trimmed = expression.trim()\n if (trimmed.startsWith('{{') && trimmed.endsWith('}}')) {\n return trimmed.slice(2, -2).trim()\n }\n return trimmed\n}\n\nexport function evaluateExpression(expression: string, scope: LegacyTemplateScope) {\n if (!expression) {\n return undefined\n }\n const trimmed = unwrapExpression(expression)\n if (!trimmed) {\n return undefined\n }\n let evaluator = expressionCache.get(trimmed)\n if (!evaluator) {\n try {\n // eslint-disable-next-line no-new-func -- dynamic expressions are required for template evaluation\n evaluator = new Function('scope', `with(scope){ return (${trimmed}); }`) as (scope: LegacyTemplateScope) => any\n }\n catch (error) {\n const reason = error instanceof Error ? error.message : String(error)\n const mode = getRuntimeExecutionMode()\n if (mode === 'safe') {\n warnRuntimeExecutionOnce(\n `safe-legacy-expression-parse:${trimmed}`,\n `[@weapp-vite/web] safe 模式下忽略表达式解析错误 \"${trimmed}\": ${reason}`,\n )\n evaluator = () => undefined\n }\n else {\n throw new SyntaxError(`[@weapp-vite/web] 无法解析表达式 \"${trimmed}\": ${reason}`)\n }\n }\n if (evaluator) {\n expressionCache.set(trimmed, evaluator)\n }\n }\n try {\n return evaluator?.(scope)\n }\n catch (error) {\n const mode = getRuntimeExecutionMode()\n if (mode === 'strict') {\n const reason = error instanceof Error ? error.message : String(error)\n throw new Error(`[@weapp-vite/web] strict 模式下表达式执行失败 \"${trimmed}\": ${reason}`)\n }\n if (mode === 'safe') {\n const reason = error instanceof Error ? error.message : String(error)\n warnRuntimeExecutionOnce(\n `safe-legacy-expression-runtime:${trimmed}`,\n `[@weapp-vite/web] safe 模式下忽略表达式执行错误 \"${trimmed}\": ${reason}`,\n )\n }\n return undefined\n }\n}\n\nexport function interpolateText(source: string, scope: LegacyTemplateScope, escapeResult: boolean) {\n if (!source.includes('{{')) {\n return escapeResult ? escapeHtml(source) : source\n }\n\n let cursor = 0\n let buffer = ''\n\n while (cursor < source.length) {\n const start = source.indexOf('{{', cursor)\n if (start === -1) {\n buffer += source.slice(cursor)\n break\n }\n\n buffer += source.slice(cursor, start)\n\n const end = source.indexOf('}}', start + 2)\n if (end === -1) {\n buffer += source.slice(start)\n break\n }\n\n const expression = source.slice(start + 2, end).trim()\n const evaluated = toDisplayString(evaluateExpression(expression, scope))\n buffer += evaluated\n cursor = end + 2\n }\n\n return escapeResult ? escapeHtml(buffer) : buffer\n}\n\nexport function resolveAttributeValue(value: string, scope: LegacyTemplateScope) {\n return interpolateText(value ?? '', scope, false)\n}\n"],"mappings":";;;AAGA,MAAM,kCAAkB,IAAI,KAAkD;AAE9E,SAAgB,YAAY,SAA+B;AACzD,QAAO,OAAO,OAAO,OAAO,OAAO,KAAK,EAAE,WAAW,EAAE,CAAC;;AAG1D,SAAgB,iBAAiB,QAA6B;AAC5D,QAAO,OAAO,OAAO,OAAO,OAAO,OAAO,EAAE,EAAE,CAAC;;AAGjD,SAAgB,cAAc,OAAmB;AAC/C,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAO;AAET,KAAI,SAAS,KACX,QAAO,EAAE;AAEX,KAAI,OAAO,UAAU,Y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O,MAAM"}
@@ -0,0 +1,9 @@
1
+ import { LegacyTemplateRenderer, LegacyTemplateScope } from "./types.mjs";
2
+ import { ChildNode } from "domhandler";
3
+
4
+ //#region src/runtime/legacyTemplate/index.d.ts
5
+ declare function renderTemplate(nodes: ChildNode[], scope?: LegacyTemplateScope): string;
6
+ declare function createTemplate(source: string): LegacyTemplateRenderer;
7
+ //#endregion
8
+ export { createTemplate, renderTemplate };
9
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1,132 @@
1
+ import { SELF_CLOSING_TAGS, hasControlAttribute, normalizeTagName, resolveControlAttributeValue } from "../../shared/wxml.mjs";
2
+ import { createChildScope, createScope, evaluateExpression, interpolateText, normalizeList } from "./expression.mjs";
3
+ import { buildAttributeString, extractFor, isConditionalElement, stripControlAttributes } from "./dom.mjs";
4
+ import { parseDocument } from "htmlparser2";
5
+
6
+ //#region src/runtime/legacyTemplate/index.ts
7
+ const templateCache = /* @__PURE__ */ new Map();
8
+ function filterRenderableNode(node) {
9
+ if (node.type === "directive" || node.type === "comment") return false;
10
+ if (node.type === "text") return (node.data ?? "").trim().length > 0;
11
+ return true;
12
+ }
13
+ function getOrParseTemplate(source) {
14
+ let cached = templateCache.get(source);
15
+ if (!cached) {
16
+ cached = (parseDocument(source, {
17
+ xmlMode: true,
18
+ decodeEntities: true,
19
+ recognizeSelfClosing: true
20
+ }).children ?? []).filter(filterRenderableNode);
21
+ templateCache.set(source, cached);
22
+ }
23
+ return cached;
24
+ }
25
+ function renderConditionalSequence(nodes, startIndex, scope, renderChildren) {
26
+ const branches = [];
27
+ let cursor = startIndex;
28
+ while (cursor < nodes.length) {
29
+ const candidate = nodes[cursor];
30
+ if (!isConditionalElement(candidate)) break;
31
+ const element = candidate;
32
+ const attribs = element.attribs ?? {};
33
+ if (branches.length === 0 && !hasControlAttribute(attribs, "if")) break;
34
+ if (branches.length > 0 && !hasControlAttribute(attribs, "elif") && !hasControlAttribute(attribs, "else")) break;
35
+ branches.push({
36
+ node: element,
37
+ attribs
38
+ });
39
+ cursor += 1;
40
+ if (hasControlAttribute(attribs, "else")) break;
41
+ }
42
+ if (!branches.length) {
43
+ const node = nodes[startIndex];
44
+ return {
45
+ rendered: renderChildren(node, scope),
46
+ endIndex: startIndex
47
+ };
48
+ }
49
+ for (const { node, attribs } of branches) {
50
+ if (hasControlAttribute(attribs, "else")) return {
51
+ rendered: renderElement(node, scope, renderChildren, { overrideAttribs: stripControlAttributes(attribs) }),
52
+ endIndex: startIndex + branches.length - 1
53
+ };
54
+ const conditionExpr = resolveControlAttributeValue(attribs, "if") ?? resolveControlAttributeValue(attribs, "elif");
55
+ if (!conditionExpr) continue;
56
+ if (evaluateExpression(conditionExpr, scope)) return {
57
+ rendered: renderElement(node, scope, renderChildren, { overrideAttribs: stripControlAttributes(attribs) }),
58
+ endIndex: startIndex + branches.length - 1
59
+ };
60
+ }
61
+ return {
62
+ rendered: "",
63
+ endIndex: startIndex + branches.length - 1
64
+ };
65
+ }
66
+ function renderElement(node, scope, renderChildren, options = {}) {
67
+ const attribs = node.attribs ?? {};
68
+ if (!options.skipFor) {
69
+ const forExtract = extractFor(attribs);
70
+ if (forExtract.expr) {
71
+ const list = normalizeList(evaluateExpression(forExtract.expr, scope));
72
+ if (!list.length) return "";
73
+ let buffer = "";
74
+ for (let idx = 0; idx < list.length; idx++) {
75
+ const item = list[idx];
76
+ const childScope = createChildScope(scope);
77
+ childScope[forExtract.itemName] = item;
78
+ childScope[forExtract.indexName] = idx;
79
+ buffer += renderElement(node, childScope, renderChildren, {
80
+ skipFor: true,
81
+ overrideAttribs: forExtract.restAttribs
82
+ });
83
+ }
84
+ return buffer;
85
+ }
86
+ }
87
+ const effectiveAttribs = options.overrideAttribs ?? attribs;
88
+ const normalizedTag = normalizeTagName(node.name);
89
+ if (normalizedTag === "#fragment") return renderChildren(node.children, scope);
90
+ const attrs = buildAttributeString(effectiveAttribs, scope);
91
+ const children = renderChildren(node.children, scope);
92
+ if (SELF_CLOSING_TAGS.has(normalizedTag) && !children) return `<${normalizedTag}${attrs} />`;
93
+ return `<${normalizedTag}${attrs}>${children}</${normalizedTag}>`;
94
+ }
95
+ function renderTextNode(node, scope) {
96
+ const value = node.data ?? "";
97
+ if (!value.trim()) return "";
98
+ return interpolateText(value, scope, true);
99
+ }
100
+ function renderTree(input, scope) {
101
+ if (!input) return "";
102
+ if (Array.isArray(input)) {
103
+ let buffer = "";
104
+ for (let index = 0; index < input.length; index++) {
105
+ const node = input[index];
106
+ if (isConditionalElement(node)) {
107
+ const { rendered, endIndex } = renderConditionalSequence(input, index, scope, renderTree);
108
+ buffer += rendered;
109
+ index = endIndex;
110
+ continue;
111
+ }
112
+ buffer += renderTree(node, scope);
113
+ }
114
+ return buffer;
115
+ }
116
+ const node = input;
117
+ if (node.type === "text") return renderTextNode(node, scope);
118
+ if (node.type === "tag" || node.type === "script" || node.type === "style") return renderElement(node, scope, renderTree);
119
+ if ("children" in node && node.children?.length) return renderTree(node.children, scope);
120
+ return "";
121
+ }
122
+ function renderTemplate(nodes, scope) {
123
+ return renderTree(nodes, createScope(scope));
124
+ }
125
+ function createTemplate(source) {
126
+ const nodes = getOrParseTemplate(source);
127
+ return (scope) => renderTemplate(nodes, scope);
128
+ }
129
+
130
+ //#endregion
131
+ export { createTemplate, renderTemplate };
132
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/runtime/legacyTemplate/index.ts"],"sourcesContent":["import type { ChildNode, DataNode, Element, Node } from 'domhandler'\nimport type {\n LegacyTemplateRenderer,\n LegacyTemplateScope,\n RenderOptions,\n} from './types'\nimport { parseDocument } from 'htmlparser2'\nimport {\n hasControlAttribute,\n normalizeTagName,\n resolveControlAttributeValue,\n SELF_CLOSING_TAGS,\n} from '../../shared/wxml'\nimport {\n buildAttributeString,\n extractFor,\n isConditionalElement,\n stripControlAttributes,\n} from './dom'\nimport {\n createChildScope,\n createScope,\n evaluateExpression,\n interpolateText,\n normalizeList,\n} from './expression'\n\nconst templateCache = new Map<string, ChildNode[]>()\n\nfunction filterRenderableNode(node: Node) {\n if (node.type === 'directive' || node.type === 'comment') {\n return false\n }\n if (node.type === 'text') {\n const data = (node as DataNode).data ?? ''\n return data.trim().length > 0\n }\n return true\n}\n\nfunction getOrParseTemplate(source: string) {\n let cached = templateCache.get(source)\n if (!cached) {\n const document = parseDocument(source, {\n xmlMode: true,\n decodeEntities: true,\n recognizeSelfClosing: true,\n })\n cached = (document.children ?? []).filter(filterRenderableNode)\n templateCache.set(source, cached)\n }\n return cached\n}\n\nfunction renderConditionalSequence(\n nodes: ChildNode[],\n startIndex: number,\n scope: LegacyTemplateScope,\n renderChildren: (input: ChildNode[] | ChildNode | undefined, scope: LegacyTemplateScope) => string,\n) {\n const branches: Array<{ node: Element, attribs: Record<string, string> }> = []\n let cursor = startIndex\n\n while (cursor < nodes.length) {\n const candidate = nodes[cursor]\n if (!isConditionalElement(candidate)) {\n break\n }\n const element = candidate as Element\n const attribs = element.attribs ?? {}\n if (branches.length === 0 && !hasControlAttribute(attribs, 'if')) {\n break\n }\n if (branches.length > 0 && !hasControlAttribute(attribs, 'elif') && !hasControlAttribute(attribs, 'else')) {\n break\n }\n branches.push({ node: element, attribs })\n cursor += 1\n if (hasControlAttribute(attribs, 'else')) {\n break\n }\n }\n\n if (!branches.length) {\n const node = nodes[startIndex]\n return {\n rendered: renderChildren(node, scope),\n endIndex: startIndex,\n }\n }\n\n for (const { node, attribs } of branches) {\n if (hasControlAttribute(attribs, 'else')) {\n return {\n // eslint-disable-next-line ts/no-use-before-define -- 条件分支与普通节点复用同一元素渲染逻辑。\n rendered: renderElement(\n node,\n scope,\n renderChildren,\n { overrideAttribs: stripControlAttributes(attribs) },\n ),\n endIndex: startIndex + branches.length - 1,\n }\n }\n const conditionExpr = resolveControlAttributeValue(attribs, 'if')\n ?? resolveControlAttributeValue(attribs, 'elif')\n if (!conditionExpr) {\n continue\n }\n const condition = evaluateExpression(conditionExpr, scope)\n if (condition) {\n return {\n // eslint-disable-next-line ts/no-use-before-define -- 条件分支与普通节点复用同一元素渲染逻辑。\n rendered: renderElement(\n node,\n scope,\n renderChildren,\n { overrideAttribs: stripControlAttributes(attribs) },\n ),\n endIndex: startIndex + branches.length - 1,\n }\n }\n }\n\n return {\n rendered: '',\n endIndex: startIndex + branches.length - 1,\n }\n}\n\nfunction renderElement(\n node: Element,\n scope: LegacyTemplateScope,\n renderChildren: (nodes: ChildNode[] | undefined, scope: LegacyTemplateScope) => string,\n options: RenderOptions = {},\n) {\n const attribs = node.attribs ?? {}\n if (!options.skipFor) {\n const forExtract = extractFor(attribs)\n if (forExtract.expr) {\n const list = normalizeList(evaluateExpression(forExtract.expr, scope))\n if (!list.length) {\n return ''\n }\n let buffer = ''\n for (let idx = 0; idx < list.length; idx++) {\n const item = list[idx]\n const childScope = createChildScope(scope)\n childScope[forExtract.itemName] = item\n childScope[forExtract.indexName] = idx\n buffer += renderElement(node, childScope, renderChildren, {\n skipFor: true,\n overrideAttribs: forExtract.restAttribs,\n })\n }\n return buffer\n }\n }\n\n const effectiveAttribs = options.overrideAttribs ?? attribs\n const normalizedTag = normalizeTagName(node.name)\n if (normalizedTag === '#fragment') {\n return renderChildren(node.children, scope)\n }\n\n const attrs = buildAttributeString(effectiveAttribs, scope)\n const children = renderChildren(node.children, scope)\n\n if (SELF_CLOSING_TAGS.has(normalizedTag) && !children) {\n return `<${normalizedTag}${attrs} />`\n }\n\n return `<${normalizedTag}${attrs}>${children}</${normalizedTag}>`\n}\n\nfunction renderTextNode(node: DataNode, scope: LegacyTemplateScope) {\n const value = node.data ?? ''\n if (!value.trim()) {\n return ''\n }\n return interpolateText(value, scope, true)\n}\n\nfunction renderTree(\n input: ChildNode[] | ChildNode | undefined,\n scope: LegacyTemplateScope,\n): string {\n if (!input) {\n return ''\n }\n\n if (Array.isArray(input)) {\n let buffer = ''\n for (let index = 0; index < input.length; index++) {\n const node = input[index]\n if (isConditionalElement(node)) {\n const { rendered, endIndex } = renderConditionalSequence(input, index, scope, renderTree)\n buffer += rendered\n index = endIndex\n continue\n }\n buffer += renderTree(node, scope)\n }\n return buffer\n }\n\n const node = input\n if (node.type === 'text') {\n return renderTextNode(node as DataNode, scope)\n }\n if (node.type === 'tag' || node.type === 'script' || node.type === 'style') {\n return renderElement(node as Element, scope, renderTree)\n }\n if ('children' in node && node.children?.length) {\n return renderTree(node.children, scope)\n }\n return ''\n}\n\nexport function renderTemplate(nodes: ChildNode[], scope?: LegacyTemplateScope) {\n const renderScope = createScope(scope)\n return renderTree(nodes, renderScope)\n}\n\nexport function createTemplate(source: string): LegacyTemplateRenderer {\n const nodes = getOrParseTemplate(source)\n return (scope?: LegacyTemplateScope) => renderTemplate(nodes, scope)\n}\n\nexport type { LegacyTemplateRenderer, LegacyTemplateScope } from './types'\n"],"mappings":";;;;;;AA2BA,MAAM,gCAAgB,IAAI,KAA0B;AAEpD,SAAS,qBAAqB,MAAY;AACxC,KAAI,KAAK,SAAS,eAAe,KAAK,SAAS,UAC7C,QAAO;AAET,KAAI,KAAK,SAAS,OAEhB,SADc,KAAkB,QAAQ,IAC5B,MAAM,CAAC,SAAS;AAE9B,QAAO;;AAGT,SAAS,mBAAmB,QAAgB;CAC1C,IAAI,SAAS,cAAc,IAAI,OAAO;AACtC,KAAI,CAAC,QAAQ;AAMX,YALiB,cAAc,QAAQ;GACrC,SAAS;GACT,gBAAgB;GAChB,sBAAsB;GACvB,CAAC,CACiB,YAAY,EAAE,EAAE,OAAO,qBAAqB;AAC/D,gBAAc,IAAI,QAAQ,OAAO;;AAEnC,QAAO;;AAGT,SAAS,0BACP,OACA,YACA,OACA,gBACA;CACA,MAAM,WAAsE,EAAE;CAC9E,IAAI,SAAS;AAEb,QAAO,SAAS,MAAM,QAAQ;EAC5B,MAAM,YAAY,MAAM;AACxB,MAAI,CAAC,qBAAqB,UAAU,CAClC;EAEF,MAAM,UAAU;EAChB,MAAM,UAAU,QAAQ,WAAW,EAAE;AACrC,MAA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,cAAc,QAAQ,KAAK,UAAU,OACvC,QAAO,WAAW,KAAK,UAAU,MAAM;AAEzC,QAAO;;AAGT,SAAgB,eAAe,OAAoB,OAA6B;AAE9E,QAAO,WAAW,OADE,YAAY,MAAM,CACD;;AAGvC,SAAgB,eAAe,QAAwC;CACrE,MAAM,QAAQ,mBAAmB,OAAO;AACxC,SAAQ,UAAgC,eAAe,OAAO,MAAM"}
@@ -0,0 +1,6 @@
1
+ //#region src/runtime/legacyTemplate/types.d.ts
2
+ type LegacyTemplateScope = Record<string, any>;
3
+ type LegacyTemplateRenderer = (scope?: LegacyTemplateScope) => string;
4
+ //#endregion
5
+ export { LegacyTemplateRenderer, LegacyTemplateScope };
6
+ //# sourceMappingURL=types.d.mts.map
@@ -0,0 +1,10 @@
1
+ //#region src/runtime/navigationBar/index.d.ts
2
+ interface NavigationBarMetrics {
3
+ statusBarHeight?: number;
4
+ navContentHeight?: number;
5
+ safeAreaTop?: number;
6
+ }
7
+ declare function setNavigationBarMetrics(next: NavigationBarMetrics): void;
8
+ //#endregion
9
+ export { type NavigationBarMetrics, setNavigationBarMetrics };
10
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1,162 @@
1
+ import { NAVBAR_STYLE } from "./style.mjs";
2
+
3
+ //#region src/runtime/navigationBar/index.ts
4
+ const NAVIGATION_BAR_TAG = "weapp-navigation-bar";
5
+ const BaseElement = globalThis.HTMLElement ?? class {};
6
+ const navigationBarInstances = /* @__PURE__ */ new Set();
7
+ let navigationBarMetrics = {};
8
+ const IOS_DEVICE_RE = /iphone|ipad|ipod/i;
9
+ function isIOS() {
10
+ if (typeof navigator === "undefined") return false;
11
+ return IOS_DEVICE_RE.test(navigator.userAgent);
12
+ }
13
+ function getDefaultHeights() {
14
+ if (isIOS()) return {
15
+ statusBarHeight: 20,
16
+ navContentHeight: 44
17
+ };
18
+ return {
19
+ statusBarHeight: 24,
20
+ navContentHeight: 48
21
+ };
22
+ }
23
+ function readSafeAreaTop() {
24
+ if (typeof document === "undefined" || !document.body) return 0;
25
+ const probe = document.createElement("div");
26
+ probe.style.cssText = [
27
+ "position: absolute",
28
+ "top: 0",
29
+ "height: env(safe-area-inset-top)",
30
+ "height: constant(safe-area-inset-top)",
31
+ "pointer-events: none",
32
+ "visibility: hidden"
33
+ ].join(";");
34
+ document.body.appendChild(probe);
35
+ const height = Math.max(0, probe.getBoundingClientRect().height);
36
+ probe.remove();
37
+ return height;
38
+ }
39
+ function resolveNavigationBarMetrics() {
40
+ const defaults = getDefaultHeights();
41
+ const safeAreaTop = navigationBarMetrics.safeAreaTop !== void 0 ? navigationBarMetrics.safeAreaTop : readSafeAreaTop();
42
+ const statusBarHeight = navigationBarMetrics.statusBarHeight !== void 0 ? navigationBarMetrics.statusBarHeight : safeAreaTop > 0 ? safeAreaTop : defaults.statusBarHeight;
43
+ const navContentHeight = navigationBarMetrics.navContentHeight !== void 0 ? navigationBarMetrics.navContentHeight : defaults.navContentHeight;
44
+ return {
45
+ safeAreaTop,
46
+ statusBarHeight,
47
+ navContentHeight,
48
+ navHeight: statusBarHeight + navContentHeight
49
+ };
50
+ }
51
+ function isTransparentColor(value) {
52
+ if (!value) return false;
53
+ const normalized = value.trim().toLowerCase();
54
+ return normalized === "transparent" || normalized === "rgba(0,0,0,0)" || normalized === "rgba(0, 0, 0, 0)" || normalized === "hsla(0,0%,0%,0)";
55
+ }
56
+ function setNavigationBarMetrics(next) {
57
+ navigationBarMetrics = {
58
+ ...navigationBarMetrics,
59
+ ...next
60
+ };
61
+ for (const instance of navigationBarInstances) instance.applyMetrics();
62
+ }
63
+ var WeappNavigationBar = class extends BaseElement {
64
+ static observedAttributes = [
65
+ "title",
66
+ "background-color",
67
+ "text-style",
68
+ "front-color",
69
+ "loading"
70
+ ];
71
+ #nav;
72
+ #title;
73
+ #loading;
74
+ #resizeHandler;
75
+ connectedCallback() {
76
+ if (!this.shadowRoot) this.attachShadow({ mode: "open" });
77
+ if (this.shadowRoot && !this.shadowRoot.hasChildNodes()) this.#renderShell();
78
+ navigationBarInstances.add(this);
79
+ this.applyMetrics();
80
+ this.applyAppearance();
81
+ this.#bindResize();
82
+ }
83
+ disconnectedCallback() {
84
+ navigationBarInstances.delete(this);
85
+ if (this.#resizeHandler) {
86
+ (typeof window !== "undefined" ? window.visualViewport ?? window : void 0)?.removeEventListener("resize", this.#resizeHandler);
87
+ this.#resizeHandler = void 0;
88
+ }
89
+ }
90
+ attributeChangedCallback() {
91
+ this.applyAppearance();
92
+ }
93
+ applyMetrics() {
94
+ const metrics = resolveNavigationBarMetrics();
95
+ this.style.setProperty("--weapp-status-bar-height", `${metrics.statusBarHeight}px`);
96
+ this.style.setProperty("--weapp-nav-content-height", `${metrics.navContentHeight}px`);
97
+ this.style.setProperty("--weapp-nav-height", `${metrics.navHeight}px`);
98
+ }
99
+ applyAppearance() {
100
+ if (!this.#nav || !this.#title || !this.#loading) return;
101
+ const title = this.getAttribute("title") ?? "";
102
+ this.#title.textContent = title;
103
+ const background = this.getAttribute("background-color") ?? "#ffffff";
104
+ const frontColor = this.getAttribute("front-color");
105
+ const textStyle = (this.getAttribute("text-style") ?? "").toLowerCase();
106
+ const color = frontColor || (textStyle === "white" ? "#ffffff" : "#000000");
107
+ const loadingAttr = this.getAttribute("loading");
108
+ const loading = loadingAttr !== null && loadingAttr !== "false" && loadingAttr !== "0";
109
+ this.style.setProperty("--weapp-nav-bg", background);
110
+ this.style.setProperty("--weapp-nav-color", color);
111
+ this.#loading.toggleAttribute("hidden", !loading);
112
+ this.#nav.classList.toggle("weapp-nav--transparent", isTransparentColor(background));
113
+ }
114
+ #bindResize() {
115
+ if (this.#resizeHandler || typeof window === "undefined") return;
116
+ const target = window.visualViewport ?? window;
117
+ this.#resizeHandler = () => {
118
+ this.applyMetrics();
119
+ };
120
+ target.addEventListener("resize", this.#resizeHandler);
121
+ }
122
+ #renderShell() {
123
+ const root = this.shadowRoot;
124
+ root.innerHTML = "";
125
+ const style = document.createElement("style");
126
+ style.textContent = NAVBAR_STYLE;
127
+ const spacer = document.createElement("div");
128
+ spacer.className = "weapp-nav__spacer";
129
+ const nav = document.createElement("div");
130
+ nav.className = "weapp-nav";
131
+ const status = document.createElement("div");
132
+ status.className = "weapp-nav__status";
133
+ const content = document.createElement("div");
134
+ content.className = "weapp-nav__content";
135
+ const left = document.createElement("div");
136
+ left.className = "weapp-nav__left";
137
+ const right = document.createElement("div");
138
+ right.className = "weapp-nav__right";
139
+ const title = document.createElement("span");
140
+ title.className = "weapp-nav__title";
141
+ const loading = document.createElement("span");
142
+ loading.className = "weapp-nav__loading";
143
+ loading.setAttribute("hidden", "");
144
+ const titleText = document.createElement("span");
145
+ titleText.className = "weapp-nav__title-text";
146
+ title.append(loading, titleText);
147
+ content.append(left, title, right);
148
+ nav.append(status, content);
149
+ root.append(style, spacer, nav);
150
+ this.#nav = nav;
151
+ this.#title = titleText;
152
+ this.#loading = loading;
153
+ }
154
+ };
155
+ function ensureNavigationBarDefined() {
156
+ if (typeof customElements === "undefined") return;
157
+ if (!customElements.get(NAVIGATION_BAR_TAG)) customElements.define(NAVIGATION_BAR_TAG, WeappNavigationBar);
158
+ }
159
+
160
+ //#endregion
161
+ export { ensureNavigationBarDefined, setNavigationBarMetrics };
162
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["#renderShell","#bindResize","#resizeHandler","#nav","#title","#loading"],"sources":["../../../src/runtime/navigationBar/index.ts"],"sourcesContent":["import { NAVBAR_STYLE } from './style'\n\ninterface NavigationBarMetrics {\n statusBarHeight?: number\n navContentHeight?: number\n safeAreaTop?: number\n}\n\nconst NAVIGATION_BAR_TAG = 'weapp-navigation-bar'\nconst BaseElement = (globalThis.HTMLElement ?? class {}) as typeof HTMLElement\nconst navigationBarInstances = new Set<WeappNavigationBar>()\nlet navigationBarMetrics: NavigationBarMetrics = {}\nconst IOS_DEVICE_RE = /iphone|ipad|ipod/i\n\nfunction isIOS() {\n if (typeof navigator === 'undefined') {\n return false\n }\n return IOS_DEVICE_RE.test(navigator.userAgent)\n}\n\nfunction getDefaultHeights() {\n if (isIOS()) {\n return { statusBarHeight: 20, navContentHeight: 44 }\n }\n return { statusBarHeight: 24, navContentHeight: 48 }\n}\n\nfunction readSafeAreaTop() {\n if (typeof document === 'undefined' || !document.body) {\n return 0\n }\n const probe = document.createElement('div')\n probe.style.cssText = [\n 'position: absolute',\n 'top: 0',\n 'height: env(safe-area-inset-top)',\n 'height: constant(safe-area-inset-top)',\n 'pointer-events: none',\n 'visibility: hidden',\n ].join(';')\n document.body.appendChild(probe)\n const height = Math.max(0, probe.getBoundingClientRect().height)\n probe.remove()\n return height\n}\n\nfunction resolveNavigationBarMetrics(): Required<NavigationBarMetrics> & { navHeight: number } {\n const defaults = getDefaultHeights()\n const safeAreaTop = navigationBarMetrics.safeAreaTop !== undefined\n ? navigationBarMetrics.safeAreaTop\n : readSafeAreaTop()\n const statusBarHeight = navigationBarMetrics.statusBarHeight !== undefined\n ? navigationBarMetrics.statusBarHeight\n : (safeAreaTop > 0 ? safeAreaTop : defaults.statusBarHeight)\n const navContentHeight = navigationBarMetrics.navContentHeight !== undefined\n ? navigationBarMetrics.navContentHeight\n : defaults.navContentHeight\n return {\n safeAreaTop,\n statusBarHeight,\n navContentHeight,\n navHeight: statusBarHeight + navContentHeight,\n }\n}\n\nfunction isTransparentColor(value: string | null) {\n if (!value) {\n return false\n }\n const normalized = value.trim().toLowerCase()\n return normalized === 'transparent'\n || normalized === 'rgba(0,0,0,0)'\n || normalized === 'rgba(0, 0, 0, 0)'\n || normalized === 'hsla(0,0%,0%,0)'\n}\n\nexport function setNavigationBarMetrics(next: NavigationBarMetrics) {\n navigationBarMetrics = { ...navigationBarMetrics, ...next }\n for (const instance of navigationBarInstances) {\n instance.applyMetrics()\n }\n}\n\nclass WeappNavigationBar extends BaseElement {\n static observedAttributes = ['title', 'background-color', 'text-style', 'front-color', 'loading']\n\n #nav?: HTMLDivElement\n #title?: HTMLSpanElement\n #loading?: HTMLSpanElement\n #resizeHandler?: () => void\n\n connectedCallback() {\n if (!this.shadowRoot) {\n this.attachShadow({ mode: 'open' })\n }\n if (this.shadowRoot && !this.shadowRoot.hasChildNodes()) {\n this.#renderShell()\n }\n navigationBarInstances.add(this)\n this.applyMetrics()\n this.applyAppearance()\n this.#bindResize()\n }\n\n disconnectedCallback() {\n navigationBarInstances.delete(this)\n if (this.#resizeHandler) {\n const target = typeof window !== 'undefined' ? (window.visualViewport ?? window) : undefined\n target?.removeEventListener('resize', this.#resizeHandler)\n this.#resizeHandler = undefined\n }\n }\n\n attributeChangedCallback() {\n this.applyAppearance()\n }\n\n applyMetrics() {\n const metrics = resolveNavigationBarMetrics()\n this.style.setProperty('--weapp-status-bar-height', `${metrics.statusBarHeight}px`)\n this.style.setProperty('--weapp-nav-content-height', `${metrics.navContentHeight}px`)\n this.style.setProperty('--weapp-nav-height', `${metrics.navHeight}px`)\n }\n\n applyAppearance() {\n if (!this.#nav || !this.#title || !this.#loading) {\n return\n }\n const title = this.getAttribute('title') ?? ''\n this.#title.textContent = title\n const background = this.getAttribute('background-color') ?? '#ffffff'\n const frontColor = this.getAttribute('front-color')\n const textStyle = (this.getAttribute('text-style') ?? '').toLowerCase()\n const color = frontColor || (textStyle === 'white' ? '#ffffff' : '#000000')\n const loadingAttr = this.getAttribute('loading')\n const loading = loadingAttr !== null && loadingAttr !== 'false' && loadingAttr !== '0'\n this.style.setProperty('--weapp-nav-bg', background)\n this.style.setProperty('--weapp-nav-color', color)\n this.#loading.toggleAttribute('hidden', !loading)\n this.#nav.classList.toggle('weapp-nav--transparent', isTransparentColor(background))\n }\n\n #bindResize() {\n if (this.#resizeHandler || typeof window === 'undefined') {\n return\n }\n const target = window.visualViewport ?? window\n this.#resizeHandler = () => {\n this.applyMetrics()\n }\n target.addEventListener('resize', this.#resizeHandler)\n }\n\n #renderShell() {\n const root = this.shadowRoot!\n root.innerHTML = ''\n const style = document.createElement('style')\n style.textContent = NAVBAR_STYLE\n const spacer = document.createElement('div')\n spacer.className = 'weapp-nav__spacer'\n const nav = document.createElement('div')\n nav.className = 'weapp-nav'\n const status = document.createElement('div')\n status.className = 'weapp-nav__status'\n const content = document.createElement('div')\n content.className = 'weapp-nav__content'\n const left = document.createElement('div')\n left.className = 'weapp-nav__left'\n const right = document.createElement('div')\n right.className = 'weapp-nav__right'\n const title = document.createElement('span')\n title.className = 'weapp-nav__title'\n const loading = document.createElement('span')\n loading.className = 'weapp-nav__loading'\n loading.setAttribute('hidden', '')\n const titleText = document.createElement('span')\n titleText.className = 'weapp-nav__title-text'\n title.append(loading, titleText)\n content.append(left, title, right)\n nav.append(status, content)\n root.append(style, spacer, nav)\n this.#nav = nav\n this.#title = titleText\n this.#loading = loading\n }\n}\n\nexport function ensureNavigationBarDefined() {\n if (typeof customElements === 'undefined') {\n return\n }\n if (!customElements.get(NAVIGATION_BAR_TAG)) {\n customElements.define(NAVIGATION_BAR_TAG, WeappNavigationBar)\n }\n}\n\nexport type { NavigationBarMetrics }\n"],"mappings":";;;AAQA,MAAM,qBAAqB;AAC3B,MAAM,cAAe,WAAW,eAAe,MAAM;AACrD,MAAM,yCAAyB,IAAI,KAAyB;AAC5D,IAAI,uBAA6C,EAAE;AACnD,MAAM,gBAAgB;AAEtB,SAAS,QAAQ;AACf,KAAI,OAAO,cAAc,YACvB,QAAO;AAET,QAAO,cAAc,KAAK,UAAU,UAAU;;AAGhD,SAAS,oBAAoB;AAC3B,KAAI,OAAO,CACT,QAAO;EAAE,iBAAiB;EAAI,kBAAkB;EAAI;AAEtD,QAAO;EAAE,iBAAiB;EAAI,kBAAkB;EAAI;;AAGtD,SAAS,kBAAkB;AACzB,KAAI,OAAO,aAAa,eAAe,CAAC,SAAS,KAC/C,QAAO;CAET,MAAM,QAAQ,SAAS,cAAc,MAAM;AAC3C,OAAM,MAAM,UAAU;EACpB;EACA;EACA;EACA;EACA;EACA;EACD,CAAC,KAAK,IAAI;AACX,UAAS,KAAK,YAAY,MAAM;CAChC,MAAM,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