@adminide-stack/yantra-mobile 12.0.171 → 12.0.172-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/GatewayConnector/GatewayConnector.js +10 -4
- package/lib/components/GatewayConnector/GatewayConnector.js.map +1 -1
- package/lib/components/GatewayConnector/GatewayStatusSheet.js +174 -0
- package/lib/components/GatewayConnector/GatewayStatusSheet.js.map +1 -0
- package/lib/components/GatewayToolbarButtonMobile.js +6 -2
- package/lib/components/GatewayToolbarButtonMobile.js.map +1 -1
- package/lib/compute.js +51 -1
- package/lib/compute.js.map +1 -1
- package/lib/config/env-config.js +12 -3
- package/lib/config/env-config.js.map +1 -1
- package/lib/features/apps/AppsCatalog.js +10 -0
- package/lib/features/apps/AppsCatalog.js.map +1 -1
- package/lib/features/apps/mobileAppCatalog.js +9 -0
- package/lib/features/apps/mobileAppCatalog.js.map +1 -1
- package/lib/features/apps/nativeAppHandoff.js +31 -13
- package/lib/features/apps/nativeAppHandoff.js.map +1 -1
- package/lib/features/apps/nativeSurfaceTwin.js +2 -1
- package/lib/features/apps/nativeSurfaceTwin.js.map +1 -1
- package/lib/features/canvas/set/agent/prompt.js +4 -5
- package/lib/features/canvas/set/agent/prompt.js.map +1 -1
- package/lib/features/canvas/set/supplyLibrary.js +1294 -2
- package/lib/features/canvas/set/supplyLibrary.js.map +1 -1
- package/lib/features/chat/PromptFillBar.js +153 -0
- package/lib/features/chat/PromptFillBar.js.map +1 -0
- package/lib/features/chat/promptBlanks.js +120 -0
- package/lib/features/chat/promptBlanks.js.map +1 -0
- package/lib/features/chat/savedReply.js +11 -0
- package/lib/features/chat/savedReply.js.map +1 -0
- package/lib/features/games/GameInviteCard.js +93 -0
- package/lib/features/games/GameInviteCard.js.map +1 -0
- package/lib/features/games/cubeforge3D.js +97 -0
- package/lib/features/games/cubeforge3D.js.map +1 -0
- package/lib/features/games/cubeforgeFriends.js +112 -0
- package/lib/features/games/cubeforgeFriends.js.map +1 -0
- package/lib/features/games/gameInvite.js +13 -0
- package/lib/features/games/gameInvite.js.map +1 -0
- package/lib/features/games/useCubeforgeFriends.js +63 -0
- package/lib/features/games/useCubeforgeFriends.js.map +1 -0
- package/lib/features/games/vendored/core/classroom/permissions.js +76 -0
- package/lib/features/games/vendored/core/classroom/permissions.js.map +1 -0
- package/lib/features/games/vendored/core/classroom/resourceLink.js +101 -0
- package/lib/features/games/vendored/core/classroom/resourceLink.js.map +1 -0
- package/lib/features/games/vendored/core/classroom/rules.js +83 -0
- package/lib/features/games/vendored/core/classroom/rules.js.map +1 -0
- package/lib/features/games/vendored/core/classroom/worldSettings.js +49 -0
- package/lib/features/games/vendored/core/classroom/worldSettings.js.map +1 -0
- package/lib/features/games/vendored/core/cubeforge/cycle.js +15 -0
- package/lib/features/games/vendored/core/cubeforge/cycle.js.map +1 -0
- package/lib/features/games/vendored/core/cubeforge/inventory.js +75 -0
- package/lib/features/games/vendored/core/cubeforge/inventory.js.map +1 -0
- package/lib/features/games/vendored/core/cubeforge/items.js +62 -0
- package/lib/features/games/vendored/core/cubeforge/items.js.map +1 -0
- package/lib/features/games/vendored/core/cubeforge/nativeWorld.js +4 -0
- package/lib/features/games/vendored/core/cubeforge/nativeWorld.js.map +1 -0
- package/lib/features/games/vendored/core/cubeforge/nativeWorlds.js +68 -0
- package/lib/features/games/vendored/core/cubeforge/nativeWorlds.js.map +1 -0
- package/lib/features/games/vendored/core/cubeforge/recipes.js +52 -0
- package/lib/features/games/vendored/core/cubeforge/recipes.js.map +1 -0
- package/lib/features/games/vendored/core/cubeforge/save.js +92 -0
- package/lib/features/games/vendored/core/cubeforge/save.js.map +1 -0
- package/lib/features/games/vendored/core/cubeforge/session.js +154 -0
- package/lib/features/games/vendored/core/cubeforge/session.js.map +1 -0
- package/lib/features/games/vendored/core/cubeforge/sharedWorlds.js +10 -0
- package/lib/features/games/vendored/core/cubeforge/sharedWorlds.js.map +1 -0
- package/lib/features/games/vendored/core/cubeforge/worldgen.js +44 -0
- package/lib/features/games/vendored/core/cubeforge/worldgen.js.map +1 -0
- package/lib/features/games/vendored/core/engine/iso.js +41 -0
- package/lib/features/games/vendored/core/engine/iso.js.map +1 -0
- package/lib/features/games/vendored/core/engine/palette.js +53 -0
- package/lib/features/games/vendored/core/engine/palette.js.map +1 -0
- package/lib/features/games/vendored/core/engine/world.js +148 -0
- package/lib/features/games/vendored/core/engine/world.js.map +1 -0
- package/lib/features/games/vendored/core/games/catalog.js +34 -0
- package/lib/features/games/vendored/core/games/catalog.js.map +1 -0
- package/lib/features/games/vendored/core/lessons/lessons.js +97 -0
- package/lib/features/games/vendored/core/lessons/lessons.js.map +1 -0
- package/lib/features/games/vendored/core/logging/events.js +24 -0
- package/lib/features/games/vendored/core/logging/events.js.map +1 -0
- package/lib/features/games/vendored/core/logging/logger.js +54 -0
- package/lib/features/games/vendored/core/logging/logger.js.map +1 -0
- package/lib/features/games/vendored/core/session/gameSession.js +317 -0
- package/lib/features/games/vendored/core/session/gameSession.js.map +1 -0
- package/lib/features/games/vendored/core/storage/worldRepository.js +192 -0
- package/lib/features/games/vendored/core/storage/worldRepository.js.map +1 -0
- package/lib/features/games/vendored/core/store/reactive.js +78 -0
- package/lib/features/games/vendored/core/store/reactive.js.map +1 -0
- package/lib/features/games/vendored/ui/GamesRoot.js +223 -0
- package/lib/features/games/vendored/ui/GamesRoot.js.map +1 -0
- package/lib/features/games/vendored/ui/components/BlockPalette.js +64 -0
- package/lib/features/games/vendored/ui/components/BlockPalette.js.map +1 -0
- package/lib/features/games/vendored/ui/components/IsoCanvas.js +124 -0
- package/lib/features/games/vendored/ui/components/IsoCanvas.js.map +1 -0
- package/lib/features/games/vendored/ui/components/primitives.js +257 -0
- package/lib/features/games/vendored/ui/components/primitives.js.map +1 -0
- package/lib/features/games/vendored/ui/hooks/useReactiveQuery.js +3 -0
- package/lib/features/games/vendored/ui/hooks/useReactiveQuery.js.map +1 -0
- package/lib/features/games/vendored/ui/screens/ActivityScreen.js +68 -0
- package/lib/features/games/vendored/ui/screens/ActivityScreen.js.map +1 -0
- package/lib/features/games/vendored/ui/screens/BuilderScreen.js +227 -0
- package/lib/features/games/vendored/ui/screens/BuilderScreen.js.map +1 -0
- package/lib/features/games/vendored/ui/screens/ClassroomScreen.js +95 -0
- package/lib/features/games/vendored/ui/screens/ClassroomScreen.js.map +1 -0
- package/lib/features/games/vendored/ui/screens/Cubeforge3DHomeScreen.js +296 -0
- package/lib/features/games/vendored/ui/screens/Cubeforge3DHomeScreen.js.map +1 -0
- package/lib/features/games/vendored/ui/screens/CubeforgeScreen.js +342 -0
- package/lib/features/games/vendored/ui/screens/CubeforgeScreen.js.map +1 -0
- package/lib/features/games/vendored/ui/screens/HubScreen.js +131 -0
- package/lib/features/games/vendored/ui/screens/HubScreen.js.map +1 -0
- package/lib/features/games/vendored/ui/screens/ScreenHeader.js +51 -0
- package/lib/features/games/vendored/ui/screens/ScreenHeader.js.map +1 -0
- package/lib/features/games/vendored/ui/screens/WorldListScreen.js +134 -0
- package/lib/features/games/vendored/ui/screens/WorldListScreen.js.map +1 -0
- package/lib/features/games/vendored/ui/storage/asyncStorageAdapter.js +23 -0
- package/lib/features/games/vendored/ui/storage/asyncStorageAdapter.js.map +1 -0
- package/lib/features/games/vendored/ui/theme.js +53 -0
- package/lib/features/games/vendored/ui/theme.js.map +1 -0
- package/lib/features/messaging/ChatComponents.js +12 -4
- package/lib/features/messaging/ChatComponents.js.map +1 -1
- package/lib/features/messaging/messageCards.js +22 -0
- package/lib/features/messaging/messageCards.js.map +1 -0
- package/lib/features/travel/TravelAgentChatPane.js +9 -1
- package/lib/features/travel/TravelAgentChatPane.js.map +1 -1
- package/lib/hooks/useCdecliAutoConnect.js +8 -1
- package/lib/hooks/useCdecliAutoConnect.js.map +1 -1
- package/lib/hooks/useCdecliChannel.js +142 -49
- package/lib/hooks/useCdecliChannel.js.map +1 -1
- package/lib/hooks/useChatApi.js +21 -10
- package/lib/hooks/useChatApi.js.map +1 -1
- package/lib/hooks/useChatStream.js +18 -5
- package/lib/hooks/useChatStream.js.map +1 -1
- package/lib/module.js +2 -1
- package/lib/module.js.map +1 -1
- package/lib/routes.json +50 -0
- package/lib/screens/Chat/index.js +23 -15
- package/lib/screens/Chat/index.js.map +1 -1
- package/lib/screens/GamesNative/index.js +75 -0
- package/lib/screens/GamesNative/index.js.map +1 -0
- package/lib/screens/Home/HomeScreen.js +147 -33
- package/lib/screens/Home/HomeScreen.js.map +1 -1
- package/lib/screens/Home/components/HomeSuggestions.js +1 -1
- package/lib/screens/Home/components/HomeSuggestions.js.map +1 -1
- package/lib/screens/Home/components/homeCatalog.js +68 -16
- package/lib/screens/Home/components/homeCatalog.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {jsx}from'react/jsx-runtime';import React__default,{useCallback}from'react';import'react-native';import'common/graphql';import'../../config/env-config.js';import'../../hooks/usePrerequisiteIds.js';import'common';import'@react-native-async-storage/async-storage';import'expo-secure-store';import'../../features/messaging/yantraChatOrg.js';import {useCdecliConnection}from'../../contexts/cdecliConnection.js';import {useGatewayContext}from'../../contexts/GatewayContext.js';import {GatewayToolbarButtonMobile}from'../GatewayToolbarButtonMobile.js';function mapCdecliStatus(status) {
|
|
1
|
+
import {jsxs,Fragment,jsx}from'react/jsx-runtime';import React__default,{useState,useCallback}from'react';import {useColorScheme}from'react-native';import'common/graphql';import'../../config/env-config.js';import'../../hooks/usePrerequisiteIds.js';import'common';import'@react-native-async-storage/async-storage';import'expo-secure-store';import'../../features/messaging/yantraChatOrg.js';import {useCdecliConnection}from'../../contexts/cdecliConnection.js';import {useGatewayContext}from'../../contexts/GatewayContext.js';import {GatewayToolbarButtonMobile}from'../GatewayToolbarButtonMobile.js';import {GatewayStatusSheet}from'./GatewayStatusSheet.js';function mapCdecliStatus(status) {
|
|
2
2
|
if (status === "connecting") return "connecting";
|
|
3
3
|
if (status === "connected") return "connected";
|
|
4
4
|
if (status === "error") return "error";
|
|
@@ -15,8 +15,14 @@ const GatewayConnector = ({
|
|
|
15
15
|
} = useGatewayContext();
|
|
16
16
|
const gatewayStatus = mapCdecliStatus(cdecli.status);
|
|
17
17
|
const gatewayLabel = cdecli.status === "connecting" ? "Checking..." : void 0;
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const deviceDark = useColorScheme() === "dark";
|
|
19
|
+
const gatewayName = (selectedGateway == null ? void 0 : selectedGateway.name) || "Yantra";
|
|
20
|
+
const [statusOpen, setStatusOpen] = useState(false);
|
|
21
|
+
const openStatus = useCallback(() => setStatusOpen(true), []);
|
|
22
|
+
const closeStatus = useCallback(() => setStatusOpen(false), []);
|
|
23
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24
|
+
/* @__PURE__ */ jsx(GatewayToolbarButtonMobile, { gatewayStatus, gatewayError: cdecli.error, onToggleGateway: openStatus, disabled, statusLabel: gatewayLabel, gatewayName, tone, isDark }),
|
|
25
|
+
/* @__PURE__ */ jsx(GatewayStatusSheet, { visible: statusOpen, status: gatewayStatus, name: gatewayName, isDark: deviceDark, onReconnect: cdecli.reconnect, onClose: closeStatus })
|
|
26
|
+
] });
|
|
21
27
|
};
|
|
22
28
|
var GatewayConnector$1 = React__default.memo(GatewayConnector);export{GatewayConnector$1 as default};//# sourceMappingURL=GatewayConnector.js.map
|
|
@@ -1 +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 { useGatewayContext } from '../../contexts/GatewayContext';\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
|
|
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, useState } from 'react';\nimport { useColorScheme } from 'react-native';\nimport { useCdecliConnection } from '../../contexts/CdecliConnectionContext';\nimport { useGatewayContext } from '../../contexts/GatewayContext';\nimport { GatewayToolbarButtonMobile } from '../GatewayToolbarButtonMobile';\nimport { GatewayStatusSheet } from './GatewayStatusSheet';\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. */\n disabled?: boolean;\n /** The bar's ink, when it follows something other than the device (the home's sky). */\n isDark?: 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, isDark }) => {\n const cdecli = useCdecliConnection();\n const { selectedGateway } = useGatewayContext();\n\n const gatewayStatus = mapCdecliStatus(cdecli.status);\n const gatewayLabel = cdecli.status === 'connecting' ? 'Checking...' : undefined;\n\n const deviceDark = useColorScheme() === 'dark';\n const gatewayName = selectedGateway?.name || 'Yantra';\n const [statusOpen, setStatusOpen] = useState(false);\n const openStatus = useCallback(() => setStatusOpen(true), []);\n const closeStatus = useCallback(() => setStatusOpen(false), []);\n\n return (\n <>\n <GatewayToolbarButtonMobile\n gatewayStatus={gatewayStatus}\n gatewayError={cdecli.error}\n onToggleGateway={openStatus}\n disabled={disabled}\n statusLabel={gatewayLabel}\n gatewayName={gatewayName}\n tone={tone}\n isDark={isDark}\n />\n <GatewayStatusSheet\n visible={statusOpen}\n status={gatewayStatus}\n name={gatewayName}\n isDark={deviceDark}\n onReconnect={cdecli.reconnect}\n onClose={closeStatus}\n />\n </>\n );\n};\n\nexport default React.memo(GatewayConnector);\n"],"names":["React"],"mappings":"8oBA6BA,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,KAAA;AAAA,EACX;AACF,CAAM,KAAA;AACJ,EAAA,MAAM,SAAS,mBAAoB,EAAA;AACnC,EAAM,MAAA;AAAA,IACJ;AAAA,MACE,iBAAkB,EAAA;AACtB,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,UAAA,GAAa,gBAAqB,KAAA,MAAA;AACxC,EAAM,MAAA,WAAA,GAAA,CAAc,mDAAiB,IAAQ,KAAA,QAAA;AAC7C,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,SAAS,KAAK,CAAA;AAClD,EAAA,MAAM,aAAa,WAAY,CAAA,MAAM,cAAc,IAAI,CAAA,EAAG,EAAE,CAAA;AAC5D,EAAA,MAAM,cAAc,WAAY,CAAA,MAAM,cAAc,KAAK,CAAA,EAAG,EAAE,CAAA;AAC9D,EAAA,uBACU,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,0BAA2B,EAAA,EAAA,aAAA,EAA8B,YAAc,EAAA,MAAA,CAAO,KAAO,EAAA,eAAA,EAAiB,UAAY,EAAA,QAAA,EAAoB,WAAa,EAAA,YAAA,EAAc,WAA0B,EAAA,IAAA,EAAY,MAAgB,EAAA,CAAA;AAAA,oBACvN,GAAA,CAAA,kBAAA,EAAA,EAAmB,OAAS,EAAA,UAAA,EAAY,QAAQ,aAAe,EAAA,IAAA,EAAM,WAAa,EAAA,MAAA,EAAQ,UAAY,EAAA,WAAA,EAAa,MAAO,CAAA,SAAA,EAAW,SAAS,WAAa,EAAA;AAAA,GAChK,EAAA,CAAA;AACR,CAAA;AACA,yBAAeA,cAAA,CAAM,KAAK,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import {jsx,jsxs}from'react/jsx-runtime';import {Modal,View,StyleSheet,Pressable,ActivityIndicator}from'react-native';import {MaterialCommunityIcons}from'@expo/vector-icons';import {Text}from'@admin-layout/gluestack-ui-mobile';import {useSafeAreaInsets}from'react-native-safe-area-context';import {mobileColors}from'../../theme/mobileTokens.js';var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
function gatewayStatusCopy(status, name) {
|
|
21
|
+
switch (status) {
|
|
22
|
+
case "connected":
|
|
23
|
+
return {
|
|
24
|
+
title: `${name} is connected`,
|
|
25
|
+
body: "Ready for whatever you ask next."
|
|
26
|
+
};
|
|
27
|
+
case "connecting":
|
|
28
|
+
return {
|
|
29
|
+
title: `Connecting to ${name}`,
|
|
30
|
+
body: "This usually takes a few seconds."
|
|
31
|
+
};
|
|
32
|
+
case "error":
|
|
33
|
+
return {
|
|
34
|
+
title: `Can't reach ${name} right now`,
|
|
35
|
+
body: "It keeps trying on its own. Check your connection, or try again now."
|
|
36
|
+
};
|
|
37
|
+
default:
|
|
38
|
+
return {
|
|
39
|
+
title: `${name} is not connected`,
|
|
40
|
+
body: "Connect to send messages from this phone."
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function statusTint(status, colors) {
|
|
45
|
+
if (status === "connected") return {
|
|
46
|
+
ink: colors.successText,
|
|
47
|
+
wash: colors.successSoft
|
|
48
|
+
};
|
|
49
|
+
if (status === "error") return {
|
|
50
|
+
ink: colors.dangerText,
|
|
51
|
+
wash: colors.dangerSoft
|
|
52
|
+
};
|
|
53
|
+
if (status === "connecting") return {
|
|
54
|
+
ink: colors.warningText,
|
|
55
|
+
wash: colors.warningSoft
|
|
56
|
+
};
|
|
57
|
+
return {
|
|
58
|
+
ink: colors.textMuted,
|
|
59
|
+
wash: colors.surfaceMuted
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function GatewayStatusSheet({
|
|
63
|
+
visible,
|
|
64
|
+
status,
|
|
65
|
+
name,
|
|
66
|
+
isDark,
|
|
67
|
+
onReconnect,
|
|
68
|
+
onClose
|
|
69
|
+
}) {
|
|
70
|
+
const colors = mobileColors(isDark);
|
|
71
|
+
const insets = useSafeAreaInsets();
|
|
72
|
+
const {
|
|
73
|
+
title,
|
|
74
|
+
body
|
|
75
|
+
} = gatewayStatusCopy(status, name);
|
|
76
|
+
const offline = status === "error" || status === "disconnected";
|
|
77
|
+
const tint = statusTint(status, colors);
|
|
78
|
+
return /* @__PURE__ */ jsx(Modal, { visible, transparent: true, animationType: "slide", onRequestClose: onClose, children: /* @__PURE__ */ jsxs(View, { style: styles.scrimWrap, children: [
|
|
79
|
+
/* @__PURE__ */ jsx(Pressable, { style: styles.scrim, onPress: onClose, accessibilityLabel: "Close" }),
|
|
80
|
+
/* @__PURE__ */ jsxs(View, { accessibilityViewIsModal: true, style: [styles.sheet, {
|
|
81
|
+
backgroundColor: colors.surface,
|
|
82
|
+
paddingBottom: Math.max(insets.bottom, 16) + 8
|
|
83
|
+
}], children: [
|
|
84
|
+
/* @__PURE__ */ jsx(View, { style: [styles.grabber, {
|
|
85
|
+
backgroundColor: colors.border
|
|
86
|
+
}] }),
|
|
87
|
+
/* @__PURE__ */ jsxs(View, { style: styles.head, children: [
|
|
88
|
+
/* @__PURE__ */ jsx(View, { style: [styles.badge, {
|
|
89
|
+
backgroundColor: tint.wash
|
|
90
|
+
}], children: status === "connecting" ? /* @__PURE__ */ jsx(ActivityIndicator, { size: "small", color: tint.ink }) : /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: status === "connected" ? "wifi" : "wifi-off", size: 20, color: tint.ink }) }),
|
|
91
|
+
/* @__PURE__ */ jsxs(View, { style: styles.flex, children: [
|
|
92
|
+
/* @__PURE__ */ jsx(Text, { accessibilityRole: "header", style: [styles.title, {
|
|
93
|
+
color: colors.text
|
|
94
|
+
}], children: title }),
|
|
95
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.body, {
|
|
96
|
+
color: colors.textMuted
|
|
97
|
+
}], children: body })
|
|
98
|
+
] }),
|
|
99
|
+
/* @__PURE__ */ jsx(Pressable, { onPress: onClose, hitSlop: 10, accessibilityRole: "button", accessibilityLabel: "Close", children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "close", size: 22, color: colors.textMuted }) })
|
|
100
|
+
] }),
|
|
101
|
+
offline ? /* @__PURE__ */ jsx(Pressable, { onPress: onReconnect, accessibilityRole: "button", style: ({
|
|
102
|
+
pressed
|
|
103
|
+
}) => [styles.action, {
|
|
104
|
+
backgroundColor: colors.primary
|
|
105
|
+
}, pressed && styles.pressed], children: /* @__PURE__ */ jsx(Text, { style: styles.actionText, children: "Try again" }) }) : null
|
|
106
|
+
] })
|
|
107
|
+
] }) });
|
|
108
|
+
}
|
|
109
|
+
const styles = StyleSheet.create({
|
|
110
|
+
scrimWrap: {
|
|
111
|
+
flex: 1,
|
|
112
|
+
justifyContent: "flex-end"
|
|
113
|
+
},
|
|
114
|
+
scrim: __spreadProps(__spreadValues({}, StyleSheet.absoluteFillObject), {
|
|
115
|
+
backgroundColor: "rgba(15,23,42,0.45)"
|
|
116
|
+
}),
|
|
117
|
+
sheet: {
|
|
118
|
+
width: "100%",
|
|
119
|
+
maxWidth: 560,
|
|
120
|
+
alignSelf: "center",
|
|
121
|
+
borderTopLeftRadius: 16,
|
|
122
|
+
borderTopRightRadius: 16
|
|
123
|
+
},
|
|
124
|
+
grabber: {
|
|
125
|
+
alignSelf: "center",
|
|
126
|
+
width: 36,
|
|
127
|
+
height: 4,
|
|
128
|
+
marginTop: 8,
|
|
129
|
+
borderRadius: 2
|
|
130
|
+
},
|
|
131
|
+
head: {
|
|
132
|
+
flexDirection: "row",
|
|
133
|
+
alignItems: "flex-start",
|
|
134
|
+
gap: 12,
|
|
135
|
+
paddingHorizontal: 20,
|
|
136
|
+
paddingTop: 14,
|
|
137
|
+
paddingBottom: 10
|
|
138
|
+
},
|
|
139
|
+
badge: {
|
|
140
|
+
width: 40,
|
|
141
|
+
height: 40,
|
|
142
|
+
borderRadius: 12,
|
|
143
|
+
alignItems: "center",
|
|
144
|
+
justifyContent: "center"
|
|
145
|
+
},
|
|
146
|
+
flex: {
|
|
147
|
+
flex: 1
|
|
148
|
+
},
|
|
149
|
+
title: {
|
|
150
|
+
fontSize: 17,
|
|
151
|
+
fontWeight: "700"
|
|
152
|
+
},
|
|
153
|
+
body: {
|
|
154
|
+
fontSize: 14,
|
|
155
|
+
lineHeight: 20,
|
|
156
|
+
marginTop: 2
|
|
157
|
+
},
|
|
158
|
+
action: {
|
|
159
|
+
marginHorizontal: 20,
|
|
160
|
+
marginTop: 8,
|
|
161
|
+
height: 48,
|
|
162
|
+
borderRadius: 12,
|
|
163
|
+
alignItems: "center",
|
|
164
|
+
justifyContent: "center"
|
|
165
|
+
},
|
|
166
|
+
actionText: {
|
|
167
|
+
color: "#ffffff",
|
|
168
|
+
fontSize: 16,
|
|
169
|
+
fontWeight: "700"
|
|
170
|
+
},
|
|
171
|
+
pressed: {
|
|
172
|
+
opacity: 0.8
|
|
173
|
+
}
|
|
174
|
+
});export{GatewayStatusSheet,gatewayStatusCopy};//# sourceMappingURL=GatewayStatusSheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GatewayStatusSheet.js","sources":["../../../src/components/GatewayConnector/GatewayStatusSheet.tsx"],"sourcesContent":["/**\n * What the header's Yantra pill opens: whether this phone is connected, in words, and a way to try\n * again when it is not. The connection itself is automatic (CdecliConnectionProvider), so there is\n * nothing to switch on or off here, only something to see and, when it failed, to retry.\n */\nimport React from 'react';\nimport { ActivityIndicator, Modal, Pressable, StyleSheet, View } from 'react-native';\nimport { MaterialCommunityIcons } from '@expo/vector-icons';\nimport { Text } from '@admin-layout/gluestack-ui-mobile';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport { mobileColors } from '../../theme/mobileTokens';\n\nexport type GatewaySheetStatus = 'connecting' | 'connected' | 'disconnected' | 'error';\n\nexport function gatewayStatusCopy(status: GatewaySheetStatus, name: string): { title: string; body: string } {\n switch (status) {\n case 'connected':\n return { title: `${name} is connected`, body: 'Ready for whatever you ask next.' };\n case 'connecting':\n return { title: `Connecting to ${name}`, body: 'This usually takes a few seconds.' };\n case 'error':\n return {\n title: `Can't reach ${name} right now`,\n body: 'It keeps trying on its own. Check your connection, or try again now.',\n };\n default:\n return { title: `${name} is not connected`, body: 'Connect to send messages from this phone.' };\n }\n}\n\nfunction statusTint(status: GatewaySheetStatus, colors: ReturnType<typeof mobileColors>) {\n if (status === 'connected') return { ink: colors.successText, wash: colors.successSoft };\n if (status === 'error') return { ink: colors.dangerText, wash: colors.dangerSoft };\n if (status === 'connecting') return { ink: colors.warningText, wash: colors.warningSoft };\n return { ink: colors.textMuted, wash: colors.surfaceMuted };\n}\n\nexport interface GatewayStatusSheetProps {\n visible: boolean;\n status: GatewaySheetStatus;\n name: string;\n isDark: boolean;\n onReconnect: () => void;\n onClose: () => void;\n}\n\nexport function GatewayStatusSheet({ visible, status, name, isDark, onReconnect, onClose }: GatewayStatusSheetProps) {\n const colors = mobileColors(isDark);\n const insets = useSafeAreaInsets();\n const { title, body } = gatewayStatusCopy(status, name);\n const offline = status === 'error' || status === 'disconnected';\n const tint = statusTint(status, colors);\n\n return (\n <Modal visible={visible} transparent animationType=\"slide\" onRequestClose={onClose}>\n <View style={styles.scrimWrap}>\n <Pressable style={styles.scrim} onPress={onClose} accessibilityLabel=\"Close\" />\n <View\n accessibilityViewIsModal\n style={[\n styles.sheet,\n { backgroundColor: colors.surface, paddingBottom: Math.max(insets.bottom, 16) + 8 },\n ]}\n >\n <View style={[styles.grabber, { backgroundColor: colors.border }]} />\n <View style={styles.head}>\n <View style={[styles.badge, { backgroundColor: tint.wash }]}>\n {status === 'connecting' ? (\n <ActivityIndicator size=\"small\" color={tint.ink} />\n ) : (\n <MaterialCommunityIcons\n name={status === 'connected' ? 'wifi' : 'wifi-off'}\n size={20}\n color={tint.ink}\n />\n )}\n </View>\n <View style={styles.flex}>\n <Text accessibilityRole=\"header\" style={[styles.title, { color: colors.text }]}>\n {title}\n </Text>\n <Text style={[styles.body, { color: colors.textMuted }]}>{body}</Text>\n </View>\n <Pressable onPress={onClose} hitSlop={10} accessibilityRole=\"button\" accessibilityLabel=\"Close\">\n <MaterialCommunityIcons name=\"close\" size={22} color={colors.textMuted} />\n </Pressable>\n </View>\n {offline ? (\n <Pressable\n onPress={onReconnect}\n accessibilityRole=\"button\"\n style={({ pressed }) => [\n styles.action,\n { backgroundColor: colors.primary },\n pressed && styles.pressed,\n ]}\n >\n <Text style={styles.actionText}>Try again</Text>\n </Pressable>\n ) : null}\n </View>\n </View>\n </Modal>\n );\n}\n\nconst styles = StyleSheet.create({\n scrimWrap: { flex: 1, justifyContent: 'flex-end' },\n scrim: { ...StyleSheet.absoluteFillObject, backgroundColor: 'rgba(15,23,42,0.45)' },\n sheet: {\n width: '100%',\n maxWidth: 560,\n alignSelf: 'center',\n borderTopLeftRadius: 16,\n borderTopRightRadius: 16,\n },\n grabber: { alignSelf: 'center', width: 36, height: 4, marginTop: 8, borderRadius: 2 },\n head: {\n flexDirection: 'row',\n alignItems: 'flex-start',\n gap: 12,\n paddingHorizontal: 20,\n paddingTop: 14,\n paddingBottom: 10,\n },\n badge: { width: 40, height: 40, borderRadius: 12, alignItems: 'center', justifyContent: 'center' },\n flex: { flex: 1 },\n title: { fontSize: 17, fontWeight: '700' },\n body: { fontSize: 14, lineHeight: 20, marginTop: 2 },\n action: {\n marginHorizontal: 20,\n marginTop: 8,\n height: 48,\n borderRadius: 12,\n alignItems: 'center',\n justifyContent: 'center',\n },\n actionText: { color: '#ffffff', fontSize: 16, fontWeight: '700' },\n pressed: { opacity: 0.8 },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAYgB,SAAA,iBAAA,CAAkB,QAA4B,IAG5D,EAAA;AACA,EAAA,QAAQ,MAAQ;AAAA,IACd,KAAK,WAAA;AACH,MAAO,OAAA;AAAA,QACL,KAAA,EAAO,GAAG,IAAI,CAAA,aAAA,CAAA;AAAA,QACd,IAAM,EAAA;AAAA,OACR;AAAA,IACF,KAAK,YAAA;AACH,MAAO,OAAA;AAAA,QACL,KAAA,EAAO,iBAAiB,IAAI,CAAA,CAAA;AAAA,QAC5B,IAAM,EAAA;AAAA,OACR;AAAA,IACF,KAAK,OAAA;AACH,MAAO,OAAA;AAAA,QACL,KAAA,EAAO,eAAe,IAAI,CAAA,UAAA,CAAA;AAAA,QAC1B,IAAM,EAAA;AAAA,OACR;AAAA,IACF;AACE,MAAO,OAAA;AAAA,QACL,KAAA,EAAO,GAAG,IAAI,CAAA,iBAAA,CAAA;AAAA,QACd,IAAM,EAAA;AAAA,OACR;AAAA;AAEN;AACA,SAAS,UAAA,CAAW,QAA4B,MAAyC,EAAA;AACvF,EAAI,IAAA,MAAA,KAAW,aAAoB,OAAA;AAAA,IACjC,KAAK,MAAO,CAAA,WAAA;AAAA,IACZ,MAAM,MAAO,CAAA;AAAA,GACf;AACA,EAAI,IAAA,MAAA,KAAW,SAAgB,OAAA;AAAA,IAC7B,KAAK,MAAO,CAAA,UAAA;AAAA,IACZ,MAAM,MAAO,CAAA;AAAA,GACf;AACA,EAAI,IAAA,MAAA,KAAW,cAAqB,OAAA;AAAA,IAClC,KAAK,MAAO,CAAA,WAAA;AAAA,IAC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,GAAK,EAAA,EAAA;AAAA,IACL,iBAAmB,EAAA,EAAA;AAAA,IACnB,UAAY,EAAA,EAAA;AAAA,IACZ,aAAe,EAAA;AAAA,GACjB;AAAA,EACA,KAAO,EAAA;AAAA,IACL,KAAO,EAAA,EAAA;AAAA,IACP,MAAQ,EAAA,EAAA;AAAA,IACR,YAAc,EAAA,EAAA;AAAA,IACd,UAAY,EAAA,QAAA;AAAA,IACZ,cAAgB,EAAA;AAAA,GAClB;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,IAAM,EAAA;AAAA,GACR;AAAA,EACA,KAAO,EAAA;AAAA,IACL,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA;AAAA,GACd;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,EAAA;AAAA,IACZ,SAAW,EAAA;AAAA,GACb;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,gBAAkB,EAAA,EAAA;AAAA,IAClB,SAAW,EAAA,CAAA;AAAA,IACX,MAAQ,EAAA,EAAA;AAAA,IACR,YAAc,EAAA,EAAA;AAAA,IACd,UAAY,EAAA,QAAA;AAAA,IACZ,cAAgB,EAAA;AAAA,GAClB;AAAA,EACA,UAAY,EAAA;AAAA,IACV,KAAO,EAAA,SAAA;AAAA,IACP,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA;AAAA,GACd;AAAA,EACA,OAAS,EAAA;AAAA,IACP,OAAS,EAAA;AAAA;AAEb,CAAC,CAAA"}
|
|
@@ -6,9 +6,13 @@ import {jsx,jsxs}from'react/jsx-runtime';import {useColorScheme,View,StyleSheet,
|
|
|
6
6
|
if (status === "error") return isDark ? "#f87171" : "#dc2626";
|
|
7
7
|
return isDark ? "#94a3b8" : "#64748b";
|
|
8
8
|
}
|
|
9
|
+
function pillTitle(status, name) {
|
|
10
|
+
if (status === "connected") return `${name} is connected. Show status`;
|
|
11
|
+
if (status === "connecting") return `Connecting to ${name}. Show status`;
|
|
12
|
+
return `${name} is not connected. Show status`;
|
|
13
|
+
}
|
|
9
14
|
function GatewayToolbarButtonMobile({
|
|
10
15
|
gatewayStatus,
|
|
11
|
-
gatewayError,
|
|
12
16
|
onToggleGateway,
|
|
13
17
|
disabled,
|
|
14
18
|
statusLabel,
|
|
@@ -20,7 +24,7 @@ function GatewayToolbarButtonMobile({
|
|
|
20
24
|
const isDark = isDarkProp != null ? isDarkProp : deviceDark;
|
|
21
25
|
const color = iconColor(gatewayStatus, tone, isDark);
|
|
22
26
|
const labelColor = isDark ? "#e2e8f0" : mobileTokens.color.text;
|
|
23
|
-
const mainTitle = gatewayStatus
|
|
27
|
+
const mainTitle = pillTitle(gatewayStatus, gatewayName);
|
|
24
28
|
return /* @__PURE__ */ jsx(View, { style: styles.wrap, children: /* @__PURE__ */ jsxs(Pressable, { onPress: onToggleGateway, disabled, accessibilityLabel: mainTitle, style: ({
|
|
25
29
|
pressed
|
|
26
30
|
}) => [styles.mainBtn, pressed && styles.pressed, disabled && styles.disabled], children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GatewayToolbarButtonMobile.js","sources":["../../src/components/GatewayToolbarButtonMobile.tsx"],"sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"file":"GatewayToolbarButtonMobile.js","sources":["../../src/components/GatewayToolbarButtonMobile.tsx"],"sourcesContent":["/**\n * The header's connection status, named for the selected gateway. On a phone the connection is\n * automatic, so tapping it shows the status (GatewayStatusSheet) rather than toggling it.\n *\n * Connection state lives in the icon color (green / amber / red), not a filled\n * pill. The label is the selected gateway name (\"Yantra\"), same as the browser.\n */\n\nimport React from 'react';\nimport { ActivityIndicator, Pressable, StyleSheet, Text, View, useColorScheme } from 'react-native';\nimport { MaterialCommunityIcons } from '@expo/vector-icons';\nimport { mobileTokens } from '../theme/mobileTokens';\n\nexport type GatewayToolbarMobileStatus = 'connected' | 'connecting' | 'disconnected' | 'error';\n\nexport interface GatewayToolbarButtonMobileProps {\n /** Overrides the device scheme, for a bar with its own ink. */\n isDark?: boolean;\n gatewayStatus: GatewayToolbarMobileStatus;\n gatewayError?: string | null;\n onToggleGateway: () => void;\n disabled?: boolean;\n /** Replaces the gateway name, e.g. \"Checking...\" */\n statusLabel?: string;\n /** Selected gateway display name from the registry. */\n gatewayName?: string;\n /** Visual override when workspace (not link status) is provisioning / error */\n tone?: 'default' | 'provisioning' | 'workspace-error';\n}\n\nfunction iconColor(status: GatewayToolbarMobileStatus, tone: GatewayToolbarButtonMobileProps['tone'], isDark: boolean) {\n if (tone === 'provisioning') return isDark ? '#60a5fa' : '#2563eb';\n if (tone === 'workspace-error') return mobileTokens.color.dangerText;\n if (status === 'connected') return isDark ? '#4ade80' : '#16a34a';\n if (status === 'connecting') return isDark ? '#fbbf24' : '#ca8a04';\n if (status === 'error') return isDark ? '#f87171' : '#dc2626';\n return isDark ? '#94a3b8' : '#64748b';\n}\n\nfunction pillTitle(status: GatewayToolbarMobileStatus, name: string): string {\n if (status === 'connected') return `${name} is connected. Show status`;\n if (status === 'connecting') return `Connecting to ${name}. Show status`;\n return `${name} is not connected. Show status`;\n}\n\nexport function GatewayToolbarButtonMobile({\n gatewayStatus,\n onToggleGateway,\n disabled,\n statusLabel,\n gatewayName = 'Yantra',\n tone = 'default',\n isDark: isDarkProp,\n}: GatewayToolbarButtonMobileProps) {\n const deviceDark = useColorScheme() === 'dark';\n const isDark = isDarkProp ?? deviceDark;\n const color = iconColor(gatewayStatus, tone, isDark);\n const labelColor = isDark ? '#e2e8f0' : mobileTokens.color.text;\n\n const mainTitle = pillTitle(gatewayStatus, gatewayName);\n\n return (\n <View style={styles.wrap}>\n <Pressable\n onPress={onToggleGateway}\n disabled={disabled}\n accessibilityLabel={mainTitle}\n style={({ pressed }) => [styles.mainBtn, pressed && styles.pressed, disabled && styles.disabled]}\n >\n {gatewayStatus === 'connecting' ? (\n <ActivityIndicator size=\"small\" color={color} />\n ) : (\n <MaterialCommunityIcons\n name={gatewayStatus === 'connected' ? 'wifi' : 'wifi-off'}\n size={16}\n color={color}\n />\n )}\n <Text style={[styles.label, { color: labelColor }]}>{statusLabel ?? gatewayName}</Text>\n </Pressable>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n wrap: { flexShrink: 0 },\n mainBtn: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 4,\n height: 36,\n paddingHorizontal: 6,\n borderRadius: 10,\n justifyContent: 'flex-start',\n },\n pressed: { opacity: 0.7 },\n disabled: { opacity: 0.45 },\n label: { fontSize: 13, fontWeight: '600', letterSpacing: -0.2 },\n});\n"],"names":[],"mappings":"gPA2BA,SAAS,SAAA,CAAU,MAAoC,EAAA,IAAA,EAA+C,MAAiB,EAAA;AACrH,EAAA,IAAI,IAAS,KAAA,cAAA,EAAuB,OAAA,MAAA,GAAS,SAAY,GAAA,SAAA;AACzD,EAAA,IAAI,IAAS,KAAA,iBAAA,EAA0B,OAAA,YAAA,CAAa,KAAM,CAAA,UAAA;AAC1D,EAAA,IAAI,MAAW,KAAA,WAAA,EAAoB,OAAA,MAAA,GAAS,SAAY,GAAA,SAAA;AACxD,EAAA,IAAI,MAAW,KAAA,YAAA,EAAqB,OAAA,MAAA,GAAS,SAAY,GAAA,SAAA;AACzD,EAAA,IAAI,MAAW,KAAA,OAAA,EAAgB,OAAA,MAAA,GAAS,SAAY,GAAA,SAAA;AACpD,EAAA,OAAO,SAAS,SAAY,GAAA,SAAA;AAC9B;AACA,SAAS,SAAA,CAAU,QAAoC,IAAsB,EAAA;AAC3E,EAAA,IAAI,MAAW,KAAA,WAAA,EAAoB,OAAA,CAAA,EAAG,IAAI,CAAA,0BAAA,CAAA;AAC1C,EAAA,IAAI,MAAW,KAAA,YAAA,EAAqB,OAAA,CAAA,cAAA,EAAiB,IAAI,CAAA,aAAA,CAAA;AACzD,EAAA,OAAO,GAAG,IAAI,CAAA,8BAAA,CAAA;AAChB;AACO,SAAS,0BAA2B,CAAA;AAAA,EACzC,aAAA;AAAA,EACA,eAAA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A,WAAA,GAAe,WAAY,EAAA;AAAA,GAAA,EAC1B,CACJ,EAAA,CAAA;AACR;AACA,MAAM,MAAA,GAAS,WAAW,MAAO,CAAA;AAAA,EAC/B,IAAM,EAAA;AAAA,IACJ,UAAY,EAAA;AAAA,GACd;AAAA,EACA,OAAS,EAAA;AAAA,IACP,aAAe,EAAA,KAAA;AAAA,IACf,UAAY,EAAA,QAAA;AAAA,IACZ,GAAK,EAAA,CAAA;AAAA,IACL,MAAQ,EAAA,EAAA;AAAA,IACR,iBAAmB,EAAA,CAAA;AAAA,IACnB,YAAc,EAAA,EAAA;AAAA,IACd,cAAgB,EAAA;AAAA,GAClB;AAAA,EACA,OAAS,EAAA;AAAA,IACP,OAAS,EAAA;AAAA,GACX;AAAA,EACA,QAAU,EAAA;AAAA,IACR,OAAS,EAAA;AAAA,GACX;AAAA,EACA,KAAO,EAAA;AAAA,IACL,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,KAAA;AAAA,IACZ,aAAe,EAAA;AAAA;AAEnB,CAAC,CAAA"}
|
package/lib/compute.js
CHANGED
|
@@ -1296,6 +1296,56 @@ const yantraMobilePageStore = [{
|
|
|
1296
1296
|
},
|
|
1297
1297
|
componentPath: "@adminide-stack/yantra-mobile/lib/screens/DictateNative/index.js",
|
|
1298
1298
|
hasComponent: true
|
|
1299
|
+
}, {
|
|
1300
|
+
key: "games-native",
|
|
1301
|
+
path: "/:orgName/c/games-native",
|
|
1302
|
+
name: "GamesNative",
|
|
1303
|
+
exact: true,
|
|
1304
|
+
priority: 4,
|
|
1305
|
+
hideInMenu: true,
|
|
1306
|
+
auth: true,
|
|
1307
|
+
menu_position: "side",
|
|
1308
|
+
// Yantra Games draws its own per-screen headers; without a customHeader the
|
|
1309
|
+
// stack draws its default one on top.
|
|
1310
|
+
importPaths: {
|
|
1311
|
+
navigationHeader: "@adminide-stack/yantra-mobile/lib/components/NavigationHeader/NavigationHeader.js"
|
|
1312
|
+
},
|
|
1313
|
+
customHeader: {
|
|
1314
|
+
name: "NavigationHeader",
|
|
1315
|
+
component: "$.importPaths.navigationHeader",
|
|
1316
|
+
props: {
|
|
1317
|
+
showTitle: true,
|
|
1318
|
+
showToggle: false,
|
|
1319
|
+
showFilter: false,
|
|
1320
|
+
isSearchBack: false,
|
|
1321
|
+
showBack: true,
|
|
1322
|
+
showGateway: false,
|
|
1323
|
+
showHistory: false,
|
|
1324
|
+
showNewChat: false
|
|
1325
|
+
}
|
|
1326
|
+
},
|
|
1327
|
+
props: {
|
|
1328
|
+
// Yantra Games draws its own header per screen.
|
|
1329
|
+
initialParams: {
|
|
1330
|
+
orgName: null,
|
|
1331
|
+
hideNavigationHeader: true
|
|
1332
|
+
},
|
|
1333
|
+
options: {
|
|
1334
|
+
title: "Games",
|
|
1335
|
+
drawerItemStyle: {
|
|
1336
|
+
display: "none"
|
|
1337
|
+
},
|
|
1338
|
+
headerTitleAlign: "left",
|
|
1339
|
+
gestureEnabled: false,
|
|
1340
|
+
swipeEnabled: false,
|
|
1341
|
+
animation: "fade",
|
|
1342
|
+
animationTypeForReplace: "pop",
|
|
1343
|
+
keyboardHandlingEnabled: false,
|
|
1344
|
+
freezeOnBlur: true
|
|
1345
|
+
}
|
|
1346
|
+
},
|
|
1347
|
+
componentPath: "@adminide-stack/yantra-mobile/lib/screens/GamesNative/index.js",
|
|
1348
|
+
hasComponent: true
|
|
1299
1349
|
}, {
|
|
1300
1350
|
key: "webbuilder-native",
|
|
1301
1351
|
path: "/:orgName/c/webbuilder-native",
|
|
@@ -1458,6 +1508,6 @@ const yantraMobilePageStore = [{
|
|
|
1458
1508
|
componentPath: "@adminide-stack/yantra-mobile/lib/screens/TravelNative/index.js",
|
|
1459
1509
|
hasComponent: true
|
|
1460
1510
|
}];
|
|
1461
|
-
const selectedRoutes = ["home", "chat", "account", "health", "devices", "chathistory", "apps", "discover", "discover-article", "notion", "notion-page", "webbuilder", "canvas-native", "characters-native", "chat-native", "shopping-native", "travel-native", "job-search-native", "resume-native", "inbox-native", "study-native", "local-services-native", "movies-native", "expenses-native", "dictate-native", "webbuilder-native", "design-native"];
|
|
1511
|
+
const selectedRoutes = ["home", "chat", "account", "health", "devices", "chathistory", "apps", "discover", "discover-article", "notion", "notion-page", "webbuilder", "canvas-native", "characters-native", "chat-native", "shopping-native", "travel-native", "job-search-native", "resume-native", "inbox-native", "study-native", "local-services-native", "movies-native", "expenses-native", "dictate-native", "webbuilder-native", "design-native", "games-native"];
|
|
1462
1512
|
const filteredRoutes = getFilteredRoutes(yantraMobilePageStore, selectedRoutes);
|
|
1463
1513
|
export { filteredRoutes, yantraMobilePageStore }; //# sourceMappingURL=compute.js.map
|