@cachly-dev/mcp-server 0.10.64 → 0.10.66

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 (270) hide show
  1. package/dist/src/handlers/brain.js +1 -1
  2. package/dist/src/index.js +1 -1
  3. package/package.json +7 -1
  4. package/server.json +2 -2
  5. package/.env.test.example +0 -23
  6. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -50
  7. package/.github/ISSUE_TEMPLATE/config.yml +0 -8
  8. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -25
  9. package/.github/workflows/eas-build-android.yml +0 -58
  10. package/.github/workflows/eas-update.yml +0 -55
  11. package/.github/workflows/publish.yml +0 -72
  12. package/BENCH.md +0 -91
  13. package/CHANGELOG.md +0 -604
  14. package/CHANGELOG.md.tmp +0 -0
  15. package/Dockerfile +0 -16
  16. package/LAUNCH_TEXTS.md +0 -182
  17. package/PROGRESS.md +0 -137
  18. package/STRATEGY.md +0 -228
  19. package/VISION_10X.md +0 -133
  20. package/apps/travel-chaos-organizer/.env.example +0 -49
  21. package/apps/travel-chaos-organizer/DEPLOY.md +0 -328
  22. package/apps/travel-chaos-organizer/Makefile +0 -57
  23. package/apps/travel-chaos-organizer/README.md +0 -159
  24. package/apps/travel-chaos-organizer/backend/.env.example +0 -10
  25. package/apps/travel-chaos-organizer/backend/Dockerfile +0 -25
  26. package/apps/travel-chaos-organizer/backend/alembic/env.py +0 -56
  27. package/apps/travel-chaos-organizer/backend/alembic/script.py.mako +0 -24
  28. package/apps/travel-chaos-organizer/backend/alembic/versions/.gitkeep +0 -0
  29. package/apps/travel-chaos-organizer/backend/alembic/versions/0001_stripe_customer_id.py +0 -24
  30. package/apps/travel-chaos-organizer/backend/alembic/versions/0002_telegram_chat_id.py +0 -24
  31. package/apps/travel-chaos-organizer/backend/alembic.ini +0 -39
  32. package/apps/travel-chaos-organizer/backend/app/__init__.py +0 -0
  33. package/apps/travel-chaos-organizer/backend/app/auth/__init__.py +0 -0
  34. package/apps/travel-chaos-organizer/backend/app/auth/keycloak.py +0 -81
  35. package/apps/travel-chaos-organizer/backend/app/config.py +0 -66
  36. package/apps/travel-chaos-organizer/backend/app/db/__init__.py +0 -0
  37. package/apps/travel-chaos-organizer/backend/app/db/database.py +0 -20
  38. package/apps/travel-chaos-organizer/backend/app/db/migrations/001_init.sql +0 -71
  39. package/apps/travel-chaos-organizer/backend/app/db/migrations/002_telemetry_freemium.sql +0 -31
  40. package/apps/travel-chaos-organizer/backend/app/db/migrations/003_telegram_chat_id.sql +0 -4
  41. package/apps/travel-chaos-organizer/backend/app/db/migrations/004_stripe_and_email.sql +0 -5
  42. package/apps/travel-chaos-organizer/backend/app/limiter.py +0 -4
  43. package/apps/travel-chaos-organizer/backend/app/logging_config.py +0 -25
  44. package/apps/travel-chaos-organizer/backend/app/main.py +0 -77
  45. package/apps/travel-chaos-organizer/backend/app/models/__init__.py +0 -0
  46. package/apps/travel-chaos-organizer/backend/app/models/schemas.py +0 -142
  47. package/apps/travel-chaos-organizer/backend/app/routers/__init__.py +0 -0
  48. package/apps/travel-chaos-organizer/backend/app/routers/admin.py +0 -237
  49. package/apps/travel-chaos-organizer/backend/app/routers/cache.py +0 -13
  50. package/apps/travel-chaos-organizer/backend/app/routers/events.py +0 -29
  51. package/apps/travel-chaos-organizer/backend/app/routers/export.py +0 -122
  52. package/apps/travel-chaos-organizer/backend/app/routers/inbox.py +0 -122
  53. package/apps/travel-chaos-organizer/backend/app/routers/items.py +0 -130
  54. package/apps/travel-chaos-organizer/backend/app/routers/mail.py +0 -108
  55. package/apps/travel-chaos-organizer/backend/app/routers/parse.py +0 -303
  56. package/apps/travel-chaos-organizer/backend/app/routers/payments.py +0 -179
  57. package/apps/travel-chaos-organizer/backend/app/routers/trips.py +0 -134
  58. package/apps/travel-chaos-organizer/backend/app/routers/users.py +0 -169
  59. package/apps/travel-chaos-organizer/backend/app/routers/waitlist.py +0 -37
  60. package/apps/travel-chaos-organizer/backend/app/services/__init__.py +0 -0
  61. package/apps/travel-chaos-organizer/backend/app/services/cache.py +0 -131
  62. package/apps/travel-chaos-organizer/backend/app/services/drip.py +0 -128
  63. package/apps/travel-chaos-organizer/backend/app/services/email.py +0 -61
  64. package/apps/travel-chaos-organizer/backend/app/services/errors.py +0 -44
  65. package/apps/travel-chaos-organizer/backend/app/services/notifier.py +0 -10
  66. package/apps/travel-chaos-organizer/backend/app/services/ollama.py +0 -101
  67. package/apps/travel-chaos-organizer/backend/app/services/parser.py +0 -22
  68. package/apps/travel-chaos-organizer/backend/app/services/quota.py +0 -85
  69. package/apps/travel-chaos-organizer/backend/app/services/sentry.py +0 -11
  70. package/apps/travel-chaos-organizer/backend/app/services/telemetry.py +0 -35
  71. package/apps/travel-chaos-organizer/backend/pytest.ini +0 -4
  72. package/apps/travel-chaos-organizer/backend/requirements-dev.txt +0 -6
  73. package/apps/travel-chaos-organizer/backend/requirements.txt +0 -25
  74. package/apps/travel-chaos-organizer/backend/tests/__init__.py +0 -0
  75. package/apps/travel-chaos-organizer/backend/tests/conftest.py +0 -223
  76. package/apps/travel-chaos-organizer/backend/tests/test_admin.py +0 -99
  77. package/apps/travel-chaos-organizer/backend/tests/test_cache.py +0 -142
  78. package/apps/travel-chaos-organizer/backend/tests/test_drip.py +0 -32
  79. package/apps/travel-chaos-organizer/backend/tests/test_e2e_chain.py +0 -121
  80. package/apps/travel-chaos-organizer/backend/tests/test_export.py +0 -48
  81. package/apps/travel-chaos-organizer/backend/tests/test_inbox.py +0 -107
  82. package/apps/travel-chaos-organizer/backend/tests/test_items.py +0 -138
  83. package/apps/travel-chaos-organizer/backend/tests/test_mail.py +0 -113
  84. package/apps/travel-chaos-organizer/backend/tests/test_ollama.py +0 -145
  85. package/apps/travel-chaos-organizer/backend/tests/test_parse_url.py +0 -98
  86. package/apps/travel-chaos-organizer/backend/tests/test_parser.py +0 -72
  87. package/apps/travel-chaos-organizer/backend/tests/test_payments.py +0 -163
  88. package/apps/travel-chaos-organizer/backend/tests/test_quota.py +0 -46
  89. package/apps/travel-chaos-organizer/backend/tests/test_search.py +0 -67
  90. package/apps/travel-chaos-organizer/backend/tests/test_trips.py +0 -123
  91. package/apps/travel-chaos-organizer/backend/tests/test_users.py +0 -52
  92. package/apps/travel-chaos-organizer/backups/.gitkeep +0 -0
  93. package/apps/travel-chaos-organizer/caddy/Caddyfile +0 -27
  94. package/apps/travel-chaos-organizer/docker-compose.node1.yml +0 -31
  95. package/apps/travel-chaos-organizer/docker-compose.override.yml +0 -14
  96. package/apps/travel-chaos-organizer/docker-compose.yml +0 -128
  97. package/apps/travel-chaos-organizer/frontend/.env.example +0 -13
  98. package/apps/travel-chaos-organizer/frontend/app/(app)/_layout.tsx +0 -80
  99. package/apps/travel-chaos-organizer/frontend/app/(app)/inbox.tsx +0 -166
  100. package/apps/travel-chaos-organizer/frontend/app/(app)/search.tsx +0 -130
  101. package/apps/travel-chaos-organizer/frontend/app/(app)/settings.tsx +0 -381
  102. package/apps/travel-chaos-organizer/frontend/app/(app)/trips/[id].tsx +0 -346
  103. package/apps/travel-chaos-organizer/frontend/app/(app)/trips.tsx +0 -363
  104. package/apps/travel-chaos-organizer/frontend/app/(app)/upgrade/cancel.tsx +0 -34
  105. package/apps/travel-chaos-organizer/frontend/app/(app)/upgrade/success.tsx +0 -35
  106. package/apps/travel-chaos-organizer/frontend/app/(auth)/login.tsx +0 -91
  107. package/apps/travel-chaos-organizer/frontend/app/_layout.tsx +0 -71
  108. package/apps/travel-chaos-organizer/frontend/app/auth.tsx +0 -29
  109. package/apps/travel-chaos-organizer/frontend/app/index.tsx +0 -16
  110. package/apps/travel-chaos-organizer/frontend/app/onboarding.tsx +0 -119
  111. package/apps/travel-chaos-organizer/frontend/app.config.ts +0 -54
  112. package/apps/travel-chaos-organizer/frontend/assets/adaptive-icon.svg +0 -66
  113. package/apps/travel-chaos-organizer/frontend/assets/icon.svg +0 -79
  114. package/apps/travel-chaos-organizer/frontend/assets/splash.svg +0 -15
  115. package/apps/travel-chaos-organizer/frontend/components/BottomSheet.tsx +0 -102
  116. package/apps/travel-chaos-organizer/frontend/components/ConfettiCannon.tsx +0 -107
  117. package/apps/travel-chaos-organizer/frontend/components/ConfirmDialog.tsx +0 -109
  118. package/apps/travel-chaos-organizer/frontend/components/ErrorBoundary.tsx +0 -45
  119. package/apps/travel-chaos-organizer/frontend/components/FileUploadButton.tsx +0 -19
  120. package/apps/travel-chaos-organizer/frontend/components/ImportSheet.tsx +0 -155
  121. package/apps/travel-chaos-organizer/frontend/components/OfflineBadge.tsx +0 -55
  122. package/apps/travel-chaos-organizer/frontend/components/QRCodeViewer.tsx +0 -80
  123. package/apps/travel-chaos-organizer/frontend/components/ScoreRing.tsx +0 -39
  124. package/apps/travel-chaos-organizer/frontend/components/Screen.tsx +0 -39
  125. package/apps/travel-chaos-organizer/frontend/components/Skeleton.tsx +0 -70
  126. package/apps/travel-chaos-organizer/frontend/components/SwipeableInboxItem.tsx +0 -121
  127. package/apps/travel-chaos-organizer/frontend/components/SwipeableTimelineItem.tsx +0 -70
  128. package/apps/travel-chaos-organizer/frontend/components/TimelineItem.tsx +0 -73
  129. package/apps/travel-chaos-organizer/frontend/components/TimelineItemDetail.tsx +0 -130
  130. package/apps/travel-chaos-organizer/frontend/components/Toast.tsx +0 -60
  131. package/apps/travel-chaos-organizer/frontend/components/ToastContext.tsx +0 -42
  132. package/apps/travel-chaos-organizer/frontend/components/TripCard.tsx +0 -146
  133. package/apps/travel-chaos-organizer/frontend/components/TripQRModal.tsx +0 -70
  134. package/apps/travel-chaos-organizer/frontend/components/UpgradeBanner.tsx +0 -44
  135. package/apps/travel-chaos-organizer/frontend/eas.json +0 -22
  136. package/apps/travel-chaos-organizer/frontend/hooks/useInbox.ts +0 -24
  137. package/apps/travel-chaos-organizer/frontend/hooks/useNetworkSync.ts +0 -60
  138. package/apps/travel-chaos-organizer/frontend/hooks/useTrips.ts +0 -112
  139. package/apps/travel-chaos-organizer/frontend/lib/api.ts +0 -223
  140. package/apps/travel-chaos-organizer/frontend/lib/auth.ts +0 -93
  141. package/apps/travel-chaos-organizer/frontend/lib/db.ts +0 -86
  142. package/apps/travel-chaos-organizer/frontend/lib/fileCache.ts +0 -54
  143. package/apps/travel-chaos-organizer/frontend/lib/haptics.ts +0 -13
  144. package/apps/travel-chaos-organizer/frontend/lib/notifications.ts +0 -112
  145. package/apps/travel-chaos-organizer/frontend/lib/offlineQueue.ts +0 -145
  146. package/apps/travel-chaos-organizer/frontend/lib/quota.tsx +0 -43
  147. package/apps/travel-chaos-organizer/frontend/lib/sentry.ts +0 -28
  148. package/apps/travel-chaos-organizer/frontend/lib/shareIntent.ts +0 -44
  149. package/apps/travel-chaos-organizer/frontend/package-lock.json +0 -13221
  150. package/apps/travel-chaos-organizer/frontend/package.json +0 -44
  151. package/apps/travel-chaos-organizer/frontend/tsconfig.json +0 -23
  152. package/apps/travel-chaos-organizer/keycloak/realm-export.json +0 -59
  153. package/apps/travel-chaos-organizer/landing/index.html +0 -773
  154. package/apps/travel-chaos-organizer/scripts/backup.sh +0 -14
  155. package/apps/travel-chaos-organizer/scripts/configure-env.sh +0 -82
  156. package/apps/travel-chaos-organizer/scripts/deploy.sh +0 -54
  157. package/apps/travel-chaos-organizer/scripts/health-check.sh +0 -36
  158. package/apps/travel-chaos-organizer/scripts/migrate.sh +0 -7
  159. package/apps/travel-chaos-organizer/scripts/server-setup.sh +0 -85
  160. package/apps/travel-chaos-organizer/scripts/smoke-test.sh +0 -29
  161. package/apps/travel-chaos-organizer/scripts/verify-tracking.sh +0 -71
  162. package/apps/travel-chaos-organizer/telegram-bot/.env.example +0 -3
  163. package/apps/travel-chaos-organizer/telegram-bot/Dockerfile +0 -6
  164. package/apps/travel-chaos-organizer/telegram-bot/bot.py +0 -504
  165. package/apps/travel-chaos-organizer/telegram-bot/requirements.txt +0 -3
  166. package/dist/src/__tests__/auth.test.d.ts +0 -1
  167. package/dist/src/__tests__/auth.test.js +0 -107
  168. package/dist/src/__tests__/auth.test.js.map +0 -1
  169. package/dist/src/__tests__/brain-flow.test.d.ts +0 -12
  170. package/dist/src/__tests__/brain-flow.test.js +0 -1241
  171. package/dist/src/__tests__/brain-flow.test.js.map +0 -1
  172. package/dist/src/__tests__/confidence.test.d.ts +0 -13
  173. package/dist/src/__tests__/confidence.test.js +0 -233
  174. package/dist/src/__tests__/confidence.test.js.map +0 -1
  175. package/dist/src/__tests__/e2e/api-auth.test.d.ts +0 -7
  176. package/dist/src/__tests__/e2e/api-auth.test.js +0 -162
  177. package/dist/src/__tests__/e2e/api-auth.test.js.map +0 -1
  178. package/dist/src/__tests__/e2e/api-health.test.d.ts +0 -7
  179. package/dist/src/__tests__/e2e/api-health.test.js +0 -95
  180. package/dist/src/__tests__/e2e/api-health.test.js.map +0 -1
  181. package/dist/src/__tests__/e2e/cli.test.d.ts +0 -10
  182. package/dist/src/__tests__/e2e/cli.test.js +0 -204
  183. package/dist/src/__tests__/e2e/cli.test.js.map +0 -1
  184. package/dist/src/__tests__/e2e/config.d.ts +0 -35
  185. package/dist/src/__tests__/e2e/config.js +0 -53
  186. package/dist/src/__tests__/e2e/config.js.map +0 -1
  187. package/dist/src/__tests__/e2e/funnel.test.d.ts +0 -13
  188. package/dist/src/__tests__/e2e/funnel.test.js +0 -90
  189. package/dist/src/__tests__/e2e/funnel.test.js.map +0 -1
  190. package/dist/src/__tests__/e2e/mcp-tools.test.d.ts +0 -7
  191. package/dist/src/__tests__/e2e/mcp-tools.test.js +0 -129
  192. package/dist/src/__tests__/e2e/mcp-tools.test.js.map +0 -1
  193. package/dist/src/__tests__/e2e/provisioning.test.d.ts +0 -15
  194. package/dist/src/__tests__/e2e/provisioning.test.js +0 -123
  195. package/dist/src/__tests__/e2e/provisioning.test.js.map +0 -1
  196. package/dist/src/__tests__/handlers-unit.test.d.ts +0 -12
  197. package/dist/src/__tests__/handlers-unit.test.js +0 -505
  198. package/dist/src/__tests__/handlers-unit.test.js.map +0 -1
  199. package/dist/src/__tests__/namespace.test.d.ts +0 -1
  200. package/dist/src/__tests__/namespace.test.js +0 -114
  201. package/dist/src/__tests__/namespace.test.js.map +0 -1
  202. package/dist/src/__tests__/rerank.test.d.ts +0 -1
  203. package/dist/src/__tests__/rerank.test.js +0 -115
  204. package/dist/src/__tests__/rerank.test.js.map +0 -1
  205. package/dist/src/__tests__/utils.test.d.ts +0 -1
  206. package/dist/src/__tests__/utils.test.js +0 -83
  207. package/dist/src/__tests__/utils.test.js.map +0 -1
  208. package/dist/src/bench/cachly-bench.d.ts +0 -35
  209. package/dist/src/bench/cachly-bench.js +0 -182
  210. package/dist/src/bench/cachly-bench.js.map +0 -1
  211. package/dist/src/bench/fixtures.d.ts +0 -37
  212. package/dist/src/bench/fixtures.js +0 -225
  213. package/dist/src/bench/fixtures.js.map +0 -1
  214. package/dist/src/search.test.d.ts +0 -1
  215. package/dist/src/search.test.js +0 -713
  216. package/dist/src/search.test.js.map +0 -1
  217. package/eslint.config.js +0 -16
  218. package/glama.json +0 -36
  219. package/llms.txt +0 -155
  220. package/packages/telegram-notify/SPLIT_PLAN.md +0 -106
  221. package/packages/telegram-notify/client.ts +0 -88
  222. package/packages/telegram-notify/emojis.json +0 -22
  223. package/packages/telegram-notify/pyproject.toml +0 -17
  224. package/packages/telegram-notify/telegram_notify/__init__.py +0 -3
  225. package/packages/telegram-notify/telegram_notify/client.py +0 -87
  226. package/packages/telegram-notify/telegram_notify/emojis.json +0 -22
  227. package/scripts/e2e-run.sh +0 -160
  228. package/scripts/generate-icons.js +0 -28
  229. package/smithery.yaml +0 -45
  230. package/src/__tests__/auth.test.ts +0 -147
  231. package/src/__tests__/brain-flow.test.ts +0 -1472
  232. package/src/__tests__/confidence.test.ts +0 -285
  233. package/src/__tests__/e2e/api-auth.test.ts +0 -182
  234. package/src/__tests__/e2e/api-health.test.ts +0 -103
  235. package/src/__tests__/e2e/cli.test.ts +0 -228
  236. package/src/__tests__/e2e/config.ts +0 -53
  237. package/src/__tests__/e2e/funnel.test.ts +0 -99
  238. package/src/__tests__/e2e/mcp-tools.test.ts +0 -191
  239. package/src/__tests__/e2e/provisioning.test.ts +0 -128
  240. package/src/__tests__/handlers-unit.test.ts +0 -677
  241. package/src/__tests__/namespace.test.ts +0 -126
  242. package/src/__tests__/rerank.test.ts +0 -130
  243. package/src/__tests__/utils.test.ts +0 -81
  244. package/src/auth.ts +0 -46
  245. package/src/bench/cachly-bench.ts +0 -217
  246. package/src/bench/fixtures.ts +0 -256
  247. package/src/ckg.ts +0 -103
  248. package/src/confidence.ts +0 -38
  249. package/src/embeddings.ts +0 -217
  250. package/src/handlers/advanced.ts +0 -647
  251. package/src/handlers/brain.ts +0 -2622
  252. package/src/handlers/cache.ts +0 -633
  253. package/src/handlers/context.ts +0 -222
  254. package/src/handlers/fedbrain.ts +0 -1232
  255. package/src/handlers/instances.ts +0 -180
  256. package/src/handlers/roadmap.ts +0 -201
  257. package/src/handlers/syndicate.ts +0 -460
  258. package/src/handlers/tco.ts +0 -345
  259. package/src/handlers/team.ts +0 -1249
  260. package/src/index.ts +0 -2815
  261. package/src/namespace.ts +0 -128
  262. package/src/notifier.ts +0 -5
  263. package/src/rerank.ts +0 -148
  264. package/src/search.test.ts +0 -848
  265. package/src/search.ts +0 -1781
  266. package/src/tools.ts +0 -2056
  267. package/src/utils.ts +0 -90
  268. package/test-features.cjs +0 -23
  269. package/tsconfig.json +0 -16
  270. package/vitest.config.ts +0 -14
