react-native-store-version 1.4.2 → 2.0.0-beta.1

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.
Files changed (149) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +514 -43
  3. package/dist/checkVersion.d.ts +73 -0
  4. package/dist/checkVersion.d.ts.map +1 -0
  5. package/dist/checkVersion.js +193 -0
  6. package/dist/cli/check.js +38 -0
  7. package/dist/cli/checks/ids.js +111 -0
  8. package/dist/cli/checks/installed.js +51 -0
  9. package/dist/cli/checks/peers.js +31 -0
  10. package/dist/cli/checks/rollout.js +141 -0
  11. package/dist/cli/checks/store.js +71 -0
  12. package/dist/cli/checks/versions.js +83 -0
  13. package/dist/cli/index.js +43 -0
  14. package/dist/cli/main.js +182 -0
  15. package/dist/cli/output.js +77 -0
  16. package/dist/cli/packages.js +40 -0
  17. package/dist/cli/project/android.js +60 -0
  18. package/dist/cli/project/expo.js +194 -0
  19. package/dist/cli/project/files.js +42 -0
  20. package/dist/cli/project/gradle.js +145 -0
  21. package/dist/cli/project/index.js +10 -0
  22. package/dist/cli/project/ios.js +190 -0
  23. package/dist/cli/project/jsx.js +327 -0
  24. package/dist/cli/project/plist.js +166 -0
  25. package/dist/cli/project/sources.js +86 -0
  26. package/dist/cli/result.js +12 -0
  27. package/dist/compare.d.ts +31 -0
  28. package/dist/compare.d.ts.map +1 -0
  29. package/dist/compare.js +68 -0
  30. package/dist/detect.d.ts +68 -0
  31. package/dist/detect.d.ts.map +1 -0
  32. package/dist/detect.js +103 -0
  33. package/dist/errors.d.ts +33 -0
  34. package/dist/errors.d.ts.map +1 -0
  35. package/dist/errors.js +23 -0
  36. package/dist/fetchers/android.d.ts +53 -0
  37. package/dist/fetchers/android.d.ts.map +1 -0
  38. package/dist/fetchers/android.js +91 -0
  39. package/dist/fetchers/custom.d.ts +29 -0
  40. package/dist/fetchers/custom.d.ts.map +1 -0
  41. package/dist/fetchers/custom.js +41 -0
  42. package/dist/fetchers/ios.d.ts +61 -0
  43. package/dist/fetchers/ios.d.ts.map +1 -0
  44. package/dist/fetchers/ios.js +79 -0
  45. package/dist/index.d.ts +15 -14
  46. package/dist/index.d.ts.map +1 -0
  47. package/dist/index.js +9 -58
  48. package/dist/openStore.d.ts +29 -0
  49. package/dist/openStore.d.ts.map +1 -0
  50. package/dist/openStore.js +46 -0
  51. package/dist/policy.d.ts +75 -0
  52. package/dist/policy.d.ts.map +1 -0
  53. package/dist/policy.js +128 -0
  54. package/dist/react/DefaultForceModal.d.ts +26 -0
  55. package/dist/react/DefaultForceModal.d.ts.map +1 -0
  56. package/dist/react/DefaultForceModal.js +58 -0
  57. package/dist/react/DefaultWarningSheet.d.ts +26 -0
  58. package/dist/react/DefaultWarningSheet.d.ts.map +1 -0
  59. package/dist/react/DefaultWarningSheet.js +66 -0
  60. package/dist/react/StoreVersionModal.d.ts +52 -0
  61. package/dist/react/StoreVersionModal.d.ts.map +1 -0
  62. package/dist/react/StoreVersionModal.js +250 -0
  63. package/dist/react/StoreVersionProvider.d.ts +51 -0
  64. package/dist/react/StoreVersionProvider.d.ts.map +1 -0
  65. package/dist/react/StoreVersionProvider.js +69 -0
  66. package/dist/react/defaultUi.d.ts +72 -0
  67. package/dist/react/defaultUi.d.ts.map +1 -0
  68. package/dist/react/defaultUi.js +118 -0
  69. package/dist/react/engine.d.ts +146 -0
  70. package/dist/react/engine.d.ts.map +1 -0
  71. package/dist/react/engine.js +541 -0
  72. package/dist/react/texts.d.ts +43 -0
  73. package/dist/react/texts.d.ts.map +1 -0
  74. package/dist/react/texts.js +57 -0
  75. package/dist/react/useIsomorphicLayoutEffect.d.ts +3 -0
  76. package/dist/react/useIsomorphicLayoutEffect.d.ts.map +1 -0
  77. package/dist/react/useIsomorphicLayoutEffect.js +6 -0
  78. package/dist/react/useStoreVersion.d.ts +121 -0
  79. package/dist/react/useStoreVersion.d.ts.map +1 -0
  80. package/dist/react/useStoreVersion.js +23 -0
  81. package/dist/request.d.ts +78 -0
  82. package/dist/request.d.ts.map +1 -0
  83. package/dist/request.js +227 -0
  84. package/dist/resolve.d.ts +98 -0
  85. package/dist/resolve.d.ts.map +1 -0
  86. package/dist/resolve.js +218 -0
  87. package/dist/texts/ja.d.ts +8 -0
  88. package/dist/texts/ja.d.ts.map +1 -0
  89. package/dist/texts/ja.js +18 -0
  90. package/dist/vendor/compare-versions.d.ts +52 -0
  91. package/dist/vendor/compare-versions.d.ts.map +1 -0
  92. package/dist/vendor/compare-versions.js +111 -0
  93. package/package.json +83 -44
  94. package/src/checkVersion.ts +273 -0
  95. package/src/cli/check.ts +59 -0
  96. package/src/cli/checks/ids.ts +163 -0
  97. package/src/cli/checks/installed.ts +75 -0
  98. package/src/cli/checks/peers.ts +34 -0
  99. package/src/cli/checks/rollout.ts +183 -0
  100. package/src/cli/checks/store.ts +105 -0
  101. package/src/cli/checks/versions.ts +108 -0
  102. package/src/cli/index.ts +51 -0
  103. package/src/cli/main.ts +229 -0
  104. package/src/cli/output.ts +122 -0
  105. package/src/cli/packages.ts +43 -0
  106. package/src/cli/project/android.ts +96 -0
  107. package/src/cli/project/expo.ts +232 -0
  108. package/src/cli/project/files.ts +56 -0
  109. package/src/cli/project/gradle.ts +181 -0
  110. package/src/cli/project/index.ts +18 -0
  111. package/src/cli/project/ios.ts +284 -0
  112. package/src/cli/project/jsx.ts +354 -0
  113. package/src/cli/project/plist.ts +179 -0
  114. package/src/cli/project/sources.ts +118 -0
  115. package/src/cli/result.ts +34 -0
  116. package/src/compare.ts +101 -0
  117. package/src/detect.ts +178 -0
  118. package/src/errors.ts +63 -0
  119. package/src/fetchers/android.ts +136 -0
  120. package/src/fetchers/custom.ts +84 -0
  121. package/src/fetchers/ios.ts +160 -0
  122. package/src/index.ts +37 -0
  123. package/src/openStore.ts +74 -0
  124. package/src/policy.ts +223 -0
  125. package/src/react/DefaultForceModal.tsx +100 -0
  126. package/src/react/DefaultWarningSheet.tsx +115 -0
  127. package/src/react/StoreVersionModal.tsx +365 -0
  128. package/src/react/StoreVersionProvider.tsx +149 -0
  129. package/src/react/defaultUi.tsx +205 -0
  130. package/src/react/engine.ts +768 -0
  131. package/src/react/texts.ts +119 -0
  132. package/src/react/useIsomorphicLayoutEffect.ts +8 -0
  133. package/src/react/useStoreVersion.ts +153 -0
  134. package/src/request.ts +328 -0
  135. package/src/resolve.ts +388 -0
  136. package/src/texts/ja.ts +26 -0
  137. package/src/vendor/compare-versions.ts +128 -0
  138. package/texts/ja.d.ts +2 -0
  139. package/texts/ja.js +3 -0
  140. package/.eslintrc.js +0 -51
  141. package/.github/FUNDING.yml +0 -3
  142. package/.github/workflows/pr.yml +0 -48
  143. package/.github/workflows/release.yml +0 -259
  144. package/.prettierrc.js +0 -6
  145. package/babel.config.js +0 -3
  146. package/dist/android.d.ts +0 -1
  147. package/dist/android.js +0 -17
  148. package/dist/ios.d.ts +0 -1
  149. package/dist/ios.js +0 -18
