@xhsreds/reds-rn-next 0.10.2-beta202512172040 → 0.10.2-beta202512181604
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/coverage/.tmp/coverage-1.json +1 -1
- package/coverage/.tmp/coverage-10.json +1 -1
- package/coverage/.tmp/coverage-11.json +1 -1
- package/coverage/.tmp/coverage-12.json +1 -1
- package/coverage/.tmp/coverage-13.json +1 -1
- package/coverage/.tmp/coverage-14.json +1 -1
- package/coverage/.tmp/coverage-15.json +1 -1
- package/coverage/.tmp/coverage-16.json +1 -1
- package/coverage/.tmp/coverage-17.json +1 -1
- package/coverage/.tmp/coverage-18.json +1 -1
- package/coverage/.tmp/coverage-19.json +1 -1
- package/coverage/.tmp/coverage-2.json +1 -1
- package/coverage/.tmp/coverage-20.json +1 -1
- package/coverage/.tmp/coverage-21.json +1 -1
- package/coverage/.tmp/coverage-22.json +1 -1
- package/coverage/.tmp/coverage-23.json +1 -1
- package/coverage/.tmp/coverage-24.json +1 -1
- package/coverage/.tmp/coverage-25.json +1 -1
- package/coverage/.tmp/coverage-26.json +1 -1
- package/coverage/.tmp/coverage-27.json +1 -1
- package/coverage/.tmp/coverage-31.json +1 -1
- package/coverage/.tmp/coverage-33.json +1 -1
- package/coverage/.tmp/coverage-34.json +1 -1
- package/coverage/.tmp/coverage-35.json +1 -1
- package/coverage/.tmp/coverage-37.json +1 -1
- package/coverage/.tmp/coverage-39.json +1 -1
- package/coverage/.tmp/coverage-4.json +1 -1
- package/coverage/.tmp/coverage-5.json +1 -1
- package/coverage/.tmp/coverage-6.json +1 -1
- package/coverage/.tmp/coverage-7.json +1 -1
- package/coverage/.tmp/coverage-8.json +1 -1
- package/coverage/.tmp/coverage-9.json +1 -1
- package/lib/cjs/components/Image/queryCacheBatcher.js +1 -2
- package/lib/cjs/components/Image/queryCacheBatcher.js.map +1 -1
- package/lib/esm/components/Image/queryCacheBatcher.js +1 -2
- package/lib/esm/components/Image/queryCacheBatcher.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Image/queryCacheBatcher.ts +1 -1
- package/src/i18n/@types/resources.d.ts +27 -27
- package/src/i18n/index.json +31 -31
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryCacheBatcher.js","sources":["../../../../src/components/Image/queryCacheBatcher.ts"],"sourcesContent":["import { Image as RNImage } from \"react-native\";\n\ndeclare const global: any;\n\ntype Resolver = (value: boolean) => void;\n\n// Runtime switch: set global.REDS_IMAGE_QUERYCACHE_BATCHING_ENABLED = false to disable batching\nlet enabled: boolean =
|
|
1
|
+
{"version":3,"file":"queryCacheBatcher.js","sources":["../../../../src/components/Image/queryCacheBatcher.ts"],"sourcesContent":["import { Image as RNImage } from \"react-native\";\n\ndeclare const global: any;\n\ntype Resolver = (value: boolean) => void;\n\n// Runtime switch: set global.REDS_IMAGE_QUERYCACHE_BATCHING_ENABLED = false to disable batching\nlet enabled: boolean = false;\nlet FLUSH_MS = 50;\n\nconst pending = new Map<string, Resolver[]>();\nlet timer: ReturnType<typeof setTimeout> | null = null;\n\nfunction directQuery(url: string): Promise<boolean> {\n try {\n if (typeof (RNImage as any).queryCache !== \"function\") {\n return Promise.resolve(false);\n }\n return (RNImage as any)\n .queryCache([url])\n .then((res: Record<string, any>) => !!(res?.[url] || res?.[encodeURI(url)]))\n .catch(() => false);\n } catch (_) {\n return Promise.resolve(false);\n }\n}\n\nfunction flush() {\n const entries = Array.from(pending.entries());\n pending.clear();\n timer = null;\n\n const urls = entries.map(([url]) => url);\n if (!urls.length) return;\n\n if (typeof (RNImage as any).queryCache !== \"function\") {\n entries.forEach(([, resolvers]) => resolvers.forEach((r) => r(false)));\n return;\n }\n\n (RNImage as any)\n .queryCache(urls)\n .then((res: Record<string, any>) => {\n entries.forEach(([url, resolvers]) => {\n const ok = !!(res?.[url] || res?.[encodeURI(url)]);\n resolvers.forEach((r) => r(ok));\n });\n })\n .catch(() => {\n entries.forEach(([, resolvers]) => resolvers.forEach((r) => r(false)));\n });\n}\n\nfunction schedule() {\n if (!timer) {\n timer = setTimeout(flush, FLUSH_MS);\n }\n}\n\nexport function setQueryCacheBatchingEnabled(v: boolean) {\n enabled = v;\n}\n\nexport function configureQueryCacheBatching(options: { flushMs?: number } = {}) {\n if (typeof options.flushMs === \"number\" && options.flushMs >= 0) {\n FLUSH_MS = options.flushMs;\n }\n}\n\n// Main entry: batched query with quick toggle to direct query\nexport function queryCacheBatched(url: string): Promise<boolean> {\n if (!url) return Promise.resolve(false);\n if (!enabled) return directQuery(url);\n\n return new Promise<boolean>((resolve) => {\n const list = pending.get(url);\n if (list) {\n list.push(resolve);\n } else {\n pending.set(url, [resolve]);\n }\n schedule();\n });\n}\n"],"names":["enabled","FLUSH_MS","pending","Map","timer","directQuery","url","RNImage","queryCache","Promise","resolve","then","res","encodeURI","_","flush","entries","Array","from","clear","urls","map","_ref","_ref2","_slicedToArray","length","forEach","_ref3","_ref4","resolvers","r","_ref5","_ref6","ok","_ref7","_ref8","schedule","setTimeout","setQueryCacheBatchingEnabled","v","configureQueryCacheBatching","options","arguments","undefined","flushMs","queryCacheBatched","list","get","push","set"],"mappings":";;;AAOA,IAAIA,OAAmB,GAAA,KAAA,CAAA;AACvB,IAAIC,QAAW,GAAA,EAAA,CAAA;AAEf,IAAMC,OAAA,sBAAcC,GAAwB,EAAA,CAAA;AAC5C,IAAIC,KAA8C,GAAA,IAAA,CAAA;AAElD,SAASC,YAAYC,GAA+B,EAAA;EAC9C,IAAA;AACE,IAAA,IAAA,OAAQC,KAAgB,CAAAC,UAAA,KAAe,UAAY,EAAA;AAC9C,MAAA,OAAAC,OAAA,CAAQC,QAAQ,KAAK,CAAA,CAAA;AAC9B,KAAA;AACQ,IAAA,OAAAH,KAAA,CACLC,WAAW,CAACF,GAAG,CAAC,CAChB,CAAAK,IAAA,CAAK,UAACC,GAAA,EAAA;MAAA,OAA6B,CAAC,EAAEA,gBAAAA,QAAAA,KAAAA,CAAAA,IAAAA,IAAMN,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>",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"dependencies": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"react-native-fs": "2.20.0",
|
|
27
27
|
"react-native-svg": "13.14.0",
|
|
28
28
|
"@xhs/react-native-harmony": "*",
|
|
29
|
-
"@xhsreds/reds-token-next": "0.10.2-
|
|
29
|
+
"@xhsreds/reds-token-next": "0.10.2-beta202512181604"
|
|
30
30
|
},
|
|
31
31
|
"peerDependenciesMeta": {
|
|
32
32
|
"ozone-schema-web": {
|
|
@@ -5,7 +5,7 @@ declare const global: any;
|
|
|
5
5
|
type Resolver = (value: boolean) => void;
|
|
6
6
|
|
|
7
7
|
// Runtime switch: set global.REDS_IMAGE_QUERYCACHE_BATCHING_ENABLED = false to disable batching
|
|
8
|
-
let enabled: boolean =
|
|
8
|
+
let enabled: boolean = false;
|
|
9
9
|
let FLUSH_MS = 50;
|
|
10
10
|
|
|
11
11
|
const pending = new Map<string, Resolver[]>();
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
interface Resources {
|
|
2
2
|
componentKey: {
|
|
3
|
-
sureKey: "
|
|
4
|
-
satisfyKey: "
|
|
5
|
-
confirmKey: "
|
|
6
|
-
uploadingKey: "
|
|
7
|
-
resetKey: "
|
|
8
|
-
NoDataKey: "
|
|
9
|
-
liveStreamingKey: "
|
|
10
|
-
generallyKey: "
|
|
11
|
-
uploadFailedKey: "
|
|
12
|
-
submitKey: "
|
|
13
|
-
requestSuccessfulKey: "
|
|
14
|
-
cancelKey: "
|
|
15
|
-
PullDownToRefreshKey: "
|
|
16
|
-
selectAllKey: "
|
|
17
|
-
requestDataKey: "
|
|
18
|
-
closeKey: "
|
|
19
|
-
veryBadKey: "
|
|
20
|
-
searchKey: "
|
|
21
|
-
expandKey: "
|
|
22
|
-
IDCardPhotoKey: "
|
|
23
|
-
finishKey: "
|
|
24
|
-
surpriseKey: "
|
|
25
|
-
releaseRefreshKey: "
|
|
26
|
-
nationalEmblemSideOfIDCardKey: "
|
|
27
|
-
buttonKey: "
|
|
28
|
-
jumpKey: "
|
|
29
|
-
disappointmentKey: "
|
|
3
|
+
sureKey: "Confirm";
|
|
4
|
+
satisfyKey: "Satisfy";
|
|
5
|
+
confirmKey: "Confirm";
|
|
6
|
+
uploadingKey: "Uploading";
|
|
7
|
+
resetKey: "Reset";
|
|
8
|
+
NoDataKey: "No data available at the moment";
|
|
9
|
+
liveStreamingKey: "live";
|
|
10
|
+
generallyKey: "Generally";
|
|
11
|
+
uploadFailedKey: "Upload failed";
|
|
12
|
+
submitKey: "Submit";
|
|
13
|
+
requestSuccessfulKey: "Request successful";
|
|
14
|
+
cancelKey: "Cancel";
|
|
15
|
+
PullDownToRefreshKey: "Pull down to refresh";
|
|
16
|
+
selectAllKey: "SelectAll";
|
|
17
|
+
requestDataKey: "Request data";
|
|
18
|
+
closeKey: "Close";
|
|
19
|
+
veryBadKey: "Very bad";
|
|
20
|
+
searchKey: "Search";
|
|
21
|
+
expandKey: "Expand";
|
|
22
|
+
IDCardPhotoKey: "ID card photo";
|
|
23
|
+
finishKey: "Finish";
|
|
24
|
+
surpriseKey: "Surprise";
|
|
25
|
+
releaseRefreshKey: "Release refresh";
|
|
26
|
+
nationalEmblemSideOfIDCardKey: "National emblem side of ID card";
|
|
27
|
+
buttonKey: "Button";
|
|
28
|
+
jumpKey: "Jump";
|
|
29
|
+
disappointmentKey: "Disappointment";
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
export default Resources;
|
package/src/i18n/index.json
CHANGED
|
@@ -1,4 +1,35 @@
|
|
|
1
1
|
{
|
|
2
|
+
"en_us": {
|
|
3
|
+
"componentKey": {
|
|
4
|
+
"sureKey": "Confirm",
|
|
5
|
+
"satisfyKey": "Satisfy",
|
|
6
|
+
"confirmKey": "Confirm",
|
|
7
|
+
"uploadingKey": "Uploading",
|
|
8
|
+
"resetKey": "Reset",
|
|
9
|
+
"NoDataKey": "No data available at the moment",
|
|
10
|
+
"liveStreamingKey": "live",
|
|
11
|
+
"generallyKey": "Generally",
|
|
12
|
+
"uploadFailedKey": "Upload failed",
|
|
13
|
+
"submitKey": "Submit",
|
|
14
|
+
"requestSuccessfulKey": "Request successful",
|
|
15
|
+
"cancelKey": "Cancel",
|
|
16
|
+
"PullDownToRefreshKey": "Pull down to refresh",
|
|
17
|
+
"selectAllKey": "SelectAll",
|
|
18
|
+
"requestDataKey": "Request data",
|
|
19
|
+
"closeKey": "Close",
|
|
20
|
+
"veryBadKey": "Very bad",
|
|
21
|
+
"searchKey": "Search",
|
|
22
|
+
"expandKey": "Expand",
|
|
23
|
+
"IDCardPhotoKey": "ID card photo",
|
|
24
|
+
"finishKey": "Finish",
|
|
25
|
+
"surpriseKey": "Surprise",
|
|
26
|
+
"releaseRefreshKey": "Release refresh",
|
|
27
|
+
"nationalEmblemSideOfIDCardKey": "National emblem side of ID card",
|
|
28
|
+
"buttonKey": "Button",
|
|
29
|
+
"jumpKey": "Jump",
|
|
30
|
+
"disappointmentKey": "Disappointment"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
2
33
|
"zh_cn": {
|
|
3
34
|
"componentKey": {
|
|
4
35
|
"sureKey": "确定",
|
|
@@ -60,36 +91,5 @@
|
|
|
60
91
|
"jumpKey": "跳轉",
|
|
61
92
|
"disappointmentKey": "失望"
|
|
62
93
|
}
|
|
63
|
-
},
|
|
64
|
-
"en_us": {
|
|
65
|
-
"componentKey": {
|
|
66
|
-
"sureKey": "Confirm",
|
|
67
|
-
"satisfyKey": "Satisfy",
|
|
68
|
-
"confirmKey": "Confirm",
|
|
69
|
-
"uploadingKey": "Uploading",
|
|
70
|
-
"resetKey": "Reset",
|
|
71
|
-
"NoDataKey": "No data available at the moment",
|
|
72
|
-
"liveStreamingKey": "live",
|
|
73
|
-
"generallyKey": "Generally",
|
|
74
|
-
"uploadFailedKey": "Upload failed",
|
|
75
|
-
"submitKey": "Submit",
|
|
76
|
-
"requestSuccessfulKey": "Request successful",
|
|
77
|
-
"cancelKey": "Cancel",
|
|
78
|
-
"PullDownToRefreshKey": "Pull down to refresh",
|
|
79
|
-
"selectAllKey": "SelectAll",
|
|
80
|
-
"requestDataKey": "Request data",
|
|
81
|
-
"closeKey": "Close",
|
|
82
|
-
"veryBadKey": "Very bad",
|
|
83
|
-
"searchKey": "Search",
|
|
84
|
-
"expandKey": "Expand",
|
|
85
|
-
"IDCardPhotoKey": "ID card photo",
|
|
86
|
-
"finishKey": "Finish",
|
|
87
|
-
"surpriseKey": "Surprise",
|
|
88
|
-
"releaseRefreshKey": "Release refresh",
|
|
89
|
-
"nationalEmblemSideOfIDCardKey": "National emblem side of ID card",
|
|
90
|
-
"buttonKey": "Button",
|
|
91
|
-
"jumpKey": "Jump",
|
|
92
|
-
"disappointmentKey": "Disappointment"
|
|
93
|
-
}
|
|
94
94
|
}
|
|
95
95
|
}
|