@weapp-vite/web 2.0.1 → 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.
- package/dist/_virtual/_rolldown/runtime.mjs +1 -2
- package/dist/compiler/wxml/attributes.mjs +12 -4
- package/dist/compiler/wxml/attributes.mjs.map +1 -1
- package/dist/compiler/wxml/compile.mjs +26 -8
- package/dist/compiler/wxml/compile.mjs.map +1 -1
- package/dist/compiler/wxml/dependency.mjs +1 -2
- package/dist/compiler/wxml/interpolation.mjs +13 -3
- package/dist/compiler/wxml/interpolation.mjs.map +1 -1
- package/dist/compiler/wxml/nativeTags.mjs +60 -0
- package/dist/compiler/wxml/nativeTags.mjs.map +1 -0
- package/dist/compiler/wxml/navigation.mjs +1 -2
- package/dist/compiler/wxml/parser.mjs +1 -2
- package/dist/compiler/wxml/prepare.mjs +1 -2
- package/dist/compiler/wxml/renderer.mjs +1 -2
- package/dist/compiler/wxml/specialNodes.mjs +1 -2
- package/dist/compiler/wxml/types.d.mts +0 -2
- package/dist/compiler/wxml/unknownTags.mjs +33 -0
- package/dist/compiler/wxml/unknownTags.mjs.map +1 -0
- package/dist/compiler/wxs.mjs +1 -2
- package/dist/css/wxss.d.mts +2 -19
- package/dist/css/wxss.mjs +5 -12
- package/dist/css/wxss.mjs.map +1 -1
- package/dist/index.d.mts +8 -3
- package/dist/index.mjs +8 -5
- package/dist/plugin/assets.d.mts +0 -2
- package/dist/plugin/assets.mjs +1 -2
- package/dist/plugin/constants.mjs +1 -2
- package/dist/plugin/dependencyScan.mjs +1 -2
- package/dist/plugin/entry.mjs +6 -4
- package/dist/plugin/entry.mjs.map +1 -1
- package/dist/plugin/files.mjs +1 -2
- package/dist/plugin/hostTypes.d.mts +0 -2
- package/dist/plugin/index.d.mts +0 -2
- package/dist/plugin/index.mjs +5 -5
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/plugin/layout.mjs +1 -2
- package/dist/plugin/navigation.mjs +1 -2
- package/dist/plugin/packageResolution.mjs +1 -2
- package/dist/plugin/path.mjs +1 -2
- package/dist/plugin/register.mjs +1 -2
- package/dist/plugin/scan.mjs +1 -2
- package/dist/plugin/scanConfig.mjs +1 -2
- package/dist/plugin/scanSfc.mjs +1 -2
- package/dist/plugin/sfcHmr.mjs +1 -2
- package/dist/plugin/state.mjs +1 -2
- package/dist/plugin/styleModule.mjs +1 -2
- package/dist/plugin/types.d.mts +2 -3
- package/dist/plugin/vueSfc.mjs +1 -2
- package/dist/runtime/appShell/container.mjs +1 -2
- package/dist/runtime/appShell/tabBar/index.mjs +1 -2
- package/dist/runtime/appShell/tabBar/style.mjs +1 -2
- package/dist/runtime/appStyle.mjs +1 -2
- package/dist/runtime/button/helpers.mjs +1 -2
- package/dist/runtime/button/index.d.mts +0 -2
- package/dist/runtime/button/index.mjs +1 -2
- package/dist/runtime/button/style.mjs +1 -2
- package/dist/runtime/component/behavior.mjs +1 -2
- package/dist/runtime/component/constants.mjs +1 -2
- package/dist/runtime/component/dom.mjs +1 -2
- package/dist/runtime/component/element.mjs +9 -2
- package/dist/runtime/component/element.mjs.map +1 -1
- package/dist/runtime/component/events.mjs +4 -4
- package/dist/runtime/component/events.mjs.map +1 -1
- package/dist/runtime/component/index.d.mts +0 -2
- package/dist/runtime/component/index.mjs +1 -2
- package/dist/runtime/component/observers.mjs +1 -2
- package/dist/runtime/component/publicInstance.mjs +1 -2
- package/dist/runtime/component/relations.mjs +1 -2
- package/dist/runtime/component/slots.mjs +1 -2
- package/dist/runtime/component/state.mjs +1 -2
- package/dist/runtime/component/types.d.mts +0 -2
- package/dist/runtime/component/utils.mjs +1 -2
- package/dist/runtime/component/virtualHost.mjs +1 -2
- package/dist/runtime/componentEvents.mjs +1 -2
- package/dist/runtime/dataset.mjs +49 -0
- package/dist/runtime/dataset.mjs.map +1 -0
- package/dist/runtime/datasetBinding.d.mts +13 -0
- package/dist/runtime/datasetBinding.mjs +40 -0
- package/dist/runtime/datasetBinding.mjs.map +1 -0
- package/dist/runtime/eventBinding.d.mts +0 -2
- package/dist/runtime/eventBinding.mjs +1 -2
- package/dist/runtime/execution.d.mts +0 -2
- package/dist/runtime/execution.mjs +1 -2
- package/dist/runtime/host/index.d.mts +0 -2
- package/dist/runtime/host/index.mjs +1 -2
- package/dist/runtime/host/types.d.mts +0 -2
- package/dist/runtime/hostGlobals.d.mts +0 -2
- package/dist/runtime/hostGlobals.mjs +1 -2
- package/dist/runtime/index.d.mts +8 -3
- package/dist/runtime/index.mjs +9 -7
- package/dist/runtime/index.mjs.map +1 -1
- package/dist/runtime/inlineStyle.d.mts +5 -0
- package/dist/runtime/inlineStyle.mjs +21 -0
- package/dist/runtime/inlineStyle.mjs.map +1 -0
- package/dist/runtime/inputHandlerResult.mjs +1 -2
- package/dist/runtime/legacyTemplate/dataset.mjs +53 -0
- package/dist/runtime/legacyTemplate/dataset.mjs.map +1 -0
- package/dist/runtime/legacyTemplate/dom.mjs +20 -5
- package/dist/runtime/legacyTemplate/dom.mjs.map +1 -1
- package/dist/runtime/legacyTemplate/expression.mjs +1 -2
- package/dist/runtime/legacyTemplate/index.d.mts +0 -2
- package/dist/runtime/legacyTemplate/index.mjs +23 -16
- package/dist/runtime/legacyTemplate/index.mjs.map +1 -1
- package/dist/runtime/legacyTemplate/types.d.mts +0 -2
- package/dist/runtime/nativeComponents/canvas/index.mjs +1 -2
- package/dist/runtime/nativeComponents/checkbox.mjs +1 -2
- package/dist/runtime/nativeComponents/cover/index.mjs +1 -2
- package/dist/runtime/nativeComponents/form.d.mts +0 -2
- package/dist/runtime/nativeComponents/form.mjs +1 -2
- package/dist/runtime/nativeComponents/formControl.mjs +1 -2
- package/dist/runtime/nativeComponents/helpers.mjs +1 -2
- package/dist/runtime/nativeComponents/icon/helpers.mjs +1 -2
- package/dist/runtime/nativeComponents/icon/index.mjs +1 -2
- package/dist/runtime/nativeComponents/icon/style.mjs +1 -2
- package/dist/runtime/nativeComponents/image.d.mts +0 -2
- package/dist/runtime/nativeComponents/image.mjs +1 -2
- package/dist/runtime/nativeComponents/index.d.mts +1 -3
- package/dist/runtime/nativeComponents/index.mjs +3 -3
- package/dist/runtime/nativeComponents/index.mjs.map +1 -1
- package/dist/runtime/nativeComponents/input.d.mts +0 -2
- package/dist/runtime/nativeComponents/input.mjs +1 -2
- package/dist/runtime/nativeComponents/label.mjs +1 -2
- package/dist/runtime/nativeComponents/mediaRegistry.mjs +1 -2
- package/dist/runtime/nativeComponents/movable/helpers.mjs +1 -2
- package/dist/runtime/nativeComponents/movable/index.mjs +1 -2
- package/dist/runtime/nativeComponents/navigator.mjs +1 -2
- package/dist/runtime/nativeComponents/picker/editors.mjs +1 -2
- package/dist/runtime/nativeComponents/picker/helpers.mjs +1 -2
- package/dist/runtime/nativeComponents/picker/index.mjs +1 -2
- package/dist/runtime/nativeComponents/picker/style.mjs +1 -2
- package/dist/runtime/nativeComponents/pickerView/column.mjs +1 -2
- package/dist/runtime/nativeComponents/pickerView/helpers.mjs +1 -2
- package/dist/runtime/nativeComponents/pickerView/index.mjs +1 -2
- package/dist/runtime/nativeComponents/pickerView/style.mjs +1 -2
- package/dist/runtime/nativeComponents/primitives.mjs +1 -2
- package/dist/runtime/nativeComponents/progress/helpers.mjs +1 -2
- package/dist/runtime/nativeComponents/progress/index.mjs +1 -2
- package/dist/runtime/nativeComponents/progress/style.mjs +1 -2
- package/dist/runtime/nativeComponents/radio.mjs +1 -2
- package/dist/runtime/nativeComponents/richText/index.mjs +1 -2
- package/dist/runtime/nativeComponents/scrollView/boundaries.mjs +62 -0
- package/dist/runtime/nativeComponents/scrollView/boundaries.mjs.map +1 -0
- package/dist/runtime/nativeComponents/{scrollView.d.mts → scrollView/helpers.d.mts} +4 -5
- package/dist/runtime/nativeComponents/scrollView/helpers.mjs +14 -0
- package/dist/runtime/nativeComponents/scrollView/helpers.mjs.map +1 -0
- package/dist/runtime/nativeComponents/scrollView/index.mjs +193 -0
- package/dist/runtime/nativeComponents/scrollView/index.mjs.map +1 -0
- package/dist/runtime/nativeComponents/scrollView/position.mjs +43 -0
- package/dist/runtime/nativeComponents/scrollView/position.mjs.map +1 -0
- package/dist/runtime/nativeComponents/slider/helpers.mjs +1 -2
- package/dist/runtime/nativeComponents/slider/index.mjs +1 -2
- package/dist/runtime/nativeComponents/slider/style.mjs +1 -2
- package/dist/runtime/nativeComponents/style.mjs +1 -2
- package/dist/runtime/nativeComponents/swiper/helpers.mjs +1 -2
- package/dist/runtime/nativeComponents/swiper/index.mjs +1 -2
- package/dist/runtime/nativeComponents/swiper/item.mjs +1 -2
- package/dist/runtime/nativeComponents/swiper/style.mjs +1 -2
- package/dist/runtime/nativeComponents/switch.d.mts +0 -2
- package/dist/runtime/nativeComponents/switch.mjs +1 -2
- package/dist/runtime/nativeComponents/textarea.d.mts +0 -2
- package/dist/runtime/nativeComponents/textarea.mjs +1 -2
- package/dist/runtime/nativeComponents/video/helpers.d.mts +0 -2
- package/dist/runtime/nativeComponents/video/helpers.mjs +1 -2
- package/dist/runtime/nativeComponents/video/index.mjs +1 -2
- package/dist/runtime/nativeComponents/video/style.mjs +1 -2
- package/dist/runtime/navigationBar/index.d.mts +0 -2
- package/dist/runtime/navigationBar/index.mjs +1 -2
- package/dist/runtime/navigationBar/style.mjs +1 -2
- package/dist/runtime/pageLayout.d.mts +0 -2
- package/dist/runtime/pageLayout.mjs +1 -2
- package/dist/runtime/polyfill/ad.mjs +1 -2
- package/dist/runtime/polyfill/animation.mjs +1 -2
- package/dist/runtime/polyfill/appState.mjs +1 -2
- package/dist/runtime/polyfill/async.d.mts +0 -2
- package/dist/runtime/polyfill/async.mjs +1 -2
- package/dist/runtime/polyfill/auth.mjs +1 -2
- package/dist/runtime/polyfill/authApi.mjs +1 -2
- package/dist/runtime/polyfill/background.mjs +1 -2
- package/dist/runtime/polyfill/canvasContext.mjs +1 -2
- package/dist/runtime/polyfill/capability.mjs +1 -2
- package/dist/runtime/polyfill/cloud.mjs +1 -2
- package/dist/runtime/polyfill/device.mjs +1 -2
- package/dist/runtime/polyfill/deviceApi.mjs +1 -2
- package/dist/runtime/polyfill/deviceAuthSystemApi.d.mts +0 -2
- package/dist/runtime/polyfill/deviceAuthSystemApi.mjs +1 -2
- package/dist/runtime/polyfill/eventBus.mjs +1 -2
- package/dist/runtime/polyfill/filePicker.mjs +1 -2
- package/dist/runtime/polyfill/fileSystemManager.mjs +1 -2
- package/dist/runtime/polyfill/files.mjs +1 -2
- package/dist/runtime/polyfill/font.mjs +1 -2
- package/dist/runtime/polyfill/index.d.mts +4 -4
- package/dist/runtime/polyfill/index.mjs +11 -4
- package/dist/runtime/polyfill/index.mjs.map +1 -1
- package/dist/runtime/polyfill/interaction.mjs +1 -2
- package/dist/runtime/polyfill/interactionApi.mjs +1 -2
- package/dist/runtime/polyfill/intersectionObserver.mjs +4 -4
- package/dist/runtime/polyfill/intersectionObserver.mjs.map +1 -1
- package/dist/runtime/polyfill/lifecycleEvents.d.mts +12 -0
- package/dist/runtime/polyfill/lifecycleEvents.mjs +67 -0
- package/dist/runtime/polyfill/lifecycleEvents.mjs.map +1 -0
- package/dist/runtime/polyfill/locale.mjs +1 -2
- package/dist/runtime/polyfill/location.mjs +1 -2
- package/dist/runtime/polyfill/locationApi.mjs +1 -2
- package/dist/runtime/polyfill/mediaActions.mjs +1 -2
- package/dist/runtime/polyfill/mediaApi/file.mjs +1 -2
- package/dist/runtime/polyfill/mediaApi/info.mjs +1 -2
- package/dist/runtime/polyfill/mediaApi/picker.mjs +1 -2
- package/dist/runtime/polyfill/mediaApi/preview.mjs +1 -2
- package/dist/runtime/polyfill/mediaApi/process.mjs +1 -2
- package/dist/runtime/polyfill/mediaInfo.mjs +1 -2
- package/dist/runtime/polyfill/mediaPicker.mjs +1 -2
- package/dist/runtime/polyfill/mediaProcess.mjs +1 -2
- package/dist/runtime/polyfill/menuApi.mjs +5 -3
- package/dist/runtime/polyfill/menuApi.mjs.map +1 -1
- package/dist/runtime/polyfill/navigationBarRuntime.mjs +1 -2
- package/dist/runtime/polyfill/network/request.mjs +1 -2
- package/dist/runtime/polyfill/network/requestBridge.mjs +1 -2
- package/dist/runtime/polyfill/network/status.mjs +1 -2
- package/dist/runtime/polyfill/platformApi.mjs +1 -2
- package/dist/runtime/polyfill/platformRuntime.mjs +1 -2
- package/dist/runtime/polyfill/routeRuntime/appLifecycle.mjs +1 -2
- package/dist/runtime/polyfill/routeRuntime/dom.mjs +1 -2
- package/dist/runtime/polyfill/routeRuntime/events.d.mts +0 -2
- package/dist/runtime/polyfill/routeRuntime/events.mjs +1 -2
- package/dist/runtime/polyfill/routeRuntime/history.d.mts +0 -2
- package/dist/runtime/polyfill/routeRuntime/history.mjs +1 -2
- package/dist/runtime/polyfill/routeRuntime/lifecycle.mjs +1 -2
- package/dist/runtime/polyfill/routeRuntime/options.d.mts +0 -2
- package/dist/runtime/polyfill/routeRuntime/options.mjs +1 -2
- package/dist/runtime/polyfill/routeRuntime/result.mjs +1 -2
- package/dist/runtime/polyfill/routeRuntime/scroll.mjs +37 -6
- package/dist/runtime/polyfill/routeRuntime/scroll.mjs.map +1 -1
- package/dist/runtime/polyfill/routeRuntime/stack.mjs +1 -2
- package/dist/runtime/polyfill/routeRuntime/url.mjs +1 -2
- package/dist/runtime/polyfill/routeRuntime.d.mts +2 -2
- package/dist/runtime/polyfill/routeRuntime.mjs +14 -5
- package/dist/runtime/polyfill/routeRuntime.mjs.map +1 -1
- package/dist/runtime/polyfill/runtimeCapabilityApi.mjs +1 -2
- package/dist/runtime/polyfill/runtimeDataApi.d.mts +0 -2
- package/dist/runtime/polyfill/runtimeDataApi.mjs +1 -2
- package/dist/runtime/polyfill/runtimeInfra.mjs +1 -2
- package/dist/runtime/polyfill/runtimeOps.mjs +1 -2
- package/dist/runtime/polyfill/selectorQuery.mjs +3 -3
- package/dist/runtime/polyfill/selectorQuery.mjs.map +1 -1
- package/dist/runtime/polyfill/storage.mjs +1 -2
- package/dist/runtime/polyfill/storageAsync.mjs +1 -2
- package/dist/runtime/polyfill/subscribe.mjs +1 -2
- package/dist/runtime/polyfill/system.mjs +1 -2
- package/dist/runtime/polyfill/systemApi.mjs +1 -2
- package/dist/runtime/polyfill/types/base.d.mts +0 -2
- package/dist/runtime/polyfill/types/common.d.mts +0 -2
- package/dist/runtime/polyfill/types/lifecycle.d.mts +12 -0
- package/dist/runtime/polyfill/types/locationRuntime.d.mts +0 -2
- package/dist/runtime/polyfill/types/mediaAuth.d.mts +0 -2
- package/dist/runtime/polyfill/types/platformRuntime.d.mts +0 -2
- package/dist/runtime/polyfill/types/systemAuth.d.mts +0 -2
- package/dist/runtime/polyfill/types/tabBarRuntime.d.mts +0 -2
- package/dist/runtime/polyfill/ui.mjs +1 -2
- package/dist/runtime/polyfill/uiFeedback.mjs +19 -5
- package/dist/runtime/polyfill/uiFeedback.mjs.map +1 -1
- package/dist/runtime/polyfill/uiMediaApi.d.mts +8 -2
- package/dist/runtime/polyfill/uiMediaApi.mjs +20 -5
- package/dist/runtime/polyfill/uiMediaApi.mjs.map +1 -1
- package/dist/runtime/polyfill/videoContext.mjs +1 -2
- package/dist/runtime/polyfill/vkSession.mjs +1 -2
- package/dist/runtime/polyfill/windowResize.mjs +1 -2
- package/dist/runtime/polyfill/worker.mjs +1 -2
- package/dist/runtime/polyfill.d.mts +4 -2
- package/dist/runtime/renderContext.d.mts +0 -2
- package/dist/runtime/renderContext.mjs +5 -4
- package/dist/runtime/renderContext.mjs.map +1 -1
- package/dist/runtime/rpx.d.mts +0 -2
- package/dist/runtime/rpx.mjs +6 -6
- package/dist/runtime/rpx.mjs.map +1 -1
- package/dist/runtime/seo/index.d.mts +0 -2
- package/dist/runtime/seo/index.mjs +1 -2
- package/dist/runtime/style.d.mts +0 -2
- package/dist/runtime/style.mjs +1 -2
- package/dist/runtime/template.d.mts +0 -2
- package/dist/runtime/utils/object.mjs +1 -2
- package/dist/runtime/viewport/index.d.mts +0 -2
- package/dist/runtime/viewport/index.mjs +1 -2
- package/dist/runtime/viewport/style.mjs +2 -2
- package/dist/runtime/viewport/style.mjs.map +1 -1
- package/dist/runtime/viewport/types.d.mts +0 -2
- package/dist/runtime/warning.d.mts +0 -2
- package/dist/runtime/warning.mjs +1 -2
- package/dist/runtime/wevu.d.mts +0 -2
- package/dist/runtime/wevu.mjs +1 -2
- package/dist/shared/nativeComponents.mjs +10 -3
- package/dist/shared/nativeComponents.mjs.map +1 -1
- package/dist/shared/slugify.mjs +1 -2
- package/dist/shared/styleUnits/options.d.mts +24 -0
- package/dist/shared/styleUnits/options.mjs +13 -0
- package/dist/shared/styleUnits/options.mjs.map +1 -0
- package/dist/shared/styleUnits/value.mjs +63 -0
- package/dist/shared/styleUnits/value.mjs.map +1 -0
- package/dist/shared/tabBar.d.mts +0 -2
- package/dist/shared/tabBar.mjs +1 -2
- package/dist/shared/wxml.mjs +1 -2
- package/package.json +15 -13
- package/dist/runtime/nativeComponents/scrollView.mjs +0 -88
- package/dist/runtime/nativeComponents/scrollView.mjs.map +0 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { readBooleanAttribute } from "../helpers.mjs";
|
|
2
|
+
|
|
3
|
+
// src/runtime/nativeComponents/scrollView/position.ts
|
|
4
|
+
/** 按原始 id 查找 light DOM,避免将引号、反斜杠等 id 内容拼入选择器。 */
|
|
5
|
+
function findScrollTarget(element) {
|
|
6
|
+
const id = element.getAttribute("scroll-into-view")?.trim();
|
|
7
|
+
return id ? [...element.querySelectorAll("[id]")].find((child) => child.id === id) : void 0;
|
|
8
|
+
}
|
|
9
|
+
function resolveDistance(start, size, viewportSize, alignment) {
|
|
10
|
+
const end = start + size;
|
|
11
|
+
if (alignment === "center") return start - (viewportSize - size) / 2;
|
|
12
|
+
if (alignment === "end") return end - viewportSize;
|
|
13
|
+
if (alignment === "nearest") {
|
|
14
|
+
if (start >= 0 && end <= viewportSize || start < 0 && end > viewportSize) return 0;
|
|
15
|
+
return start < 0 === size <= viewportSize ? start : end - viewportSize;
|
|
16
|
+
}
|
|
17
|
+
return start;
|
|
18
|
+
}
|
|
19
|
+
/** 仅调整启用的轴;默认 start,nearest 对已完整可见的目标保持位置。 */
|
|
20
|
+
function scrollToTarget(element, viewport, target) {
|
|
21
|
+
const alignment = element.getAttribute("scroll-into-view-alignment") ?? "start";
|
|
22
|
+
const offsetValue = Number(element.getAttribute("scroll-into-view-offset"));
|
|
23
|
+
const offset = Number.isFinite(offsetValue) ? offsetValue : 0;
|
|
24
|
+
const viewportRect = viewport.getBoundingClientRect();
|
|
25
|
+
const targetRect = target.getBoundingClientRect();
|
|
26
|
+
const width = viewport.clientWidth || viewportRect.right - viewportRect.left;
|
|
27
|
+
const height = viewport.clientHeight || viewportRect.bottom - viewportRect.top;
|
|
28
|
+
if (readBooleanAttribute(element, "scroll-y") && height <= 0 || readBooleanAttribute(element, "scroll-x") && width <= 0) return false;
|
|
29
|
+
const apply = (axis) => {
|
|
30
|
+
if (!readBooleanAttribute(element, `scroll-${axis}`)) return;
|
|
31
|
+
const vertical = axis === "y";
|
|
32
|
+
const distance = resolveDistance(vertical ? targetRect.top - viewportRect.top - viewport.clientTop : targetRect.left - viewportRect.left - viewport.clientLeft, vertical ? targetRect.bottom - targetRect.top : targetRect.right - targetRect.left, vertical ? height : width, alignment);
|
|
33
|
+
if (alignment === "nearest" && distance === 0) return;
|
|
34
|
+
if (vertical) viewport.scrollTop = Math.max(0, viewport.scrollTop + distance - offset);
|
|
35
|
+
else viewport.scrollLeft = Math.max(0, viewport.scrollLeft + distance - offset);
|
|
36
|
+
};
|
|
37
|
+
apply("y");
|
|
38
|
+
apply("x");
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { findScrollTarget, scrollToTarget };
|
|
43
|
+
//# sourceMappingURL=position.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"position.mjs","names":[],"sources":["../../../../src/runtime/nativeComponents/scrollView/position.ts"],"sourcesContent":["import { readBooleanAttribute } from '../helpers'\n\n/** 按原始 id 查找 light DOM,避免将引号、反斜杠等 id 内容拼入选择器。 */\nexport function findScrollTarget(element: Element) {\n const id = element.getAttribute('scroll-into-view')?.trim()\n return id ? [...element.querySelectorAll('[id]')].find(child => child.id === id) : undefined\n}\n\nfunction resolveDistance(start: number, size: number, viewportSize: number, alignment: string) {\n const end = start + size\n if (alignment === 'center') {\n return start - (viewportSize - size) / 2\n }\n if (alignment === 'end') {\n return end - viewportSize\n }\n if (alignment === 'nearest') {\n if ((start >= 0 && end <= viewportSize) || (start < 0 && end > viewportSize)) {\n return 0\n }\n return (start < 0) === (size <= viewportSize) ? start : end - viewportSize\n }\n return start\n}\n\n/** 仅调整启用的轴;默认 start,nearest 对已完整可见的目标保持位置。 */\nexport function scrollToTarget(element: Element, viewport: HTMLDivElement, target: Element) {\n const alignment = element.getAttribute('scroll-into-view-alignment') ?? 'start'\n const offsetValue = Number(element.getAttribute('scroll-into-view-offset'))\n const offset = Number.isFinite(offsetValue) ? offsetValue : 0\n const viewportRect = viewport.getBoundingClientRect()\n const targetRect = target.getBoundingClientRect()\n const width = viewport.clientWidth || viewportRect.right - viewportRect.left\n const height = viewport.clientHeight || viewportRect.bottom - viewportRect.top\n if ((readBooleanAttribute(element, 'scroll-y') && height <= 0)\n || (readBooleanAttribute(element, 'scroll-x') && width <= 0)) {\n return false\n }\n const apply = (axis: 'x' | 'y') => {\n if (!readBooleanAttribute(element, `scroll-${axis}`)) {\n return\n }\n const vertical = axis === 'y'\n const start = vertical\n ? targetRect.top - viewportRect.top - viewport.clientTop\n : targetRect.left - viewportRect.left - viewport.clientLeft\n const size = vertical ? targetRect.bottom - targetRect.top : targetRect.right - targetRect.left\n const distance = resolveDistance(start, size, vertical ? height : width, alignment)\n if (alignment === 'nearest' && distance === 0) {\n return\n }\n if (vertical) {\n viewport.scrollTop = Math.max(0, viewport.scrollTop + distance - offset)\n }\n else {\n viewport.scrollLeft = Math.max(0, viewport.scrollLeft + distance - offset)\n }\n }\n apply('y')\n apply('x')\n return true\n}\n"],"mappings":";;;;AAGA,SAAgB,iBAAiB,SAAkB;CACjD,MAAM,KAAK,QAAQ,aAAa,kBAAkB,CAAC,EAAE,KAAK;CAC1D,OAAO,KAAK,CAAC,GAAG,QAAQ,iBAAiB,MAAM,CAAC,CAAC,CAAC,MAAK,UAAS,MAAM,OAAO,EAAE,IAAI;AACrF;AAEA,SAAS,gBAAgB,OAAe,MAAc,cAAsB,WAAmB;CAC7F,MAAM,MAAM,QAAQ;CACpB,IAAI,cAAc,UAChB,OAAO,SAAS,eAAe,QAAQ;CAEzC,IAAI,cAAc,OAChB,OAAO,MAAM;CAEf,IAAI,cAAc,WAAW;EAC3B,IAAK,SAAS,KAAK,OAAO,gBAAkB,QAAQ,KAAK,MAAM,cAC7D,OAAO;EAET,OAAQ,QAAQ,MAAQ,QAAQ,eAAgB,QAAQ,MAAM;CAChE;CACA,OAAO;AACT;;AAGA,SAAgB,eAAe,SAAkB,UAA0B,QAAiB;CAC1F,MAAM,YAAY,QAAQ,aAAa,4BAA4B,KAAK;CACxE,MAAM,cAAc,OAAO,QAAQ,aAAa,yBAAyB,CAAC;CAC1E,MAAM,SAAS,OAAO,SAAS,WAAW,IAAI,cAAc;CAC5D,MAAM,eAAe,SAAS,sBAAsB;CACpD,MAAM,aAAa,OAAO,sBAAsB;CAChD,MAAM,QAAQ,SAAS,eAAe,aAAa,QAAQ,aAAa;CACxE,MAAM,SAAS,SAAS,gBAAgB,aAAa,SAAS,aAAa;CAC3E,IAAK,qBAAqB,SAAS,UAAU,KAAK,UAAU,KACtD,qBAAqB,SAAS,UAAU,KAAK,SAAS,GAC1D,OAAO;CAET,MAAM,SAAS,SAAoB;EACjC,IAAI,CAAC,qBAAqB,SAAS,UAAU,MAAM,GACjD;EAEF,MAAM,WAAW,SAAS;EAK1B,MAAM,WAAW,gBAJH,WACV,WAAW,MAAM,aAAa,MAAM,SAAS,YAC7C,WAAW,OAAO,aAAa,OAAO,SAAS,YACtC,WAAW,WAAW,SAAS,WAAW,MAAM,WAAW,QAAQ,WAAW,MAC7C,WAAW,SAAS,OAAO,SAAS;EAClF,IAAI,cAAc,aAAa,aAAa,GAC1C;EAEF,IAAI,UACF,SAAS,YAAY,KAAK,IAAI,GAAG,SAAS,YAAY,WAAW,MAAM;OAGvE,SAAS,aAAa,KAAK,IAAI,GAAG,SAAS,aAAa,WAAW,MAAM;CAE7E;CACA,MAAM,GAAG;CACT,MAAM,GAAG;CACT,OAAO;AACT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/runtime/nativeComponents/slider/helpers.ts
|
|
2
2
|
function finiteNumber(value, fallback) {
|
|
3
3
|
const numeric = Number(value);
|
|
4
4
|
return Number.isFinite(numeric) ? numeric : fallback;
|
|
@@ -23,6 +23,5 @@ function createSliderEventDetail(value) {
|
|
|
23
23
|
return { value };
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
//#endregion
|
|
27
26
|
export { createSliderEventDetail, resolveSliderConfig };
|
|
28
27
|
//# sourceMappingURL=helpers.mjs.map
|
|
@@ -5,7 +5,7 @@ import { ensureNativeComponentStyle } from "../style.mjs";
|
|
|
5
5
|
import { createSliderEventDetail, resolveSliderConfig } from "./helpers.mjs";
|
|
6
6
|
import { SLIDER_SHADOW_STYLE } from "./style.mjs";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/runtime/nativeComponents/slider/index.ts
|
|
9
9
|
const BaseElement = globalThis.HTMLElement ?? class {};
|
|
10
10
|
var WeappSlider = class extends BaseElement {
|
|
11
11
|
static observedAttributes = [...getNativeComponentDescriptor("slider").attributes];
|
|
@@ -115,6 +115,5 @@ var WeappSlider = class extends BaseElement {
|
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
117
|
|
|
118
|
-
//#endregion
|
|
119
118
|
export { WeappSlider, createSliderEventDetail, resolveSliderConfig };
|
|
120
119
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/runtime/nativeComponents/slider/style.ts
|
|
2
2
|
const SLIDER_SHADOW_STYLE = `
|
|
3
3
|
:host { min-width: 0; }
|
|
4
4
|
.slider {
|
|
@@ -55,6 +55,5 @@ const SLIDER_SHADOW_STYLE = `
|
|
|
55
55
|
output[hidden] { display: none; }
|
|
56
56
|
`;
|
|
57
57
|
|
|
58
|
-
//#endregion
|
|
59
58
|
export { SLIDER_SHADOW_STYLE };
|
|
60
59
|
//# sourceMappingURL=style.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NATIVE_COMPONENT_DESCRIPTORS } from "../../shared/nativeComponents.mjs";
|
|
2
2
|
import { injectStyle } from "../style.mjs";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/runtime/nativeComponents/style.ts
|
|
5
5
|
const NATIVE_COMPONENT_STYLE_ID = "weapp-web-native-component-style";
|
|
6
6
|
const styleTargets = /* @__PURE__ */ new WeakSet();
|
|
7
7
|
let sharedSheet;
|
|
@@ -36,6 +36,5 @@ function ensureNativeComponentStyle(root) {
|
|
|
36
36
|
styleTargets.add(target);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
//#endregion
|
|
40
39
|
export { NATIVE_COMPONENT_STYLE, ensureNativeComponentStyle };
|
|
41
40
|
//# sourceMappingURL=style.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/runtime/nativeComponents/swiper/helpers.ts
|
|
2
2
|
function clampSwiperIndex(index, itemCount) {
|
|
3
3
|
if (itemCount <= 0) return 0;
|
|
4
4
|
return Math.min(itemCount - 1, Math.max(0, Math.trunc(index)));
|
|
@@ -47,6 +47,5 @@ function resolveSwiperLength(value) {
|
|
|
47
47
|
return /^-?\d+(?:\.\d+)?rpx$/i.test(normalized) || /^-?\.\d+rpx$/i.test(normalized) ? `calc(var(--rpx) * ${normalized.slice(0, -3)})` : normalized;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
//#endregion
|
|
51
50
|
export { clampSwiperIndex, createSwiperChangeDetail, resolveSwipeTarget, resolveSwiperEasing, resolveSwiperIndex, resolveSwiperLength, resolveSwiperNumber, resolveSwiperStep };
|
|
52
51
|
//# sourceMappingURL=helpers.mjs.map
|
|
@@ -4,7 +4,7 @@ import { ensureNativeComponentStyle } from "../style.mjs";
|
|
|
4
4
|
import { createSwiperChangeDetail, resolveSwipeTarget, resolveSwiperEasing, resolveSwiperIndex, resolveSwiperLength, resolveSwiperNumber, resolveSwiperStep } from "./helpers.mjs";
|
|
5
5
|
import { SWIPER_SHADOW_STYLE } from "./style.mjs";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/runtime/nativeComponents/swiper/index.ts
|
|
8
8
|
const BaseElement = globalThis.HTMLElement ?? class {};
|
|
9
9
|
var WeappSwiper = class extends BaseElement {
|
|
10
10
|
static observedAttributes = [...getNativeComponentDescriptor("swiper").attributes];
|
|
@@ -230,6 +230,5 @@ var WeappSwiper = class extends BaseElement {
|
|
|
230
230
|
}
|
|
231
231
|
};
|
|
232
232
|
|
|
233
|
-
//#endregion
|
|
234
233
|
export { WeappSwiper };
|
|
235
234
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolveContainingShadowRoot } from "../helpers.mjs";
|
|
2
2
|
import { ensureNativeComponentStyle } from "../style.mjs";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/runtime/nativeComponents/swiper/item.ts
|
|
5
5
|
const BaseElement = globalThis.HTMLElement ?? class {};
|
|
6
6
|
var WeappSwiperItem = class extends BaseElement {
|
|
7
7
|
connectedCallback() {
|
|
@@ -9,6 +9,5 @@ var WeappSwiperItem = class extends BaseElement {
|
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
//#endregion
|
|
13
12
|
export { WeappSwiperItem };
|
|
14
13
|
//# sourceMappingURL=item.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/runtime/nativeComponents/swiper/style.ts
|
|
2
2
|
const SWIPER_SHADOW_STYLE = `
|
|
3
3
|
:host { position: relative; min-width: 0; min-height: 0; }
|
|
4
4
|
.viewport { position: relative; box-sizing: border-box; width: 100%; height: 100%; overflow: hidden; touch-action: pan-y; }
|
|
@@ -15,6 +15,5 @@ const SWIPER_SHADOW_STYLE = `
|
|
|
15
15
|
.indicator[data-active="true"] { background: var(--weapp-swiper-indicator-active-color, #000000); }
|
|
16
16
|
`;
|
|
17
17
|
|
|
18
|
-
//#endregion
|
|
19
18
|
export { SWIPER_SHADOW_STYLE };
|
|
20
19
|
//# sourceMappingURL=style.mjs.map
|
|
@@ -3,7 +3,7 @@ import { connectFormControl, disconnectFormControl } from "./formControl.mjs";
|
|
|
3
3
|
import { dispatchMiniProgramEvent, readBooleanAttribute, resolveContainingShadowRoot } from "./helpers.mjs";
|
|
4
4
|
import { ensureNativeComponentStyle } from "./style.mjs";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/runtime/nativeComponents/switch.ts
|
|
7
7
|
const BaseElement = globalThis.HTMLElement ?? class {};
|
|
8
8
|
function createSwitchEventDetail(checked) {
|
|
9
9
|
return { value: checked };
|
|
@@ -127,6 +127,5 @@ var WeappSwitch = class extends BaseElement {
|
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
129
|
|
|
130
|
-
//#endregion
|
|
131
130
|
export { WeappSwitch, createSwitchEventDetail };
|
|
132
131
|
//# sourceMappingURL=switch.mjs.map
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
//#region src/runtime/nativeComponents/textarea.d.ts
|
|
2
1
|
export declare function createTextareaLineChangeDetail(textarea: Pick<HTMLTextAreaElement, 'scrollHeight' | 'value'>): {
|
|
3
2
|
height: number;
|
|
4
3
|
heightRpx: number;
|
|
5
4
|
lineCount: number;
|
|
6
5
|
};
|
|
7
|
-
//#endregion
|
|
8
6
|
//# sourceMappingURL=textarea.d.mts.map
|
|
@@ -4,7 +4,7 @@ import { dispatchMiniProgramEvent, readBooleanAttribute, resolveContainingShadow
|
|
|
4
4
|
import { ensureNativeComponentStyle } from "./style.mjs";
|
|
5
5
|
import { createInputEventDetail } from "./input.mjs";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/runtime/nativeComponents/textarea.ts
|
|
8
8
|
const BaseElement = globalThis.HTMLElement ?? class {};
|
|
9
9
|
function createTextareaLineChangeDetail(textarea) {
|
|
10
10
|
const height = textarea.scrollHeight;
|
|
@@ -139,6 +139,5 @@ var WeappTextarea = class extends BaseElement {
|
|
|
139
139
|
}
|
|
140
140
|
};
|
|
141
141
|
|
|
142
|
-
//#endregion
|
|
143
142
|
export { WeappTextarea, createTextareaLineChangeDetail };
|
|
144
143
|
//# sourceMappingURL=textarea.mjs.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/runtime/nativeComponents/video/helpers.d.ts
|
|
2
1
|
export declare function resolveVideoObjectFit(value: string | null): "fill" | "cover" | "contain";
|
|
3
2
|
export declare function createVideoTimeUpdateDetail(currentTime: number, duration: number): {
|
|
4
3
|
currentTime: number;
|
|
@@ -7,5 +6,4 @@ export declare function createVideoTimeUpdateDetail(currentTime: number, duratio
|
|
|
7
6
|
export declare function createVideoProgressDetail(bufferedEnd: number, duration: number): {
|
|
8
7
|
buffered: number;
|
|
9
8
|
};
|
|
10
|
-
//#endregion
|
|
11
9
|
//# sourceMappingURL=helpers.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/runtime/nativeComponents/video/helpers.ts
|
|
2
2
|
function resolveVideoObjectFit(value) {
|
|
3
3
|
return value === "fill" || value === "cover" || value === "contain" ? value : "contain";
|
|
4
4
|
}
|
|
@@ -16,6 +16,5 @@ function resolveVideoDirection(videoWidth, videoHeight) {
|
|
|
16
16
|
return videoWidth >= videoHeight ? "horizontal" : "vertical";
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
//#endregion
|
|
20
19
|
export { createVideoProgressDetail, createVideoTimeUpdateDetail, resolveVideoDirection, resolveVideoObjectFit };
|
|
21
20
|
//# sourceMappingURL=helpers.mjs.map
|
|
@@ -5,7 +5,7 @@ import { registerNativeMediaElement, unregisterNativeMediaElement } from "../med
|
|
|
5
5
|
import { createVideoProgressDetail, createVideoTimeUpdateDetail, resolveVideoDirection, resolveVideoObjectFit } from "./helpers.mjs";
|
|
6
6
|
import { VIDEO_SHADOW_STYLE } from "./style.mjs";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/runtime/nativeComponents/video/index.ts
|
|
9
9
|
const BaseElement = globalThis.HTMLElement ?? class {};
|
|
10
10
|
function readFiniteNumber(value) {
|
|
11
11
|
if (value === null || value.trim() === "") return;
|
|
@@ -119,6 +119,5 @@ var WeappVideo = class extends BaseElement {
|
|
|
119
119
|
};
|
|
120
120
|
};
|
|
121
121
|
|
|
122
|
-
//#endregion
|
|
123
122
|
export { WeappVideo };
|
|
124
123
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/runtime/nativeComponents/video/style.ts
|
|
2
2
|
const VIDEO_SHADOW_STYLE = `
|
|
3
3
|
:host { position: relative; background: #000; }
|
|
4
4
|
video {
|
|
@@ -9,6 +9,5 @@ const VIDEO_SHADOW_STYLE = `
|
|
|
9
9
|
}
|
|
10
10
|
`;
|
|
11
11
|
|
|
12
|
-
//#endregion
|
|
13
12
|
export { VIDEO_SHADOW_STYLE };
|
|
14
13
|
//# sourceMappingURL=style.mjs.map
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
//#region src/runtime/navigationBar/index.d.ts
|
|
2
1
|
interface NavigationBarMetrics {
|
|
3
2
|
statusBarHeight?: number;
|
|
4
3
|
navContentHeight?: number;
|
|
5
4
|
safeAreaTop?: number;
|
|
6
5
|
}
|
|
7
6
|
export declare function setNavigationBarMetrics(next: NavigationBarMetrics): void;
|
|
8
|
-
//#endregion
|
|
9
7
|
export type { NavigationBarMetrics };
|
|
10
8
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NAVBAR_STYLE } from "./style.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/runtime/navigationBar/index.ts
|
|
4
4
|
const NAVIGATION_BAR_TAG = "weapp-navigation-bar";
|
|
5
5
|
const BaseElement = globalThis.HTMLElement ?? class {};
|
|
6
6
|
const navigationBarInstances = /* @__PURE__ */ new Set();
|
|
@@ -155,6 +155,5 @@ function ensureNavigationBarDefined() {
|
|
|
155
155
|
if (!customElements.get(NAVIGATION_BAR_TAG)) customElements.define(NAVIGATION_BAR_TAG, WeappNavigationBar);
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
//#endregion
|
|
159
158
|
export { ensureNavigationBarDefined, setNavigationBarMetrics };
|
|
160
159
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/runtime/navigationBar/style.ts
|
|
2
2
|
const NAVBAR_STYLE = `
|
|
3
3
|
:host {
|
|
4
4
|
--weapp-status-bar-height: 20px;
|
|
@@ -103,6 +103,5 @@ const NAVBAR_STYLE = `
|
|
|
103
103
|
}
|
|
104
104
|
`;
|
|
105
105
|
|
|
106
|
-
//#endregion
|
|
107
106
|
export { NAVBAR_STYLE };
|
|
108
107
|
//# sourceMappingURL=style.mjs.map
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { WevuPageLayoutMap } from "wevu";
|
|
2
|
-
//#region src/runtime/pageLayout.d.ts
|
|
3
2
|
type ResolveTypedPageLayoutName = keyof WevuPageLayoutMap extends never ? string : Extract<keyof WevuPageLayoutMap, string>;
|
|
4
3
|
type ResolveTypedPageLayoutProps<Name extends string> = Name extends keyof WevuPageLayoutMap ? WevuPageLayoutMap[Name] : Record<string, any>;
|
|
5
4
|
export declare function setPageLayout(layout: false): void;
|
|
6
5
|
export declare function setPageLayout<Name extends ResolveTypedPageLayoutName>(layout: Name, props?: ResolveTypedPageLayoutProps<Name>): void;
|
|
7
|
-
//#endregion
|
|
8
6
|
export {};
|
|
9
7
|
//# sourceMappingURL=pageLayout.d.mts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getCurrentPageInstance } from "./polyfill/routeRuntime.mjs";
|
|
2
2
|
import { WEVU_PAGE_LAYOUT_SETTER_KEY } from "@weapp-core/constants";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/runtime/pageLayout.ts
|
|
5
5
|
function setPageLayout(layout, props) {
|
|
6
6
|
const setter = getCurrentPageInstance()?.[WEVU_PAGE_LAYOUT_SETTER_KEY];
|
|
7
7
|
if (typeof setter === "function") {
|
|
@@ -11,6 +11,5 @@ function setPageLayout(layout, props) {
|
|
|
11
11
|
throw new Error("setPageLayout() 未找到当前 Web 页面实例。请在页面生命周期、事件回调或当前页面上下文中调用。");
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
//#endregion
|
|
15
14
|
export { setPageLayout };
|
|
16
15
|
//# sourceMappingURL=pageLayout.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/runtime/polyfill/ad.ts
|
|
2
2
|
function createAdError(errMsg) {
|
|
3
3
|
return {
|
|
4
4
|
errMsg,
|
|
@@ -145,6 +145,5 @@ function createInterstitialAdImpl(options) {
|
|
|
145
145
|
};
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
//#endregion
|
|
149
148
|
export { createInterstitialAdImpl, createRewardedVideoAdImpl };
|
|
150
149
|
//# sourceMappingURL=ad.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/runtime/polyfill/animation.ts
|
|
2
2
|
var WebAnimation = class {
|
|
3
3
|
defaults;
|
|
4
4
|
#actions = [];
|
|
@@ -115,6 +115,5 @@ function createAnimation(options = {}) {
|
|
|
115
115
|
return new WebAnimation(options);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
//#endregion
|
|
119
118
|
export { WebAnimation, createAnimation };
|
|
120
119
|
//# sourceMappingURL=animation.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/runtime/polyfill/appState.ts
|
|
2
2
|
function resolveCurrentPages(navigationHistory) {
|
|
3
3
|
return navigationHistory.map((entry) => entry.instance).filter((instance) => Boolean(instance));
|
|
4
4
|
}
|
|
@@ -26,6 +26,5 @@ function resolveFallbackLaunchOptions(navigationHistory) {
|
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
//#endregion
|
|
30
29
|
export { cloneLaunchOptions, resolveCurrentPages, resolveFallbackLaunchOptions };
|
|
31
30
|
//# sourceMappingURL=appState.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/runtime/polyfill/async.ts
|
|
2
2
|
function callMiniProgramAsyncSuccess(options, result) {
|
|
3
3
|
options?.success?.(result);
|
|
4
4
|
options?.complete?.(result);
|
|
@@ -26,6 +26,5 @@ function scheduleMicrotask(task) {
|
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
//#endregion
|
|
30
29
|
export { callMiniProgramAsyncFailure, callMiniProgramAsyncSuccess, normalizeDuration, scheduleMicrotask };
|
|
31
30
|
//# sourceMappingURL=async.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WEAPP_VITE_WEB_AUTHORIZE_DECISION_KEY, WEAPP_VITE_WEB_CHECK_SESSION_KEY, WEAPP_VITE_WEB_GET_USER_PROFILE_DECISION_KEY, WEAPP_VITE_WEB_OPEN_APP_AUTHORIZE_SETTING_KEY, WEAPP_VITE_WEB_OPEN_SETTING_AUTH_KEY, WEAPP_VITE_WEB_USER_INFO_KEY, WEAPP_VITE_WEB_USER_PROFILE_KEY } from "@weapp-core/constants";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/runtime/polyfill/auth.ts
|
|
4
4
|
function normalizeAuthScope(scope) {
|
|
5
5
|
if (typeof scope !== "string") return "";
|
|
6
6
|
return scope.trim();
|
|
@@ -115,6 +115,5 @@ function resolveUserProfileDecision() {
|
|
|
115
115
|
return normalizeAuthorizeDecision(preset);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
//#endregion
|
|
119
118
|
export { buildAuthSettingSnapshot, buildUserProfilePayload, generateLoginCode, normalizeAppAuthorizeStatus, normalizeAuthScope, normalizeAuthorizeDecision, normalizeUserLanguage, resolveAuthorizeDecision, resolveCheckSessionState, resolveUserProfileDecision, syncOpenAppAuthorizeSettingPreset, syncOpenSettingPreset };
|
|
120
119
|
//# sourceMappingURL=auth.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { callMiniProgramAsyncFailure, callMiniProgramAsyncSuccess } from "./async.mjs";
|
|
2
2
|
import { buildAuthSettingSnapshot, buildUserProfilePayload, generateLoginCode, normalizeAuthScope, resolveAuthorizeDecision, resolveCheckSessionState, resolveUserProfileDecision, syncOpenAppAuthorizeSettingPreset, syncOpenSettingPreset } from "./auth.mjs";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/runtime/polyfill/authApi.ts
|
|
5
5
|
function getSettingBridge(options, authState) {
|
|
6
6
|
return Promise.resolve(callMiniProgramAsyncSuccess(options, {
|
|
7
7
|
errMsg: "getSetting:ok",
|
|
@@ -96,6 +96,5 @@ function getUserProfileBridge(options, authState) {
|
|
|
96
96
|
return Promise.resolve(callMiniProgramAsyncSuccess(options, buildUserProfilePayload("getUserProfile:ok", options?.lang)));
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
//#endregion
|
|
100
99
|
export { authorizeBridge, checkSessionBridge, getAppAuthorizeSettingBridge, getSettingBridge, getSystemSettingBridge, getUserInfoBridge, getUserProfileBridge, loginBridge, openAppAuthorizeSettingBridge, openSettingBridge };
|
|
101
100
|
//# sourceMappingURL=authApi.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { callMiniProgramAsyncFailure, callMiniProgramAsyncSuccess } from "./async.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/runtime/polyfill/background.ts
|
|
4
4
|
function normalizeBackgroundColorValue(color) {
|
|
5
5
|
if (typeof color !== "string") return "";
|
|
6
6
|
return color.trim();
|
|
@@ -26,6 +26,5 @@ function setBackgroundTextStyleBridge(options) {
|
|
|
26
26
|
return Promise.resolve(callMiniProgramAsyncSuccess(options, { errMsg: "setBackgroundTextStyle:ok" }));
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
//#endregion
|
|
30
29
|
export { setBackgroundColorBridge, setBackgroundTextStyleBridge };
|
|
31
30
|
//# sourceMappingURL=background.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveNativeMediaElement } from "../nativeComponents/mediaRegistry.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/runtime/polyfill/canvasContext.ts
|
|
4
4
|
function normalizeCanvasNumber(value) {
|
|
5
5
|
if (typeof value !== "number" || Number.isNaN(value)) return 0;
|
|
6
6
|
return value;
|
|
@@ -151,6 +151,5 @@ function createCanvasContextBridge(canvasId) {
|
|
|
151
151
|
return createCanvasCommandQueue(String(canvasId ?? ""));
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
//#endregion
|
|
155
154
|
export { createCanvasContextBridge };
|
|
156
155
|
//# sourceMappingURL=canvasContext.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getMiniProgramRuntimeGlobalKeys } from "@weapp-core/shared/platforms/runtime";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/runtime/polyfill/capability.ts
|
|
4
4
|
const MINI_PROGRAM_CAPABILITY_SCHEMA_PREFIX_RE = new RegExp(`^(?:${getMiniProgramRuntimeGlobalKeys().join("|")})\\.`);
|
|
5
5
|
function checkRuntimeCapability(miniProgramBridge, schema) {
|
|
6
6
|
const normalized = String(schema ?? "").trim().replace(MINI_PROGRAM_CAPABILITY_SCHEMA_PREFIX_RE, "");
|
|
@@ -15,6 +15,5 @@ function checkRuntimeCapability(miniProgramBridge, schema) {
|
|
|
15
15
|
return typeof cursor === "function" || typeof cursor === "object" && cursor !== null;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
//#endregion
|
|
19
18
|
export { checkRuntimeCapability };
|
|
20
19
|
//# sourceMappingURL=capability.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/runtime/polyfill/cloud.ts
|
|
2
2
|
function createCloudRequestId() {
|
|
3
3
|
return `web_cloud_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 10)}`;
|
|
4
4
|
}
|
|
@@ -34,6 +34,5 @@ function createCloudBridge(callMiniProgramAsyncSuccess, callMiniProgramAsyncFail
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
//#endregion
|
|
38
37
|
export { createCloudBridge };
|
|
39
38
|
//# sourceMappingURL=cloud.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/runtime/polyfill/device.ts
|
|
2
2
|
function resolveVibrateDuration(type) {
|
|
3
3
|
if (type === "heavy") return 30;
|
|
4
4
|
if (type === "medium") return 20;
|
|
@@ -39,6 +39,5 @@ function readBatteryInfoSnapshot() {
|
|
|
39
39
|
return readRuntimeBatteryInfoInternal();
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
//#endregion
|
|
43
42
|
export { readBatteryInfoSnapshot, readBatteryInfoSyncSnapshot, vibrateDevice };
|
|
44
43
|
//# sourceMappingURL=device.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { callMiniProgramAsyncFailure, callMiniProgramAsyncSuccess } from "./async.mjs";
|
|
2
2
|
import { readBatteryInfoSnapshot, readBatteryInfoSyncSnapshot, vibrateDevice } from "./device.mjs";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/runtime/polyfill/deviceApi.ts
|
|
5
5
|
function vibrateShortBridge(options) {
|
|
6
6
|
try {
|
|
7
7
|
vibrateDevice(options?.type);
|
|
@@ -29,6 +29,5 @@ async function getBatteryInfoBridge(options) {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
//#endregion
|
|
33
32
|
export { getBatteryInfoBridge, getBatteryInfoSyncBridge, vibrateShortBridge };
|
|
34
33
|
//# sourceMappingURL=deviceApi.mjs.map
|
|
@@ -3,7 +3,6 @@ import { GetFuzzyLocationOptions, GetLocationOptions, GetNetworkTypeOptions, Net
|
|
|
3
3
|
import { AuthorizeOptions, GetSettingOptions, OpenSettingOptions } from "./types/mediaAuth.mjs";
|
|
4
4
|
import { BatteryInfo, GetBatteryInfoSuccessResult, VibrateShortOptions } from "./types/platformRuntime.mjs";
|
|
5
5
|
import { AccountInfoSync, AppAuthorizeSetting, AppBaseInfo, CheckSessionOptions, DeviceInfo, GetSystemInfoOptions, GetUserInfoOptions, GetUserProfileOptions, LoginOptions, MenuButtonBoundingClientRect, OpenAppAuthorizeSettingOptions, SystemInfo, SystemSetting, WindowInfo } from "./types/systemAuth.mjs";
|
|
6
|
-
//#region src/runtime/polyfill/deviceAuthSystemApi.d.ts
|
|
7
6
|
export declare function vibrateShort(options?: VibrateShortOptions): Promise<{
|
|
8
7
|
errMsg: string;
|
|
9
8
|
}>;
|
|
@@ -96,5 +95,4 @@ export declare function getUserProfile(options?: GetUserProfileOptions): Promise
|
|
|
96
95
|
export declare function getAccountInfoSync(): AccountInfoSync;
|
|
97
96
|
export declare function getAppBaseInfo(): AppBaseInfo;
|
|
98
97
|
export declare function getMenuButtonBoundingClientRect(): MenuButtonBoundingClientRect;
|
|
99
|
-
//#endregion
|
|
100
98
|
//# sourceMappingURL=deviceAuthSystemApi.d.mts.map
|
|
@@ -7,7 +7,7 @@ import { offNetworkStatusChangeBridge, offWindowResizeBridge, onNetworkStatusCha
|
|
|
7
7
|
import { resolveDeviceOrientation, rpx2px as rpx2px$1 } from "./system.mjs";
|
|
8
8
|
import { getAccountInfoSyncBridge, getAppBaseInfoBridge, getDeviceInfoBridge, getMenuButtonBoundingClientRectBridge, getSystemInfoBridge, getSystemInfoSyncBridge, getWindowInfoBridge } from "./systemApi.mjs";
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
// src/runtime/polyfill/deviceAuthSystemApi.ts
|
|
11
11
|
var deviceAuthSystemApi_exports = /* @__PURE__ */ __exportAll({
|
|
12
12
|
authorize: () => authorize,
|
|
13
13
|
checkSession: () => checkSession,
|
|
@@ -145,6 +145,5 @@ function getMenuButtonBoundingClientRect() {
|
|
|
145
145
|
return getMenuButtonBoundingClientRectBridge();
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
//#endregion
|
|
149
148
|
export { authorize, checkSession, deviceAuthSystemApi_exports, getAccountInfoSync, getAppAuthorizeSetting, getAppBaseInfo, getBatteryInfo, getBatteryInfoSync, getDeviceInfo, getFuzzyLocation, getLocation, getMenuButtonBoundingClientRect, getNetworkType, getSetting, getSystemInfo, getSystemInfoSync, getSystemSetting, getUserInfo, getUserProfile, getWindowInfo, login, offNetworkStatusChange, offWindowResize, onNetworkStatusChange, onWindowResize, openAppAuthorizeSetting, openSetting, rpx2px, upx2px, vibrateShort };
|
|
150
149
|
//# sourceMappingURL=deviceAuthSystemApi.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __exportAll } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/runtime/polyfill/eventBus.ts
|
|
4
4
|
var eventBus_exports = /* @__PURE__ */ __exportAll({
|
|
5
5
|
$emit: () => $emit,
|
|
6
6
|
$off: () => $off,
|
|
@@ -51,6 +51,5 @@ function $emit(eventName, ...args) {
|
|
|
51
51
|
for (const { handler } of [...eventListeners]) handler(...args);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
//#endregion
|
|
55
54
|
export { $emit, $off, $on, $once, eventBus_exports };
|
|
56
55
|
//# sourceMappingURL=eventBus.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createTempFilePath } from "./mediaPicker.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/runtime/polyfill/filePicker.ts
|
|
4
4
|
function normalizeChooseMessageFileCount(count) {
|
|
5
5
|
if (typeof count !== "number" || Number.isNaN(count)) return 1;
|
|
6
6
|
return Math.max(1, Math.floor(count));
|
|
@@ -153,6 +153,5 @@ async function pickChooseFileFiles(count, type, extensions) {
|
|
|
153
153
|
throw new TypeError("File picker is unavailable in current environment.");
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
//#endregion
|
|
157
156
|
export { normalizeChooseFileExtensions, normalizeChooseMessageFile, normalizeChooseMessageFileCount, normalizeChooseMessageFileType, pickChooseFileFiles, pickChooseMessageFiles };
|
|
158
157
|
//# sourceMappingURL=filePicker.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { normalizeFilePath, readFileSyncInternal, writeFileSyncInternal } from "./files.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/runtime/polyfill/fileSystemManager.ts
|
|
4
4
|
function stringifyFileSystemError(error) {
|
|
5
5
|
return error instanceof Error ? error.message : String(error);
|
|
6
6
|
}
|
|
@@ -43,6 +43,5 @@ function createFileSystemManagerBridge(callMiniProgramAsyncSuccess, callMiniProg
|
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
//#endregion
|
|
47
46
|
export { createFileSystemManagerBridge };
|
|
48
47
|
//# sourceMappingURL=fileSystemManager.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/runtime/polyfill/files.ts
|
|
2
2
|
const WEB_USER_DATA_PATH = "/__weapp_vite_web_user_data__";
|
|
3
3
|
const memoryFileStorage = /* @__PURE__ */ new Map();
|
|
4
4
|
function normalizeFilePath(filePath) {
|
|
@@ -113,6 +113,5 @@ function resolveOpenDocumentUrl(filePath) {
|
|
|
113
113
|
return filePath;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
//#endregion
|
|
117
116
|
export { WEB_USER_DATA_PATH, normalizeFilePath, readFileSyncInternal, resolveOpenDocumentUrl, resolveSaveFilePath, resolveUploadFileBlob, resolveUploadFileName, saveMemoryFile, writeFileSyncInternal };
|
|
118
117
|
//# sourceMappingURL=files.mjs.map
|