@appsupportkit/support-sdk 0.3.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 (208) hide show
  1. package/lib/commonjs/api.js +49 -15
  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 +123 -97
  8. package/lib/commonjs/components/SupportButton.js.map +1 -1
  9. package/lib/commonjs/components/icons.js +81 -110
  10. package/lib/commonjs/components/icons.js.map +1 -1
  11. package/lib/commonjs/components/primitives.js +0 -153
  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/i18n/strings/de.js +3 -0
  16. package/lib/commonjs/i18n/strings/de.js.map +1 -1
  17. package/lib/commonjs/i18n/strings/en.js +3 -0
  18. package/lib/commonjs/i18n/strings/en.js.map +1 -1
  19. package/lib/commonjs/i18n/strings/es.js +3 -0
  20. package/lib/commonjs/i18n/strings/es.js.map +1 -1
  21. package/lib/commonjs/i18n/strings/fr.js +3 -0
  22. package/lib/commonjs/i18n/strings/fr.js.map +1 -1
  23. package/lib/commonjs/i18n/strings/hi.js +3 -0
  24. package/lib/commonjs/i18n/strings/hi.js.map +1 -1
  25. package/lib/commonjs/i18n/strings/it.js +3 -0
  26. package/lib/commonjs/i18n/strings/it.js.map +1 -1
  27. package/lib/commonjs/i18n/strings/ja.js +3 -0
  28. package/lib/commonjs/i18n/strings/ja.js.map +1 -1
  29. package/lib/commonjs/i18n/strings/ko.js +3 -0
  30. package/lib/commonjs/i18n/strings/ko.js.map +1 -1
  31. package/lib/commonjs/i18n/strings/nl.js +3 -0
  32. package/lib/commonjs/i18n/strings/nl.js.map +1 -1
  33. package/lib/commonjs/i18n/strings/pl.js +3 -0
  34. package/lib/commonjs/i18n/strings/pl.js.map +1 -1
  35. package/lib/commonjs/i18n/strings/pt.js +3 -0
  36. package/lib/commonjs/i18n/strings/pt.js.map +1 -1
  37. package/lib/commonjs/i18n/strings/ru.js +3 -0
  38. package/lib/commonjs/i18n/strings/ru.js.map +1 -1
  39. package/lib/commonjs/i18n/strings/tr.js +3 -0
  40. package/lib/commonjs/i18n/strings/tr.js.map +1 -1
  41. package/lib/commonjs/i18n/strings/zh.js +3 -0
  42. package/lib/commonjs/i18n/strings/zh.js.map +1 -1
  43. package/lib/commonjs/index.js +7 -0
  44. package/lib/commonjs/index.js.map +1 -1
  45. package/lib/commonjs/push.js +78 -3
  46. package/lib/commonjs/push.js.map +1 -1
  47. package/lib/commonjs/review.js +54 -0
  48. package/lib/commonjs/review.js.map +1 -0
  49. package/lib/commonjs/theme.js +142 -23
  50. package/lib/commonjs/theme.js.map +1 -1
  51. package/lib/commonjs/types.js +21 -3
  52. package/lib/commonjs/types.js.map +1 -1
  53. package/lib/commonjs/useSupportThreads.js +22 -15
  54. package/lib/commonjs/useSupportThreads.js.map +1 -1
  55. package/lib/commonjs/utils.js +13 -33
  56. package/lib/commonjs/utils.js.map +1 -1
  57. package/lib/commonjs/version.js +13 -0
  58. package/lib/commonjs/version.js.map +1 -0
  59. package/lib/module/api.js +46 -13
  60. package/lib/module/api.js.map +1 -1
  61. package/lib/module/components/BottomSheet.js +1 -1
  62. package/lib/module/components/BottomSheet.js.map +1 -1
  63. package/lib/module/components/LauncherButton.js +5 -5
  64. package/lib/module/components/LauncherButton.js.map +1 -1
  65. package/lib/module/components/SupportButton.js +128 -102
  66. package/lib/module/components/SupportButton.js.map +1 -1
  67. package/lib/module/components/icons.js +80 -107
  68. package/lib/module/components/icons.js.map +1 -1
  69. package/lib/module/components/primitives.js +2 -146
  70. package/lib/module/components/primitives.js.map +1 -1
  71. package/lib/module/components/screens/ChatScreen.js +485 -0
  72. package/lib/module/components/screens/ChatScreen.js.map +1 -0
  73. package/lib/module/i18n/strings/de.js +3 -0
  74. package/lib/module/i18n/strings/de.js.map +1 -1
  75. package/lib/module/i18n/strings/en.js +3 -0
  76. package/lib/module/i18n/strings/en.js.map +1 -1
  77. package/lib/module/i18n/strings/es.js +3 -0
  78. package/lib/module/i18n/strings/es.js.map +1 -1
  79. package/lib/module/i18n/strings/fr.js +3 -0
  80. package/lib/module/i18n/strings/fr.js.map +1 -1
  81. package/lib/module/i18n/strings/hi.js +3 -0
  82. package/lib/module/i18n/strings/hi.js.map +1 -1
  83. package/lib/module/i18n/strings/it.js +3 -0
  84. package/lib/module/i18n/strings/it.js.map +1 -1
  85. package/lib/module/i18n/strings/ja.js +3 -0
  86. package/lib/module/i18n/strings/ja.js.map +1 -1
  87. package/lib/module/i18n/strings/ko.js +3 -0
  88. package/lib/module/i18n/strings/ko.js.map +1 -1
  89. package/lib/module/i18n/strings/nl.js +3 -0
  90. package/lib/module/i18n/strings/nl.js.map +1 -1
  91. package/lib/module/i18n/strings/pl.js +3 -0
  92. package/lib/module/i18n/strings/pl.js.map +1 -1
  93. package/lib/module/i18n/strings/pt.js +3 -0
  94. package/lib/module/i18n/strings/pt.js.map +1 -1
  95. package/lib/module/i18n/strings/ru.js +3 -0
  96. package/lib/module/i18n/strings/ru.js.map +1 -1
  97. package/lib/module/i18n/strings/tr.js +3 -0
  98. package/lib/module/i18n/strings/tr.js.map +1 -1
  99. package/lib/module/i18n/strings/zh.js +3 -0
  100. package/lib/module/i18n/strings/zh.js.map +1 -1
  101. package/lib/module/index.js +1 -0
  102. package/lib/module/index.js.map +1 -1
  103. package/lib/module/push.js +77 -3
  104. package/lib/module/push.js.map +1 -1
  105. package/lib/module/review.js +48 -0
  106. package/lib/module/review.js.map +1 -0
  107. package/lib/module/theme.js +141 -23
  108. package/lib/module/theme.js.map +1 -1
  109. package/lib/module/types.js +21 -3
  110. package/lib/module/types.js.map +1 -1
  111. package/lib/module/useSupportThreads.js +22 -15
  112. package/lib/module/useSupportThreads.js.map +1 -1
  113. package/lib/module/utils.js +12 -32
  114. package/lib/module/utils.js.map +1 -1
  115. package/lib/module/version.js +9 -0
  116. package/lib/module/version.js.map +1 -0
  117. package/lib/typescript/api.d.ts +33 -12
  118. package/lib/typescript/api.d.ts.map +1 -1
  119. package/lib/typescript/components/SupportButton.d.ts +2 -2
  120. package/lib/typescript/components/SupportButton.d.ts.map +1 -1
  121. package/lib/typescript/components/icons.d.ts +5 -14
  122. package/lib/typescript/components/icons.d.ts.map +1 -1
  123. package/lib/typescript/components/primitives.d.ts +0 -31
  124. package/lib/typescript/components/primitives.d.ts.map +1 -1
  125. package/lib/typescript/components/screens/ChatScreen.d.ts +21 -0
  126. package/lib/typescript/components/screens/ChatScreen.d.ts.map +1 -0
  127. package/lib/typescript/i18n/strings/de.d.ts.map +1 -1
  128. package/lib/typescript/i18n/strings/en.d.ts +3 -0
  129. package/lib/typescript/i18n/strings/en.d.ts.map +1 -1
  130. package/lib/typescript/i18n/strings/es.d.ts.map +1 -1
  131. package/lib/typescript/i18n/strings/fr.d.ts.map +1 -1
  132. package/lib/typescript/i18n/strings/hi.d.ts.map +1 -1
  133. package/lib/typescript/i18n/strings/it.d.ts.map +1 -1
  134. package/lib/typescript/i18n/strings/ja.d.ts.map +1 -1
  135. package/lib/typescript/i18n/strings/ko.d.ts.map +1 -1
  136. package/lib/typescript/i18n/strings/nl.d.ts.map +1 -1
  137. package/lib/typescript/i18n/strings/pl.d.ts.map +1 -1
  138. package/lib/typescript/i18n/strings/pt.d.ts.map +1 -1
  139. package/lib/typescript/i18n/strings/ru.d.ts.map +1 -1
  140. package/lib/typescript/i18n/strings/tr.d.ts.map +1 -1
  141. package/lib/typescript/i18n/strings/zh.d.ts.map +1 -1
  142. package/lib/typescript/index.d.ts +3 -2
  143. package/lib/typescript/index.d.ts.map +1 -1
  144. package/lib/typescript/push.d.ts +14 -2
  145. package/lib/typescript/push.d.ts.map +1 -1
  146. package/lib/typescript/review.d.ts +15 -0
  147. package/lib/typescript/review.d.ts.map +1 -0
  148. package/lib/typescript/theme.d.ts +23 -5
  149. package/lib/typescript/theme.d.ts.map +1 -1
  150. package/lib/typescript/types.d.ts +54 -11
  151. package/lib/typescript/types.d.ts.map +1 -1
  152. package/lib/typescript/useSupportThreads.d.ts +9 -3
  153. package/lib/typescript/useSupportThreads.d.ts.map +1 -1
  154. package/lib/typescript/utils.d.ts +3 -2
  155. package/lib/typescript/utils.d.ts.map +1 -1
  156. package/lib/typescript/version.d.ts +7 -0
  157. package/lib/typescript/version.d.ts.map +1 -0
  158. package/package.json +1 -1
  159. package/src/api.ts +59 -30
  160. package/src/components/BottomSheet.tsx +1 -1
  161. package/src/components/LauncherButton.tsx +4 -4
  162. package/src/components/SupportButton.tsx +140 -111
  163. package/src/components/icons.tsx +60 -101
  164. package/src/components/primitives.tsx +1 -163
  165. package/src/components/screens/ChatScreen.tsx +541 -0
  166. package/src/i18n/strings/de.ts +3 -0
  167. package/src/i18n/strings/en.ts +3 -0
  168. package/src/i18n/strings/es.ts +3 -0
  169. package/src/i18n/strings/fr.ts +3 -0
  170. package/src/i18n/strings/hi.ts +3 -0
  171. package/src/i18n/strings/it.ts +3 -0
  172. package/src/i18n/strings/ja.ts +3 -0
  173. package/src/i18n/strings/ko.ts +3 -0
  174. package/src/i18n/strings/nl.ts +3 -0
  175. package/src/i18n/strings/pl.ts +3 -0
  176. package/src/i18n/strings/pt.ts +3 -0
  177. package/src/i18n/strings/ru.ts +3 -0
  178. package/src/i18n/strings/tr.ts +3 -0
  179. package/src/i18n/strings/zh.ts +3 -0
  180. package/src/index.tsx +5 -0
  181. package/src/push.ts +100 -2
  182. package/src/review.ts +54 -0
  183. package/src/theme.ts +182 -28
  184. package/src/types.ts +53 -11
  185. package/src/useSupportThreads.ts +31 -18
  186. package/src/utils.ts +14 -21
  187. package/src/version.ts +6 -0
  188. package/lib/commonjs/components/screens/ComposeScreen.js +0 -219
  189. package/lib/commonjs/components/screens/ComposeScreen.js.map +0 -1
  190. package/lib/commonjs/components/screens/HomeScreen.js +0 -334
  191. package/lib/commonjs/components/screens/HomeScreen.js.map +0 -1
  192. package/lib/commonjs/components/screens/ThreadScreen.js +0 -339
  193. package/lib/commonjs/components/screens/ThreadScreen.js.map +0 -1
  194. package/lib/module/components/screens/ComposeScreen.js +0 -217
  195. package/lib/module/components/screens/ComposeScreen.js.map +0 -1
  196. package/lib/module/components/screens/HomeScreen.js +0 -330
  197. package/lib/module/components/screens/HomeScreen.js.map +0 -1
  198. package/lib/module/components/screens/ThreadScreen.js +0 -337
  199. package/lib/module/components/screens/ThreadScreen.js.map +0 -1
  200. package/lib/typescript/components/screens/ComposeScreen.d.ts +0 -12
  201. package/lib/typescript/components/screens/ComposeScreen.d.ts.map +0 -1
  202. package/lib/typescript/components/screens/HomeScreen.d.ts +0 -19
  203. package/lib/typescript/components/screens/HomeScreen.d.ts.map +0 -1
  204. package/lib/typescript/components/screens/ThreadScreen.d.ts +0 -12
  205. package/lib/typescript/components/screens/ThreadScreen.d.ts.map +0 -1
  206. package/src/components/screens/ComposeScreen.tsx +0 -229
  207. package/src/components/screens/HomeScreen.tsx +0 -346
  208. package/src/components/screens/ThreadScreen.tsx +0 -424
