@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.
Files changed (242) hide show
  1. package/lib/commonjs/api.js +61 -12
  2. package/lib/commonjs/api.js.map +1 -1
  3. package/lib/commonjs/components/BottomSheet.js +1 -1
  4. package/lib/commonjs/components/BottomSheet.js.map +1 -1
  5. package/lib/commonjs/components/LauncherButton.js +4 -4
  6. package/lib/commonjs/components/LauncherButton.js.map +1 -1
  7. package/lib/commonjs/components/SupportButton.js +192 -66
  8. package/lib/commonjs/components/SupportButton.js.map +1 -1
  9. package/lib/commonjs/components/icons.js +117 -110
  10. package/lib/commonjs/components/icons.js.map +1 -1
  11. package/lib/commonjs/components/primitives.js +3 -154
  12. package/lib/commonjs/components/primitives.js.map +1 -1
  13. package/lib/commonjs/components/screens/ChatScreen.js +487 -0
  14. package/lib/commonjs/components/screens/ChatScreen.js.map +1 -0
  15. package/lib/commonjs/components/screens/LanguageScreen.js +150 -0
  16. package/lib/commonjs/components/screens/LanguageScreen.js.map +1 -0
  17. package/lib/commonjs/i18n/index.js +101 -0
  18. package/lib/commonjs/i18n/index.js.map +1 -0
  19. package/lib/commonjs/i18n/languages.js +95 -0
  20. package/lib/commonjs/i18n/languages.js.map +1 -0
  21. package/lib/commonjs/i18n/strings/de.js +75 -0
  22. package/lib/commonjs/i18n/strings/de.js.map +1 -0
  23. package/lib/commonjs/i18n/strings/en.js +91 -0
  24. package/lib/commonjs/i18n/strings/en.js.map +1 -0
  25. package/lib/commonjs/i18n/strings/es.js +75 -0
  26. package/lib/commonjs/i18n/strings/es.js.map +1 -0
  27. package/lib/commonjs/i18n/strings/fr.js +75 -0
  28. package/lib/commonjs/i18n/strings/fr.js.map +1 -0
  29. package/lib/commonjs/i18n/strings/hi.js +75 -0
  30. package/lib/commonjs/i18n/strings/hi.js.map +1 -0
  31. package/lib/commonjs/i18n/strings/it.js +75 -0
  32. package/lib/commonjs/i18n/strings/it.js.map +1 -0
  33. package/lib/commonjs/i18n/strings/ja.js +75 -0
  34. package/lib/commonjs/i18n/strings/ja.js.map +1 -0
  35. package/lib/commonjs/i18n/strings/ko.js +75 -0
  36. package/lib/commonjs/i18n/strings/ko.js.map +1 -0
  37. package/lib/commonjs/i18n/strings/nl.js +75 -0
  38. package/lib/commonjs/i18n/strings/nl.js.map +1 -0
  39. package/lib/commonjs/i18n/strings/pl.js +75 -0
  40. package/lib/commonjs/i18n/strings/pl.js.map +1 -0
  41. package/lib/commonjs/i18n/strings/pt.js +75 -0
  42. package/lib/commonjs/i18n/strings/pt.js.map +1 -0
  43. package/lib/commonjs/i18n/strings/ru.js +75 -0
  44. package/lib/commonjs/i18n/strings/ru.js.map +1 -0
  45. package/lib/commonjs/i18n/strings/tr.js +75 -0
  46. package/lib/commonjs/i18n/strings/tr.js.map +1 -0
  47. package/lib/commonjs/i18n/strings/zh.js +75 -0
  48. package/lib/commonjs/i18n/strings/zh.js.map +1 -0
  49. package/lib/commonjs/index.js +38 -0
  50. package/lib/commonjs/index.js.map +1 -1
  51. package/lib/commonjs/push.js +78 -3
  52. package/lib/commonjs/push.js.map +1 -1
  53. package/lib/commonjs/review.js +54 -0
  54. package/lib/commonjs/review.js.map +1 -0
  55. package/lib/commonjs/theme.js +142 -23
  56. package/lib/commonjs/theme.js.map +1 -1
  57. package/lib/commonjs/types.js +32 -3
  58. package/lib/commonjs/types.js.map +1 -1
  59. package/lib/commonjs/useSupportThreads.js +41 -24
  60. package/lib/commonjs/useSupportThreads.js.map +1 -1
  61. package/lib/commonjs/utils.js +25 -30
  62. package/lib/commonjs/utils.js.map +1 -1
  63. package/lib/commonjs/version.js +13 -0
  64. package/lib/commonjs/version.js.map +1 -0
  65. package/lib/module/api.js +57 -10
  66. package/lib/module/api.js.map +1 -1
  67. package/lib/module/components/BottomSheet.js +1 -1
  68. package/lib/module/components/BottomSheet.js.map +1 -1
  69. package/lib/module/components/LauncherButton.js +5 -5
  70. package/lib/module/components/LauncherButton.js.map +1 -1
  71. package/lib/module/components/SupportButton.js +199 -73
  72. package/lib/module/components/SupportButton.js.map +1 -1
  73. package/lib/module/components/icons.js +115 -107
  74. package/lib/module/components/icons.js.map +1 -1
  75. package/lib/module/components/primitives.js +5 -147
  76. package/lib/module/components/primitives.js.map +1 -1
  77. package/lib/module/components/screens/ChatScreen.js +485 -0
  78. package/lib/module/components/screens/ChatScreen.js.map +1 -0
  79. package/lib/module/components/screens/LanguageScreen.js +147 -0
  80. package/lib/module/components/screens/LanguageScreen.js.map +1 -0
  81. package/lib/module/i18n/index.js +56 -0
  82. package/lib/module/i18n/index.js.map +1 -0
  83. package/lib/module/i18n/languages.js +88 -0
  84. package/lib/module/i18n/languages.js.map +1 -0
  85. package/lib/module/i18n/strings/de.js +71 -0
  86. package/lib/module/i18n/strings/de.js.map +1 -0
  87. package/lib/module/i18n/strings/en.js +87 -0
  88. package/lib/module/i18n/strings/en.js.map +1 -0
  89. package/lib/module/i18n/strings/es.js +71 -0
  90. package/lib/module/i18n/strings/es.js.map +1 -0
  91. package/lib/module/i18n/strings/fr.js +71 -0
  92. package/lib/module/i18n/strings/fr.js.map +1 -0
  93. package/lib/module/i18n/strings/hi.js +71 -0
  94. package/lib/module/i18n/strings/hi.js.map +1 -0
  95. package/lib/module/i18n/strings/it.js +71 -0
  96. package/lib/module/i18n/strings/it.js.map +1 -0
  97. package/lib/module/i18n/strings/ja.js +71 -0
  98. package/lib/module/i18n/strings/ja.js.map +1 -0
  99. package/lib/module/i18n/strings/ko.js +71 -0
  100. package/lib/module/i18n/strings/ko.js.map +1 -0
  101. package/lib/module/i18n/strings/nl.js +71 -0
  102. package/lib/module/i18n/strings/nl.js.map +1 -0
  103. package/lib/module/i18n/strings/pl.js +71 -0
  104. package/lib/module/i18n/strings/pl.js.map +1 -0
  105. package/lib/module/i18n/strings/pt.js +71 -0
  106. package/lib/module/i18n/strings/pt.js.map +1 -0
  107. package/lib/module/i18n/strings/ru.js +71 -0
  108. package/lib/module/i18n/strings/ru.js.map +1 -0
  109. package/lib/module/i18n/strings/tr.js +71 -0
  110. package/lib/module/i18n/strings/tr.js.map +1 -0
  111. package/lib/module/i18n/strings/zh.js +71 -0
  112. package/lib/module/i18n/strings/zh.js.map +1 -0
  113. package/lib/module/index.js +2 -0
  114. package/lib/module/index.js.map +1 -1
  115. package/lib/module/push.js +77 -3
  116. package/lib/module/push.js.map +1 -1
  117. package/lib/module/review.js +48 -0
  118. package/lib/module/review.js.map +1 -0
  119. package/lib/module/theme.js +141 -23
  120. package/lib/module/theme.js.map +1 -1
  121. package/lib/module/types.js +32 -3
  122. package/lib/module/types.js.map +1 -1
  123. package/lib/module/useSupportThreads.js +41 -24
  124. package/lib/module/useSupportThreads.js.map +1 -1
  125. package/lib/module/utils.js +24 -29
  126. package/lib/module/utils.js.map +1 -1
  127. package/lib/module/version.js +9 -0
  128. package/lib/module/version.js.map +1 -0
  129. package/lib/typescript/api.d.ts +40 -10
  130. package/lib/typescript/api.d.ts.map +1 -1
  131. package/lib/typescript/components/SupportButton.d.ts +2 -2
  132. package/lib/typescript/components/SupportButton.d.ts.map +1 -1
  133. package/lib/typescript/components/icons.d.ts +10 -14
  134. package/lib/typescript/components/icons.d.ts.map +1 -1
  135. package/lib/typescript/components/primitives.d.ts +3 -30
  136. package/lib/typescript/components/primitives.d.ts.map +1 -1
  137. package/lib/typescript/components/screens/ChatScreen.d.ts +21 -0
  138. package/lib/typescript/components/screens/ChatScreen.d.ts.map +1 -0
  139. package/lib/typescript/components/screens/LanguageScreen.d.ts +30 -0
  140. package/lib/typescript/components/screens/LanguageScreen.d.ts.map +1 -0
  141. package/lib/typescript/i18n/index.d.ts +15 -0
  142. package/lib/typescript/i18n/index.d.ts.map +1 -0
  143. package/lib/typescript/i18n/languages.d.ts +36 -0
  144. package/lib/typescript/i18n/languages.d.ts.map +1 -0
  145. package/lib/typescript/i18n/strings/de.d.ts +3 -0
  146. package/lib/typescript/i18n/strings/de.d.ts.map +1 -0
  147. package/lib/typescript/i18n/strings/en.d.ts +86 -0
  148. package/lib/typescript/i18n/strings/en.d.ts.map +1 -0
  149. package/lib/typescript/i18n/strings/es.d.ts +3 -0
  150. package/lib/typescript/i18n/strings/es.d.ts.map +1 -0
  151. package/lib/typescript/i18n/strings/fr.d.ts +3 -0
  152. package/lib/typescript/i18n/strings/fr.d.ts.map +1 -0
  153. package/lib/typescript/i18n/strings/hi.d.ts +3 -0
  154. package/lib/typescript/i18n/strings/hi.d.ts.map +1 -0
  155. package/lib/typescript/i18n/strings/it.d.ts +3 -0
  156. package/lib/typescript/i18n/strings/it.d.ts.map +1 -0
  157. package/lib/typescript/i18n/strings/ja.d.ts +3 -0
  158. package/lib/typescript/i18n/strings/ja.d.ts.map +1 -0
  159. package/lib/typescript/i18n/strings/ko.d.ts +3 -0
  160. package/lib/typescript/i18n/strings/ko.d.ts.map +1 -0
  161. package/lib/typescript/i18n/strings/nl.d.ts +3 -0
  162. package/lib/typescript/i18n/strings/nl.d.ts.map +1 -0
  163. package/lib/typescript/i18n/strings/pl.d.ts +3 -0
  164. package/lib/typescript/i18n/strings/pl.d.ts.map +1 -0
  165. package/lib/typescript/i18n/strings/pt.d.ts +3 -0
  166. package/lib/typescript/i18n/strings/pt.d.ts.map +1 -0
  167. package/lib/typescript/i18n/strings/ru.d.ts +3 -0
  168. package/lib/typescript/i18n/strings/ru.d.ts.map +1 -0
  169. package/lib/typescript/i18n/strings/tr.d.ts +3 -0
  170. package/lib/typescript/i18n/strings/tr.d.ts.map +1 -0
  171. package/lib/typescript/i18n/strings/zh.d.ts +3 -0
  172. package/lib/typescript/i18n/strings/zh.d.ts.map +1 -0
  173. package/lib/typescript/index.d.ts +4 -2
  174. package/lib/typescript/index.d.ts.map +1 -1
  175. package/lib/typescript/push.d.ts +14 -2
  176. package/lib/typescript/push.d.ts.map +1 -1
  177. package/lib/typescript/review.d.ts +15 -0
  178. package/lib/typescript/review.d.ts.map +1 -0
  179. package/lib/typescript/theme.d.ts +23 -5
  180. package/lib/typescript/theme.d.ts.map +1 -1
  181. package/lib/typescript/types.d.ts +86 -13
  182. package/lib/typescript/types.d.ts.map +1 -1
  183. package/lib/typescript/useSupportThreads.d.ts +20 -4
  184. package/lib/typescript/useSupportThreads.d.ts.map +1 -1
  185. package/lib/typescript/utils.d.ts +8 -6
  186. package/lib/typescript/utils.d.ts.map +1 -1
  187. package/lib/typescript/version.d.ts +7 -0
  188. package/lib/typescript/version.d.ts.map +1 -0
  189. package/package.json +2 -2
  190. package/src/api.ts +75 -23
  191. package/src/components/BottomSheet.tsx +1 -1
  192. package/src/components/LauncherButton.tsx +4 -4
  193. package/src/components/SupportButton.tsx +244 -86
  194. package/src/components/icons.tsx +96 -101
  195. package/src/components/primitives.tsx +9 -161
  196. package/src/components/screens/ChatScreen.tsx +541 -0
  197. package/src/components/screens/LanguageScreen.tsx +172 -0
  198. package/src/i18n/index.ts +81 -0
  199. package/src/i18n/languages.ts +106 -0
  200. package/src/i18n/strings/de.ts +81 -0
  201. package/src/i18n/strings/en.ts +97 -0
  202. package/src/i18n/strings/es.ts +80 -0
  203. package/src/i18n/strings/fr.ts +81 -0
  204. package/src/i18n/strings/hi.ts +80 -0
  205. package/src/i18n/strings/it.ts +80 -0
  206. package/src/i18n/strings/ja.ts +80 -0
  207. package/src/i18n/strings/ko.ts +79 -0
  208. package/src/i18n/strings/nl.ts +80 -0
  209. package/src/i18n/strings/pl.ts +80 -0
  210. package/src/i18n/strings/pt.ts +80 -0
  211. package/src/i18n/strings/ru.ts +80 -0
  212. package/src/i18n/strings/tr.ts +80 -0
  213. package/src/i18n/strings/zh.ts +78 -0
  214. package/src/index.tsx +13 -0
  215. package/src/push.ts +100 -2
  216. package/src/review.ts +54 -0
  217. package/src/theme.ts +182 -28
  218. package/src/types.ts +85 -13
  219. package/src/useSupportThreads.ts +61 -28
  220. package/src/utils.ts +27 -29
  221. package/src/version.ts +6 -0
  222. package/lib/commonjs/components/screens/ComposeScreen.js +0 -228
  223. package/lib/commonjs/components/screens/ComposeScreen.js.map +0 -1
  224. package/lib/commonjs/components/screens/HomeScreen.js +0 -286
  225. package/lib/commonjs/components/screens/HomeScreen.js.map +0 -1
  226. package/lib/commonjs/components/screens/ThreadScreen.js +0 -327
  227. package/lib/commonjs/components/screens/ThreadScreen.js.map +0 -1
  228. package/lib/module/components/screens/ComposeScreen.js +0 -224
  229. package/lib/module/components/screens/ComposeScreen.js.map +0 -1
  230. package/lib/module/components/screens/HomeScreen.js +0 -282
  231. package/lib/module/components/screens/HomeScreen.js.map +0 -1
  232. package/lib/module/components/screens/ThreadScreen.js +0 -325
  233. package/lib/module/components/screens/ThreadScreen.js.map +0 -1
  234. package/lib/typescript/components/screens/ComposeScreen.d.ts +0 -10
  235. package/lib/typescript/components/screens/ComposeScreen.d.ts.map +0 -1
  236. package/lib/typescript/components/screens/HomeScreen.d.ts +0 -14
  237. package/lib/typescript/components/screens/HomeScreen.d.ts.map +0 -1
  238. package/lib/typescript/components/screens/ThreadScreen.d.ts +0 -10
  239. package/lib/typescript/components/screens/ThreadScreen.d.ts.map +0 -1
  240. package/src/components/screens/ComposeScreen.tsx +0 -233
  241. package/src/components/screens/HomeScreen.tsx +0 -287
  242. package/src/components/screens/ThreadScreen.tsx +0 -397
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.tr = void 0;
7
+ const tr = exports.tr = {
8
+ 'home.title': 'Destek',
9
+ 'home.subtitle': 'Bir görüşme başlatın — tam burada yanıtlıyoruz.',
10
+ 'home.close': 'Desteği kapat',
11
+ 'home.open': 'Açık',
12
+ 'home.resolved': 'Çözüldü',
13
+ 'home.empty': 'Henüz görüşme yok',
14
+ 'home.emptyHint': 'Gönderdiğiniz her şey ekibe ulaşır ve yanıtları bu pencereye geri gelir.',
15
+ 'home.noMessages': 'Henüz mesaj yok',
16
+ 'home.you': 'Siz',
17
+ 'home.threadA11y': 'Görüşme: {type}',
18
+ 'home.threadUnreadA11y': 'Görüşme: {type}, {count} okunmamış',
19
+ 'home.newA11y': 'Yeni: {type}',
20
+ 'home.language': 'Dil',
21
+ 'type.feedback': 'Geri bildirim',
22
+ 'type.feature_request': 'Özellik isteği',
23
+ 'type.bug_report': 'Hata bildirimi',
24
+ 'hint.feedback': 'Ne düşündüğünüzü söyleyin',
25
+ 'hint.feature_request': 'Bir iyileştirme önerin',
26
+ 'hint.bug_report': 'Bir şey çalışmıyor',
27
+ 'prompt.feedback': 'Neyi bilmemiz gerekiyor?',
28
+ 'prompt.feature_request': 'Neyi görmek istersiniz?',
29
+ 'prompt.bug_report': 'Ne oldu ve ne olmasını bekliyordunuz?',
30
+ 'sub.feedback': 'İyi ya da kötü — doğrudan ekibe gider.',
31
+ 'sub.feature_request': 'Ne yapmaya çalıştığınızı anlatın.',
32
+ 'sub.bug_report': 'Adımlar, ekran ve beklentiniz bize yardımcı olur.',
33
+ 'compose.back': 'Görüşmelere dön',
34
+ 'compose.sent': 'Gönderildi',
35
+ 'compose.sentHint': 'Tam burada yanıtlayacağız. Görüşmeyi Açık bölümünde bulursunuz ve yanıtladığımızda düğmede bir işaret belirir.',
36
+ 'compose.done': 'Tamam',
37
+ 'compose.send': 'Gönder',
38
+ 'compose.sending': 'Gönderiliyor…',
39
+ 'compose.minChars': 'En az {count} karakter',
40
+ 'thread.support': 'Destek',
41
+ 'thread.new': 'Yeni',
42
+ 'thread.resolvedAt': 'Çözüldü · {date}',
43
+ 'thread.readOnly': 'Bu görüşme çözüldü ve salt okunur',
44
+ 'thread.placeholder': 'Bir yanıt yazın…',
45
+ 'chat.placeholder': 'Bir mesaj yazın…',
46
+ 'review.appStore': "App Store'da değerlendir",
47
+ 'review.playStore': "Google Play'de değerlendir",
48
+ 'thread.sendA11y': 'Yanıtı gönder',
49
+ 'thread.sendingA11y': 'Gönderiliyor',
50
+ 'thread.translating': 'Çevriliyor…',
51
+ 'status.open': 'Açık',
52
+ 'status.resolved': 'Çözüldü',
53
+ 'error.tryAgain': 'Tekrar dene',
54
+ 'error.rateLimited': 'Çok fazla istek — daha sonra tekrar deneyin',
55
+ 'error.offline': 'Çevrimdışısınız — bağlantınızı kontrol edin',
56
+ 'error.sendFailed': 'Gönderilemedi — tekrar deneyin',
57
+ 'error.loadFailed': 'Görüşmeleriniz yüklenemedi',
58
+ 'error.unavailable': 'Destek şu anda kullanılamıyor',
59
+ 'error.loadRateLimited': 'Çok fazla istek — birazdan tekrar deneyin',
60
+ 'lang.title': 'Dilinizi seçin',
61
+ 'lang.subtitle': 'İstediğiniz dilde yazın — sizinle destek ekibi arasında çeviri yapıyoruz.',
62
+ 'lang.continue': 'Devam',
63
+ 'lang.change': 'Dili değiştir',
64
+ 'lang.saveFailed': 'Kaydedilemedi — tekrar deneyin',
65
+ 'time.justNow': 'az önce',
66
+ 'time.minutes': '{count} dk önce',
67
+ 'time.hours': '{count} sa önce',
68
+ 'time.days': '{count} g önce',
69
+ 'time.weeks': '{count} hf önce',
70
+ 'time.months': '{count} ay önce',
71
+ 'time.years': '{count} yıl önce',
72
+ 'time.today': 'Bugün',
73
+ 'time.yesterday': 'Dün'
74
+ };
75
+ //# sourceMappingURL=tr.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["tr","exports"],"sourceRoot":"../../../../src","sources":["i18n/strings/tr.ts"],"mappings":";;;;;;AAEO,MAAMA,EAAe,GAAAC,OAAA,CAAAD,EAAA,GAAG;EAC7B,YAAY,EAAE,QAAQ;EACtB,eAAe,EAAE,iDAAiD;EAClE,YAAY,EAAE,eAAe;EAC7B,WAAW,EAAE,MAAM;EACnB,eAAe,EAAE,SAAS;EAC1B,YAAY,EAAE,mBAAmB;EACjC,gBAAgB,EACd,0EAA0E;EAC5E,iBAAiB,EAAE,iBAAiB;EACpC,UAAU,EAAE,KAAK;EACjB,iBAAiB,EAAE,iBAAiB;EACpC,uBAAuB,EAAE,oCAAoC;EAC7D,cAAc,EAAE,cAAc;EAC9B,eAAe,EAAE,KA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,cAAc,EAAE,SAAS;EACzB,cAAc,EAAE,iBAAiB;EACjC,YAAY,EAAE,iBAAiB;EAC/B,WAAW,EAAE,gBAAgB;EAC7B,YAAY,EAAE,iBAAiB;EAC/B,aAAa,EAAE,iBAAiB;EAChC,YAAY,EAAE,kBAAkB;EAChC,YAAY,EAAE,OAAO;EACrB,gBAAgB,EAAE;AACpB,CAAC","ignoreList":[]}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.zh = void 0;
7
+ const zh = exports.zh = {
8
+ 'home.title': '客服支持',
9
+ 'home.subtitle': '发起一次对话 —— 我们就在这里回复你。',
10
+ 'home.close': '关闭客服',
11
+ 'home.open': '进行中',
12
+ 'home.resolved': '已解决',
13
+ 'home.empty': '还没有对话',
14
+ 'home.emptyHint': '你发送的内容都会送到团队,他们的回复也会回到这个窗口。',
15
+ 'home.noMessages': '还没有消息',
16
+ 'home.you': '你',
17
+ 'home.threadA11y': '对话:{type}',
18
+ 'home.threadUnreadA11y': '对话:{type},{count} 条未读',
19
+ 'home.newA11y': '新建:{type}',
20
+ 'home.language': '语言',
21
+ 'type.feedback': '反馈',
22
+ 'type.feature_request': '功能请求',
23
+ 'type.bug_report': '错误报告',
24
+ 'hint.feedback': '告诉我们你的想法',
25
+ 'hint.feature_request': '提出一个改进建议',
26
+ 'hint.bug_report': '有功能无法正常使用',
27
+ 'prompt.feedback': '有什么想让我们知道的?',
28
+ 'prompt.feature_request': '你希望看到什么?',
29
+ 'prompt.bug_report': '发生了什么,你期待的结果是什么?',
30
+ 'sub.feedback': '好评差评都会直接送到团队。',
31
+ 'sub.feature_request': '告诉我们你想完成什么。',
32
+ 'sub.bug_report': '操作步骤、所在页面和你的预期都很有帮助。',
33
+ 'compose.back': '返回对话列表',
34
+ 'compose.sent': '已发送',
35
+ 'compose.sentHint': '我们会在这里回复。对话会出现在「进行中」,我们回复后按钮上会显示提示。',
36
+ 'compose.done': '完成',
37
+ 'compose.send': '发送',
38
+ 'compose.sending': '发送中…',
39
+ 'compose.minChars': '至少输入 {count} 个字符',
40
+ 'thread.support': '客服支持',
41
+ 'thread.new': '新消息',
42
+ 'thread.resolvedAt': '已解决 · {date}',
43
+ 'thread.readOnly': '此对话已解决,仅供查看',
44
+ 'thread.placeholder': '写下回复…',
45
+ 'chat.placeholder': '输入消息…',
46
+ 'review.appStore': '在 App Store 评分',
47
+ 'review.playStore': '在 Google Play 评分',
48
+ 'thread.sendA11y': '发送回复',
49
+ 'thread.sendingA11y': '发送中',
50
+ 'thread.translating': '翻译中…',
51
+ 'status.open': '进行中',
52
+ 'status.resolved': '已解决',
53
+ 'error.tryAgain': '重试',
54
+ 'error.rateLimited': '请求过于频繁 —— 请稍后再试',
55
+ 'error.offline': '你已离线 —— 请检查网络连接',
56
+ 'error.sendFailed': '发送失败 —— 请重试',
57
+ 'error.loadFailed': '无法加载你的对话',
58
+ 'error.unavailable': '客服支持暂时不可用',
59
+ 'error.loadRateLimited': '请求过于频繁 —— 请稍等片刻再试',
60
+ 'lang.title': '选择你的语言',
61
+ 'lang.subtitle': '用你习惯的语言书写 —— 我们会在你和客服团队之间翻译。',
62
+ 'lang.continue': '继续',
63
+ 'lang.change': '更改语言',
64
+ 'lang.saveFailed': '保存失败 —— 请重试',
65
+ 'time.justNow': '刚刚',
66
+ 'time.minutes': '{count} 分钟前',
67
+ 'time.hours': '{count} 小时前',
68
+ 'time.days': '{count} 天前',
69
+ 'time.weeks': '{count} 周前',
70
+ 'time.months': '{count} 个月前',
71
+ 'time.years': '{count} 年前',
72
+ 'time.today': '今天',
73
+ 'time.yesterday': '昨天'
74
+ };
75
+ //# sourceMappingURL=zh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["zh","exports"],"sourceRoot":"../../../../src","sources":["i18n/strings/zh.ts"],"mappings":";;;;;;AAEO,MAAMA,EAAe,GAAAC,OAAA,CAAAD,EAAA,GAAG;EAC7B,YAAY,EAAE,M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,EAAE,iBAAiB;EAClC,kBAAkB,EAAE,aAAa;EACjC,kBAAkB,EAAE,UAAU;EAC9B,mBAAmB,EAAE,WAAW;EAChC,uBAAuB,EAAE,mBAAmB;EAE5C,YAAY,EAAE,QAAQ;EACtB,eAAe,EAAE,8BAA8B;EAC/C,eAAe,EAAE,IAAI;EACrB,aAAa,EAAE,MAAM;EACrB,iBAAiB,EAAE,aAAa;EAEhC,cAAc,EAAE,IAAI;EACpB,cAAc,EAAE,aAAa;EAC7B,YAAY,EAAE,aAAa;EAC3B,WAAW,EAAE,YAAY;EACzB,YAAY,EAAE,YAAY;EAC1B,aAAa,EAAE,aAAa;EAC5B,YAAY,EAAE,YAAY;EAC1B,YAAY,EAAE,IAAI;EAClB,gBAAgB,EAAE;AACpB,CAAC","ignoreList":[]}
@@ -3,12 +3,36 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ Object.defineProperty(exports, "DEFAULT_LANGUAGE", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _languages.DEFAULT_LANGUAGE;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "LANGUAGE_LABELS", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _languages.LANGUAGE_LABELS;
16
+ }
17
+ });
6
18
  Object.defineProperty(exports, "QUERY_TYPE_LABEL", {
7
19
  enumerable: true,
8
20
  get: function () {
9
21
  return _types.QUERY_TYPE_LABEL;
10
22
  }
11
23
  });
