@namiml/expo-sdk 3.4.0-dev.202605060437
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 +4000 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +151 -0
- package/dist/index.mjs +3966 -0
- package/dist/index.mjs.map +1 -0
- package/nami-expo-nami-iap.tgz +0 -0
- package/package.json +92 -0
- package/src/adapters/expo-device.adapter.ts +106 -0
- package/src/adapters/expo-purchase.adapter.ts +79 -0
- package/src/adapters/expo-storage.adapter.ts +92 -0
- package/src/adapters/expo-ui.adapter.ts +57 -0
- package/src/adapters/index.ts +33 -0
- package/src/amazon-kepler.d.ts +7 -0
- package/src/components/NamiView.tsx +1006 -0
- package/src/components/PaywallScreen.tsx +245 -0
- package/src/components/TemplateRenderer.tsx +243 -0
- package/src/components/containers/NamiBackgroundContainer.tsx +103 -0
- package/src/components/containers/NamiCarousel.tsx +217 -0
- package/src/components/containers/NamiCollapseContainer.tsx +116 -0
- package/src/components/containers/NamiContainer.tsx +315 -0
- package/src/components/containers/NamiContentContainer.tsx +140 -0
- package/src/components/containers/NamiFooter.tsx +35 -0
- package/src/components/containers/NamiHeader.tsx +45 -0
- package/src/components/containers/NamiProductContainer.tsx +248 -0
- package/src/components/containers/NamiRepeatingGrid.tsx +81 -0
- package/src/components/containers/NamiResponsiveGrid.tsx +75 -0
- package/src/components/containers/NamiStack.tsx +69 -0
- package/src/components/elements/NamiButton.tsx +285 -0
- package/src/components/elements/NamiCountdownTimer.tsx +123 -0
- package/src/components/elements/NamiImage.tsx +177 -0
- package/src/components/elements/NamiPlayPauseButton.tsx +93 -0
- package/src/components/elements/NamiProgressBar.tsx +90 -0
- package/src/components/elements/NamiProgressIndicator.tsx +41 -0
- package/src/components/elements/NamiQRCode.tsx +51 -0
- package/src/components/elements/NamiRadioButton.tsx +62 -0
- package/src/components/elements/NamiSegmentPicker.tsx +67 -0
- package/src/components/elements/NamiSegmentPickerItem.tsx +184 -0
- package/src/components/elements/NamiSpacer.tsx +23 -0
- package/src/components/elements/NamiSymbol.tsx +104 -0
- package/src/components/elements/NamiText.tsx +311 -0
- package/src/components/elements/NamiToggleButton.tsx +102 -0
- package/src/components/elements/NamiToggleSwitch.tsx +64 -0
- package/src/components/elements/NamiVideo.kepler.tsx +638 -0
- package/src/components/elements/NamiVideo.tsx +133 -0
- package/src/components/elements/NamiVolumeButton.tsx +93 -0
- package/src/context/FocusContext.tsx +169 -0
- package/src/context/PaywallContext.tsx +343 -0
- package/src/global.d.ts +5 -0
- package/src/index.ts +62 -0
- package/src/nami.ts +24 -0
- package/src/react-native-qrcode-svg.d.ts +4 -0
- package/src/utils/actionHandler.ts +281 -0
- package/src/utils/fonts.ts +359 -0
- package/src/utils/iconMap.ts +67 -0
- package/src/utils/impression.ts +39 -0
- package/src/utils/rendering.ts +197 -0
- package/src/utils/smartText.ts +148 -0
- package/src/utils/styles.ts +668 -0
- package/src/utils/tvFocus.ts +31 -0
- package/src/utils/videoControls.ts +49 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
type VideoControlState = {
|
|
2
|
+
playing: boolean;
|
|
3
|
+
muted: boolean;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
type Listener = (state: VideoControlState) => void;
|
|
7
|
+
|
|
8
|
+
let state: VideoControlState = {
|
|
9
|
+
playing: false,
|
|
10
|
+
muted: false,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const listeners = new Set<Listener>();
|
|
14
|
+
|
|
15
|
+
function emit() {
|
|
16
|
+
listeners.forEach((listener) => listener(state));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function getVideoControlState(): VideoControlState {
|
|
20
|
+
return state;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function subscribeVideoControls(listener: Listener): () => void {
|
|
24
|
+
listeners.add(listener);
|
|
25
|
+
listener(state);
|
|
26
|
+
return () => listeners.delete(listener);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function setVideoPlaying(playing: boolean): void {
|
|
30
|
+
if (state.playing === playing) return;
|
|
31
|
+
state = { ...state, playing };
|
|
32
|
+
emit();
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function setVideoMuted(muted: boolean): void {
|
|
36
|
+
if (state.muted === muted) return;
|
|
37
|
+
state = { ...state, muted };
|
|
38
|
+
emit();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function initializeVideoControls(next: Partial<VideoControlState>): void {
|
|
42
|
+
const updated: VideoControlState = {
|
|
43
|
+
playing: next.playing ?? state.playing,
|
|
44
|
+
muted: next.muted ?? state.muted,
|
|
45
|
+
};
|
|
46
|
+
if (updated.playing === state.playing && updated.muted === state.muted) return;
|
|
47
|
+
state = updated;
|
|
48
|
+
emit();
|
|
49
|
+
}
|