@@ -1,70 +0,0 @@
1
- /**
2
- * Timeline item with swipe-left-to-delete gesture.
3
- * Mirrors SwipeableInboxItem pattern for consistent UX.
4
- */
5
- import { useRef } from "react";
6
- import { Animated, PanResponder, StyleSheet, Text, View } from "react-native";
7
- import { TripItem } from "../lib/api";
8
- import TimelineItem from "./TimelineItem";
9
- import { haptics } from "../lib/haptics";
10
-
11
- const SWIPE_THRESHOLD = 80;
12
- const ACTION_WIDTH = 72;
13
-
14
- type Props = {
15
- item: TripItem;
16
- onDelete: () => void;
17
- };
18
-
19
- export default function SwipeableTimelineItem({ item, onDelete }: Props) {
20
- const translateX = useRef(new Animated.Value(0)).current;
21
-
22
- const panResponder = useRef(
23
- PanResponder.create({
24
- onMoveShouldSetPanResponder: (_, g) => Math.abs(g.dx) > 8 && Math.abs(g.dy) < 20,
25
- onPanResponderMove: (_, g) => {
26
- // Only allow swipe left (negative dx)
27
- const clamped = Math.min(0, Math.max(-ACTION_WIDTH * 1.5, g.dx));
28
- translateX.setValue(clamped);
29
- },
30
- onPanResponderRelease: async (_, g) => {
31
- if (g.dx < -SWIPE_THRESHOLD) {
32
- await haptics.warning();
33
- snapBack();
34
- onDelete();
35
- } else {
36
- snapBack();
37
- }
38
- },
39
- })
40
- ).current;
41
-
42
- function snapBack() {
43
- Animated.spring(translateX, { toValue: 0, useNativeDriver: true, damping: 15 }).start();
44
- }
45
-
46
- return (
47
- <View style={s.wrapper}>
48
- {/* Right action — delete (revealed by swipe left) */}
49
- <View style={s.deleteAction}>
50
- <Text style={s.deleteIcon}>🗑️</Text>
51
- <Text style={s.deleteLabel}>Löschen</Text>
52
- </View>
53
-
54
- <Animated.View style={{ transform: [{ translateX }] }} {...panResponder.panHandlers}>
55
- <TimelineItem item={item} />
56
- </Animated.View>
57
- </View>
58
- );
59
- }
60
-
61
- const s = StyleSheet.create({
62
- wrapper: { position: "relative" },
63
- deleteAction: {
64
- position: "absolute", top: 0, bottom: 8, right: 0,
65
- width: ACTION_WIDTH, alignItems: "center", justifyContent: "center",
66
- backgroundColor: "#dc262633", borderRadius: 14, gap: 4,
67
- },
68
- deleteIcon: { fontSize: 20 },
69
- deleteLabel: { color: "#fff", fontSize: 11, fontWeight: "600" },
70
- });
@@ -1,73 +0,0 @@
1
- import { StyleSheet, Text, View } from "react-native";
2
- import { format, parseISO } from "date-fns";
3
- import { de } from "date-fns/locale";
4
- import { TripItem } from "../lib/api";
5
- import QRCodeViewer from "./QRCodeViewer";
6
-
7
- const TYPE_ICONS: Record<string, string> = {
8
- flight: "✈️", train: "🚂", bus: "🚌", hotel: "🏨",
9
- rental_car: "🚗", activity: "🎡", transfer: "🚕", document: "📄", other: "📋",
10
- };
11
-
12
- const TYPE_COLORS: Record<string, string> = {
13
- flight: "#4f46e5", train: "#0891b2", bus: "#059669", hotel: "#d97706",
14
- rental_car: "#7c3aed", activity: "#db2777", transfer: "#6366f1", document: "#64748b", other: "#475569",
15
- };
16
-
17
- type Props = { item: TripItem };
18
-
19
- export default function TimelineItem({ item }: Props) {
20
- const color = TYPE_COLORS[item.type] ?? TYPE_COLORS.other;
21
- const icon = TYPE_ICONS[item.type] ?? TYPE_ICONS.other;
22
- const parsed = item.parsed_data as Record<string, unknown> | null;
23
-
24
- return (
25
- <View style={s.row}>
26
- <View style={s.line}>
27
- <View style={[s.dot, { backgroundColor: color }]} />
28
- <View style={s.connector} />
29
- </View>
30
-
31
- <View style={s.card}>
32
- <View style={s.cardTop}>
33
- <Text style={s.icon}>{icon}</Text>
34
- <View style={s.cardMeta}>
35
- <Text style={s.title} numberOfLines={2}>{item.title}</Text>
36
- {item.event_at && (
37
- <Text style={s.time}>
38
- {format(parseISO(item.event_at), "EEE dd. MMM, HH:mm", { locale: de })}
39
- </Text>
40
- )}
41
- </View>
42
- </View>
43
-
44
- <View style={s.details}>
45
- {!!parsed?.origin && !!parsed?.destination && (
46
- <Text style={s.route}>{parsed.origin as string} → {parsed.destination as string}</Text>
47
- )}
48
- {item.provider && <Text style={s.chip}>{item.provider}</Text>}
49
- {item.booking_ref && (
50
- <QRCodeViewer bookingRef={item.booking_ref} title={item.title} />
51
- )}
52
- {!!parsed?.price && <Text style={s.chip}>{parsed.price as string}</Text>}
53
- </View>
54
- </View>
55
- </View>
56
- );
57
- }
58
-
59
- const s = StyleSheet.create({
60
- row: { flexDirection: "row", gap: 12, paddingBottom: 2 },
61
- line: { alignItems: "center", width: 24 },
62
- dot: { width: 12, height: 12, borderRadius: 6, marginTop: 18 },
63
- connector: { flex: 1, width: 2, backgroundColor: "#2a2a4e", marginTop: 2 },
64
- card: { flex: 1, backgroundColor: "#1a1a2e", borderRadius: 14, padding: 14, marginBottom: 8, borderWidth: 1, borderColor: "#2a2a4e", gap: 8 },
65
- cardTop: { flexDirection: "row", gap: 10, alignItems: "flex-start" },
66
- icon: { fontSize: 22, marginTop: 2 },
67
- cardMeta: { flex: 1, gap: 2 },
68
- title: { color: "#fff", fontSize: 15, fontWeight: "600", lineHeight: 20 },
69
- time: { color: "#6666aa", fontSize: 12 },
70
- details: { flexDirection: "row", flexWrap: "wrap", gap: 6 },
71
- route: { color: "#a5b4fc", fontSize: 13, width: "100%" },
72
- chip: { backgroundColor: "#0f0f1a", borderRadius: 6, paddingHorizontal: 8, paddingVertical: 3, color: "#8888aa", fontSize: 12 },
73
- });
@@ -1,130 +0,0 @@
1
- /**
2
- * Full-detail bottom sheet for a timeline item.
3
- * Shows all parsed fields: route, passengers, price, raw_summary, booking_ref.
4
- */
5
- import { ScrollView, StyleSheet, Text, View } from "react-native";
6
- import { format, parseISO } from "date-fns";
7
- import { de } from "date-fns/locale";
8
- import BottomSheet from "./BottomSheet";
9
- import QRCodeViewer from "./QRCodeViewer";
10
- import { TripItem } from "../lib/api";
11
-
12
- const TYPE_LABELS: Record<string, string> = {
13
- flight: "Flug", train: "Zug", bus: "Bus", hotel: "Hotel",
14
- rental_car: "Mietwagen", activity: "Aktivität", transfer: "Transfer",
15
- document: "Dokument", other: "Sonstiges",
16
- };
17
-
18
- type Props = {
19
- item: TripItem | null;
20
- onClose: () => void;
21
- };
22
-
23
- function eventLabels(type: string): { start: string; end: string } {
24
- const map: Record<string, { start: string; end: string }> = {
25
- flight: { start: "Abflug", end: "Ankunft" },
26
- train: { start: "Abfahrt", end: "Ankunft" },
27
- bus: { start: "Abfahrt", end: "Ankunft" },
28
- hotel: { start: "Check-in", end: "Check-out" },
29
- rental_car: { start: "Abholung", end: "Rückgabe" },
30
- activity: { start: "Beginn", end: "Ende" },
31
- transfer: { start: "Abholung", end: "Ankunft" },
32
- };
33
- return map[type] ?? { start: "Beginn", end: "Ende" };
34
- }
35
-
36
- export default function TimelineItemDetail({ item, onClose }: Props) {
37
- if (!item) return null;
38
- const parsed = item.parsed_data as Record<string, unknown> | null;
39
-
40
- function fmtDate(iso: string | null | undefined): string {
41
- if (!iso) return "—";
42
- try {
43
- return format(parseISO(iso), "EEE dd. MMM yyyy, HH:mm", { locale: de });
44
- } catch {
45
- return iso;
46
- }
47
- }
48
-
49
- return (
50
- <BottomSheet visible={!!item} onClose={onClose} heightFraction={0.75}>
51
- <ScrollView showsVerticalScrollIndicator={false} style={{ flex: 1 }}>
52
- {/* Header */}
53
- <View style={s.header}>
54
- <View style={s.typePill}>
55
- <Text style={s.typeText}>{TYPE_LABELS[item.type] ?? item.type}</Text>
56
- </View>
57
- {item.provider && <Text style={s.provider}>{item.provider}</Text>}
58
- </View>
59
-
60
- <Text style={s.title}>{item.title}</Text>
61
-
62
- {/* Core details */}
63
- <View style={s.section}>
64
- {item.event_at && <DetailRow label={eventLabels(item.type).start} value={fmtDate(item.event_at)} />}
65
- {item.event_end_at && <DetailRow label={eventLabels(item.type).end} value={fmtDate(item.event_end_at)} />}
66
- {!!parsed?.origin && !!parsed?.destination && (
67
- <DetailRow label="Route" value={`${parsed.origin as string} → ${parsed.destination as string}`} />
68
- )}
69
- {item.booking_ref && <DetailRow label="Buchungsnr." value={item.booking_ref} mono />}
70
- {!!parsed?.confirmation_number && (
71
- <DetailRow label="Bestätigungsnr." value={parsed.confirmation_number as string} mono />
72
- )}
73
- {!!parsed?.price && <DetailRow label="Preis" value={parsed.price as string} />}
74
- {!!parsed?.passengers && Array.isArray(parsed.passengers) && parsed.passengers.length > 0 && (
75
- <DetailRow label="Passagiere" value={(parsed.passengers as string[]).join(", ")} />
76
- )}
77
- </View>
78
-
79
- {/* Summary */}
80
- {!!parsed?.raw_summary && (
81
- <View style={s.summaryBox}>
82
- <Text style={s.summaryLabel}>Zusammenfassung</Text>
83
- <Text style={s.summaryText}>{parsed.raw_summary as string}</Text>
84
- </View>
85
- )}
86
-
87
- {/* QR code */}
88
- {item.booking_ref && (
89
- <View style={s.qrRow}>
90
- <QRCodeViewer bookingRef={item.booking_ref} title={item.title} />
91
- </View>
92
- )}
93
-
94
- {/* Confidence */}
95
- {typeof parsed?.confidence === "number" && (
96
- <Text style={s.confidence}>
97
- KI-Konfidenz: {Math.round((parsed.confidence as number) * 100)}%
98
- </Text>
99
- )}
100
- </ScrollView>
101
- </BottomSheet>
102
- );
103
- }
104
-
105
- function DetailRow({ label, value, mono }: { label: string; value: string; mono?: boolean }) {
106
- return (
107
- <View style={s.row}>
108
- <Text style={s.rowLabel}>{label}</Text>
109
- <Text style={[s.rowValue, mono && s.mono]} numberOfLines={2}>{value}</Text>
110
- </View>
111
- );
112
- }
113
-
114
- const s = StyleSheet.create({
115
- header: { flexDirection: "row", alignItems: "center", gap: 8, marginBottom: 8 },
116
- typePill: { backgroundColor: "#4f46e522", borderRadius: 6, paddingHorizontal: 8, paddingVertical: 3, borderWidth: 1, borderColor: "#4f46e544" },
117
- typeText: { color: "#a5b4fc", fontSize: 12, fontWeight: "600" },
118
- provider: { color: "#6666aa", fontSize: 13 },
119
- title: { fontSize: 18, fontWeight: "700", color: "#fff", marginBottom: 16, lineHeight: 24 },
120
- section: { backgroundColor: "#0f0f1a", borderRadius: 12, padding: 4, marginBottom: 14, borderWidth: 1, borderColor: "#2a2a4e" },
121
- row: { flexDirection: "row", justifyContent: "space-between", alignItems: "flex-start", paddingVertical: 10, paddingHorizontal: 12, gap: 12 },
122
- rowLabel: { color: "#6666aa", fontSize: 13, flex: 1 },
123
- rowValue: { color: "#e2e8f0", fontSize: 13, flex: 2, textAlign: "right" },
124
- mono: { fontFamily: "monospace", color: "#a5b4fc" },
125
- summaryBox: { backgroundColor: "#1a1a2e", borderRadius: 12, padding: 14, marginBottom: 14, borderWidth: 1, borderColor: "#2a2a4e" },
126
- summaryLabel: { color: "#6666aa", fontSize: 11, fontWeight: "600", letterSpacing: 0.5, textTransform: "uppercase", marginBottom: 6 },
127
- summaryText: { color: "#c4b5fd", fontSize: 13, lineHeight: 20 },
128
- qrRow: { alignItems: "flex-start", marginBottom: 14 },
129
- confidence: { color: "#3a3a5e", fontSize: 11, textAlign: "right", marginBottom: 8 },
130
- });
@@ -1,60 +0,0 @@
1
- import { useEffect, useRef } from "react";
2
- import { Animated, StyleSheet, Text, View } from "react-native";
3
- import { useSafeAreaInsets } from "react-native-safe-area-context";
4
- import { ToastItem } from "./ToastContext";
5
-
6
- // exported so ToastContext can import the type
7
- export type { ToastItem };
8
-
9
- const ICONS = { success: "✓", error: "✗", warning: "⚠", info: "ℹ" };
10
- const COLORS = {
11
- success: { border: "#34d399", bg: "#34d39915", text: "#34d399" },
12
- error: { border: "#f87171", bg: "#f8717115", text: "#f87171" },
13
- warning: { border: "#fbbf24", bg: "#fbbf2415", text: "#fbbf24" },
14
- info: { border: "#60a5fa", bg: "#60a5fa15", text: "#60a5fa" },
15
- };
16
-
17
- function SingleToast({ toast, onDone }: { toast: ToastItem; onDone: (id: string) => void }) {
18
- const translateY = useRef(new Animated.Value(-72)).current;
19
- const opacity = useRef(new Animated.Value(0)).current;
20
- const c = COLORS[toast.type];
21
-
22
- useEffect(() => {
23
- Animated.parallel([
24
- Animated.spring(translateY, { toValue: 0, useNativeDriver: true, damping: 20, stiffness: 220 }),
25
- Animated.timing(opacity, { toValue: 1, duration: 180, useNativeDriver: true }),
26
- ]).start();
27
-
28
- const timer = setTimeout(() => {
29
- Animated.parallel([
30
- Animated.timing(translateY, { toValue: -72, duration: 220, useNativeDriver: true }),
31
- Animated.timing(opacity, { toValue: 0, duration: 200, useNativeDriver: true }),
32
- ]).start(() => onDone(toast.id));
33
- }, toast.duration ?? 3500);
34
-
35
- return () => clearTimeout(timer);
36
- }, []);
37
-
38
- return (
39
- <Animated.View style={[s.toast, { borderColor: c.border, backgroundColor: c.bg, opacity, transform: [{ translateY }] }]}>
40
- <Text style={[s.icon, { color: c.text }]}>{ICONS[toast.type]}</Text>
41
- <Text style={[s.msg, { color: c.text }]} numberOfLines={3}>{toast.message}</Text>
42
- </Animated.View>
43
- );
44
- }
45
-
46
- export default function ToastRenderer({ toasts, remove }: { toasts: ToastItem[]; remove: (id: string) => void }) {
47
- const insets = useSafeAreaInsets();
48
- return (
49
- <View style={[s.container, { top: insets.top + 12 }]} pointerEvents="none">
50
- {toasts.slice(0, 3).map(t => <SingleToast key={t.id} toast={t} onDone={remove} />)}
51
- </View>
52
- );
53
- }
54
-
55
- const s = StyleSheet.create({
56
- container: { position: "absolute", left: 16, right: 16, zIndex: 9999, gap: 8 },
57
- toast: { flexDirection: "row", alignItems: "center", gap: 10, padding: 14, borderRadius: 12, borderWidth: 1 },
58
- icon: { fontSize: 16, fontWeight: "700", flexShrink: 0 },
59
- msg: { fontSize: 14, flex: 1, fontWeight: "500", lineHeight: 19 },
60
- });
@@ -1,42 +0,0 @@
1
- import { createContext, ReactNode, useCallback, useContext, useRef, useState } from "react";
2
- import ToastRenderer from "./Toast";
3
-
4
- export type ToastType = "success" | "error" | "warning" | "info";
5
- export interface ToastItem {
6
- id: string;
7
- message: string;
8
- type: ToastType;
9
- duration?: number;
10
- }
11
-
12
- interface ToastCtx {
13
- showToast: (message: string, type?: ToastType, duration?: number) => void;
14
- }
15
-
16
- const Ctx = createContext<ToastCtx>({ showToast: () => {} });
17
-
18
- let _counter = 0;
19
-
20
- export function ToastProvider({ children }: { children: ReactNode }) {
21
- const [toasts, setToasts] = useState<ToastItem[]>([]);
22
-
23
- const showToast = useCallback((message: string, type: ToastType = "info", duration?: number) => {
24
- const id = String(++_counter);
25
- setToasts(prev => [...prev, { id, message, type, duration }]);
26
- }, []);
27
-
28
- const remove = useCallback((id: string) => {
29
- setToasts(prev => prev.filter(t => t.id !== id));
30
- }, []);
31
-
32
- return (
33
- <Ctx.Provider value={{ showToast }}>
34
- {children}
35
- <ToastRenderer toasts={toasts} remove={remove} />
36
- </Ctx.Provider>
37
- );
38
- }
39
-
40
- export function useToast() {
41
- return useContext(Ctx);
42
- }
@@ -1,146 +0,0 @@
1
- import { useEffect, useRef } from "react";
2
- import { Animated, StyleSheet, Text, TouchableOpacity, View } from "react-native";
3
- import { format, parseISO, differenceInDays } from "date-fns";
4
- import { de } from "date-fns/locale";
5
- import { Trip } from "../lib/api";
6
- import { haptics } from "../lib/haptics";
7
- import ScoreRing from "./ScoreRing";
8
-
9
- type Props = {
10
- trip: Trip;
11
- onPress: () => void;
12
- onLongPress?: () => void;
13
- score?: number;
14
- };
15
-
16
- export default function TripCard({ trip, onPress, onLongPress, score }: Props) {
17
- const start = trip.start_date ? parseISO(trip.start_date) : null;
18
- const end = trip.end_date ? parseISO(trip.end_date) : null;
19
- const duration = start && end ? differenceInDays(end, start) : null;
20
- const today = new Date();
21
- const isActive = start && end && start <= today && today <= end;
22
- const daysUntil = start && start > today ? differenceInDays(start, today) : null;
23
- const isUpcoming = start && start > today;
24
- const isPast = end && end < today;
25
-
26
- const pulseAnim = useRef(new Animated.Value(1)).current;
27
-
28
- useEffect(() => {
29
- if (isActive) {
30
- const loop = Animated.loop(
31
- Animated.sequence([
32
- Animated.timing(pulseAnim, { toValue: 0.4, duration: 800, useNativeDriver: true }),
33
- Animated.timing(pulseAnim, { toValue: 1, duration: 800, useNativeDriver: true }),
34
- ])
35
- );
36
- loop.start();
37
- return () => loop.stop();
38
- }
39
- }, [isActive]);
40
-
41
- async function handleLongPress() {
42
- if (onLongPress) {
43
- await haptics.confirm();
44
- onLongPress();
45
- }
46
- }
47
-
48
- function getBadgeText(): string {
49
- if (isActive) return "✈️ Jetzt auf Reise";
50
- if (daysUntil !== null) {
51
- if (daysUntil === 0) return "🚀 Heute!";
52
- if (daysUntil === 1) return "✈️ Morgen!";
53
- if (daysUntil <= 7) return `✈️ in ${daysUntil} Tagen`;
54
- if (daysUntil <= 30) return `🗓️ in ${daysUntil} Tagen`;
55
- }
56
- if (isUpcoming) return "Geplant";
57
- if (isPast) return "Vorbei";
58
- return "Aktuell";
59
- }
60
-
61
- const badgeText = getBadgeText();
62
- const isCloseCountdown = daysUntil !== null && daysUntil <= 7;
63
-
64
- return (
65
- <TouchableOpacity
66
- style={[s.card, isActive && s.cardActive]}
67
- onPress={onPress}
68
- onLongPress={handleLongPress}
69
- activeOpacity={0.8}
70
- accessibilityLabel={`Trip: ${trip.name}`}
71
- accessibilityRole="button"
72
- accessibilityHint={onLongPress ? "Gedrückt halten zum Bearbeiten" : undefined}
73
- >
74
- <View style={s.row}>
75
- <View style={s.info}>
76
- <Text style={s.name} numberOfLines={1}>{trip.name}</Text>
77
- {start && (
78
- <Text style={s.dates}>
79
- {format(start, "dd. MMM", { locale: de })}
80
- {end ? ` → ${format(end, "dd. MMM yyyy", { locale: de })}` : ""}
81
- {duration !== null ? ` · ${duration} Tage` : ""}
82
- </Text>
83
- )}
84
- {!start && <Text style={s.dates}>Kein Datum gesetzt</Text>}
85
- </View>
86
- <View style={s.badgeRow}>
87
- {isActive && (
88
- <Animated.View style={[s.pulseDot, { opacity: pulseAnim }]} />
89
- )}
90
- <View style={[
91
- s.badge,
92
- isActive && s.badgeActive,
93
- isUpcoming && !isActive && s.badgeUpcoming,
94
- isPast && s.badgePast,
95
- ]}>
96
- <Text style={[
97
- s.badgeText,
98
- isActive && s.badgeTextActive,
99
- isCloseCountdown && s.badgeTextCountdown,
100
- ]}>
101
- {badgeText}
102
- </Text>
103
- </View>
104
- </View>
105
- </View>
106
- <View style={s.footer}>
107
- <View style={s.footerLeft}>
108
- {trip.description
109
- ? <Text style={s.desc} numberOfLines={1}>{trip.description}</Text>
110
- : null}
111
- {onLongPress && <Text style={s.editHint}>Gedrückt halten zum Bearbeiten</Text>}
112
- </View>
113
- {score !== undefined && (
114
- <View style={s.scoreWrap}>
115
- <ScoreRing score={score} size={38} />
116
- {score === 100 && <Text style={s.scoreComplete}>✓</Text>}
117
- </View>
118
- )}
119
- </View>
120
- </TouchableOpacity>
121
- );
122
- }
123
-
124
- const s = StyleSheet.create({
125
- card: { backgroundColor: "#1a1a2e", borderRadius: 16, padding: 18, borderWidth: 1, borderColor: "#2a2a4e", gap: 6 },
126
- cardActive: { borderLeftWidth: 4, borderLeftColor: "#4f46e5" },
127
- row: { flexDirection: "row", alignItems: "flex-start", gap: 12 },
128
- info: { flex: 1, gap: 4 },
129
- name: { color: "#fff", fontSize: 17, fontWeight: "700" },
130
- dates: { color: "#6666aa", fontSize: 13 },
131
- desc: { color: "#8888aa", fontSize: 13 },
132
- badgeRow: { flexDirection: "row", alignItems: "center", gap: 6 },
133
- pulseDot: { width: 8, height: 8, borderRadius: 4, backgroundColor: "#a5b4fc" },
134
- badge: { backgroundColor: "#2a2a4e", borderRadius: 6, paddingHorizontal: 8, paddingVertical: 3 },
135
- badgeActive: { backgroundColor: "#4f46e5" },
136
- badgeUpcoming: { backgroundColor: "#4f46e522", borderWidth: 1, borderColor: "#4f46e5" },
137
- badgePast: { backgroundColor: "#1a1a1a" },
138
- badgeText: { color: "#a5b4fc", fontSize: 12, fontWeight: "500" },
139
- badgeTextActive: { color: "#fff" },
140
- badgeTextCountdown: { color: "#a5b4fc", fontWeight: "700" },
141
- editHint: { color: "#3a3a5e", fontSize: 11 },
142
- footer: { flexDirection: "row", alignItems: "center", justifyContent: "space-between", gap: 8 },
143
- footerLeft: { flex: 1, gap: 2 },
144
- scoreWrap: { alignItems: "center", justifyContent: "center" },
145
- scoreComplete: { position: "absolute", color: "#10b981", fontSize: 14, fontWeight: "800" },
146
- });
@@ -1,70 +0,0 @@
1
- import React, { useEffect, useState } from "react";
2
- import {
3
- Modal, StyleSheet, Text, TouchableOpacity, View, Share, ActivityIndicator,
4
- } from "react-native";
5
- // @ts-ignore — added in Phase 3 deps
6
- import QRCode from "react-native-qrcode-svg";
7
-
8
- type Props = {
9
- tripId: string;
10
- tripName: string;
11
- visible: boolean;
12
- onClose: () => void;
13
- };
14
-
15
- export function TripQRModal({ tripId, tripName, visible, onClose }: Props) {
16
- const deepLink = `tco://trips/${tripId}`;
17
- const [qrReady, setQrReady] = useState(false);
18
-
19
- useEffect(() => {
20
- if (visible) {
21
- // Defer QR generation until after the modal animation frame
22
- const id = requestAnimationFrame(() => setQrReady(true));
23
- return () => { cancelAnimationFrame(id); setQrReady(false); };
24
- } else {
25
- setQrReady(false);
26
- }
27
- }, [visible]);
28
-
29
- async function handleShare() {
30
- await Share.share({
31
- message: `Mein Trip "${tripName}" in Travel Chaos Organizer: ${deepLink}`,
32
- });
33
- }
34
-
35
- return (
36
- <Modal visible={visible} transparent animationType="fade" onRequestClose={onClose}>
37
- <View style={s.overlay}>
38
- <View style={s.card}>
39
- <Text style={s.title}>{tripName}</Text>
40
- <Text style={s.sub}>QR-Code zum Teilen</Text>
41
- <View style={s.qrBox}>
42
- {qrReady
43
- ? <QRCode value={deepLink} size={180} color="#fff" backgroundColor="#1a1a2e" />
44
- : <ActivityIndicator color="#4f46e5" size="large" style={{ width: 180, height: 180 }} />}
45
- </View>
46
- <Text style={s.link}>{deepLink}</Text>
47
- <TouchableOpacity style={s.shareBtn} onPress={handleShare} activeOpacity={0.8} accessibilityLabel="Teilen" accessibilityRole="button">
48
- <Text style={s.shareBtnText}>Teilen</Text>
49
- </TouchableOpacity>
50
- <TouchableOpacity style={s.closeBtn} onPress={onClose} accessibilityLabel="Schließen" accessibilityRole="button">
51
- <Text style={s.closeBtnText}>Schließen</Text>
52
- </TouchableOpacity>
53
- </View>
54
- </View>
55
- </Modal>
56
- );
57
- }
58
-
59
- const s = StyleSheet.create({
60
- overlay: { flex: 1, backgroundColor: "#000000aa", justifyContent: "center", alignItems: "center" },
61
- card: { backgroundColor: "#1a1a2e", borderRadius: 24, padding: 28, alignItems: "center", width: 300, gap: 12 },
62
- title: { fontSize: 18, fontWeight: "800", color: "#fff", textAlign: "center" },
63
- sub: { fontSize: 12, color: "#6666aa" },
64
- qrBox: { backgroundColor: "#1a1a2e", padding: 16, borderRadius: 16, borderWidth: 1, borderColor: "#2a2a4a" },
65
- link: { fontSize: 11, color: "#6666aa", fontFamily: "monospace" },
66
- shareBtn: { backgroundColor: "#4f46e5", paddingVertical: 12, paddingHorizontal: 32, borderRadius: 12, width: "100%", alignItems: "center" },
67
- shareBtnText: { color: "#fff", fontWeight: "700", fontSize: 15 },
68
- closeBtn: { paddingVertical: 8 },
69
- closeBtnText: { color: "#6666aa", fontSize: 14 },
70
- });
@@ -1,44 +0,0 @@
1
- import React from "react";
2
- import { StyleSheet, Text, TouchableOpacity, View, Linking } from "react-native";
3
- import { useQuota } from "../lib/quota";
4
-
5
- export function UpgradeBanner() {
6
- const { plan, isPro } = useQuota();
7
- if (isPro || !plan) return null;
8
-
9
- return (
10
- <View style={s.banner}>
11
- <Text style={s.text}>
12
- Free Plan · {plan.free_daily_parses} Parses/Tag · {plan.free_max_trips} Trips
13
- </Text>
14
- <TouchableOpacity
15
- style={s.btn}
16
- onPress={() => Linking.openURL(process.env.EXPO_PUBLIC_UPGRADE_URL ?? "https://tco.app/upgrade")}
17
- activeOpacity={0.8}
18
- >
19
- <Text style={s.btnText}>Pro ✦</Text>
20
- </TouchableOpacity>
21
- </View>
22
- );
23
- }
24
-
25
- const s = StyleSheet.create({
26
- banner: {
27
- flexDirection: "row",
28
- alignItems: "center",
29
- justifyContent: "space-between",
30
- backgroundColor: "#1a1a2e",
31
- borderBottomWidth: 1,
32
- borderBottomColor: "#2a2a4a",
33
- paddingHorizontal: 16,
34
- paddingVertical: 8,
35
- },
36
- text: { color: "#6666aa", fontSize: 12 },
37
- btn: {
38
- backgroundColor: "#4f46e5",
39
- paddingHorizontal: 12,
40
- paddingVertical: 4,
41
- borderRadius: 8,
42
- },
43
- btnText: { color: "#fff", fontSize: 12, fontWeight: "700" },
44
- });
@@ -1,22 +0,0 @@
1
- {
2
- "cli": {
3
- "version": ">= 7.0.0"
4
- },
5
- "build": {
6
- "development": {
7
- "developmentClient": true,
8
- "distribution": "internal"
9
- },
10
- "preview": {
11
- "distribution": "internal",
12
- "channel": "preview"
13
- },
14
- "production": {
15
- "channel": "production",
16
- "autoIncrement": true
17
- }
18
- },
19
- "submit": {
20
- "production": {}
21
- }
22
- }