24
+ Object.defineProperty(exports, "SDK_VERSION", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _version.SDK_VERSION;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "SUPPORTED_LANGUAGES", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _languages.SUPPORTED_LANGUAGES;
34
+ }
35
+ });
12
36
  Object.defineProperty(exports, "SupportApiError", {
13
37
  enumerable: true,
14
38
  get: function () {
@@ -33,12 +57,24 @@ Object.defineProperty(exports, "USER_MESSAGE_MIN", {
33
57
  return _types.USER_MESSAGE_MIN;
34
58
  }
35
59
  });
60
+ Object.defineProperty(exports, "deviceLanguage", {
61
+ enumerable: true,
62
+ get: function () {
63
+ return _languages.deviceLanguage;
64
+ }
65
+ });
36
66
  Object.defineProperty(exports, "isPushAvailable", {
37
67
  enumerable: true,
38
68
  get: function () {
39
69
  return _push.isPushAvailable;
40
70
  }
41
71
  });
72
+ Object.defineProperty(exports, "isSupportedLanguage", {
73
+ enumerable: true,
74
+ get: function () {
75
+ return _languages.isSupportedLanguage;
76
+ }
77
+ });
42
78
  Object.defineProperty(exports, "resolveTheme", {
43
79
  enumerable: true,
44
80
  get: function () {
@@ -60,6 +96,8 @@ Object.defineProperty(exports, "supportLightTheme", {
60
96
  var _SupportButton = require("./components/SupportButton");
61
97
  var _theme = require("./theme");
62
98
  var _api = require("./api");
99
+ var _version = require("./version");
63
100
  var _push = require("./push");
101
+ var _languages = require("./i18n/languages");
64
102
  var _types = require("./types");
65
103
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_SupportButton","require","_theme","_api","_push","_types"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAMA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAcA,IAAAI,MAAA,GAAAJ,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["_SupportButton","require","_theme","_api","_version","_push","_languages","_types"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAOA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAwBA,IAAAM,MAAA,GAAAN,OAAA","ignoreList":[]}
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.ensurePushPermission = ensurePushPermission;
7
7
  exports.isPushAvailable = void 0;
8
+ exports.onSupportNotificationTap = onSupportNotificationTap;
8
9
  // Optional push-notification support.
9
10
  //
10
11
  // expo-notifications is an OPTIONAL peer dependency: if the host app has it
@@ -17,6 +18,8 @@ exports.isPushAvailable = void 0;
17
18
  // badges. The status is reported purely so the dashboard can show whether
18
19
  // the user is reachable.
19
20
 
21
+ /** The slice of a NotificationResponse that tap handling reads. */
22
+
20
23
  /** The slice of expo-notifications this SDK uses. */
21
24
 
22
25
  function loadNotifications() {
@@ -40,12 +43,16 @@ function normalizeStatus(status) {
40
43
 
41
44
  /**
42
45
  * Ensures notification permission has been requested, and returns the
43
- * outcome plus an Expo push token when one is obtainable.
46
+ * outcome plus an Expo push token when one is obtainable. With
47
+ * `prompt: false` it only reads the current state — for refreshing the token
48
+ * at launch without ever showing the OS prompt outside the support sheet.
44
49
  *
45
50
  * Never throws: any failure resolves to an 'undetermined' registration so
46
51
  * callers can report it and move on.
47
52
  */
48
- async function ensurePushPermission(expoProjectId) {
53
+ async function ensurePushPermission(expoProjectId, {
54
+ prompt = true
55
+ } = {}) {
49
56
  if (!notifications) {
50
57
  return {
51
58
  status: 'undetermined',
@@ -60,7 +67,7 @@ async function ensurePushPermission(expoProjectId) {
60
67
 
61
68
  // Only prompt when the OS will actually show something. Re-prompting a
62
69
  // user who already decided is impossible on iOS and annoying on Android.
63
- if (status === 'undetermined' && current.canAskAgain) {
70
+ if (prompt && status === 'undetermined' && current.canAskAgain) {
64
71
  const requested = await notifications.requestPermissionsAsync();
65
72
  status = normalizeStatus(requested.status);
66
73
  asked = true;
@@ -100,4 +107,72 @@ async function ensurePushPermission(expoProjectId) {
100
107
  };
101
108
  }
102
109
  }
110
+
111
+ // ---------- opening the thread from a tapped notification ----------
112
+ //
113
+ // send-push tags every support reply with `{ type: 'support_reply',
114
+ // query_id }`. Tapping one should land the user in that thread, not wherever
115
+ // the host app happens to open.
116
+ //
117
+ // The observer starts when this module loads rather than when a launcher
118
+ // mounts, for two reasons: a cold start's tap is only reported once, early,
119
+ // and a host app may mount the launcher later (behind auth, on a settings
120
+ // screen). A tap seen before any launcher is listening is held for
121
+ // PENDING_TAP_TTL_MS and then dropped — opening the sheet minutes after the
122
+ // tap, the first time the user wanders onto that screen, would be a surprise.
123
+
124
+ const PENDING_TAP_TTL_MS = 60_000;
125
+ const tapListeners = [];
126
+ let pendingTap = null;
127
+ // Both the listener and getLastNotificationResponseAsync can report the same
128
+ // cold-start tap, and the latter keeps reporting it for the life of the
129
+ // process. Each tap is handled once.
130
+ const handledTaps = new Set();
131
+ function supportReplyThreadId(response) {
132
+ const defaultAction = notifications?.DEFAULT_ACTION_IDENTIFIER;
133
+ if (defaultAction && response.actionIdentifier !== defaultAction) return null;
134
+ const data = response.notification?.request?.content?.data;
135
+ if (data?.type !== 'support_reply') return null;
136
+ return typeof data.query_id === 'string' ? data.query_id : null;
137
+ }
138
+ function handleResponse(response) {
139
+ if (!response) return;
140
+ const threadId = supportReplyThreadId(response);
141
+ const tapId = response.notification?.request?.identifier;
142
+ if (threadId === null || !tapId || handledTaps.has(tapId)) return;
143
+ handledTaps.add(tapId);
144
+
145
+ // One sheet, not one per mounted launcher: the newest launcher takes it.
146
+ const listener = tapListeners[tapListeners.length - 1];
147
+ if (listener) listener(threadId);else pendingTap = {
148
+ threadId,
149
+ at: Date.now()
150
+ };
151
+ }
152
+ if (notifications) {
153
+ try {
154
+ notifications.addNotificationResponseReceivedListener(handleResponse);
155
+ notifications.getLastNotificationResponseAsync().then(handleResponse).catch(() => {});
156
+ } catch {
157
+ // Same contract as the rest of this file: push never breaks support.
158
+ }
159
+ }
160
+
161
+ /**
162
+ * Calls `listener` with the thread id whenever the user taps a support-reply
163
+ * notification — including, once, a tap from the last minute that arrived
164
+ * before anything was listening. Returns an unsubscribe function.
165
+ */
166
+ function onSupportNotificationTap(listener) {
167
+ tapListeners.push(listener);
168
+ const pending = pendingTap;
169
+ pendingTap = null;
170
+ if (pending && Date.now() - pending.at < PENDING_TAP_TTL_MS) {
171
+ listener(pending.threadId);
172
+ }
173
+ return () => {
174
+ const index = tapListeners.lastIndexOf(listener);
175
+ if (index !== -1) tapListeners.splice(index, 1);
176
+ };
177
+ }
103
178
  //# sourceMappingURL=push.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["loadNotifications","mod","require","getPermissionsAsync","notifications","isPushAvailable","exports","normalizeStatus","status","ensurePushPermission","expoProjectId","asked","token","current","canAskAgain","requested","requestPermissionsAsync","getExpoPushTokenAsync","projectId","undefined","data"],"sourceRoot":"../../src","sources":["push.ts"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;;AASA,SAASA,iBAAiBA,CAAA,EAAmC;EAC3D,IAAI;IACF;IACA,MAAMC,GAAG,GAAGC,OAAO,CAAC,oBAAoB,CAA4B;IACpE,OAAO,OAAOD,GAAG,EAAEE,mBAAmB,KAAK,UAAU,GAAGF,GAAG,GAAG,IAAI;EACpE,CAAC,CAAC,MAAM;IACN,OAAO,IAAI;EACb;AACF;AAEA,MAAMG,aAAa,GAAGJ,iBAAiB,CAAC,CAAC;;AAEzC;AACO,MAAMK,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAGD,aAAa,KAAK,IAAI;AASrD,SAASG,eAAeA,CAACC,MAAc,EAAwB;EAC7D,IAAIA,MAAM,KAAK,SAAS,EAAE,OAAO,SAAS;EAC1C,IAAIA,MAAM,KAAK,QAAQ,EAAE,OAAO,QAAQ;EACxC,OAAO,cAAc;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeC,oBAAoBA,CACxCC,aAAsB,EACK;EAC3B,IAAI,CAACN,aAAa,EAAE;IAClB,OAAO;MAAEI,MAAM,EAAE,cAAc;MAAEG,KAAK,EAAE,KAAK;MAAEC,KAAK,EAAE;IAAK,CAAC;EAC9D;EAEA,IAAI;IACF,MAAMC,OAAO,GAAG,MAAMT,aAAa,CAACD,mBAAmB,CAAC,CAAC;IACzD,IAAIK,MAAM,GAAGD,eAAe,CAACM,OAAO,CAACL,MAAM,CAAC;IAC5C,IAAIG,KAAK,GAAG,KAAK;;IAEjB;IACA;IACA,IAAIH,MAAM,KAAK,cAAc,IAAIK,OAAO,CAACC,WAAW,EAAE;MACpD,MAAMC,SAAS,GAAG,MAAMX,aAAa,CAACY,uBAAuB,CAAC,CAAC;MAC/DR,MAAM,GAAGD,eAAe,CAACQ,SAAS,CAACP,MAAM,CAAC;MAC1CG,KAAK,GAAG,IAAI;IACd;IAEA,IAAIH,MAAM,KAAK,SAAS,EAAE;MACxB,OAAO;QAAEA,MAAM;QAAEG,KAAK;QAAEC,KAAK,EAAE;MAAK,CAAC;IACvC;;IAEA;IACA;IACA;IACA,IAAI;MACF,MAAMA,KAAK,GAAG,MAAMR,aAAa,CAACa,qBAAqB,CACrDP,aAAa,GAAG;QAAEQ,SAAS,EAAER;MAAc,CAAC,GAAGS,SACjD,CAAC;MACD,OAAO;QAAEX,MAAM;QAAEG,KAAK;QAAEC,KAAK,EAAEA,KAAK,CAACQ;MAAK,CAAC;IAC7C,CAAC,CAAC,MAAM;MACN,OAAO;QAAEZ,MAAM;QAAEG,KAAK;QAAEC,KAAK,EAAE;MAAK,CAAC;IACvC;EACF,CAAC,CAAC,MAAM;IACN,OAAO;MAAEJ,MAAM,EAAE,cAAc;MAAEG,KAAK,EAAE,KAAK;MAAEC,KAAK,EAAE;IAAK,CAAC;EAC9D;AACF","ignoreList":[]}
1
+ {"version":3,"names":["loadNotifications","mod","require","getPermissionsAsync","notifications","isPushAvailable","exports","normalizeStatus","status","ensurePushPermission","expoProjectId","prompt","asked","token","current","canAskAgain","requested","requestPermissionsAsync","getExpoPushTokenAsync","projectId","undefined","data","PENDING_TAP_TTL_MS","tapListeners","pendingTap","handledTaps","Set","supportReplyThreadId","response","defaultAction","DEFAULT_ACTION_IDENTIFIER","actionIdentifier","notification","request","content","type","query_id","handleResponse","threadId","tapId","identifier","has","add","listener","length","at","Date","now","addNotificationResponseReceivedListener","getLastNotificationResponseAsync","then","catch","onSupportNotificationTap","push","pending","index","lastIndexOf","splice"],"sourceRoot":"../../src","sources":["push.ts"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;;AAWA;;AAcA,SAASA,iBAAiBA,CAAA,EAAmC;EAC3D,IAAI;IACF;IACA,MAAMC,GAAG,GAAGC,OAAO,CAAC,oBAAoB,CAA4B;IACpE,OAAO,OAAOD,GAAG,EAAEE,mBAAmB,KAAK,UAAU,GAAGF,GAAG,GAAG,IAAI;EACpE,CAAC,CAAC,MAAM;IACN,OAAO,IAAI;EACb;AACF;AAEA,MAAMG,aAAa,GAAGJ,iBAAiB,CAAC,CAAC;;AAEzC;AACO,MAAMK,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAGD,aAAa,KAAK,IAAI;AASrD,SAASG,eAAeA,CAACC,MAAc,EAAwB;EAC7D,IAAIA,MAAM,KAAK,SAAS,EAAE,OAAO,SAAS;EAC1C,IAAIA,MAAM,KAAK,QAAQ,EAAE,OAAO,QAAQ;EACxC,OAAO,cAAc;AACvB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAeC,oBAAoBA,CACxCC,aAAsB,EACtB;EAAEC,MAAM,GAAG;AAA2B,CAAC,GAAG,CAAC,CAAC,EACjB;EAC3B,IAAI,CAACP,aAAa,EAAE;IAClB,OAAO;MAAEI,MAAM,EAAE,cAAc;MAAEI,KAAK,EAAE,KAAK;MAAEC,KAAK,EAAE;IAAK,CA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;EAAA;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,wBAAwBA,CACtCT,QAA4B,EAChB;EACZpB,YAAY,CAAC8B,IAAI,CAACV,QAAQ,CAAC;EAE3B,MAAMW,OAAO,GAAG9B,UAAU;EAC1BA,UAAU,GAAG,IAAI;EACjB,IAAI8B,OAAO,IAAIR,IAAI,CAACC,GAAG,CAAC,CAAC,GAAGO,OAAO,CAACT,EAAE,GAAGvB,kBAAkB,EAAE;IAC3DqB,QAAQ,CAACW,OAAO,CAAChB,QAAQ,CAAC;EAC5B;EAEA,OAAO,MAAM;IACX,MAAMiB,KAAK,GAAGhC,YAAY,CAACiC,WAAW,CAACb,QAAQ,CAAC;IAChD,IAAIY,KAAK,KAAK,CAAC,CAAC,EAAEhC,YAAY,CAACkC,MAAM,CAACF,KAAK,EAAE,CAAC,CAAC;EACjD,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.openStoreReview = openStoreReview;
7
+ exports.storeLinks = storeLinks;
8
+ exports.storePlatform = storePlatform;
9
+ var _reactNative = require("react-native");
10
+ // Review requests: a support reply with a "Rate on the App Store / Google
11
+ // Play" button. The button opens the store's write-a-review page — the store
12
+ // app where there is one, its website otherwise. It is a link, not a prompt:
13
+ // Apple's guidelines reserve in-app rating prompts for SKStoreReviewController,
14
+ // and linking to the review page is what they document for everything else.
15
+
16
+ /** Links for this device's store, or null when the team hasn't set one up. */
17
+ function storeLinks(store) {
18
+ if (_reactNative.Platform.OS === 'ios' && store?.app_store_id) {
19
+ const id = encodeURIComponent(store.app_store_id);
20
+ return {
21
+ app: `itms-apps://apps.apple.com/app/id${id}?action=write-review`,
22
+ web: `https://apps.apple.com/app/id${id}?action=write-review`
23
+ };
24
+ }
25
+ if (_reactNative.Platform.OS === 'android' && store?.play_store_package) {
26
+ const pkg = encodeURIComponent(store.play_store_package);
27
+ return {
28
+ app: `market://details?id=${pkg}&showAllReviews=true`,
29
+ web: `https://play.google.com/store/apps/details?id=${pkg}&showAllReviews=true`
30
+ };
31
+ }
32
+ return null;
33
+ }
34
+
35
+ /** Opens the review page; resolves false if neither link would open. */
36
+ async function openStoreReview(links) {
37
+ try {
38
+ await _reactNative.Linking.openURL(links.app);
39
+ return true;
40
+ } catch {
41
+ try {
42
+ await _reactNative.Linking.openURL(links.web);
43
+ return true;
44
+ } catch {
45
+ return false;
46
+ }
47
+ }
48
+ }
49
+
50
+ /** The platform the backend should know this user by, if it's a store one. */
51
+ function storePlatform() {
52
+ return _reactNative.Platform.OS === 'ios' || _reactNative.Platform.OS === 'android' ? _reactNative.Platform.OS : undefined;
53
+ }
54
+ //# sourceMappingURL=review.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","storeLinks","store","Platform","OS","app_store_id","id","encodeURIComponent","app","web","play_store_package","pkg","openStoreReview","links","Linking","openURL","storePlatform","undefined"],"sourceRoot":"../../src","sources":["review.ts"],"mappings":";;;;;;;;AAMA,IAAAA,YAAA,GAAAC,OAAA;AANA;AACA;AACA;AACA;AACA;;AAYA;AACO,SAASC,UAAUA,CAACC,KAAsC,EAAqB;EACpF,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,IAAIF,KAAK,EAAEG,YAAY,EAAE;IAChD,MAAMC,EAAE,GAAGC,kBAAkB,CAACL,KAAK,CAACG,YAAY,CAAC;IACjD,OAAO;MACLG,GAAG,EAAE,oCAAoCF,EAAE,sBAAsB;MACjEG,GAAG,EAAE,gCAAgCH,EAAE;IACzC,CAAC;EACH;EACA,IAAIH,qBAAQ,CAACC,EAAE,KAAK,SAAS,IAAIF,KAAK,EAAEQ,kBAAkB,EAAE;IAC1D,MAAMC,GAAG,GAAGJ,kBAAkB,CAACL,KAAK,CAACQ,kBAAkB,CAAC;IACxD,OAAO;MACLF,GAAG,EAAE,uBAAuBG,GAAG,sBAAsB;MACrDF,GAAG,EAAE,iDAAiDE,GAAG;IAC3D,CAAC;EACH;EACA,OAAO,IAAI;AACb;;AAEA;AACO,eAAeC,eAAeA,CAACC,KAAiB,EAAoB;EACzE,IAAI;IACF,MAAMC,oBAAO,CAACC,OAAO,CAACF,KAAK,CAACL,GAAG,CAAC;IAChC,OAAO,IAAI;EACb,CAAC,CAAC,MAAM;IACN,IAAI;MACF,MAAMM,oBAAO,CAACC,OAAO,CAACF,KAAK,CAACJ,GAAG,CAAC;MAChC,OAAO,IAAI;IACb,CAAC,CAAC,MAAM;MACN,OAAO,KAAK;IACd;EACF;AACF;;AAEA;AACO,SAASO,aAAaA,CAAA,EAAkC;EAC7D,OAAOb,qBAAQ,CAACC,EAAE,KAAK,KAAK,IAAID,qBAAQ,CAACC,EAAE,KAAK,SAAS,GAAGD,qBAAQ,CAACC,EAAE,GAAGa,SAAS;AACrF","ignoreList":[]}
@@ -5,11 +5,14 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.resolveTheme = resolveTheme;
7
7
  exports.supportRadii = exports.supportLightTheme = exports.supportDarkTheme = void 0;
8
+ exports.themeFor = themeFor;
8
9
  var _designTokens = require("@appsupportkit/design-tokens");
9
10
  // The SDK consumes the same design tokens as the admin dashboard, so both
10
11
  // surfaces look like one product. On top of those it adds the few values
11
- // that only exist on mobile: sheet/bubble radii and the elevation used by
12
- // the launcher and the sheet (the web side gets those from CSS).
12
+ // that only exist on mobile: sheet/bubble radii, the elevation used by the
13
+ // launcher and the sheet (the web side gets those from CSS), and a re-cut of
14
+ // the surfaces and text ramp for a sheet held at arm's length (see
15
+ // SHEET_OVERRIDES).
13
16
 
14
17
  /** Rounder than the dashboard: touch targets read better with more radius. */
15
18
  const supportRadii = exports.supportRadii = {
@@ -36,7 +39,12 @@ const supportRadii = exports.supportRadii = {
36
39
  // Color helpers come first: the themes below are built at module load, so
37
40
  // anything they reach for has to already be initialized. (A `const` used
38
41
  // before its definition survives tsc but lands as `undefined` on Hermes.)
42
+
39
43
  const HEX = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i;
44
+ const WHITE = [255, 255, 255];
45
+ /** Foreground for light accents — the dashboard's near-black, not pure black. */
46
+ const INK = '#111113';
47
+ const INK_RGB = [17, 17, 19];
40
48
  function parseHex(color) {
41
49
  const match = HEX.exec(color.trim());
42
50
  const digits = match?.[1];
@@ -44,10 +52,83 @@ function parseHex(color) {
44
52
  const hex = digits.length === 3 ? digits.split('').map(c => c + c).join('') : digits;
45
53
  return [parseInt(hex.slice(0, 2), 16), parseInt(hex.slice(2, 4), 16), parseInt(hex.slice(4, 6), 16)];
46
54
  }
47
- function mix([r, g, b], target, amount) {
55
+ function toHex(rgb) {
56
+ return `#${rgb.map(c => c.toString(16).padStart(2, '0')).join('').toUpperCase()}`;
57
+ }
58
+ function mixRgb([r, g, b], target, amount) {
48
59
  const channel = c => Math.round(c + (target - c) * amount);
49
- return `rgb(${channel(r)}, ${channel(g)}, ${channel(b)})`;
60
+ return [channel(r), channel(g), channel(b)];
61
+ }
62
+ function mix(rgb, target, amount) {
63
+ return toHex(mixRgb(rgb, target, amount));
64
+ }
65
+
66
+ /** WCAG relative luminance. */
67
+ function luminance(rgb) {
68
+ const [r, g, b] = rgb.map(c => {
69
+ const s = c / 255;
70
+ return s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;
71
+ });
72
+ return 0.2126 * r + 0.7152 * g + 0.0722 * b;
73
+ }
74
+
75
+ /** WCAG contrast ratio, 1–21. */
76
+ function contrast(a, b) {
77
+ const [hi, lo] = [luminance(a), luminance(b)].sort((x, y) => y - x);
78
+ return (hi + 0.05) / (lo + 0.05);
50
79
  }
80
+
81
+ /**
82
+ * Nudges `color` toward white (dark theme) or black (light theme) in 5%
83
+ * steps until it reaches `ratio` against every background. The smallest
84
+ * step that works wins, so a brand color stays recognizably itself.
85
+ */
86
+ function legible(color, backgrounds, ratio, name) {
87
+ const rgb = parseHex(color);
88
+ if (rgb === null) return color;
89
+ const against = backgrounds.map(parseHex).filter(c => c !== null);
90
+ const target = name === 'dark' ? 255 : 0;
91
+ for (let step = 0; step <= 20; step += 1) {
92
+ const candidate = mixRgb(rgb, target, step * 0.05);
93
+ if (against.every(bg => contrast(candidate, bg) >= ratio)) {
94
+ return toHex(candidate);
95
+ }
96
+ }
97
+ return name === 'dark' ? '#FFFFFF' : '#000000';
98
+ }
99
+
100
+ /**
101
+ * Where the SDK departs from the dashboard tokens.
102
+ *
103
+ * Dark: the sheet floats over the host app, so it takes an elevated gray the
104
+ * way iOS sheets do, and the cards and bubbles on it step lighter again. On
105
+ * the dashboard's near-black base, cards sat 1.05:1 from the background and
106
+ * the layering disappeared.
107
+ *
108
+ * Both: the text ramp is re-cut so every step clears WCAG AA (4.5:1) on the
109
+ * sheet and on the cards over it. Tertiary carries timestamps and labels at
110
+ * 11–12px and was 3.1:1 (dark) and 2.5:1 (light); secondary moves too, so
111
+ * the two stay a visible step apart.
112
+ */
113
+ const SHEET_OVERRIDES = {
114
+ dark: {
115
+ sheet: '#161618',
116
+ surface: '#1F1F23',
117
+ surfaceHover: '#26262B',
118
+ surfaceActive: '#2D2D33',
119
+ border: '#2E2E35',
120
+ borderStrong: '#3C3C44',
121
+ textSecondary: '#A3A3AB',
122
+ // 6.5:1 on surface
123
+ textTertiary: '#87878F' // 4.6:1 on surface, 5.1:1 on sheet
124
+ },
125
+ light: {
126
+ sheet: _designTokens.lightColors.bg,
127
+ textSecondary: '#5A5A62',
128
+ // 6.5:1 on sheet
129
+ textTertiary: '#717179' // 4.6:1 on sheet, 4.8:1 on surface
130
+ }
131
+ };
51
132
  function shadowsFor(name, accent) {
52
133
  const dark = name === 'dark';
53
134
  return {
@@ -94,7 +175,21 @@ function launcherFor(name, accent) {
94
175
  minimalMark: name === 'dark' && rgb !== null ? mix(rgb, 255, 0.35) : accent
95
176
  };
96
177
  }
97
- function buildTheme(name, colors) {
178
+ function buildTheme(name, tokens) {
179
+ const base = {
180
+ ...tokens,
181
+ ...SHEET_OVERRIDES[name]
182
+ };
183
+ // Status tones double as 12px labels, so they get the text bar too.
184
+ const onSheet = [base.sheet, base.surface];
185
+ const colors = {
186
+ ...base,
187
+ statusOpen: legible(base.statusOpen, onSheet, 4.5, name),
188
+ statusProgress: legible(base.statusProgress, onSheet, 4.5, name),
189
+ statusResolved: legible(base.statusResolved, onSheet, 4.5, name),
190
+ statusDanger: legible(base.statusDanger, onSheet, 4.5, name),
191
+ accentText: legible(base.accent, onSheet, 4.5, name)
192
+ };
98
193
  return {
99
194
  name,
100
195
  colors,
@@ -110,39 +205,63 @@ const supportLightTheme = exports.supportLightTheme = buildTheme('light', _desig
110
205
 
111
206
  /**
112
207
  * Derives the accent family from a single brand color: a pressed shade, the
113
- * 12% wash used behind chips and own-message bubbles, and a foreground that
114
- * stays legible on top (dark text on light brands, white on dark ones).
208
+ * 12% wash used behind chips, a text-safe variant, and whichever of white or
209
+ * ink reads better on top of it.
210
+ *
211
+ * `adapt` is for a color that has to serve both themes: it is lifted just
212
+ * far enough to read as a fill (3:1, the WCAG bar for UI components) on this
213
+ * theme's sheet — a navy brand would otherwise vanish in dark mode. A color
214
+ * given for this mode specifically is used as is.
115
215
  */
116
- function withAccent(theme, accent) {
117
- const rgb = parseHex(accent);
118
- if (!rgb) return theme;
216
+ function withAccent(theme, accent, adapt) {
217
+ if (parseHex(accent) === null) return theme;
218
+ const {
219
+ name
220
+ } = theme;
221
+ const fill = adapt ? legible(accent, [theme.colors.sheet], 3, name) : toHex(parseHex(accent));
222
+ const rgb = parseHex(fill);
119
223
  const [r, g, b] = rgb;
120
- // Relative luminance, sRGB coefficients — good enough to pick a foreground.
121
- const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255;
224
+ const accentText = legible(fill, [theme.colors.sheet, theme.colors.surface], 4.5, name);
122
225
  const colors = {
123
226
  ...theme.colors,
124
- accent,
125
- accentHover: mix(rgb, theme.name === 'dark' ? 255 : 0, 0.12),
227
+ accent: fill,
228
+ accentHover: mix(rgb, name === 'dark' ? 255 : 0, 0.12),
126
229
  accentMuted: `rgba(${r}, ${g}, ${b}, 0.12)`,
127
- accentForeground: luminance > 0.62 ? '#111113' : '#FFFFFF',
128
- statusOpen: accent,
230
+ accentForeground: contrast(rgb, WHITE) >= contrast(rgb, INK_RGB) ? '#FFFFFF' : INK,
231
+ accentText,
232
+ statusOpen: accentText,
129
233
  statusOpenBg: `rgba(${r}, ${g}, ${b}, 0.10)`,
130
- focusRing: accent
234
+ focusRing: fill
131
235
  };
132
236
  return {
133
237
  ...theme,
134
238
  colors,
135
- shadows: shadowsFor(theme.name, accent),
136
- launcher: launcherFor(theme.name, accent)
239
+ shadows: shadowsFor(name, fill),
240
+ launcher: launcherFor(name, fill)
137
241
  };
138
242
  }
139
243
 
140
244
  /**
141
- * @param name "light" | "dark" (default dark).
142
- * @param accentColor Optional brand color (hex) replacing the default accent.
245
+ * The theme for one resolved mode. `accent` is the color for this mode
246
+ * (already picked from a light/dark pair), and `adapt` says whether it was a
247
+ * single color that has to be made to work here.
143
248
  */
144
- function resolveTheme(name, accentColor) {
249
+ function themeFor(name, accent, adapt) {
145
250
  const base = name === 'light' ? supportLightTheme : supportDarkTheme;
146
- return accentColor ? withAccent(base, accentColor) : base;
251
+ return accent ? withAccent(base, accent, adapt) : base;
252
+ }
253
+
254
+ /**
255
+ * @param name "light" | "dark" (default dark). SupportButton resolves its
256
+ * "system" default before calling this.
257
+ * @param accentColor Optional brand color: one hex for both modes (adjusted
258
+ * per mode where needed), or a `{ light, dark }` pair used as given.
259
+ */
260
+ function resolveTheme(name, accentColor) {
261
+ const mode = name === 'light' ? 'light' : 'dark';
262
+ if (typeof accentColor === 'object' && accentColor !== null) {
263
+ return themeFor(mode, accentColor[mode], false);
264
+ }
265
+ return themeFor(mode, accentColor, true);
147
266
  }
148
267
  //# sourceMappingURL=theme.js.map