@@ -0,0 +1,66 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // Warning(閉じられる警告)のデフォルト UI の中身。Warning の元のデザインの実測値で作る。
3
+ // Modal の枠(戻るボタン・背景タップ・VoiceOver の escape で `dismiss`、幕、下寄せ、アニメーション)は StoreVersionModal.tsx が持ち、
4
+ // ここは `components.Warning` が無いときにその中に描かれるシート。ハンドルは見た目だけ(ドラッグでは閉じない)
5
+ import { Image, Platform, StyleSheet, Text, View } from 'react-native';
6
+ import { ActionButton, BUTTON_TEXT_COLOR, MAX_CONTENT_WIDTH, messageStyle, titleStyle, usePalette, } from './defaultUi.js';
7
+ /** デザインの幕 `rgba(0, 0, 0, 0.35)` */
8
+ export const WARNING_OVERLAY_COLOR = 'rgba(0, 0, 0, 0.35)';
9
+ /**
10
+ * シートの影(デザイン: `box-shadow: 0 -8px 32px rgba(0, 0, 0, .2)`)。iOS は shadow* にそのまま写し、
11
+ * Android は elevation に読み替える(影の y オフセットの大きさ 8 を elevation に。elevation は上向きの影を描けない)
12
+ */
13
+ export const sheetShadow = Platform.select({
14
+ ios: {
15
+ shadowColor: '#000000',
16
+ shadowOffset: { width: 0, height: -8 },
17
+ shadowOpacity: 0.2,
18
+ shadowRadius: 32,
19
+ },
20
+ android: { elevation: 8 },
21
+ });
22
+ /** デザインどおりのシート(`components.Warning` が無いときの中身)。`texts` は置き換え済み */
23
+ export const WarningSheet = ({ texts, icon, openStore, dismiss, }) => {
24
+ const palette = usePalette();
25
+ return (_jsxs(View, { style: [styles.sheet, { backgroundColor: palette.card }], children: [_jsx(View, { style: [styles.handle, { backgroundColor: palette.handle }] }), icon === undefined ? null : (_jsx(Image, { source: icon, style: [styles.icon, { backgroundColor: palette.iconBg }] })), _jsx(Text, { accessibilityRole: "header", style: [titleStyle, { color: palette.text }], children: texts.title }), _jsx(Text, { style: [messageStyle, { color: palette.sub }], children: texts.message }), _jsxs(View, { style: styles.buttons, children: [_jsx(ActionButton, { label: texts.update, onPress: () => {
26
+ // 開けたかどうかは使わない(失敗は onError に渡る。reject しない)
27
+ void openStore();
28
+ }, backgroundColor: palette.primary, color: BUTTON_TEXT_COLOR }), _jsx(ActionButton, { label: texts.later, onPress: dismiss, color: palette.secondaryText })] })] }));
29
+ };
30
+ const styles = StyleSheet.create({
31
+ // デザイン: radius 24px 24px 0 0・padding 12px 24px 40px・gap 14。
32
+ // 下の padding 40 でホームインジケータのセーフエリアも吸収する(react-native-safe-area-context には依存しない)。
33
+ // 幅は画面いっぱい(スマホ縦向きではデザインと同じ)で、最大 480 に抑えて中央に置く(意図的に変える点)
34
+ sheet: {
35
+ width: '100%',
36
+ maxWidth: MAX_CONTENT_WIDTH,
37
+ alignSelf: 'center',
38
+ borderTopLeftRadius: 24,
39
+ borderTopRightRadius: 24,
40
+ paddingTop: 12,
41
+ paddingHorizontal: 24,
42
+ paddingBottom: 40,
43
+ gap: 14,
44
+ ...sheetShadow,
45
+ },
46
+ // デザイン: 40×5・radius 3・align-self center・margin-bottom 10(gap 14 と合わせて次の要素まで 24)
47
+ handle: {
48
+ width: 40,
49
+ height: 5,
50
+ borderRadius: 3,
51
+ alignSelf: 'center',
52
+ marginBottom: 10,
53
+ },
54
+ // デザイン: 56×56・radius 13(左寄せ)
55
+ icon: {
56
+ width: 56,
57
+ height: 56,
58
+ borderRadius: 13,
59
+ alignSelf: 'flex-start',
60
+ },
61
+ // デザイン: ボタンは縦に並べ、ボタン同士 8・ボタンの前の margin-top 8
62
+ buttons: {
63
+ gap: 8,
64
+ marginTop: 8,
65
+ },
66
+ });
@@ -0,0 +1,52 @@
1
+ import type { UseStoreVersionResult } from './useStoreVersion.ts';
2
+ /** 出している UI の種類 */
3
+ export type UiKind = 'force' | 'warning';
4
+ /** 開閉のアニメーションの時間(ms) */
5
+ export declare const ANIMATION_DURATION_MS = 250;
6
+ /**
7
+ * iOS の Modal が対応する向き。RN の既定は portrait だけで、横向き専用のアプリでは Modal を出した瞬間に落ちる
8
+ * ("Supported orientations has no common orientation with the application")ので、すべて渡す
9
+ */
10
+ export declare const SUPPORTED_ORIENTATIONS: readonly ['portrait', 'portrait-upside-down', 'landscape', 'landscape-left', 'landscape-right'];
11
+ /**
12
+ * 出すべき UI。force なら Force、warning で「あとで」が押されていなければ Warning、それ以外
13
+ * (none / 判定前 / skipped / error)は無し(失敗・タイムアウトでは UI を出さない)。
14
+ * 再チェック中も前回の `action` が残るので Force は消えない
15
+ */
16
+ export declare const uiKindOf: (state: UseStoreVersionResult) => UiKind | null;
17
+ /**
18
+ * 「視差効果を減らす」(iOS)/「アニメーションを無効化」(Android)の設定。変化も追い、`active` が false になったときと
19
+ * アンマウントで購読を外す。`active` が false の間は取得も購読もしない(Provider が `ui` かつ skipped でないときだけ true にする)。
20
+ * 取得できるまで・取れない環境では false(動かす)
21
+ */
22
+ export declare const useReduceMotion: (active: boolean) => boolean;
23
+ /**
24
+ * デフォルト UI の Modal。Provider が初めて出すものができたときにマウントし、以後はマウントしたまま
25
+ * (出すものが無い間は `visible={false}` で何も描かない。skipped や判定前はマウントもしない)。
26
+ * 「視差効果を減らす」は Provider が購読して props で受け取る(マウントと同じ commit で開くので、ここで取りに行くと初回に間に合わない)。
27
+ *
28
+ * - 中身の props(`local` / `remote` / `storeUrl` / 文言 / `openStore` / `dismiss`)は出している間に作ったものを保存し、
29
+ * 閉じるアニメーションの間は最後の値のまま描く(`enabled` を false にした経路では engine が `local` / `remote` / `storeUrl` を
30
+ * null にするので、そのまま読むと閉じる途中で本文が変わり、`components` に `local: ''` が渡ってしまう)
31
+ *
32
+ * - 開くとき: 幕は opacity 0 → 1、Force のカードは opacity 0 → 1、Warning のシートは画面の高さ分下から translateY → 0(250ms、native driver)
33
+ * - 閉じるとき(`action` が force / warning でなくなる、Warning が dismiss される): 逆のアニメーションを走らせ、終わってから `visible={false}`
34
+ * - Force ⇄ Warning の切り替えでは Modal を閉じず、中身だけを入れ替える(切り替え自体はアニメーションしない)
35
+ * - 「視差効果を減らす」が有効なら動かさず、すぐに開閉する
36
+ * - 中身は ScrollView に入れる(大きいフォントや横向きでもボタンまで届くように)。Warning は ScrollView の空いたところのタップでも `dismiss`
37
+ * - `components` で差し替えた中身にも同じアニメーションを外側のラッパーでかける
38
+ */
39
+ export declare const StoreVersionModal: ({ reduceMotion, }: {
40
+ /** 「視差効果を減らす」の設定(Provider が {@link useReduceMotion} で購読した値)。true なら開閉を動かさない */
41
+ reduceMotion: boolean;
42
+ }) => import("react").JSX.Element;
43
+ /**
44
+ * 中身が画面より高くなったとき(大きいフォントなど)に、端をシステムの領域から外すための余白(Force は上下、Warning は上)。
45
+ * react-native-safe-area-context には依存しないので固定値にする。
46
+ * - 縦向き: 72。ステータスバー / ノッチ / Dynamic Island(上の領域は機種により 60pt 台)と Android の edge-to-edge の
47
+ * ステータスバーを覆う
48
+ * - 横向き: 24。iPhone の横向きは上にステータスバーが無く、Android の横向きのステータスバー(24dp)だけを覆う
49
+ * 中身が「画面の高さ − 余白」に収まるときは、配置(Force は中央、Warning は下寄せ)の見た目は変わらない
50
+ */
51
+ export declare const overflowInsetFor: (width: number, height: number) => number;
52
+ //# sourceMappingURL=StoreVersionModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StoreVersionModal.d.ts","sourceRoot":"","sources":["../../src/react/StoreVersionModal.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAGV,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAE9B,mBAAmB;AACnB,MAAM,MAAM,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEzC,wBAAwB;AACxB,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,sBAAsB,YACjC,UAAU,EACV,sBAAsB,EACtB,WAAW,EACX,gBAAgB,EAChB,iBAAiB,CACT,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,QAAQ,UAAW,qBAAqB,KAAG,MAAM,GAAG,IAWhE,CAAC;AAKF;;;;GAIG;AACH,eAAO,MAAM,eAAe,WAAY,OAAO,KAAG,OA2BjD,CAAC;AA8BF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,iBAAiB,sBAE3B;IACD,+EAA+E;IAC/E,YAAY,EAAE,OAAO,CAAC;CACvB,gCA4KA,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,UAAW,MAAM,UAAU,MAAM,KAAG,MACvC,CAAC"}
@@ -0,0 +1,250 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // デフォルト UI の Modal の枠。Provider はこれを 1 つだけ描き、Force / Warning はこの中で中身だけが入れ替わる
3
+ // (Force と Warning で別々の Modal を出すと、iOS では前の Modal の dismiss と次の present が重なって次が出ないことがある)。
4
+ // ライブラリが持つもの: Modal、幕(オーバーレイ)とその色、中身の配置(Force は縦中央、Warning は下寄せ)、
5
+ // 戻るボタン・背景タップ・VoiceOver の escape の扱い、a11y の属性、開閉のアニメーション。`components` で差し替えられるのは中身だけ
6
+ import { useEffect, useMemo, useRef, useState } from 'react';
7
+ import { AccessibilityInfo, Animated, Modal, Pressable, ScrollView, StyleSheet, useWindowDimensions, View, } from 'react-native';
8
+ import { FORCE_OVERLAY_COLOR, ForceCard } from './DefaultForceModal.js';
9
+ import { WARNING_OVERLAY_COLOR, WarningSheet } from './DefaultWarningSheet.js';
10
+ import { normalizeIcon, useDefaultUiContext, } from './defaultUi.js';
11
+ import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect.js';
12
+ /** 開閉のアニメーションの時間(ms) */
13
+ export const ANIMATION_DURATION_MS = 250;
14
+ /**
15
+ * iOS の Modal が対応する向き。RN の既定は portrait だけで、横向き専用のアプリでは Modal を出した瞬間に落ちる
16
+ * ("Supported orientations has no common orientation with the application")ので、すべて渡す
17
+ */
18
+ export const SUPPORTED_ORIENTATIONS = [
19
+ 'portrait',
20
+ 'portrait-upside-down',
21
+ 'landscape',
22
+ 'landscape-left',
23
+ 'landscape-right',
24
+ ];
25
+ /**
26
+ * 出すべき UI。force なら Force、warning で「あとで」が押されていなければ Warning、それ以外
27
+ * (none / 判定前 / skipped / error)は無し(失敗・タイムアウトでは UI を出さない)。
28
+ * 再チェック中も前回の `action` が残るので Force は消えない
29
+ */
30
+ export const uiKindOf = (state) => {
31
+ if (state.local === null) {
32
+ return null;
33
+ }
34
+ if (state.action === 'force') {
35
+ return 'force';
36
+ }
37
+ if (state.action === 'warning' && !state.dismissed) {
38
+ return 'warning';
39
+ }
40
+ return null;
41
+ };
42
+ // Android の戻るボタンでは閉じない(Force)
43
+ const ignoreRequestClose = () => { };
44
+ /**
45
+ * 「視差効果を減らす」(iOS)/「アニメーションを無効化」(Android)の設定。変化も追い、`active` が false になったときと
46
+ * アンマウントで購読を外す。`active` が false の間は取得も購読もしない(Provider が `ui` かつ skipped でないときだけ true にする)。
47
+ * 取得できるまで・取れない環境では false(動かす)
48
+ */
49
+ export const useReduceMotion = (active) => {
50
+ const [reduceMotion, setReduceMotion] = useState(false);
51
+ useEffect(() => {
52
+ if (!active) {
53
+ return;
54
+ }
55
+ let live = true;
56
+ AccessibilityInfo.isReduceMotionEnabled().then((enabled) => {
57
+ if (live) {
58
+ setReduceMotion(enabled);
59
+ }
60
+ }, () => {
61
+ // 取れない環境では動かす
62
+ });
63
+ const subscription = AccessibilityInfo.addEventListener('reduceMotionChanged', setReduceMotion);
64
+ return () => {
65
+ live = false;
66
+ subscription.remove();
67
+ };
68
+ }, [active]);
69
+ return reduceMotion;
70
+ };
71
+ /** 中身に渡す props を作る(`local` は出すものがあるときは必ずある) */
72
+ const propsFor = ({ state, display, texts }, local) => {
73
+ const base = {
74
+ local,
75
+ remote: state.remote,
76
+ storeUrl: state.storeUrl,
77
+ releaseNotes: state.releaseNotes,
78
+ icon: normalizeIcon(display.icon),
79
+ openStore: state.openStore,
80
+ };
81
+ const force = { ...base, texts: texts.force };
82
+ const warning = {
83
+ ...base,
84
+ texts: texts.warning,
85
+ dismiss: state.dismiss,
86
+ };
87
+ return { force, warning };
88
+ };
89
+ /**
90
+ * デフォルト UI の Modal。Provider が初めて出すものができたときにマウントし、以後はマウントしたまま
91
+ * (出すものが無い間は `visible={false}` で何も描かない。skipped や判定前はマウントもしない)。
92
+ * 「視差効果を減らす」は Provider が購読して props で受け取る(マウントと同じ commit で開くので、ここで取りに行くと初回に間に合わない)。
93
+ *
94
+ * - 中身の props(`local` / `remote` / `storeUrl` / 文言 / `openStore` / `dismiss`)は出している間に作ったものを保存し、
95
+ * 閉じるアニメーションの間は最後の値のまま描く(`enabled` を false にした経路では engine が `local` / `remote` / `storeUrl` を
96
+ * null にするので、そのまま読むと閉じる途中で本文が変わり、`components` に `local: ''` が渡ってしまう)
97
+ *
98
+ * - 開くとき: 幕は opacity 0 → 1、Force のカードは opacity 0 → 1、Warning のシートは画面の高さ分下から translateY → 0(250ms、native driver)
99
+ * - 閉じるとき(`action` が force / warning でなくなる、Warning が dismiss される): 逆のアニメーションを走らせ、終わってから `visible={false}`
100
+ * - Force ⇄ Warning の切り替えでは Modal を閉じず、中身だけを入れ替える(切り替え自体はアニメーションしない)
101
+ * - 「視差効果を減らす」が有効なら動かさず、すぐに開閉する
102
+ * - 中身は ScrollView に入れる(大きいフォントや横向きでもボタンまで届くように)。Warning は ScrollView の空いたところのタップでも `dismiss`
103
+ * - `components` で差し替えた中身にも同じアニメーションを外側のラッパーでかける
104
+ */
105
+ export const StoreVersionModal = ({ reduceMotion, }) => {
106
+ const context = useDefaultUiContext();
107
+ const { state, display } = context;
108
+ const kind = uiKindOf(state);
109
+ const { width: windowWidth, height: windowHeight } = useWindowDimensions();
110
+ const inset = overflowInsetFor(windowWidth, windowHeight);
111
+ // 描いている種類。閉じるアニメーションの間は、出すものが無くなった後も前の種類を描き続ける。
112
+ // 開くときは同じ描画で中身を出す(描画中の自分の setState。前の描画の値から導く React の書き方)
113
+ const [shown, setShown] = useState(kind);
114
+ if (kind !== null && kind !== shown) {
115
+ setShown(kind);
116
+ }
117
+ // 出している間の props は描画で作り、commit の後に最後の値として保存する(layout effect。描画中には ref に書かない)。
118
+ // 閉じている間(kind が null)は保存した最後の値で描く(描画中に ref を読むが、読むのは commit 済みの描画が書いた値だけ)
119
+ const current = kind !== null && state.local !== null
120
+ ? propsFor(context, state.local)
121
+ : null;
122
+ const lastRef = useRef(null);
123
+ useIsomorphicLayoutEffect(() => {
124
+ if (current !== null) {
125
+ lastRef.current = current;
126
+ }
127
+ });
128
+ const saved = current ?? lastRef.current;
129
+ // 幕と中身は 0 から始めて、マウント直後の effect で 1 へ動かす(Provider は初めて出すものができたときにマウントする)
130
+ const progress = useRef(new Animated.Value(0)).current;
131
+ const openRef = useRef(false);
132
+ // 設定は開閉のときに読むだけにする(表示中に設定が変わっても、走っているアニメーションを止めたりやり直したりしない)。
133
+ // この effect は下の開閉の effect より先に宣言してあるので、同じ commit では先に更新される
134
+ const reduceMotionRef = useRef(reduceMotion);
135
+ useEffect(() => {
136
+ reduceMotionRef.current = reduceMotion;
137
+ }, [reduceMotion]);
138
+ useEffect(() => {
139
+ if (kind !== null) {
140
+ openRef.current = true;
141
+ if (reduceMotionRef.current) {
142
+ progress.setValue(1);
143
+ return;
144
+ }
145
+ const animation = Animated.timing(progress, {
146
+ toValue: 1,
147
+ duration: ANIMATION_DURATION_MS,
148
+ useNativeDriver: true,
149
+ });
150
+ animation.start();
151
+ return () => animation.stop();
152
+ }
153
+ if (!openRef.current) {
154
+ return;
155
+ }
156
+ openRef.current = false;
157
+ if (reduceMotionRef.current) {
158
+ progress.setValue(0);
159
+ setShown(null);
160
+ return;
161
+ }
162
+ const animation = Animated.timing(progress, {
163
+ toValue: 0,
164
+ duration: ANIMATION_DURATION_MS,
165
+ useNativeDriver: true,
166
+ });
167
+ // 途中でまた開くことになったら stop され(finished: false)、閉じない
168
+ animation.start(({ finished }) => {
169
+ if (finished) {
170
+ setShown(null);
171
+ }
172
+ });
173
+ return () => animation.stop();
174
+ }, [kind, progress]);
175
+ // Warning のシートは画面の高さ分(シートの高さに関わらず画面の外になる値)下から出る
176
+ const slide = useMemo(() => ({
177
+ transform: [
178
+ {
179
+ translateY: progress.interpolate({
180
+ inputRange: [0, 1],
181
+ outputRange: [windowHeight, 0],
182
+ }),
183
+ },
184
+ ],
185
+ }), [progress, windowHeight]);
186
+ const isWarning = shown === 'warning';
187
+ // 閉じる途中の戻るボタン・背景タップ・escape も、保存した props の dismiss(engine の関数)のまま
188
+ const dismiss = saved?.warning.dismiss ?? ignoreRequestClose;
189
+ const Force = display.components?.Force;
190
+ const Warning = display.components?.Warning;
191
+ const content = shown === null || saved === null ? null : isWarning ? (Warning ? (_jsx(Warning, { ...saved.warning })) : (_jsx(WarningSheet, { ...saved.warning }))) : Force ? (_jsx(Force, { ...saved.force })) : (_jsx(ForceCard, { ...saved.force }));
192
+ return (_jsxs(Modal, { visible: shown !== null, transparent: true,
193
+ // 幕と中身は自前でアニメーションするので Modal 自体は動かさない
194
+ animationType: "none",
195
+ // Android の透過 Modal は既定でステータスバーの下まで広がらず、そこだけ暗くならない帯になるので広げる(iOS では無視される)
196
+ statusBarTranslucent: true, supportedOrientations: [...SUPPORTED_ORIENTATIONS], onRequestClose: isWarning ? dismiss : ignoreRequestClose, children: [_jsx(Animated.View, { pointerEvents: "none", style: [
197
+ styles.overlay,
198
+ {
199
+ backgroundColor: isWarning
200
+ ? WARNING_OVERLAY_COLOR
201
+ : FORCE_OVERLAY_COLOR,
202
+ opacity: progress,
203
+ },
204
+ ], importantForAccessibility: "no-hide-descendants", accessibilityElementsHidden: true }), _jsx(View, { style: styles.fill, accessibilityViewIsModal: true, onAccessibilityEscape: isWarning ? dismiss : undefined, children: _jsxs(ScrollView, { style: styles.fill, contentContainerStyle: [
205
+ styles.content,
206
+ isWarning
207
+ ? [styles.bottom, { paddingTop: inset }]
208
+ : [styles.center, { paddingVertical: inset }],
209
+ ], bounces: false, keyboardShouldPersistTaps: "handled", children: [isWarning ? (_jsx(Pressable, { style: styles.overlay, onPress: dismiss, accessible: false,
210
+ // 読み上げから外すのと同じ理由で、キーボード / D-pad のフォーカスも受けない(Pressable の既定は focusable)
211
+ focusable: false, importantForAccessibility: "no-hide-descendants", accessibilityElementsHidden: true })) : null, _jsx(Animated.View, { style: isWarning ? slide : { opacity: progress }, children: content })] }) })] }));
212
+ };
213
+ /**
214
+ * 中身が画面より高くなったとき(大きいフォントなど)に、端をシステムの領域から外すための余白(Force は上下、Warning は上)。
215
+ * react-native-safe-area-context には依存しないので固定値にする。
216
+ * - 縦向き: 72。ステータスバー / ノッチ / Dynamic Island(上の領域は機種により 60pt 台)と Android の edge-to-edge の
217
+ * ステータスバーを覆う
218
+ * - 横向き: 24。iPhone の横向きは上にステータスバーが無く、Android の横向きのステータスバー(24dp)だけを覆う
219
+ * 中身が「画面の高さ − 余白」に収まるときは、配置(Force は中央、Warning は下寄せ)の見た目は変わらない
220
+ */
221
+ export const overflowInsetFor = (width, height) => width > height ? 24 : 72;
222
+ const styles = StyleSheet.create({
223
+ fill: {
224
+ flex: 1,
225
+ },
226
+ // 画面いっぱい(StyleSheet.absoluteFill と同じ。RN 0.88 の型には absoluteFillObject が無いので書き下す)
227
+ overlay: {
228
+ position: 'absolute',
229
+ top: 0,
230
+ left: 0,
231
+ right: 0,
232
+ bottom: 0,
233
+ },
234
+ // 中身が画面より低いときは画面いっぱいに広げて配置し、高いときはスクロールする
235
+ content: {
236
+ flexGrow: 1,
237
+ },
238
+ // Force: 画面の縦中央(デザインの top 268px は 844pt の画面での値なので、中央寄せに読み替える)。
239
+ // カードの左右 24 はデザインの left / right 24(カード側ではなくここで取る)。上下の余白は overflowInsetFor
240
+ center: {
241
+ justifyContent: 'center',
242
+ paddingHorizontal: 24,
243
+ },
244
+ // Warning: 下寄せ。上の余白は overflowInsetFor。下はシートの padding 40 で、iOS のホームインジケータ(34pt)と
245
+ // Android のジェスチャーナビは吸収する。Android の 3 ボタンのナビゲーションバー(48dp)では「あとで」の押せる範囲の
246
+ // 下の端がバーに少し重なる(文字は見え、押せることを Android エミュレータで確認)
247
+ bottom: {
248
+ justifyContent: 'flex-end',
249
+ },
250
+ });
@@ -0,0 +1,51 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { ColorValue, ImageSourcePropType } from 'react-native';
3
+ import { type StoreVersionCheckProps } from './engine.ts';
4
+ import type { StoreVersionTexts } from './texts.ts';
5
+ import { type StoreVersionComponents } from './useStoreVersion.ts';
6
+ export type { StoreVersionCheckResult } from './engine.ts';
7
+ export { DEFAULT_TIMEOUT_MS, defaultCountry } from './engine.ts';
8
+ /** {@link StoreVersionProvider} の props */
9
+ export type StoreVersionProviderProps = StoreVersionCheckProps & {
10
+ children?: ReactNode;
11
+ /**
12
+ * デフォルト UI の文言。`force` / `warning` ごとに、指定しなかったキーは英語の既定値で補完する。
13
+ * `{remote}`(最新バージョン)/ `{local}`(現在のバージョン)は表示時に置き換える。
14
+ * 日本語は `react-native-store-version/texts/ja`。変えると表示中のモーダルにも即座に反映する
15
+ */
16
+ texts?: StoreVersionTexts;
17
+ /** デフォルト UI に表示するアイコン(Force はタイトルの上に中央、Warning はシートの左上)。無ければ表示しない */
18
+ icon?: ImageSourcePropType;
19
+ /**
20
+ * デフォルト UI の中身の差し替え。差し替えられるのはカード(Force)/ シート(Warning)の中身だけで、
21
+ * Modal・幕の色・配置・戻るボタン / 背景タップの扱い・開閉のアニメーションはライブラリが持つ。
22
+ * 置かれ方: Force は左右 24 の余白の内側で画面の縦中央、Warning は画面幅で下寄せ。どちらも ScrollView の中。
23
+ * カード / シートの面(背景・角丸・影・最大幅 480)はライブラリは掛けないので、差し替えたコンポーネントが自分で描く
24
+ */
25
+ components?: StoreVersionComponents;
26
+ /**
27
+ * デフォルト UI のボタンの色。「更新」の塗りと「あとで」の文字に使う(「更新」の文字は白のまま)。
28
+ * 省略すると既定の配色(ライト #1D4ED8 / ダーク #2563EB、「あとで」はダークで #93C5FD)。
29
+ * ライト / ダークで同じ色になるので、モードで変えたいときは `useColorScheme()` で分けた値(iOS は `DynamicColorIOS` も可)を渡す。
30
+ * 白の文字と、ダークのシートの背景(#27272A)の上の「あとで」が読める色にすること。`components` で差し替えた中身には効かない
31
+ */
32
+ primaryColor?: ColorValue;
33
+ /** false ならデフォルト UI を出さない(hook だけ使う)。既定 true */
34
+ ui?: boolean;
35
+ };
36
+ /**
37
+ * ストアのバージョンを確認し、強制 / 警告アップデートを出す Provider。子は判定を待たずに描画する。
38
+ *
39
+ * - 確認するのはマウント時・`recheck()`・(`recheckOnForeground` のとき)バックグラウンドからの復帰時・`enabled` が true になったときだけ。
40
+ * ほかの props(インラインで書いた `getLatestVersion` なども)が変わっても取り直さない。`policy` が変わったら `action` だけ計算し直す
41
+ * - 再チェックの間(`status: 'checking'`)も前回の判定の結果を見せ続け、再チェックが失敗したら前回の結果に戻す(エラーは `onError` へ)
42
+ * - 判定の途中でバックグラウンドになったら取り消し、復帰時に取り直す(`onError` には渡さない)。
43
+ * バックグラウンドのままマウントされたら、active になるまで取得を始めない
44
+ * - 失敗・タイムアウトでは UI を出さず、エラーを `onError` に渡すだけ(1 回の判定で複数回呼ばれうる)
45
+ * - キャッシュ・永続化はしない。「あとで」(`dismiss`)もメモリだけ
46
+ * - StrictMode では開発時だけ、マウント時に `getLatestVersion` / `getMinimumVersion` が 2 回呼ばれうる(ストアへの fetch は 1 回にまとまる)
47
+ *
48
+ * 判定結果は配下の {@link useStoreVersion} で読める
49
+ */
50
+ export declare const StoreVersionProvider: (props: StoreVersionProviderProps) => import("react").JSX.Element;
51
+ //# sourceMappingURL=StoreVersionProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StoreVersionProvider.d.ts","sourceRoot":"","sources":["../../src/react/StoreVersionProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAwC,MAAM,OAAO,CAAC;AAC7E,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,EAKL,KAAK,sBAAsB,EAE5B,MAAM,aAAa,CAAC;AAMrB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,OAAO,EACL,KAAK,sBAAsB,EAI5B,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEjE,2CAA2C;AAC3C,MAAM,MAAM,yBAAyB,GAAG,sBAAsB,GAAG;IAC/D,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,qEAAqE;IACrE,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,UAAU,CAAC;IAC1B,gDAAgD;IAChD,EAAE,CAAC,EAAE,OAAO,CAAC;CACd,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,UAAW,yBAAyB,gCA0EpE,CAAC"}
@@ -0,0 +1,69 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // 判定を 1 つだけ持ち、Context で配下に配る Provider。ここは React の配線だけで、状態遷移と副作用は engine.ts。
3
+ // 子は判定を待たずに描画する(アプリの起動を止めない)。キャッシュ・永続化はしない
4
+ import { useEffect, useMemo, useRef, useState } from 'react';
5
+ import { createEngine, IDLE, stateOf, } from './engine.js';
6
+ import { StoreVersionModal, uiKindOf, useReduceMotion, } from './StoreVersionModal.js';
7
+ import { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect.js';
8
+ import { StoreVersionDisplayContext, StoreVersionStateContext, } from './useStoreVersion.js';
9
+ // テストから使う(パッケージの入口からは export しない)
10
+ export { DEFAULT_TIMEOUT_MS, defaultCountry } from './engine.js';
11
+ /**
12
+ * ストアのバージョンを確認し、強制 / 警告アップデートを出す Provider。子は判定を待たずに描画する。
13
+ *
14
+ * - 確認するのはマウント時・`recheck()`・(`recheckOnForeground` のとき)バックグラウンドからの復帰時・`enabled` が true になったときだけ。
15
+ * ほかの props(インラインで書いた `getLatestVersion` なども)が変わっても取り直さない。`policy` が変わったら `action` だけ計算し直す
16
+ * - 再チェックの間(`status: 'checking'`)も前回の判定の結果を見せ続け、再チェックが失敗したら前回の結果に戻す(エラーは `onError` へ)
17
+ * - 判定の途中でバックグラウンドになったら取り消し、復帰時に取り直す(`onError` には渡さない)。
18
+ * バックグラウンドのままマウントされたら、active になるまで取得を始めない
19
+ * - 失敗・タイムアウトでは UI を出さず、エラーを `onError` に渡すだけ(1 回の判定で複数回呼ばれうる)
20
+ * - キャッシュ・永続化はしない。「あとで」(`dismiss`)もメモリだけ
21
+ * - StrictMode では開発時だけ、マウント時に `getLatestVersion` / `getMinimumVersion` が 2 回呼ばれうる(ストアへの fetch は 1 回にまとまる)
22
+ *
23
+ * 判定結果は配下の {@link useStoreVersion} で読める
24
+ */
25
+ export const StoreVersionProvider = (props) => {
26
+ const { children, policy, texts, icon, components, primaryColor, ui } = props;
27
+ const [model, setModel] = useState(IDLE);
28
+ const [dismissedRemote, setDismissedRemote] = useState(null);
29
+ // 判定は effect と非同期の続きの中で props を読むので、いつも最新の props を ref で渡す。
30
+ // 描画中には書かず、commit の後(layout effect。配下の passive effect より先)に書く
31
+ const propsRef = useRef(props);
32
+ useIsomorphicLayoutEffect(() => {
33
+ propsRef.current = props;
34
+ });
35
+ const engineRef = useRef(null);
36
+ if (engineRef.current === null) {
37
+ engineRef.current = createEngine(() => propsRef.current, setModel, setDismissedRemote);
38
+ }
39
+ const engine = engineRef.current;
40
+ useEffect(() => {
41
+ engine.mount();
42
+ return () => engine.unmount();
43
+ }, [engine]);
44
+ // enabled の切り替えだけは取り直す(false → true で始め、true → false で取り消して skipped)
45
+ const enabled = props.enabled !== false;
46
+ useEffect(() => {
47
+ engine.setEnabled(enabled);
48
+ }, [engine, enabled]);
49
+ useEffect(() => {
50
+ engine.applyPolicy(policy);
51
+ }, [engine, policy]);
52
+ const state = useMemo(() => stateOf(model, dismissedRemote, engine), [model, dismissedRemote, engine]);
53
+ // 表示の設定は別の Context に置く(インラインの texts などで Provider が描画し直しても、hook を使う側は描画し直さない)
54
+ const display = useMemo(() => ({ ui: ui ?? true, texts, icon, components, primaryColor }), [ui, texts, icon, components, primaryColor]);
55
+ // デフォルト UI は子の後ろに重ねる(Modal なので描画の位置はレイアウトに影響しない)。Modal は 1 つだけで、初めて出すものが
56
+ // できたとき(force / warning で未 dismiss)にマウントし、以後はマウントしたまま(閉じている間は visible={false})。
57
+ // skipped(web / Expo Go / enabled false)や判定前はマウントもしない(描画中の自分の setState。前の描画の値から導く React の書き方)
58
+ const [uiMounted, setUiMounted] = useState(false);
59
+ if (!uiMounted && uiKindOf(state) !== null) {
60
+ setUiMounted(true);
61
+ }
62
+ // 「視差効果を減らす」の設定は Provider で購読する(Modal はマウントと同じ commit で開くので、Modal の中で取りに行くと
63
+ // 初回の表示に間に合わない。ストアへの取得を待つ間に終わる)。ただし、すぐ値を返す getLatestVersion や、出すものがある状態で
64
+ // ui を false → true にした場合は、最初の 1 回の表示に間に合わず動くことがある(既知の制限)。
65
+ // UI を出さない(ui={false})・skipped の間は購読も取得もしない。
66
+ // idle(マウント直後。skipped かどうかは engine の mount で決まる / バックグラウンドで active を待つ間)も、まだ出すものが無いので取りに行かない
67
+ const reduceMotion = useReduceMotion(display.ui && state.status !== 'skipped' && state.status !== 'idle');
68
+ return (_jsx(StoreVersionStateContext.Provider, { value: state, children: _jsxs(StoreVersionDisplayContext.Provider, { value: display, children: [children, display.ui && uiMounted ? (_jsx(StoreVersionModal, { reduceMotion: reduceMotion })) : null] }) }));
69
+ };
@@ -0,0 +1,72 @@
1
+ import { type ColorValue, type ImageSourcePropType, type TextStyle } from 'react-native';
2
+ import { type StoreVersionResolvedTexts } from './texts.ts';
3
+ import { type StoreVersionDisplay, type UseStoreVersionResult } from './useStoreVersion.ts';
4
+ /**
5
+ * デザインの配色の定義のうち、UI に使う色。実装から外したキー: appBg / block はデザインの背景のダミー画面の色、
6
+ * iconText はプレースホルダーの "icon" という文字の色(実装では `icon` の画像に置き換わるので当てる先が無い)
7
+ */
8
+ export type Palette = {
9
+ /** カード / シートの背景 */
10
+ card: string;
11
+ /** タイトル */
12
+ text: string;
13
+ /** 本文 */
14
+ sub: string;
15
+ /** 塗りのボタンの背景(Provider の `primaryColor` で変えられる) */
16
+ primary: ColorValue;
17
+ /** `icon` の背景(画像の読み込み中・透過部分に見える) */
18
+ iconBg: string;
19
+ /** Warning のハンドル */
20
+ handle: string;
21
+ /** Warning の「あとで」の文字(Provider の `primaryColor` で変えられる) */
22
+ secondaryText: ColorValue;
23
+ };
24
+ /** ライト / ダークの配色(Force / Warning の配色の定義。両方のデザインで同じ値) */
25
+ export declare const PALETTES: Record<'light' | 'dark', Palette>;
26
+ /** 塗りのボタンの文字(デザインは `color: #FFFFFF` 固定。ライト / ダークで変わらない) */
27
+ export declare const BUTTON_TEXT_COLOR = "#FFFFFF";
28
+ /**
29
+ * カード / シートの最大幅(デザインから意図的に変える点)。タブレットや横向きで画面いっぱいに広がらないようにする。
30
+ * スマホの縦向き(幅 480 未満)では効かないので見た目は変わらない
31
+ */
32
+ export declare const MAX_CONTENT_WIDTH = 480;
33
+ /**
34
+ * 端末の配色に合わせた色(`useColorScheme`。null(未対応の環境)はライト)。
35
+ * Provider に `primaryColor` があれば、ボタンの塗りと「あとで」の文字をそれにする
36
+ */
37
+ export declare const usePalette: () => Palette;
38
+ /**
39
+ * `icon` を描くかどうかの正規化。JS からの利用で null / false を渡されても「無し」として扱う
40
+ * (`components` に渡す `icon` も undefined にそろえる)
41
+ */
42
+ export declare const normalizeIcon: (icon: ImageSourcePropType | undefined) => ImageSourcePropType | undefined;
43
+ /** デフォルト UI が Context から読む値。`texts` は既定値で補完し `{remote}` / `{local}` を置き換え済み */
44
+ export type DefaultUiContext = {
45
+ state: UseStoreVersionResult;
46
+ display: StoreVersionDisplay;
47
+ texts: StoreVersionResolvedTexts;
48
+ };
49
+ /**
50
+ * 判定の状態と表示の設定を読み、文言を解決する。Provider の中でしか描画されないので Context は必ずある。
51
+ * 文言は `texts` / `local` / `remote` が変わったときだけ解決し直す(`texts` の変更は表示中のモーダルに即座に反映される)
52
+ */
53
+ export declare const useDefaultUiContext: () => DefaultUiContext;
54
+ /** {@link ActionButton} の props */
55
+ export type ActionButtonProps = {
56
+ label: string;
57
+ onPress: () => void;
58
+ /** 塗りの色。無ければ文字だけのボタン(Warning の「あとで」) */
59
+ backgroundColor?: ColorValue;
60
+ /** 文字の色 */
61
+ color: ColorValue;
62
+ };
63
+ /**
64
+ * ボタン(デザイン: 高さ 50・radius 12・文字 16/600)。高さはフォントスケールで伸びるよう `minHeight` にする(デザインから意図的に変える点)。
65
+ * 押している間だけ `opacity: 0.7`(デザインに無いので決めた値)。`allowFontScaling` は切らない(既定 true)
66
+ */
67
+ export declare const ActionButton: ({ label, onPress, backgroundColor, color, }: ActionButtonProps) => import("react").JSX.Element;
68
+ /** タイトル(デザイン: 20/28 bold)。フォントはプラットフォーム標準(fontFamily は指定しない) */
69
+ export declare const titleStyle: TextStyle;
70
+ /** 本文(デザイン: 15/22) */
71
+ export declare const messageStyle: TextStyle;
72
+ //# sourceMappingURL=defaultUi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultUi.d.ts","sourceRoot":"","sources":["../../src/react/defaultUi.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,mBAAmB,EAIxB,KAAK,SAAS,EAEf,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAgB,KAAK,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EACL,KAAK,mBAAmB,EAGxB,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAC;AAE9B;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS;IACT,GAAG,EAAE,MAAM,CAAC;IACZ,kDAAkD;IAClD,OAAO,EAAE,UAAU,CAAC;IACpB,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,oBAAoB;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,aAAa,EAAE,UAAU,CAAC;CAC3B,CAAC;AAEF,uDAAuD;AACvD,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,OAAO,GAAG,MAAM,EAAE,OAAO,CAmBtD,CAAC;AAEF,2DAA2D;AAC3D,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C;;;GAGG;AACH,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAYrC;;;GAGG;AACH,eAAO,MAAM,UAAU,QAAO,OAU7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,SAClB,mBAAmB,GAAG,SAAS,KACpC,mBAAmB,GAAG,SAGxB,CAAC;AAEF,+EAA+E;AAC/E,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,qBAAqB,CAAC;IAC7B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,KAAK,EAAE,yBAAyB,CAAC;CAClC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAO,gBAgBtC,CAAC;AAEF,mCAAmC;AACnC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,wCAAwC;IACxC,eAAe,CAAC,EAAE,UAAU,CAAC;IAC7B,WAAW;IACX,KAAK,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,gDAKtB,iBAAiB,gCAYnB,CAAC;AAEF,gEAAgE;AAChE,eAAO,MAAM,UAAU,EAAE,SAIxB,CAAC;AAEF,sBAAsB;AACtB,eAAO,MAAM,YAAY,EAAE,SAG1B,CAAC"}