@appsupportkit/support-sdk 0.2.0 → 0.4.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/lib/commonjs/api.js +61 -12
- package/lib/commonjs/api.js.map +1 -1
- package/lib/commonjs/components/BottomSheet.js +1 -1
- package/lib/commonjs/components/BottomSheet.js.map +1 -1
- package/lib/commonjs/components/LauncherButton.js +4 -4
- package/lib/commonjs/components/LauncherButton.js.map +1 -1
- package/lib/commonjs/components/SupportButton.js +192 -66
- package/lib/commonjs/components/SupportButton.js.map +1 -1
- package/lib/commonjs/components/icons.js +117 -110
- package/lib/commonjs/components/icons.js.map +1 -1
- package/lib/commonjs/components/primitives.js +3 -154
- package/lib/commonjs/components/primitives.js.map +1 -1
- package/lib/commonjs/components/screens/ChatScreen.js +487 -0
- package/lib/commonjs/components/screens/ChatScreen.js.map +1 -0
- package/lib/commonjs/components/screens/LanguageScreen.js +150 -0
- package/lib/commonjs/components/screens/LanguageScreen.js.map +1 -0
- package/lib/commonjs/i18n/index.js +101 -0
- package/lib/commonjs/i18n/index.js.map +1 -0
- package/lib/commonjs/i18n/languages.js +95 -0
- package/lib/commonjs/i18n/languages.js.map +1 -0
- package/lib/commonjs/i18n/strings/de.js +75 -0
- package/lib/commonjs/i18n/strings/de.js.map +1 -0
- package/lib/commonjs/i18n/strings/en.js +91 -0
- package/lib/commonjs/i18n/strings/en.js.map +1 -0
- package/lib/commonjs/i18n/strings/es.js +75 -0
- package/lib/commonjs/i18n/strings/es.js.map +1 -0
- package/lib/commonjs/i18n/strings/fr.js +75 -0
- package/lib/commonjs/i18n/strings/fr.js.map +1 -0
- package/lib/commonjs/i18n/strings/hi.js +75 -0
- package/lib/commonjs/i18n/strings/hi.js.map +1 -0
- package/lib/commonjs/i18n/strings/it.js +75 -0
- package/lib/commonjs/i18n/strings/it.js.map +1 -0
- package/lib/commonjs/i18n/strings/ja.js +75 -0
- package/lib/commonjs/i18n/strings/ja.js.map +1 -0
- package/lib/commonjs/i18n/strings/ko.js +75 -0
- package/lib/commonjs/i18n/strings/ko.js.map +1 -0
- package/lib/commonjs/i18n/strings/nl.js +75 -0
- package/lib/commonjs/i18n/strings/nl.js.map +1 -0
- package/lib/commonjs/i18n/strings/pl.js +75 -0
- package/lib/commonjs/i18n/strings/pl.js.map +1 -0
- package/lib/commonjs/i18n/strings/pt.js +75 -0
- package/lib/commonjs/i18n/strings/pt.js.map +1 -0
- package/lib/commonjs/i18n/strings/ru.js +75 -0
- package/lib/commonjs/i18n/strings/ru.js.map +1 -0
- package/lib/commonjs/i18n/strings/tr.js +75 -0
- package/lib/commonjs/i18n/strings/tr.js.map +1 -0
- package/lib/commonjs/i18n/strings/zh.js +75 -0
- package/lib/commonjs/i18n/strings/zh.js.map +1 -0
- package/lib/commonjs/index.js +38 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/push.js +78 -3
- package/lib/commonjs/push.js.map +1 -1
- package/lib/commonjs/review.js +54 -0
- package/lib/commonjs/review.js.map +1 -0
- package/lib/commonjs/theme.js +142 -23
- package/lib/commonjs/theme.js.map +1 -1
- package/lib/commonjs/types.js +32 -3
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/useSupportThreads.js +41 -24
- package/lib/commonjs/useSupportThreads.js.map +1 -1
- package/lib/commonjs/utils.js +25 -30
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/commonjs/version.js +13 -0
- package/lib/commonjs/version.js.map +1 -0
- package/lib/module/api.js +57 -10
- package/lib/module/api.js.map +1 -1
- package/lib/module/components/BottomSheet.js +1 -1
- package/lib/module/components/BottomSheet.js.map +1 -1
- package/lib/module/components/LauncherButton.js +5 -5
- package/lib/module/components/LauncherButton.js.map +1 -1
- package/lib/module/components/SupportButton.js +199 -73
- package/lib/module/components/SupportButton.js.map +1 -1
- package/lib/module/components/icons.js +115 -107
- package/lib/module/components/icons.js.map +1 -1
- package/lib/module/components/primitives.js +5 -147
- package/lib/module/components/primitives.js.map +1 -1
- package/lib/module/components/screens/ChatScreen.js +485 -0
- package/lib/module/components/screens/ChatScreen.js.map +1 -0
- package/lib/module/components/screens/LanguageScreen.js +147 -0
- package/lib/module/components/screens/LanguageScreen.js.map +1 -0
- package/lib/module/i18n/index.js +56 -0
- package/lib/module/i18n/index.js.map +1 -0
- package/lib/module/i18n/languages.js +88 -0
- package/lib/module/i18n/languages.js.map +1 -0
- package/lib/module/i18n/strings/de.js +71 -0
- package/lib/module/i18n/strings/de.js.map +1 -0
- package/lib/module/i18n/strings/en.js +87 -0
- package/lib/module/i18n/strings/en.js.map +1 -0
- package/lib/module/i18n/strings/es.js +71 -0
- package/lib/module/i18n/strings/es.js.map +1 -0
- package/lib/module/i18n/strings/fr.js +71 -0
- package/lib/module/i18n/strings/fr.js.map +1 -0
- package/lib/module/i18n/strings/hi.js +71 -0
- package/lib/module/i18n/strings/hi.js.map +1 -0
- package/lib/module/i18n/strings/it.js +71 -0
- package/lib/module/i18n/strings/it.js.map +1 -0
- package/lib/module/i18n/strings/ja.js +71 -0
- package/lib/module/i18n/strings/ja.js.map +1 -0
- package/lib/module/i18n/strings/ko.js +71 -0
- package/lib/module/i18n/strings/ko.js.map +1 -0
- package/lib/module/i18n/strings/nl.js +71 -0
- package/lib/module/i18n/strings/nl.js.map +1 -0
- package/lib/module/i18n/strings/pl.js +71 -0
- package/lib/module/i18n/strings/pl.js.map +1 -0
- package/lib/module/i18n/strings/pt.js +71 -0
- package/lib/module/i18n/strings/pt.js.map +1 -0
- package/lib/module/i18n/strings/ru.js +71 -0
- package/lib/module/i18n/strings/ru.js.map +1 -0
- package/lib/module/i18n/strings/tr.js +71 -0
- package/lib/module/i18n/strings/tr.js.map +1 -0
- package/lib/module/i18n/strings/zh.js +71 -0
- package/lib/module/i18n/strings/zh.js.map +1 -0
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/push.js +77 -3
- package/lib/module/push.js.map +1 -1
- package/lib/module/review.js +48 -0
- package/lib/module/review.js.map +1 -0
- package/lib/module/theme.js +141 -23
- package/lib/module/theme.js.map +1 -1
- package/lib/module/types.js +32 -3
- package/lib/module/types.js.map +1 -1
- package/lib/module/useSupportThreads.js +41 -24
- package/lib/module/useSupportThreads.js.map +1 -1
- package/lib/module/utils.js +24 -29
- package/lib/module/utils.js.map +1 -1
- package/lib/module/version.js +9 -0
- package/lib/module/version.js.map +1 -0
- package/lib/typescript/api.d.ts +40 -10
- package/lib/typescript/api.d.ts.map +1 -1
- package/lib/typescript/components/SupportButton.d.ts +2 -2
- package/lib/typescript/components/SupportButton.d.ts.map +1 -1
- package/lib/typescript/components/icons.d.ts +10 -14
- package/lib/typescript/components/icons.d.ts.map +1 -1
- package/lib/typescript/components/primitives.d.ts +3 -30
- package/lib/typescript/components/primitives.d.ts.map +1 -1
- package/lib/typescript/components/screens/ChatScreen.d.ts +21 -0
- package/lib/typescript/components/screens/ChatScreen.d.ts.map +1 -0
- package/lib/typescript/components/screens/LanguageScreen.d.ts +30 -0
- package/lib/typescript/components/screens/LanguageScreen.d.ts.map +1 -0
- package/lib/typescript/i18n/index.d.ts +15 -0
- package/lib/typescript/i18n/index.d.ts.map +1 -0
- package/lib/typescript/i18n/languages.d.ts +36 -0
- package/lib/typescript/i18n/languages.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/de.d.ts +3 -0
- package/lib/typescript/i18n/strings/de.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/en.d.ts +86 -0
- package/lib/typescript/i18n/strings/en.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/es.d.ts +3 -0
- package/lib/typescript/i18n/strings/es.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/fr.d.ts +3 -0
- package/lib/typescript/i18n/strings/fr.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/hi.d.ts +3 -0
- package/lib/typescript/i18n/strings/hi.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/it.d.ts +3 -0
- package/lib/typescript/i18n/strings/it.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/ja.d.ts +3 -0
- package/lib/typescript/i18n/strings/ja.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/ko.d.ts +3 -0
- package/lib/typescript/i18n/strings/ko.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/nl.d.ts +3 -0
- package/lib/typescript/i18n/strings/nl.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/pl.d.ts +3 -0
- package/lib/typescript/i18n/strings/pl.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/pt.d.ts +3 -0
- package/lib/typescript/i18n/strings/pt.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/ru.d.ts +3 -0
- package/lib/typescript/i18n/strings/ru.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/tr.d.ts +3 -0
- package/lib/typescript/i18n/strings/tr.d.ts.map +1 -0
- package/lib/typescript/i18n/strings/zh.d.ts +3 -0
- package/lib/typescript/i18n/strings/zh.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +4 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/push.d.ts +14 -2
- package/lib/typescript/push.d.ts.map +1 -1
- package/lib/typescript/review.d.ts +15 -0
- package/lib/typescript/review.d.ts.map +1 -0
- package/lib/typescript/theme.d.ts +23 -5
- package/lib/typescript/theme.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +86 -13
- package/lib/typescript/types.d.ts.map +1 -1
- package/lib/typescript/useSupportThreads.d.ts +20 -4
- package/lib/typescript/useSupportThreads.d.ts.map +1 -1
- package/lib/typescript/utils.d.ts +8 -6
- package/lib/typescript/utils.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +7 -0
- package/lib/typescript/version.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/api.ts +75 -23
- package/src/components/BottomSheet.tsx +1 -1
- package/src/components/LauncherButton.tsx +4 -4
- package/src/components/SupportButton.tsx +244 -86
- package/src/components/icons.tsx +96 -101
- package/src/components/primitives.tsx +9 -161
- package/src/components/screens/ChatScreen.tsx +541 -0
- package/src/components/screens/LanguageScreen.tsx +172 -0
- package/src/i18n/index.ts +81 -0
- package/src/i18n/languages.ts +106 -0
- package/src/i18n/strings/de.ts +81 -0
- package/src/i18n/strings/en.ts +97 -0
- package/src/i18n/strings/es.ts +80 -0
- package/src/i18n/strings/fr.ts +81 -0
- package/src/i18n/strings/hi.ts +80 -0
- package/src/i18n/strings/it.ts +80 -0
- package/src/i18n/strings/ja.ts +80 -0
- package/src/i18n/strings/ko.ts +79 -0
- package/src/i18n/strings/nl.ts +80 -0
- package/src/i18n/strings/pl.ts +80 -0
- package/src/i18n/strings/pt.ts +80 -0
- package/src/i18n/strings/ru.ts +80 -0
- package/src/i18n/strings/tr.ts +80 -0
- package/src/i18n/strings/zh.ts +78 -0
- package/src/index.tsx +13 -0
- package/src/push.ts +100 -2
- package/src/review.ts +54 -0
- package/src/theme.ts +182 -28
- package/src/types.ts +85 -13
- package/src/useSupportThreads.ts +61 -28
- package/src/utils.ts +27 -29
- package/src/version.ts +6 -0
- package/lib/commonjs/components/screens/ComposeScreen.js +0 -228
- package/lib/commonjs/components/screens/ComposeScreen.js.map +0 -1
- package/lib/commonjs/components/screens/HomeScreen.js +0 -286
- package/lib/commonjs/components/screens/HomeScreen.js.map +0 -1
- package/lib/commonjs/components/screens/ThreadScreen.js +0 -327
- package/lib/commonjs/components/screens/ThreadScreen.js.map +0 -1
- package/lib/module/components/screens/ComposeScreen.js +0 -224
- package/lib/module/components/screens/ComposeScreen.js.map +0 -1
- package/lib/module/components/screens/HomeScreen.js +0 -282
- package/lib/module/components/screens/HomeScreen.js.map +0 -1
- package/lib/module/components/screens/ThreadScreen.js +0 -325
- package/lib/module/components/screens/ThreadScreen.js.map +0 -1
- package/lib/typescript/components/screens/ComposeScreen.d.ts +0 -10
- package/lib/typescript/components/screens/ComposeScreen.d.ts.map +0 -1
- package/lib/typescript/components/screens/HomeScreen.d.ts +0 -14
- package/lib/typescript/components/screens/HomeScreen.d.ts.map +0 -1
- package/lib/typescript/components/screens/ThreadScreen.d.ts +0 -10
- package/lib/typescript/components/screens/ThreadScreen.d.ts.map +0 -1
- package/src/components/screens/ComposeScreen.tsx +0 -233
- package/src/components/screens/HomeScreen.tsx +0 -287
- package/src/components/screens/ThreadScreen.tsx +0 -397
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Translator } from '../../i18n';
|
|
2
|
+
import { type Language } from '../../i18n/languages';
|
|
3
|
+
import type { SupportTheme } from '../../theme';
|
|
4
|
+
/**
|
|
5
|
+
* The one-time language prompt, and the same screen again whenever the user
|
|
6
|
+
* changes their mind from the home header.
|
|
7
|
+
*
|
|
8
|
+
* Selecting a row re-renders the whole sheet in that language immediately —
|
|
9
|
+
* the confirmation button is the only way to see what you are choosing before
|
|
10
|
+
* you commit to it.
|
|
11
|
+
*/
|
|
12
|
+
export declare function LanguageScreen({ theme, strings, selected, onSelect, onConfirm, onBack, onDismiss, saving, error, }: {
|
|
13
|
+
theme: SupportTheme;
|
|
14
|
+
strings: Translator;
|
|
15
|
+
selected: Language;
|
|
16
|
+
onSelect: (language: Language) => void;
|
|
17
|
+
onConfirm: () => void;
|
|
18
|
+
/** Absent on first run: there is nothing to go back to yet. */
|
|
19
|
+
onBack?: () => void;
|
|
20
|
+
/**
|
|
21
|
+
* First run only — dismissing without choosing closes the sheet and leaves
|
|
22
|
+
* the preference unset, so the prompt appears again next time. Saving a
|
|
23
|
+
* language the user never actually picked would be worse: every message
|
|
24
|
+
* they write would be translated from the wrong one.
|
|
25
|
+
*/
|
|
26
|
+
onDismiss?: () => void;
|
|
27
|
+
saving: boolean;
|
|
28
|
+
error: string | null;
|
|
29
|
+
}): import("react").JSX.Element;
|
|
30
|
+
//# sourceMappingURL=LanguageScreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LanguageScreen.d.ts","sourceRoot":"","sources":["../../../../src/components/screens/LanguageScreen.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAGL,KAAK,QAAQ,EACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAShD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,MAAM,EACN,SAAS,EACT,MAAM,EACN,KAAK,GACN,EAAE;IACD,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,UAAU,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,+BAuHA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Language } from './languages';
|
|
2
|
+
import { type StringKey, type StringTable } from './strings/en';
|
|
3
|
+
export interface Translator {
|
|
4
|
+
language: Language;
|
|
5
|
+
/**
|
|
6
|
+
* BCP-47 tag for Intl — dates and times stay in the user's chosen language
|
|
7
|
+
* rather than the device's, so a sheet never mixes the two.
|
|
8
|
+
*/
|
|
9
|
+
locale: string;
|
|
10
|
+
t: (key: StringKey, vars?: Record<string, string | number>) => string;
|
|
11
|
+
}
|
|
12
|
+
export declare function createTranslator(language: Language): Translator;
|
|
13
|
+
export type { StringKey, StringTable };
|
|
14
|
+
export { asLanguage, baseLanguage, DEFAULT_LANGUAGE, deviceLanguage, isSupportedLanguage, LANGUAGE_LABELS, SUPPORTED_LANGUAGES, type Language, } from './languages';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/i18n/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAoB,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAM,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AA2CpE,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,EAAE,CAAC,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;CACvE;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,UAAU,CAO/D;AAED,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;AACvC,OAAO,EACL,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,KAAK,QAAQ,GACd,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The languages the picker offers.
|
|
3
|
+
*
|
|
4
|
+
* Kept in sync by hand with supabase/functions/_shared/languages.ts — the two
|
|
5
|
+
* run in different runtimes and share no build step. Adding one means adding a
|
|
6
|
+
* string table here too, which the compiler enforces.
|
|
7
|
+
*
|
|
8
|
+
* Right-to-left languages are deliberately absent for now: React Native only
|
|
9
|
+
* flips layout direction through I18nManager, which needs an app restart the
|
|
10
|
+
* SDK has no business triggering inside a host app.
|
|
11
|
+
*/
|
|
12
|
+
export declare const SUPPORTED_LANGUAGES: readonly ["en", "es", "fr", "de", "nl", "pt", "it", "pl", "tr", "ru", "ja", "ko", "zh", "hi"];
|
|
13
|
+
export type Language = (typeof SUPPORTED_LANGUAGES)[number];
|
|
14
|
+
/** The language the support team reads and writes. */
|
|
15
|
+
export declare const DEFAULT_LANGUAGE: Language;
|
|
16
|
+
/**
|
|
17
|
+
* Endonyms — a language is listed the way its own speakers write it, so the
|
|
18
|
+
* picker is readable to someone who can't read the current UI language.
|
|
19
|
+
*/
|
|
20
|
+
export declare const LANGUAGE_LABELS: Record<Language, string>;
|
|
21
|
+
/** Strips a region qualifier: "pt-BR" → "pt". */
|
|
22
|
+
export declare function baseLanguage(code: string): string;
|
|
23
|
+
export declare function isSupportedLanguage(code: string): code is Language;
|
|
24
|
+
/** Narrows any string to a supported language, or null. */
|
|
25
|
+
export declare function asLanguage(code: string | null | undefined): Language | null;
|
|
26
|
+
/**
|
|
27
|
+
* The device's language, if the SDK supports it.
|
|
28
|
+
*
|
|
29
|
+
* Used to pre-select a row in the picker and to render the picker itself, so
|
|
30
|
+
* the one screen shown before we know the user's choice is already in a
|
|
31
|
+
* language they probably read. Deliberately not used to *skip* the picker: a
|
|
32
|
+
* device set to French says nothing about which language its owner wants to
|
|
33
|
+
* write support messages in.
|
|
34
|
+
*/
|
|
35
|
+
export declare function deviceLanguage(): Language | null;
|
|
36
|
+
//# sourceMappingURL=languages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../../../src/i18n/languages.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,+FAetB,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D,sDAAsD;AACtD,eAAO,MAAM,gBAAgB,EAAE,QAAe,CAAC;AAE/C;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAepD,CAAC;AAEF,iDAAiD;AACjD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,QAAQ,CAElE;AAED,2DAA2D;AAC3D,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,QAAQ,GAAG,IAAI,CAI3E;AAuBD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,QAAQ,GAAG,IAAI,CAGhD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"de.d.ts","sourceRoot":"","sources":["../../../../src/i18n/strings/de.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAExC,eAAO,MAAM,EAAE,EAAE,WA8EhB,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* English is the source table: every other language is typed against it, so a
|
|
3
|
+
* missing or misspelled key fails the build rather than falling back silently
|
|
4
|
+
* at runtime.
|
|
5
|
+
*
|
|
6
|
+
* Placeholders are `{name}` tokens filled in by `format()` — the table stays
|
|
7
|
+
* pure data so it can be handed to a translator (or lifted to JSON) without
|
|
8
|
+
* touching code.
|
|
9
|
+
*
|
|
10
|
+
* Keys that read identically in English are still separate when their context
|
|
11
|
+
* differs: `home.open` labels a section of several threads, `status.open`
|
|
12
|
+
* labels one thread's state, and plenty of languages inflect those
|
|
13
|
+
* differently.
|
|
14
|
+
*/
|
|
15
|
+
export declare const en: {
|
|
16
|
+
readonly 'home.title': "Support";
|
|
17
|
+
readonly 'home.subtitle': "Start a conversation — we reply right here.";
|
|
18
|
+
readonly 'home.close': "Close support";
|
|
19
|
+
readonly 'home.open': "Open";
|
|
20
|
+
readonly 'home.resolved': "Resolved";
|
|
21
|
+
readonly 'home.empty': "No conversations yet";
|
|
22
|
+
readonly 'home.emptyHint': "Anything you send lands with the team, and their replies come back to this sheet.";
|
|
23
|
+
readonly 'home.noMessages': "No messages yet";
|
|
24
|
+
readonly 'home.you': "You";
|
|
25
|
+
readonly 'home.threadA11y': "{type} thread";
|
|
26
|
+
readonly 'home.threadUnreadA11y': "{type} thread, {count} unread";
|
|
27
|
+
readonly 'home.newA11y': "New {type}";
|
|
28
|
+
readonly 'home.language': "Language";
|
|
29
|
+
readonly 'type.feedback': "Feedback";
|
|
30
|
+
readonly 'type.feature_request': "Feature request";
|
|
31
|
+
readonly 'type.bug_report': "Bug report";
|
|
32
|
+
readonly 'hint.feedback': "Tell us what you think";
|
|
33
|
+
readonly 'hint.feature_request': "Suggest an improvement";
|
|
34
|
+
readonly 'hint.bug_report': "Something isn't working";
|
|
35
|
+
readonly 'prompt.feedback': "What should we know?";
|
|
36
|
+
readonly 'prompt.feature_request': "What would you like to see?";
|
|
37
|
+
readonly 'prompt.bug_report': "What happened, and what did you expect?";
|
|
38
|
+
readonly 'sub.feedback': "Good or bad — it goes straight to the team.";
|
|
39
|
+
readonly 'sub.feature_request': "Tell us what you are trying to do.";
|
|
40
|
+
readonly 'sub.bug_report': "Steps, screen, and what you expected all help.";
|
|
41
|
+
readonly 'compose.back': "Back to conversations";
|
|
42
|
+
readonly 'compose.sent': "Sent";
|
|
43
|
+
readonly 'compose.sentHint': "We'll reply right here. You'll find the conversation under Open, and the button shows a badge when we answer.";
|
|
44
|
+
readonly 'compose.done': "Done";
|
|
45
|
+
readonly 'compose.send': "Send";
|
|
46
|
+
readonly 'compose.sending': "Sending…";
|
|
47
|
+
readonly 'compose.minChars': "At least {count} characters";
|
|
48
|
+
readonly 'thread.support': "Support";
|
|
49
|
+
readonly 'thread.new': "New";
|
|
50
|
+
readonly 'thread.resolvedAt': "Resolved · {date}";
|
|
51
|
+
readonly 'thread.readOnly': "This conversation is resolved and read-only";
|
|
52
|
+
readonly 'thread.placeholder': "Write a reply…";
|
|
53
|
+
readonly 'chat.placeholder': "Write a message…";
|
|
54
|
+
readonly 'review.appStore': "Rate on the App Store";
|
|
55
|
+
readonly 'review.playStore': "Rate on Google Play";
|
|
56
|
+
readonly 'thread.sendA11y': "Send reply";
|
|
57
|
+
readonly 'thread.sendingA11y': "Sending";
|
|
58
|
+
readonly 'thread.translating': "Translating…";
|
|
59
|
+
readonly 'status.open': "Open";
|
|
60
|
+
readonly 'status.resolved': "Resolved";
|
|
61
|
+
readonly 'error.tryAgain': "Try again";
|
|
62
|
+
readonly 'error.rateLimited': "Too many requests — try again later";
|
|
63
|
+
readonly 'error.offline': "You're offline — check your connection";
|
|
64
|
+
readonly 'error.sendFailed': "Couldn't send — try again";
|
|
65
|
+
readonly 'error.loadFailed': "Couldn't load your conversations";
|
|
66
|
+
readonly 'error.unavailable': "Support is unavailable right now";
|
|
67
|
+
readonly 'error.loadRateLimited': "Too many requests — try again in a bit";
|
|
68
|
+
readonly 'lang.title': "Choose your language";
|
|
69
|
+
readonly 'lang.subtitle': "Write in whichever language you prefer — we translate between you and the support team.";
|
|
70
|
+
readonly 'lang.continue': "Continue";
|
|
71
|
+
readonly 'lang.change': "Change language";
|
|
72
|
+
readonly 'lang.saveFailed': "Couldn't save — try again";
|
|
73
|
+
readonly 'time.justNow': "just now";
|
|
74
|
+
readonly 'time.minutes': "{count}m ago";
|
|
75
|
+
readonly 'time.hours': "{count}h ago";
|
|
76
|
+
readonly 'time.days': "{count}d ago";
|
|
77
|
+
readonly 'time.weeks': "{count}w ago";
|
|
78
|
+
readonly 'time.months': "{count}mo ago";
|
|
79
|
+
readonly 'time.years': "{count}y ago";
|
|
80
|
+
readonly 'time.today': "Today";
|
|
81
|
+
readonly 'time.yesterday': "Yesterday";
|
|
82
|
+
};
|
|
83
|
+
export type StringKey = keyof typeof en;
|
|
84
|
+
/** Every language provides every key — enforced at compile time. */
|
|
85
|
+
export type StringTable = Record<StringKey, string>;
|
|
86
|
+
//# sourceMappingURL=en.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../../../src/i18n/strings/en.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6EL,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,EAAE,CAAC;AAExC,oEAAoE;AACpE,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"es.d.ts","sourceRoot":"","sources":["../../../../src/i18n/strings/es.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAExC,eAAO,MAAM,EAAE,EAAE,WA6EhB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../../../src/i18n/strings/fr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAExC,eAAO,MAAM,EAAE,EAAE,WA8EhB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hi.d.ts","sourceRoot":"","sources":["../../../../src/i18n/strings/hi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAExC,eAAO,MAAM,EAAE,EAAE,WA6EhB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"it.d.ts","sourceRoot":"","sources":["../../../../src/i18n/strings/it.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAExC,eAAO,MAAM,EAAE,EAAE,WA6EhB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ja.d.ts","sourceRoot":"","sources":["../../../../src/i18n/strings/ja.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAExC,eAAO,MAAM,EAAE,EAAE,WA6EhB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ko.d.ts","sourceRoot":"","sources":["../../../../src/i18n/strings/ko.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAExC,eAAO,MAAM,EAAE,EAAE,WA4EhB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nl.d.ts","sourceRoot":"","sources":["../../../../src/i18n/strings/nl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAExC,eAAO,MAAM,EAAE,EAAE,WA6EhB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pl.d.ts","sourceRoot":"","sources":["../../../../src/i18n/strings/pl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAExC,eAAO,MAAM,EAAE,EAAE,WA6EhB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pt.d.ts","sourceRoot":"","sources":["../../../../src/i18n/strings/pt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAExC,eAAO,MAAM,EAAE,EAAE,WA6EhB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ru.d.ts","sourceRoot":"","sources":["../../../../src/i18n/strings/ru.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAExC,eAAO,MAAM,EAAE,EAAE,WA6EhB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["../../../../src/i18n/strings/tr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAExC,eAAO,MAAM,EAAE,EAAE,WA6EhB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zh.d.ts","sourceRoot":"","sources":["../../../../src/i18n/strings/zh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAExC,eAAO,MAAM,EAAE,EAAE,WA2EhB,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export { SupportButton } from './components/SupportButton';
|
|
2
|
-
export { supportDarkTheme, supportLightTheme, resolveTheme, type SupportTheme, } from './theme';
|
|
2
|
+
export { supportDarkTheme, supportLightTheme, resolveTheme, type SupportColors, type SupportTheme, } from './theme';
|
|
3
3
|
export { SupportApiError } from './api';
|
|
4
|
+
export { SDK_VERSION } from './version';
|
|
4
5
|
export { isPushAvailable } from './push';
|
|
5
|
-
export
|
|
6
|
+
export { DEFAULT_LANGUAGE, deviceLanguage, isSupportedLanguage, LANGUAGE_LABELS, SUPPORTED_LANGUAGES, type Language, } from './i18n/languages';
|
|
7
|
+
export type { AccentColor, LauncherVariant, MessageSender, PushPermissionStatus, QueryStatus, QueryType, SupportButtonProps, SupportUser, Thread, ThreadMessage, ThreadsResponse, ThemeName, ThemePreference, UserPlan, } from './types';
|
|
6
8
|
export { QUERY_TYPE_LABEL, USER_MESSAGE_MAX, USER_MESSAGE_MIN, } from './types';
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,KAAK,YAAY,GAClB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzC,YAAY,EACV,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,WAAW,EACX,MAAM,EACN,aAAa,EACb,eAAe,EACf,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,KAAK,QAAQ,GACd,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,WAAW,EACX,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,WAAW,EACX,MAAM,EACN,aAAa,EACb,eAAe,EACf,SAAS,EACT,eAAe,EACf,QAAQ,GACT,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,SAAS,CAAC"}
|
package/lib/typescript/push.d.ts
CHANGED
|
@@ -9,10 +9,22 @@ export interface PushRegistration {
|
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Ensures notification permission has been requested, and returns the
|
|
12
|
-
* outcome plus an Expo push token when one is obtainable.
|
|
12
|
+
* outcome plus an Expo push token when one is obtainable. With
|
|
13
|
+
* `prompt: false` it only reads the current state — for refreshing the token
|
|
14
|
+
* at launch without ever showing the OS prompt outside the support sheet.
|
|
13
15
|
*
|
|
14
16
|
* Never throws: any failure resolves to an 'undetermined' registration so
|
|
15
17
|
* callers can report it and move on.
|
|
16
18
|
*/
|
|
17
|
-
export declare function ensurePushPermission(expoProjectId?: string
|
|
19
|
+
export declare function ensurePushPermission(expoProjectId?: string, { prompt }?: {
|
|
20
|
+
prompt?: boolean;
|
|
21
|
+
}): Promise<PushRegistration>;
|
|
22
|
+
type SupportTapListener = (threadId: string) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Calls `listener` with the thread id whenever the user taps a support-reply
|
|
25
|
+
* notification — including, once, a tap from the last minute that arrived
|
|
26
|
+
* before anything was listening. Returns an unsubscribe function.
|
|
27
|
+
*/
|
|
28
|
+
export declare function onSupportNotificationTap(listener: SupportTapListener): () => void;
|
|
29
|
+
export {};
|
|
18
30
|
//# sourceMappingURL=push.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/push.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"push.d.ts","sourceRoot":"","sources":["../../src/push.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAuCpD,+DAA+D;AAC/D,eAAO,MAAM,eAAe,SAAyB,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,oBAAoB,CAAC;IAC7B,qEAAqE;IACrE,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAQD;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACxC,aAAa,CAAC,EAAE,MAAM,EACtB,EAAE,MAAa,EAAE,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GAC3C,OAAO,CAAC,gBAAgB,CAAC,CAoC3B;AAiBD,KAAK,kBAAkB,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;AA0CrD;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,kBAAkB,GAC3B,MAAM,IAAI,CAaZ"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { StoreListing } from './types';
|
|
2
|
+
interface StoreLinks {
|
|
3
|
+
/** Opens the store app. */
|
|
4
|
+
app: string;
|
|
5
|
+
/** The same page on the web, if the store app won't open. */
|
|
6
|
+
web: string;
|
|
7
|
+
}
|
|
8
|
+
/** Links for this device's store, or null when the team hasn't set one up. */
|
|
9
|
+
export declare function storeLinks(store: StoreListing | null | undefined): StoreLinks | null;
|
|
10
|
+
/** Opens the review page; resolves false if neither link would open. */
|
|
11
|
+
export declare function openStoreReview(links: StoreLinks): Promise<boolean>;
|
|
12
|
+
/** The platform the backend should know this user by, if it's a store one. */
|
|
13
|
+
export declare function storePlatform(): 'ios' | 'android' | undefined;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=review.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/review.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,UAAU,UAAU;IAClB,2BAA2B;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,6DAA6D;IAC7D,GAAG,EAAE,MAAM,CAAC;CACb;AAED,8EAA8E;AAC9E,wBAAgB,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,GAAG,UAAU,GAAG,IAAI,CAgBpF;AAED,wEAAwE;AACxE,wBAAsB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAYzE;AAED,8EAA8E;AAC9E,wBAAgB,aAAa,IAAI,KAAK,GAAG,SAAS,GAAG,SAAS,CAE7D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { motion, spacing, type ThemeColors } from '@appsupportkit/design-tokens';
|
|
2
2
|
import type { ViewStyle } from 'react-native';
|
|
3
|
-
import type { ThemeName } from './types';
|
|
3
|
+
import type { AccentColor, ThemeName } from './types';
|
|
4
4
|
/** Rounder than the dashboard: touch targets read better with more radius. */
|
|
5
5
|
export declare const supportRadii: {
|
|
6
6
|
readonly control: 10;
|
|
@@ -14,6 +14,16 @@ export declare const supportRadii: {
|
|
|
14
14
|
readonly pill: 999;
|
|
15
15
|
readonly full: 9999;
|
|
16
16
|
};
|
|
17
|
+
export interface SupportColors extends ThemeColors {
|
|
18
|
+
/** The sheet's own background — the layer every screen is drawn on. */
|
|
19
|
+
sheet: string;
|
|
20
|
+
/**
|
|
21
|
+
* The accent where it is small text — status labels, the "New" divider.
|
|
22
|
+
* The fill color can sit at 3:1; text needs 4.5:1 on the sheet and on the
|
|
23
|
+
* cards over it, so this is the accent nudged as far as that takes.
|
|
24
|
+
*/
|
|
25
|
+
accentText: string;
|
|
26
|
+
}
|
|
17
27
|
export interface SupportShadows {
|
|
18
28
|
/** Floating launcher button. */
|
|
19
29
|
launcher: ViewStyle;
|
|
@@ -37,7 +47,7 @@ export interface LauncherPalette {
|
|
|
37
47
|
}
|
|
38
48
|
export interface SupportTheme {
|
|
39
49
|
name: ThemeName;
|
|
40
|
-
colors:
|
|
50
|
+
colors: SupportColors;
|
|
41
51
|
spacing: typeof spacing;
|
|
42
52
|
radii: typeof supportRadii;
|
|
43
53
|
motion: typeof motion;
|
|
@@ -47,8 +57,16 @@ export interface SupportTheme {
|
|
|
47
57
|
export declare const supportDarkTheme: SupportTheme;
|
|
48
58
|
export declare const supportLightTheme: SupportTheme;
|
|
49
59
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
60
|
+
* The theme for one resolved mode. `accent` is the color for this mode
|
|
61
|
+
* (already picked from a light/dark pair), and `adapt` says whether it was a
|
|
62
|
+
* single color that has to be made to work here.
|
|
63
|
+
*/
|
|
64
|
+
export declare function themeFor(name: ThemeName, accent: string | undefined, adapt: boolean): SupportTheme;
|
|
65
|
+
/**
|
|
66
|
+
* @param name "light" | "dark" (default dark). SupportButton resolves its
|
|
67
|
+
* "system" default before calling this.
|
|
68
|
+
* @param accentColor Optional brand color: one hex for both modes (adjusted
|
|
69
|
+
* per mode where needed), or a `{ light, dark }` pair used as given.
|
|
52
70
|
*/
|
|
53
|
-
export declare function resolveTheme(name: ThemeName | undefined, accentColor?:
|
|
71
|
+
export declare function resolveTheme(name: ThemeName | undefined, accentColor?: AccentColor): SupportTheme;
|
|
54
72
|
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/theme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/theme.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,MAAM,EAEN,OAAO,EACP,KAAK,WAAW,EACjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEtD,8EAA8E;AAC9E,eAAO,MAAM,YAAY;;;;IAKvB,uBAAuB;;IAEvB,kDAAkD;;;;;CAI1C,CAAC;AAEX,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,gCAAgC;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,+BAA+B;IAC/B,KAAK,EAAE,SAAS,CAAC;IACjB,gDAAgD;IAChD,KAAK,EAAE,SAAS,CAAC;CAClB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,KAAK,EAAE,OAAO,YAAY,CAAC;IAC3B,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,OAAO,EAAE,cAAc,CAAC;IACxB,QAAQ,EAAE,eAAe,CAAC;CAC3B;AA0LD,eAAO,MAAM,gBAAgB,EAAE,YAA6C,CAAC;AAC7E,eAAO,MAAM,iBAAiB,EAAE,YAA+C,CAAC;AAkDhF;;;;GAIG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,KAAK,EAAE,OAAO,GACb,YAAY,CAGd;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,SAAS,GAAG,SAAS,EAC3B,WAAW,CAAC,EAAE,WAAW,GACxB,YAAY,CAMd"}
|
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
-
|
|
2
|
+
import type { Language } from './i18n/languages';
|
|
3
|
+
/**
|
|
4
|
+
* 'support' is the single chat (0.4+). The other three are the typed requests
|
|
5
|
+
* older builds file; their conversations still show in the chat.
|
|
6
|
+
*/
|
|
7
|
+
export type QueryType = 'feedback' | 'feature_request' | 'bug_report' | 'support';
|
|
8
|
+
/** Shown to the support team, which can filter and message users by it. */
|
|
9
|
+
export type UserPlan = 'free' | 'trial' | 'pro';
|
|
3
10
|
export type QueryStatus = 'open' | 'resolved';
|
|
4
11
|
export type MessageSender = 'user' | 'admin';
|
|
5
12
|
export type ThemeName = 'dark' | 'light';
|
|
13
|
+
/** What the host app asks for. "system" follows the app's light/dark appearance. */
|
|
14
|
+
export type ThemePreference = ThemeName | 'system';
|
|
15
|
+
/**
|
|
16
|
+
* A brand color: one hex for both modes, or a pair. A single color is
|
|
17
|
+
* lightened in dark mode (darkened in light) only as far as it takes to
|
|
18
|
+
* stay visible; a pair is used exactly as given.
|
|
19
|
+
*/
|
|
20
|
+
export type AccentColor = string | {
|
|
21
|
+
light: string;
|
|
22
|
+
dark: string;
|
|
23
|
+
};
|
|
6
24
|
export type PushPermissionStatus = 'undetermined' | 'granted' | 'denied';
|
|
7
25
|
/**
|
|
8
26
|
* How the launcher renders:
|
|
@@ -14,8 +32,17 @@ export type LauncherVariant = 'solid' | 'soft' | 'minimal';
|
|
|
14
32
|
export interface SupportUser {
|
|
15
33
|
/** Display name shown to the support team. */
|
|
16
34
|
name: string;
|
|
17
|
-
/**
|
|
18
|
-
|
|
35
|
+
/**
|
|
36
|
+
* The user's plan: "free", "trial" (in a free trial) or "pro" (paying).
|
|
37
|
+
* With RevenueCat: "trial" when the active entitlement's periodType is
|
|
38
|
+
* TRIAL, "pro" when it is active otherwise, else "free".
|
|
39
|
+
*/
|
|
40
|
+
plan?: UserPlan;
|
|
41
|
+
/**
|
|
42
|
+
* @deprecated Pass `plan`, which can also say "trial". Still accepted:
|
|
43
|
+
* true reads as "pro", false as "free". One of the two is required.
|
|
44
|
+
*/
|
|
45
|
+
isPaid?: boolean;
|
|
19
46
|
/** RevenueCat app user id — identifies the user's threads. */
|
|
20
47
|
revenuecatId: string;
|
|
21
48
|
/** Host app version, e.g. "2.4.1". */
|
|
@@ -34,14 +61,19 @@ export interface SupportButtonProps {
|
|
|
34
61
|
* Edge Functions.
|
|
35
62
|
*/
|
|
36
63
|
supabaseUrl: string;
|
|
37
|
-
/** Visual theme. Matches the admin dashboard tokens. Default "dark". */
|
|
38
|
-
theme?: ThemeName;
|
|
39
64
|
/**
|
|
40
|
-
*
|
|
41
|
-
* the
|
|
42
|
-
*
|
|
65
|
+
* Visual theme. Default "system": follows the host app's light/dark
|
|
66
|
+
* appearance (the device setting, unless the app pins one) and switches
|
|
67
|
+
* live when it changes. Pass "light" or "dark" to pin it.
|
|
68
|
+
*/
|
|
69
|
+
theme?: ThemePreference;
|
|
70
|
+
/**
|
|
71
|
+
* Brand color replacing the default accent across the launcher, buttons,
|
|
72
|
+
* and the user's own message bubbles: a hex like "#FF5A1F", or
|
|
73
|
+
* `{ light, dark }` for a color per mode. The pressed shade, the 12% wash,
|
|
74
|
+
* a text-safe variant, and a legible foreground are derived from it.
|
|
43
75
|
*/
|
|
44
|
-
accentColor?:
|
|
76
|
+
accentColor?: AccentColor;
|
|
45
77
|
/** Launcher style. Default "solid" — the floating action button. */
|
|
46
78
|
variant?: LauncherVariant;
|
|
47
79
|
/** Launcher diameter in px (height when `label` is set). Default 52. */
|
|
@@ -67,21 +99,53 @@ export interface SupportButtonProps {
|
|
|
67
99
|
* installed — it is an optional peer dependency.
|
|
68
100
|
*/
|
|
69
101
|
expoProjectId?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Pre-selects a language in the picker the first time a user opens support.
|
|
104
|
+
* Pass it when the host app already knows what the user reads — an in-app
|
|
105
|
+
* language setting beats the device locale, which is what the SDK falls
|
|
106
|
+
* back to. It is a default, not an override: the user still chooses, and a
|
|
107
|
+
* choice they have already made always wins.
|
|
108
|
+
*/
|
|
109
|
+
defaultLanguage?: Language;
|
|
70
110
|
}
|
|
71
111
|
export interface ThreadMessage {
|
|
72
112
|
id: string;
|
|
73
113
|
sender: MessageSender;
|
|
114
|
+
/**
|
|
115
|
+
* Already in the user's language: their own messages as they wrote them,
|
|
116
|
+
* support replies translated. The server does the choosing — see the
|
|
117
|
+
* get-threads function.
|
|
118
|
+
*/
|
|
74
119
|
body: string;
|
|
75
120
|
created_at: string;
|
|
76
|
-
|
|
121
|
+
/**
|
|
122
|
+
* A support reply whose translation hasn't landed yet. `body` currently
|
|
123
|
+
* holds the English original; it will change under the reader shortly, so
|
|
124
|
+
* the UI says so rather than letting it flicker.
|
|
125
|
+
*/
|
|
126
|
+
translation_pending: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* 'review_request': a support reply that carries a store review button.
|
|
129
|
+
* Absent from servers older than 0.4, where every message is text.
|
|
130
|
+
*/
|
|
131
|
+
kind?: 'text' | 'review_request';
|
|
77
132
|
}
|
|
133
|
+
/** Where a review request's button points; set per app in the dashboard. */
|
|
134
|
+
export interface StoreListing {
|
|
135
|
+
app_store_id: string | null;
|
|
136
|
+
play_store_package: string | null;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Note the absence of any admin identity: end users see one support team,
|
|
140
|
+
* not the people staffing it, so the names never leave the server. The
|
|
141
|
+
* dashboard still shows who wrote and who resolved what.
|
|
142
|
+
*/
|
|
78
143
|
export interface Thread {
|
|
79
144
|
id: string;
|
|
80
145
|
type: QueryType;
|
|
81
146
|
status: QueryStatus;
|
|
82
147
|
created_at: string;
|
|
83
148
|
resolved_at: string | null;
|
|
84
|
-
resolved_by_name: string | null;
|
|
85
149
|
app_version: string;
|
|
86
150
|
unread_count: number;
|
|
87
151
|
last_message: {
|
|
@@ -94,8 +158,17 @@ export interface Thread {
|
|
|
94
158
|
export interface ThreadsResponse {
|
|
95
159
|
threads: Thread[];
|
|
96
160
|
total_unread: number;
|
|
161
|
+
/** Null when this user has never picked one — the SDK then asks. */
|
|
162
|
+
language: string | null;
|
|
163
|
+
/** The app's store listings, for review requests. */
|
|
164
|
+
store?: StoreListing;
|
|
97
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* English labels, kept for host apps that render their own entry points.
|
|
168
|
+
* Inside the sheet the labels come from the string table instead, so they
|
|
169
|
+
* follow the user's language.
|
|
170
|
+
*/
|
|
98
171
|
export declare const QUERY_TYPE_LABEL: Record<QueryType, string>;
|
|
99
|
-
export declare const USER_MESSAGE_MIN =
|
|
100
|
-
export declare const USER_MESSAGE_MAX =
|
|
172
|
+
export declare const USER_MESSAGE_MIN = 1;
|
|
173
|
+
export declare const USER_MESSAGE_MAX = 1000;
|
|
101
174
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"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"}
|