@onekeyfe/react-native-native-list 6.7.0-2 → 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/HybridNativeList.kt +14 -1
- package/android/src/main/java/com/onekey/nativelist/NativeListAccessoryStack.kt +245 -9
- package/android/src/main/java/com/onekey/nativelist/NativeListActivityDetailsView.kt +35 -7
- package/android/src/main/java/com/onekey/nativelist/NativeListActivityRenderer.kt +25 -3
- package/android/src/main/java/com/onekey/nativelist/NativeListAdapter.kt +17 -1
- package/android/src/main/java/com/onekey/nativelist/NativeListButtonGroupRenderer.kt +102 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListContainerSlotAdapter.kt +12 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListDataRowRenderer.kt +102 -7
- package/android/src/main/java/com/onekey/nativelist/NativeListIdentityRenderer.kt +225 -11
- package/android/src/main/java/com/onekey/nativelist/NativeListLeadingVisual.kt +147 -33
- package/android/src/main/java/com/onekey/nativelist/NativeListMarketRenderer.kt +92 -28
- package/android/src/main/java/com/onekey/nativelist/NativeListMessageRenderer.kt +25 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListModels.kt +149 -3
- package/android/src/main/java/com/onekey/nativelist/NativeListPrimitives.kt +51 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListRendererRegistry.kt +2 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListRendererRowView.kt +2 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListResolvedText.kt +3 -2
- package/android/src/main/java/com/onekey/nativelist/NativeListSectionHeaderRenderer.kt +69 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListTextView.kt +55 -1
- package/android/src/main/java/com/onekey/nativelist/NativeListView.kt +1953 -117
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListActivityHostClipPolicyTest.kt +35 -0
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListIdentityTrailingAxisTest.kt +36 -0
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListLeadingSlotFrameTest.kt +68 -0
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListLeadingVisualClipPolicyTest.kt +44 -0
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListPressPolicyTest.kt +10 -0
- package/docs/ROW_TEMPLATES.md +70 -11
- package/docs/SPEC.md +1235 -20
- package/docs/STYLE_SPEC.md +6 -0
- package/ios/HybridNativeList.swift +21 -2
- package/ios/NativeListAccessoryStack.swift +235 -39
- package/ios/NativeListActivityDetailsView.swift +30 -11
- package/ios/NativeListActivityRenderer.swift +8 -2
- package/ios/NativeListButtonGroupRenderer.swift +89 -0
- package/ios/NativeListDataRowRenderer.swift +155 -27
- package/ios/NativeListDesignAssets.swift +9 -0
- package/ios/NativeListIdentityRenderer.swift +239 -31
- package/ios/NativeListLeadingVisual.swift +119 -22
- package/ios/NativeListMarketRenderer.swift +113 -18
- package/ios/NativeListMessageRenderer.swift +34 -1
- package/ios/NativeListModels.swift +42 -2
- package/ios/NativeListRendererRegistry.swift +1 -0
- package/ios/NativeListResolvedText.swift +2 -1
- package/ios/NativeListRowHost.swift +14 -0
- package/ios/NativeListSectionHeaderRenderer.swift +88 -0
- package/ios/RNCNativeListView.swift +1052 -58
- package/ios/Resources/NativeListIcons.xcassets/onekey_crypto_coin_outline.imageset/Contents.json +15 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_crypto_coin_outline.imageset/icon.svg +4 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_document2.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_document2.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_dot_ver_solid.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_dot_ver_solid.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_gas_solid.imageset/Contents.json +15 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_gas_solid.imageset/icon.svg +3 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_plus_large.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_plus_large.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_refresh_ccw_outline.imageset/Contents.json +15 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_refresh_ccw_outline.imageset/icon.svg +3 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_ticket.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_ticket.imageset/icon.svg +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_wallet.imageset/Contents.json +1 -0
- package/ios/Resources/NativeListIcons.xcassets/onekey_wallet.imageset/icon.svg +1 -0
- package/ios/tests/NativeListAccessoryStackTests.swift +89 -0
- package/ios/tests/NativeListActivityPresentationTests.swift +153 -0
- package/ios/tests/NativeListIdentityTitleIconLayoutTests.swift +81 -0
- package/ios/tests/NativeListLeadingVisualPairBackdropTests.swift +50 -0
- package/ios/tests/NativeListLifecycleTests.swift +2789 -3
- package/ios/tests/NativeListMarketMetricsTests.swift +117 -0
- package/lib/module/NativeList.js +223 -36
- package/lib/module/NativeList.web.js +260 -33
- package/lib/module/index.js +1 -1
- package/lib/module/models.js +3 -0
- package/lib/module/selection.js +1 -1
- package/lib/module/validation.js +1386 -81
- package/lib/module/web/NativeListWebEngine.js +914 -80
- package/lib/module/web/templates/ActivityRowRenderer.js +487 -7
- package/lib/module/web/templates/ButtonGroupRowRenderer.js +47 -0
- package/lib/module/web/templates/DataRowRenderer.js +40 -5
- package/lib/module/web/templates/IdentityRowRenderer.js +145 -5
- package/lib/module/web/templates/MarketRowRenderer.js +8 -3
- package/lib/module/web/templates/MarketTableRowRenderer.js +577 -0
- package/lib/module/web/templates/MediaTileRowRenderer.js +260 -5
- package/lib/module/web/templates/MessageRowRenderer.js +18 -2
- package/lib/module/web/templates/RowContainerStyle.js +1 -0
- package/lib/module/web/templates/RowRendererRegistry.js +8 -3
- package/lib/module/web/templates/SectionHeaderRowRenderer.js +70 -3
- package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +26 -0
- package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +4 -0
- package/lib/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +10 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +20 -0
- package/lib/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +14 -0
- package/lib/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +12 -0
- package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +2 -0
- package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +43 -0
- package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +4 -0
- package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +4 -0
- package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +4 -0
- package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +6 -0
- package/lib/nitrogen/generated/shared/json/NativeListConfig.json +2 -0
- package/lib/typescript/src/NativeList.d.ts +3 -3
- package/lib/typescript/src/NativeList.nitro.d.ts +2 -0
- package/lib/typescript/src/NativeList.types.d.ts +29 -1
- package/lib/typescript/src/NativeList.web.d.ts +2 -2
- package/lib/typescript/src/index.d.ts +2 -2
- package/lib/typescript/src/models.d.ts +196 -17
- package/lib/typescript/src/validation.d.ts +20 -0
- package/lib/typescript/src/web/NativeListWebEngine.d.ts +58 -1
- package/lib/typescript/src/web/templates/ActivityRowRenderer.d.ts +3 -3
- package/lib/typescript/src/web/templates/ButtonGroupRowRenderer.d.ts +14 -0
- package/lib/typescript/src/web/templates/IdentityRowRenderer.d.ts +1 -1
- package/lib/typescript/src/web/templates/MarketTableRowRenderer.d.ts +17 -0
- package/lib/typescript/src/web/templates/MediaTileRowRenderer.d.ts +3 -3
- package/lib/typescript/src/web/templates/MessageRowRenderer.d.ts +10 -4
- package/lib/typescript/src/web/templates/RowRendererRegistry.d.ts +3 -1
- package/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +26 -0
- package/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +4 -0
- package/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +10 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +20 -0
- package/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +14 -0
- package/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +12 -0
- package/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +2 -0
- package/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +43 -0
- package/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +4 -0
- package/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +4 -0
- package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +4 -0
- package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +6 -0
- package/nitrogen/generated/shared/json/NativeListConfig.json +2 -0
- package/package.json +3 -3
- package/react-native-native-list.podspec +1 -0
- package/src/NativeList.nitro.ts +2 -0
- package/src/NativeList.tsx +418 -89
- package/src/NativeList.types.ts +34 -1
- package/src/NativeList.web.tsx +417 -66
- package/src/index.ts +2 -0
- package/src/models.ts +355 -143
- package/src/selection.ts +1 -0
- package/src/validation.ts +3315 -166
- package/src/web/NativeListWebEngine.ts +1473 -113
- package/src/web/templates/ActivityRowRenderer.ts +732 -8
- package/src/web/templates/ButtonGroupRowRenderer.ts +58 -0
- package/src/web/templates/DataRowRenderer.ts +93 -20
- package/src/web/templates/IdentityRowRenderer.ts +217 -6
- package/src/web/templates/MarketRowRenderer.ts +19 -3
- package/src/web/templates/MarketTableRowRenderer.ts +755 -0
- package/src/web/templates/MediaTileRowRenderer.ts +313 -5
- package/src/web/templates/MessageRowRenderer.ts +23 -7
- package/src/web/templates/RowContainerStyle.ts +2 -0
- package/src/web/templates/RowRendererRegistry.ts +21 -6
- package/src/web/templates/SectionHeaderRowRenderer.ts +89 -5
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import UIKit
|
|
2
|
+
import XCTest
|
|
3
|
+
@testable import NativeListModule
|
|
4
|
+
|
|
5
|
+
@MainActor
|
|
6
|
+
final class NativeListMarketMetricsTests: XCTestCase {
|
|
7
|
+
private func item(
|
|
8
|
+
_ metrics: [[String: Any]]? = nil, price: String = "$42", accessibilityLabel: String? = nil
|
|
9
|
+
) throws -> NativeListItem {
|
|
10
|
+
var data: [String: Any] = [
|
|
11
|
+
"key": "market-eth", "type": "market", "variant": "token", "height": 72,
|
|
12
|
+
"leading": ["kind": "token", "fallbackIcon": ["name": "CryptoCoinOutline"]],
|
|
13
|
+
"leadingAction": ["kind": "icon", "name": "StarOutline", "actionKey": "favorite"],
|
|
14
|
+
"title": "ETH", "subtitle": "Volume", "price": price,
|
|
15
|
+
"change": ["text": "+2%", "tone": "positive"],
|
|
16
|
+
"badges": [["key": "community", "text": "Verified", "actionKey": "info"]],
|
|
17
|
+
"pressActionKey": "detail", "pressInActionKey": "prewarm",
|
|
18
|
+
"longPressActionKey": "menu",
|
|
19
|
+
"style": ["horizontalPadding": 20, "leadingGap": 14, "trailingGap": 8],
|
|
20
|
+
]
|
|
21
|
+
if let metrics { data["metrics"] = metrics }
|
|
22
|
+
data["accessibilityLabel"] = accessibilityLabel
|
|
23
|
+
return try NativeListItem(data: data)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
private var two: [[String: Any]] { [
|
|
27
|
+
["key": "price", "text": "$42", "alignment": "end"],
|
|
28
|
+
["key": "change", "text": "+2%", "tone": "positive", "alignment": "end"],
|
|
29
|
+
] }
|
|
30
|
+
|
|
31
|
+
func testMetricCountAndCompactReuseClearInactiveViews() throws {
|
|
32
|
+
let cell = NativeListMarketCell(frame: CGRect(x: 0, y: 0, width: 800, height: 72))
|
|
33
|
+
let window = UIWindow(frame: CGRect(x: 0, y: 0, width: 800, height: 200))
|
|
34
|
+
window.addSubview(cell)
|
|
35
|
+
let bind: (NativeListItem) -> Void = { item in
|
|
36
|
+
cell.bind(item: item, theme: nil, layout: "linear", selected: false,
|
|
37
|
+
checkboxState: { _, _, fallback in fallback }, fonts: NativeListFontFamilies())
|
|
38
|
+
cell.layoutIfNeeded()
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
bind(try item(two))
|
|
42
|
+
XCTAssertEqual(cell.root.arrangedSubviews.count, 5)
|
|
43
|
+
let identity = try XCTUnwrap(cell.root.arrangedSubviews[2] as? UIStackView)
|
|
44
|
+
let firstMetric = try XCTUnwrap(cell.root.arrangedSubviews[3] as? UIStackView)
|
|
45
|
+
XCTAssertEqual(identity.bounds.width, firstMetric.bounds.width * 2, accuracy: 1)
|
|
46
|
+
XCTAssertEqual(firstMetric.frame.minX - identity.frame.maxX, 8, accuracy: 1)
|
|
47
|
+
let metricStack = try XCTUnwrap(cell.root.arrangedSubviews.last as? UIStackView)
|
|
48
|
+
let metricLabel = try XCTUnwrap(metricStack.arrangedSubviews.first as? UILabel)
|
|
49
|
+
XCTAssertEqual(metricLabel.text, "+2%")
|
|
50
|
+
|
|
51
|
+
bind(try item(two + [["key": "volume", "text": "$1B", "secondaryText": "24h"]]))
|
|
52
|
+
XCTAssertEqual(cell.root.arrangedSubviews.count, 6)
|
|
53
|
+
bind(try item())
|
|
54
|
+
XCTAssertEqual(cell.root.arrangedSubviews.count, 4)
|
|
55
|
+
XCTAssertFalse(cell.root.arrangedSubviews.contains(metricStack))
|
|
56
|
+
bind(try item(two))
|
|
57
|
+
XCTAssertEqual(cell.root.arrangedSubviews.count, 5)
|
|
58
|
+
XCTAssertEqual(metricLabel.text, "+2%")
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
func testAccessibilityLabelFollowsVisibleMetricsAndExplicitOverride() throws {
|
|
62
|
+
let cell = NativeListMarketCell(frame: .zero)
|
|
63
|
+
let bind: (NativeListItem) -> Void = { item in
|
|
64
|
+
cell.bind(item: item, theme: nil, layout: "linear", selected: false,
|
|
65
|
+
checkboxState: { _, _, fallback in fallback }, fonts: NativeListFontFamilies())
|
|
66
|
+
}
|
|
67
|
+
var metrics: [[String: Any]] = [
|
|
68
|
+
["key": "volume", "text": "$5M", "secondaryText": "24h"],
|
|
69
|
+
["key": "cap", "text": "$8M"],
|
|
70
|
+
]
|
|
71
|
+
bind(try item(metrics))
|
|
72
|
+
XCTAssertEqual(cell.accessibilityLabel, "ETH, Volume, $5M, 24h, $8M")
|
|
73
|
+
|
|
74
|
+
metrics[0]["textSegments"] = [["text": "$"], ["text": "6M"]]
|
|
75
|
+
cell.updateMarketQuote(try item(metrics), theme: nil)
|
|
76
|
+
XCTAssertEqual(cell.accessibilityLabel, "ETH, Volume, $6M, 24h, $8M")
|
|
77
|
+
cell.updateMarketQuote(try item(metrics, accessibilityLabel: "Market summary"), theme: nil)
|
|
78
|
+
XCTAssertEqual(cell.accessibilityLabel, "Market summary")
|
|
79
|
+
|
|
80
|
+
bind(try item())
|
|
81
|
+
XCTAssertEqual(cell.accessibilityLabel, "ETH, Volume, $42, +2%")
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
func testQuoteUpdatesKeepMetricViewsAndActionTargetsStable() throws {
|
|
85
|
+
let cell = NativeListMarketCell(frame: CGRect(x: 0, y: 0, width: 800, height: 72))
|
|
86
|
+
let window = UIWindow(frame: CGRect(x: 0, y: 0, width: 800, height: 200))
|
|
87
|
+
window.addSubview(cell)
|
|
88
|
+
cell.bind(item: try item(two), theme: nil, layout: "linear", selected: false,
|
|
89
|
+
checkboxState: { _, _, fallback in fallback }, fonts: NativeListFontFamilies())
|
|
90
|
+
cell.layoutIfNeeded()
|
|
91
|
+
let metricStack = try XCTUnwrap(cell.root.arrangedSubviews[3] as? UIStackView)
|
|
92
|
+
let metricLabel = try XCTUnwrap(metricStack.arrangedSubviews.first as? UILabel)
|
|
93
|
+
let leadingAction = try XCTUnwrap(cell.root.arrangedSubviews.first as? UIButton)
|
|
94
|
+
var actions: [String] = []
|
|
95
|
+
cell.onAction = { _, key, _, _ in actions.append(key) }
|
|
96
|
+
|
|
97
|
+
for tick in 0..<50 {
|
|
98
|
+
var updated = two
|
|
99
|
+
updated[0]["text"] = "$\(tick)"
|
|
100
|
+
cell.updateMarketQuote(try item(updated, price: "$\(tick)"), theme: nil)
|
|
101
|
+
XCTAssertEqual(cell.root.arrangedSubviews.count, 5)
|
|
102
|
+
XCTAssertTrue(cell.root.arrangedSubviews[3] === metricStack)
|
|
103
|
+
XCTAssertTrue(cell.root.arrangedSubviews.first === leadingAction)
|
|
104
|
+
}
|
|
105
|
+
XCTAssertEqual((metricStack.arrangedSubviews.first as? UILabel)?.text, "$49")
|
|
106
|
+
let changeStack = try XCTUnwrap(cell.root.arrangedSubviews.last as? UIStackView)
|
|
107
|
+
XCTAssertEqual((changeStack.arrangedSubviews.first as? UILabel)?.text, "+2%")
|
|
108
|
+
XCTAssertTrue(leadingAction.allTargets.contains(cell))
|
|
109
|
+
let action = try XCTUnwrap(
|
|
110
|
+
leadingAction.actions(forTarget: cell, forControlEvent: .touchUpInside)?.first)
|
|
111
|
+
let selector = NSSelectorFromString(action)
|
|
112
|
+
XCTAssertTrue(cell.responds(to: selector))
|
|
113
|
+
_ = cell.perform(selector)
|
|
114
|
+
XCTAssertEqual(actions, ["favorite"])
|
|
115
|
+
XCTAssertEqual(metricLabel.text, "$49")
|
|
116
|
+
}
|
|
117
|
+
}
|
package/lib/module/NativeList.js
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { useNativeListFontFamiliesJson } from "./fonts.js";
|
|
4
|
-
import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
5
5
|
import { OneKeyImageCache, OneKeyImageCachePolicy } from '@onekeyfe/react-native-image';
|
|
6
6
|
import { NativeAvatarPrefetchModel, NativeAvatarPrefetchQueue } from "./avatarPrefetch.js";
|
|
7
7
|
import { Platform, View } from 'react-native';
|
|
8
8
|
import { callback, getHostComponent } from 'react-native-nitro-modules';
|
|
9
9
|
import { isSelectableRow } from "./selection.js";
|
|
10
10
|
import { normalizeIndexScroll, normalizeKeyScroll, normalizePositionScroll, resolveLocationIndex, scrollFailure, validateOffset } from "./scrolling.js";
|
|
11
|
-
import {
|
|
11
|
+
import { applyOwnedNativePatches, captureNativeListInput, containNativeListInput, emptyNativeListSnapshot, ownValidatedNativeSnapshot, validateSnapshot } from "./validation.js";
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
const NativeListConfig = require('../nitrogen/generated/shared/json/NativeListConfig.json');
|
|
14
14
|
const NativeListHost = getHostComponent('NativeList', () => NativeListConfig);
|
|
15
|
+
const clearedStructuralTransitionSettled = {
|
|
16
|
+
f: undefined
|
|
17
|
+
};
|
|
18
|
+
const disclosureSlotMeasurementStyle = {
|
|
19
|
+
alignSelf: 'stretch'
|
|
20
|
+
};
|
|
15
21
|
export function preloadNativeListAvatarImages(sources) {
|
|
16
22
|
return OneKeyImageCache.preload(sources.map(source => ({
|
|
17
23
|
uri: source.uri,
|
|
@@ -27,14 +33,20 @@ function parsePayload(payloadJson) {
|
|
|
27
33
|
return JSON.parse(payloadJson);
|
|
28
34
|
}
|
|
29
35
|
export const NativeList = /*#__PURE__*/forwardRef(function NativeList({
|
|
30
|
-
snapshot,
|
|
36
|
+
snapshot: inputSnapshot,
|
|
31
37
|
listHeader,
|
|
32
38
|
listFooter,
|
|
33
39
|
listEmpty,
|
|
40
|
+
listSidecar,
|
|
41
|
+
listExpandedContent,
|
|
42
|
+
listStructureToggle,
|
|
43
|
+
sidecarLayout,
|
|
34
44
|
topOverlay,
|
|
35
45
|
topScrollEdgeEffect,
|
|
36
46
|
scrollPositionThresholds,
|
|
37
47
|
webVirtualizationEnabled: _webVirtualizationEnabled,
|
|
48
|
+
webScrollHost: _webScrollHost,
|
|
49
|
+
webStickyInset: _webStickyInset,
|
|
38
50
|
webSectionIndexContainerRef: _webSectionIndexContainerRef,
|
|
39
51
|
keyboardDismissMode = 'none',
|
|
40
52
|
keyboardShouldPersistTaps = 'never',
|
|
@@ -44,6 +56,7 @@ export const NativeList = /*#__PURE__*/forwardRef(function NativeList({
|
|
|
44
56
|
onReorder,
|
|
45
57
|
onEndReached,
|
|
46
58
|
onVisibleRangeChanged,
|
|
59
|
+
onStructuralTransitionSettled,
|
|
47
60
|
onScrollPositionThresholdChange,
|
|
48
61
|
onRefresh,
|
|
49
62
|
onScrollToIndexFailed,
|
|
@@ -53,16 +66,120 @@ export const NativeList = /*#__PURE__*/forwardRef(function NativeList({
|
|
|
53
66
|
initialScrollViewOffset,
|
|
54
67
|
...viewProps
|
|
55
68
|
}, forwardedRef) {
|
|
69
|
+
const snapshotRef = useRef(emptyNativeListSnapshot());
|
|
70
|
+
const needsNativeSnapshotRef = useRef(false);
|
|
71
|
+
const renderedSnapshotRef = useRef(undefined);
|
|
72
|
+
const initializedSnapshot = useRef(false);
|
|
73
|
+
const pendingDisclosureSnapshotRef = useRef(undefined);
|
|
74
|
+
const previousPropInputRef = useRef(inputSnapshot);
|
|
75
|
+
const [pendingDisclosureRevision, setPendingDisclosureRevision] = useState(0);
|
|
76
|
+
const disclosureSlotMounts = useRef({
|
|
77
|
+
expandedPresent: false,
|
|
78
|
+
togglePresent: false,
|
|
79
|
+
expandedEpoch: 0,
|
|
80
|
+
toggleEpoch: 0
|
|
81
|
+
});
|
|
82
|
+
const expandedPresent = listExpandedContent != null;
|
|
83
|
+
const togglePresent = listStructureToggle != null;
|
|
84
|
+
if (disclosureSlotMounts.current.expandedPresent !== expandedPresent) {
|
|
85
|
+
disclosureSlotMounts.current.expandedPresent = expandedPresent;
|
|
86
|
+
disclosureSlotMounts.current.expandedEpoch += 1;
|
|
87
|
+
}
|
|
88
|
+
if (disclosureSlotMounts.current.togglePresent !== togglePresent) {
|
|
89
|
+
disclosureSlotMounts.current.togglePresent = togglePresent;
|
|
90
|
+
disclosureSlotMounts.current.toggleEpoch += 1;
|
|
91
|
+
}
|
|
92
|
+
const expandedEpoch = disclosureSlotMounts.current.expandedEpoch;
|
|
93
|
+
const toggleEpoch = disclosureSlotMounts.current.toggleEpoch;
|
|
94
|
+
const [slotMeasurements, setSlotMeasurements] = useState({
|
|
95
|
+
heights: [0, 0, 0, 0, 0, 0],
|
|
96
|
+
readyEpochs: [-1, -1, -1, -1, -1, -1]
|
|
97
|
+
});
|
|
98
|
+
const hasSidecar = listSidecar !== undefined;
|
|
99
|
+
const sidecarWidth = sidecarLayout?.width;
|
|
100
|
+
const sidecarGap = sidecarLayout?.gap;
|
|
101
|
+
const sidecarMaxContentWidth = sidecarLayout?.maxContentWidth;
|
|
102
|
+
const hasContainerSlots = Boolean(listHeader || listEmpty || listFooter || listSidecar || listExpandedContent || listStructureToggle);
|
|
103
|
+
const validateContainerConfiguration = useCallback(accepted => {
|
|
104
|
+
if (hasContainerSlots && accepted.layout.orientation === 'horizontal') throw new Error('NativeList container slots require vertical orientation');
|
|
105
|
+
if (hasSidecar !== (sidecarWidth !== undefined)) throw new Error('listSidecar and sidecarLayout must be supplied together');
|
|
106
|
+
if (sidecarWidth !== undefined) {
|
|
107
|
+
const width = sidecarWidth;
|
|
108
|
+
const gap = sidecarGap ?? NaN;
|
|
109
|
+
const maxContentWidth = sidecarMaxContentWidth ?? NaN;
|
|
110
|
+
if (accepted.layout.kind !== 'linear' || !Number.isFinite(width) || width <= 0 || !Number.isFinite(gap) || gap < 0 || !Number.isFinite(maxContentWidth) || maxContentWidth <= width + gap) throw new Error('Invalid NativeList sidecar layout');
|
|
111
|
+
}
|
|
112
|
+
}, [hasContainerSlots, hasSidecar, sidecarWidth, sidecarGap, sidecarMaxContentWidth]);
|
|
113
|
+
const prepareSnapshot = useCallback(next => {
|
|
114
|
+
const accepted = validateSnapshot(captureNativeListInput(next));
|
|
115
|
+
validateContainerConfiguration(accepted);
|
|
116
|
+
return ownValidatedNativeSnapshot(accepted);
|
|
117
|
+
}, [validateContainerConfiguration]);
|
|
118
|
+
const expandedReadyEpoch = slotMeasurements.readyEpochs[4];
|
|
119
|
+
const toggleReadyEpoch = slotMeasurements.readyEpochs[5];
|
|
120
|
+
const snapshot = useMemo(() => {
|
|
121
|
+
// Imperative pending snapshots use this revision to retry the readiness gate.
|
|
122
|
+
// eslint-disable-next-line no-void -- Reading this revision invalidates the readiness memo.
|
|
123
|
+
void pendingDisclosureRevision;
|
|
124
|
+
const propReplaced = previousPropInputRef.current !== inputSnapshot;
|
|
125
|
+
previousPropInputRef.current = inputSnapshot;
|
|
126
|
+
const pending = pendingDisclosureSnapshotRef.current;
|
|
127
|
+
const retained = pending && !propReplaced && (pending.source === 'imperative' || pending.input === inputSnapshot) && pending.expandedEpoch === expandedEpoch && pending.toggleEpoch === toggleEpoch ? pending : undefined;
|
|
128
|
+
const candidate = retained?.owned ?? (!propReplaced && initializedSnapshot.current ? renderedSnapshotRef.current ?? snapshotRef.current : containNativeListInput(() => prepareSnapshot(inputSnapshot)) ?? snapshotRef.current);
|
|
129
|
+
const acceptedCandidate = !propReplaced && initializedSnapshot.current ? containNativeListInput(() => {
|
|
130
|
+
validateContainerConfiguration(candidate);
|
|
131
|
+
return candidate;
|
|
132
|
+
}) : candidate;
|
|
133
|
+
if (!acceptedCandidate) {
|
|
134
|
+
pendingDisclosureSnapshotRef.current = undefined;
|
|
135
|
+
return renderedSnapshotRef.current ?? snapshotRef.current;
|
|
136
|
+
}
|
|
137
|
+
const transitionId = acceptedCandidate.structuralTransition?.id;
|
|
138
|
+
const newDisclosureCommand = initializedSnapshot.current && acceptedCandidate.disclosure !== undefined && transitionId !== undefined && transitionId !== snapshotRef.current.structuralTransition?.id;
|
|
139
|
+
if (newDisclosureCommand && (expandedPresent && expandedReadyEpoch !== expandedEpoch || togglePresent && toggleReadyEpoch !== toggleEpoch)) {
|
|
140
|
+
pendingDisclosureSnapshotRef.current = retained ?? {
|
|
141
|
+
source: 'prop',
|
|
142
|
+
input: inputSnapshot,
|
|
143
|
+
owned: acceptedCandidate,
|
|
144
|
+
expandedEpoch,
|
|
145
|
+
toggleEpoch
|
|
146
|
+
};
|
|
147
|
+
return snapshotRef.current;
|
|
148
|
+
}
|
|
149
|
+
pendingDisclosureSnapshotRef.current = undefined;
|
|
150
|
+
return acceptedCandidate;
|
|
151
|
+
}, [inputSnapshot, prepareSnapshot, validateContainerConfiguration, expandedPresent, togglePresent, expandedEpoch, toggleEpoch, expandedReadyEpoch, toggleReadyEpoch, pendingDisclosureRevision]);
|
|
152
|
+
renderedSnapshotRef.current = snapshot;
|
|
56
153
|
const fontFamiliesJson = useNativeListFontFamiliesJson();
|
|
57
|
-
const
|
|
154
|
+
const slotHeights = slotMeasurements.heights;
|
|
155
|
+
const [viewportWidth, setViewportWidth] = useState(0);
|
|
58
156
|
const [topOverlayHeight, setTopOverlayHeight] = useState(0);
|
|
59
157
|
const hasTopOverlay = Platform?.OS === 'ios' && parseInt(String(Platform.Version), 10) >= 26 && (topScrollEdgeEffect === 'hard' || topScrollEdgeEffect === 'soft') && topOverlay != null;
|
|
60
158
|
const containerSlotHeightsJson = JSON.stringify(slotHeights);
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const slotContents = [listHeader, listEmpty, listFooter];
|
|
159
|
+
const defaultSlotInset = snapshot.layout.contentPaddingHorizontal ?? snapshot.layout.contentPadding ?? 0;
|
|
160
|
+
const bandWidth = sidecarLayout ? Math.min(viewportWidth, sidecarLayout.maxContentWidth) : 0;
|
|
161
|
+
const slotInset = sidecarLayout ? Math.max(0, (viewportWidth - bandWidth) / 2) + defaultSlotInset : defaultSlotInset;
|
|
162
|
+
const sidecarSpace = sidecarLayout ? sidecarLayout.width + sidecarLayout.gap : 0;
|
|
163
|
+
const slotContents = [listHeader, listEmpty, listFooter, listSidecar, listExpandedContent, listStructureToggle];
|
|
164
|
+
const recordSlotLayout = (index, height, epoch) => {
|
|
165
|
+
if (index === 4 && epoch !== disclosureSlotMounts.current.expandedEpoch || index === 5 && epoch !== disclosureSlotMounts.current.toggleEpoch) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
setSlotMeasurements(previous => {
|
|
169
|
+
if (previous.heights[index] === height && previous.readyEpochs[index] === epoch) {
|
|
170
|
+
return previous;
|
|
171
|
+
}
|
|
172
|
+
const heights = [...previous.heights];
|
|
173
|
+
const readyEpochs = [...previous.readyEpochs];
|
|
174
|
+
heights[index] = height;
|
|
175
|
+
readyEpochs[index] = epoch;
|
|
176
|
+
return {
|
|
177
|
+
heights,
|
|
178
|
+
readyEpochs
|
|
179
|
+
};
|
|
180
|
+
});
|
|
181
|
+
};
|
|
182
|
+
const sidecarLayoutJson = sidecarLayout ? JSON.stringify(sidecarLayout) : '';
|
|
66
183
|
const normalizedKeyboardShouldPersistTaps = keyboardShouldPersistTaps === true ? 'always' : keyboardShouldPersistTaps === false ? 'never' : keyboardShouldPersistTaps;
|
|
67
184
|
const nativeRef = useRef(null);
|
|
68
185
|
const callbacksRef = useRef({
|
|
@@ -72,6 +189,7 @@ export const NativeList = /*#__PURE__*/forwardRef(function NativeList({
|
|
|
72
189
|
onReorder,
|
|
73
190
|
onEndReached,
|
|
74
191
|
onVisibleRangeChanged,
|
|
192
|
+
onStructuralTransitionSettled,
|
|
75
193
|
onScrollPositionThresholdChange,
|
|
76
194
|
onRefresh,
|
|
77
195
|
onScrollToIndexFailed
|
|
@@ -83,11 +201,12 @@ export const NativeList = /*#__PURE__*/forwardRef(function NativeList({
|
|
|
83
201
|
onReorder,
|
|
84
202
|
onEndReached,
|
|
85
203
|
onVisibleRangeChanged,
|
|
204
|
+
onStructuralTransitionSettled,
|
|
86
205
|
onScrollPositionThresholdChange,
|
|
87
206
|
onRefresh,
|
|
88
207
|
onScrollToIndexFailed
|
|
89
208
|
};
|
|
90
|
-
const scrollPositionThresholdsJson = useMemo(() => {
|
|
209
|
+
const scrollPositionThresholdsJson = useMemo(() => containNativeListInput(() => {
|
|
91
210
|
if (!scrollPositionThresholds || scrollPositionThresholds.enabled === false) return '';
|
|
92
211
|
const {
|
|
93
212
|
start,
|
|
@@ -100,15 +219,18 @@ export const NativeList = /*#__PURE__*/forwardRef(function NativeList({
|
|
|
100
219
|
start,
|
|
101
220
|
end
|
|
102
221
|
});
|
|
103
|
-
}, [scrollPositionThresholds]);
|
|
104
|
-
const snapshotJson = useMemo(() =>
|
|
105
|
-
const snapshotRef = useRef(snapshot);
|
|
222
|
+
}) ?? '', [scrollPositionThresholds]);
|
|
223
|
+
const snapshotJson = useMemo(() => JSON.stringify(snapshot), [snapshot]);
|
|
106
224
|
const previousSnapshotJsonRef = useRef(snapshotJson);
|
|
107
225
|
const snapshotChanged = previousSnapshotJsonRef.current !== snapshotJson;
|
|
108
226
|
if (snapshotChanged) {
|
|
109
227
|
snapshotRef.current = snapshot;
|
|
110
228
|
previousSnapshotJsonRef.current = snapshotJson;
|
|
111
229
|
}
|
|
230
|
+
if (!initializedSnapshot.current) {
|
|
231
|
+
snapshotRef.current = snapshot;
|
|
232
|
+
initializedSnapshot.current = true;
|
|
233
|
+
}
|
|
112
234
|
// OneKey patch: range events already cross the bridge only when row indices
|
|
113
235
|
// change. Prefetch is optional work; scrolling and visible loads stay native.
|
|
114
236
|
const avatarQueueRef = useRef(null);
|
|
@@ -140,7 +262,7 @@ export const NativeList = /*#__PURE__*/forwardRef(function NativeList({
|
|
|
140
262
|
useEffect(() => {
|
|
141
263
|
updateAvatarPrefetchRef.current();
|
|
142
264
|
}, [snapshot]);
|
|
143
|
-
const initialScrollRef = useRef(initialScrollIndex === undefined && initialScrollKey === undefined ? undefined : initialScrollIndex !== undefined ? normalizeIndexScroll({
|
|
265
|
+
const initialScrollRef = useRef(containNativeListInput(() => initialScrollIndex === undefined && initialScrollKey === undefined ? undefined : initialScrollIndex !== undefined ? normalizeIndexScroll({
|
|
144
266
|
index: initialScrollIndex,
|
|
145
267
|
animated: false,
|
|
146
268
|
viewPosition: initialScrollViewPosition,
|
|
@@ -152,7 +274,7 @@ export const NativeList = /*#__PURE__*/forwardRef(function NativeList({
|
|
|
152
274
|
viewPosition: initialScrollViewPosition,
|
|
153
275
|
viewOffset: initialScrollViewOffset
|
|
154
276
|
}, 'start')
|
|
155
|
-
});
|
|
277
|
+
}));
|
|
156
278
|
const didApplyInitialScroll = useRef(false);
|
|
157
279
|
const emitIndexFailure = (index, reason) => {
|
|
158
280
|
callbacksRef.current.onScrollToIndexFailed?.(scrollFailure(snapshotRef.current.rows, index, reason));
|
|
@@ -178,39 +300,79 @@ export const NativeList = /*#__PURE__*/forwardRef(function NativeList({
|
|
|
178
300
|
applyInitialScrollCallbackRef.current = applyInitialScroll;
|
|
179
301
|
useImperativeHandle(forwardedRef, () => ({
|
|
180
302
|
applySnapshot(nextSnapshot) {
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
303
|
+
const accepted = containNativeListInput(() => prepareSnapshot(nextSnapshot));
|
|
304
|
+
if (!accepted) return;
|
|
305
|
+
const transitionId = accepted.structuralTransition?.id;
|
|
306
|
+
const waitsForSlots = accepted.disclosure !== undefined && transitionId !== undefined && transitionId !== snapshotRef.current.structuralTransition?.id && (expandedPresent && slotMeasurements.readyEpochs[4] !== expandedEpoch || togglePresent && slotMeasurements.readyEpochs[5] !== toggleEpoch);
|
|
307
|
+
if (waitsForSlots) {
|
|
308
|
+
pendingDisclosureSnapshotRef.current = {
|
|
309
|
+
source: 'imperative',
|
|
310
|
+
input: nextSnapshot,
|
|
311
|
+
owned: accepted,
|
|
312
|
+
expandedEpoch,
|
|
313
|
+
toggleEpoch
|
|
314
|
+
};
|
|
315
|
+
setPendingDisclosureRevision(value => value + 1);
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
pendingDisclosureSnapshotRef.current = undefined;
|
|
319
|
+
const native = nativeRef.current;
|
|
320
|
+
if (native) native.applySnapshot(JSON.stringify(accepted));
|
|
321
|
+
snapshotRef.current = accepted;
|
|
322
|
+
needsNativeSnapshotRef.current = !native;
|
|
323
|
+
if (native && avatarLifecycle.current !== 'unmounted') {
|
|
324
|
+
avatarModelRef.current?.replaceSnapshot(accepted.rows);
|
|
186
325
|
updateAvatarPrefetchRef.current();
|
|
187
326
|
}
|
|
188
327
|
},
|
|
189
328
|
applyPatches(patches) {
|
|
190
|
-
|
|
191
|
-
const
|
|
329
|
+
const pending = pendingDisclosureSnapshotRef.current;
|
|
330
|
+
const accepted = containNativeListInput(() => applyOwnedNativePatches(pending?.owned ?? snapshotRef.current, patches));
|
|
331
|
+
if (!accepted || accepted.patches.length === 0) return;
|
|
332
|
+
const nextSnapshot = accepted.snapshot;
|
|
333
|
+
if (pending) {
|
|
334
|
+
pendingDisclosureSnapshotRef.current = {
|
|
335
|
+
...pending,
|
|
336
|
+
owned: nextSnapshot
|
|
337
|
+
};
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
192
340
|
const native = nativeRef.current;
|
|
193
|
-
|
|
194
|
-
|
|
341
|
+
if (!native) {
|
|
342
|
+
snapshotRef.current = nextSnapshot;
|
|
343
|
+
needsNativeSnapshotRef.current = true;
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
const dispatch = () => {
|
|
347
|
+
native.applyPatches(accepted.json);
|
|
195
348
|
snapshotRef.current = nextSnapshot;
|
|
196
|
-
}
|
|
349
|
+
};
|
|
197
350
|
if (avatarLifecycle.current === 'unmounted') {
|
|
198
351
|
dispatch?.();
|
|
199
352
|
return;
|
|
200
353
|
}
|
|
201
|
-
if (avatarModelRef.current?.applyPatches(patches, dispatch)) updateAvatarPrefetchRef.current();
|
|
354
|
+
if (avatarModelRef.current?.applyPatches(accepted.patches, dispatch)) updateAvatarPrefetchRef.current();
|
|
202
355
|
},
|
|
203
356
|
reconcileSelection(selectedKeys) {
|
|
204
|
-
|
|
205
|
-
const
|
|
206
|
-
if (
|
|
207
|
-
|
|
357
|
+
const capturedKeys = captureNativeListInput(selectedKeys);
|
|
358
|
+
const pending = pendingDisclosureSnapshotRef.current;
|
|
359
|
+
if (!pending) nativeRef.current?.reconcileSelection(JSON.stringify(capturedKeys));
|
|
360
|
+
const current = pending?.owned ?? snapshotRef.current;
|
|
361
|
+
if (current.selection && (current.selection.mode !== 'single' || capturedKeys.length <= 1) && capturedKeys.every(key => current.rows.some(row => row.key === key && isSelectableRow(row)))) {
|
|
362
|
+
const next = {
|
|
208
363
|
...current,
|
|
209
364
|
selection: {
|
|
210
365
|
...current.selection,
|
|
211
|
-
selectedKeys
|
|
366
|
+
selectedKeys: capturedKeys
|
|
212
367
|
}
|
|
213
368
|
};
|
|
369
|
+
if (pending) pendingDisclosureSnapshotRef.current = {
|
|
370
|
+
...pending,
|
|
371
|
+
owned: next
|
|
372
|
+
};else {
|
|
373
|
+
snapshotRef.current = next;
|
|
374
|
+
if (!nativeRef.current) needsNativeSnapshotRef.current = true;
|
|
375
|
+
}
|
|
214
376
|
}
|
|
215
377
|
},
|
|
216
378
|
scrollToKey(paramsOrKey, animated, alignment) {
|
|
@@ -265,7 +427,16 @@ export const NativeList = /*#__PURE__*/forwardRef(function NativeList({
|
|
|
265
427
|
}));
|
|
266
428
|
const nativeCallbacks = useMemo(() => ({
|
|
267
429
|
hybridRef: callback(ref => {
|
|
430
|
+
const previous = nativeRef.current;
|
|
268
431
|
nativeRef.current = ref;
|
|
432
|
+
if (needsNativeSnapshotRef.current || previous && previous !== ref) {
|
|
433
|
+
// The parent can publish values before Fabric delivers the host.
|
|
434
|
+
const latest = snapshotRef.current;
|
|
435
|
+
ref.applySnapshot(JSON.stringify(latest));
|
|
436
|
+
needsNativeSnapshotRef.current = false;
|
|
437
|
+
avatarModelRef.current?.replaceSnapshot(latest.rows);
|
|
438
|
+
updateAvatarPrefetchRef.current();
|
|
439
|
+
}
|
|
269
440
|
applyInitialScrollCallbackRef.current();
|
|
270
441
|
}),
|
|
271
442
|
onRowAction: callback(payloadJson => {
|
|
@@ -317,14 +488,23 @@ export const NativeList = /*#__PURE__*/forwardRef(function NativeList({
|
|
|
317
488
|
};
|
|
318
489
|
updateAvatarPrefetchRef.current();
|
|
319
490
|
callbacksRef.current.onVisibleRangeChanged?.(payload);
|
|
491
|
+
}),
|
|
492
|
+
onStructuralTransitionSettled: callback(payloadJson => {
|
|
493
|
+
callbacksRef.current.onStructuralTransitionSettled?.(parsePayload(payloadJson));
|
|
320
494
|
})
|
|
321
495
|
}), []);
|
|
322
496
|
return /*#__PURE__*/_jsxs(NativeListHost, {
|
|
323
497
|
...viewProps,
|
|
498
|
+
onLayout: event => {
|
|
499
|
+
setViewportWidth(event.nativeEvent.layout.width);
|
|
500
|
+
viewProps.onLayout?.(event);
|
|
501
|
+
},
|
|
324
502
|
...nativeCallbacks,
|
|
503
|
+
onStructuralTransitionSettled: onStructuralTransitionSettled ? nativeCallbacks.onStructuralTransitionSettled : clearedStructuralTransitionSettled,
|
|
325
504
|
fontFamiliesJson: fontFamiliesJson,
|
|
326
505
|
snapshotJson: snapshotJson,
|
|
327
506
|
containerSlotHeightsJson: containerSlotHeightsJson,
|
|
507
|
+
sidecarLayoutJson: sidecarLayoutJson,
|
|
328
508
|
topScrollEdgeEffect: hasTopOverlay ? topScrollEdgeEffect ?? 'none' : 'none',
|
|
329
509
|
topOverlayHeight: hasTopOverlay ? topOverlayHeight : 0,
|
|
330
510
|
scrollPositionThresholdsJson: scrollPositionThresholdsJson,
|
|
@@ -334,15 +514,22 @@ export const NativeList = /*#__PURE__*/forwardRef(function NativeList({
|
|
|
334
514
|
collapsable: false,
|
|
335
515
|
style: {
|
|
336
516
|
position: 'absolute',
|
|
337
|
-
|
|
338
|
-
|
|
517
|
+
start: index === 3 ? 0 : slotInset,
|
|
518
|
+
end: index === 3 ? undefined : slotInset + sidecarSpace,
|
|
519
|
+
width: index === 3 ? sidecarLayout?.width : undefined,
|
|
339
520
|
top: 0
|
|
340
521
|
},
|
|
341
522
|
onLayout: event => {
|
|
342
|
-
|
|
343
|
-
|
|
523
|
+
if (index < 4) {
|
|
524
|
+
recordSlotLayout(index, Math.ceil(event.nativeEvent.layout.height), 0);
|
|
525
|
+
}
|
|
344
526
|
},
|
|
345
|
-
children:
|
|
527
|
+
children: index >= 4 ? /*#__PURE__*/_jsx(View, {
|
|
528
|
+
collapsable: false,
|
|
529
|
+
style: disclosureSlotMeasurementStyle,
|
|
530
|
+
onLayout: event => recordSlotLayout(index, Math.ceil(event.nativeEvent.layout.height), index === 4 ? expandedEpoch : toggleEpoch),
|
|
531
|
+
children: content
|
|
532
|
+
}, index === 4 ? `expanded-${expandedEpoch}` : `toggle-${toggleEpoch}`) : content
|
|
346
533
|
}, index)), hasTopOverlay ? /*#__PURE__*/_jsx(View, {
|
|
347
534
|
collapsable: false,
|
|
348
535
|
style: {
|