@@ -11,76 +11,7 @@ import {
11
11
  } from 'react-native';
12
12
  import type { Translator } from '../i18n';
13
13
  import type { SupportTheme } from '../theme';
14
- import type { QueryStatus, QueryType } from '../types';
15
- import { AlertCircleIcon, ChatIcon, PlusCircleIcon } from './icons';
16
-
17
- export function typeIcon(type: QueryType, color: string, size = 15): ReactNode {
18
- if (type === 'bug_report') return <AlertCircleIcon color={color} size={size} />;
19
- if (type === 'feature_request') return <PlusCircleIcon color={color} size={size} />;
20
- return <ChatIcon color={color} size={size} />;
21
- }
22
-
23
- export function typeColor(type: QueryType, theme: SupportTheme): string {
24
- if (type === 'bug_report') return theme.colors.statusDanger;
25
- if (type === 'feature_request') return theme.colors.statusProgress;
26
- return theme.colors.statusOpen;
27
- }
28
-
29
- export function typeBackground(type: QueryType, theme: SupportTheme): string {
30
- if (type === 'bug_report') return theme.colors.statusDangerBg;
31
- if (type === 'feature_request') return theme.colors.statusProgressBg;
32
- return theme.colors.statusOpenBg;
33
- }
34
-
35
- /** Tinted round chip holding a type icon — the anchor of every list row. */
36
- export function TypeGlyph({
37
- type,
38
- theme,
39
- size = 36,
40
- }: {
41
- type: QueryType;
42
- theme: SupportTheme;
43
- size?: number;
44
- }) {
45
- return (
46
- <View
47
- style={{
48
- width: size,
49
- height: size,
50
- borderRadius: size / 2,
51
- backgroundColor: typeBackground(type, theme),
52
- alignItems: 'center',
53
- justifyContent: 'center',
54
- }}
55
- >
56
- {typeIcon(type, typeColor(type, theme), size * 0.44)}
57
- </View>
58
- );
59
- }
60
-
61
- /** Status dot + label — same visual language as the dashboard. */
62
- export function StatusIndicator({
63
- status,
64
- theme,
65
- strings,
66
- }: {
67
- status: QueryStatus;
68
- theme: SupportTheme;
69
- strings: Translator;
70
- }) {
71
- const color =
72
- status === 'open' ? theme.colors.statusOpen : theme.colors.statusResolved;
73
- return (
74
- <View style={{ flexDirection: 'row', alignItems: 'center', gap: 6 }}>
75
- <View
76
- style={{ width: 6, height: 6, borderRadius: 3, backgroundColor: color }}
77
- />
78
- <Text style={{ fontSize: 12, color }}>
79
- {strings.t(status === 'open' ? 'status.open' : 'status.resolved')}
80
- </Text>
81
- </View>
82
- );
83
- }
14
+ import { ChatIcon } from './icons';
84
15
 
