@namiml/expo-sdk 3.4.6-dev.202607162357 → 3.4.6-dev.202607170209

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@namiml/expo-sdk",
3
- "version": "3.4.6-dev.202607162357",
3
+ "version": "3.4.6-dev.202607170209",
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.6-dev.202607162357",
33
- "@namiml/sdk-core": "3.4.6-dev.202607162357",
32
+ "@namiml/expo-nami-iap": "3.4.6-dev.202607170209",
33
+ "@namiml/sdk-core": "3.4.6-dev.202607170209",
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"
@@ -3,6 +3,7 @@ import { Image as RNImage, View } from 'react-native';
3
3
  import { applyStyles, parseSizeOrPercent } from '../../utils/styles';
4
4
  import { usePaywallContext } from '../../context/PaywallContext';
5
5
  import { buildSmartTextReplacements, interpolateSmartText } from '../../utils/smartText';
6
+ import { getImageAccessibilityProps } from './imageAccessibility';
6
7
 
7
8
  // Prefer expo-image when available; fall back to react-native Image
8
9
  let ImageComponent: typeof RNImage;
@@ -146,6 +147,10 @@ export const NamiImage: React.FC<Props> = ({ component, scaleFactor, parentDirec
146
147
  applyLoadedSource(event?.source);
147
148
  }, [applyLoadedSource]);
148
149
 
150
+ // NAM-1450: non-blank alt exposes the image to screen readers; otherwise the
151
+ // RN default accessible={false} keeps it decorative.
152
+ const accessibilityProps = getImageAccessibilityProps(component);
153
+
149
154
  return (
150
155
  <View style={containerStyle} pointerEvents="none">
151
156
  {shouldUseNativeEdgeFit ? (
@@ -155,6 +160,7 @@ export const NamiImage: React.FC<Props> = ({ component, scaleFactor, parentDirec
155
160
  blurRadius={component.blur}
156
161
  onLoad={shouldUseNativeEdgeFit ? onNativeImageLoad : undefined}
157
162
  resizeMode={contentFit}
163
+ {...accessibilityProps}
158
164
  />
159
165
  ) : (
160
166
  <ImageComponent
@@ -164,6 +170,7 @@ export const NamiImage: React.FC<Props> = ({ component, scaleFactor, parentDirec
164
170
  onLoad={shouldUseNativeEdgeFit ? onExpoImageLoad : undefined}
165
171
  {...(supportsContentPosition ? { contentPosition } : {})}
166
172
  {...(supportsContentFit ? { contentFit } : { resizeMode: contentFit })}
173
+ {...accessibilityProps}
167
174
  />
168
175
  )}
169
176
  </View>
@@ -0,0 +1,19 @@
1
+ /**
2
+ * NAM-1450: accessibility props for the paywall image element (WCAG 1.1.1).
3
+ *
4
+ * A non-blank `alt` on the template's image component opts the image into screen
5
+ * reader exposure: accessible element, image role, label = alt (raw — no smart-text,
6
+ * matching the Web SDK's `<img alt>` handling). Anything else keeps RN's default
7
+ * `accessible={false}`, i.e. the image stays decorative.
8
+ *
9
+ * RN-free module so the jest node environment can unit-test it (see
10
+ * tests/components/elements/textInputStyle.test.ts for the pattern).
11
+ */
12
+ export const getImageAccessibilityProps = (
13
+ component: unknown,
14
+ ): { accessible: true; accessibilityRole: 'image'; accessibilityLabel: string } | Record<string, never> => {
15
+ const alt = (component as { alt?: unknown } | null | undefined)?.alt;
16
+ const trimmed = typeof alt === 'string' ? alt.trim() : '';
17
+ if (!trimmed) return {};
18
+ return { accessible: true, accessibilityRole: 'image', accessibilityLabel: trimmed };
19
+ };