@wevu/web-apis 1.3.1 → 1.3.3
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/abort.mjs +1 -1
- package/dist/fetch.mjs +3 -3
- package/dist/{http-C-VyEBss.mjs → http-mcdF3N9S.mjs} +2 -2
- package/dist/http.mjs +1 -1
- package/dist/index.mjs +4 -4
- package/dist/{shared-BsJRaiBh.mjs → shared-85INNxXV.mjs} +18 -182
- package/dist/shared.mjs +1 -1
- package/dist/{web-kSAO_PSD.mjs → web-uZ-hezcd.mjs} +1 -1
- package/dist/web.mjs +1 -1
- package/dist/websocket.mjs +2 -2
- package/dist/xhr.mjs +2 -2
- package/package.json +3 -3
package/dist/abort.mjs
CHANGED
package/dist/fetch.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as normalizeHeaderName, h as isUrlSearchParamsInstance, l as isArrayBufferLike, m as isUrlInstance, n as cloneArrayBuffer, r as cloneArrayBufferView, u as isBlobLike } from "./shared-
|
|
2
|
-
import { a as encodeMultipartFormData, i as consumeBodyValue, n as RequestPolyfill, o as HeadersPolyfill, t as ResponsePolyfill } from "./http-
|
|
3
|
-
import { t as FormDataPolyfill } from "./web-
|
|
1
|
+
import { d as normalizeHeaderName, h as isUrlSearchParamsInstance, l as isArrayBufferLike, m as isUrlInstance, n as cloneArrayBuffer, r as cloneArrayBufferView, u as isBlobLike } from "./shared-85INNxXV.mjs";
|
|
2
|
+
import { a as encodeMultipartFormData, i as consumeBodyValue, n as RequestPolyfill, o as HeadersPolyfill, t as ResponsePolyfill } from "./http-mcdF3N9S.mjs";
|
|
3
|
+
import { t as FormDataPolyfill } from "./web-uZ-hezcd.mjs";
|
|
4
4
|
import { resolveRequestMiniProgramOptions } from "./networkDefaults.mjs";
|
|
5
5
|
import { wpi } from "@wevu/api";
|
|
6
6
|
//#region src/fetch.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as normalizeHeaderName, h as isUrlSearchParamsInstance, i as decodeText, l as isArrayBufferLike, m as isUrlInstance, n as cloneArrayBuffer, o as encodeText, r as cloneArrayBufferView, u as isBlobLike } from "./shared-
|
|
2
|
-
import { r as BlobPolyfill, t as FormDataPolyfill } from "./web-
|
|
1
|
+
import { d as normalizeHeaderName, h as isUrlSearchParamsInstance, i as decodeText, l as isArrayBufferLike, m as isUrlInstance, n as cloneArrayBuffer, o as encodeText, r as cloneArrayBufferView, u as isBlobLike } from "./shared-85INNxXV.mjs";
|
|
2
|
+
import { r as BlobPolyfill, t as FormDataPolyfill } from "./web-uZ-hezcd.mjs";
|
|
3
3
|
//#region src/http/headers.ts
|
|
4
4
|
const SET_COOKIE_HEADER_NAME = "set-cookie";
|
|
5
5
|
function isIterableHeaders(input) {
|
package/dist/http.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as RequestPolyfill, o as HeadersPolyfill, r as getRequestBodyValue, s as headersToObject, t as ResponsePolyfill } from "./http-
|
|
1
|
+
import { n as RequestPolyfill, o as HeadersPolyfill, r as getRequestBodyValue, s as headersToObject, t as ResponsePolyfill } from "./http-mcdF3N9S.mjs";
|
|
2
2
|
export { HeadersPolyfill, RequestPolyfill, ResponsePolyfill, getRequestBodyValue, headersToObject };
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as decodeTextFallback, c as installRequestGlobalBinding, f as resolveRequestGlobalsHost, l as isArrayBufferLike, n as cloneArrayBuffer, p as resolveRequestGlobalsHosts, r as cloneArrayBufferView, s as encodeTextFallback, t as RequestGlobalsEventTarget, v as getMiniProgramRuntimeGlobalKeys } from "./shared-
|
|
1
|
+
import { a as decodeTextFallback, c as installRequestGlobalBinding, f as resolveRequestGlobalsHost, l as isArrayBufferLike, n as cloneArrayBuffer, p as resolveRequestGlobalsHosts, r as cloneArrayBufferView, s as encodeTextFallback, t as RequestGlobalsEventTarget, v as getMiniProgramRuntimeGlobalKeys } from "./shared-85INNxXV.mjs";
|
|
2
2
|
import { URLPolyfill, URLSearchParamsPolyfill } from "./url.mjs";
|
|
3
3
|
import { AbortControllerPolyfill, AbortSignalPolyfill } from "./abort.mjs";
|
|
4
|
-
import { n as RequestPolyfill, o as HeadersPolyfill, t as ResponsePolyfill } from "./http-
|
|
5
|
-
import { n as FilePolyfill, r as BlobPolyfill, t as FormDataPolyfill } from "./web-
|
|
4
|
+
import { n as RequestPolyfill, o as HeadersPolyfill, t as ResponsePolyfill } from "./http-mcdF3N9S.mjs";
|
|
5
|
+
import { n as FilePolyfill, r as BlobPolyfill, t as FormDataPolyfill } from "./web-uZ-hezcd.mjs";
|
|
6
6
|
import { getMiniProgramNetworkDefaults, resetMiniProgramNetworkDefaults, setMiniProgramNetworkDefaults } from "./networkDefaults.mjs";
|
|
7
7
|
import { fetch } from "./fetch.mjs";
|
|
8
8
|
import { WebSocketPolyfill } from "./websocket.mjs";
|
|
@@ -159,7 +159,7 @@ const performancePolyfill = {
|
|
|
159
159
|
//#region src/task.ts
|
|
160
160
|
function queueMicrotaskPolyfill(callback) {
|
|
161
161
|
if (typeof callback !== "function") throw new TypeError("Failed to execute 'queueMicrotask': callback must be a function");
|
|
162
|
-
const nativeQueueMicrotask = globalThis.queueMicrotask;
|
|
162
|
+
const nativeQueueMicrotask = typeof globalThis !== "undefined" ? globalThis.queueMicrotask : void 0;
|
|
163
163
|
if (typeof nativeQueueMicrotask === "function" && nativeQueueMicrotask !== queueMicrotaskPolyfill && nativeQueueMicrotask[REQUEST_GLOBAL_PLACEHOLDER_KEY] !== true) {
|
|
164
164
|
nativeQueueMicrotask(callback);
|
|
165
165
|
return;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { URLPolyfill, URLSearchParamsPolyfill } from "./url.mjs";
|
|
2
|
-
//#region ../../@weapp-core/shared/dist/platforms
|
|
3
|
-
const
|
|
2
|
+
//#region ../../@weapp-core/shared/dist/platforms/runtime/descriptors.js
|
|
3
|
+
const DEFAULT_RUNTIME_HOST_CONFIG_KEY = "__wxConfig";
|
|
4
4
|
const DEFAULT_RUNTIME_CAPABILITIES = Object.freeze({
|
|
5
5
|
globalPageStack: true,
|
|
6
6
|
globalCreateSelectorQuery: true,
|
|
@@ -22,46 +22,18 @@ const DEFAULT_PAGE_IDENTITY_RULES = [{
|
|
|
22
22
|
prefix: "route",
|
|
23
23
|
source: "route"
|
|
24
24
|
}];
|
|
25
|
-
|
|
26
|
-
* @description 全仓库统一的小程序平台描述表。
|
|
27
|
-
*/
|
|
28
|
-
const MINI_PROGRAM_PLATFORM_DESCRIPTORS = [
|
|
25
|
+
const MINI_PROGRAM_RUNTIME_DESCRIPTORS = [
|
|
29
26
|
{
|
|
30
27
|
id: "weapp",
|
|
31
|
-
displayName: "WeChat Mini Program",
|
|
32
|
-
family: "wechat",
|
|
33
28
|
aliases: [
|
|
34
29
|
"weapp",
|
|
35
30
|
"wechat",
|
|
36
31
|
"weixin",
|
|
37
32
|
"wx"
|
|
38
33
|
],
|
|
39
|
-
outputExtensions: {
|
|
40
|
-
js: "js",
|
|
41
|
-
json: "json",
|
|
42
|
-
wxml: "wxml",
|
|
43
|
-
wxss: "wxss",
|
|
44
|
-
wxs: "wxs"
|
|
45
|
-
},
|
|
46
|
-
projectConfigFileName: "project.config.json",
|
|
47
|
-
projectConfigRootKeys: DEFAULT_PROJECT_CONFIG_ROOT_KEYS,
|
|
48
|
-
ide: {},
|
|
49
|
-
build: {
|
|
50
|
-
autoTouchAppStyle: true,
|
|
51
|
-
defaultBuildTarget: "es2020"
|
|
52
|
-
},
|
|
53
|
-
resolvePreservedNpmDirNames: () => ["miniprogram_npm"],
|
|
54
|
-
json: {},
|
|
55
|
-
npm: { distDirName: () => "miniprogram_npm" },
|
|
56
|
-
wxml: {
|
|
57
|
-
eventBindingStyle: "default",
|
|
58
|
-
directivePrefix: "wx"
|
|
59
|
-
},
|
|
60
|
-
compiler: { templatePreset: "wechat" },
|
|
61
|
-
typescript: { appTypesPackage: "miniprogram-api-typings" },
|
|
62
34
|
runtime: {
|
|
63
35
|
globalObjectKey: "wx",
|
|
64
|
-
hostConfigKey:
|
|
36
|
+
hostConfigKey: DEFAULT_RUNTIME_HOST_CONFIG_KEY,
|
|
65
37
|
globalResolvePriority: 1,
|
|
66
38
|
routeGlobalResolvePriority: 0,
|
|
67
39
|
capabilities: DEFAULT_RUNTIME_CAPABILITIES,
|
|
@@ -82,58 +54,14 @@ const MINI_PROGRAM_PLATFORM_DESCRIPTORS = [
|
|
|
82
54
|
},
|
|
83
55
|
{
|
|
84
56
|
id: "alipay",
|
|
85
|
-
displayName: "Alipay Mini Program",
|
|
86
|
-
family: "alipay",
|
|
87
57
|
aliases: [
|
|
88
58
|
"alipay",
|
|
89
59
|
"ali",
|
|
90
60
|
"my"
|
|
91
61
|
],
|
|
92
|
-
outputExtensions: {
|
|
93
|
-
js: "js",
|
|
94
|
-
json: "json",
|
|
95
|
-
wxml: "axml",
|
|
96
|
-
wxss: "acss",
|
|
97
|
-
wxs: "sjs"
|
|
98
|
-
},
|
|
99
|
-
projectConfigFileName: "mini.project.json",
|
|
100
|
-
projectConfigRootKeys: DEFAULT_PROJECT_CONFIG_ROOT_KEYS,
|
|
101
|
-
scriptModuleTagByExtension: { sjs: "import-sjs" },
|
|
102
|
-
usesProjectRootNpmDir: true,
|
|
103
|
-
ide: {
|
|
104
|
-
requiresOpenPlatformArg: true,
|
|
105
|
-
defaultProjectRoot: "dist/alipay/dist"
|
|
106
|
-
},
|
|
107
|
-
build: {
|
|
108
|
-
autoTouchAppStyle: false,
|
|
109
|
-
defaultBuildTarget: "es2015"
|
|
110
|
-
},
|
|
111
|
-
resolvePreservedNpmDirNames: (options) => [options?.alipayNpmMode === "miniprogram_npm" ? "miniprogram_npm" : "node_modules"],
|
|
112
|
-
json: {
|
|
113
|
-
normalizeUsingComponents: true,
|
|
114
|
-
fillComponentGenericsDefault: true,
|
|
115
|
-
rewriteBundleNpmImports: true
|
|
116
|
-
},
|
|
117
|
-
npm: {
|
|
118
|
-
distDirName: (options) => options?.alipayNpmMode === "miniprogram_npm" ? "miniprogram_npm" : "node_modules",
|
|
119
|
-
normalizeImportPath: true,
|
|
120
|
-
normalizeMiniprogramPackage: true,
|
|
121
|
-
copyEsModuleDirectory: true,
|
|
122
|
-
hoistNestedDependencies: true,
|
|
123
|
-
shouldRebuildCachedPackage: true
|
|
124
|
-
},
|
|
125
|
-
wxml: {
|
|
126
|
-
eventBindingStyle: "alipay",
|
|
127
|
-
directivePrefix: "a",
|
|
128
|
-
normalizeComponentTagName: true,
|
|
129
|
-
normalizeVueTemplate: true,
|
|
130
|
-
emitGenericPlaceholder: true
|
|
131
|
-
},
|
|
132
|
-
compiler: { templatePreset: "alipay" },
|
|
133
|
-
typescript: { appTypesPackage: "@mini-types/alipay" },
|
|
134
62
|
runtime: {
|
|
135
63
|
globalObjectKey: "my",
|
|
136
|
-
hostConfigKey:
|
|
64
|
+
hostConfigKey: DEFAULT_RUNTIME_HOST_CONFIG_KEY,
|
|
137
65
|
globalResolvePriority: 0,
|
|
138
66
|
routeGlobalResolvePriority: 2,
|
|
139
67
|
capabilities: {
|
|
@@ -146,78 +74,29 @@ const MINI_PROGRAM_PLATFORM_DESCRIPTORS = [
|
|
|
146
74
|
},
|
|
147
75
|
{
|
|
148
76
|
id: "swan",
|
|
149
|
-
displayName: "Baidu Smart Program",
|
|
150
|
-
family: "swan",
|
|
151
77
|
aliases: [
|
|
152
78
|
"swan",
|
|
153
79
|
"baidu",
|
|
154
80
|
"bd"
|
|
155
81
|
],
|
|
156
|
-
outputExtensions: {
|
|
157
|
-
js: "js",
|
|
158
|
-
json: "json",
|
|
159
|
-
wxml: "swan",
|
|
160
|
-
wxss: "css",
|
|
161
|
-
wxs: "sjs"
|
|
162
|
-
},
|
|
163
|
-
projectConfigFileName: "project.swan.json",
|
|
164
|
-
projectConfigRootKeys: ["smartProgramRoot", ...DEFAULT_PROJECT_CONFIG_ROOT_KEYS],
|
|
165
|
-
ide: {},
|
|
166
|
-
build: { autoTouchAppStyle: false },
|
|
167
|
-
resolvePreservedNpmDirNames: () => ["miniprogram_npm"],
|
|
168
|
-
json: {},
|
|
169
|
-
npm: { distDirName: () => "miniprogram_npm" },
|
|
170
|
-
wxml: {
|
|
171
|
-
eventBindingStyle: "default",
|
|
172
|
-
directivePrefix: "s"
|
|
173
|
-
},
|
|
174
|
-
compiler: { templatePreset: "swan" },
|
|
175
|
-
typescript: { appTypesPackage: "miniprogram-api-typings" },
|
|
176
82
|
runtime: {
|
|
177
83
|
globalObjectKey: "swan",
|
|
178
|
-
hostConfigKey:
|
|
84
|
+
hostConfigKey: DEFAULT_RUNTIME_HOST_CONFIG_KEY,
|
|
179
85
|
capabilities: DEFAULT_RUNTIME_CAPABILITIES,
|
|
180
86
|
pageIdentityRules: DEFAULT_PAGE_IDENTITY_RULES
|
|
181
87
|
}
|
|
182
88
|
},
|
|
183
89
|
{
|
|
184
90
|
id: "tt",
|
|
185
|
-
displayName: "ByteDance / Douyin Mini Program",
|
|
186
|
-
family: "tt",
|
|
187
91
|
aliases: [
|
|
188
92
|
"tt",
|
|
189
93
|
"toutiao",
|
|
190
94
|
"bytedance",
|
|
191
95
|
"douyin"
|
|
192
96
|
],
|
|
193
|
-
outputExtensions: {
|
|
194
|
-
js: "js",
|
|
195
|
-
json: "json",
|
|
196
|
-
wxml: "ttml",
|
|
197
|
-
wxss: "ttss"
|
|
198
|
-
},
|
|
199
|
-
projectConfigFileName: "project.config.json",
|
|
200
|
-
projectConfigRootKeys: DEFAULT_PROJECT_CONFIG_ROOT_KEYS,
|
|
201
|
-
ide: {},
|
|
202
|
-
build: { autoTouchAppStyle: false },
|
|
203
|
-
resolvePreservedNpmDirNames: () => ["miniprogram_npm"],
|
|
204
|
-
json: {
|
|
205
|
-
normalizeUsingComponents: true,
|
|
206
|
-
rewriteBundleNpmImports: true
|
|
207
|
-
},
|
|
208
|
-
npm: {
|
|
209
|
-
distDirName: () => "miniprogram_npm",
|
|
210
|
-
normalizeImportPath: true
|
|
211
|
-
},
|
|
212
|
-
wxml: {
|
|
213
|
-
eventBindingStyle: "default",
|
|
214
|
-
directivePrefix: "tt"
|
|
215
|
-
},
|
|
216
|
-
compiler: { templatePreset: "tt" },
|
|
217
|
-
typescript: { appTypesPackage: "@douyin-microapp/typings" },
|
|
218
97
|
runtime: {
|
|
219
98
|
globalObjectKey: "tt",
|
|
220
|
-
hostConfigKey:
|
|
99
|
+
hostConfigKey: DEFAULT_RUNTIME_HOST_CONFIG_KEY,
|
|
221
100
|
globalResolvePriority: 2,
|
|
222
101
|
routeGlobalResolvePriority: 1,
|
|
223
102
|
capabilities: {
|
|
@@ -229,74 +108,32 @@ const MINI_PROGRAM_PLATFORM_DESCRIPTORS = [
|
|
|
229
108
|
},
|
|
230
109
|
{
|
|
231
110
|
id: "jd",
|
|
232
|
-
displayName: "JD Mini Program",
|
|
233
|
-
family: "wechat",
|
|
234
111
|
aliases: ["jd", "jingdong"],
|
|
235
|
-
outputExtensions: {
|
|
236
|
-
js: "js",
|
|
237
|
-
json: "json",
|
|
238
|
-
wxml: "jxml",
|
|
239
|
-
wxss: "jxss",
|
|
240
|
-
wxs: "wxs"
|
|
241
|
-
},
|
|
242
|
-
projectConfigFileName: "project.config.json",
|
|
243
|
-
projectConfigRootKeys: DEFAULT_PROJECT_CONFIG_ROOT_KEYS,
|
|
244
|
-
ide: {},
|
|
245
|
-
build: { autoTouchAppStyle: false },
|
|
246
|
-
resolvePreservedNpmDirNames: () => ["miniprogram_npm"],
|
|
247
|
-
json: {},
|
|
248
|
-
npm: { distDirName: () => "miniprogram_npm" },
|
|
249
|
-
wxml: {
|
|
250
|
-
eventBindingStyle: "default",
|
|
251
|
-
directivePrefix: "wx"
|
|
252
|
-
},
|
|
253
|
-
compiler: { templatePreset: "wechat" },
|
|
254
|
-
typescript: { appTypesPackage: "miniprogram-api-typings" },
|
|
255
112
|
runtime: {
|
|
256
113
|
globalObjectKey: "jd",
|
|
257
|
-
hostConfigKey:
|
|
114
|
+
hostConfigKey: DEFAULT_RUNTIME_HOST_CONFIG_KEY,
|
|
258
115
|
capabilities: DEFAULT_RUNTIME_CAPABILITIES,
|
|
259
116
|
pageIdentityRules: DEFAULT_PAGE_IDENTITY_RULES
|
|
260
117
|
}
|
|
261
118
|
},
|
|
262
119
|
{
|
|
263
120
|
id: "xhs",
|
|
264
|
-
displayName: "Xiaohongshu Mini Program",
|
|
265
|
-
family: "wechat",
|
|
266
121
|
aliases: [
|
|
267
122
|
"xhs",
|
|
268
123
|
"xiaohongshu",
|
|
269
124
|
"little-red-book",
|
|
270
125
|
"red"
|
|
271
126
|
],
|
|
272
|
-
outputExtensions: {
|
|
273
|
-
js: "js",
|
|
274
|
-
json: "json",
|
|
275
|
-
wxml: "xhsml",
|
|
276
|
-
wxss: "css",
|
|
277
|
-
wxs: "wxs"
|
|
278
|
-
},
|
|
279
|
-
projectConfigFileName: "project.config.json",
|
|
280
|
-
projectConfigRootKeys: DEFAULT_PROJECT_CONFIG_ROOT_KEYS,
|
|
281
|
-
ide: {},
|
|
282
|
-
build: { autoTouchAppStyle: false },
|
|
283
|
-
resolvePreservedNpmDirNames: () => ["miniprogram_npm"],
|
|
284
|
-
json: {},
|
|
285
|
-
npm: { distDirName: () => "miniprogram_npm" },
|
|
286
|
-
wxml: {
|
|
287
|
-
eventBindingStyle: "default",
|
|
288
|
-
directivePrefix: "wx"
|
|
289
|
-
},
|
|
290
|
-
compiler: { templatePreset: "wechat" },
|
|
291
|
-
typescript: { appTypesPackage: "miniprogram-api-typings" },
|
|
292
127
|
runtime: {
|
|
293
128
|
globalObjectKey: "xhs",
|
|
294
|
-
hostConfigKey:
|
|
129
|
+
hostConfigKey: DEFAULT_RUNTIME_HOST_CONFIG_KEY,
|
|
295
130
|
capabilities: DEFAULT_RUNTIME_CAPABILITIES,
|
|
296
131
|
pageIdentityRules: DEFAULT_PAGE_IDENTITY_RULES
|
|
297
132
|
}
|
|
298
133
|
}
|
|
299
134
|
];
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region ../../@weapp-core/shared/dist/platforms/runtime/helpers.js
|
|
300
137
|
function createMiniProgramPlatformRegistry(descriptors) {
|
|
301
138
|
const descriptorById = /* @__PURE__ */ new Map();
|
|
302
139
|
const aliasToId = /* @__PURE__ */ new Map();
|
|
@@ -317,17 +154,16 @@ function createMiniProgramPlatformRegistry(descriptors) {
|
|
|
317
154
|
runtimeGlobalKeyToId
|
|
318
155
|
};
|
|
319
156
|
}
|
|
320
|
-
const { aliasToId: MINI_PROGRAM_PLATFORM_ALIAS_TO_ID, descriptorById: MINI_PROGRAM_PLATFORM_DESCRIPTOR_BY_ID, runtimeGlobalKeyToId: MINI_PROGRAM_RUNTIME_GLOBAL_KEY_TO_ID } = createMiniProgramPlatformRegistry(
|
|
321
|
-
Object.freeze(
|
|
322
|
-
Object.freeze(Array.from(new Set(
|
|
323
|
-
const ORDERED_RUNTIME_GLOBAL_KEYS = Object.freeze(Array.from(new Set(MINI_PROGRAM_PLATFORM_DESCRIPTORS.map((descriptor) => descriptor.runtime.globalObjectKey))));
|
|
157
|
+
const { aliasToId: MINI_PROGRAM_PLATFORM_ALIAS_TO_ID, descriptorById: MINI_PROGRAM_PLATFORM_DESCRIPTOR_BY_ID, runtimeGlobalKeyToId: MINI_PROGRAM_RUNTIME_GLOBAL_KEY_TO_ID } = createMiniProgramPlatformRegistry(MINI_PROGRAM_RUNTIME_DESCRIPTORS);
|
|
158
|
+
Object.freeze(MINI_PROGRAM_RUNTIME_DESCRIPTORS.map((descriptor) => descriptor.id));
|
|
159
|
+
const ORDERED_RUNTIME_GLOBAL_KEYS = Object.freeze(Array.from(new Set(MINI_PROGRAM_RUNTIME_DESCRIPTORS.map((descriptor) => descriptor.runtime.globalObjectKey))));
|
|
324
160
|
const MAX_RUNTIME_RESOLVE_PRIORITY = Number.MAX_SAFE_INTEGER;
|
|
325
161
|
function getOrderedRuntimeGlobalKeysByPriority(priorityKey) {
|
|
326
|
-
const ordered = [...
|
|
162
|
+
const ordered = [...MINI_PROGRAM_RUNTIME_DESCRIPTORS].sort((left, right) => {
|
|
327
163
|
const leftPriority = left.runtime[priorityKey] ?? MAX_RUNTIME_RESOLVE_PRIORITY;
|
|
328
164
|
const rightPriority = right.runtime[priorityKey] ?? MAX_RUNTIME_RESOLVE_PRIORITY;
|
|
329
165
|
if (leftPriority !== rightPriority) return leftPriority - rightPriority;
|
|
330
|
-
return
|
|
166
|
+
return MINI_PROGRAM_RUNTIME_DESCRIPTORS.indexOf(left) - MINI_PROGRAM_RUNTIME_DESCRIPTORS.indexOf(right);
|
|
331
167
|
});
|
|
332
168
|
return Object.freeze(Array.from(new Set(ordered.map((descriptor) => descriptor.runtime.globalObjectKey))));
|
|
333
169
|
}
|
|
@@ -342,7 +178,7 @@ Object.freeze(MINI_PROGRAM_PLATFORM_ALIAS_RECORD);
|
|
|
342
178
|
/**
|
|
343
179
|
* @description 获取平台描述。
|
|
344
180
|
*/
|
|
345
|
-
function
|
|
181
|
+
function getMiniProgramRuntimeDescriptor(platform) {
|
|
346
182
|
const descriptor = MINI_PROGRAM_PLATFORM_DESCRIPTOR_BY_ID.get(platform);
|
|
347
183
|
if (!descriptor) throw new Error(`不支持的小程序平台 "${platform}"。`);
|
|
348
184
|
return descriptor;
|
|
@@ -351,7 +187,7 @@ function getMiniProgramPlatformDescriptor(platform) {
|
|
|
351
187
|
* @description 获取宿主全局对象 key。
|
|
352
188
|
*/
|
|
353
189
|
function getMiniProgramRuntimeGlobalKey(platform) {
|
|
354
|
-
return
|
|
190
|
+
return getMiniProgramRuntimeDescriptor(platform).runtime.globalObjectKey;
|
|
355
191
|
}
|
|
356
192
|
/**
|
|
357
193
|
* @description 返回 runtime 全局对象 key 的扫描优先级。
|
package/dist/shared.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as decodeTextFallback, c as installRequestGlobalBinding, d as normalizeHeaderName, f as resolveRequestGlobalsHost, i as decodeText, l as isArrayBufferLike, n as cloneArrayBuffer, o as encodeText, p as resolveRequestGlobalsHosts, r as cloneArrayBufferView, s as encodeTextFallback, t as RequestGlobalsEventTarget, u as isBlobLike } from "./shared-
|
|
1
|
+
import { a as decodeTextFallback, c as installRequestGlobalBinding, d as normalizeHeaderName, f as resolveRequestGlobalsHost, i as decodeText, l as isArrayBufferLike, n as cloneArrayBuffer, o as encodeText, p as resolveRequestGlobalsHosts, r as cloneArrayBufferView, s as encodeTextFallback, t as RequestGlobalsEventTarget, u as isBlobLike } from "./shared-85INNxXV.mjs";
|
|
2
2
|
export { RequestGlobalsEventTarget, cloneArrayBuffer, cloneArrayBufferView, decodeText, decodeTextFallback, encodeText, encodeTextFallback, installRequestGlobalBinding, isArrayBufferLike, isBlobLike, normalizeHeaderName, resolveRequestGlobalsHost, resolveRequestGlobalsHosts };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as decodeText, l as isArrayBufferLike, n as cloneArrayBuffer, o as encodeText, r as cloneArrayBufferView, u as isBlobLike } from "./shared-
|
|
1
|
+
import { i as decodeText, l as isArrayBufferLike, n as cloneArrayBuffer, o as encodeText, r as cloneArrayBufferView, u as isBlobLike } from "./shared-85INNxXV.mjs";
|
|
2
2
|
//#region src/web/blob.ts
|
|
3
3
|
const segments = /* @__PURE__ */ new WeakMap();
|
|
4
4
|
/** Blob 的 MIME 类型只接受可打印 ASCII,并按标准转换成小写。 */
|
package/dist/web.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as FilePolyfill, r as BlobPolyfill, t as FormDataPolyfill } from "./web-
|
|
1
|
+
import { n as FilePolyfill, r as BlobPolyfill, t as FormDataPolyfill } from "./web-uZ-hezcd.mjs";
|
|
2
2
|
export { BlobPolyfill, FilePolyfill, FormDataPolyfill };
|
package/dist/websocket.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as resolveUrlConstructor$1, g as resolveTextEncoderConstructor, l as isArrayBufferLike, n as cloneArrayBuffer, r as cloneArrayBufferView, t as RequestGlobalsEventTarget, u as isBlobLike } from "./shared-
|
|
1
|
+
import { _ as resolveUrlConstructor$1, g as resolveTextEncoderConstructor, l as isArrayBufferLike, n as cloneArrayBuffer, r as cloneArrayBufferView, t as RequestGlobalsEventTarget, u as isBlobLike } from "./shared-85INNxXV.mjs";
|
|
2
2
|
import { URLPolyfill } from "./url.mjs";
|
|
3
|
-
import { r as BlobPolyfill } from "./web-
|
|
3
|
+
import { r as BlobPolyfill } from "./web-uZ-hezcd.mjs";
|
|
4
4
|
import { resolveWebSocketMiniProgramOptions } from "./networkDefaults.mjs";
|
|
5
5
|
import { wpi } from "@wevu/api";
|
|
6
6
|
//#region src/websocket.ts
|
package/dist/xhr.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { f as resolveRequestGlobalsHost, t as RequestGlobalsEventTarget } from "./shared-
|
|
1
|
+
import { f as resolveRequestGlobalsHost, t as RequestGlobalsEventTarget } from "./shared-85INNxXV.mjs";
|
|
2
2
|
import { AbortControllerPolyfill } from "./abort.mjs";
|
|
3
|
-
import { o as HeadersPolyfill, s as headersToObject } from "./http-
|
|
3
|
+
import { o as HeadersPolyfill, s as headersToObject } from "./http-mcdF3N9S.mjs";
|
|
4
4
|
import { fetch } from "./fetch.mjs";
|
|
5
5
|
//#region src/xhr.ts
|
|
6
6
|
function createProgressEvent(type) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wevu/web-apis",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.3",
|
|
5
5
|
"description": "Web API polyfills and global installers for mini-program runtimes",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"node": "^20.19.0 || >=22.12.0"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@weapp-core/constants": "0.2.
|
|
83
|
-
"@wevu/api": "0.3.
|
|
82
|
+
"@weapp-core/constants": "0.2.7",
|
|
83
|
+
"@wevu/api": "0.3.6"
|
|
84
84
|
},
|
|
85
85
|
"publishConfig": {
|
|
86
86
|
"access": "public",
|