85
16
  /** Pressable row with the standard press wash. */
86
17
  export function PressableRow({
@@ -239,68 +170,6 @@ export function SecondaryButton({
239
170
  );
240
171
  }
241
172
 
242
- /** The count pill on a thread row. */
243
- export function UnreadPill({
244
- count,
245
- theme,
246
- }: {
247
- count: number;
248
- theme: SupportTheme;
249
- }) {
250
- return (
251
- <View
252
- style={{
253
- minWidth: 20,
254
- height: 20,
255
- paddingHorizontal: 6,
256
- borderRadius: theme.radii.pill,
257
- backgroundColor: theme.colors.accent,
258
- alignItems: 'center',
259
- justifyContent: 'center',
260
- }}
261
- >
262
- <Text
263
- style={{
264
- fontSize: 11,
265
- lineHeight: 14,
266
- fontWeight: '700',
267
- color: theme.colors.accentForeground,
268
- fontVariant: ['tabular-nums'],
269
- }}
270
- >
271
- {count > 99 ? '99+' : count}
272
- </Text>
273
- </View>
274
- );
275
- }
276
-
277
- export function SectionLabel({
278
- children,
279
- theme,
280
- style,
281
- }: {
282
- children: ReactNode;
283
- theme: SupportTheme;
284
- style?: StyleProp<TextStyle>;
285
- }) {
286
- return (
287
- <Text
288
- style={[
289
- {
290
- fontSize: 11,
291
- fontWeight: '600',
292
- textTransform: 'uppercase',
293
- letterSpacing: 0.6,
294
- color: theme.colors.textTertiary,
295
- },
296
- style,
297
- ]}
298
- >
299
- {children}
300
- </Text>
301
- );
302
- }
303
-
304
173
  /** Small muted icon + one line — no illustrations. */
305
174
  export function EmptyState({
306
175
  message,
@@ -456,34 +325,3 @@ export const textStyles = {
456
325
  fontVariant: ['tabular-nums'],
457
326
  }),
458
327
  };
459
-
460
- export function TypeChipView({
461
- type,
462
- theme,
463
- strings,
464
- }: {
465
- type: QueryType;
466
- theme: SupportTheme;
467
- strings: Translator;
468
- }) {
469
- const color = typeColor(type, theme);
470
- return (
471
- <View
472
- style={{
473
- flexDirection: 'row',
474
- alignItems: 'center',
475
- gap: 5,
476
- paddingHorizontal: 8,
477
- paddingVertical: 4,
478
- borderRadius: theme.radii.pill,
479
- backgroundColor: typeBackground(type, theme),
480
- alignSelf: 'flex-start',
481
- }}
482
- >
483
- {typeIcon(type, color, 11)}
484
- <Text style={{ fontSize: 11.5, fontWeight: '600', color }}>
485
- {strings.t(`type.${type}`)}
486
- </Text>
487
- </View>
488
- );
489
- }