@weapp-vite/web 1.5.5 → 1.6.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.
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +2 -1
- package/dist/runtime/component/dom.mjs +1 -1
- package/dist/runtime/component/dom.mjs.map +1 -1
- package/dist/runtime/index.d.mts +2 -1
- package/dist/runtime/index.mjs +2 -1
- package/dist/runtime/index.mjs.map +1 -1
- package/dist/runtime/polyfill/capability.mjs +1 -1
- package/dist/runtime/polyfill/capability.mjs.map +1 -1
- package/dist/runtime/polyfill/index.d.mts +2 -1
- package/dist/runtime/polyfill/index.mjs +16 -2
- package/dist/runtime/polyfill/index.mjs.map +1 -1
- package/dist/runtime/polyfill/routeRuntime/dom.mjs +5 -0
- package/dist/runtime/polyfill/routeRuntime/dom.mjs.map +1 -1
- package/dist/runtime/polyfill/routeRuntime/events.d.mts +29 -0
- package/dist/runtime/polyfill/routeRuntime/events.mjs +123 -0
- package/dist/runtime/polyfill/routeRuntime/events.mjs.map +1 -0
- package/dist/runtime/polyfill/routeRuntime/history.d.mts +3 -1
- package/dist/runtime/polyfill/routeRuntime/history.mjs +4 -1
- package/dist/runtime/polyfill/routeRuntime/history.mjs.map +1 -1
- package/dist/runtime/polyfill/routeRuntime/lifecycle.mjs +9 -0
- package/dist/runtime/polyfill/routeRuntime/lifecycle.mjs.map +1 -1
- package/dist/runtime/polyfill/routeRuntime/options.mjs.map +1 -1
- package/dist/runtime/polyfill/routeRuntime/scroll.mjs +20 -3
- package/dist/runtime/polyfill/routeRuntime/scroll.mjs.map +1 -1
- package/dist/runtime/polyfill/routeRuntime/stack.mjs +60 -19
- package/dist/runtime/polyfill/routeRuntime/stack.mjs.map +1 -1
- package/dist/runtime/polyfill/routeRuntime.mjs +27 -11
- package/dist/runtime/polyfill/routeRuntime.mjs.map +1 -1
- package/dist/runtime/polyfill.d.mts +2 -1
- package/dist/shared/wxml.mjs +2 -2
- package/dist/shared/wxml.mjs.map +1 -1
- package/package.json +7 -7
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AppHideCallback, AppHideOptions, AppLaunchOptions, AppShowCallback } from "./polyfill/routeRuntime/options.mjs";
|
|
2
2
|
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";
|
|
3
3
|
import { getEnterOptionsSync, getLaunchOptionsSync, initializePageRoutes, navigateBack, navigateTo, offAppHide, offAppShow, onAppHide, onAppShow, reLaunch, redirectTo, registerApp, registerComponent, registerPage, switchTab } from "./polyfill/routeRuntime.mjs";
|
|
4
|
+
import { AppRouteCallback, AppRouteEvent, AppRouteOpenType, BeforePageUnloadCallback, BeforePageUnloadEvent, offAppRoute, offAppRouteDone, offBeforeAppRoute, offBeforePageUnload, onAppRoute, onAppRouteDone, onBeforeAppRoute, onBeforePageUnload } from "./polyfill/routeRuntime/events.mjs";
|
|
4
5
|
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";
|
|
5
6
|
import { chooseAddress, chooseFile, chooseImage, chooseLocation, chooseMedia, chooseMessageFile, chooseVideo, compressImage, compressVideo, getClipboardData, getImageInfo, getVideoInfo, hideLoading, hideTabBar, hideTabBarRedDot, makePhoneCall, openCustomerServiceChat, openDocument, openLocation, openVideoEditor, previewImage, previewMedia, removeTabBarBadge, requestPayment, requestSubscribeMessage, saveFile, saveFileToDisk, saveImageToPhotosAlbum, saveVideoToPhotosAlbum, scanCode, setClipboardData, setTabBarBadge, setTabBarItem, setTabBarStyle, showActionSheet, showLoading, showModal, showShareMenu, showTabBar, showTabBarRedDot, showToast, updateShareMenu } from "./polyfill/uiMediaApi.mjs";
|
|
6
7
|
import { canIUse, createInterstitialAd, createRewardedVideoAd, getExtConfig, getExtConfigSync, getLogManager, getUpdateManager, hideNavigationBarLoading, reportAnalytics, setBackgroundColor, setBackgroundTextStyle, setNavigationBarColor, setNavigationBarTitle, showNavigationBarLoading } from "./polyfill/index.mjs";
|
|
7
|
-
export { type AppHideCallback, type AppHideOptions, type AppLaunchOptions, type AppShowCallback, authorize, canIUse, checkSession, chooseAddress, chooseFile, chooseImage, chooseLocation, chooseMedia, chooseMessageFile, chooseVideo, clearStorage, clearStorageSync, compressImage, compressVideo, createCanvasContext, createInterstitialAd, createRewardedVideoAd, createSelectorQuery, createVKSession, createVideoContext, createWorker, downloadFile, exitMiniProgram, getAccountInfoSync, getAppAuthorizeSetting, getAppBaseInfo, getBatteryInfo, getBatteryInfoSync, getClipboardData, getDeviceInfo, getEnterOptionsSync, getExtConfig, getExtConfigSync, getFileSystemManager, getFuzzyLocation, getImageInfo, getLaunchOptionsSync, getLocation, getLogManager, getMenuButtonBoundingClientRect, getNetworkType, getSetting, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, getSystemInfo, getSystemInfoSync, getSystemSetting, getUpdateManager, getUserInfo, getUserProfile, getVideoInfo, getWindowInfo, hideKeyboard, hideLoading, hideNavigationBarLoading, hideTabBar, hideTabBarRedDot, initializePageRoutes, loadSubPackage, login, makePhoneCall, navigateBack, navigateTo, navigateToMiniProgram, nextTick, offAppHide, offAppShow, offNetworkStatusChange, offWindowResize, onAppHide, onAppShow, onNetworkStatusChange, onWindowResize, openAppAuthorizeSetting, openCustomerServiceChat, openDocument, openLocation, openSetting, openVideoEditor, pageScrollTo, preloadSubpackage, previewImage, previewMedia, reLaunch, redirectTo, registerApp, registerComponent, registerPage, removeStorage, removeStorageSync, removeTabBarBadge, reportAnalytics, request, requestPayment, requestSubscribeMessage, saveFile, saveFileToDisk, saveImageToPhotosAlbum, saveVideoToPhotosAlbum, scanCode, setBackgroundColor, setBackgroundTextStyle, setClipboardData, setNavigationBarColor, setNavigationBarTitle, setStorage, setStorageSync, setTabBarBadge, setTabBarItem, setTabBarStyle, showActionSheet, showLoading, showModal, showNavigationBarLoading, showShareMenu, showTabBar, showTabBarRedDot, showToast, startPullDownRefresh, stopPullDownRefresh, switchTab, updateShareMenu, uploadFile, vibrateShort };
|
|
8
|
+
export { type AppHideCallback, type AppHideOptions, type AppLaunchOptions, type AppRouteCallback, type AppRouteEvent, type AppRouteOpenType, type AppShowCallback, type BeforePageUnloadCallback, type BeforePageUnloadEvent, authorize, canIUse, checkSession, chooseAddress, chooseFile, chooseImage, chooseLocation, chooseMedia, chooseMessageFile, chooseVideo, clearStorage, clearStorageSync, compressImage, compressVideo, createCanvasContext, createInterstitialAd, createRewardedVideoAd, createSelectorQuery, createVKSession, createVideoContext, createWorker, downloadFile, exitMiniProgram, getAccountInfoSync, getAppAuthorizeSetting, getAppBaseInfo, getBatteryInfo, getBatteryInfoSync, getClipboardData, getDeviceInfo, getEnterOptionsSync, getExtConfig, getExtConfigSync, getFileSystemManager, getFuzzyLocation, getImageInfo, getLaunchOptionsSync, getLocation, getLogManager, getMenuButtonBoundingClientRect, getNetworkType, getSetting, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, getSystemInfo, getSystemInfoSync, getSystemSetting, getUpdateManager, getUserInfo, getUserProfile, getVideoInfo, getWindowInfo, hideKeyboard, hideLoading, hideNavigationBarLoading, hideTabBar, hideTabBarRedDot, initializePageRoutes, loadSubPackage, login, makePhoneCall, navigateBack, navigateTo, navigateToMiniProgram, nextTick, offAppHide, offAppRoute, offAppRouteDone, offAppShow, offBeforeAppRoute, offBeforePageUnload, offNetworkStatusChange, offWindowResize, onAppHide, onAppRoute, onAppRouteDone, onAppShow, onBeforeAppRoute, onBeforePageUnload, onNetworkStatusChange, onWindowResize, openAppAuthorizeSetting, openCustomerServiceChat, openDocument, openLocation, openSetting, openVideoEditor, pageScrollTo, preloadSubpackage, previewImage, previewMedia, reLaunch, redirectTo, registerApp, registerComponent, registerPage, removeStorage, removeStorageSync, removeTabBarBadge, reportAnalytics, request, requestPayment, requestSubscribeMessage, saveFile, saveFileToDisk, saveImageToPhotosAlbum, saveVideoToPhotosAlbum, scanCode, setBackgroundColor, setBackgroundTextStyle, setClipboardData, setNavigationBarColor, setNavigationBarTitle, setStorage, setStorageSync, setTabBarBadge, setTabBarItem, setTabBarStyle, showActionSheet, showLoading, showModal, showNavigationBarLoading, showShareMenu, showTabBar, showTabBarRedDot, showToast, startPullDownRefresh, stopPullDownRefresh, switchTab, updateShareMenu, uploadFile, vibrateShort };
|
package/dist/shared/wxml.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveNativeComponentWebTag } from "./nativeComponents.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { getSupportedMiniProgramDirectivePrefixes } from "@weapp-core/shared/platforms/runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/shared/wxml.ts
|
|
5
5
|
const CONTROL_ATTR_SUFFIXES = [
|
|
@@ -11,7 +11,7 @@ const CONTROL_ATTR_SUFFIXES = [
|
|
|
11
11
|
"for-index",
|
|
12
12
|
"key"
|
|
13
13
|
];
|
|
14
|
-
const CONTROL_ATTR_PREFIXES =
|
|
14
|
+
const CONTROL_ATTR_PREFIXES = [...getSupportedMiniProgramDirectivePrefixes()];
|
|
15
15
|
const TEMPLATE_IMPORT_TAG_NAMES = Array.from(/* @__PURE__ */ new Set(["import", ...CONTROL_ATTR_PREFIXES.map((prefix) => `${prefix}-import`)]));
|
|
16
16
|
const TEMPLATE_INCLUDE_TAG_NAMES = Array.from(/* @__PURE__ */ new Set(["include", ...CONTROL_ATTR_PREFIXES.map((prefix) => `${prefix}-include`)]));
|
|
17
17
|
const CONTROL_ATTRS = /* @__PURE__ */ new Set([...CONTROL_ATTR_PREFIXES.flatMap((prefix) => CONTROL_ATTR_SUFFIXES.map((suffix) => `${prefix}:${suffix}`))]);
|
package/dist/shared/wxml.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wxml.mjs","names":[],"sources":["../../src/shared/wxml.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"wxml.mjs","names":[],"sources":["../../src/shared/wxml.ts"],"sourcesContent":["import { getSupportedMiniProgramDirectivePrefixes } from '@weapp-core/shared/platforms/runtime'\nimport { resolveNativeComponentWebTag } from './nativeComponents'\n\nconst CONTROL_ATTR_SUFFIXES = [\n 'if',\n 'elif',\n 'else',\n 'for',\n 'for-item',\n 'for-index',\n 'key',\n] as const\n\nexport type ControlAttrSuffix = typeof CONTROL_ATTR_SUFFIXES[number]\n\nexport const CONTROL_ATTR_PREFIXES = [...getSupportedMiniProgramDirectivePrefixes()]\n\nexport const TEMPLATE_IMPORT_TAG_NAMES = Array.from(new Set([\n 'import',\n ...CONTROL_ATTR_PREFIXES.map(prefix => `${prefix}-import`),\n]))\n\nexport const TEMPLATE_INCLUDE_TAG_NAMES = Array.from(new Set([\n 'include',\n ...CONTROL_ATTR_PREFIXES.map(prefix => `${prefix}-include`),\n]))\n\nexport const CONTROL_ATTRS = new Set([\n ...CONTROL_ATTR_PREFIXES.flatMap(prefix => CONTROL_ATTR_SUFFIXES.map(suffix => `${prefix}:${suffix}`)),\n])\n\nexport const EVENT_PREFIX_RE = /^(?:bind|catch|mut-bind|capture-bind|capture-catch)([\\w-]+)$/\nexport const EVENT_KIND_ALIAS: Record<string, string> = {\n tap: 'click',\n}\n\nexport const SELF_CLOSING_TAGS = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'image',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n])\n\nexport function resolveControlAttributeName(\n attribs: Record<string, string>,\n suffix: ControlAttrSuffix,\n): string | undefined {\n for (const prefix of CONTROL_ATTR_PREFIXES) {\n const name = `${prefix}:${suffix}`\n if (name in attribs) {\n return name\n }\n }\n return undefined\n}\n\nexport function resolveControlAttributeValue(\n attribs: Record<string, string>,\n suffix: ControlAttrSuffix,\n): string | undefined {\n const name = resolveControlAttributeName(attribs, suffix)\n return name ? attribs[name] : undefined\n}\n\nexport function hasControlAttribute(\n attribs: Record<string, string>,\n suffix: ControlAttrSuffix,\n): boolean {\n return resolveControlAttributeName(attribs, suffix) !== undefined\n}\n\nexport function normalizeTagName(name: string) {\n const nativeComponentTag = resolveNativeComponentWebTag(name)\n if (nativeComponentTag) {\n return nativeComponentTag\n }\n switch (name) {\n case 'block':\n return '#fragment'\n case 'slot':\n return 'slot'\n default:\n return name || 'div'\n }\n}\n\nexport function normalizeAttributeName(name: string) {\n if (name === 'class' || name === 'style' || name.startsWith('data-')) {\n return name\n }\n return name.replace(/[A-Z]/g, match => `-${match.toLowerCase()}`)\n}\n"],"mappings":";;;;AAGA,MAAM,wBAAwB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAIA,MAAa,wBAAwB,CAAC,GAAG,yCAAyC,CAAC;AAEnF,MAAa,4BAA4B,MAAM,qBAAK,IAAI,IAAI,CAC1D,UACA,GAAG,sBAAsB,KAAI,WAAU,GAAG,OAAO,QAAQ,CAC3D,CAAC,CAAC;AAEF,MAAa,6BAA6B,MAAM,qBAAK,IAAI,IAAI,CAC3D,WACA,GAAG,sBAAsB,KAAI,WAAU,GAAG,OAAO,SAAS,CAC5D,CAAC,CAAC;AAEF,MAAa,gCAAgB,IAAI,IAAI,CACnC,GAAG,sBAAsB,SAAQ,WAAU,sBAAsB,KAAI,WAAU,GAAG,OAAO,GAAG,QAAQ,CAAC,CACvG,CAAC;AAED,MAAa,kBAAkB;AAC/B,MAAa,mBAA2C,EACtD,KAAK,QACP;AAEA,MAAa,oCAAoB,IAAI,IAAI;CACvC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,SAAgB,4BACd,SACA,QACoB;CACpB,KAAK,MAAM,UAAU,uBAAuB;EAC1C,MAAM,OAAO,GAAG,OAAO,GAAG;EAC1B,IAAI,QAAQ,SACV,OAAO;CAEX;AAEF;AAEA,SAAgB,6BACd,SACA,QACoB;CACpB,MAAM,OAAO,4BAA4B,SAAS,MAAM;CACxD,OAAO,OAAO,QAAQ,QAAQ;AAChC;AAEA,SAAgB,oBACd,SACA,QACS;CACT,OAAO,4BAA4B,SAAS,MAAM,MAAM;AAC1D;AAEA,SAAgB,iBAAiB,MAAc;CAC7C,MAAM,qBAAqB,6BAA6B,IAAI;CAC5D,IAAI,oBACF,OAAO;CAET,QAAQ,MAAR;EACE,KAAK,SACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,SACE,OAAO,QAAQ;CACnB;AACF;AAEA,SAAgB,uBAAuB,MAAc;CACnD,IAAI,SAAS,WAAW,SAAS,WAAW,KAAK,WAAW,OAAO,GACjE,OAAO;CAET,OAAO,KAAK,QAAQ,WAAU,UAAS,IAAI,MAAM,YAAY,GAAG;AAClE"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-vite/web",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.6.0",
|
|
5
5
|
"description": "Experimental web runtime for weapp-vite templates",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -65,19 +65,19 @@
|
|
|
65
65
|
"@babel/parser": "^8.0.6",
|
|
66
66
|
"@babel/traverse": "^8.0.6",
|
|
67
67
|
"@babel/types": "^8.0.6",
|
|
68
|
-
"@weapp-core/constants": "0.
|
|
69
|
-
"@weapp-core/shared": "3.2.
|
|
68
|
+
"@weapp-core/constants": "0.3.0",
|
|
69
|
+
"@weapp-core/shared": "3.2.7",
|
|
70
70
|
"domhandler": "^6.0.1",
|
|
71
71
|
"esbuild": "^0.28.2",
|
|
72
72
|
"htmlparser2": "^12.0.0",
|
|
73
73
|
"lit": "^3.3.3",
|
|
74
|
-
"magic-string": "^1.4.
|
|
74
|
+
"magic-string": "^1.4.2",
|
|
75
75
|
"pathe": "^2.0.3",
|
|
76
76
|
"postcss": "^8.5.28",
|
|
77
77
|
"postcss-selector-parser": "^7.1.6",
|
|
78
|
-
"rolldown": "1.2.
|
|
79
|
-
"rolldown-require": "2.0.
|
|
80
|
-
"wevu": "7.
|
|
78
|
+
"rolldown": "1.2.11",
|
|
79
|
+
"rolldown-require": "2.0.34",
|
|
80
|
+
"wevu": "7.4.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"happy-dom": "^20.14.5"
|