@adminide-stack/yantra-mobile 12.0.28-alpha.67 → 12.0.28-alpha.69

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 (37) hide show
  1. package/lib/api/stt.js +54 -0
  2. package/lib/api/stt.js.map +1 -0
  3. package/lib/components/GatewayConnector/GatewayConnector.js +18 -0
  4. package/lib/components/GatewayConnector/GatewayConnector.js.map +1 -0
  5. package/lib/components/NavigationHeader/NavigationHeader.js +214 -0
  6. package/lib/components/NavigationHeader/NavigationHeader.js.map +1 -0
  7. package/lib/components/ThinkingIndicator.js +55 -0
  8. package/lib/components/ThinkingIndicator.js.map +1 -0
  9. package/lib/compute.js +108 -31
  10. package/lib/compute.js.map +1 -1
  11. package/lib/contexts/CdecliConnectionContext.js +47 -0
  12. package/lib/contexts/CdecliConnectionContext.js.map +1 -0
  13. package/lib/contexts/GatewayContext.js +1 -1
  14. package/lib/features/audio-input/AudioRecorderPanel.js +231 -0
  15. package/lib/features/audio-input/AudioRecorderPanel.js.map +1 -0
  16. package/lib/features/audio-input/MicErrorBoundary.js +34 -0
  17. package/lib/features/audio-input/MicErrorBoundary.js.map +1 -0
  18. package/lib/hooks/useCdecliAutoConnect.js +41 -18
  19. package/lib/hooks/useCdecliAutoConnect.js.map +1 -1
  20. package/lib/hooks/useChatApi.js +158 -41
  21. package/lib/hooks/useChatApi.js.map +1 -1
  22. package/lib/hooks/useChatStream.js +59 -16
  23. package/lib/hooks/useChatStream.js.map +1 -1
  24. package/lib/hooks/usePrerequisiteIds.js +8 -12
  25. package/lib/hooks/usePrerequisiteIds.js.map +1 -1
  26. package/lib/index.js +1 -1
  27. package/lib/index.js.map +1 -1
  28. package/lib/routes.json +112 -0
  29. package/lib/screens/Chat/index.js +423 -0
  30. package/lib/screens/Chat/index.js.map +1 -0
  31. package/lib/screens/ChatHistory/index.js +56 -0
  32. package/lib/screens/ChatHistory/index.js.map +1 -0
  33. package/lib/screens/Home/HomeScreen.js +136 -427
  34. package/lib/screens/Home/HomeScreen.js.map +1 -1
  35. package/lib/screens/Home/components/ChatHistoryLanding.js +436 -214
  36. package/lib/screens/Home/components/ChatHistoryLanding.js.map +1 -1
  37. package/package.json +4 -4
