@forthtilliath/react-native-kit 0.13.0 → 0.14.0
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/README.md +18 -116
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +0 -1
- package/dist/components/picker/PickerModal.d.ts +2 -29
- package/dist/components/picker/PickerModal.d.ts.map +1 -1
- package/dist/components/picker/PickerModal.js +10 -112
- package/dist/components/picker/PickerModal.styles.d.ts +32 -0
- package/dist/components/picker/PickerModal.styles.d.ts.map +1 -0
- package/dist/components/picker/PickerModal.styles.js +82 -0
- package/dist/components/picker/PickerModalRow.d.ts +17 -0
- package/dist/components/picker/PickerModalRow.d.ts.map +1 -0
- package/dist/components/picker/PickerModalRow.js +11 -0
- package/dist/components/picker/usePickerModalSections.d.ts +7 -0
- package/dist/components/picker/usePickerModalSections.d.ts.map +1 -0
- package/dist/components/picker/usePickerModalSections.js +28 -0
- package/dist/components/settings/UpdateSettingsScreen.d.ts +2 -46
- package/dist/components/settings/UpdateSettingsScreen.d.ts.map +1 -1
- package/dist/components/settings/UpdateSettingsScreen.js +4 -78
- package/dist/components/settings/UpdateSettingsScreen.styles.d.ts +49 -0
- package/dist/components/settings/UpdateSettingsScreen.styles.d.ts.map +1 -0
- package/dist/components/settings/UpdateSettingsScreen.styles.js +76 -0
- package/dist/components/settings/UpdateSettingsScreenHistory.d.ts +20 -0
- package/dist/components/settings/UpdateSettingsScreenHistory.d.ts.map +1 -0
- package/dist/components/settings/UpdateSettingsScreenHistory.js +10 -0
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +0 -1
- package/dist/index.d.ts +8 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -11
- package/dist/utils/helpers/index.d.ts +1 -6
- package/dist/utils/helpers/index.d.ts.map +1 -1
- package/dist/utils/helpers/index.js +1 -6
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -1
- package/package.json +4 -3
- package/dist/components/update/ChangelogNotes.d.ts +0 -22
- package/dist/components/update/ChangelogNotes.d.ts.map +0 -1
- package/dist/components/update/ChangelogNotes.js +0 -51
- package/dist/components/update/UpdateAvailableBanner.d.ts +0 -29
- package/dist/components/update/UpdateAvailableBanner.d.ts.map +0 -1
- package/dist/components/update/UpdateAvailableBanner.js +0 -63
- package/dist/components/update/index.d.ts +0 -3
- package/dist/components/update/index.d.ts.map +0 -1
- package/dist/components/update/index.js +0 -2
- package/dist/hooks/useUpdateCheck.d.ts +0 -35
- package/dist/hooks/useUpdateCheck.d.ts.map +0 -1
- package/dist/hooks/useUpdateCheck.js +0 -47
- package/dist/utils/format/escapeCsvField.d.ts +0 -2
- package/dist/utils/format/escapeCsvField.d.ts.map +0 -1
- package/dist/utils/format/escapeCsvField.js +0 -8
- package/dist/utils/format/escapeHtml.d.ts +0 -2
- package/dist/utils/format/escapeHtml.d.ts.map +0 -1
- package/dist/utils/format/escapeHtml.js +0 -9
- package/dist/utils/format/formatCsvNumber.d.ts +0 -2
- package/dist/utils/format/formatCsvNumber.d.ts.map +0 -1
- package/dist/utils/format/formatCsvNumber.js +0 -6
- package/dist/utils/format/index.d.ts +0 -4
- package/dist/utils/format/index.d.ts.map +0 -1
- package/dist/utils/format/index.js +0 -3
- package/dist/utils/helpers/getMostRecentIds.d.ts +0 -6
- package/dist/utils/helpers/getMostRecentIds.d.ts.map +0 -1
- package/dist/utils/helpers/getMostRecentIds.js +0 -19
- package/dist/utils/helpers/getPeriodStartMs.d.ts +0 -3
- package/dist/utils/helpers/getPeriodStartMs.d.ts.map +0 -1
- package/dist/utils/helpers/getPeriodStartMs.js +0 -14
- package/dist/utils/helpers/nextInCycle.d.ts +0 -2
- package/dist/utils/helpers/nextInCycle.d.ts.map +0 -1
- package/dist/utils/helpers/nextInCycle.js +0 -9
- package/dist/utils/helpers/normalizeForSearch.d.ts +0 -2
- package/dist/utils/helpers/normalizeForSearch.d.ts.map +0 -1
- package/dist/utils/helpers/normalizeForSearch.js +0 -15
- package/dist/utils/helpers/rankByNameMatch.d.ts +0 -2
- package/dist/utils/helpers/rankByNameMatch.d.ts.map +0 -1
- package/dist/utils/helpers/rankByNameMatch.js +0 -33
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateSettingsScreen.d.ts","sourceRoot":"","sources":["../../../src/components/settings/UpdateSettingsScreen.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UpdateSettingsScreen.d.ts","sourceRoot":"","sources":["../../../src/components/settings/UpdateSettingsScreen.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,gCAAgC,EAChC,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,EAC3B,MAAM,kCAAkC,CAAC;AAI1C,YAAY,EACV,gCAAgC,EAChC,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,kCAAkC,CAAC;AAU1C,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,MAAM,CAAC;IACvB,wEAAwE;IACxE,cAAc,EAAE,MAAM,OAAO,CAAC,2BAA2B,GAAG,IAAI,CAAC,CAAC;IAClE,mEAAmE;IACnE,eAAe,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAClD,qBAAqB,EAAE,CACrB,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,KACpC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,yDAAyD;IACzD,mBAAmB,CAAC,EAAE,MAAM,OAAO,CAAC,gCAAgC,EAAE,CAAC,CAAC;IACxE,8EAA8E;IAC9E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,0BAA0B,CAAC;IACpC,MAAM,CAAC,EAAE,0BAA0B,CAAC;CACrC;AAQD,wBAAgB,oBAAoB,CAAC,EACnC,cAAc,EACd,cAAc,EACd,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,UAAoB,EACpB,MAAM,EACN,MAAM,GACP,EAAE,yBAAyB,+BAkL3B"}
|
|
@@ -1,83 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
3
3
|
import { ActivityIndicator, Pressable, Text, View } from "react-native";
|
|
4
|
-
import { ChangelogNotes } from "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
checkButton: "Rechercher une mise à jour",
|
|
8
|
-
upToDate: "Tu as déjà la dernière version.",
|
|
9
|
-
checkError: "Impossible de vérifier les mises à jour.",
|
|
10
|
-
downloadError: "Le téléchargement a échoué.",
|
|
11
|
-
availableTitle: (version) => `Version ${version} disponible`,
|
|
12
|
-
installButton: () => "Télécharger et installer",
|
|
13
|
-
installButtonAccessibilityLabel: (version) => `Télécharger et installer la version ${version}`,
|
|
14
|
-
downloadingLabel: (percent) => `Téléchargement… ${String(percent)}%`,
|
|
15
|
-
downloadingHint: "Ton téléphone va ensuite te demander confirmation pour installer la mise à jour.",
|
|
16
|
-
historyTitle: "Historique des versions",
|
|
17
|
-
};
|
|
18
|
-
const defaultStyles = {
|
|
19
|
-
container: { gap: 4 },
|
|
20
|
-
infoBox: {
|
|
21
|
-
backgroundColor: "#ffffff",
|
|
22
|
-
borderWidth: 1,
|
|
23
|
-
borderColor: "#e5e7eb",
|
|
24
|
-
borderRadius: 10,
|
|
25
|
-
padding: 14,
|
|
26
|
-
marginBottom: 8,
|
|
27
|
-
},
|
|
28
|
-
infoLabel: { fontSize: 13, fontWeight: "600", color: "#6b7280" },
|
|
29
|
-
infoValue: {
|
|
30
|
-
fontSize: 18,
|
|
31
|
-
fontWeight: "700",
|
|
32
|
-
color: "#111827",
|
|
33
|
-
marginTop: 2,
|
|
34
|
-
},
|
|
35
|
-
helpText: { fontSize: 12, color: "#6b7280", marginTop: 8 },
|
|
36
|
-
errorText: { fontSize: 12, color: "#dc2626", marginTop: 8 },
|
|
37
|
-
button: {
|
|
38
|
-
backgroundColor: "#2563eb",
|
|
39
|
-
borderRadius: 10,
|
|
40
|
-
paddingVertical: 14,
|
|
41
|
-
alignItems: "center",
|
|
42
|
-
marginTop: 8,
|
|
43
|
-
},
|
|
44
|
-
buttonDisabled: { opacity: 0.6 },
|
|
45
|
-
buttonText: { color: "#ffffff", fontSize: 16, fontWeight: "700" },
|
|
46
|
-
activityIndicatorColor: "#ffffff",
|
|
47
|
-
updateAvailableBox: {
|
|
48
|
-
backgroundColor: "#ffffff",
|
|
49
|
-
borderWidth: 1,
|
|
50
|
-
borderColor: "#e5e7eb",
|
|
51
|
-
borderRadius: 10,
|
|
52
|
-
padding: 14,
|
|
53
|
-
marginTop: 12,
|
|
54
|
-
gap: 4,
|
|
55
|
-
},
|
|
56
|
-
updateAvailableTitle: { fontSize: 15, fontWeight: "700", color: "#111827" },
|
|
57
|
-
changelog: { marginTop: 28 },
|
|
58
|
-
changelogTitle: {
|
|
59
|
-
fontSize: 15,
|
|
60
|
-
fontWeight: "700",
|
|
61
|
-
color: "#111827",
|
|
62
|
-
marginBottom: 8,
|
|
63
|
-
},
|
|
64
|
-
changelogEntry: {
|
|
65
|
-
backgroundColor: "#ffffff",
|
|
66
|
-
borderWidth: 1,
|
|
67
|
-
borderColor: "#e5e7eb",
|
|
68
|
-
borderRadius: 10,
|
|
69
|
-
padding: 14,
|
|
70
|
-
marginBottom: 8,
|
|
71
|
-
},
|
|
72
|
-
changelogEntryHeader: {
|
|
73
|
-
flexDirection: "row",
|
|
74
|
-
justifyContent: "space-between",
|
|
75
|
-
alignItems: "center",
|
|
76
|
-
},
|
|
77
|
-
changelogVersion: { fontSize: 14, fontWeight: "700", color: "#111827" },
|
|
78
|
-
changelogDate: { fontSize: 12, color: "#6b7280" },
|
|
79
|
-
notes: undefined,
|
|
80
|
-
};
|
|
4
|
+
import { ChangelogNotes } from "@forthtilliath/expo-release-updates-ui";
|
|
5
|
+
import { defaultLabels, defaultStyles } from "./UpdateSettingsScreen.styles.js";
|
|
6
|
+
import { UpdateSettingsScreenHistory } from "./UpdateSettingsScreenHistory.js";
|
|
81
7
|
// Full "check for update" screen: installed version, a manual check button,
|
|
82
8
|
// the available-update box (with changelog + install button) or an
|
|
83
9
|
// up-to-date/error message, download progress, and — if
|
|
@@ -174,5 +100,5 @@ export function UpdateSettingsScreen({ currentVersion, checkForUpdate, compareVe
|
|
|
174
100
|
void handleCheckForUpdate();
|
|
175
101
|
}, disabled: isBusy, accessibilityRole: "button", accessibilityLabel: t.checkButton, children: updateState.status === "checking" ? (_jsx(ActivityIndicator, { color: activityIndicatorColor })) : (_jsx(Text, { style: merged.buttonText, children: t.checkButton })) })), updateState.status === "up-to-date" && (_jsx(Text, { style: merged.helpText, children: t.upToDate })), updateState.status === "error" && (_jsx(Text, { style: merged.errorText, children: updateState.message })), updateState.status === "available" && (_jsxs(View, { style: merged.updateAvailableBox, children: [_jsx(Text, { style: merged.updateAvailableTitle, children: t.availableTitle(updateState.release.version) }), updateState.release.notes ? (_jsx(ChangelogNotes, { notes: updateState.release.notes, styles: merged.notes })) : null, _jsx(Pressable, { style: merged.button, onPress: () => {
|
|
176
102
|
void handleInstall(updateState.release.apkUrl);
|
|
177
|
-
}, accessibilityRole: "button", accessibilityLabel: t.installButtonAccessibilityLabel(updateState.release.version), children: _jsx(Text, { style: merged.buttonText, children: t.installButton(updateState.release.version) }) })] })), updateState.status === "downloading" && (_jsxs(View, { style: merged.updateAvailableBox, children: [_jsx(Text, { style: merged.helpText, children: t.downloadingLabel(Math.round(updateState.progress * 100)) }), _jsx(Text, { style: merged.helpText, children: t.downloadingHint })] })), releaseHistory && releaseHistory.length > 0 && (
|
|
103
|
+
}, accessibilityRole: "button", accessibilityLabel: t.installButtonAccessibilityLabel(updateState.release.version), children: _jsx(Text, { style: merged.buttonText, children: t.installButton(updateState.release.version) }) })] })), updateState.status === "downloading" && (_jsxs(View, { style: merged.updateAvailableBox, children: [_jsx(Text, { style: merged.helpText, children: t.downloadingLabel(Math.round(updateState.progress * 100)) }), _jsx(Text, { style: merged.helpText, children: t.downloadingHint })] })), releaseHistory && releaseHistory.length > 0 && (_jsx(UpdateSettingsScreenHistory, { releaseHistory: releaseHistory, historyTitle: t.historyTitle, dateLocale: dateLocale, notesStyles: notesStyles, styles: merged }))] }));
|
|
178
104
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
2
|
+
import type { ChangelogNotesStyles } from "@forthtilliath/expo-release-updates-ui";
|
|
3
|
+
export interface UpdateSettingsScreenRelease {
|
|
4
|
+
version: string;
|
|
5
|
+
notes: string;
|
|
6
|
+
apkUrl: string;
|
|
7
|
+
}
|
|
8
|
+
export interface UpdateSettingsScreenHistoryEntry {
|
|
9
|
+
version: string;
|
|
10
|
+
notes: string;
|
|
11
|
+
publishedAt?: string | null;
|
|
12
|
+
}
|
|
13
|
+
export interface UpdateSettingsScreenLabels {
|
|
14
|
+
installedVersionLabel?: string;
|
|
15
|
+
checkButton?: string;
|
|
16
|
+
upToDate?: string;
|
|
17
|
+
checkError?: string;
|
|
18
|
+
downloadError?: string;
|
|
19
|
+
availableTitle?: (version: string) => string;
|
|
20
|
+
installButton?: (version: string) => string;
|
|
21
|
+
installButtonAccessibilityLabel?: (version: string) => string;
|
|
22
|
+
downloadingLabel?: (percent: number) => string;
|
|
23
|
+
downloadingHint?: string;
|
|
24
|
+
historyTitle?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface UpdateSettingsScreenStyles {
|
|
27
|
+
container?: StyleProp<ViewStyle>;
|
|
28
|
+
infoBox?: StyleProp<ViewStyle>;
|
|
29
|
+
infoLabel?: StyleProp<TextStyle>;
|
|
30
|
+
infoValue?: StyleProp<TextStyle>;
|
|
31
|
+
helpText?: StyleProp<TextStyle>;
|
|
32
|
+
errorText?: StyleProp<TextStyle>;
|
|
33
|
+
button?: StyleProp<ViewStyle>;
|
|
34
|
+
buttonDisabled?: StyleProp<ViewStyle>;
|
|
35
|
+
buttonText?: StyleProp<TextStyle>;
|
|
36
|
+
activityIndicatorColor?: string;
|
|
37
|
+
updateAvailableBox?: StyleProp<ViewStyle>;
|
|
38
|
+
updateAvailableTitle?: StyleProp<TextStyle>;
|
|
39
|
+
changelog?: StyleProp<ViewStyle>;
|
|
40
|
+
changelogTitle?: StyleProp<TextStyle>;
|
|
41
|
+
changelogEntry?: StyleProp<ViewStyle>;
|
|
42
|
+
changelogEntryHeader?: StyleProp<ViewStyle>;
|
|
43
|
+
changelogVersion?: StyleProp<TextStyle>;
|
|
44
|
+
changelogDate?: StyleProp<TextStyle>;
|
|
45
|
+
notes?: ChangelogNotesStyles;
|
|
46
|
+
}
|
|
47
|
+
export declare const defaultLabels: Required<UpdateSettingsScreenLabels>;
|
|
48
|
+
export declare const defaultStyles: Required<Omit<UpdateSettingsScreenStyles, "activityIndicatorColor" | "notes">> & Pick<UpdateSettingsScreenStyles, "activityIndicatorColor" | "notes">;
|
|
49
|
+
//# sourceMappingURL=UpdateSettingsScreen.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpdateSettingsScreen.styles.d.ts","sourceRoot":"","sources":["../../../src/components/settings/UpdateSettingsScreen.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAEnF,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB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AC,SAAS,CAAC,CAAC;IAC1C,oBAAoB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5C,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACjC,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,oBAAoB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5C,gBAAgB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACxC,aAAa,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACrC,KAAK,CAAC,EAAE,oBAAoB,CAAC;CAC9B;AAED,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,0BAA0B,CAc9D,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAClC,IAAI,CAAC,0BAA0B,EAAE,wBAAwB,GAAG,OAAO,CAAC,CACrE,GACC,IAAI,CAAC,0BAA0B,EAAE,wBAAwB,GAAG,OAAO,CA8DpE,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export const defaultLabels = {
|
|
2
|
+
installedVersionLabel: "Version installée",
|
|
3
|
+
checkButton: "Rechercher une mise à jour",
|
|
4
|
+
upToDate: "Tu as déjà la dernière version.",
|
|
5
|
+
checkError: "Impossible de vérifier les mises à jour.",
|
|
6
|
+
downloadError: "Le téléchargement a échoué.",
|
|
7
|
+
availableTitle: (version) => `Version ${version} disponible`,
|
|
8
|
+
installButton: () => "Télécharger et installer",
|
|
9
|
+
installButtonAccessibilityLabel: (version) => `Télécharger et installer la version ${version}`,
|
|
10
|
+
downloadingLabel: (percent) => `Téléchargement… ${String(percent)}%`,
|
|
11
|
+
downloadingHint: "Ton téléphone va ensuite te demander confirmation pour installer la mise à jour.",
|
|
12
|
+
historyTitle: "Historique des versions",
|
|
13
|
+
};
|
|
14
|
+
export const defaultStyles = {
|
|
15
|
+
container: { gap: 4 },
|
|
16
|
+
infoBox: {
|
|
17
|
+
backgroundColor: "#ffffff",
|
|
18
|
+
borderWidth: 1,
|
|
19
|
+
borderColor: "#e5e7eb",
|
|
20
|
+
borderRadius: 10,
|
|
21
|
+
padding: 14,
|
|
22
|
+
marginBottom: 8,
|
|
23
|
+
},
|
|
24
|
+
infoLabel: { fontSize: 13, fontWeight: "600", color: "#6b7280" },
|
|
25
|
+
infoValue: {
|
|
26
|
+
fontSize: 18,
|
|
27
|
+
fontWeight: "700",
|
|
28
|
+
color: "#111827",
|
|
29
|
+
marginTop: 2,
|
|
30
|
+
},
|
|
31
|
+
helpText: { fontSize: 12, color: "#6b7280", marginTop: 8 },
|
|
32
|
+
errorText: { fontSize: 12, color: "#dc2626", marginTop: 8 },
|
|
33
|
+
button: {
|
|
34
|
+
backgroundColor: "#2563eb",
|
|
35
|
+
borderRadius: 10,
|
|
36
|
+
paddingVertical: 14,
|
|
37
|
+
alignItems: "center",
|
|
38
|
+
marginTop: 8,
|
|
39
|
+
},
|
|
40
|
+
buttonDisabled: { opacity: 0.6 },
|
|
41
|
+
buttonText: { color: "#ffffff", fontSize: 16, fontWeight: "700" },
|
|
42
|
+
activityIndicatorColor: "#ffffff",
|
|
43
|
+
updateAvailableBox: {
|
|
44
|
+
backgroundColor: "#ffffff",
|
|
45
|
+
borderWidth: 1,
|
|
46
|
+
borderColor: "#e5e7eb",
|
|
47
|
+
borderRadius: 10,
|
|
48
|
+
padding: 14,
|
|
49
|
+
marginTop: 12,
|
|
50
|
+
gap: 4,
|
|
51
|
+
},
|
|
52
|
+
updateAvailableTitle: { fontSize: 15, fontWeight: "700", color: "#111827" },
|
|
53
|
+
changelog: { marginTop: 28 },
|
|
54
|
+
changelogTitle: {
|
|
55
|
+
fontSize: 15,
|
|
56
|
+
fontWeight: "700",
|
|
57
|
+
color: "#111827",
|
|
58
|
+
marginBottom: 8,
|
|
59
|
+
},
|
|
60
|
+
changelogEntry: {
|
|
61
|
+
backgroundColor: "#ffffff",
|
|
62
|
+
borderWidth: 1,
|
|
63
|
+
borderColor: "#e5e7eb",
|
|
64
|
+
borderRadius: 10,
|
|
65
|
+
padding: 14,
|
|
66
|
+
marginBottom: 8,
|
|
67
|
+
},
|
|
68
|
+
changelogEntryHeader: {
|
|
69
|
+
flexDirection: "row",
|
|
70
|
+
justifyContent: "space-between",
|
|
71
|
+
alignItems: "center",
|
|
72
|
+
},
|
|
73
|
+
changelogVersion: { fontSize: 14, fontWeight: "700", color: "#111827" },
|
|
74
|
+
changelogDate: { fontSize: 12, color: "#6b7280" },
|
|
75
|
+
notes: undefined,
|
|
76
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
2
|
+
import type { ChangelogNotesStyles } from "@forthtilliath/expo-release-updates-ui";
|
|
3
|
+
import type { UpdateSettingsScreenHistoryEntry } from "./UpdateSettingsScreen.styles.js";
|
|
4
|
+
export interface UpdateSettingsScreenHistoryStyles {
|
|
5
|
+
changelog: StyleProp<ViewStyle>;
|
|
6
|
+
changelogTitle: StyleProp<TextStyle>;
|
|
7
|
+
changelogEntry: StyleProp<ViewStyle>;
|
|
8
|
+
changelogEntryHeader: StyleProp<ViewStyle>;
|
|
9
|
+
changelogVersion: StyleProp<TextStyle>;
|
|
10
|
+
changelogDate: StyleProp<TextStyle>;
|
|
11
|
+
}
|
|
12
|
+
export interface UpdateSettingsScreenHistoryProps {
|
|
13
|
+
releaseHistory: UpdateSettingsScreenHistoryEntry[];
|
|
14
|
+
historyTitle: string;
|
|
15
|
+
dateLocale: string;
|
|
16
|
+
notesStyles: ChangelogNotesStyles;
|
|
17
|
+
styles: UpdateSettingsScreenHistoryStyles;
|
|
18
|
+
}
|
|
19
|
+
export declare function UpdateSettingsScreenHistory({ releaseHistory, historyTitle, dateLocale, notesStyles, styles, }: UpdateSettingsScreenHistoryProps): import("react").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=UpdateSettingsScreenHistory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpdateSettingsScreenHistory.d.ts","sourceRoot":"","sources":["../../../src/components/settings/UpdateSettingsScreenHistory.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAGnF,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,kCAAkC,CAAC;AAEzF,MAAM,WAAW,iCAAiC;IAChD,SAAS,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAChC,cAAc,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACrC,cAAc,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACrC,oBAAoB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC3C,gBAAgB,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACvC,aAAa,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,gCAAgC;IAC/C,cAAc,EAAE,gCAAgC,EAAE,CAAC;IACnD,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,oBAAoB,CAAC;IAClC,MAAM,EAAE,iCAAiC,CAAC;CAC3C;AAMD,wBAAgB,2BAA2B,CAAC,EAC1C,cAAc,EACd,YAAY,EACZ,UAAU,EACV,WAAW,EACX,MAAM,GACP,EAAE,gCAAgC,+BAqBlC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text, View } from "react-native";
|
|
3
|
+
import { ChangelogNotes } from "@forthtilliath/expo-release-updates-ui";
|
|
4
|
+
// Past-releases list shown below the "check for update" box, one entry per
|
|
5
|
+
// release (version, publish date, changelog). Extracted from
|
|
6
|
+
// UpdateSettingsScreen to keep that file under the project's
|
|
7
|
+
// 300-line-per-file rule.
|
|
8
|
+
export function UpdateSettingsScreenHistory({ releaseHistory, historyTitle, dateLocale, notesStyles, styles, }) {
|
|
9
|
+
return (_jsxs(View, { style: styles.changelog, children: [_jsx(Text, { style: styles.changelogTitle, children: historyTitle }), releaseHistory.map((release) => (_jsxs(View, { style: styles.changelogEntry, children: [_jsxs(View, { style: styles.changelogEntryHeader, children: [_jsxs(Text, { style: styles.changelogVersion, children: ["v", release.version] }), release.publishedAt ? (_jsx(Text, { style: styles.changelogDate, children: new Date(release.publishedAt).toLocaleDateString(dateLocale) })) : null] }), release.notes ? (_jsx(ChangelogNotes, { notes: release.notes, styles: notesStyles })) : null] }, release.version)))] }));
|
|
10
|
+
}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC"}
|
package/dist/hooks/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -14,19 +14,16 @@ export * from "./components/settings/ThemeSettingsScreen.js";
|
|
|
14
14
|
export * from "./components/settings/UpdateSettingsScreen.js";
|
|
15
15
|
export * from "./components/theme/ThemeOptionList.js";
|
|
16
16
|
export * from "./components/theme/ThemeToggle.js";
|
|
17
|
-
export * from "./components/update/ChangelogNotes.js";
|
|
18
|
-
export * from "./components/update/UpdateAvailableBanner.js";
|
|
19
17
|
export * from "./hooks/useDebouncedChange.js";
|
|
20
18
|
export * from "./hooks/useEffectiveColorScheme.js";
|
|
21
19
|
export * from "./hooks/useSubmitGuard.js";
|
|
22
|
-
export * from "./hooks/useUpdateCheck.js";
|
|
23
|
-
export * from "./utils/format/escapeCsvField.js";
|
|
24
|
-
export * from "./utils/format/escapeHtml.js";
|
|
25
|
-
export * from "./utils/format/formatCsvNumber.js";
|
|
26
20
|
export * from "./utils/helpers/confirmDestructive.js";
|
|
27
|
-
export
|
|
28
|
-
export
|
|
29
|
-
export
|
|
30
|
-
export
|
|
31
|
-
export
|
|
21
|
+
export { getMostRecentIds, type RecentIdRow, } from "@forthtilliath/ts-kit/array/getMostRecentIds";
|
|
22
|
+
export { nextInCycle } from "@forthtilliath/ts-kit/array/nextInCycle";
|
|
23
|
+
export { rankByNameMatch } from "@forthtilliath/ts-kit/array/rankByNameMatch";
|
|
24
|
+
export { getPeriodStartMs, type PeriodFilter, } from "@forthtilliath/ts-kit/date/getPeriodStartMs";
|
|
25
|
+
export { formatCsvNumber } from "@forthtilliath/ts-kit/number/formatCsvNumber";
|
|
26
|
+
export { escapeCsvField } from "@forthtilliath/ts-kit/string/escapeCsvField";
|
|
27
|
+
export { escapeHtml } from "@forthtilliath/ts-kit/string/escapeHtml";
|
|
28
|
+
export { normalizeForSearch } from "@forthtilliath/ts-kit/string/normalizeForSearch";
|
|
32
29
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,0CAA0C,CAAC;AACzD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cA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
|
package/dist/index.js
CHANGED
|
@@ -19,18 +19,17 @@ export * from "./components/settings/ThemeSettingsScreen.js";
|
|
|
19
19
|
export * from "./components/settings/UpdateSettingsScreen.js";
|
|
20
20
|
export * from "./components/theme/ThemeOptionList.js";
|
|
21
21
|
export * from "./components/theme/ThemeToggle.js";
|
|
22
|
-
export * from "./components/update/ChangelogNotes.js";
|
|
23
|
-
export * from "./components/update/UpdateAvailableBanner.js";
|
|
24
22
|
export * from "./hooks/useDebouncedChange.js";
|
|
25
23
|
export * from "./hooks/useEffectiveColorScheme.js";
|
|
26
24
|
export * from "./hooks/useSubmitGuard.js";
|
|
27
|
-
export * from "./hooks/useUpdateCheck.js";
|
|
28
|
-
export * from "./utils/format/escapeCsvField.js";
|
|
29
|
-
export * from "./utils/format/escapeHtml.js";
|
|
30
|
-
export * from "./utils/format/formatCsvNumber.js";
|
|
31
25
|
export * from "./utils/helpers/confirmDestructive.js";
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
export
|
|
35
|
-
export
|
|
36
|
-
export
|
|
26
|
+
// Framework-agnostic — actually implemented (and tested/documented) in
|
|
27
|
+
// ts-kit, re-exported here so existing imports of these names keep working.
|
|
28
|
+
export { getMostRecentIds, } from "@forthtilliath/ts-kit/array/getMostRecentIds";
|
|
29
|
+
export { nextInCycle } from "@forthtilliath/ts-kit/array/nextInCycle";
|
|
30
|
+
export { rankByNameMatch } from "@forthtilliath/ts-kit/array/rankByNameMatch";
|
|
31
|
+
export { getPeriodStartMs, } from "@forthtilliath/ts-kit/date/getPeriodStartMs";
|
|
32
|
+
export { formatCsvNumber } from "@forthtilliath/ts-kit/number/formatCsvNumber";
|
|
33
|
+
export { escapeCsvField } from "@forthtilliath/ts-kit/string/escapeCsvField";
|
|
34
|
+
export { escapeHtml } from "@forthtilliath/ts-kit/string/escapeHtml";
|
|
35
|
+
export { normalizeForSearch } from "@forthtilliath/ts-kit/string/normalizeForSearch";
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
export * from "./confirmDestructive";
|
|
2
|
-
export * from "./getMostRecentIds";
|
|
3
|
-
export * from "./getPeriodStartMs";
|
|
4
|
-
export * from "./nextInCycle";
|
|
5
|
-
export * from "./normalizeForSearch";
|
|
6
|
-
export * from "./rankByNameMatch";
|
|
1
|
+
export * from "./confirmDestructive.js";
|
|
7
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
|
package/dist/utils/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forthtilliath/react-native-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"./*": "./dist/*.js"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@forthtilliath/expo-release-updates": "0.
|
|
24
|
+
"@forthtilliath/expo-release-updates-ui": "0.2.0",
|
|
25
|
+
"@forthtilliath/ts-kit": "0.4.0"
|
|
25
26
|
},
|
|
26
27
|
"peerDependencies": {
|
|
27
28
|
"@expo/vector-icons": ">=15.0.0",
|
|
@@ -44,7 +45,7 @@
|
|
|
44
45
|
"react-test-renderer": "19.2.3",
|
|
45
46
|
"typescript": "^5.9.3",
|
|
46
47
|
"vitest": "^4.1.10",
|
|
47
|
-
"@forthtilliath/eslint-config": "0.
|
|
48
|
+
"@forthtilliath/eslint-config": "0.4.2",
|
|
48
49
|
"@forthtilliath/typescript-config": "0.0.0"
|
|
49
50
|
},
|
|
50
51
|
"scripts": {
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
2
|
-
export interface ChangelogNotesStyles {
|
|
3
|
-
heading?: StyleProp<TextStyle>;
|
|
4
|
-
itemRow?: StyleProp<ViewStyle>;
|
|
5
|
-
bullet?: StyleProp<TextStyle>;
|
|
6
|
-
itemText?: StyleProp<TextStyle>;
|
|
7
|
-
text?: StyleProp<TextStyle>;
|
|
8
|
-
bold?: StyleProp<TextStyle>;
|
|
9
|
-
}
|
|
10
|
-
export interface ChangelogNotesProps {
|
|
11
|
-
/** Raw release notes, e.g. straight from a GitHub release body. */
|
|
12
|
-
notes: string;
|
|
13
|
-
/** Override any of the default styles to match your app's theme. */
|
|
14
|
-
styles?: ChangelogNotesStyles;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Renders GitHub-style release notes (parsed by `parseChangelogNotes`) as
|
|
18
|
-
* headings, bulleted items and bold-aware text, instead of showing the raw
|
|
19
|
-
* Markdown syntax in a plain `<Text>`.
|
|
20
|
-
*/
|
|
21
|
-
export declare function ChangelogNotes({ notes, styles }: ChangelogNotesProps): import("react").JSX.Element;
|
|
22
|
-
//# sourceMappingURL=ChangelogNotes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChangelogNotes.d.ts","sourceRoot":"","sources":["../../../src/components/update/ChangelogNotes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMpE,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC/B,MAAM,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC9B,QAAQ,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAChC,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC5B,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,mBAAmB;IAClC,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B;AA0BD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,mBAAmB,+BA+CpE"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Text, View } from "react-native";
|
|
3
|
-
import { parseChangelogNotes } from "@forthtilliath/expo-release-updates/parseChangelogNotes";
|
|
4
|
-
// Reasonable, neutral defaults so the component works with zero
|
|
5
|
-
// configuration — most consumers will still want to pass `styles` to match
|
|
6
|
-
// their own theme (colors, dark mode, ...), which this package has no
|
|
7
|
-
// opinion on.
|
|
8
|
-
const defaultStyles = {
|
|
9
|
-
heading: { fontSize: 13, fontWeight: "700", color: "#111827", marginTop: 8 },
|
|
10
|
-
itemRow: { flexDirection: "row", gap: 6, marginTop: 4 },
|
|
11
|
-
bullet: { fontSize: 13, color: "#6b7280" },
|
|
12
|
-
itemText: { flex: 1, fontSize: 13, color: "#6b7280" },
|
|
13
|
-
text: { fontSize: 13, color: "#6b7280" },
|
|
14
|
-
bold: { fontWeight: "700", color: "#111827" },
|
|
15
|
-
};
|
|
16
|
-
function renderSegments(segments, boldStyle) {
|
|
17
|
-
return segments.map((segment) => (_jsx(Text, { style: segment.bold ? boldStyle : undefined, children: segment.text }, segment.text)));
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Renders GitHub-style release notes (parsed by `parseChangelogNotes`) as
|
|
21
|
-
* headings, bulleted items and bold-aware text, instead of showing the raw
|
|
22
|
-
* Markdown syntax in a plain `<Text>`.
|
|
23
|
-
*/
|
|
24
|
-
export function ChangelogNotes({ notes, styles }) {
|
|
25
|
-
// Each field is merged as a style array (default, then override) rather
|
|
26
|
-
// than the override replacing the whole default outright — so passing e.g.
|
|
27
|
-
// `styles={{ heading: { color: "red" } }}` only changes the color instead
|
|
28
|
-
// of silently dropping the default's fontSize/fontWeight/marginTop too.
|
|
29
|
-
const merged = {
|
|
30
|
-
heading: [defaultStyles.heading, styles?.heading],
|
|
31
|
-
itemRow: [defaultStyles.itemRow, styles?.itemRow],
|
|
32
|
-
bullet: [defaultStyles.bullet, styles?.bullet],
|
|
33
|
-
itemText: [defaultStyles.itemText, styles?.itemText],
|
|
34
|
-
text: [defaultStyles.text, styles?.text],
|
|
35
|
-
bold: [defaultStyles.bold, styles?.bold],
|
|
36
|
-
};
|
|
37
|
-
const blocks = parseChangelogNotes(notes);
|
|
38
|
-
return (_jsx(_Fragment, { children: blocks.map((block, index) => {
|
|
39
|
-
// Blocks have no stable identity of their own (plain parsed lines),
|
|
40
|
-
// so the index is the only reasonable key — the list is never
|
|
41
|
-
// reordered or filtered after the initial parse.
|
|
42
|
-
const key = `${block.type}-${String(index)}`;
|
|
43
|
-
if (block.type === "heading") {
|
|
44
|
-
return (_jsx(Text, { style: merged.heading, children: block.text }, key));
|
|
45
|
-
}
|
|
46
|
-
if (block.type === "item") {
|
|
47
|
-
return (_jsxs(View, { style: merged.itemRow, children: [_jsx(Text, { style: merged.bullet, children: "\u2022" }), _jsx(Text, { style: merged.itemText, children: renderSegments(block.segments, merged.bold) })] }, key));
|
|
48
|
-
}
|
|
49
|
-
return (_jsx(Text, { style: merged.text, children: renderSegments(block.segments, merged.bold) }, key));
|
|
50
|
-
}) }));
|
|
51
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { StyleProp, TextStyle, ViewStyle } from "react-native";
|
|
2
|
-
import type { ChangelogNotesStyles } from "./ChangelogNotes.js";
|
|
3
|
-
export interface UpdateAvailableBannerStyles {
|
|
4
|
-
container?: StyleProp<ViewStyle>;
|
|
5
|
-
header?: StyleProp<ViewStyle>;
|
|
6
|
-
title?: StyleProp<TextStyle>;
|
|
7
|
-
notes?: ChangelogNotesStyles;
|
|
8
|
-
actionButton?: StyleProp<ViewStyle>;
|
|
9
|
-
actionButtonText?: StyleProp<TextStyle>;
|
|
10
|
-
dismissButton?: StyleProp<ViewStyle>;
|
|
11
|
-
dismissButtonText?: StyleProp<TextStyle>;
|
|
12
|
-
}
|
|
13
|
-
export interface UpdateAvailableBannerLabels {
|
|
14
|
-
title?: (version: string) => string;
|
|
15
|
-
action?: string;
|
|
16
|
-
dismiss?: string;
|
|
17
|
-
dismissAccessibilityLabel?: string;
|
|
18
|
-
}
|
|
19
|
-
export interface UpdateAvailableBannerProps {
|
|
20
|
-
version: string;
|
|
21
|
-
/** Raw release notes, passed straight to `ChangelogNotes`. */
|
|
22
|
-
notes: string;
|
|
23
|
-
onPress: () => void;
|
|
24
|
-
onDismiss: () => void;
|
|
25
|
-
labels?: UpdateAvailableBannerLabels;
|
|
26
|
-
styles?: UpdateAvailableBannerStyles;
|
|
27
|
-
}
|
|
28
|
-
export declare function UpdateAvailableBanner({ version, notes, onPress, onDismiss, labels, styles, }: UpdateAvailableBannerProps): import("react").JSX.Element;
|
|
29
|
-
//# sourceMappingURL=UpdateAvailableBanner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateAvailableBanner.d.ts","sourceRoot":"","sources":["../../../src/components/update/UpdateAvailableBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA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s as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Pressable, Text, View } from "react-native";
|
|
3
|
-
import { ChangelogNotes } from "./ChangelogNotes.js";
|
|
4
|
-
const defaultStyles = {
|
|
5
|
-
container: {
|
|
6
|
-
backgroundColor: "#ffffff",
|
|
7
|
-
borderWidth: 1,
|
|
8
|
-
borderColor: "#e5e7eb",
|
|
9
|
-
borderRadius: 10,
|
|
10
|
-
padding: 14,
|
|
11
|
-
gap: 8,
|
|
12
|
-
},
|
|
13
|
-
header: {
|
|
14
|
-
flexDirection: "row",
|
|
15
|
-
justifyContent: "space-between",
|
|
16
|
-
alignItems: "center",
|
|
17
|
-
},
|
|
18
|
-
title: { fontSize: 15, fontWeight: "700", color: "#111827" },
|
|
19
|
-
notes: {},
|
|
20
|
-
actionButton: {
|
|
21
|
-
backgroundColor: "#2563eb",
|
|
22
|
-
borderRadius: 10,
|
|
23
|
-
paddingVertical: 10,
|
|
24
|
-
alignItems: "center",
|
|
25
|
-
},
|
|
26
|
-
actionButtonText: { color: "#ffffff", fontSize: 14, fontWeight: "700" },
|
|
27
|
-
dismissButton: { padding: 4 },
|
|
28
|
-
dismissButtonText: { fontSize: 13, color: "#6b7280" },
|
|
29
|
-
};
|
|
30
|
-
const defaultLabels = {
|
|
31
|
-
title: (version) => `Version ${version} disponible`,
|
|
32
|
-
action: "Voir",
|
|
33
|
-
dismiss: "Fermer",
|
|
34
|
-
dismissAccessibilityLabel: "Fermer la notification de mise à jour",
|
|
35
|
-
};
|
|
36
|
-
// Dismissible banner announcing an available update: version, release notes
|
|
37
|
-
// (via `ChangelogNotes`), and an action + dismiss button. Has no opinion on
|
|
38
|
-
// what "action" does (e.g. navigate to an update screen) or on how/whether
|
|
39
|
-
// dismissal is persisted — both are left entirely to the caller.
|
|
40
|
-
export function UpdateAvailableBanner({ version, notes, onPress, onDismiss, labels, styles, }) {
|
|
41
|
-
// Style fields are merged as arrays (default, then override) so a partial
|
|
42
|
-
// override only changes the properties it specifies instead of replacing
|
|
43
|
-
// the whole default style object. `notes` is forwarded as-is to
|
|
44
|
-
// ChangelogNotes, which does its own equivalent merge against its defaults.
|
|
45
|
-
const merged = {
|
|
46
|
-
container: [defaultStyles.container, styles?.container],
|
|
47
|
-
header: [defaultStyles.header, styles?.header],
|
|
48
|
-
title: [defaultStyles.title, styles?.title],
|
|
49
|
-
notes: styles?.notes ?? defaultStyles.notes,
|
|
50
|
-
actionButton: [defaultStyles.actionButton, styles?.actionButton],
|
|
51
|
-
actionButtonText: [
|
|
52
|
-
defaultStyles.actionButtonText,
|
|
53
|
-
styles?.actionButtonText,
|
|
54
|
-
],
|
|
55
|
-
dismissButton: [defaultStyles.dismissButton, styles?.dismissButton],
|
|
56
|
-
dismissButtonText: [
|
|
57
|
-
defaultStyles.dismissButtonText,
|
|
58
|
-
styles?.dismissButtonText,
|
|
59
|
-
],
|
|
60
|
-
};
|
|
61
|
-
const t = { ...defaultLabels, ...labels };
|
|
62
|
-
return (_jsxs(View, { style: merged.container, children: [_jsxs(View, { style: merged.header, children: [_jsx(Text, { style: merged.title, children: t.title(version) }), _jsx(Pressable, { style: merged.dismissButton, onPress: onDismiss, accessibilityRole: "button", accessibilityLabel: t.dismissAccessibilityLabel, children: _jsx(Text, { style: merged.dismissButtonText, children: t.dismiss }) })] }), notes ? _jsx(ChangelogNotes, { notes: notes, styles: merged.notes }) : null, _jsx(Pressable, { style: merged.actionButton, onPress: onPress, accessibilityRole: "button", accessibilityLabel: t.action, children: _jsx(Text, { style: merged.actionButtonText, children: t.action }) })] }));
|
|
63
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/update/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC"}
|