@onekeyfe/react-native-native-list 6.7.0-6 → 6.7.0-61
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/README.md +312 -375
- package/android/src/main/java/com/onekey/nativelist/HybridNativeList.kt +14 -1
- package/android/src/main/java/com/onekey/nativelist/NativeListAccessoryStack.kt +250 -9
- package/android/src/main/java/com/onekey/nativelist/NativeListActivityDetailsView.kt +50 -13
- 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/NativeListGeneratedIcons.kt +47 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListIdentityRenderer.kt +225 -11
- package/android/src/main/java/com/onekey/nativelist/NativeListLeadingVisual.kt +152 -33
- package/android/src/main/java/com/onekey/nativelist/NativeListMarketRenderer.kt +92 -28
- package/android/src/main/java/com/onekey/nativelist/NativeListMediaPlaceholderView.kt +244 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListMediaPreviewSlot.kt +66 -31
- package/android/src/main/java/com/onekey/nativelist/NativeListMediaTileRenderer.kt +32 -11
- package/android/src/main/java/com/onekey/nativelist/NativeListMessageRenderer.kt +25 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListModels.kt +209 -3
- package/android/src/main/java/com/onekey/nativelist/NativeListPrimitives.kt +120 -287
- package/android/src/main/java/com/onekey/nativelist/NativeListRendererRegistry.kt +2 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListRendererRowView.kt +7 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListResolvedText.kt +8 -3
- package/android/src/main/java/com/onekey/nativelist/NativeListSectionHeaderRenderer.kt +69 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListTextView.kt +130 -1
- package/android/src/main/java/com/onekey/nativelist/NativeListView.kt +1978 -136
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListActivityHostClipPolicyTest.kt +35 -0
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListDescriptionTouchPolicyTest.kt +153 -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 +78 -14
- package/docs/SPEC.md +1318 -16
- package/docs/STYLE_SPEC.md +18 -0
- package/ios/HybridNativeList.swift +21 -2
- package/ios/NativeListAccessoryStack.swift +237 -51
- package/ios/NativeListActivityDetailsView.swift +43 -16
- package/ios/NativeListActivityRenderer.swift +8 -2
- package/ios/NativeListButtonGroupRenderer.swift +89 -0
- package/ios/NativeListDataRowRenderer.swift +167 -30
- package/ios/NativeListDesignAssets.swift +13 -75
- package/ios/NativeListGeneratedIcons.swift +55 -0
- package/ios/NativeListIconBinding.swift +171 -0
- package/ios/NativeListIdentityRenderer.swift +256 -39
- package/ios/NativeListLeadingVisual.swift +127 -28
- package/ios/NativeListMarketRenderer.swift +120 -31
- package/ios/NativeListMediaPlaceholderView.swift +189 -0
- package/ios/NativeListMediaPreviewSlot.swift +122 -61
- package/ios/NativeListMediaTileRenderer.swift +15 -11
- package/ios/NativeListMessageRenderer.swift +34 -1
- package/ios/NativeListMetricCardRenderer.swift +4 -2
- package/ios/NativeListModels.swift +42 -2
- package/ios/NativeListRendererRegistry.swift +1 -0
- package/ios/NativeListResolvedText.swift +17 -5
- package/ios/NativeListRowHost.swift +14 -0
- package/ios/NativeListSectionHeaderRenderer.swift +100 -4
- package/ios/NativeListTextLabel.swift +106 -0
- package/ios/RNCNativeListView.swift +1097 -60
- package/ios/tests/NativeListAccessoryStackTests.swift +101 -0
- package/ios/tests/NativeListAccountSelectorLayoutTests.swift +96 -0
- package/ios/tests/NativeListActivityPresentationTests.swift +423 -0
- package/ios/tests/NativeListIdentityTitleIconLayoutTests.swift +81 -0
- package/ios/tests/NativeListLeadingVisualPairBackdropTests.swift +50 -0
- package/ios/tests/NativeListLifecycleTests.swift +2959 -4
- package/ios/tests/NativeListMarketMetricsTests.swift +117 -0
- package/ios/tests/NativeListMediaVisibilityTests.swift +41 -7
- package/ios/tests/NativeListSharedIconTests.swift +236 -0
- package/lib/module/NativeList.js +236 -38
- package/lib/module/NativeList.web.js +163 -45
- 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 +1263 -48
- package/lib/module/web/NativeListGeneratedIcons.js +31 -0
- package/lib/module/web/NativeListWebEngine.js +513 -275
- package/lib/module/web/templates/ActivityRowRenderer.js +41 -54
- package/lib/module/web/templates/ButtonGroupRowRenderer.js +47 -0
- package/lib/module/web/templates/DataRowRenderer.js +56 -5
- package/lib/module/web/templates/IdentityRowRenderer.js +161 -7
- package/lib/module/web/templates/MarketTableRowRenderer.js +36 -19
- package/lib/module/web/templates/MediaTileRowRenderer.js +84 -25
- 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 +3 -0
- package/lib/module/web/templates/SectionHeaderRowRenderer.js +36 -2
- 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 +20 -2
- package/lib/typescript/src/index.d.ts +2 -2
- package/lib/typescript/src/models.d.ts +134 -17
- package/lib/typescript/src/validation.d.ts +20 -0
- package/lib/typescript/src/web/NativeListGeneratedIcons.d.ts +2 -0
- package/lib/typescript/src/web/NativeListWebEngine.d.ts +32 -1
- 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/MessageRowRenderer.d.ts +9 -3
- 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 +16 -10
- package/react-native-native-list.podspec +2 -6
- package/scripts/generate-icons.mjs +150 -0
- package/scripts/generate-icons.test.mjs +288 -0
- package/scripts/native-list-icons.json +260 -0
- package/src/NativeList.nitro.ts +2 -0
- package/src/NativeList.tsx +439 -91
- package/src/NativeList.types.ts +24 -2
- package/src/NativeList.web.tsx +286 -88
- package/src/index.ts +2 -0
- package/src/models.ts +272 -144
- package/src/selection.ts +1 -0
- package/src/validation.ts +3041 -146
- package/src/web/NativeListGeneratedIcons.ts +28 -0
- package/src/web/NativeListWebEngine.ts +818 -343
- package/src/web/templates/ActivityRowRenderer.ts +71 -91
- package/src/web/templates/ButtonGroupRowRenderer.ts +58 -0
- package/src/web/templates/DataRowRenderer.ts +121 -20
- package/src/web/templates/IdentityRowRenderer.ts +234 -9
- package/src/web/templates/MarketTableRowRenderer.ts +53 -33
- package/src/web/templates/MediaTileRowRenderer.ts +90 -28
- package/src/web/templates/MessageRowRenderer.ts +23 -7
- package/src/web/templates/RowContainerStyle.ts +2 -0
- package/src/web/templates/RowRendererRegistry.ts +11 -1
- package/src/web/templates/SectionHeaderRowRenderer.ts +47 -4
- package/ios/Resources/NativeListIcons.xcassets/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_bottom.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_bottom.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_top.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_top.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_badge_verified_solid.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_badge_verified_solid.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_chart_trending_up.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_chart_trending_up.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_checked.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_checked.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_indeterminate.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_indeterminate.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_bottom.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_bottom.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_grabber_ver.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_grabber_ver.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_right_small.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_right_small.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_top.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_top.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_dot_hor.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_dot_hor.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_drag.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_drag.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_error_solid.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_error_solid.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_image_square_waves.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_image_square_waves.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_info_circle.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_info_circle.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle_solid.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle_solid.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_pencil.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_pencil.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_plus_circle.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_plus_circle.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_plus_small.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_plus_small.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_questionmark_solid.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_questionmark_solid.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_account_error_custom.imageset/Contents.json +0 -15
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_account_error_custom.imageset/icon.svg +0 -14
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_all_networks_solid.imageset/Contents.json +0 -15
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_all_networks_solid.imageset/icon.svg +0 -12
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_apple_brand.imageset/Contents.json +0 -15
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_apple_brand.imageset/icon.svg +0 -6
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_bot_illus.imageset/Contents.json +0 -15
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_bot_illus.imageset/icon.svg +0 -15
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_crossed_small_solid.imageset/Contents.json +0 -15
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_crossed_small_solid.imageset/icon.svg +0 -3
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_globus_outline.imageset/Contents.json +0 -15
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_globus_outline.imageset/icon.svg +0 -7
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_google_illus.imageset/Contents.json +0 -15
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_google_illus.imageset/icon.svg +0 -18
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_lock_solid.imageset/Contents.json +0 -15
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_lock_solid.imageset/icon.svg +0 -7
- package/ios/Resources/NativeListIcons.xcassets/onekey_shield_exclamation.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_shield_exclamation.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_speaker_promote.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_speaker_promote.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_star.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_star.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_star_solid.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_star_solid.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_swap_hor.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_swap_hor.imageset/icon.svg +0 -1
|
@@ -20,6 +20,8 @@ namespace margelo::nitro::nativelist {
|
|
|
20
20
|
prototype.registerHybridSetter("fontFamiliesJson", &HybridNativeListSpec::setFontFamiliesJson);
|
|
21
21
|
prototype.registerHybridGetter("containerSlotHeightsJson", &HybridNativeListSpec::getContainerSlotHeightsJson);
|
|
22
22
|
prototype.registerHybridSetter("containerSlotHeightsJson", &HybridNativeListSpec::setContainerSlotHeightsJson);
|
|
23
|
+
prototype.registerHybridGetter("sidecarLayoutJson", &HybridNativeListSpec::getSidecarLayoutJson);
|
|
24
|
+
prototype.registerHybridSetter("sidecarLayoutJson", &HybridNativeListSpec::setSidecarLayoutJson);
|
|
23
25
|
prototype.registerHybridGetter("topScrollEdgeEffect", &HybridNativeListSpec::getTopScrollEdgeEffect);
|
|
24
26
|
prototype.registerHybridSetter("topScrollEdgeEffect", &HybridNativeListSpec::setTopScrollEdgeEffect);
|
|
25
27
|
prototype.registerHybridGetter("topOverlayHeight", &HybridNativeListSpec::getTopOverlayHeight);
|
|
@@ -44,6 +46,8 @@ namespace margelo::nitro::nativelist {
|
|
|
44
46
|
prototype.registerHybridSetter("onEndReached", &HybridNativeListSpec::setOnEndReached);
|
|
45
47
|
prototype.registerHybridGetter("onVisibleRangeChanged", &HybridNativeListSpec::getOnVisibleRangeChanged);
|
|
46
48
|
prototype.registerHybridSetter("onVisibleRangeChanged", &HybridNativeListSpec::setOnVisibleRangeChanged);
|
|
49
|
+
prototype.registerHybridGetter("onStructuralTransitionSettled", &HybridNativeListSpec::getOnStructuralTransitionSettled);
|
|
50
|
+
prototype.registerHybridSetter("onStructuralTransitionSettled", &HybridNativeListSpec::setOnStructuralTransitionSettled);
|
|
47
51
|
prototype.registerHybridMethod("applySnapshot", &HybridNativeListSpec::applySnapshot);
|
|
48
52
|
prototype.registerHybridMethod("applyPatches", &HybridNativeListSpec::applyPatches);
|
|
49
53
|
prototype.registerHybridMethod("reconcileSelection", &HybridNativeListSpec::reconcileSelection);
|
|
@@ -63,6 +63,8 @@ namespace margelo::nitro::nativelist {
|
|
|
63
63
|
virtual void setFontFamiliesJson(const std::string& fontFamiliesJson) = 0;
|
|
64
64
|
virtual std::string getContainerSlotHeightsJson() = 0;
|
|
65
65
|
virtual void setContainerSlotHeightsJson(const std::string& containerSlotHeightsJson) = 0;
|
|
66
|
+
virtual std::string getSidecarLayoutJson() = 0;
|
|
67
|
+
virtual void setSidecarLayoutJson(const std::string& sidecarLayoutJson) = 0;
|
|
66
68
|
virtual NativeListScrollEdgeEffect getTopScrollEdgeEffect() = 0;
|
|
67
69
|
virtual void setTopScrollEdgeEffect(NativeListScrollEdgeEffect topScrollEdgeEffect) = 0;
|
|
68
70
|
virtual double getTopOverlayHeight() = 0;
|
|
@@ -87,6 +89,8 @@ namespace margelo::nitro::nativelist {
|
|
|
87
89
|
virtual void setOnEndReached(const std::optional<std::function<void(const std::string& /* payloadJson */)>>& onEndReached) = 0;
|
|
88
90
|
virtual std::optional<std::function<void(const std::string& /* payloadJson */)>> getOnVisibleRangeChanged() = 0;
|
|
89
91
|
virtual void setOnVisibleRangeChanged(const std::optional<std::function<void(const std::string& /* payloadJson */)>>& onVisibleRangeChanged) = 0;
|
|
92
|
+
virtual std::optional<std::function<void(const std::string& /* payloadJson */)>> getOnStructuralTransitionSettled() = 0;
|
|
93
|
+
virtual void setOnStructuralTransitionSettled(const std::optional<std::function<void(const std::string& /* payloadJson */)>>& onStructuralTransitionSettled) = 0;
|
|
90
94
|
|
|
91
95
|
public:
|
|
92
96
|
// Methods
|
|
@@ -23,6 +23,7 @@ namespace margelo::nitro::nativelist::views {
|
|
|
23
23
|
snapshotJson(nitro::ReactProp<std::string>::fromRawValue("NativeList", "snapshotJson", rawProps, sourceProps.snapshotJson)),
|
|
24
24
|
fontFamiliesJson(nitro::ReactProp<std::string>::fromRawValue("NativeList", "fontFamiliesJson", rawProps, sourceProps.fontFamiliesJson)),
|
|
25
25
|
containerSlotHeightsJson(nitro::ReactProp<std::string>::fromRawValue("NativeList", "containerSlotHeightsJson", rawProps, sourceProps.containerSlotHeightsJson)),
|
|
26
|
+
sidecarLayoutJson(nitro::ReactProp<std::string>::fromRawValue("NativeList", "sidecarLayoutJson", rawProps, sourceProps.sidecarLayoutJson)),
|
|
26
27
|
topScrollEdgeEffect(nitro::ReactProp<NativeListScrollEdgeEffect>::fromRawValue("NativeList", "topScrollEdgeEffect", rawProps, sourceProps.topScrollEdgeEffect)),
|
|
27
28
|
topOverlayHeight(nitro::ReactProp<double>::fromRawValue("NativeList", "topOverlayHeight", rawProps, sourceProps.topOverlayHeight)),
|
|
28
29
|
scrollPositionThresholdsJson(nitro::ReactProp<std::string>::fromRawValue("NativeList", "scrollPositionThresholdsJson", rawProps, sourceProps.scrollPositionThresholdsJson)),
|
|
@@ -35,6 +36,7 @@ namespace margelo::nitro::nativelist::views {
|
|
|
35
36
|
onReorder(nitro::ReactProp<std::optional<std::function<void(const std::string& /* payloadJson */)>>>::fromRawValue("NativeList", "onReorder", rawProps, sourceProps.onReorder)),
|
|
36
37
|
onEndReached(nitro::ReactProp<std::optional<std::function<void(const std::string& /* payloadJson */)>>>::fromRawValue("NativeList", "onEndReached", rawProps, sourceProps.onEndReached)),
|
|
37
38
|
onVisibleRangeChanged(nitro::ReactProp<std::optional<std::function<void(const std::string& /* payloadJson */)>>>::fromRawValue("NativeList", "onVisibleRangeChanged", rawProps, sourceProps.onVisibleRangeChanged)),
|
|
39
|
+
onStructuralTransitionSettled(nitro::ReactProp<std::optional<std::function<void(const std::string& /* payloadJson */)>>>::fromRawValue("NativeList", "onStructuralTransitionSettled", rawProps, sourceProps.onStructuralTransitionSettled)),
|
|
38
40
|
hybridRef(nitro::ReactProp<std::optional<std::function<void(const std::shared_ptr<HybridNativeListSpec>& /* ref */)>>>::fromRawValue("NativeList", "hybridRef", rawProps, sourceProps.hybridRef)) { }
|
|
39
41
|
|
|
40
42
|
bool HybridNativeListProps::filterObjectKeys(const std::string& propName) {
|
|
@@ -42,6 +44,7 @@ namespace margelo::nitro::nativelist::views {
|
|
|
42
44
|
case hashString("snapshotJson"): return true;
|
|
43
45
|
case hashString("fontFamiliesJson"): return true;
|
|
44
46
|
case hashString("containerSlotHeightsJson"): return true;
|
|
47
|
+
case hashString("sidecarLayoutJson"): return true;
|
|
45
48
|
case hashString("topScrollEdgeEffect"): return true;
|
|
46
49
|
case hashString("topOverlayHeight"): return true;
|
|
47
50
|
case hashString("scrollPositionThresholdsJson"): return true;
|
|
@@ -54,6 +57,7 @@ namespace margelo::nitro::nativelist::views {
|
|
|
54
57
|
case hashString("onReorder"): return true;
|
|
55
58
|
case hashString("onEndReached"): return true;
|
|
56
59
|
case hashString("onVisibleRangeChanged"): return true;
|
|
60
|
+
case hashString("onStructuralTransitionSettled"): return true;
|
|
57
61
|
case hashString("hybridRef"): return true;
|
|
58
62
|
default: return false;
|
|
59
63
|
}
|
|
@@ -49,6 +49,7 @@ namespace margelo::nitro::nativelist::views {
|
|
|
49
49
|
nitro::ReactProp<std::string> snapshotJson;
|
|
50
50
|
nitro::ReactProp<std::string> fontFamiliesJson;
|
|
51
51
|
nitro::ReactProp<std::string> containerSlotHeightsJson;
|
|
52
|
+
nitro::ReactProp<std::string> sidecarLayoutJson;
|
|
52
53
|
nitro::ReactProp<NativeListScrollEdgeEffect> topScrollEdgeEffect;
|
|
53
54
|
nitro::ReactProp<double> topOverlayHeight;
|
|
54
55
|
nitro::ReactProp<std::string> scrollPositionThresholdsJson;
|
|
@@ -61,6 +62,7 @@ namespace margelo::nitro::nativelist::views {
|
|
|
61
62
|
nitro::ReactProp<std::optional<std::function<void(const std::string& /* payloadJson */)>>> onReorder;
|
|
62
63
|
nitro::ReactProp<std::optional<std::function<void(const std::string& /* payloadJson */)>>> onEndReached;
|
|
63
64
|
nitro::ReactProp<std::optional<std::function<void(const std::string& /* payloadJson */)>>> onVisibleRangeChanged;
|
|
65
|
+
nitro::ReactProp<std::optional<std::function<void(const std::string& /* payloadJson */)>>> onStructuralTransitionSettled;
|
|
64
66
|
nitro::ReactProp<std::optional<std::function<void(const std::shared_ptr<HybridNativeListSpec>& /* ref */)>>> hybridRef;
|
|
65
67
|
|
|
66
68
|
[[nodiscard]]
|
|
@@ -68,6 +70,7 @@ namespace margelo::nitro::nativelist::views {
|
|
|
68
70
|
return snapshotJson.hasSameValue(other.snapshotJson) &&
|
|
69
71
|
fontFamiliesJson.hasSameValue(other.fontFamiliesJson) &&
|
|
70
72
|
containerSlotHeightsJson.hasSameValue(other.containerSlotHeightsJson) &&
|
|
73
|
+
sidecarLayoutJson.hasSameValue(other.sidecarLayoutJson) &&
|
|
71
74
|
topScrollEdgeEffect.hasSameValue(other.topScrollEdgeEffect) &&
|
|
72
75
|
topOverlayHeight.hasSameValue(other.topOverlayHeight) &&
|
|
73
76
|
scrollPositionThresholdsJson.hasSameValue(other.scrollPositionThresholdsJson) &&
|
|
@@ -80,6 +83,7 @@ namespace margelo::nitro::nativelist::views {
|
|
|
80
83
|
onReorder.hasSameValue(other.onReorder) &&
|
|
81
84
|
onEndReached.hasSameValue(other.onEndReached) &&
|
|
82
85
|
onVisibleRangeChanged.hasSameValue(other.onVisibleRangeChanged) &&
|
|
86
|
+
onStructuralTransitionSettled.hasSameValue(other.onStructuralTransitionSettled) &&
|
|
83
87
|
hybridRef.hasSameValue(other.hybridRef);
|
|
84
88
|
}
|
|
85
89
|
|
|
@@ -88,6 +92,7 @@ namespace margelo::nitro::nativelist::views {
|
|
|
88
92
|
return snapshotJson.isProvided() ||
|
|
89
93
|
fontFamiliesJson.isProvided() ||
|
|
90
94
|
containerSlotHeightsJson.isProvided() ||
|
|
95
|
+
sidecarLayoutJson.isProvided() ||
|
|
91
96
|
topScrollEdgeEffect.isProvided() ||
|
|
92
97
|
topOverlayHeight.isProvided() ||
|
|
93
98
|
scrollPositionThresholdsJson.isProvided() ||
|
|
@@ -100,6 +105,7 @@ namespace margelo::nitro::nativelist::views {
|
|
|
100
105
|
onReorder.isProvided() ||
|
|
101
106
|
onEndReached.isProvided() ||
|
|
102
107
|
onVisibleRangeChanged.isProvided() ||
|
|
108
|
+
onStructuralTransitionSettled.isProvided() ||
|
|
103
109
|
hybridRef.isProvided();
|
|
104
110
|
}
|
|
105
111
|
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"snapshotJson": true,
|
|
8
8
|
"fontFamiliesJson": true,
|
|
9
9
|
"containerSlotHeightsJson": true,
|
|
10
|
+
"sidecarLayoutJson": true,
|
|
10
11
|
"topScrollEdgeEffect": true,
|
|
11
12
|
"topOverlayHeight": true,
|
|
12
13
|
"scrollPositionThresholdsJson": true,
|
|
@@ -19,6 +20,7 @@
|
|
|
19
20
|
"onReorder": true,
|
|
20
21
|
"onEndReached": true,
|
|
21
22
|
"onVisibleRangeChanged": true,
|
|
23
|
+
"onStructuralTransitionSettled": true,
|
|
22
24
|
"hybridRef": true
|
|
23
25
|
}
|
|
24
26
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ImageSource } from './models';
|
|
2
|
+
import type { ImageSource, NativeListSnapshot } from './models';
|
|
3
3
|
import type { NativeListProps } from './NativeList.types';
|
|
4
|
-
export type { NativeListProps, NativeListRef } from './NativeList.types';
|
|
4
|
+
export type { NativeListProps, NativeListRef, StructuralTransitionSettledEvent, } from './NativeList.types';
|
|
5
5
|
export type { ActionAnchorState, NativeListKeyboardDismissMode, NativeListKeyboardShouldPersistTaps, ScrollAlignment, ScrollPositionOptions, ScrollToEndParams, ScrollToIndexFailedInfo, ScrollToIndexParams, ScrollToItemParams, ScrollToKeyParams, ScrollToLocationParams, ScrollToOffsetParams, } from './NativeList.types';
|
|
6
6
|
export declare function preloadNativeListAvatarImages(sources: readonly ImageSource[]): Promise<boolean>;
|
|
7
7
|
export declare const NativeList: React.ForwardRefExoticComponent<NativeListProps & React.RefAttributes<Readonly<{
|
|
8
|
-
applySnapshot(snapshot:
|
|
8
|
+
applySnapshot(snapshot: NativeListSnapshot): void;
|
|
9
9
|
applyPatches(patches: readonly import("./models").RowPatch[]): void;
|
|
10
10
|
reconcileSelection(selectedKeys: readonly string[]): void;
|
|
11
11
|
scrollToKey: (paramsOrKey: import("./NativeList.types").ScrollToKeyParams | string, animated?: boolean, alignment?: import("./NativeList.types").ScrollAlignment) => void;
|
|
@@ -8,6 +8,7 @@ export interface NativeListNativeProps extends HybridViewProps {
|
|
|
8
8
|
snapshotJson: string;
|
|
9
9
|
fontFamiliesJson: string;
|
|
10
10
|
containerSlotHeightsJson: string;
|
|
11
|
+
sidecarLayoutJson: string;
|
|
11
12
|
topScrollEdgeEffect: NativeListScrollEdgeEffect;
|
|
12
13
|
topOverlayHeight: number;
|
|
13
14
|
scrollPositionThresholdsJson: string;
|
|
@@ -20,6 +21,7 @@ export interface NativeListNativeProps extends HybridViewProps {
|
|
|
20
21
|
onReorder?: (payloadJson: string) => void;
|
|
21
22
|
onEndReached?: (payloadJson: string) => void;
|
|
22
23
|
onVisibleRangeChanged?: (payloadJson: string) => void;
|
|
24
|
+
onStructuralTransitionSettled?: (payloadJson: string) => void;
|
|
23
25
|
}
|
|
24
26
|
export type NativeListKeyboardDismissMode = 'none' | 'on-drag' | 'interactive';
|
|
25
27
|
export type NativeListKeyboardShouldPersistTaps = 'never' | 'always' | 'handled';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ScrollEdgeEffect } from './ScrollEdgeEffect';
|
|
2
|
-
import type { ReactNode, RefObject } from 'react';
|
|
2
|
+
import type { ElementRef, ReactNode, RefObject } from 'react';
|
|
3
3
|
import type { View, ViewProps } from 'react-native';
|
|
4
4
|
import type { ActionAnchorInvalidatedEvent, EndReachedEvent, NativeListSnapshot, ReorderEvent, RowActionEvent, RowModel, RowPatch, SelectionDeltaEvent, VisibleRangeChangedEvent } from './models';
|
|
5
5
|
export type ActionAnchorState = Readonly<{
|
|
@@ -49,6 +49,16 @@ export type NativeListWebScrollHost = Readonly<{
|
|
|
49
49
|
clientHeight: number;
|
|
50
50
|
scrollTop: number;
|
|
51
51
|
}>;
|
|
52
|
+
export type NativeListSidecarLayout = Readonly<{
|
|
53
|
+
width: number;
|
|
54
|
+
gap: number;
|
|
55
|
+
maxContentWidth: number;
|
|
56
|
+
}>;
|
|
57
|
+
export type StructuralTransitionSettledEvent = Readonly<{
|
|
58
|
+
transitionId: string;
|
|
59
|
+
status: 'completed' | 'interrupted';
|
|
60
|
+
settledExpanded: boolean;
|
|
61
|
+
}>;
|
|
52
62
|
type InitialScrollProps = Readonly<{
|
|
53
63
|
initialScrollIndex?: never;
|
|
54
64
|
initialScrollKey?: never;
|
|
@@ -86,6 +96,13 @@ export type NativeListProps = Omit<ViewProps, 'children'> & Readonly<{
|
|
|
86
96
|
listHeader?: ReactNode;
|
|
87
97
|
listFooter?: ReactNode;
|
|
88
98
|
listEmpty?: ReactNode;
|
|
99
|
+
/** Native disclosure content, retained until its transition settles. */
|
|
100
|
+
listExpandedContent?: ReactNode;
|
|
101
|
+
/** Stable native disclosure toggle after expanded content. */
|
|
102
|
+
listStructureToggle?: ReactNode;
|
|
103
|
+
/** Scrolling right column for a vertical linear list. Requires sidecarLayout. */
|
|
104
|
+
listSidecar?: ReactNode;
|
|
105
|
+
sidecarLayout?: NativeListSidecarLayout;
|
|
89
106
|
/** Fixed overlay above scrolling rows on iOS 26 and newer. */
|
|
90
107
|
topOverlay?: ReactNode;
|
|
91
108
|
/** Selects UIKit's top scroll-edge effect on iOS 26 and newer. */
|
|
@@ -97,7 +114,7 @@ export type NativeListProps = Omit<ViewProps, 'children'> & Readonly<{
|
|
|
97
114
|
/** Web only: visible sticky chrome above the parent's list viewport. */
|
|
98
115
|
webStickyInset?: number;
|
|
99
116
|
/** Web only. Hosts the section index inside this container. */
|
|
100
|
-
webSectionIndexContainerRef?: RefObject<View | null>;
|
|
117
|
+
webSectionIndexContainerRef?: RefObject<ElementRef<typeof View> | null>;
|
|
101
118
|
/** Defaults to `none`. `interactive` behaves as `none` on Android. */
|
|
102
119
|
keyboardDismissMode?: NativeListKeyboardDismissMode;
|
|
103
120
|
/**
|
|
@@ -111,6 +128,7 @@ export type NativeListProps = Omit<ViewProps, 'children'> & Readonly<{
|
|
|
111
128
|
onReorder?: (event: ReorderEvent) => void;
|
|
112
129
|
onEndReached?: (event: EndReachedEvent) => void;
|
|
113
130
|
onVisibleRangeChanged?: (event: VisibleRangeChangedEvent) => void;
|
|
131
|
+
onStructuralTransitionSettled?: (event: StructuralTransitionSettledEvent) => void;
|
|
114
132
|
/** Native only. Emits initial state and hysteresis transitions, not scroll frames. */
|
|
115
133
|
scrollPositionThresholds?: Readonly<{
|
|
116
134
|
start: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { NativeList, preloadNativeListAvatarImages } from './NativeList';
|
|
2
|
-
export type { ActionAnchorState, NativeListKeyboardDismissMode, NativeListKeyboardShouldPersistTaps, NativeListProps, NativeListRef, ScrollAlignment, ScrollPositionOptions, ScrollToEndParams, ScrollToIndexFailedInfo, ScrollToIndexParams, ScrollToItemParams, ScrollToKeyParams, ScrollToLocationParams, ScrollToOffsetParams, } from './NativeList';
|
|
2
|
+
export type { ActionAnchorState, NativeListKeyboardDismissMode, NativeListKeyboardShouldPersistTaps, NativeListProps, NativeListRef, ScrollAlignment, ScrollPositionOptions, ScrollToEndParams, ScrollToIndexFailedInfo, ScrollToIndexParams, ScrollToItemParams, ScrollToKeyParams, ScrollToLocationParams, ScrollToOffsetParams, StructuralTransitionSettledEvent, } from './NativeList';
|
|
3
3
|
export type * from './models';
|
|
4
|
-
export { applyRowPatches, serializePatches, serializeSnapshot, validatePatches, validateSnapshot, } from './validation';
|
|
4
|
+
export { applyRowPatches, planNativeListPatches, serializePatches, serializeSnapshot, validatePatches, validateSnapshot, } from './validation';
|
|
5
5
|
export { checkboxStateForKeys, checkboxStateForSection, isSelectableRow, reduceSelection, selectionStateFromSnapshot, } from './selection';
|
|
6
6
|
export type { SelectionAction, SelectionResult, SelectionState, } from './selection';
|
|
7
7
|
export { configureNativeListFonts } from './fonts';
|
|
@@ -97,6 +97,7 @@ export declare const ROW_BOX_STYLE_KEYS_BY_TYPE: {
|
|
|
97
97
|
readonly metricCard: readonly ["horizontalPadding", "verticalPadding", "leadingGap", "lineGap", "image"];
|
|
98
98
|
readonly sectionHeader: readonly ["horizontalPadding", "verticalPadding", "lineGap", "trailingGap"];
|
|
99
99
|
readonly action: readonly ["horizontalPadding", "verticalPadding", "leadingGap", "trailingGap", "image"];
|
|
100
|
+
readonly buttonGroup: readonly [];
|
|
100
101
|
readonly system: readonly ["horizontalPadding", "verticalPadding", "lineGap"];
|
|
101
102
|
};
|
|
102
103
|
type TemplateBoxStyle<T extends keyof typeof ROW_BOX_STYLE_KEYS_BY_TYPE> = Pick<RowBoxStyle, (typeof ROW_BOX_STYLE_KEYS_BY_TYPE)[T][number] | 'container'>;
|
|
@@ -107,6 +108,7 @@ type TemplateBoxStyle<T extends keyof typeof ROW_BOX_STYLE_KEYS_BY_TYPE> = Pick<
|
|
|
107
108
|
* the same key name keeps one meaning across platforms. See docs/STYLE_SPEC.md §4.
|
|
108
109
|
*/
|
|
109
110
|
export type IdentityRowStyle = TemplateBoxStyle<'identity'> & Readonly<{
|
|
111
|
+
leadingContentMaxWidthRatio?: number;
|
|
110
112
|
title?: NativeListTextStyle;
|
|
111
113
|
subtitle?: NativeListTextStyle;
|
|
112
114
|
tertiary?: NativeListTextStyle;
|
|
@@ -168,6 +170,13 @@ export type SectionHeaderRowStyle = TemplateBoxStyle<'sectionHeader'> & Readonly
|
|
|
168
170
|
title?: NativeListTextStyle;
|
|
169
171
|
subtitle?: NativeListTextStyle;
|
|
170
172
|
value?: NativeListTextStyle;
|
|
173
|
+
valuePlacement?: 'afterTitle';
|
|
174
|
+
titleDecoration?: 'none' | 'dashed';
|
|
175
|
+
}>;
|
|
176
|
+
export type RowTextHelp = Readonly<{
|
|
177
|
+
actionKey: string;
|
|
178
|
+
presentation: 'tooltip' | 'popover';
|
|
179
|
+
underline?: 'dashed';
|
|
171
180
|
}>;
|
|
172
181
|
export type ActionRowStyle = TemplateBoxStyle<'action'> & Readonly<{
|
|
173
182
|
title?: NativeListTextStyle;
|
|
@@ -225,8 +234,13 @@ export type VisualOverlay = Readonly<{
|
|
|
225
234
|
offsetX?: number;
|
|
226
235
|
offsetY?: number;
|
|
227
236
|
image?: ImageSource;
|
|
237
|
+
fallbackIcon?: Readonly<{
|
|
238
|
+
name: string;
|
|
239
|
+
tintColor?: string;
|
|
240
|
+
}>;
|
|
228
241
|
name?: string;
|
|
229
242
|
text?: string;
|
|
243
|
+
fontWeight?: NativeListTextStyle['fontWeight'];
|
|
230
244
|
tintColor?: string;
|
|
231
245
|
backgroundColor?: string;
|
|
232
246
|
}>;
|
|
@@ -234,12 +248,15 @@ type VisualWithImage = Readonly<{
|
|
|
234
248
|
fallbackIcon?: Readonly<{
|
|
235
249
|
name: string;
|
|
236
250
|
tintColor?: string;
|
|
251
|
+
size?: number;
|
|
252
|
+
backgroundColor?: string;
|
|
237
253
|
}>;
|
|
238
254
|
overlays?: readonly VisualOverlay[];
|
|
239
255
|
borderStyle?: 'dashed';
|
|
240
256
|
borderColor?: string;
|
|
241
257
|
image?: ImageSource;
|
|
242
258
|
fallbackText?: string;
|
|
259
|
+
fallbackTextColor?: string;
|
|
243
260
|
backgroundColor?: string;
|
|
244
261
|
shape?: 'circle' | 'rounded' | 'square';
|
|
245
262
|
cornerIcon?: Readonly<{
|
|
@@ -291,8 +308,24 @@ export type TrailingAccessory = Readonly<{
|
|
|
291
308
|
kind: 'valuePair';
|
|
292
309
|
primary: string;
|
|
293
310
|
secondary: string;
|
|
311
|
+
primaryFontWeight?: 'medium';
|
|
312
|
+
primaryHelp?: RowTextHelp;
|
|
313
|
+
primaryTextSegments?: readonly ValueTextSegment[];
|
|
314
|
+
secondaryTextSegments?: readonly ValueTextSegment[];
|
|
294
315
|
primaryTone?: TextTone;
|
|
295
316
|
secondaryTone?: TextTone;
|
|
317
|
+
}> | Readonly<{
|
|
318
|
+
kind: 'button';
|
|
319
|
+
label: string;
|
|
320
|
+
actionKey: string;
|
|
321
|
+
disabled?: boolean;
|
|
322
|
+
testID?: string;
|
|
323
|
+
accessibilityLabel?: string;
|
|
324
|
+
textColor?: string;
|
|
325
|
+
backgroundColor?: string;
|
|
326
|
+
pressedBackgroundColor?: string;
|
|
327
|
+
hoverBackgroundColor?: string;
|
|
328
|
+
focusRingColor?: string;
|
|
296
329
|
}> | Readonly<{
|
|
297
330
|
kind: 'checkbox';
|
|
298
331
|
state: CheckboxState;
|
|
@@ -323,6 +356,7 @@ export type TrailingAccessory = Readonly<{
|
|
|
323
356
|
kind: 'icon';
|
|
324
357
|
name: string;
|
|
325
358
|
tintColor?: string;
|
|
359
|
+
buttonStyle?: 'tertiary';
|
|
326
360
|
disabled?: boolean;
|
|
327
361
|
actionKey?: string;
|
|
328
362
|
testID?: string;
|
|
@@ -362,6 +396,10 @@ export type RowBase = Readonly<{
|
|
|
362
396
|
}>;
|
|
363
397
|
export type IdentityRow = RowBase & Readonly<{
|
|
364
398
|
type: 'identity';
|
|
399
|
+
/** Opt in to content-based height; explicit row/container height still wins. */
|
|
400
|
+
contentHeight?: 'auto';
|
|
401
|
+
/** Emits a row action instead of a press after a successful long press. */
|
|
402
|
+
longPressActionKey?: string;
|
|
365
403
|
titleMatch?: readonly Readonly<{
|
|
366
404
|
start: number;
|
|
367
405
|
end: number;
|
|
@@ -375,11 +413,34 @@ export type IdentityRow = RowBase & Readonly<{
|
|
|
375
413
|
kind: 'icon';
|
|
376
414
|
}>;
|
|
377
415
|
title: string;
|
|
416
|
+
/** Plain 12/16 labels beside the title, preserving independent tones. */
|
|
417
|
+
titleSuffixes?: readonly Readonly<{
|
|
418
|
+
text: string;
|
|
419
|
+
tone: 'secondary' | 'disabled';
|
|
420
|
+
maxWidth?: number;
|
|
421
|
+
}>[];
|
|
422
|
+
titleIcon?: Readonly<{
|
|
423
|
+
name: string;
|
|
424
|
+
tintColor?: string;
|
|
425
|
+
accessibilityLabel?: string;
|
|
426
|
+
/** Web-only anchored help from this icon; does not add a click action. */
|
|
427
|
+
hoverActionKey?: string;
|
|
428
|
+
}>;
|
|
429
|
+
/** Web-only additional help icon after titleIcon. */
|
|
430
|
+
secondaryTitleIcon?: IdentityRow['titleIcon'];
|
|
431
|
+
/** Circular image after title icons; image dimensions must be square, 1...40. */
|
|
432
|
+
titleImage?: Readonly<{
|
|
433
|
+
image: ImageSource;
|
|
434
|
+
accessibilityLabel?: string;
|
|
435
|
+
/** Web-only help anchor; the consumer owns tooltip content. */
|
|
436
|
+
hoverActionKey?: string;
|
|
437
|
+
}>;
|
|
378
438
|
subtitle?: string;
|
|
379
439
|
tertiary?: string;
|
|
380
440
|
tertiaryTone?: 'secondary' | 'info';
|
|
381
441
|
titleLines?: 1 | 2;
|
|
382
|
-
|
|
442
|
+
/** Zero displays the complete subtitle. */
|
|
443
|
+
subtitleLines?: 0 | 1 | 2;
|
|
383
444
|
badges?: readonly BadgeModel[];
|
|
384
445
|
trailing?: readonly TrailingAccessory[];
|
|
385
446
|
draggable?: boolean;
|
|
@@ -413,6 +474,7 @@ export type ActivityAmount = Readonly<{
|
|
|
413
474
|
export type ActivityRow = RowBase & Readonly<{
|
|
414
475
|
type: 'activity';
|
|
415
476
|
leading: LeadingVisual;
|
|
477
|
+
hideLeading?: boolean;
|
|
416
478
|
secondaryLeading?: LeadingVisual;
|
|
417
479
|
title: string;
|
|
418
480
|
description?: string;
|
|
@@ -431,16 +493,27 @@ export type ActivityRow = RowBase & Readonly<{
|
|
|
431
493
|
hidden?: boolean;
|
|
432
494
|
}>;
|
|
433
495
|
descriptionActionKey?: string;
|
|
496
|
+
/**
|
|
497
|
+
* UTF-16 offset into `description` where the text that opens
|
|
498
|
+
* `descriptionActionKey` starts; the text before it stays plain. An integer
|
|
499
|
+
* in `0...description.length`: `0`, the default, makes the whole
|
|
500
|
+
* description the action and `description.length` leaves no action text.
|
|
501
|
+
* Ignored without `descriptionActionKey`.
|
|
502
|
+
*/
|
|
503
|
+
descriptionActionStart?: number;
|
|
434
504
|
footerActions?: readonly FooterAction[];
|
|
435
505
|
style?: ActivityRowStyle;
|
|
436
506
|
}>;
|
|
437
507
|
export type MessageRow = RowBase & Readonly<{
|
|
438
508
|
type: 'message';
|
|
509
|
+
/** Draws only top and bottom container borders when a border is supplied. */
|
|
510
|
+
presentation?: 'inlineWarning';
|
|
439
511
|
unread?: boolean;
|
|
440
512
|
leading?: LeadingVisual;
|
|
441
513
|
title: string;
|
|
442
514
|
body: string;
|
|
443
|
-
|
|
515
|
+
/** Zero displays the complete body. */
|
|
516
|
+
bodyLines?: 0 | 1 | 2 | 3;
|
|
444
517
|
time: string;
|
|
445
518
|
thumbnail?: ImageSource;
|
|
446
519
|
style?: MessageRowStyle;
|
|
@@ -448,8 +521,12 @@ export type MessageRow = RowBase & Readonly<{
|
|
|
448
521
|
export type DataColumn = Readonly<{
|
|
449
522
|
key: string;
|
|
450
523
|
text: string;
|
|
524
|
+
textSegments?: readonly ValueTextSegment[];
|
|
525
|
+
titleIcon?: IdentityRow['titleIcon'];
|
|
526
|
+
secondaryTitleIcon?: IdentityRow['titleIcon'];
|
|
451
527
|
secondaryLeadingText?: string;
|
|
452
528
|
secondaryText?: string;
|
|
529
|
+
secondaryTextSegments?: readonly ValueTextSegment[];
|
|
453
530
|
weight?: 1 | 2 | 3;
|
|
454
531
|
alignment?: 'start' | 'center' | 'end';
|
|
455
532
|
tone?: 'primary' | 'secondary' | 'positive' | 'negative';
|
|
@@ -459,6 +536,7 @@ export type DataRow = RowBase & Readonly<{
|
|
|
459
536
|
type: 'dataRow';
|
|
460
537
|
leading?: LeadingVisual;
|
|
461
538
|
columns: readonly DataColumn[];
|
|
539
|
+
trailing?: readonly TrailingAccessory[];
|
|
462
540
|
checkbox?: Extract<TrailingAccessory, {
|
|
463
541
|
kind: 'checkbox';
|
|
464
542
|
}>;
|
|
@@ -532,6 +610,8 @@ export type MarketRow = RowBase & Readonly<{
|
|
|
532
610
|
variant: 'token' | 'stock' | 'perp';
|
|
533
611
|
/** Web-only bounded table presentation; native reads the ordinary Market fields. */
|
|
534
612
|
webTable?: WebMarketTablePresentation;
|
|
613
|
+
/** Two or three ordered native text metrics; omitting them keeps the compact quote. */
|
|
614
|
+
metrics?: readonly Pick<DataColumn, 'key' | 'text' | 'textSegments' | 'secondaryText' | 'secondaryTextSegments' | 'weight' | 'alignment' | 'tone' | 'secondaryTone'>[];
|
|
535
615
|
leadingAction?: Extract<TrailingAccessory, {
|
|
536
616
|
kind: 'icon';
|
|
537
617
|
}>;
|
|
@@ -611,9 +691,11 @@ export type SectionHeaderRow = RowBase & Readonly<{
|
|
|
611
691
|
indexTitle?: string;
|
|
612
692
|
variant?: 'summary' | 'gallery' | 'history';
|
|
613
693
|
title: string;
|
|
694
|
+
leadingBadge?: BadgeModel;
|
|
614
695
|
titleLoading?: boolean;
|
|
615
696
|
subtitle?: string;
|
|
616
697
|
value?: string;
|
|
698
|
+
valueHelp?: RowTextHelp;
|
|
617
699
|
valueActionKey?: string;
|
|
618
700
|
titleIcon?: Extract<TrailingAccessory, {
|
|
619
701
|
kind: 'icon';
|
|
@@ -641,6 +723,19 @@ export type ActionRow = RowBase & Readonly<{
|
|
|
641
723
|
trailing?: readonly TrailingAccessory[];
|
|
642
724
|
style?: ActionRowStyle;
|
|
643
725
|
}>;
|
|
726
|
+
export type ButtonGroupRow = RowBase & Readonly<{
|
|
727
|
+
type: 'buttonGroup';
|
|
728
|
+
buttons: readonly Readonly<{
|
|
729
|
+
key: string;
|
|
730
|
+
label: string;
|
|
731
|
+
actionKey: string;
|
|
732
|
+
disabled?: boolean;
|
|
733
|
+
loading?: boolean;
|
|
734
|
+
testID?: string;
|
|
735
|
+
accessibilityLabel?: string;
|
|
736
|
+
}>[];
|
|
737
|
+
style?: TemplateBoxStyle<'buttonGroup'>;
|
|
738
|
+
}>;
|
|
644
739
|
export type SystemRow = RowBase & Readonly<{
|
|
645
740
|
style?: SystemRowStyle;
|
|
646
741
|
}> & (Readonly<{
|
|
@@ -677,7 +772,7 @@ export type SystemRow = RowBase & Readonly<{
|
|
|
677
772
|
variant: 'spacer';
|
|
678
773
|
height: number;
|
|
679
774
|
}>);
|
|
680
|
-
export type RowModel = IdentityRow | WalletGroupRow | RailRow | ActivityRow | MessageRow | DataRow | MarketRow | MediaTileRow | MetricCardRow | SectionHeaderRow | ActionRow | SystemRow;
|
|
775
|
+
export type RowModel = IdentityRow | WalletGroupRow | RailRow | ActivityRow | MessageRow | DataRow | MarketRow | MediaTileRow | MetricCardRow | SectionHeaderRow | ActionRow | ButtonGroupRow | SystemRow;
|
|
681
776
|
export type NativeListTheme = Readonly<{
|
|
682
777
|
checkboxBackground?: string;
|
|
683
778
|
checkboxBorder?: string;
|
|
@@ -687,6 +782,8 @@ export type NativeListTheme = Readonly<{
|
|
|
687
782
|
rowBackground: string;
|
|
688
783
|
rowSelectedBackground: string;
|
|
689
784
|
rowPressedBackground?: string;
|
|
785
|
+
/** Web-only enabled-row hover color; defaults to rowPressedBackground. */
|
|
786
|
+
rowHoverBackground?: string;
|
|
690
787
|
subduedBackground?: string;
|
|
691
788
|
strongBackground?: string;
|
|
692
789
|
/** Web-only background for a displayed declared image fallback. */
|
|
@@ -699,6 +796,8 @@ export type NativeListTheme = Readonly<{
|
|
|
699
796
|
separator: string;
|
|
700
797
|
accent: string;
|
|
701
798
|
positive: string;
|
|
799
|
+
/** Optional exact background for the success tone of section leading badges. */
|
|
800
|
+
successBackground?: string;
|
|
702
801
|
negative: string;
|
|
703
802
|
criticalBackground?: string;
|
|
704
803
|
inverseBackground?: string;
|
|
@@ -740,6 +839,16 @@ export type NativeListListStyle = Readonly<{
|
|
|
740
839
|
export type NativeListSnapshot = Readonly<{
|
|
741
840
|
schemaVersion: 1;
|
|
742
841
|
generation: number;
|
|
842
|
+
/** One-shot animation for a user-initiated row-key insertion or removal. */
|
|
843
|
+
structuralTransition?: Readonly<{
|
|
844
|
+
id: string;
|
|
845
|
+
durationMs?: number;
|
|
846
|
+
anchorKey?: string;
|
|
847
|
+
}>;
|
|
848
|
+
disclosure?: Readonly<{
|
|
849
|
+
expanded: boolean;
|
|
850
|
+
expandedTrailingInset?: number;
|
|
851
|
+
}>;
|
|
743
852
|
layout: Readonly<{
|
|
744
853
|
kind: NativeListLayout;
|
|
745
854
|
orientation?: NativeListOrientation;
|
|
@@ -772,56 +881,64 @@ export type NativeListSnapshot = Readonly<{
|
|
|
772
881
|
listStyle?: NativeListListStyle;
|
|
773
882
|
}>;
|
|
774
883
|
type CommonPatchFields = 'revision' | 'disabled' | 'selected' | 'separator' | 'height' | 'heightRounding' | 'opacity' | 'pressDisabled' | 'accessibilityLabel' | 'style';
|
|
884
|
+
/** Null removes optional fields; undefined leaves the existing value unchanged. */
|
|
885
|
+
export type PatchClearableChanges<Row, Keys extends keyof Row> = Readonly<{
|
|
886
|
+
[K in Keys]?: undefined extends Row[K] ? Row[K] | null : Row[K];
|
|
887
|
+
}>;
|
|
775
888
|
export type RowPatch = Readonly<{
|
|
776
889
|
type: 'identity';
|
|
777
890
|
key: string;
|
|
778
|
-
changes:
|
|
891
|
+
changes: PatchClearableChanges<IdentityRow, CommonPatchFields | 'title' | 'titleSuffixes' | 'titleIcon' | 'secondaryTitleIcon' | 'titleImage' | 'subtitle' | 'subtitleLines' | 'contentHeight' | 'longPressActionKey' | 'tertiary' | 'tertiaryTone' | 'badges' | 'trailing' | 'leading' | 'leadingAction' | 'titleMatch' | 'titleActionKey' | 'titleActionOnHover' | 'subtitleSegments'>;
|
|
779
892
|
}> | Readonly<{
|
|
780
893
|
type: 'rail';
|
|
781
894
|
key: string;
|
|
782
|
-
changes:
|
|
895
|
+
changes: PatchClearableChanges<RailRow, CommonPatchFields | 'title' | 'status' | 'badge' | 'visual'>;
|
|
783
896
|
}> | Readonly<{
|
|
784
897
|
type: 'activity';
|
|
785
898
|
key: string;
|
|
786
|
-
changes:
|
|
899
|
+
changes: PatchClearableChanges<ActivityRow, CommonPatchFields | 'title' | 'description' | 'status' | 'amounts' | 'badges' | 'presentation' | 'fee' | 'descriptionActionKey' | 'descriptionActionStart' | 'primaryAmount' | 'secondaryAmount' | 'leading' | 'hideLeading' | 'secondaryLeading' | 'footerActions'>;
|
|
787
900
|
}> | Readonly<{
|
|
788
901
|
type: 'message';
|
|
789
902
|
key: string;
|
|
790
|
-
changes:
|
|
903
|
+
changes: PatchClearableChanges<MessageRow, CommonPatchFields | 'unread' | 'title' | 'body' | 'bodyLines' | 'presentation' | 'time' | 'thumbnail'>;
|
|
791
904
|
}> | Readonly<{
|
|
792
905
|
type: 'dataRow';
|
|
793
906
|
key: string;
|
|
794
|
-
changes:
|
|
907
|
+
changes: PatchClearableChanges<DataRow, CommonPatchFields | 'leading' | 'columns' | 'trailing' | 'checkbox' | 'index' | 'badge' | 'badges' | 'favorite' | 'favoriteActive'>;
|
|
795
908
|
}> | Readonly<{
|
|
796
909
|
type: 'market';
|
|
797
910
|
key: string;
|
|
798
|
-
changes:
|
|
911
|
+
changes: PatchClearableChanges<MarketRow, CommonPatchFields | 'leadingAction' | 'leading' | 'title' | 'subtitle' | 'subtitleSegments' | 'price' | 'priceSegments' | 'change' | 'badges' | 'pressActionKey' | 'pressInActionKey' | 'longPressActionKey' | 'diagnostics' | 'webTable' | 'metrics' | 'style'>;
|
|
799
912
|
}> | Readonly<{
|
|
800
913
|
type: 'mediaTile';
|
|
801
914
|
key: string;
|
|
802
|
-
changes:
|
|
915
|
+
changes: PatchClearableChanges<MediaTileRow, CommonPatchFields | 'image' | 'imageState' | 'media' | 'networkImage' | 'title' | 'subtitle' | 'badge' | 'closeActionKey'>;
|
|
803
916
|
}> | Readonly<{
|
|
804
917
|
type: 'metricCard';
|
|
805
918
|
key: string;
|
|
806
|
-
changes:
|
|
919
|
+
changes: PatchClearableChanges<MetricCardRow, CommonPatchFields | 'variant' | 'title' | 'value' | 'subtitle' | 'trend' | 'trendTone' | 'visual' | 'badge' | 'metrics' | 'progress'>;
|
|
807
920
|
}> | Readonly<{
|
|
808
921
|
type: 'sectionHeader';
|
|
809
922
|
key: string;
|
|
810
|
-
changes:
|
|
923
|
+
changes: PatchClearableChanges<SectionHeaderRow, CommonPatchFields | 'variant' | 'titleLoading' | 'title' | 'subtitle' | 'value' | 'valueHelp' | 'leadingBadge' | 'valueActionKey' | 'titleActionKey' | 'titleActionOnHover' | 'titleIcon' | 'valueIcon' | 'checkbox'>;
|
|
811
924
|
}> | Readonly<{
|
|
812
925
|
type: 'action';
|
|
813
926
|
key: string;
|
|
814
|
-
changes:
|
|
927
|
+
changes: PatchClearableChanges<ActionRow, CommonPatchFields | 'title' | 'tone' | 'icon' | 'checkbox' | 'trailing'>;
|
|
928
|
+
}> | Readonly<{
|
|
929
|
+
type: 'buttonGroup';
|
|
930
|
+
key: string;
|
|
931
|
+
changes: PatchClearableChanges<ButtonGroupRow, CommonPatchFields | 'buttons'>;
|
|
815
932
|
}> | Readonly<{
|
|
816
933
|
type: 'system';
|
|
817
934
|
key: string;
|
|
818
935
|
changes: Readonly<{
|
|
819
|
-
revision?: number;
|
|
820
|
-
disabled?: boolean;
|
|
821
|
-
message?: string;
|
|
936
|
+
revision?: number | null;
|
|
937
|
+
disabled?: boolean | null;
|
|
938
|
+
message?: string | null;
|
|
822
939
|
}>;
|
|
823
940
|
}>;
|
|
824
|
-
export type NativeListActionSource = 'row' | 'marketBadge' | 'leadingAction' | 'trailingAccessory' | 'footerAction' | 'description' | 'mediaClose';
|
|
941
|
+
export type NativeListActionSource = 'row' | 'marketBadge' | 'leadingAction' | 'trailingAccessory' | 'footerAction' | 'buttonGroup' | 'description' | 'mediaClose';
|
|
825
942
|
export type NativeListWindowRect = Readonly<{
|
|
826
943
|
x: number;
|
|
827
944
|
y: number;
|
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import type { NativeListSnapshot, RowPatch } from './models';
|
|
2
|
+
/** Component boundaries report locations, never caller-controlled payload values. */
|
|
3
|
+
export declare function containNativeListInput<T>(operation: () => T): T | undefined;
|
|
4
|
+
export declare function emptyNativeListSnapshot(): NativeListSnapshot;
|
|
2
5
|
export declare function validateSnapshot(snapshot: NativeListSnapshot): NativeListSnapshot;
|
|
6
|
+
/** Capture caller data once before validation, including accessor values. */
|
|
7
|
+
export declare function captureNativeListInput<T>(value: T): T;
|
|
8
|
+
/** Private native-wrapper ownership; exported validators keep their public identity. */
|
|
9
|
+
export declare function ownValidatedNativeSnapshot(snapshot: NativeListSnapshot): NativeListSnapshot;
|
|
3
10
|
export declare function validatePatches(patches: readonly RowPatch[]): readonly RowPatch[];
|
|
11
|
+
/** Plan value-only patches; callers own valid immutable snapshots and commit state. */
|
|
12
|
+
export declare function planNativeListPatches(previous: NativeListSnapshot, next: NativeListSnapshot): readonly RowPatch[] | undefined;
|
|
13
|
+
/** One canonical batch owns both accepted rows and the native wire payload. */
|
|
14
|
+
export declare function applyValidatedRowPatches(snapshot: NativeListSnapshot, patches: readonly RowPatch[]): {
|
|
15
|
+
patches: readonly RowPatch[];
|
|
16
|
+
snapshot: NativeListSnapshot;
|
|
17
|
+
json: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function applyOwnedNativePatches(snapshot: NativeListSnapshot, patches: readonly RowPatch[]): {
|
|
20
|
+
patches: readonly RowPatch[];
|
|
21
|
+
snapshot: NativeListSnapshot;
|
|
22
|
+
json: string;
|
|
23
|
+
};
|
|
4
24
|
export declare function applyRowPatches(snapshot: NativeListSnapshot, patches: readonly RowPatch[]): NativeListSnapshot;
|
|
5
25
|
export declare function serializeSnapshot(snapshot: NativeListSnapshot): string;
|
|
6
26
|
export declare function serializePatches(patches: readonly RowPatch[]): string;
|