package/lib/api/stt.js ADDED
@@ -0,0 +1,54 @@
1
+ import {config}from'../config/env-config.js';const GROQ_STT_URL = "https://api.groq.com/openai/v1/audio/transcriptions";
2
+ const WHISPER_MODEL = "whisper-large-v3-turbo";
3
+ async function transcribeAudio(params) {
4
+ var _a, _b, _c;
5
+ const {
6
+ uri,
7
+ mimeType = "audio/m4a",
8
+ filename = "audio.m4a",
9
+ prompt
10
+ } = params;
11
+ const apiKey = config.GROQ_API_KEY;
12
+ if (!apiKey) {
13
+ throw new Error("GROQ_API_KEY is not configured. Add it to your .env (e.g. config/development/dev.env).");
14
+ }
15
+ if (!uri) {
16
+ throw new Error("Audio file uri is empty or not provided");
17
+ }
18
+ const formData = new FormData();
19
+ formData.append("file", {
20
+ uri,
21
+ name: filename,
22
+ type: mimeType
23
+ });
24
+ formData.append("model", WHISPER_MODEL);
25
+ if (prompt) {
26
+ formData.append("prompt", prompt);
27
+ }
28
+ const response = await fetch(GROQ_STT_URL, {
29
+ method: "POST",
30
+ headers: {
31
+ Authorization: `Bearer ${apiKey}`
32
+ /*
33
+ * Intentionally NOT setting Content-Type. Letting `fetch` derive
34
+ * it from FormData ensures the multipart boundary string is set
35
+ * correctly. Overriding here would break the upload silently.
36
+ */
37
+ },
38
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
39
+ body: formData
40
+ });
41
+ if (!response.ok) {
42
+ const errorText = await response.text();
43
+ let errorMessage;
44
+ try {
45
+ const errorJson = JSON.parse(errorText);
46
+ errorMessage = ((_a = errorJson == null ? void 0 : errorJson.error) == null ? void 0 : _a.message) || (errorJson == null ? void 0 : errorJson.message) || errorText;
47
+ } catch (e) {
48
+ errorMessage = errorText || response.statusText;
49
+ }
50
+ throw new Error(`STT API error (${response.status}): ${errorMessage}`);
51
+ }
52
+ const data = await response.json();
53
+ return (_c = (_b = data == null ? void 0 : data.text) == null ? void 0 : _b.trim()) != null ? _c : "";
54
+ }export{transcribeAudio};//# sourceMappingURL=stt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stt.js","sources":["../../src/api/stt.ts"],"sourcesContent":["/**\n * Speech-to-Text (STT) API using Groq's Whisper model — mobile port.\n *\n * Mirrors `packages-modules/account/browser/src/api/stt.ts` (which uploads\n * a `Blob` produced by the browser's `MediaRecorder`). On React Native we\n * upload a file by URI instead, because:\n * • `expo-audio` writes the recording to a local `file://` URI on disk,\n * not an in-memory Blob.\n * • RN's `fetch` + `FormData` already supports `{uri, name, type}` parts —\n * it streams the file directly without us reading bytes into JS, which\n * keeps a 3-minute clip from spiking memory.\n *\n * Same Groq endpoint / model / auth as web so a single `GROQ_API_KEY`\n * works for both surfaces.\n */\n\nimport { config } from '../config';\n\nconst GROQ_STT_URL = 'https://api.groq.com/openai/v1/audio/transcriptions';\nconst WHISPER_MODEL = 'whisper-large-v3-turbo';\n\nexport interface STTParams {\n /** Local file URI returned by `expo-audio`'s `recorder.uri` (e.g. `file:///...m4a`). */\n uri: string;\n /** Optional MIME type override. HIGH_QUALITY preset → `audio/m4a` on iOS & Android. */\n mimeType?: string;\n /** Optional filename hint sent with the multipart form. Whisper uses the extension to pick a decoder. */\n filename?: string;\n /** Optional Whisper \"prompt\" — passed through to bias decoding. */\n prompt?: string;\n}\n\nexport async function transcribeAudio(params: STTParams): Promise<string> {\n const { uri, mimeType = 'audio/m4a', filename = 'audio.m4a', prompt } = params;\n\n const apiKey = config.GROQ_API_KEY;\n if (!apiKey) {\n throw new Error('GROQ_API_KEY is not configured. Add it to your .env (e.g. config/development/dev.env).');\n }\n if (!uri) {\n throw new Error('Audio file uri is empty or not provided');\n }\n\n const formData = new FormData();\n /*\n * React Native's FormData accepts file parts in `{uri, name, type}` shape;\n * the runtime streams the file from disk on send. The cast is the usual\n * escape hatch — web FormData's TS lib types only know about\n * `Blob | string`, but the RN polyfill widens it at runtime.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n formData.append('file', { uri, name: filename, type: mimeType } as any);\n formData.append('model', WHISPER_MODEL);\n if (prompt) {\n formData.append('prompt', prompt);\n }\n\n const response = await fetch(GROQ_STT_URL, {\n method: 'POST',\n headers: {\n Authorization: `Bearer ${apiKey}`,\n /*\n * Intentionally NOT setting Content-Type. Letting `fetch` derive\n * it from FormData ensures the multipart boundary string is set\n * correctly. Overriding here would break the upload silently.\n */\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n body: formData as any,\n });\n\n if (!response.ok) {\n const errorText = await response.text();\n let errorMessage: string;\n try {\n const errorJson = JSON.parse(errorText);\n errorMessage = errorJson?.error?.message || errorJson?.message || errorText;\n } catch {\n errorMessage = errorText || response.statusText;\n }\n throw new Error(`STT API error (${response.status}): ${errorMessage}`);\n }\n\n const data = (await response.json()) as { text?: string };\n return data?.text?.trim() ?? '';\n}\n"],"names":[],"mappings":"6CAiBA,MAAM,YAAe,GAAA,qDAAA;AACrB,MAAM,aAAgB,GAAA,wBAAA;AAWtB,eAAsB,gBAAgB,MAAoC,EAAA;AA7B1E,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA;AA8BE,EAAM,MAAA;AAAA,IACJ,GAAA;AAAA,IACA,QAAW,GAAA,WAAA;AAAA,IACX,QAAW,GAAA,WAAA;AAAA,IACX;AAAA,GACE,GAAA,MAAA;AACJ,EAAA,MAAM,SAAS,MAAO,CAAA,YAAA;AACtB,EAAA,IAAI,CAAC,MAAQ,EAAA;AACX,IAAM,MAAA,IAAI,MAAM,wFAAwF,CAAA;AAAA;AAE1G,EAAA,IAAI,CAAC,GAAK,EAAA;AACR,IAAM,MAAA,IAAI,MAAM,yCAAyC,CAAA;AAAA;AAE3D,EAAM,MAAA,QAAA,GAAW,IAAI,QAAS,EAAA;AAQ9B,EAAA,QAAA,CAAS,OAAO,MAAQ,EAAA;AAAA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A,GAAA,IAAA,CAAA,IAAA,KAAN,IAAY,GAAA,MAAA,GAAA,EAAA,CAAA,IAAA,EAAA,KAAZ,IAAsB,GAAA,EAAA,GAAA,EAAA;AAC/B"}
@@ -0,0 +1,18 @@
1
+ import {jsx}from'react/jsx-runtime';import React,{useCallback}from'react';import {useCdecliConnection}from'../../contexts/CdecliConnectionContext.js';import {GatewayToolbarButtonMobile}from'../GatewayToolbarButtonMobile.js';function mapCdecliStatus(status) {
2
+ if (status === "connecting") return "connecting";
3
+ if (status === "connected") return "connected";
4
+ if (status === "error") return "error";
5
+ return "disconnected";
6
+ }
7
+ const GatewayConnector = ({
8
+ tone = "default",
9
+ disabled = false
10
+ }) => {
11
+ const cdecli = useCdecliConnection();
12
+ const gatewayStatus = mapCdecliStatus(cdecli.status);
13
+ const gatewayLabel = cdecli.status === "connecting" ? "Checking..." : void 0;
14
+ const handleToggleGateway = useCallback(() => {
15
+ }, []);
16
+ return /* @__PURE__ */ jsx(GatewayToolbarButtonMobile, { gatewayStatus, gatewayError: cdecli.error, onToggleGateway: handleToggleGateway, disabled, statusLabel: gatewayLabel, tone });
17
+ };
18
+ var GatewayConnector$1 = React.memo(GatewayConnector);export{GatewayConnector$1 as default};//# sourceMappingURL=GatewayConnector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GatewayConnector.js","sources":["../../../src/components/GatewayConnector/GatewayConnector.tsx"],"sourcesContent":["/**\n * Gateway connector pill.\n *\n * Renders the visual CDeCLI status pill (`GatewayToolbarButtonMobile`) using\n * the shared `CdecliConnectionContext`. It is purely a consumer — the actual\n * `useCdecliAutoConnect` lifecycle lives in `CdecliConnectionProvider`\n * mounted once at the app root.\n *\n * This separation is intentional: the Chat screen also binds its `channelId`\n * to the same shared connection. If this component called its own\n * `useCdecliAutoConnect`, the two hooks would race their `gatewayConnect`\n * mutations and the agent session would lose its chat binding, producing the\n * \"agent did not return a response / API key may be missing\" fallback.\n */\nimport React, { useCallback } from 'react';\nimport { useCdecliConnection } from '../../contexts/CdecliConnectionContext';\nimport { GatewayToolbarButtonMobile } from '../GatewayToolbarButtonMobile';\n\nexport type GatewayConnectorStatus = 'connecting' | 'connected' | 'disconnected' | 'error';\n\ninterface GatewayConnectorProps {\n /** Visual variant — defaults to the standard toolbar tone. */\n tone?: 'default' | 'provisioning' | 'workspace-error';\n /** Disable interaction (the pill itself is currently click-through). */\n disabled?: boolean;\n}\n\nfunction mapCdecliStatus(status: string | null | undefined): GatewayConnectorStatus {\n if (status === 'connecting') return 'connecting';\n if (status === 'connected') return 'connected';\n if (status === 'error') return 'error';\n return 'disconnected';\n}\n\nconst GatewayConnector: React.FC<GatewayConnectorProps> = ({ tone = 'default', disabled = false }) => {\n const cdecli = useCdecliConnection();\n\n const gatewayStatus = mapCdecliStatus(cdecli.status);\n const gatewayLabel = cdecli.status === 'connecting' ? 'Checking...' : undefined;\n\n const handleToggleGateway = useCallback(() => {\n /* CDeCLI selection is gateway-context driven elsewhere — no-op here. */\n }, []);\n\n return (\n <GatewayToolbarButtonMobile\n gatewayStatus={gatewayStatus}\n gatewayError={cdecli.error}\n onToggleGateway={handleToggleGateway}\n disabled={disabled}\n statusLabel={gatewayLabel}\n tone={tone}\n />\n );\n};\n\nexport default React.memo(GatewayConnector);\n"],"names":[],"mappings":"gOAwBA,SAAS,gBAAgB,MAA2D,EAAA;AAClF,EAAI,IAAA,MAAA,KAAW,cAAqB,OAAA,YAAA;AACpC,EAAI,IAAA,MAAA,KAAW,aAAoB,OAAA,WAAA;AACnC,EAAI,IAAA,MAAA,KAAW,SAAgB,OAAA,OAAA;AAC/B,EAAO,OAAA,cAAA;AACT;AACA,MAAM,mBAAoD,CAAC;AAAA,EACzD,IAAO,GAAA,SAAA;AAAA,EACP,QAAW,GAAA;AACb,CAAM,KAAA;AACJ,EAAA,MAAM,SAAS,mBAAoB,EAAA;AACnC,EAAM,MAAA,aAAA,GAAgB,eAAgB,CAAA,MAAA,CAAO,MAAM,CAAA;AACnD,EAAA,MAAM,YAAe,GAAA,MAAA,CAAO,MAAW,KAAA,YAAA,GAAe,aAAgB,GAAA,MAAA;AACtE,EAAM,MAAA,mBAAA,GAAsB,YAAY,MAAM;AAAA,GAE9C,EAAG,EAAE,CAAA;AACL,EAAO,uBAAA,GAAA,CAAC,0BAA2B,EAAA,EAAA,aAAA,EAA8B,YAAc,EAAA,MAAA,CAAO,KAAO,EAAA,eAAA,EAAiB,mBAAqB,EAAA,QAAA,EAAoB,WAAa,EAAA,YAAA,EAAc,IAAY,EAAA,CAAA;AAChM,CAAA;AACA,yBAAe,KAAA,CAAM,KAAK,gBAAgB,CAAA"}
@@ -0,0 +1,214 @@
1
+ import {jsx,jsxs,Fragment}from'react/jsx-runtime';import React,{useMemo,useCallback}from'react';import {useColorScheme,StyleSheet,View,Pressable}from'react-native';import {useSafeAreaInsets,SafeAreaView}from'react-native-safe-area-context';import {StatusBar}from'expo-status-bar';import {useNavigation,CommonActions,DrawerActions}from'@react-navigation/native';import {getHeaderTitle}from'@react-navigation/elements';import {MaterialCommunityIcons}from'@expo/vector-icons';import {Text}from'@admin-layout/gluestack-ui-mobile';import GatewayConnector from'../GatewayConnector/GatewayConnector.js';import {mobileTokens}from'../../theme/mobileTokens.js';const ICON_SIZE = 22;
2
+ function resolveTitle(options, route) {
3
+ var _a, _b;
4
+ if (typeof (options == null ? void 0 : options.title) === "string" && options.title.trim()) {
5
+ return options.title.trim();
6
+ }
7
+ if (typeof (options == null ? void 0 : options.headerTitle) === "string" && options.headerTitle.trim()) {
8
+ return options.headerTitle.trim();
9
+ }
10
+ const fallback = (_b = getHeaderTitle) == null ? void 0 : _b(options != null ? options : {}, (_a = route == null ? void 0 : route.name) != null ? _a : "Yantra");
11
+ return typeof fallback === "string" && fallback.trim() ? fallback : "Yantra";
12
+ }
13
+ const NavigationHeader = (props) => {
14
+ var _a, _b, _c;
15
+ const {
16
+ navigation: navProp,
17
+ route,
18
+ options,
19
+ back,
20
+ showTitle = true,
21
+ showToggle = false,
22
+ showBack = false,
23
+ showGateway = false,
24
+ showHistory = false,
25
+ showNewChat = false,
26
+ headerBgColor
27
+ } = props;
28
+ const fallbackNav = useNavigation();
29
+ const navigation = navProp != null ? navProp : fallbackNav;
30
+ const colorScheme = useColorScheme();
31
+ const isDark = colorScheme === "dark";
32
+ const insets = useSafeAreaInsets();
33
+ const themeTitleColor = isDark ? "#f1f5f9" : "#0f172a";
34
+ const themeAccentColor = isDark ? "#a5b4fc" : "#4338ca";
35
+ const themeNewChatIconColor = isDark ? "#e5e7eb" : "#000000";
36
+ const optionTint = typeof (options == null ? void 0 : options.headerTintColor) === "string" ? options.headerTintColor : null;
37
+ const tintLooksDark = optionTint && /^(#?000(000)?|black)$/i.test(optionTint.trim());
38
+ const effectiveTint = optionTint && !(isDark && tintLooksDark) ? optionTint : null;
39
+ const titleColor = effectiveTint != null ? effectiveTint : themeTitleColor;
40
+ const iconColor = effectiveTint != null ? effectiveTint : themeTitleColor;
41
+ const accentColor = effectiveTint != null ? effectiveTint : themeAccentColor;
42
+ const newChatIconColor = effectiveTint != null ? effectiveTint : themeNewChatIconColor;
43
+ const surfaceColor = headerBgColor != null ? headerBgColor : isDark ? "#0f172a" : "#ffffff";
44
+ const dividerColor = isDark ? "rgba(148, 163, 184, 0.18)" : "rgba(15, 23, 42, 0.06)";
45
+ const titleAlignLeft = (options == null ? void 0 : options.headerTitleAlign) === "left";
46
+ const title = useMemo(() => resolveTitle(options, route), [options, route]);
47
+ const optionTitleStyle = (_a = options == null ? void 0 : options.headerTitleStyle) != null ? _a : null;
48
+ const orgName = useMemo(() => {
49
+ var _a2, _b2;
50
+ const raw = (_b2 = (_a2 = route == null ? void 0 : route.params) == null ? void 0 : _a2.orgName) != null ? _b2 : "";
51
+ return typeof raw === "string" && raw.trim() ? raw.trim() : null;
52
+ }, [(_b = route == null ? void 0 : route.params) == null ? void 0 : _b.orgName]);
53
+ const handleBack = useCallback(() => {
54
+ var _a2, _b2;
55
+ if ((_a2 = navigation == null ? void 0 : navigation.canGoBack) == null ? void 0 : _a2.call(navigation)) {
56
+ navigation.goBack();
57
+ return;
58
+ }
59
+ (_b2 = navigation == null ? void 0 : navigation.dispatch) == null ? void 0 : _b2.call(navigation, CommonActions.navigate({
60
+ name: "MainStack.Layout.Home",
61
+ params: orgName ? {
62
+ orgName
63
+ } : void 0
64
+ }));
65
+ }, [navigation, orgName]);
66
+ const handleToggleDrawer = useCallback(() => {
67
+ var _a2;
68
+ try {
69
+ (_a2 = navigation == null ? void 0 : navigation.dispatch) == null ? void 0 : _a2.call(navigation, DrawerActions.openDrawer());
70
+ } catch (e) {
71
+ }
72
+ }, [navigation]);
73
+ const handleOpenChatHistory = useCallback(() => {
74
+ var _a2;
75
+ (_a2 = navigation == null ? void 0 : navigation.dispatch) == null ? void 0 : _a2.call(navigation, CommonActions.navigate({
76
+ name: "MainStack.ChatHistory",
77
+ params: orgName ? {
78
+ orgName
79
+ } : void 0
80
+ }));
81
+ }, [navigation, orgName]);
82
+ const handleNewChat = useCallback(() => {
83
+ var _a2;
84
+ (_a2 = navigation == null ? void 0 : navigation.dispatch) == null ? void 0 : _a2.call(navigation, CommonActions.navigate({
85
+ name: "MainStack.Layout.Home",
86
+ params: orgName ? {
87
+ orgName
88
+ } : void 0,
89
+ merge: true
90
+ }));
91
+ }, [navigation, orgName]);
92
+ const wantsBack = Boolean(back) || showBack;
93
+ const leftSlot = wantsBack ? /* @__PURE__ */ jsx(Pressable, { onPress: handleBack, accessibilityLabel: "Go back", accessibilityRole: "button", style: ({
94
+ pressed
95
+ }) => [styles.iconButton, pressed && styles.iconButtonPressed], hitSlop: 8, children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "chevron-left", size: ICON_SIZE + 4, color: iconColor }) }) : showToggle ? /* @__PURE__ */ jsx(Pressable, { onPress: handleToggleDrawer, accessibilityLabel: "Open menu", accessibilityRole: "button", style: ({
96
+ pressed
97
+ }) => [styles.iconButton, pressed && styles.iconButtonPressed], hitSlop: 8, children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "menu", size: ICON_SIZE, color: iconColor }) }) : null;
98
+ const titleSlot = showTitle ? /* @__PURE__ */ jsx(Text, { style: [styles.title, titleAlignLeft ? styles.titleAlignLeft : styles.titleAlignCenter, {
99
+ color: titleColor
100
+ }, optionTitleStyle], numberOfLines: 1, ellipsizeMode: "tail", children: title }) : null;
101
+ const showRightSlot = showGateway || showHistory || showNewChat;
102
+ const rightSlot = showRightSlot ? /* @__PURE__ */ jsxs(View, { style: styles.rightActions, children: [
103
+ showGateway ? /* @__PURE__ */ jsx(GatewayConnector, {}) : null,
104
+ showHistory ? /* @__PURE__ */ jsx(Pressable, { onPress: handleOpenChatHistory, style: ({
105
+ pressed
106
+ }) => [styles.actionButton, pressed && styles.actionButtonPressed], accessibilityLabel: "Chat history", accessibilityRole: "button", hitSlop: 8, children: /* @__PURE__ */ jsx(View, { style: [styles.actionButtonInner, isDark ? styles.actionButtonInnerDark : null], children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "history", size: 19, color: accentColor }) }) }) : null,
107
+ showNewChat ? /* @__PURE__ */ jsx(Pressable, { onPress: handleNewChat, style: ({
108
+ pressed
109
+ }) => [styles.actionButton, pressed && styles.actionButtonPressed], accessibilityLabel: "New chat", accessibilityRole: "button", hitSlop: 8, children: /* @__PURE__ */ jsx(View, { style: [styles.actionButtonInner, isDark ? styles.actionButtonInnerDark : null], children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "chat-plus-outline", size: 20, color: newChatIconColor }) }) }) : null
110
+ ] }) : null;
111
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
112
+ /* @__PURE__ */ jsx(StatusBar, { style: isDark ? "light" : "dark" }),
113
+ /* @__PURE__ */ jsx(SafeAreaView, { edges: ["top"], style: {
114
+ backgroundColor: surfaceColor
115
+ }, children: /* @__PURE__ */ jsxs(View, { style: [styles.row, {
116
+ backgroundColor: surfaceColor,
117
+ borderBottomColor: dividerColor,
118
+ paddingTop: insets.top > 0 ? 0 : 6
119
+ }, (_c = options == null ? void 0 : options.headerStyle) != null ? _c : null], children: [
120
+ /* @__PURE__ */ jsx(View, { style: styles.leftSlot, children: leftSlot }),
121
+ /* @__PURE__ */ jsx(View, { style: [styles.titleSlot, titleAlignLeft && styles.titleSlotLeft], children: titleSlot }),
122
+ /* @__PURE__ */ jsx(View, { style: styles.rightSlot, children: rightSlot })
123
+ ] }) })
124
+ ] });
125
+ };
126
+ const styles = StyleSheet.create({
127
+ row: {
128
+ flexDirection: "row",
129
+ alignItems: "center",
130
+ paddingHorizontal: 12,
131
+ paddingVertical: 10,
132
+ minHeight: 52,
133
+ borderBottomWidth: StyleSheet.hairlineWidth
134
+ },
135
+ leftSlot: {
136
+ minWidth: 40,
137
+ alignItems: "flex-start",
138
+ justifyContent: "center"
139
+ },
140
+ titleSlot: {
141
+ flex: 1,
142
+ alignItems: "center",
143
+ justifyContent: "center",
144
+ paddingHorizontal: 8,
145
+ minWidth: 0
146
+ },
147
+ titleSlotLeft: {
148
+ alignItems: "flex-start"
149
+ },
150
+ rightSlot: {
151
+ minWidth: 40,
152
+ alignItems: "flex-end",
153
+ justifyContent: "center"
154
+ },
155
+ rightActions: {
156
+ flexDirection: "row",
157
+ alignItems: "center",
158
+ gap: 6
159
+ },
160
+ title: {
161
+ fontSize: 17,
162
+ fontWeight: "700",
163
+ letterSpacing: -0.2,
164
+ width: "100%"
165
+ },
166
+ titleAlignCenter: {
167
+ textAlign: "center"
168
+ },
169
+ titleAlignLeft: {
170
+ textAlign: "left"
171
+ },
172
+ iconButton: {
173
+ width: 36,
174
+ height: 36,
175
+ alignItems: "center",
176
+ justifyContent: "center",
177
+ borderRadius: 18
178
+ },
179
+ iconButtonPressed: {
180
+ opacity: 0.6
181
+ },
182
+ actionButton: {
183
+ padding: 0,
184
+ alignItems: "center",
185
+ justifyContent: "center",
186
+ borderRadius: 22
187
+ },
188
+ actionButtonPressed: {
189
+ opacity: 0.6
190
+ },
191
+ actionButtonInner: {
192
+ width: 32,
193
+ height: 32,
194
+ borderRadius: 16,
195
+ alignItems: "center",
196
+ justifyContent: "center",
197
+ backgroundColor: mobileTokens.color.surface,
198
+ borderWidth: 1,
199
+ borderColor: mobileTokens.color.border,
200
+ shadowColor: "#0f172a",
201
+ shadowOpacity: 0.08,
202
+ shadowRadius: 5,
203
+ shadowOffset: {
204
+ width: 0,
205
+ height: 2
206
+ },
207
+ elevation: 2
208
+ },
209
+ actionButtonInnerDark: {
210
+ backgroundColor: "#0f172a",
211
+ borderColor: "#334155"
212
+ }
213
+ });
214
+ var NavigationHeader$1 = React.memo(NavigationHeader);export{NavigationHeader$1 as default};//# sourceMappingURL=NavigationHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavigationHeader.js","sources":["../../../src/components/NavigationHeader/NavigationHeader.tsx"],"sourcesContent":["/**\n * Universal navigation header for the Yantra mobile app.\n *\n * Wired via `customHeader` in `compute.ts`, so the React Navigation runtime\n * passes us TWO sets of props on every render:\n *\n * 1. The standard navigator props — `navigation`, `route`, `options`, `back`,\n * `layout`. We read EVERYTHING visual out of `options` (set by `props.options`\n * in compute.ts):\n * • `options.title` / `options.headerTitle` — visible title text\n * • `options.headerTitleAlign` — `'left' | 'center'`\n * • `options.headerTitleStyle` — text style overrides (fontWeight, etc.)\n * • `options.headerTintColor` — title + icon tint (light-mode default)\n * • `options.headerStyle` — outer header view style overrides\n *\n * 2. The static `customHeader.props` from compute.ts — the layout flags\n * describing what the header should render for this route:\n * • `showTitle, showToggle, showBack, showFilter, isSearchBack`\n * • `showGateway, showHistory, showNewChat` (`showGateway` is intended for Home only)\n * • `headerBgColor`\n *\n * Screens never touch the header — no `setOptions`, no slot registration.\n * If a route needs a different header configuration, change its\n * `customHeader.props` / `props.options` in `compute.ts`.\n */\nimport React, { useCallback, useMemo } from 'react';\nimport { Pressable, StyleSheet, View, useColorScheme } from 'react-native';\nimport { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';\nimport { StatusBar } from 'expo-status-bar';\nimport { CommonActions, DrawerActions, useNavigation } from '@react-navigation/native';\nimport { getHeaderTitle } from '@react-navigation/elements';\nimport { MaterialCommunityIcons } from '@expo/vector-icons';\nimport { Text } from '@admin-layout/gluestack-ui-mobile';\nimport { GatewayConnector } from '../GatewayConnector';\nimport { mobileTokens } from '../../theme/mobileTokens';\n\ninterface NavigationHeaderProps {\n /** React Navigation header props (typed loose because they vary per navigator). */\n navigation?: any;\n route?: any;\n options?: any;\n /** Set by the native-stack navigator when there's a previous screen on the stack. */\n back?: { title?: string };\n\n showTitle?: boolean;\n showToggle?: boolean;\n showBack?: boolean;\n showFilter?: boolean;\n isSearchBack?: boolean;\n showGateway?: boolean;\n showHistory?: boolean;\n showNewChat?: boolean;\n headerBgColor?: string;\n}\n\nconst ICON_SIZE = 22;\n\nfunction resolveTitle(options: any, route: any): string {\n if (typeof options?.title === 'string' && options.title.trim()) {\n return options.title.trim();\n }\n if (typeof options?.headerTitle === 'string' && options.headerTitle.trim()) {\n return options.headerTitle.trim();\n }\n const fallback = getHeaderTitle?.(options ?? {}, route?.name ?? 'Yantra');\n return typeof fallback === 'string' && fallback.trim() ? fallback : 'Yantra';\n}\n\nconst NavigationHeader: React.FC<NavigationHeaderProps> = (props) => {\n const {\n navigation: navProp,\n route,\n options,\n back,\n showTitle = true,\n showToggle = false,\n showBack = false,\n showGateway = false,\n showHistory = false,\n showNewChat = false,\n headerBgColor,\n } = props;\n\n const fallbackNav = useNavigation<any>();\n const navigation = navProp ?? fallbackNav;\n\n const colorScheme = useColorScheme();\n const isDark = colorScheme === 'dark';\n const insets = useSafeAreaInsets();\n\n /* ── Theme + options-driven colours / styles ─────────────────────────── */\n const themeTitleColor = isDark ? '#f1f5f9' : '#0f172a';\n const themeAccentColor = isDark ? '#a5b4fc' : '#4338ca';\n const themeNewChatIconColor = isDark ? '#e5e7eb' : '#000000';\n\n /**\n * Honour `options.headerTintColor` (set in `compute.ts` → `props.options`).\n * In dark mode we ignore a hard \"black\" tint so the title stays legible —\n * but any non-black tint is respected in both modes.\n */\n const optionTint = typeof options?.headerTintColor === 'string' ? options.headerTintColor : null;\n const tintLooksDark = optionTint && /^(#?000(000)?|black)$/i.test(optionTint.trim());\n const effectiveTint = optionTint && !(isDark && tintLooksDark) ? optionTint : null;\n\n const titleColor = effectiveTint ?? themeTitleColor;\n const iconColor = effectiveTint ?? themeTitleColor;\n const accentColor = effectiveTint ?? themeAccentColor;\n const newChatIconColor = effectiveTint ?? themeNewChatIconColor;\n\n const surfaceColor = headerBgColor ?? (isDark ? '#0f172a' : '#ffffff');\n const dividerColor = isDark ? 'rgba(148, 163, 184, 0.18)' : 'rgba(15, 23, 42, 0.06)';\n\n const titleAlignLeft = options?.headerTitleAlign === 'left';\n const title = useMemo(() => resolveTitle(options, route), [options, route]);\n const optionTitleStyle = options?.headerTitleStyle ?? null;\n\n /** Org slug used by header navigation actions; falls back to route params. */\n const orgName = useMemo(() => {\n const raw = (route?.params?.orgName as string | undefined) ?? '';\n return typeof raw === 'string' && raw.trim() ? raw.trim() : null;\n }, [route?.params?.orgName]);\n\n /* ── Action handlers ─────────────────────────────────────────────────── */\n const handleBack = useCallback(() => {\n if (navigation?.canGoBack?.()) {\n navigation.goBack();\n return;\n }\n navigation?.dispatch?.(\n CommonActions.navigate({\n name: 'MainStack.Layout.Home',\n params: orgName ? { orgName } : undefined,\n }),\n );\n }, [navigation, orgName]);\n\n const handleToggleDrawer = useCallback(() => {\n try {\n navigation?.dispatch?.(DrawerActions.openDrawer());\n } catch {\n /* Current navigator may not be a drawer — ignore. */\n }\n }, [navigation]);\n\n const handleOpenChatHistory = useCallback(() => {\n navigation?.dispatch?.(\n CommonActions.navigate({\n name: 'MainStack.ChatHistory',\n params: orgName ? { orgName } : undefined,\n }),\n );\n }, [navigation, orgName]);\n\n const handleNewChat = useCallback(() => {\n navigation?.dispatch?.(\n CommonActions.navigate({\n name: 'MainStack.Layout.Home',\n params: orgName ? { orgName } : undefined,\n merge: true,\n }),\n );\n }, [navigation, orgName]);\n\n /* ── Slot composition (left → title → right) ─────────────────────────── */\n const wantsBack = Boolean(back) || showBack;\n\n const leftSlot = wantsBack ? (\n <Pressable\n onPress={handleBack}\n accessibilityLabel=\"Go back\"\n accessibilityRole=\"button\"\n style={({ pressed }) => [styles.iconButton, pressed && styles.iconButtonPressed]}\n hitSlop={8}\n >\n <MaterialCommunityIcons name=\"chevron-left\" size={ICON_SIZE + 4} color={iconColor} />\n </Pressable>\n ) : showToggle ? (\n <Pressable\n onPress={handleToggleDrawer}\n accessibilityLabel=\"Open menu\"\n accessibilityRole=\"button\"\n style={({ pressed }) => [styles.iconButton, pressed && styles.iconButtonPressed]}\n hitSlop={8}\n >\n <MaterialCommunityIcons name=\"menu\" size={ICON_SIZE} color={iconColor} />\n </Pressable>\n ) : null;\n\n const titleSlot = showTitle ? (\n <Text\n style={[\n styles.title,\n titleAlignLeft ? styles.titleAlignLeft : styles.titleAlignCenter,\n { color: titleColor },\n optionTitleStyle,\n ]}\n numberOfLines={1}\n ellipsizeMode=\"tail\"\n >\n {title}\n </Text>\n ) : null;\n\n const showRightSlot = showGateway || showHistory || showNewChat;\n const rightSlot = showRightSlot ? (\n <View style={styles.rightActions}>\n {showGateway ? <GatewayConnector /> : null}\n {showHistory ? (\n <Pressable\n onPress={handleOpenChatHistory}\n style={({ pressed }) => [styles.actionButton, pressed && styles.actionButtonPressed]}\n accessibilityLabel=\"Chat history\"\n accessibilityRole=\"button\"\n hitSlop={8}\n >\n <View style={[styles.actionButtonInner, isDark ? styles.actionButtonInnerDark : null]}>\n <MaterialCommunityIcons name=\"history\" size={19} color={accentColor} />\n </View>\n </Pressable>\n ) : null}\n {showNewChat ? (\n <Pressable\n onPress={handleNewChat}\n style={({ pressed }) => [styles.actionButton, pressed && styles.actionButtonPressed]}\n accessibilityLabel=\"New chat\"\n accessibilityRole=\"button\"\n hitSlop={8}\n >\n <View style={[styles.actionButtonInner, isDark ? styles.actionButtonInnerDark : null]}>\n <MaterialCommunityIcons name=\"chat-plus-outline\" size={20} color={newChatIconColor} />\n </View>\n </Pressable>\n ) : null}\n </View>\n ) : null;\n\n return (\n <>\n <StatusBar style={isDark ? 'light' : 'dark'} />\n <SafeAreaView edges={['top']} style={{ backgroundColor: surfaceColor }}>\n <View\n style={[\n styles.row,\n {\n backgroundColor: surfaceColor,\n borderBottomColor: dividerColor,\n paddingTop: insets.top > 0 ? 0 : 6,\n },\n options?.headerStyle ?? null,\n ]}\n >\n <View style={styles.leftSlot}>{leftSlot}</View>\n <View style={[styles.titleSlot, titleAlignLeft && styles.titleSlotLeft]}>{titleSlot}</View>\n <View style={styles.rightSlot}>{rightSlot}</View>\n </View>\n </SafeAreaView>\n </>\n );\n};\n\nconst styles = StyleSheet.create({\n row: {\n flexDirection: 'row',\n alignItems: 'center',\n paddingHorizontal: 12,\n paddingVertical: 10,\n minHeight: 52,\n borderBottomWidth: StyleSheet.hairlineWidth,\n },\n leftSlot: {\n minWidth: 40,\n alignItems: 'flex-start',\n justifyContent: 'center',\n },\n titleSlot: {\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n paddingHorizontal: 8,\n minWidth: 0,\n },\n titleSlotLeft: {\n alignItems: 'flex-start',\n },\n rightSlot: {\n minWidth: 40,\n alignItems: 'flex-end',\n justifyContent: 'center',\n },\n rightActions: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 6,\n },\n title: {\n fontSize: 17,\n fontWeight: '700',\n letterSpacing: -0.2,\n width: '100%',\n },\n titleAlignCenter: {\n textAlign: 'center',\n },\n titleAlignLeft: {\n textAlign: 'left',\n },\n iconButton: {\n width: 36,\n height: 36,\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: 18,\n },\n iconButtonPressed: {\n opacity: 0.6,\n },\n actionButton: {\n padding: 0,\n alignItems: 'center',\n justifyContent: 'center',\n borderRadius: 22,\n },\n actionButtonPressed: {\n opacity: 0.6,\n },\n actionButtonInner: {\n width: 32,\n height: 32,\n borderRadius: 16,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: mobileTokens.color.surface,\n borderWidth: 1,\n borderColor: mobileTokens.color.border,\n shadowColor: '#0f172a',\n shadowOpacity: 0.08,\n shadowRadius: 5,\n shadowOffset: { width: 0, height: 2 },\n elevation: 2,\n },\n actionButtonInnerDark: {\n backgroundColor: '#0f172a',\n borderColor: '#334155',\n },\n});\n\nexport default React.memo(NavigationHeader);\n"],"names":["_a","_b"],"mappings":"2oBAsDA,MAAM,SAAY,GAAA,EAAA;AAClB,SAAS,YAAA,CAAa,SAAc,KAAoB,EAAA;AAvDxD,EAAA,IAAA,EAAA,EAAA,EAAA;AAwDE,EAAA,IAAI,QAAO,OAAS,IAAA,IAAA,GAAA,MAAA,GAAA,OAAA,CAAA,KAAA,CAAA,KAAU,YAAY,OAAQ,CAAA,KAAA,CAAM,MAAQ,EAAA;AAC9D,IAAO,OAAA,OAAA,CAAQ,MAAM,IAAK,EAAA;AAAA;AAE5B,EAAA,IAAI,QAAO,OAAS,IAAA,IAAA,GAAA,MAAA,GAAA,OAAA,CAAA,WAAA,CAAA,KAAgB,YAAY,OAAQ,CAAA,WAAA,CAAY,MAAQ,EAAA;AAC1E,IAAO,OAAA,OAAA,CAAQ,YAAY,IAAK,EAAA;AAAA;AAElC,EAAA,MAAM,YAAW,EAAiB,GAAA,cAAA,KAAA,IAAA,GAAA,MAAA,GAAA,EAAA,CAAA,OAAA,IAAA,IAAA,GAAA,OAAA,GAAW,EAAI,EAAA,CAAA,EAAA,GAAA,KAAA,IAAA,IAAA,GAAA,MAAA,GAAA,KAAA,CAAO,SAAP,IAAe,GAAA,EAAA,GAAA,QAAA,CAAA;AAChE,EAAA,OAAO,OAAO,QAAa,KAAA,QAAA,IAAY,QAAS,CAAA,IAAA,KAAS,QAAW,GAAA,QAAA;AACtE;AACA,MAAM,mBAAoD,CAAS,KAAA,KAAA;AAjEnE,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA;AAkEE,EAAM,MAAA;AAAA,IACJ,UAA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-0,0 +1,55 @@
1
+ import {jsxs,jsx}from'react/jsx-runtime';import {useRef,useEffect}from'react';import {Animated,Easing,View,StyleSheet}from'react-native';import {Text}from'@admin-layout/gluestack-ui-mobile';function ThinkingIndicator({
2
+ color,
3
+ label = "Thinking\u2026"
4
+ }) {
5
+ const rotation = useRef(new Animated.Value(0)).current;
6
+ useEffect(() => {
7
+ const loop = Animated.loop(Animated.timing(rotation, {
8
+ toValue: 1,
9
+ duration: 900,
10
+ easing: Easing.linear,
11
+ useNativeDriver: true
12
+ }));
13
+ loop.start();
14
+ return () => loop.stop();
15
+ }, [rotation]);
16
+ const rotate = rotation.interpolate({
17
+ inputRange: [0, 1],
18
+ outputRange: ["0deg", "360deg"]
19
+ });
20
+ return /* @__PURE__ */ jsxs(View, { style: styles.row, children: [
21
+ /* @__PURE__ */ jsx(Animated.View, { style: [styles.spinner, label ? styles.spinnerWithLabel : null, {
22
+ borderTopColor: color,
23
+ borderRightColor: color,
24
+ borderBottomColor: color,
25
+ transform: [{
26
+ rotate
27
+ }]
28
+ }] }),
29
+ label ? /* @__PURE__ */ jsx(Text, { style: [styles.label, {
30
+ color
31
+ }], children: label }) : null
32
+ ] });
33
+ }
34
+ const styles = StyleSheet.create({
35
+ row: {
36
+ flexDirection: "row",
37
+ alignItems: "center"
38
+ },
39
+ spinner: {
40
+ width: 14,
41
+ height: 14,
42
+ borderRadius: 7,
43
+ borderWidth: 1.5,
44
+ borderLeftColor: "transparent"
45
+ },
46
+ spinnerWithLabel: {
47
+ marginRight: 8
48
+ },
49
+ label: {
50
+ fontSize: 12,
51
+ fontWeight: "500",
52
+ letterSpacing: 0.2,
53
+ opacity: 0.9
54
+ }
55
+ });export{ThinkingIndicator as default};//# sourceMappingURL=ThinkingIndicator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThinkingIndicator.js","sources":["../../src/components/ThinkingIndicator.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport { Animated, Easing, StyleSheet, View } from 'react-native';\nimport { Text } from '@admin-layout/gluestack-ui-mobile';\n\ninterface ThinkingIndicatorProps {\n /** Foreground tint for both the spinner ring and the caption. */\n color: string;\n /**\n * Optional caption. Defaults to `Thinking…` to mirror the web composer's\n * status pill (`packages-modules/account/browser/src/pages/chat/ChatSessionPage.tsx`).\n * Pass an empty string to render only the spinner ring.\n */\n label?: string;\n}\n\n/**\n * Shared \"thinking\" status row used by Chat and Chat History.\n *\n * Visual parity with the web composer (`ChatSessionPage.tsx`):\n * • Thin circular outline arc (mirrors lucide's `Loader2`) — drawn with a\n * 1.5px border and one transparent side so the spin reads as a single\n * curved stroke, not the iOS dotted-wheel that RN's `ActivityIndicator`\n * produces.\n * • 12px muted caption to the right of the spinner, matching web's\n * `text-xs text-muted-foreground`.\n *\n * The animation lifecycle is owned by this component so the `Animated.loop`\n * only runs while the indicator is mounted (i.e. only while the consumer is\n * actually waiting on something). On unmount we stop the loop to release\n * the driver tick.\n */\nexport default function ThinkingIndicator({ color, label = 'Thinking…' }: ThinkingIndicatorProps) {\n const rotation = useRef(new Animated.Value(0)).current;\n useEffect(() => {\n const loop = Animated.loop(\n Animated.timing(rotation, {\n toValue: 1,\n duration: 900,\n easing: Easing.linear,\n useNativeDriver: true,\n }),\n );\n loop.start();\n return () => loop.stop();\n }, [rotation]);\n const rotate = rotation.interpolate({ inputRange: [0, 1], outputRange: ['0deg', '360deg'] });\n return (\n <View style={styles.row}>\n <Animated.View\n style={[\n styles.spinner,\n label ? styles.spinnerWithLabel : null,\n {\n borderTopColor: color,\n borderRightColor: color,\n borderBottomColor: color,\n transform: [{ rotate }],\n },\n ]}\n />\n {label ? <Text style={[styles.label, { color }]}>{label}</Text> : null}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n row: {\n flexDirection: 'row',\n alignItems: 'center',\n },\n spinner: {\n width: 14,\n height: 14,\n borderRadius: 7,\n borderWidth: 1.5,\n borderLeftColor: 'transparent',\n },\n spinnerWithLabel: {\n marginRight: 8,\n },\n label: {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BAAS,GAAA,CAAA,IAAA,EAAA,EAAK,KAAO,EAAA,CAAC,OAAO,KAAO,EAAA;AAAA,MAC3C;AAAA,KACD,CAAI,EAAA,QAAA,EAAA,KAAA,EAAM,CAAU,GAAA;AAAA,GACjB,EAAA,CAAA;AACR;AACA,MAAM,MAAA,GAAS,WAAW,MAAO,CAAA;AAAA,EAC/B,GAAK,EAAA;AAAA,IACH,aAAe,EAAA,KAAA;AAAA,IACf,UAAY,EAAA;AAAA,GACd;AAAA,EACA,OAAS,EAAA;AAAA,IACP,KAAO,EAAA,EAAA;AAAA,IACP,MAAQ,EAAA,EAAA;AAAA,IACR,YAAc,EAAA,CAAA;AAAA,IACd,WAAa,EAAA,GAAA;AAAA,IACb,eAAiB,EAAA;AAAA,GACnB;AAAA,EACA,gBAAkB,EAAA;AAAA,IAChB,WAAa,EAAA;AAAA,GACf;AAAA,EACA,KAAO,EAAA;AAAA,IACL,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,KAAA;AAAA,IACZ,aAAe,EAAA,GAAA;AAAA,IACf,OAAS,EAAA;AAAA;AAEb,CAAC,CAAA"}
package/lib/compute.js CHANGED
@@ -9,6 +9,22 @@ const yantraMobilePageStore = [{
9
9
  hideInMenu: true,
10
10
  auth: true,
11
11
  menu_position: "side",
12
+ importPaths: {
13
+ navigationHeader: "@adminide-stack/yantra-mobile/lib/components/NavigationHeader/NavigationHeader.js"
14
+ },
15
+ customHeader: {
16
+ name: "NavigationHeader",
17
+ component: "$.importPaths.navigationHeader",
18
+ props: {
19
+ showTitle: true,
20
+ showToggle: true,
21
+ showFilter: true,
22
+ isSearchBack: false,
23
+ showGateway: true,
24
+ showHistory: true,
25
+ showNewChat: true
26
+ }
27
+ },
12
28
  props: {
13
29
  initialParams: {
14
30
  initialSessionId: null,
@@ -30,36 +46,97 @@ const yantraMobilePageStore = [{
30
46
  },
31
47
  componentPath: "@adminide-stack/yantra-mobile/lib/screens/Home/index.js",
32
48
  hasComponent: true
33
- }
34
- // {
35
- // key: 'chat',
36
- // path: '/:orgName/l/chat',
37
- // name: 'Chat',
38
- // exact: true,
39
- // index: true,
40
- // priority: 1,
41
- // hideInMenu: true,
42
- // auth: true,
43
- // menu_position: 'side',
44
- // component: () => import('./screens/Home'),
45
- // permissions: ['*'],
46
- // extraPermissions: ['*'],
47
- // props: {
48
- // initialParams: { initialSessionId: null, orgName: null },
49
- // options: {
50
- // title: 'Yantra',
51
- // headerTintColor: 'black',
52
- // headerTitleStyle: {
53
- // fontWeight: 'bold',
54
- // },
55
- // drawerLabel: 'Chat',
56
- // headerTitleAlign: 'left',
57
- // gestureEnabled: false,
58
- // swipeEnabled: false,
59
- // },
60
- // },
61
- // },
62
- ];
63
- const selectedRoutes = ["home"];
49
+ }, {
50
+ key: "chat",
51
+ path: "/:orgName/chat/:channelId",
52
+ name: "Chat",
53
+ exact: false,
54
+ priority: 2,
55
+ hideInMenu: true,
56
+ auth: true,
57
+ importPaths: {
58
+ navigationHeader: "@adminide-stack/yantra-mobile/lib/components/NavigationHeader/NavigationHeader.js"
59
+ },
60
+ customHeader: {
61
+ name: "NavigationHeader",
62
+ component: "$.importPaths.navigationHeader",
63
+ props: {
64
+ showTitle: true,
65
+ showToggle: false,
66
+ showFilter: false,
67
+ isSearchBack: false,
68
+ showBack: true,
69
+ showGateway: true,
70
+ showHistory: false,
71
+ showNewChat: true
72
+ }
73
+ },
74
+ props: {
75
+ initialParams: {
76
+ channelId: null,
77
+ orgName: null
78
+ },
79
+ options: {
80
+ title: "Yantra",
81
+ headerTintColor: "black",
82
+ headerTitleStyle: {
83
+ fontWeight: "bold"
84
+ },
85
+ drawerLabel: "Chat",
86
+ headerTitleAlign: "left",
87
+ gestureEnabled: false,
88
+ swipeEnabled: false,
89
+ animation: "fade",
90
+ animationTypeForReplace: "pop"
91
+ }
92
+ },
93
+ componentPath: "@adminide-stack/yantra-mobile/lib/screens/Chat/index.js",
94
+ hasComponent: true
95
+ }, {
96
+ key: "chathistory",
97
+ path: "/:orgName/chathistory",
98
+ name: "ChatHistory",
99
+ exact: false,
100
+ priority: 3,
101
+ hideInMenu: true,
102
+ auth: true,
103
+ importPaths: {
104
+ navigationHeader: "@adminide-stack/yantra-mobile/lib/components/NavigationHeader/NavigationHeader.js"
105
+ },
106
+ customHeader: {
107
+ name: "NavigationHeader",
108
+ component: "$.importPaths.navigationHeader",
109
+ props: {
110
+ showTitle: true,
111
+ showToggle: false,
112
+ showFilter: false,
113
+ isSearchBack: false,
114
+ showBack: true,
115
+ showGateway: false,
116
+ showHistory: false,
117
+ showNewChat: true
118
+ }
119
+ },
120
+ props: {
121
+ initialParams: {
122
+ orgName: null
123
+ },
124
+ options: {
125
+ title: "Chat history",
126
+ headerTintColor: "black",
127
+ headerTitleStyle: {
128
+ fontWeight: "bold"
129
+ },
130
+ headerTitleAlign: "left",
131
+ gestureEnabled: false,
132
+ swipeEnabled: false,
133
+ animation: "fade",
134
+ animationTypeForReplace: "pop"
135
+ }
136
+ },
137
+ componentPath: "@adminide-stack/yantra-mobile/lib/screens/ChatHistory/index.js",
138
+ hasComponent: true
139
+ }];
140
+ const selectedRoutes = ["home", "chat", "chathistory"];
64
141
  const filteredRoutes = getFilteredRoutes(yantraMobilePageStore, selectedRoutes);
65
142
  export { filteredRoutes, yantraMobilePageStore }; //# sourceMappingURL=compute.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"compute.js","sources":["../src/compute.ts"],"sourcesContent":["/* eslint-disable import/no-extraneous-dependencies */\nimport { getFilteredRoutes } from '@common-stack/client-react/lib/utils/filteredRoutes.js';\nimport type { IRouteModule } from '@common-stack/core';\n\nexport const yantraMobilePageStore: IRouteModule[] = [\n {\n key: 'home',\n path: '/:orgName/l/home',\n name: 'Home',\n exact: true,\n index: true,\n priority: 1,\n hideInMenu: true,\n auth: true,\n menu_position: 'side',\n component: () => import('./screens/Home'),\n props: {\n initialParams: { initialSessionId: null, orgName: null },\n options: {\n title: 'Yantra',\n headerTintColor: 'black',\n headerTitleStyle: {\n fontWeight: 'bold',\n },\n drawerLabel: 'Chat',\n headerTitleAlign: 'left',\n gestureEnabled: false,\n swipeEnabled: false,\n animation: 'fade',\n animationTypeForReplace: 'pop',\n },\n },\n },\n // {\n // key: 'chat',\n // path: '/:orgName/l/chat',\n // name: 'Chat',\n // exact: true,\n // index: true,\n // priority: 1,\n // hideInMenu: true,\n // auth: true,\n // menu_position: 'side',\n // component: () => import('./screens/Home'),\n // permissions: ['*'],\n // extraPermissions: ['*'],\n // props: {\n // initialParams: { initialSessionId: null, orgName: null },\n // options: {\n // title: 'Yantra',\n // headerTintColor: 'black',\n // headerTitleStyle: {\n // fontWeight: 'bold',\n // },\n // drawerLabel: 'Chat',\n // headerTitleAlign: 'left',\n // gestureEnabled: false,\n // swipeEnabled: false,\n // },\n // },\n // },\n];\n\nconst selectedRoutes = ['home'];\n\nconst filteredRoutes = getFilteredRoutes(yantraMobilePageStore, selectedRoutes);\n\nexport { filteredRoutes };\n"],"names":[],"mappings":"uFAGO,MAAM,qBAAwC,GAAA;AAAA,EAAC;AAAA,IACpD,GAAK,EAAA,MAAA;AAAA,IACL,IAAM,EAAA,kBAAA;AAAA,IACN,IAAM,EAAA,MAAA;AAAA,IACN,KAAO,EAAA,IAAA;AAAA,IACP,KAAO,EAAA,IAAA;AAAA,IACP,QAAU,EAAA,CAAA;AAAA,IACV,UAAY,EAAA,IAAA;AAAA,IACZ,IAAM,EAAA,IAAA;AAAA,IACN,aAAe,EAAA,MAAA;AAAA,IACf,SAAA,EAAW,MAAM,OAAO,yBAAgB,CAAA;AAAA,IACxC,KAAO,EAAA;AAAA,MACL,aAAe,EAAA;AAAA,QACb,gBAAkB,EAAA,IAAA;AAAA,QAClB,OAAS,EAAA;AAAA,OACX;AAAA,MACA,OAAS,EAAA;AAAA,QACP,KAAO,EAAA,QAAA;AAAA,QACP,eAAiB,EAAA,OAAA;AAAA,QACjB,gBAAkB,EAAA;AAAA,UAChB,UAAY,EAAA;AAAA,SACd;AAAA,QACA,WAAa,EAAA,MAAA;AAAA,QACb,gBAAkB,EAAA,MAAA;AAAA,QAClB,cAAgB,EAAA,KAAA;AAAA,QAChB,YAAc,EAAA,KAAA;AAAA,QACd,SAAW,EAAA,MAAA;AAAA,QACX,uBAAyB,EAAA;AAAA;AAC3B;AACF;AACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6BA;AACA,MAAM,cAAA,GAAiB,CAAC,MAAM,CAAA;AACxB,MAAA,cAAA,GAAiB,iBAAkB,CAAA,qBAAA,EAAuB,cAAc"}
1
+ {"version":3,"file":"compute.js","sources":["../src/compute.ts"],"sourcesContent":["/* eslint-disable import/no-extraneous-dependencies */\nimport { getFilteredRoutes } from '@common-stack/client-react/lib/utils/filteredRoutes.js';\nimport type { IRouteModule } from '@common-stack/core';\n\nexport const yantraMobilePageStore: IRouteModule[] = [\n {\n key: 'home',\n path: '/:orgName/l/home',\n name: 'Home',\n exact: true,\n index: true,\n priority: 1,\n hideInMenu: true,\n auth: true,\n menu_position: 'side',\n component: () => import('./screens/Home'),\n importPaths: {\n navigationHeader: () => import('./components/NavigationHeader/NavigationHeader'),\n },\n customHeader: {\n name: 'NavigationHeader',\n component: '$.importPaths.navigationHeader',\n props: {\n showTitle: true,\n showToggle: true,\n showFilter: true,\n isSearchBack: false,\n showGateway: true,\n showHistory: true,\n showNewChat: true,\n },\n },\n props: {\n initialParams: { initialSessionId: null, orgName: null },\n options: {\n title: 'Yantra',\n headerTintColor: 'black',\n headerTitleStyle: {\n fontWeight: 'bold',\n },\n drawerLabel: 'Chat',\n headerTitleAlign: 'left',\n gestureEnabled: false,\n swipeEnabled: false,\n animation: 'fade',\n animationTypeForReplace: 'pop',\n },\n },\n },\n {\n key: 'chat',\n path: '/:orgName/chat/:channelId',\n name: 'Chat',\n exact: false,\n priority: 2,\n hideInMenu: true,\n auth: true,\n component: () => import('./screens/Chat'),\n importPaths: {\n navigationHeader: () => import('./components/NavigationHeader/NavigationHeader'),\n },\n customHeader: {\n name: 'NavigationHeader',\n component: '$.importPaths.navigationHeader',\n props: {\n showTitle: true,\n showToggle: false,\n showFilter: false,\n isSearchBack: false,\n showBack: true,\n showGateway: true,\n showHistory: false,\n showNewChat: true,\n },\n },\n props: {\n initialParams: { channelId: null, orgName: null },\n options: {\n title: 'Yantra',\n headerTintColor: 'black',\n headerTitleStyle: {\n fontWeight: 'bold',\n },\n drawerLabel: 'Chat',\n headerTitleAlign: 'left',\n gestureEnabled: false,\n swipeEnabled: false,\n animation: 'fade',\n animationTypeForReplace: 'pop',\n },\n },\n },\n {\n key: 'chathistory',\n path: '/:orgName/chathistory',\n name: 'ChatHistory',\n exact: false,\n priority: 3,\n hideInMenu: true,\n auth: true,\n component: () => import('./screens/ChatHistory'),\n importPaths: {\n navigationHeader: () => import('./components/NavigationHeader/NavigationHeader'),\n },\n customHeader: {\n name: 'NavigationHeader',\n component: '$.importPaths.navigationHeader',\n props: {\n showTitle: true,\n showToggle: false,\n showFilter: false,\n isSearchBack: false,\n showBack: true,\n showGateway: false,\n showHistory: false,\n showNewChat: true,\n },\n },\n props: {\n initialParams: { orgName: null },\n options: {\n title: 'Chat history',\n headerTintColor: 'black',\n headerTitleStyle: {\n fontWeight: 'bold',\n },\n headerTitleAlign: 'left',\n gestureEnabled: false,\n swipeEnabled: false,\n animation: 'fade',\n animationTypeForReplace: 'pop',\n },\n },\n },\n];\n\nconst selectedRoutes = ['home', 'chat', 'chathistory'];\n\nconst filteredRoutes = getFilteredRoutes(yantraMobilePageStore, selectedRoutes);\n\nexport { filteredRoutes };\n"],"names":[],"mappings":"uFAGO,MAAM,wBAAwC,CAAC;AAAA,EACpD,GAAK,EAAA,MAAA;AAAA,EACL,IAAM,EAAA,kBAAA;AAAA,EACN,IAAM,EAAA,MAAA;AAAA,EACN,KAAO,EAAA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