@applicaster/zapp-react-native-ui-components 15.1.4 → 16.0.0-alpha.1042942411
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/Components/BackgroundImage/index.ts +1 -8
- package/Components/BaseFocusable/index.ios.ts +12 -2
- package/Components/Cell/FocusableWrapper.tsx +3 -0
- package/Components/Cell/TvOSCellComponent.tsx +6 -3
- package/Components/CellRendererResolver/index.ts +1 -1
- package/Components/Focusable/Focusable.tsx +4 -2
- package/Components/Focusable/FocusableTvOS.tsx +18 -1
- package/Components/Focusable/__tests__/__snapshots__/FocusableTvOS.test.tsx.snap +1 -0
- package/Components/FocusableGroup/FocusableTvOS.tsx +30 -1
- package/Components/GeneralContentScreen/GeneralContentScreenHookAdapter.tsx +39 -0
- package/Components/GeneralContentScreen/__tests__/GeneralContentScreenHookAdapter.test.tsx +64 -0
- package/Components/GeneralContentScreen/__tests__/HookContentFocusGroup.web.test.tsx +91 -0
- package/Components/GeneralContentScreen/hookAdapter/__tests__/networkService.test.ts +74 -0
- package/Components/GeneralContentScreen/hookAdapter/__tests__/runInBackground.test.ts +139 -0
- package/Components/GeneralContentScreen/hookAdapter/__tests__/validationHelper.test.ts +124 -0
- package/Components/GeneralContentScreen/hookAdapter/logger.ts +6 -0
- package/Components/GeneralContentScreen/hookAdapter/networkService.ts +53 -0
- package/Components/GeneralContentScreen/hookAdapter/runInBackground.ts +48 -0
- package/Components/GeneralContentScreen/hookAdapter/validationHelper.ts +72 -0
- package/Components/GeneralContentScreen/hookFocus/index.tsx +13 -0
- package/Components/GeneralContentScreen/hookFocus/index.web.tsx +69 -0
- package/Components/GeneralContentScreen/index.ts +2 -0
- package/Components/GeneralContentScreen/utils/__tests__/useCurationAPI.test.js +1 -1
- package/Components/HandlePlayable/HandlePlayable.tsx +13 -8
- package/Components/Layout/TV/NavBarContainer.tsx +1 -10
- package/Components/Layout/TV/ScreenContainer.tsx +2 -6
- package/Components/Layout/TV/__tests__/__snapshots__/NavBarContainer.test.tsx.snap +7 -12
- package/Components/Layout/TV/__tests__/__snapshots__/ScreenContainer.test.tsx.snap +7 -12
- package/Components/Layout/TV/index.tsx +3 -4
- package/Components/Layout/TV/index.web.tsx +3 -4
- package/Components/LinkHandler/LinkHandler.tsx +2 -2
- package/Components/MasterCell/CONFIG_BUILDER_TO_REACT_COMPONENT.md +144 -0
- package/Components/MasterCell/DefaultComponents/ActionButton.tsx +27 -48
- package/Components/MasterCell/DefaultComponents/ActionButtonsCore/__tests__/model.test.ts +80 -0
- package/Components/MasterCell/DefaultComponents/ActionButtonsCore/__tests__/placement.test.ts +213 -0
- package/Components/MasterCell/DefaultComponents/ActionButtonsCore/__tests__/selectors.test.ts +45 -0
- package/Components/MasterCell/DefaultComponents/ActionButtonsCore/__tests__/style.test.ts +49 -0
- package/Components/MasterCell/DefaultComponents/ActionButtonsCore/components/ActionButtonController.tsx +165 -0
- package/Components/MasterCell/DefaultComponents/ActionButtonsCore/components/__tests__/ActionButtonController.test.tsx +405 -0
- package/Components/MasterCell/DefaultComponents/ActionButtonsCore/components/index.ts +1 -0
- package/Components/MasterCell/DefaultComponents/ActionButtonsCore/model.ts +47 -0
- package/Components/MasterCell/DefaultComponents/ActionButtonsCore/placement.ts +198 -0
- package/Components/MasterCell/DefaultComponents/ActionButtonsCore/selectors.ts +26 -0
- package/Components/MasterCell/DefaultComponents/ActionButtonsCore/style.ts +29 -0
- package/Components/MasterCell/DefaultComponents/ActionButtonsCore/types.ts +37 -0
- package/Components/MasterCell/DefaultComponents/BorderContainerView/__tests__/index.test.tsx +217 -46
- package/Components/MasterCell/DefaultComponents/BorderContainerView/index.tsx +50 -119
- package/Components/MasterCell/DefaultComponents/Button.tsx +50 -58
- package/Components/MasterCell/DefaultComponents/ButtonContainerView/components/HorizontalSeparator.tsx +8 -0
- package/Components/MasterCell/DefaultComponents/ButtonContainerView/index.android.tv.tsx +58 -0
- package/Components/MasterCell/DefaultComponents/ButtonContainerView/index.tsx +15 -0
- package/Components/MasterCell/DefaultComponents/{tv/ButtonContainerView/index.tsx → ButtonContainerView/index.tv.tsx} +3 -11
- package/Components/MasterCell/DefaultComponents/ButtonContainerView/index.web.ts +1 -0
- package/Components/MasterCell/DefaultComponents/ButtonContainerView/types.ts +40 -0
- package/Components/MasterCell/DefaultComponents/CellBadge/__tests__/__snapshots__/index.test.tsx.snap +18 -0
- package/Components/MasterCell/DefaultComponents/CellBadge/__tests__/index.test.tsx +90 -0
- package/Components/MasterCell/DefaultComponents/CellBadge/index.tsx +13 -14
- package/Components/MasterCell/DefaultComponents/DataProvider/index.tsx +163 -0
- package/Components/MasterCell/DefaultComponents/FocusableView/index.android.tsx +2 -23
- package/Components/MasterCell/DefaultComponents/FocusableView/index.tsx +4 -22
- package/Components/MasterCell/DefaultComponents/Image/Image.android.tsx +8 -2
- package/Components/MasterCell/DefaultComponents/Image/Image.ios.tsx +11 -3
- package/Components/MasterCell/DefaultComponents/Image/Image.web.tsx +9 -1
- package/Components/MasterCell/DefaultComponents/Image/hooks/useImage.ts +15 -14
- package/Components/MasterCell/DefaultComponents/ImageContainer/index.tsx +5 -3
- package/Components/MasterCell/DefaultComponents/LiveImage/index.tsx +1 -2
- package/Components/MasterCell/DefaultComponents/PressableView.tsx +54 -0
- package/Components/MasterCell/DefaultComponents/SecondaryImage/Image.tsx +46 -50
- package/Components/MasterCell/DefaultComponents/SecondaryImage/__tests__/__snapshots__/Image.test.tsx.snap +47 -39
- package/Components/MasterCell/DefaultComponents/SecondaryImage/hooks/__tests__/useGetImageDimensions.test.ts +7 -6
- package/Components/MasterCell/DefaultComponents/SecondaryImage/utils.ts +19 -6
- package/Components/MasterCell/DefaultComponents/Text/hooks/useText.ts +15 -0
- package/Components/MasterCell/DefaultComponents/Text/index.tsx +45 -15
- package/Components/MasterCell/DefaultComponents/UIKitAdapters/Badge.tsx +49 -0
- package/Components/MasterCell/DefaultComponents/__tests__/ActionButton.test.tsx +122 -0
- package/Components/MasterCell/DefaultComponents/__tests__/Button.test.tsx +186 -0
- package/Components/MasterCell/DefaultComponents/__tests__/DataProvider.test.tsx +141 -0
- package/Components/MasterCell/DefaultComponents/__tests__/DynamicBadge.test.tsx +156 -0
- package/Components/MasterCell/DefaultComponents/__tests__/__snapshots__/ActionButton.test.tsx.snap +60 -0
- package/Components/MasterCell/DefaultComponents/__tests__/text.test.tsx +196 -67
- package/Components/MasterCell/DefaultComponents/index.ts +13 -3
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/ActionButton.tsx +189 -0
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/Asset.ts +33 -0
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/AssetComponent.tsx +33 -0
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/Button.ts +159 -0
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/Spacer.ts +18 -0
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/TextLabel.ts +67 -0
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/TextLabelsContainer.ts +39 -0
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/__tests__/PressableView.test.tsx +402 -0
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/__tests__/builders.test.ts +141 -0
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/__tests__/index.test.ts +354 -0
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/helpers.ts +105 -0
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/index.ts +129 -0
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/utils/__tests__/insertButtons.test.ts +123 -0
- package/Components/MasterCell/DefaultComponents/mobile/MobileActionButtons/utils/index.ts +238 -0
- package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/Asset.ts +4 -18
- package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/Button.ts +24 -73
- package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/TextLabelsContainer.ts +37 -18
- package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/TvActionButton.tsx +27 -0
- package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/__tests__/index.test.ts +89 -0
- package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/__tests__/renderedTree.test.tsx +231 -0
- package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/index.ts +47 -48
- package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/utils/__tests__/getPluginIdentifier.test.ts +115 -29
- package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/utils/__tests__/insertButtonsBetweenLabels.test.ts +45 -13
- package/Components/MasterCell/DefaultComponents/tv/TvActionButtons/utils/index.ts +101 -144
- package/Components/MasterCell/MappingFunctions/index.js +3 -2
- package/Components/MasterCell/README.md +4 -0
- package/Components/MasterCell/__tests__/__snapshots__/dataAdapter.test.js.snap +24 -0
- package/Components/MasterCell/__tests__/configInflater.test.js +1 -0
- package/Components/MasterCell/__tests__/elementMapper.test.js +46 -0
- package/Components/MasterCell/contexts/PressedStateContext.ts +3 -0
- package/Components/MasterCell/dataAdapter.ts +4 -1
- package/Components/MasterCell/elementMapper.tsx +54 -7
- package/Components/MasterCell/hooks/index.ts +2 -0
- package/Components/MasterCell/hooks/usePressedState.ts +4 -0
- package/Components/MasterCell/index.tsx +20 -4
- package/Components/MasterCell/utils/__tests__/cloneChildrenWithIds.test.tsx +43 -0
- package/Components/MasterCell/utils/__tests__/useFilterChildren.test.tsx +80 -0
- package/Components/MasterCell/utils/index.ts +82 -16
- package/Components/ModalComponent/AudioPlayer/Components/Action.tsx +33 -69
- package/Components/ModalComponent/AudioPlayer/Components/Button.tsx +25 -47
- package/Components/ModalComponent/AudioPlayer/Components/Header.tsx +122 -39
- package/Components/ModalComponent/AudioPlayer/Components/Input.tsx +671 -0
- package/Components/ModalComponent/AudioPlayer/Components/Item.tsx +257 -88
- package/Components/ModalComponent/AudioPlayer/Components/index.ts +6 -4
- package/Components/ModalComponent/BottomSheetDragArea.tsx +33 -0
- package/Components/ModalComponent/BottomSheetModalContent.tsx +17 -10
- package/Components/ModalComponent/__tests__/BottomSheetDragArea.test.tsx +74 -0
- package/Components/OfflineHandler/__tests__/__snapshots__/index.test.tsx.snap +4 -85
- package/Components/OfflineHandler/__tests__/index.test.tsx +101 -32
- package/Components/OfflineHandler/hooks.ts +123 -0
- package/Components/OfflineHandler/index.tsx +51 -73
- package/Components/OfflineHandler/utils/index.ts +1 -13
- package/Components/PlayerContainer/PlayerContainer.tsx +6 -5
- package/Components/PlayerContainer/__tests__/PlayerContainer.test.tsx +2 -4
- package/Components/PreloaderWrapper/index.tsx +1 -1
- package/Components/River/ComponentsMap/ComponentsMap.tsx +8 -21
- package/Components/River/ComponentsMap/hooks/__tests__/useLoadingState.test.ts +1 -1
- package/Components/River/RefreshControl.tsx +19 -105
- package/Components/River/River.tsx +9 -82
- package/Components/River/TV/River.tsx +31 -14
- package/Components/River/TV/index.tsx +8 -4
- package/Components/River/TV/utils/__tests__/toStringOrEmpty.test.ts +30 -0
- package/Components/River/TV/utils/index.ts +4 -0
- package/Components/River/TV/withFocusableGroupForContent.tsx +71 -0
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +4 -0
- package/Components/River/__tests__/componentsMap.test.js +38 -0
- package/Components/River/hooks/__tests__/usePullToRefresh.test.ts +132 -0
- package/Components/River/hooks/index.ts +1 -0
- package/Components/River/hooks/usePullToRefresh.ts +51 -0
- package/Components/Screen/TV/index.web.tsx +4 -2
- package/Components/Screen/__tests__/Screen.test.tsx +65 -42
- package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +68 -44
- package/Components/Screen/hooks.ts +2 -3
- package/Components/Screen/index.tsx +2 -3
- package/Components/Screen/orientationHandler.ts +3 -3
- package/Components/ScreenFeedLoader/ScreenFeedLoader.tsx +5 -3
- package/Components/ScreenResolver/index.tsx +9 -5
- package/Components/ScreenResolverFeedProvider/ScreenResolverFeedProvider.tsx +1 -1
- package/Components/ScreenRevealManager/ScreenRevealManager.ts +40 -8
- package/Components/ScreenRevealManager/__tests__/ScreenRevealManager.test.ts +86 -69
- package/Components/ScreenRevealManager/withScreenRevealManager.tsx +1 -1
- package/Components/Tabs/TabContent.tsx +7 -4
- package/Components/TopCutoffOverlay/__tests__/TopCutoffOverlay.test.tsx +201 -0
- package/Components/TopCutoffOverlay/hooks/__tests__/useMarginTop.test.ts +130 -0
- package/Components/TopCutoffOverlay/hooks/index.ts +1 -0
- package/Components/TopCutoffOverlay/hooks/useMarginTop.ts +59 -0
- package/Components/TopCutoffOverlay/index.tsx +55 -0
- package/Components/Transitioner/index.js +3 -3
- package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +5 -5
- package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +15 -7
- package/Components/VideoModal/utils.ts +12 -10
- package/Components/Viewport/ViewportAware/__tests__/viewportAware.test.js +0 -2
- package/Components/Viewport/ViewportAware/index.tsx +16 -7
- package/Components/Viewport/ViewportEvents/__tests__/viewportEvents.test.js +1 -1
- package/Components/default-cell-renderer/viewTrees/mobile/index.ts +0 -3
- package/Contexts/CachedDimensionsContext/__tests__/index.test.ts +154 -0
- package/Contexts/ScreenContext/index.tsx +25 -18
- package/Contexts/ScreenTrackedViewPositionsContext/__tests__/index.test.tsx +1 -1
- package/Decorators/Analytics/index.tsx +6 -5
- package/Decorators/ConfigurationWrapper/__tests__/__snapshots__/withConfigurationProvider.test.tsx.snap +1 -0
- package/Decorators/ConfigurationWrapper/const.ts +1 -0
- package/Decorators/ZappPipesDataConnector/__tests__/UrlFeedResolver.test.tsx +39 -21
- package/Decorators/ZappPipesDataConnector/__tests__/zappPipesDataConnector.test.js +1 -1
- package/Decorators/ZappPipesDataConnector/index.tsx +2 -2
- package/Decorators/ZappPipesDataConnector/resolvers/StaticFeedResolver.tsx +1 -1
- package/Decorators/ZappPipesDataConnector/resolvers/UrlFeedResolver.tsx +18 -7
- package/Helpers/DataSourceHelper/__tests__/itemLimitForData.test.ts +80 -0
- package/Helpers/DataSourceHelper/index.ts +19 -0
- package/package.json +5 -5
- package/Components/MasterCell/DefaultComponents/tv/ButtonContainerView/index.android.tsx +0 -135
- package/Components/MasterCell/DefaultComponents/tv/ButtonContainerView/types.ts +0 -25
- package/Components/OfflineHandler/NotificationView/NotificationView.lg.tsx +0 -112
- package/Components/OfflineHandler/NotificationView/NotificationView.samsung.tsx +0 -107
- package/Components/OfflineHandler/NotificationView/NotificationView.tsx +0 -153
- package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +0 -67
- package/Components/OfflineHandler/NotificationView/utils.ts +0 -34
- package/Components/River/TV/withTVEventHandler.tsx +0 -36
- package/Helpers/DataSourceHelper/index.js +0 -19
- /package/Components/BackgroundImage/{BackgroundImage.tv.android.tsx → BackgroundImage.android.tv.tsx} +0 -0
- /package/Components/BackgroundImage/{BackgroundImage.tv.ios.tsx → BackgroundImage.ios.tv.tsx} +0 -0
- /package/Components/BackgroundImage/{BackgroundImage.tv.web.tsx → BackgroundImage.tsx} +0 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
|
|
4
|
+
type Props = Record<string, any> & {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Creates the provider payload from the resolved runtime props.
|
|
10
|
+
* `children` is structural and is therefore excluded. `_dataKey` is produced
|
|
11
|
+
* by `configInflater` from the data mapping propName and identifies the prop
|
|
12
|
+
* that carries the resolved entry value.
|
|
13
|
+
*/
|
|
14
|
+
const createDataProviderProps = ({ children: _children, ...props }: Props) => ({
|
|
15
|
+
_dataKey: props._dataKey,
|
|
16
|
+
[props._dataKey as string]: props[props._dataKey as string],
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Merges provider values into an element's existing `dataProviderProps`
|
|
21
|
+
* without overwriting keys that were supplied explicitly.
|
|
22
|
+
*/
|
|
23
|
+
const mergeDataProviderProps = (
|
|
24
|
+
targetProps: Record<string, unknown>,
|
|
25
|
+
forwardedProps: Record<string, unknown>
|
|
26
|
+
) => {
|
|
27
|
+
const dataProviderProps = Object.keys(forwardedProps).reduce(
|
|
28
|
+
(acc, key) => {
|
|
29
|
+
if (typeof acc[key] === "undefined") {
|
|
30
|
+
acc[key] = forwardedProps[key];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return acc;
|
|
34
|
+
},
|
|
35
|
+
{ ...(targetProps.dataProviderProps as Record<string, unknown>) } as Record<
|
|
36
|
+
string,
|
|
37
|
+
unknown
|
|
38
|
+
>
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
dataProviderProps: dataProviderProps,
|
|
43
|
+
...(targetProps[dataProviderProps._dataKey as string] === undefined
|
|
44
|
+
? {
|
|
45
|
+
[dataProviderProps._dataKey as string]:
|
|
46
|
+
forwardedProps[dataProviderProps._dataKey as string],
|
|
47
|
+
}
|
|
48
|
+
: {}),
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Applies the provider props to the wrapped child's direct children only.
|
|
54
|
+
* The shallow stop is intentional: descendants below this level must receive
|
|
55
|
+
* data explicitly from their parent component instead of implicit propagation.
|
|
56
|
+
*/
|
|
57
|
+
const cloneSecondLevel = (
|
|
58
|
+
nodes: React.ReactNode,
|
|
59
|
+
forwardedProps: Record<string, unknown>
|
|
60
|
+
) =>
|
|
61
|
+
React.Children.map(nodes, (child) => {
|
|
62
|
+
if (!React.isValidElement(child)) {
|
|
63
|
+
return child;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (child.type === View) {
|
|
67
|
+
return child;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return React.cloneElement(
|
|
71
|
+
child,
|
|
72
|
+
mergeDataProviderProps(
|
|
73
|
+
child.props as Record<string, unknown>,
|
|
74
|
+
forwardedProps
|
|
75
|
+
) as never
|
|
76
|
+
);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Specification:
|
|
81
|
+
* `DataProvider` bridges MasterCell node-tree `data` mappings into runtime
|
|
82
|
+
* React props for a shallow wrapped subtree under `dataProviderProps`.
|
|
83
|
+
*
|
|
84
|
+
* Purpose:
|
|
85
|
+
* Use `DataProvider` when a subtree root and that root's direct children must
|
|
86
|
+
* receive the same resolved runtime prop without propagating that prop deeper
|
|
87
|
+
* into the tree.
|
|
88
|
+
*
|
|
89
|
+
* Input contract:
|
|
90
|
+
* - `DataProvider` receives runtime props from normal MasterCell inflation.
|
|
91
|
+
* - The values under `dataProviderProps` are derived from the resolved props
|
|
92
|
+
* it receives.
|
|
93
|
+
* - The inner keys are not hardcoded and may include `entry`, `item`, or any
|
|
94
|
+
* other prop name produced by the node-tree `data` mapping.
|
|
95
|
+
*
|
|
96
|
+
* Forwarding contract:
|
|
97
|
+
* - inject the mapped value as a direct prop on the wrapped child
|
|
98
|
+
* - inject `dataProviderProps` into the wrapped child
|
|
99
|
+
* - inject both the direct prop and `dataProviderProps` into that child's
|
|
100
|
+
* direct children
|
|
101
|
+
* - stop at that level
|
|
102
|
+
* - do not overwrite explicit keys that already exist inside
|
|
103
|
+
* `dataProviderProps` on wrapped elements
|
|
104
|
+
*
|
|
105
|
+
* Non-forwarded props:
|
|
106
|
+
* - `children`
|
|
107
|
+
*
|
|
108
|
+
* Example:
|
|
109
|
+
*
|
|
110
|
+
* ```ts
|
|
111
|
+
* {
|
|
112
|
+
* type: "DataProvider",
|
|
113
|
+
* data: [
|
|
114
|
+
* {
|
|
115
|
+
* func: "identity",
|
|
116
|
+
* args: [],
|
|
117
|
+
* propName: "entry",
|
|
118
|
+
* },
|
|
119
|
+
* ],
|
|
120
|
+
* elements: [
|
|
121
|
+
* {
|
|
122
|
+
* type: "ButtonContainerView",
|
|
123
|
+
* elements: [Button({ ... })],
|
|
124
|
+
* },
|
|
125
|
+
* ],
|
|
126
|
+
* }
|
|
127
|
+
* ```
|
|
128
|
+
*
|
|
129
|
+
* Expected runtime result:
|
|
130
|
+
* - `ButtonContainerView` receives `entry` and `dataProviderProps.entry`
|
|
131
|
+
* - each direct `Button` child receives `entry` and `dataProviderProps.entry`
|
|
132
|
+
* - deeper descendants such as `Asset` or `TextLabel` do not receive
|
|
133
|
+
* `entry` or `dataProviderProps.entry` unless their parent passes it
|
|
134
|
+
* explicitly
|
|
135
|
+
*/
|
|
136
|
+
export const DataProvider = ({ children, ...props }: Props) => {
|
|
137
|
+
const forwardedProps = createDataProviderProps(props);
|
|
138
|
+
|
|
139
|
+
return (
|
|
140
|
+
<>
|
|
141
|
+
{React.Children.map(children, (child) => {
|
|
142
|
+
if (!React.isValidElement(child)) {
|
|
143
|
+
return child;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const injectedChildren = cloneSecondLevel(
|
|
147
|
+
child.props.children,
|
|
148
|
+
forwardedProps
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
return React.cloneElement(child, {
|
|
152
|
+
...mergeDataProviderProps(
|
|
153
|
+
child.props as Record<string, unknown>,
|
|
154
|
+
forwardedProps
|
|
155
|
+
),
|
|
156
|
+
...(typeof injectedChildren !== "undefined"
|
|
157
|
+
? { children: injectedChildren }
|
|
158
|
+
: {}),
|
|
159
|
+
});
|
|
160
|
+
})}
|
|
161
|
+
</>
|
|
162
|
+
);
|
|
163
|
+
};
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View, ImageStyle } from "react-native";
|
|
3
3
|
import { Focusable } from "@applicaster/zapp-react-native-ui-components/Components/Focusable";
|
|
4
|
-
import { useActions } from "@applicaster/zapp-react-native-utils/reactHooks/actions";
|
|
5
|
-
import { getXray } from "@applicaster/zapp-react-native-utils/logger";
|
|
6
4
|
import { useFocusable } from "@applicaster/zapp-react-native-ui-components/Components/Focusable/index.android";
|
|
7
5
|
import { useIsRTL } from "@applicaster/zapp-react-native-utils/localizationUtils";
|
|
8
6
|
|
|
9
|
-
const { Logger } = getXray();
|
|
10
|
-
|
|
11
7
|
import { recursiveCloneElementsWithState } from "../../utils";
|
|
12
8
|
|
|
13
|
-
const logger = new Logger("plugin", "plugins/navigation-action");
|
|
14
|
-
|
|
15
9
|
type ButtonProps = Record<string, any> & {
|
|
16
10
|
style: ImageStyle;
|
|
17
11
|
};
|
|
@@ -33,7 +27,7 @@ const getNextFocusRight = ({ nextFocusRight, parentFocus, isRTL }) => {
|
|
|
33
27
|
};
|
|
34
28
|
|
|
35
29
|
export function FocusableViewComponent(
|
|
36
|
-
{ style, children,
|
|
30
|
+
{ style, children, ...otherProps }: ButtonProps,
|
|
37
31
|
ref
|
|
38
32
|
) {
|
|
39
33
|
const {
|
|
@@ -44,7 +38,6 @@ export function FocusableViewComponent(
|
|
|
44
38
|
focusedStyles,
|
|
45
39
|
nextFocusLeft,
|
|
46
40
|
nextFocusRight,
|
|
47
|
-
pluginIdentifier,
|
|
48
41
|
disableFocus,
|
|
49
42
|
onButtonFocus,
|
|
50
43
|
} = otherProps;
|
|
@@ -52,20 +45,6 @@ export function FocusableViewComponent(
|
|
|
52
45
|
const parentFocus = useFocusable();
|
|
53
46
|
const isRTL = useIsRTL();
|
|
54
47
|
|
|
55
|
-
const actionContext = useActions(pluginIdentifier);
|
|
56
|
-
|
|
57
|
-
const onPress = () => {
|
|
58
|
-
if (!actionContext) {
|
|
59
|
-
logger.warning(
|
|
60
|
-
`Cannot resolve action context for ${pluginIdentifier} - please make sure the plugin is installed and up to date`
|
|
61
|
-
);
|
|
62
|
-
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
actionContext?.invokeAction?.(item);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
48
|
const onFocus = React.useCallback(
|
|
70
49
|
(ref) => {
|
|
71
50
|
onButtonFocus?.(ref);
|
|
@@ -82,7 +61,7 @@ export function FocusableViewComponent(
|
|
|
82
61
|
id={generateId(cellUUID, suffixId)}
|
|
83
62
|
disableFocus={disableFocus}
|
|
84
63
|
groupId={groupId}
|
|
85
|
-
onPress={onPress}
|
|
64
|
+
onPress={otherProps.onPress}
|
|
86
65
|
nextFocusUp={parentFocus?.nextFocusUp}
|
|
87
66
|
nextFocusDown={parentFocus?.nextFocusDown}
|
|
88
67
|
nextFocusLeft={getNextFocusLeft({ nextFocusLeft, parentFocus, isRTL })}
|
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
import React, { useMemo } from "react";
|
|
2
2
|
import { ImageStyle } from "react-native";
|
|
3
3
|
import { Focusable } from "@applicaster/zapp-react-native-ui-components/Components/Focusable";
|
|
4
|
-
import { useActions } from "@applicaster/zapp-react-native-utils/reactHooks/actions";
|
|
5
|
-
import { getXray } from "@applicaster/zapp-react-native-utils/logger";
|
|
6
4
|
import { toBooleanWithDefaultFalse } from "@applicaster/zapp-react-native-utils/booleanUtils";
|
|
7
5
|
|
|
8
|
-
const { Logger } = getXray();
|
|
9
|
-
|
|
10
6
|
import {
|
|
11
7
|
recursiveCloneElementsWithState,
|
|
12
8
|
getFocusedButtonId,
|
|
13
9
|
} from "../../utils";
|
|
14
10
|
|
|
15
|
-
const logger = new Logger("plugin", "plugins/navigation-action");
|
|
16
|
-
|
|
17
11
|
type Props = Record<string, any> & {
|
|
18
12
|
style: ImageStyle;
|
|
19
13
|
};
|
|
20
14
|
|
|
21
15
|
const getFocusableId = (prefixId, suffixId) => `${prefixId}___${suffixId}`;
|
|
22
16
|
|
|
23
|
-
export function FocusableView({ style, children,
|
|
17
|
+
export function FocusableView({ style, children, ...otherProps }: Props) {
|
|
24
18
|
const {
|
|
25
19
|
groupId,
|
|
26
20
|
prefixId,
|
|
@@ -29,7 +23,6 @@ export function FocusableView({ style, children, item, ...otherProps }: Props) {
|
|
|
29
23
|
focusedButtonId,
|
|
30
24
|
normalStyles,
|
|
31
25
|
focusedStyles,
|
|
32
|
-
pluginIdentifier,
|
|
33
26
|
preferredFocus,
|
|
34
27
|
} = otherProps;
|
|
35
28
|
|
|
@@ -41,20 +34,9 @@ export function FocusableView({ style, children, item, ...otherProps }: Props) {
|
|
|
41
34
|
|
|
42
35
|
const additionalStyles = focused ? focusedStyles : normalStyles;
|
|
43
36
|
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
const onPress = (event) => {
|
|
37
|
+
const handlePress = (event) => {
|
|
47
38
|
event?.preventDefault?.();
|
|
48
|
-
|
|
49
|
-
if (!actionContext) {
|
|
50
|
-
logger.warning(
|
|
51
|
-
`Cannot resolve action context for ${pluginIdentifier} - please make sure the plugin is installed and up to date`
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
actionContext?.invokeAction?.(item);
|
|
39
|
+
otherProps?.onPress?.(event);
|
|
58
40
|
};
|
|
59
41
|
|
|
60
42
|
const handleFocus = (focusable) => {
|
|
@@ -83,7 +65,7 @@ export function FocusableView({ style, children, item, ...otherProps }: Props) {
|
|
|
83
65
|
style={styles}
|
|
84
66
|
onFocus={handleFocus}
|
|
85
67
|
onBlur={handleBlur}
|
|
86
|
-
onPress={
|
|
68
|
+
onPress={handlePress}
|
|
87
69
|
preferredFocus={preferredFocus}
|
|
88
70
|
skipFocusManagerRegistration={otherProps.skipFocusManagerRegistration}
|
|
89
71
|
isFocusable={otherProps.isFocusable}
|
|
@@ -24,7 +24,9 @@ const MemoizedImage = React.memo(QBImage, R.equals);
|
|
|
24
24
|
const isValidExternalSource = (source): boolean =>
|
|
25
25
|
source?.uri?.startsWith("http") ||
|
|
26
26
|
source?.uri?.startsWith("data:image") ||
|
|
27
|
-
source?.uri?.startsWith("file://")
|
|
27
|
+
source?.uri?.startsWith("file://") ||
|
|
28
|
+
source?.uri?.startsWith("asset:/") ||
|
|
29
|
+
source?.uri?.startsWith("node_modules_");
|
|
28
30
|
|
|
29
31
|
export default function Image({
|
|
30
32
|
style,
|
|
@@ -32,6 +34,7 @@ export default function Image({
|
|
|
32
34
|
placeholderImage,
|
|
33
35
|
entry,
|
|
34
36
|
withDimensions,
|
|
37
|
+
source: sourceProp,
|
|
35
38
|
...otherProps
|
|
36
39
|
}: Props) {
|
|
37
40
|
const [showDefault, setShowDefault] = React.useState(false);
|
|
@@ -48,7 +51,10 @@ export default function Image({
|
|
|
48
51
|
entry,
|
|
49
52
|
showDefault,
|
|
50
53
|
placeholderImage: placeholderImage || "",
|
|
51
|
-
otherProps
|
|
54
|
+
otherProps: {
|
|
55
|
+
source: sourceProp,
|
|
56
|
+
state: otherProps.state,
|
|
57
|
+
},
|
|
52
58
|
});
|
|
53
59
|
|
|
54
60
|
const onError = React.useCallback(() => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Image as RnImage, ImageStyle } from "react-native";
|
|
3
|
-
import { equals, omit } from "ramda";
|
|
4
3
|
|
|
5
4
|
import { useImageSource } from "./hooks";
|
|
5
|
+
import { equals } from "@applicaster/zapp-react-native-utils/utils";
|
|
6
6
|
|
|
7
7
|
type Source = {
|
|
8
8
|
uri: string;
|
|
@@ -25,11 +25,19 @@ function Image({
|
|
|
25
25
|
placeholderImage,
|
|
26
26
|
entry,
|
|
27
27
|
withDimensions,
|
|
28
|
+
source: sourceProp,
|
|
28
29
|
...otherProps
|
|
29
30
|
}: Props) {
|
|
30
31
|
const [error, setErrorState] = React.useState(null);
|
|
31
32
|
|
|
32
|
-
const source = useImageSource({
|
|
33
|
+
const source = useImageSource({
|
|
34
|
+
uri,
|
|
35
|
+
entry,
|
|
36
|
+
otherProps: {
|
|
37
|
+
source: sourceProp,
|
|
38
|
+
state: otherProps.state,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
33
41
|
|
|
34
42
|
React.useEffect(() => {
|
|
35
43
|
// reset error state on URI change as the error is referencing previous uri
|
|
@@ -49,7 +57,7 @@ function Image({
|
|
|
49
57
|
onError={React.useCallback(() => setErrorState(true), [])}
|
|
50
58
|
// as we have defaults as "" for placeholder image, we need to pass undefined to source to not throw warnings
|
|
51
59
|
source={_source?.uri ? _source : undefined}
|
|
52
|
-
{...
|
|
60
|
+
{...otherProps}
|
|
53
61
|
/>
|
|
54
62
|
);
|
|
55
63
|
}
|
|
@@ -23,9 +23,17 @@ function Image({
|
|
|
23
23
|
placeholderImage,
|
|
24
24
|
entry,
|
|
25
25
|
withDimensions,
|
|
26
|
+
source: sourceProp,
|
|
26
27
|
...otherProps
|
|
27
28
|
}: Props) {
|
|
28
|
-
const source = useImageSource({
|
|
29
|
+
const source = useImageSource({
|
|
30
|
+
uri,
|
|
31
|
+
entry,
|
|
32
|
+
otherProps: {
|
|
33
|
+
source: sourceProp,
|
|
34
|
+
state: otherProps.state,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
29
37
|
|
|
30
38
|
const updatedSource = source ? withDimensions(source) : { uri: "" };
|
|
31
39
|
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { path } from "ramda";
|
|
3
2
|
|
|
4
3
|
import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
5
4
|
import { useActions } from "@applicaster/zapp-react-native-utils/reactHooks/actions";
|
|
6
5
|
import { extractAsset } from "./utils";
|
|
7
6
|
|
|
8
7
|
type Return = { uri: string } | null;
|
|
8
|
+
type Source = { context?: string; uri?: string } | null | undefined;
|
|
9
9
|
|
|
10
|
-
const getSourceContext =
|
|
11
|
-
const getSourceUri =
|
|
12
|
-
const getState = path(["state"]);
|
|
10
|
+
const getSourceContext = (source: Source) => source?.context;
|
|
11
|
+
const getSourceUri = (source: Source) => source?.uri;
|
|
13
12
|
|
|
14
|
-
export const useImageSource = ({
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
export const useImageSource = ({
|
|
14
|
+
uri,
|
|
15
|
+
entry,
|
|
16
|
+
otherProps: { source, state: uriState },
|
|
17
|
+
}): Return => {
|
|
18
|
+
const uriContext = getSourceContext(source);
|
|
17
19
|
|
|
18
20
|
const action = useActions(uriContext);
|
|
19
21
|
|
|
@@ -38,7 +40,7 @@ export const useImageSource = ({ uri, entry, otherProps }): Return => {
|
|
|
38
40
|
return { uri };
|
|
39
41
|
}
|
|
40
42
|
|
|
41
|
-
const uriFromSource = getSourceUri(
|
|
43
|
+
const uriFromSource = getSourceUri(source);
|
|
42
44
|
|
|
43
45
|
if (uriFromSource) {
|
|
44
46
|
return { uri: uriFromSource };
|
|
@@ -47,7 +49,7 @@ export const useImageSource = ({ uri, entry, otherProps }): Return => {
|
|
|
47
49
|
return null;
|
|
48
50
|
};
|
|
49
51
|
|
|
50
|
-
const getSource = (uri, showDefault, placeholderImage,
|
|
52
|
+
const getSource = (uri, showDefault, placeholderImage, source) => {
|
|
51
53
|
const placeholderName = placeholderImage || "";
|
|
52
54
|
|
|
53
55
|
const defaultPath = {
|
|
@@ -60,7 +62,7 @@ const getSource = (uri, showDefault, placeholderImage, otherProps) => {
|
|
|
60
62
|
return { uri };
|
|
61
63
|
}
|
|
62
64
|
|
|
63
|
-
const uriFromSource = getSourceUri(
|
|
65
|
+
const uriFromSource = getSourceUri(source);
|
|
64
66
|
|
|
65
67
|
if (uriFromSource) {
|
|
66
68
|
return { uri: uriFromSource };
|
|
@@ -74,10 +76,9 @@ export const useImageSourceWithDefault = ({
|
|
|
74
76
|
entry,
|
|
75
77
|
showDefault,
|
|
76
78
|
placeholderImage,
|
|
77
|
-
otherProps,
|
|
79
|
+
otherProps: { state: uriState, source },
|
|
78
80
|
}): Return => {
|
|
79
|
-
const uriContext = getSourceContext(
|
|
80
|
-
const uriState = getState(otherProps);
|
|
81
|
+
const uriContext = getSourceContext(source);
|
|
81
82
|
|
|
82
83
|
const action = useActions(uriContext);
|
|
83
84
|
|
|
@@ -98,5 +99,5 @@ export const useImageSourceWithDefault = ({
|
|
|
98
99
|
return extractAsset(!isTV(), entryStateLocal.asset, uriState);
|
|
99
100
|
}
|
|
100
101
|
|
|
101
|
-
return getSource(uri, showDefault, placeholderImage,
|
|
102
|
+
return getSource(uri, showDefault, placeholderImage, source);
|
|
102
103
|
};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { PropsWithChildren } from "react";
|
|
2
2
|
import { isVideoPreviewEnabled } from "@applicaster/zapp-react-native-ui-components/Components/MasterCell/utils";
|
|
3
3
|
import { LiveImage } from "../LiveImage";
|
|
4
4
|
import PureImage from "../Image";
|
|
5
5
|
import { useIsScreenActive } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
6
6
|
|
|
7
|
-
type Props = {
|
|
7
|
+
type Props = PropsWithChildren<{
|
|
8
8
|
enable_video_preview: boolean;
|
|
9
9
|
player_screen_id: string;
|
|
10
|
-
|
|
10
|
+
uri?: string;
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}>;
|
|
11
13
|
|
|
12
14
|
export const ImageContainer = (props: Props) => {
|
|
13
15
|
const isActive = useIsScreenActive();
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import merge from "
|
|
3
|
-
import { clone } from "@applicaster/zapp-react-native-utils/utils";
|
|
2
|
+
import { merge, clone } from "@applicaster/zapp-react-native-utils/utils";
|
|
4
3
|
import { Platform, View, ViewStyle } from "react-native";
|
|
5
4
|
import { appStore } from "@applicaster/zapp-react-native-redux/AppStore";
|
|
6
5
|
import { isTV, isWeb } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React, { useCallback } from "react";
|
|
2
|
+
import { Pressable, ViewStyle } from "react-native";
|
|
3
|
+
import { PressedStateContext } from "../contexts/PressedStateContext";
|
|
4
|
+
|
|
5
|
+
type Props = {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
style?: ViewStyle | ViewStyle[];
|
|
8
|
+
pressedStyle?: ViewStyle | ViewStyle[];
|
|
9
|
+
testID?: string;
|
|
10
|
+
accessibilityLabel?: string;
|
|
11
|
+
accessibilityHint?: string;
|
|
12
|
+
onPress?: () => void;
|
|
13
|
+
testOnly_pressed?: boolean;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export function PressableView({
|
|
17
|
+
children,
|
|
18
|
+
style,
|
|
19
|
+
testID,
|
|
20
|
+
accessibilityLabel,
|
|
21
|
+
accessibilityHint,
|
|
22
|
+
pressedStyle,
|
|
23
|
+
onPress,
|
|
24
|
+
testOnly_pressed = false,
|
|
25
|
+
}: Props) {
|
|
26
|
+
return (
|
|
27
|
+
<Pressable
|
|
28
|
+
testOnly_pressed={testOnly_pressed}
|
|
29
|
+
onPress={onPress}
|
|
30
|
+
testID={testID}
|
|
31
|
+
accessibilityLabel={accessibilityLabel}
|
|
32
|
+
accessibilityHint={accessibilityHint}
|
|
33
|
+
accessible={!!(testID || accessibilityLabel)}
|
|
34
|
+
style={useCallback(
|
|
35
|
+
({ pressed }) => [
|
|
36
|
+
style,
|
|
37
|
+
pressed && {
|
|
38
|
+
opacity: 1,
|
|
39
|
+
},
|
|
40
|
+
pressed && pressedStyle,
|
|
41
|
+
],
|
|
42
|
+
[style, pressedStyle]
|
|
43
|
+
)}
|
|
44
|
+
>
|
|
45
|
+
{({ pressed }) => {
|
|
46
|
+
return (
|
|
47
|
+
<PressedStateContext.Provider value={pressed}>
|
|
48
|
+
{children}
|
|
49
|
+
</PressedStateContext.Provider>
|
|
50
|
+
);
|
|
51
|
+
}}
|
|
52
|
+
</Pressable>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { isNil } from "ramda";
|
|
3
|
-
import {
|
|
3
|
+
import { ViewStyle } from "react-native";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from "@applicaster/zapp-react-native-utils/manifestUtils/secondaryImage";
|
|
9
|
-
import { QBImage as Image } from "@applicaster/zapp-react-native-ui-components/Components/Image";
|
|
5
|
+
SecondaryImage as UIKitSecondaryImage,
|
|
6
|
+
UIKitSecondaryImageProps,
|
|
7
|
+
} from "@applicaster/uikit";
|
|
10
8
|
|
|
11
9
|
import { useGetImageDimensions } from "./hooks";
|
|
12
10
|
import {
|
|
13
11
|
DisplayMode,
|
|
14
|
-
|
|
12
|
+
FitPosition,
|
|
13
|
+
ImageSizing,
|
|
15
14
|
isDisplayModeFixed,
|
|
16
15
|
isImageSizingFit,
|
|
17
16
|
} from "./utils";
|
|
@@ -20,9 +19,9 @@ import { withAsyncRenderHOC } from "../../hoc/withAsyncRender";
|
|
|
20
19
|
interface Props {
|
|
21
20
|
displayMode: DisplayMode;
|
|
22
21
|
uri: Nullable<string>;
|
|
23
|
-
style:
|
|
24
|
-
imageSizing:
|
|
25
|
-
fitPosition:
|
|
22
|
+
style: ViewStyle;
|
|
23
|
+
imageSizing: ImageSizing;
|
|
24
|
+
fitPosition: FitPosition;
|
|
26
25
|
fixedWidth: number;
|
|
27
26
|
fixedHeight: number;
|
|
28
27
|
onAsyncRender?: () => void;
|
|
@@ -31,8 +30,17 @@ interface Props {
|
|
|
31
30
|
/** Secondary Image Dynamic does not render until the image is loaded */
|
|
32
31
|
const SecondaryImageDynamic = withAsyncRenderHOC(
|
|
33
32
|
(props: Props & { onAsyncRender: () => void }) => {
|
|
34
|
-
const {
|
|
35
|
-
|
|
33
|
+
const {
|
|
34
|
+
uri,
|
|
35
|
+
style,
|
|
36
|
+
displayMode,
|
|
37
|
+
imageSizing,
|
|
38
|
+
fitPosition,
|
|
39
|
+
onAsyncRender,
|
|
40
|
+
fixedHeight: _fixedHeight,
|
|
41
|
+
fixedWidth: _fixedWidth,
|
|
42
|
+
...imageProps
|
|
43
|
+
} = props;
|
|
36
44
|
|
|
37
45
|
const imageDimension = useGetImageDimensions(
|
|
38
46
|
uri,
|
|
@@ -49,24 +57,18 @@ const SecondaryImageDynamic = withAsyncRenderHOC(
|
|
|
49
57
|
}
|
|
50
58
|
|
|
51
59
|
return (
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}),
|
|
65
|
-
borderRadius: style.borderRadius,
|
|
66
|
-
aspectRatio: imageDimension.aspectRatio,
|
|
67
|
-
}}
|
|
68
|
-
/>
|
|
69
|
-
</View>
|
|
60
|
+
<UIKitSecondaryImage
|
|
61
|
+
{...imageProps}
|
|
62
|
+
uri={uri}
|
|
63
|
+
style={style as UIKitSecondaryImageProps["style"]}
|
|
64
|
+
displayMode={displayMode}
|
|
65
|
+
imageSizing={imageSizing}
|
|
66
|
+
fitPosition={fitPosition}
|
|
67
|
+
width={containerWidth as number}
|
|
68
|
+
height={containerHeight}
|
|
69
|
+
imageDimension={imageDimension}
|
|
70
|
+
onAsyncRender={onAsyncRender}
|
|
71
|
+
/>
|
|
70
72
|
);
|
|
71
73
|
}
|
|
72
74
|
);
|
|
@@ -81,6 +83,8 @@ const SecondaryImageFixed = (props: Props) => {
|
|
|
81
83
|
fitPosition,
|
|
82
84
|
fixedHeight,
|
|
83
85
|
fixedWidth,
|
|
86
|
+
onAsyncRender: _onAsyncRender,
|
|
87
|
+
...imageProps
|
|
84
88
|
} = props;
|
|
85
89
|
|
|
86
90
|
const imageDimension = useGetImageDimensions(
|
|
@@ -90,26 +94,18 @@ const SecondaryImageFixed = (props: Props) => {
|
|
|
90
94
|
);
|
|
91
95
|
|
|
92
96
|
return (
|
|
93
|
-
<
|
|
94
|
-
{
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
containerWidth: fixedWidth,
|
|
106
|
-
}),
|
|
107
|
-
borderRadius: style.borderRadius,
|
|
108
|
-
aspectRatio: imageDimension.aspectRatio,
|
|
109
|
-
}}
|
|
110
|
-
/>
|
|
111
|
-
)}
|
|
112
|
-
</View>
|
|
97
|
+
<UIKitSecondaryImage
|
|
98
|
+
{...imageProps}
|
|
99
|
+
uri={uri}
|
|
100
|
+
style={style as UIKitSecondaryImageProps["style"]}
|
|
101
|
+
displayMode={displayMode}
|
|
102
|
+
imageSizing={imageSizing}
|
|
103
|
+
fitPosition={fitPosition}
|
|
104
|
+
width={fixedWidth}
|
|
105
|
+
height={fixedHeight}
|
|
106
|
+
imageDimension={imageDimension}
|
|
107
|
+
testID="secondary-image-fixed"
|
|
108
|
+
/>
|
|
113
109
|
);
|
|
114
110
|
};
|
|
115
111
|
|