@namiml/expo-sdk 3.4.4-dev.202607010315 → 3.4.4-dev.202607012039
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/dist/index.cjs +8 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +8 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/components/containers/NamiBackgroundContainer.tsx +10 -2
- package/src/components/containers/NamiContainer.tsx +9 -2
- package/src/components/elements/NamiButton.tsx +5 -2
- package/src/utils/styles.ts +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@namiml/expo-sdk",
|
|
3
|
-
"version": "3.4.4-dev.
|
|
3
|
+
"version": "3.4.4-dev.202607012039",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Nami Expo SDK — paywall and subscription management for Expo apps",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"prepublishOnly": "yarn clean && yarn build:prod"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@namiml/expo-nami-iap": "3.4.4-dev.
|
|
33
|
-
"@namiml/sdk-core": "3.4.4-dev.
|
|
32
|
+
"@namiml/expo-nami-iap": "3.4.4-dev.202607012039",
|
|
33
|
+
"@namiml/sdk-core": "3.4.4-dev.202607012039",
|
|
34
34
|
"react-native-qrcode-svg": "^6.3.21",
|
|
35
35
|
"react-native-safe-area-context": "^5.6.0",
|
|
36
36
|
"react-native-svg": "^15.15.4"
|
|
@@ -20,6 +20,14 @@ export const NamiBackgroundContainer: React.FC<Props> = ({ component, scaleFacto
|
|
|
20
20
|
|
|
21
21
|
const fillImageUrl = resolveFillImageUrl(component.fillImage);
|
|
22
22
|
const bgColor = parseColor(component.fillColor) ?? parseColor(component.fillColorFallback);
|
|
23
|
+
// Only clip when the container is a filled "tile" with specific (non-all-corners)
|
|
24
|
+
// rounding (NAM-1798); all-corners / unrounded filled containers stay unclipped so
|
|
25
|
+
// NC-3948 / NAM-1201 over-rounding is not reintroduced. Matches the Apple/Web gate.
|
|
26
|
+
const roundBorders = component.roundBorders;
|
|
27
|
+
const hasSpecificCorners =
|
|
28
|
+
Array.isArray(roundBorders) && roundBorders.length > 0 && roundBorders.length < 4;
|
|
29
|
+
const clipStyle: ViewStyle =
|
|
30
|
+
(component.fillColor || component.fillImage) && hasSpecificCorners ? { overflow: 'hidden' } : {};
|
|
23
31
|
|
|
24
32
|
const direction = component.direction ?? 'vertical';
|
|
25
33
|
const content = (
|
|
@@ -52,7 +60,7 @@ export const NamiBackgroundContainer: React.FC<Props> = ({ component, scaleFacto
|
|
|
52
60
|
<ImageBackground
|
|
53
61
|
source={{ uri: fillImageUrl }}
|
|
54
62
|
resizeMode='cover'
|
|
55
|
-
style={[containerStyle, styles.background]}
|
|
63
|
+
style={[containerStyle, styles.background, clipStyle]}
|
|
56
64
|
>
|
|
57
65
|
{content}
|
|
58
66
|
</ImageBackground>
|
|
@@ -60,7 +68,7 @@ export const NamiBackgroundContainer: React.FC<Props> = ({ component, scaleFacto
|
|
|
60
68
|
}
|
|
61
69
|
|
|
62
70
|
return (
|
|
63
|
-
<View style={[containerStyle, bgColor ? { backgroundColor: bgColor } : null, styles.background]}>
|
|
71
|
+
<View style={[containerStyle, bgColor ? { backgroundColor: bgColor } : null, styles.background, clipStyle]}>
|
|
64
72
|
{content}
|
|
65
73
|
</View>
|
|
66
74
|
);
|
|
@@ -211,7 +211,14 @@ export const NamiContainer: React.FC<Props> = ({
|
|
|
211
211
|
const Wrapper = component.onTap ? Pressable : View;
|
|
212
212
|
|
|
213
213
|
const radiusStyles = pickBorderRadius(containerStyle);
|
|
214
|
-
|
|
214
|
+
// Only clip a filled "tile" with specific (non-all-corners) rounding so a moved
|
|
215
|
+
// image is cut off at the tile edge (NAM-1798). All-corners / unrounded filled
|
|
216
|
+
// containers stay unclipped so their overflowing content is not cut off and the
|
|
217
|
+
// NC-3948 / NAM-1201 over-rounding is not reintroduced. Matches the Apple/Web gate.
|
|
218
|
+
const roundBorders = component.roundBorders;
|
|
219
|
+
const hasSpecificCorners =
|
|
220
|
+
Array.isArray(roundBorders) && roundBorders.length > 0 && roundBorders.length < 4;
|
|
221
|
+
const shouldClip = Boolean(component.fillColor || component.fillImage) && hasSpecificCorners;
|
|
215
222
|
|
|
216
223
|
const wrapperStyle = [
|
|
217
224
|
styles.relative,
|
|
@@ -246,7 +253,7 @@ export const NamiContainer: React.FC<Props> = ({
|
|
|
246
253
|
<ImageBackground
|
|
247
254
|
source={{ uri: fillImageUrl }}
|
|
248
255
|
style={StyleSheet.absoluteFill}
|
|
249
|
-
imageStyle={
|
|
256
|
+
imageStyle={Object.keys(radiusStyles).length > 0 ? radiusStyles : undefined}
|
|
250
257
|
resizeMode={
|
|
251
258
|
component.fillImage?.imageCropping === 'fit' ? 'contain' : 'cover'
|
|
252
259
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useMemo, useRef } from 'react';
|
|
2
2
|
import { Pressable, ActivityIndicator, StyleSheet, View, Linking as RNLinking } from 'react-native';
|
|
3
3
|
import { useFirstFocusReadyContext, usePaywallContext } from '../../context/PaywallContext';
|
|
4
|
-
import { applyStyles, parseColor, childSpacingStyle, extractPrefixedStyles, focusedStyleOverrides, parseSize } from '../../utils/styles';
|
|
4
|
+
import { applyStyles, parseColor, childSpacingStyle, extractPrefixedStyles, focusedStyleOverrides, parseSize, buttonFlexDirection } from '../../utils/styles';
|
|
5
5
|
import {
|
|
6
6
|
handleAction,
|
|
7
7
|
shouldHoist,
|
|
@@ -200,6 +200,9 @@ export const NamiButton: React.FC<Props> = ({ component, scaleFactor, onClose, p
|
|
|
200
200
|
if (base.borderRadius != null) {
|
|
201
201
|
base.overflow = 'hidden';
|
|
202
202
|
}
|
|
203
|
+
// NAM-2417: a directionless button defaults to horizontal (row). applyStyles uses the
|
|
204
|
+
// shared flexDirectionFromConfig whose default is 'column'; override for buttons here.
|
|
205
|
+
base.flexDirection = buttonFlexDirection(component.direction);
|
|
203
206
|
return base;
|
|
204
207
|
}, [component, scaleFactor, disabled, backgroundColor, borderOverride, parentDirection, isFocused ]);
|
|
205
208
|
|
|
@@ -209,7 +212,7 @@ export const NamiButton: React.FC<Props> = ({ component, scaleFactor, onClose, p
|
|
|
209
212
|
component.sku?.id === (ctx.state as any).productBeingPurchased?.id;
|
|
210
213
|
const renderedChildren = useMemo(() => resolvedChildren.map((child: TComponent, i: number) => {
|
|
211
214
|
const resolvedChild = withDisabledChildStyles(child, disabled);
|
|
212
|
-
const buttonDirection = component.direction ?? "
|
|
215
|
+
const buttonDirection = component.direction ?? "horizontal";
|
|
213
216
|
const spacingStyle =
|
|
214
217
|
i === 0
|
|
215
218
|
? {}
|
package/src/utils/styles.ts
CHANGED
|
@@ -189,6 +189,12 @@ export function flexDirectionFromConfig(dir?: string): ViewStyle['flexDirection'
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
+
// NAM-2417: a directionless `button` component defaults to horizontal (icon left of
|
|
193
|
+
// label), unlike containers which default to vertical via flexDirectionFromConfig.
|
|
194
|
+
export function buttonFlexDirection(dir?: string): ViewStyle['flexDirection'] {
|
|
195
|
+
return flexDirectionFromConfig(dir ?? 'horizontal');
|
|
196
|
+
}
|
|
197
|
+
|
|
192
198
|
const ALIGNMENT_VALUE_MAP: Record<string, ViewStyle['alignItems']> = {
|
|
193
199
|
top: 'flex-start',
|
|
194
200
|
left: 'flex-start',
|