@onekeyfe/react-native-native-list 6.7.0-20 → 6.7.0-21
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/android/src/main/java/com/onekey/nativelist/NativeListActivityDetailsView.kt +29 -4
- package/android/src/main/java/com/onekey/nativelist/NativeListActivityRenderer.kt +6 -10
- package/android/src/main/java/com/onekey/nativelist/NativeListAdapter.kt +17 -1
- package/android/src/main/java/com/onekey/nativelist/NativeListDataRowRenderer.kt +15 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListIdentityRenderer.kt +33 -2
- package/android/src/main/java/com/onekey/nativelist/NativeListMarketRenderer.kt +92 -28
- package/android/src/main/java/com/onekey/nativelist/NativeListModels.kt +13 -10
- package/android/src/main/java/com/onekey/nativelist/NativeListView.kt +33 -8
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListActivityHostClipPolicyTest.kt +11 -5
- package/docs/ROW_TEMPLATES.md +10 -2
- package/docs/SPEC.md +270 -42
- package/ios/NativeListActivityDetailsView.swift +13 -4
- package/ios/NativeListIdentityRenderer.swift +50 -3
- package/ios/NativeListMarketRenderer.swift +113 -18
- package/ios/RNCNativeListView.swift +21 -3
- package/ios/tests/NativeListActivityPresentationTests.swift +97 -0
- package/ios/tests/NativeListLifecycleTests.swift +73 -4
- package/ios/tests/NativeListMarketMetricsTests.swift +117 -0
- package/lib/module/NativeList.js +25 -6
- package/lib/module/NativeList.web.js +9 -12
- package/lib/module/models.js +2 -0
- package/lib/module/validation.js +695 -114
- package/lib/module/web/NativeListWebEngine.js +3 -9
- package/lib/module/web/templates/IdentityRowRenderer.js +58 -4
- package/lib/typescript/src/models.d.ts +27 -14
- package/lib/typescript/src/validation.d.ts +7 -2
- package/package.json +3 -3
- package/src/NativeList.tsx +30 -10
- package/src/NativeList.web.tsx +10 -14
- package/src/models.ts +158 -153
- package/src/validation.ts +1757 -167
- package/src/web/NativeListWebEngine.ts +6 -10
- package/src/web/templates/IdentityRowRenderer.ts +70 -4
|
@@ -4,7 +4,7 @@ import { useNativeListFontFamiliesJson } from "./fonts.js";
|
|
|
4
4
|
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
5
5
|
import { View } from 'react-native';
|
|
6
6
|
import { normalizeIndexScroll, normalizeKeyScroll, normalizePositionScroll, resolveLocationIndex, scrollFailure, validateOffset } from "./scrolling.js";
|
|
7
|
-
import { applyRowPatches, containNativeListInput, emptyNativeListSnapshot,
|
|
7
|
+
import { applyRowPatches, containNativeListInput, emptyNativeListSnapshot, validateSnapshot } from "./validation.js";
|
|
8
8
|
import { NativeListWebEngine } from "./web/NativeListWebEngine.js";
|
|
9
9
|
import { acquireNativeListAvatar, canonicalNativeListAvatarUri } from "./web/NativeListWebAvatarCache.js";
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -255,18 +255,15 @@ export const NativeList = /*#__PURE__*/forwardRef(function NativeList({
|
|
|
255
255
|
synchronizeSlots(next);
|
|
256
256
|
},
|
|
257
257
|
applyPatches(patches) {
|
|
258
|
-
const
|
|
259
|
-
if (
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
const next = containNativeListInput(() => applyRowPatches(snapshotRef.current, accepted));
|
|
266
|
-
if (next) snapshotRef.current = next;
|
|
267
|
-
}
|
|
268
|
-
acceptedSnapshotRef.current = snapshotRef.current;
|
|
258
|
+
const engine = engineRef.current;
|
|
259
|
+
if (engine) {
|
|
260
|
+
engine.applyPatches(patches);
|
|
261
|
+
snapshotRef.current = engine.currentSnapshot();
|
|
262
|
+
} else {
|
|
263
|
+
const next = containNativeListInput(() => applyRowPatches(snapshotRef.current, patches));
|
|
264
|
+
if (next) snapshotRef.current = next;
|
|
269
265
|
}
|
|
266
|
+
acceptedSnapshotRef.current = snapshotRef.current;
|
|
270
267
|
},
|
|
271
268
|
reconcileSelection(selectedKeys) {
|
|
272
269
|
engineRef.current?.reconcileSelection(selectedKeys);
|
package/lib/module/models.js
CHANGED
|
@@ -54,4 +54,6 @@ export const ROW_BOX_STYLE_KEYS_BY_TYPE = {
|
|
|
54
54
|
// type CommonPatchFields = 'revision' | 'disabled' | 'selected' | 'separator';
|
|
55
55
|
// OneKey patch: balance patches also refresh the existing row's spoken content.
|
|
56
56
|
// type CommonPatchFields = 'revision' | 'disabled' | 'selected' | 'separator' | 'height' | 'heightRounding' | 'opacity' | 'pressDisabled';
|
|
57
|
+
|
|
58
|
+
/** Null removes optional fields; undefined leaves the existing value unchanged. */
|
|
57
59
|
//# sourceMappingURL=models.js.map
|