@adminide-stack/yantra-mobile 12.0.179 → 12.0.181

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 (56) hide show
  1. package/lib/features/computer/computerChat.js +4 -1
  2. package/lib/features/computer/computerChat.js.map +1 -1
  3. package/lib/features/webbuilder/WebBuilderExperience.js +205 -31
  4. package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
  5. package/lib/features/webbuilder/components/GithubConnectSheet.js +159 -0
  6. package/lib/features/webbuilder/components/GithubConnectSheet.js.map +1 -0
  7. package/lib/features/webbuilder/components/ProjectSheets.js +3 -1
  8. package/lib/features/webbuilder/components/ProjectSheets.js.map +1 -1
  9. package/lib/features/webbuilder/components/ProjectsScreen.js +122 -23
  10. package/lib/features/webbuilder/components/ProjectsScreen.js.map +1 -1
  11. package/lib/features/webbuilder/components/ShareSheet.js +144 -4
  12. package/lib/features/webbuilder/components/ShareSheet.js.map +1 -1
  13. package/lib/features/webbuilder/components/SiteUploadSheet.js +92 -3
  14. package/lib/features/webbuilder/components/SiteUploadSheet.js.map +1 -1
  15. package/lib/features/webbuilder/components/TemplateCard.js +33 -3
  16. package/lib/features/webbuilder/components/TemplateCard.js.map +1 -1
  17. package/lib/features/webbuilder/components/TemplatesSheet.js +54 -15
  18. package/lib/features/webbuilder/components/TemplatesSheet.js.map +1 -1
  19. package/lib/features/webbuilder/projectsList.js +117 -0
  20. package/lib/features/webbuilder/projectsList.js.map +1 -0
  21. package/lib/features/webbuilder/templateCatalog.js +13 -1
  22. package/lib/features/webbuilder/templateCatalog.js.map +1 -1
  23. package/lib/features/webbuilder/uploadCard.js +169 -0
  24. package/lib/features/webbuilder/uploadCard.js.map +1 -0
  25. package/lib/features/webbuilder/web/github/autoSync.js +1 -1
  26. package/lib/features/webbuilder/web/github/autoSync.js.map +1 -1
  27. package/lib/features/webbuilder/web/github/githubConnect.js +179 -0
  28. package/lib/features/webbuilder/web/github/githubConnect.js.map +1 -0
  29. package/lib/features/webbuilder/web/github/githubConnectApi.js +102 -0
  30. package/lib/features/webbuilder/web/github/githubConnectApi.js.map +1 -0
  31. package/lib/features/webbuilder/web/history/versions.js.map +1 -1
  32. package/lib/features/webbuilder/web/sharing/roles.js +50 -4
  33. package/lib/features/webbuilder/web/sharing/roles.js.map +1 -1
  34. package/lib/features/webbuilder/web/sharing/sharingApi.js +97 -6
  35. package/lib/features/webbuilder/web/sharing/sharingApi.js.map +1 -1
  36. package/lib/features/webbuilder/web/state/storageKeys.js +2 -0
  37. package/lib/features/webbuilder/web/state/storageKeys.js.map +1 -1
  38. package/lib/features/webbuilder/web/upload/sitePhotos.js +256 -2
  39. package/lib/features/webbuilder/web/upload/sitePhotos.js.map +1 -1
  40. package/lib/features/webbuilder/web/webServices.js +13 -1
  41. package/lib/features/webbuilder/web/webServices.js.map +1 -1
  42. package/lib/screens/ChatHistory/index.js +2 -2
  43. package/lib/screens/ChatHistory/index.js.map +1 -1
  44. package/lib/screens/ComputerNative/useComputerHostChat.js +7 -3
  45. package/lib/screens/ComputerNative/useComputerHostChat.js.map +1 -1
  46. package/lib/screens/WebBuilder/nativeWebBuilderRedirect.js +11 -3
  47. package/lib/screens/WebBuilder/nativeWebBuilderRedirect.js.map +1 -1
  48. package/lib/screens/WebBuilderNative/index.js +43 -10
  49. package/lib/screens/WebBuilderNative/index.js.map +1 -1
  50. package/lib/screens/WebBuilderNative/runningBuilds.js +44 -2
  51. package/lib/screens/WebBuilderNative/runningBuilds.js.map +1 -1
  52. package/lib/screens/WebBuilderNative/useConnectorTemplates.js +12 -3
  53. package/lib/screens/WebBuilderNative/useConnectorTemplates.js.map +1 -1
  54. package/lib/screens/WebBuilderNative/useWebBuilderHost.js +2 -0
  55. package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -1
  56. package/package.json +2 -2
@@ -27,6 +27,9 @@ const COMPUTER_CONTEXT_SUFFIX_RE = /\s*\((?:Use the yantra-computer connector|No
27
27
  function stripComputerInstrumentation(content) {
28
28
  return content.replace(ACTIVE_CONNECTORS_PREFIX_RE, "").replace(COMPUTER_CONTEXT_SUFFIX_RE, "").trim();
29
29
  }
30
+ function separateRunOnSentences(content) {
31
+ return content.replace(/([a-zà-ÿ)\]"'’”][.!?…])(?=[A-Z][a-z'’ ])/g, "$1\n\n");
32
+ }
30
33
  function tokenSubject(token) {
31
34
  var _a;
32
35
  try {
@@ -39,4 +42,4 @@ function tokenSubject(token) {
39
42
  } catch (e) {
40
43
  return "";
41
44
  }
42
- }export{COMPUTER_EMPTY_BODY,COMPUTER_EMPTY_TITLE,COMPUTER_PLACEHOLDER,COMPUTER_SUGGESTIONS,composeComputerTurn,computerContext,stripComputerInstrumentation,tokenSubject};//# sourceMappingURL=computerChat.js.map
45
+ }export{COMPUTER_EMPTY_BODY,COMPUTER_EMPTY_TITLE,COMPUTER_PLACEHOLDER,COMPUTER_SUGGESTIONS,composeComputerTurn,computerContext,separateRunOnSentences,stripComputerInstrumentation,tokenSubject};//# sourceMappingURL=computerChat.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"computerChat.js","sources":["../../../src/features/computer/computerChat.ts"],"sourcesContent":["/**\n * What the Computer's agent pane SAYS - native twin of the web surface's\n * `chat/ComputerChatPane.tsx` copy and steering. The pane itself is the shared\n * NativeAgentChat over the host's gateway chat (useComputerHostChat).\n *\n * Every turn is told WHICH computer it works on. The workspace id is the whole\n * address of the machine - without it the agent resolves or creates one on its\n * own and can land on a different computer than the page the person watches.\n *\n * Pure: no React Native imports.\n */\nimport type { AgentChatSuggestion } from '../agent-chat';\n\n/** Skills a dispatched computer turn runs with on the web (the registry's `computer` routing). */\nexport const COMPUTER_SKILLS = ['yantra-computer', 'yantra-skills/cdecli-connector-skill'] as const;\n\nexport const COMPUTER_SUGGESTIONS: AgentChatSuggestion[] = [\n { id: 'read-page', label: 'Read a page', prompt: 'Open example.com and tell me what the page says.' },\n {\n id: 'check-login',\n label: 'Check a login',\n prompt: 'Open the site I logged into and tell me whether I am still signed in.',\n },\n {\n id: 'on-screen',\n label: \"What's on screen\",\n prompt: 'Read the current page and list what I can click or type into.',\n },\n];\n\nexport const COMPUTER_EMPTY_TITLE = 'Ask, and the computer does it';\nexport const COMPUTER_EMPTY_BODY =\n 'The agent drives this Computer - the same browser, terminal and files you see here.';\nexport const COMPUTER_PLACEHOLDER = 'Ask the computer to do something…';\n\n/** The steering a turn carries for the agent: which machine, and to ask with AskUserQuestion. */\nexport function computerContext(workspaceId: string): string {\n return workspaceId\n ? `(Use the yantra-computer connector against workspaceId ${workspaceId}. When you need the user to choose or confirm something - a value, which option, whether to proceed - ask with AskUserQuestion so it renders as a choice, rather than in prose.)`\n : \"(No computer has been started yet. Use the yantra-computer connector, resolving or creating this user's workspace first. When you need the user to choose or confirm something, ask with AskUserQuestion.)\";\n}\n\n/** A turn as it goes to the agent: the person's words, then the steering. */\nexport function composeComputerTurn(text: string, workspaceId: string): string {\n return `${text}\\n\\n${computerContext(workspaceId)}`;\n}\n\nconst ACTIVE_CONNECTORS_PREFIX_RE = /^\\s*\\[Active connectors:[^\\]]*\\]\\s*/i;\nconst COMPUTER_CONTEXT_SUFFIX_RE =\n /\\s*\\((?:Use the yantra-computer connector|No computer has been started)[\\s\\S]*\\)\\s*$/;\n\n/** The person's own words: the routing prefix and the steering peeled off what the transcript shows. */\nexport function stripComputerInstrumentation(content: string): string {\n return content.replace(ACTIVE_CONNECTORS_PREFIX_RE, '').replace(COMPUTER_CONTEXT_SUFFIX_RE, '').trim();\n}\n\n/** Turn a tool call into the one line worth showing while it runs. */\nexport function describeToolCall(name: string): string {\n switch (/YANTRA_COMPUTER_([A-Z_]+)/.exec(name)?.[1]) {\n case 'CREATE':\n return 'Starting the computer…';\n case 'BROWSE':\n return 'Opening a page…';\n case 'READ_PAGE':\n return 'Reading the page…';\n case 'ACT':\n return 'Clicking and typing…';\n case 'INPUT':\n return 'Using the browser…';\n case 'SCREENSHOT':\n return 'Looking at the screen…';\n case 'EXEC':\n return 'Running a command…';\n case 'READ_FILE':\n case 'WRITE_FILE':\n return 'Working with files…';\n default:\n return `Working${name ? ` - ${name.split('/').pop()?.replace(/_/g, ' ').toLowerCase()}` : ''}…`;\n }\n}\n\n/** The account a token belongs to: its `sub`. The Computer is derived from it (the web's identity.ts). */\nexport function tokenSubject(token: string | null | undefined): string {\n try {\n const payload = token?.split('.')[1];\n if (!payload) return '';\n const padded = payload.replace(/-/g, '+').replace(/_/g, '/');\n const claims = JSON.parse(atob(padded + '='.repeat((4 - (padded.length % 4)) % 4))) as { sub?: unknown };\n const sub = String(claims.sub ?? '').trim();\n // 'default' is a placeholder identity a per-user agent rejects outright.\n return sub === 'default' ? '' : sub;\n } catch {\n return '';\n }\n}\n"],"names":[],"mappings":"AAeO,MAAM,uBAA8C,CAAC;AAAA,EAC1D,EAAI,EAAA,WAAA;AAAA,EACJ,KAAO,EAAA,aAAA;AAAA,EACP,MAAQ,EAAA;AACV,CAAG,EAAA;AAAA,EACD,EAAI,EAAA,aAAA;AAAA,EACJ,KAAO,EAAA,eAAA;AAAA,EACP,MAAQ,EAAA;AACV,CAAG,EAAA;AAAA,EACD,EAAI,EAAA,WAAA;AAAA,EACJ,KAAO,EAAA,kBAAA;AAAA,EACP,MAAQ,EAAA;AACV,CAAC;AACM,MAAM,oBAAuB,GAAA;AAC7B,MAAM,mBAAsB,GAAA;AAC5B,MAAM,oBAAuB,GAAA;AAG7B,SAAS,gBAAgB,WAA6B,EAAA;AAC3D,EAAO,OAAA,WAAA,GAAc,CAA0D,uDAAA,EAAA,WAAW,CAAqL,gLAAA,CAAA,GAAA,4MAAA;AACjR;AAGgB,SAAA,mBAAA,CAAoB,MAAc,WAA6B,EAAA;AAC7E,EAAA,OAAO,GAAG,IAAI;;AAAA,EAAO,eAAA,CAAgB,WAAW,CAAC,CAAA,CAAA;AACnD;AACA,MAAM,2BAA8B,GAAA,sCAAA;AACpC,MAAM,0BAA6B,GAAA,sFAAA;AAG5B,SAAS,6BAA6B,OAAyB,EAAA;AACpE,EAAO,OAAA,OAAA,CAAQ,QAAQ,2BAA6B,EAAA,EAAE,EAAE,OAAQ,CAAA,0BAAA,EAA4B,EAAE,CAAA,CAAE,IAAK,EAAA;AACvG;AA4BO,SAAS,aAAa,KAA0C,EAAA;AA3EvE,EAAA,IAAA,EAAA;AA4EE,EAAI,IAAA;AACF,IAAM,MAAA,OAAA,GAAU,KAAO,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,KAAA,CAAA,KAAA,CAAM,GAAK,CAAA,CAAA,CAAA,CAAA;AAClC,IAAI,IAAA,CAAC,SAAgB,OAAA,EAAA;AACrB,IAAM,MAAA,MAAA,GAAS,QAAQ,OAAQ,CAAA,IAAA,EAAM,GAAG,CAAE,CAAA,OAAA,CAAQ,MAAM,GAAG,CAAA;AAC3D,IAAA,MAAM,MAAS,GAAA,IAAA,CAAK,KAAM,CAAA,IAAA,CAAK,MAAS,GAAA,GAAA,CAAI,MAAQ,CAAA,CAAA,CAAA,GAAI,MAAO,CAAA,MAAA,GAAS,CAAK,IAAA,CAAC,CAAC,CAAC,CAAA;AAGhF,IAAA,MAAM,MAAM,MAAO,CAAA,CAAA,EAAA,GAAA,MAAA,CAAO,QAAP,IAAc,GAAA,EAAA,GAAA,EAAE,EAAE,IAAK,EAAA;AAE1C,IAAO,OAAA,GAAA,KAAQ,YAAY,EAAK,GAAA,GAAA;AAAA,GAC1B,CAAA,OAAA,CAAA,EAAA;AACN,IAAO,OAAA,EAAA;AAAA;AAEX"}
1
+ {"version":3,"file":"computerChat.js","sources":["../../../src/features/computer/computerChat.ts"],"sourcesContent":["/**\n * What the Computer's agent pane SAYS - native twin of the web surface's\n * `chat/ComputerChatPane.tsx` copy and steering. The pane itself is the shared\n * NativeAgentChat over the host's gateway chat (useComputerHostChat).\n *\n * Every turn is told WHICH computer it works on. The workspace id is the whole\n * address of the machine - without it the agent resolves or creates one on its\n * own and can land on a different computer than the page the person watches.\n *\n * Pure: no React Native imports.\n */\nimport type { AgentChatSuggestion } from '../agent-chat';\n\n/** Skills a dispatched computer turn runs with on the web (the registry's `computer` routing). */\nexport const COMPUTER_SKILLS = ['yantra-computer', 'yantra-skills/cdecli-connector-skill'] as const;\n\nexport const COMPUTER_SUGGESTIONS: AgentChatSuggestion[] = [\n { id: 'read-page', label: 'Read a page', prompt: 'Open example.com and tell me what the page says.' },\n {\n id: 'check-login',\n label: 'Check a login',\n prompt: 'Open the site I logged into and tell me whether I am still signed in.',\n },\n {\n id: 'on-screen',\n label: \"What's on screen\",\n prompt: 'Read the current page and list what I can click or type into.',\n },\n];\n\nexport const COMPUTER_EMPTY_TITLE = 'Ask, and the computer does it';\nexport const COMPUTER_EMPTY_BODY =\n 'The agent drives this Computer - the same browser, terminal and files you see here.';\nexport const COMPUTER_PLACEHOLDER = 'Ask the computer to do something…';\n\n/** The steering a turn carries for the agent: which machine, and to ask with AskUserQuestion. */\nexport function computerContext(workspaceId: string): string {\n return workspaceId\n ? `(Use the yantra-computer connector against workspaceId ${workspaceId}. When you need the user to choose or confirm something - a value, which option, whether to proceed - ask with AskUserQuestion so it renders as a choice, rather than in prose.)`\n : \"(No computer has been started yet. Use the yantra-computer connector, resolving or creating this user's workspace first. When you need the user to choose or confirm something, ask with AskUserQuestion.)\";\n}\n\n/** A turn as it goes to the agent: the person's words, then the steering. */\nexport function composeComputerTurn(text: string, workspaceId: string): string {\n return `${text}\\n\\n${computerContext(workspaceId)}`;\n}\n\nconst ACTIVE_CONNECTORS_PREFIX_RE = /^\\s*\\[Active connectors:[^\\]]*\\]\\s*/i;\nconst COMPUTER_CONTEXT_SUFFIX_RE =\n /\\s*\\((?:Use the yantra-computer connector|No computer has been started)[\\s\\S]*\\)\\s*$/;\n\n/** The person's own words: the routing prefix and the steering peeled off what the transcript shows. */\nexport function stripComputerInstrumentation(content: string): string {\n return content.replace(ACTIVE_CONNECTORS_PREFIX_RE, '').replace(COMPUTER_CONTEXT_SUFFIX_RE, '').trim();\n}\n\n/**\n * The agent's reply as the person reads it. A computer turn speaks in short\n * status lines between its tool calls (\"I'll look up…\", \"Your Computer is\n * ready…\"), and the stream hands them over back to back with nothing between\n * them - \"now.I'll search…region.Your Computer is ready\". Each line that runs\n * straight on from the last one's full stop starts its own paragraph.\n *\n * Only a lowercase letter or a closing bracket/quote before the stop counts,\n * and only a capital that starts a word after it - so \"U.S.\", \"e.g.\", \"3.5\"\n * and \"example.com\" are left alone.\n */\nexport function separateRunOnSentences(content: string): string {\n return content.replace(/([a-zà-ÿ)\\]\"'’”][.!?…])(?=[A-Z][a-z'’ ])/g, '$1\\n\\n');\n}\n\n/** Turn a tool call into the one line worth showing while it runs. */\nexport function describeToolCall(name: string): string {\n switch (/YANTRA_COMPUTER_([A-Z_]+)/.exec(name)?.[1]) {\n case 'CREATE':\n return 'Starting the computer…';\n case 'BROWSE':\n return 'Opening a page…';\n case 'READ_PAGE':\n return 'Reading the page…';\n case 'ACT':\n return 'Clicking and typing…';\n case 'INPUT':\n return 'Using the browser…';\n case 'SCREENSHOT':\n return 'Looking at the screen…';\n case 'EXEC':\n return 'Running a command…';\n case 'READ_FILE':\n case 'WRITE_FILE':\n return 'Working with files…';\n default:\n return `Working${name ? ` - ${name.split('/').pop()?.replace(/_/g, ' ').toLowerCase()}` : ''}…`;\n }\n}\n\n/** The account a token belongs to: its `sub`. The Computer is derived from it (the web's identity.ts). */\nexport function tokenSubject(token: string | null | undefined): string {\n try {\n const payload = token?.split('.')[1];\n if (!payload) return '';\n const padded = payload.replace(/-/g, '+').replace(/_/g, '/');\n const claims = JSON.parse(atob(padded + '='.repeat((4 - (padded.length % 4)) % 4))) as { sub?: unknown };\n const sub = String(claims.sub ?? '').trim();\n // 'default' is a placeholder identity a per-user agent rejects outright.\n return sub === 'default' ? '' : sub;\n } catch {\n return '';\n }\n}\n"],"names":[],"mappings":"AAeO,MAAM,uBAA8C,CAAC;AAAA,EAC1D,EAAI,EAAA,WAAA;AAAA,EACJ,KAAO,EAAA,aAAA;AAAA,EACP,MAAQ,EAAA;AACV,CAAG,EAAA;AAAA,EACD,EAAI,EAAA,aAAA;AAAA,EACJ,KAAO,EAAA,eAAA;AAAA,EACP,MAAQ,EAAA;AACV,CAAG,EAAA;AAAA,EACD,EAAI,EAAA,WAAA;AAAA,EACJ,KAAO,EAAA,kBAAA;AAAA,EACP,MAAQ,EAAA;AACV,CAAC;AACM,MAAM,oBAAuB,GAAA;AAC7B,MAAM,mBAAsB,GAAA;AAC5B,MAAM,oBAAuB,GAAA;AAG7B,SAAS,gBAAgB,WAA6B,EAAA;AAC3D,EAAO,OAAA,WAAA,GAAc,CAA0D,uDAAA,EAAA,WAAW,CAAqL,gLAAA,CAAA,GAAA,4MAAA;AACjR;AAGgB,SAAA,mBAAA,CAAoB,MAAc,WAA6B,EAAA;AAC7E,EAAA,OAAO,GAAG,IAAI;;AAAA,EAAO,eAAA,CAAgB,WAAW,CAAC,CAAA,CAAA;AACnD;AACA,MAAM,2BAA8B,GAAA,sCAAA;AACpC,MAAM,0BAA6B,GAAA,sFAAA;AAG5B,SAAS,6BAA6B,OAAyB,EAAA;AACpE,EAAO,OAAA,OAAA,CAAQ,QAAQ,2BAA6B,EAAA,EAAE,EAAE,OAAQ,CAAA,0BAAA,EAA4B,EAAE,CAAA,CAAE,IAAK,EAAA;AACvG;AAaO,SAAS,uBAAuB,OAAyB,EAAA;AAC9D,EAAO,OAAA,OAAA,CAAQ,OAAQ,CAAA,2CAAA,EAA6C,QAAQ,CAAA;AAC9E;AA4BO,SAAS,aAAa,KAA0C,EAAA;AA1FvE,EAAA,IAAA,EAAA;AA2FE,EAAI,IAAA;AACF,IAAM,MAAA,OAAA,GAAU,KAAO,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,KAAA,CAAA,KAAA,CAAM,GAAK,CAAA,CAAA,CAAA,CAAA;AAClC,IAAI,IAAA,CAAC,SAAgB,OAAA,EAAA;AACrB,IAAM,MAAA,MAAA,GAAS,QAAQ,OAAQ,CAAA,IAAA,EAAM,GAAG,CAAE,CAAA,OAAA,CAAQ,MAAM,GAAG,CAAA;AAC3D,IAAA,MAAM,MAAS,GAAA,IAAA,CAAK,KAAM,CAAA,IAAA,CAAK,MAAS,GAAA,GAAA,CAAI,MAAQ,CAAA,CAAA,CAAA,GAAI,MAAO,CAAA,MAAA,GAAS,CAAK,IAAA,CAAC,CAAC,CAAC,CAAA;AAGhF,IAAA,MAAM,MAAM,MAAO,CAAA,CAAA,EAAA,GAAA,MAAA,CAAO,QAAP,IAAc,GAAA,EAAA,GAAA,EAAE,EAAE,IAAK,EAAA;AAE1C,IAAO,OAAA,GAAA,KAAQ,YAAY,EAAK,GAAA,GAAA;AAAA,GAC1B,CAAA,OAAA,CAAA,EAAA;AACN,IAAO,OAAA,EAAA;AAAA;AAEX"}
@@ -1,4 +1,4 @@
1
- import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useMemo,useState,useCallback,useRef,useEffect}from'react';import {StyleSheet,Alert,Linking,Keyboard,BackHandler,View,Text,Share,Clipboard}from'react-native';import {MaterialCommunityIcons}from'@expo/vector-icons';import {GestureHandlerRootView}from'react-native-gesture-handler';import {useSafeInsets}from'../canvas/withRemoteSafeArea.js';import {useAppTheme}from'../../theme/AppThemeProvider.js';import {Tap,DIM}from'../inbox/components/Tap.js';import {isBareSeed,studioTurnText,siteScoreTurn}from'./studioCatalog.js';import {brandKitNote,findDesires,importBrandKit}from'../design/surface/brandKit.js';import {useBrandKitInUse}from'../design/surface/useBrandKitInUse.js';import {BrandSheet}from'../design/surface/BrandSheet.js';import {moveLegacyBrandKit}from'./brandKitMove.js';import {titleFromPrompt,displayHost}from'./buildFragments.js';import {parseToolActivity}from'../chat/toolActivity.js';import {friendlySteps,firstContentLanded}from'./stepLabels.js';import {restoreTurnNote}from'./webbuilderPrompts.js';import {webbuilderTheme}from'./webbuilderTheme.js';import {CodeView}from'./components/CodeView.js';import {ProjectChat}from'./components/ProjectChat.js';import {ViewportToggle,PreviewScreen,ViewPicker}from'./components/PreviewScreen.js';import {PublishSheet}from'./components/PublishSheet.js';import {BOTTOM_TABS_SPACE,BottomTabs}from'./components/BottomTabs.js';import {SiteScoreSheet}from'./components/SiteScoreSheet.js';import {ProjectsScreen}from'./components/ProjectsScreen.js';import {TemplatesSheet}from'./components/TemplatesSheet.js';import {StudioHome}from'./components/StudioHome.js';import {VersionsSheet}from'./components/VersionsSheet.js';import {IconButton,Sheet,Toast}from'./components/ui.js';import {exportMessage,exportTurn}from'./exportCode.js';import {ownCloudflareTurn,projectNameOfLiveUrl,plainActionError}from'./publishTools.js';import {SecretsSheet}from'./components/SecretsSheet.js';import {CloudSheet}from'./components/CloudSheet.js';import {MAX_IMAGE_EDIT_BYTES,imageMimeFor}from'./web/code/imageEdit.js';import {useSiteCopyProgress,SiteCopyCard}from'./components/SiteCopyProgress.js';import {heldCopyLine,copyLine}from'./web/chat/siteCopy.js';import {publishDeployCheck}from'./web/publish/siteInsights.js';import {DraftBanner,DraftsSheet}from'./components/DraftsSheet.js';import {draftBuild,createDrafts}from'./drafts.js';import {draftTurnNote}from'./web/project/drafts.js';import {notReadyHint,projectReadiness}from'./readiness.js';import {SiteStatusSheet}from'./components/SiteStatusSheet.js';import {useRetention,RetentionBanner}from'./components/RetentionBanner.js';import {useGithubAutoSync}from'./useGithubAutoSync.js';import {githubSyncStatus,repoNameOf,githubSettingsPatch}from'./web/github/githubSync.js';import {syncChip,canRunSync}from'./web/github/autoSync.js';import {normalizeGithubRepoUrl}from'./web/project/serverSettings.js';import {ShareSheet}from'./components/ShareSheet.js';import {approvalsSettingsUrl}from'./approvalsLink.js';import {NotesSheet}from'./components/NotesSheet.js';import {projectShareLink}from'./web/sharing/shareLink.js';import {ignoresPatch}from'./web/publish/review/ignores.js';import {publishRequestComment}from'./web/publish/publishRequest.js';import {roleCan}from'./web/sharing/roles.js';import {remixSnapshotParams,snapshotIdFromResult,remixSecretsCheck,buildRemixUrl}from'./web/sharing/share.js';import {OutOfCreditsCard,CreditsSheet}from'./components/Credits.js';import {billingPageUrl}from'./creditsLinks.js';import {useWebBuilderCredits}from'./useWebBuilderCredits.js';import {OUT_OF_CREDITS_TITLE,outOfCreditsText,chipLabel}from'./web/credits/credits.js';import {IntegrationsPanel}from'./components/IntegrationsPanel.js';import {createWebServices}from'./web/webServices.js';import {websiteImportBrief}from'./web/import/websiteImport.js';import {siteForLink}from'./web/upload/sitePhotos.js';import {SiteUploadSheet}from'./components/SiteUploadSheet.js';import {setupPhase}from'./web/preview/setupPhase.js';import {ProjectMenuSheet,ProjectSettingsSheet,GithubPushSheet,IntegrationsSheet,ImportProjectSheet}from'./components/ProjectSheets.js';import {isUserOwnedRepo,CODEZEN_NEEDS_GITHUB,codezenRepoHandoff,codezenRepoFragment,demoVideoSource,webbuilderDemoHandoff,encodeCodezenHandoff}from'./codezenHandoff.js';import {PreviewAccessProvider,openPreviewInBrowser}from'./usePreviewAccess.js';import {probePreviewPrivacy}from'./previewProbe.js';import {siteShareTarget,PRIVATE_SHARE_TITLE,privateShareMessage}from'./shareLink.js';var __defProp = Object.defineProperty;
1
+ import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useMemo,useState,useCallback,useRef,useEffect}from'react';import {StyleSheet,Alert,Linking,Keyboard,BackHandler,View,Text,Share,Clipboard}from'react-native';import {MaterialCommunityIcons}from'@expo/vector-icons';import {GestureHandlerRootView}from'react-native-gesture-handler';import {useSafeInsets}from'../canvas/withRemoteSafeArea.js';import {useAppTheme}from'../../theme/AppThemeProvider.js';import {Tap,DIM}from'../inbox/components/Tap.js';import {isBareSeed,studioTurnText,siteScoreTurn}from'./studioCatalog.js';import {brandKitNote,findDesires,importBrandKit}from'../design/surface/brandKit.js';import {useBrandKitInUse}from'../design/surface/useBrandKitInUse.js';import {BrandSheet}from'../design/surface/BrandSheet.js';import {moveLegacyBrandKit}from'./brandKitMove.js';import {titleFromPrompt,displayHost}from'./buildFragments.js';import {parseToolActivity}from'../chat/toolActivity.js';import {friendlySteps,firstContentLanded}from'./stepLabels.js';import {restoreTurnNote}from'./webbuilderPrompts.js';import {webbuilderTheme}from'./webbuilderTheme.js';import {CodeView}from'./components/CodeView.js';import {ProjectChat}from'./components/ProjectChat.js';import {ViewportToggle,PreviewScreen,ViewPicker}from'./components/PreviewScreen.js';import {PublishSheet}from'./components/PublishSheet.js';import {BOTTOM_TABS_SPACE,BottomTabs}from'./components/BottomTabs.js';import {SiteScoreSheet}from'./components/SiteScoreSheet.js';import {ProjectsScreen}from'./components/ProjectsScreen.js';import {TemplatesSheet}from'./components/TemplatesSheet.js';import {StudioHome}from'./components/StudioHome.js';import {VersionsSheet}from'./components/VersionsSheet.js';import {IconButton,Sheet,Toast}from'./components/ui.js';import {exportMessage,exportTurn}from'./exportCode.js';import {ownCloudflareTurn,projectNameOfLiveUrl,plainActionError}from'./publishTools.js';import {SecretsSheet}from'./components/SecretsSheet.js';import {CloudSheet}from'./components/CloudSheet.js';import {MAX_IMAGE_EDIT_BYTES,imageMimeFor}from'./web/code/imageEdit.js';import {useSiteCopyProgress,SiteCopyCard}from'./components/SiteCopyProgress.js';import {heldCopyLine,copyLine}from'./web/chat/siteCopy.js';import {publishDeployCheck}from'./web/publish/siteInsights.js';import {DraftBanner,DraftsSheet}from'./components/DraftsSheet.js';import {draftBuild,createDrafts}from'./drafts.js';import {draftTurnNote}from'./web/project/drafts.js';import {notReadyHint,projectReadiness}from'./readiness.js';import {SiteStatusSheet}from'./components/SiteStatusSheet.js';import {useRetention,RetentionBanner}from'./components/RetentionBanner.js';import {useGithubAutoSync}from'./useGithubAutoSync.js';import {githubSyncStatus,repoNameOf,githubSettingsPatch}from'./web/github/githubSync.js';import {syncChip,canRunSync}from'./web/github/autoSync.js';import {normalizeGithubRepoUrl}from'./web/project/serverSettings.js';import {ShareSheet}from'./components/ShareSheet.js';import {approvalsSettingsUrl}from'./approvalsLink.js';import {NotesSheet}from'./components/NotesSheet.js';import {projectShareLink}from'./web/sharing/shareLink.js';import {ignoresPatch}from'./web/publish/review/ignores.js';import {publishRequestComment}from'./web/publish/publishRequest.js';import {roleCan}from'./web/sharing/roles.js';import {remixSnapshotParams,snapshotIdFromResult,remixSecretsCheck,buildRemixUrl}from'./web/sharing/share.js';import {OutOfCreditsCard,CreditsSheet}from'./components/Credits.js';import {billingPageUrl}from'./creditsLinks.js';import {useWebBuilderCredits}from'./useWebBuilderCredits.js';import {OUT_OF_CREDITS_TITLE,outOfCreditsText,chipLabel}from'./web/credits/credits.js';import {IntegrationsPanel}from'./components/IntegrationsPanel.js';import {createWebServices}from'./web/webServices.js';import {websiteImportBrief}from'./web/import/websiteImport.js';import {siteForLink}from'./web/upload/sitePhotos.js';import {SiteUploadSheet}from'./components/SiteUploadSheet.js';import {GithubConnectSheet}from'./components/GithubConnectSheet.js';import {needsGithubConnection}from'./web/github/githubConnect.js';import {useUploadCard}from'./uploadCard.js';import {setupPhase}from'./web/preview/setupPhase.js';import {ProjectMenuSheet,ProjectSettingsSheet,GithubPushSheet,IntegrationsSheet,ImportProjectSheet}from'./components/ProjectSheets.js';import {isUserOwnedRepo,CODEZEN_NEEDS_GITHUB,codezenRepoHandoff,codezenRepoFragment,demoVideoSource,webbuilderDemoHandoff,encodeCodezenHandoff}from'./codezenHandoff.js';import {PreviewAccessProvider,openPreviewInBrowser}from'./usePreviewAccess.js';import {probePreviewPrivacy}from'./previewProbe.js';import {siteShareTarget,PRIVATE_SHARE_TITLE,privateShareMessage}from'./shareLink.js';var __defProp = Object.defineProperty;
2
2
  var __defProps = Object.defineProperties;
3
3
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
@@ -24,11 +24,14 @@ const CODEZEN_PREVIEW_MIN_VALID_MS = 9 * 6e4;
24
24
  const TOAST_MS = 2400;
25
25
  const TOAST_ACTION_MS = 6e3;
26
26
  const PUBLISH_WATCH_MS = 15 * 60 * 1e3;
27
+ const coverAsked = /* @__PURE__ */ new Set();
28
+ const COVER_WARMUP_MS = 8e3;
27
29
  function WebBuilderExperience({
28
30
  isDark: hostIsDark,
29
31
  onExit,
30
32
  projects,
31
33
  projectsLoading = false,
34
+ projectsLoadingMore = false,
32
35
  projectsError = null,
33
36
  onRefreshProjects,
34
37
  projectsHasMore = false,
@@ -64,7 +67,7 @@ function WebBuilderExperience({
64
67
  onUploadLinkDone,
65
68
  previewAccess
66
69
  }) {
67
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M;
70
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S;
68
71
  const appTheme = useAppTheme();
69
72
  const isDark = hostIsDark != null ? hostIsDark : appTheme.isDark;
70
73
  const theme = useMemo(() => webbuilderTheme(isDark), [isDark]);
@@ -244,12 +247,18 @@ ${draftTurnNote(openDraft, openDraft.sandboxId)}` : text, [openDraft]);
244
247
  }, [hostChat, build, activeChannelId, showToast, inDraft]);
245
248
  const [uploadPicked, setUploadPicked] = useState(null);
246
249
  const uploadPages = useRef(1);
247
- const uploadResolved = siteForLink(projects, (_c = uploadLink == null ? void 0 : uploadLink.build) != null ? _c : null, {
250
+ const uploadCard = useUploadCard(projectTools == null ? void 0 : projectTools.graphql, (_c = uploadLink == null ? void 0 : uploadLink.card) != null ? _c : null);
251
+ const waitForCard = Boolean(uploadLink) && uploadCard.reading && !(uploadLink == null ? void 0 : uploadLink.build);
252
+ const uploadResolvedRaw = siteForLink(projects, (_e = (_d = uploadLink == null ? void 0 : uploadLink.build) != null ? _d : uploadCard.build) != null ? _e : null, {
248
253
  loading: Boolean(projectsLoading),
249
254
  pagesSettled: uploadPages.current,
250
255
  hasMore: Boolean(projectsHasMore && onLoadMoreProjects),
251
256
  error: Boolean(projectsError)
252
257
  });
258
+ const uploadResolved = waitForCard ? __spreadProps(__spreadValues({}, uploadResolvedRaw), {
259
+ site: null,
260
+ state: "wait"
261
+ }) : uploadResolvedRaw;
253
262
  const uploadSite = uploadPicked ? __spreadProps(__spreadValues({}, uploadResolved), {
254
263
  site: uploadPicked,
255
264
  state: "ready"
@@ -262,11 +271,11 @@ ${draftTurnNote(openDraft, openDraft.sandboxId)}` : text, [openDraft]);
262
271
  useEffect(() => {
263
272
  if (!uploadLink) uploadPages.current = 1;
264
273
  }, [uploadLink]);
265
- const uploadChannel = uploadLink ? (_e = (_d = uploadSite.site) == null ? void 0 : _d.channelId) != null ? _e : null : null;
274
+ const uploadChannel = uploadLink ? (_g = (_f = uploadSite.site) == null ? void 0 : _f.channelId) != null ? _g : null : null;
266
275
  useEffect(() => {
267
276
  if (uploadChannel && uploadChannel !== activeChannelId) onOpenProject(uploadChannel);
268
277
  }, [uploadChannel, activeChannelId, onOpenProject]);
269
- const uploadLastReply = uploadLink ? (_h = (_g = [...(_f = hostChat == null ? void 0 : hostChat.messages) != null ? _f : []].reverse().find((m) => m.role === "assistant")) == null ? void 0 : _g.content) != null ? _h : null : null;
278
+ const uploadLastReply = uploadLink ? (_j = (_i = [...(_h = hostChat == null ? void 0 : hostChat.messages) != null ? _h : []].reverse().find((m) => m.role === "assistant")) == null ? void 0 : _i.content) != null ? _j : null : null;
270
279
  const openChat = useCallback(() => {
271
280
  Keyboard.dismiss();
272
281
  setMode("chat");
@@ -284,6 +293,23 @@ ${draftTurnNote(openDraft, openDraft.sandboxId)}` : text, [openDraft]);
284
293
  key: build.key,
285
294
  kind: "gone"
286
295
  };
296
+ const activeProjectCover = (_l = (_k = projects.find((p) => p.channelId === activeChannelId)) == null ? void 0 : _k.coverUrl) != null ? _l : null;
297
+ const coverWanted = Boolean((publishTools == null ? void 0 : publishTools.run) && activeChannelId && (build == null ? void 0 : build.sandboxId) && !build.coverUrl && !activeProjectCover && !building && !(hostChat == null ? void 0 : hostChat.busy) && !previewTrouble && !openDraft);
298
+ useEffect(() => {
299
+ if (!coverWanted || !build || !activeChannelId || coverAsked.has(activeChannelId)) return void 0;
300
+ const channel = activeChannelId;
301
+ const target = build;
302
+ const timer = setTimeout(() => {
303
+ coverAsked.add(channel);
304
+ const builder = /next/i.test(target.templateId || "") ? "next" : "vite";
305
+ publishTools == null ? void 0 : publishTools.run(target, "WEBBUILDER_FINISH", {
306
+ sandbox_id: target.sandboxId,
307
+ builder,
308
+ workDir: "/home/yantra/repo"
309
+ }, 3 * 60 * 1e3).catch(() => null);
310
+ }, COVER_WARMUP_MS);
311
+ return () => clearTimeout(timer);
312
+ }, [coverWanted, build == null ? void 0 : build.key, activeChannelId]);
287
313
  const wakePreview = useCallback((asked = false) => {
288
314
  if (!build || waking) return;
289
315
  if (openDraft) {
@@ -366,8 +392,8 @@ ${restoreTurnNote({
366
392
  const [versionsOpen, setVersionsOpen] = useState(false);
367
393
  const [publishStarted, setPublishStarted] = useState(null);
368
394
  useEffect(() => setPublishStarted(null), [activeChannelId]);
369
- const siteLive = (_j = (_i = builds.find((b) => b.liveUrl)) == null ? void 0 : _i.liveUrl) != null ? _j : null;
370
- const liveSince = (_l = (_k = builds.find((b) => b.liveUrl)) == null ? void 0 : _k.updatedAt) != null ? _l : 0;
395
+ const siteLive = (_n = (_m = builds.find((b) => b.liveUrl)) == null ? void 0 : _m.liveUrl) != null ? _n : null;
396
+ const liveSince = (_p = (_o = builds.find((b) => b.liveUrl)) == null ? void 0 : _o.updatedAt) != null ? _p : 0;
371
397
  const landedLive = Boolean(publishStarted && liveSince >= publishStarted.at - 2e3);
372
398
  useEffect(() => {
373
399
  if (!publishStarted) return;
@@ -459,7 +485,7 @@ ${restoreTurnNote({
459
485
  });
460
486
  return () => sub.remove();
461
487
  }, [back]);
462
- const live = (_n = (_m = build == null ? void 0 : build.liveUrl) != null ? _m : project == null ? void 0 : project.liveUrl) != null ? _n : null;
488
+ const live = (_r = (_q = build == null ? void 0 : build.liveUrl) != null ? _q : project == null ? void 0 : project.liveUrl) != null ? _r : null;
463
489
  let statusText = "New";
464
490
  let statusTone = theme.muted;
465
491
  if (building || (hostChat == null ? void 0 : hostChat.busy)) {
@@ -487,7 +513,7 @@ ${restoreTurnNote({
487
513
  const coverSteps = friendlySteps(liveSteps);
488
514
  const buildingCover = turnBusy && build && !hadBuildsAtTurnStart.current && !firstContentLanded(liveSteps) ? {
489
515
  title: siteTitle || build.title,
490
- step: (_p = (_o = coverSteps[coverSteps.length - 1]) == null ? void 0 : _o.label) != null ? _p : null
516
+ step: (_t = (_s = coverSteps[coverSteps.length - 1]) == null ? void 0 : _s.label) != null ? _t : null
491
517
  } : null;
492
518
  const setupNotice = turnBusy && build && !buildingCover ? setupPhase(hostChat == null ? void 0 : hostChat.streaming) : null;
493
519
  let publishLabel = "Publish";
@@ -598,11 +624,24 @@ ${restoreTurnNote({
598
624
  const content = typeof (d == null ? void 0 : d.content) === "string" ? d.content : "";
599
625
  return content ? `data:${imageMimeFor(path)};base64,${content}` : null;
600
626
  }, [build, publishTools]);
601
- const copyText = (hostChat == null ? void 0 : hostChat.busy) ? (_s = hostChat.streaming) != null ? _s : (_r = [...(_q = hostChat.messages) != null ? _q : []].reverse().find((m) => m.role === "assistant")) == null ? void 0 : _r.content : null;
627
+ const copyText = (hostChat == null ? void 0 : hostChat.busy) ? (_x = (_u = hostChat.rawStreaming) != null ? _u : hostChat.streaming) != null ? _x : (_w = [...(_v = hostChat.messages) != null ? _v : []].reverse().find((m) => m.role === "assistant")) == null ? void 0 : _w.content : null;
602
628
  const copyHeld = useRef(null);
603
- copyHeld.current = heldCopyLine(copyHeld.current, (_u = (_t = copyLine(copyText)) == null ? void 0 : _t.sandboxId) != null ? _u : null, Boolean(hostChat == null ? void 0 : hostChat.busy));
629
+ copyHeld.current = heldCopyLine(copyHeld.current, (_z = (_y = copyLine(copyText)) == null ? void 0 : _y.sandboxId) != null ? _z : null, Boolean(hostChat == null ? void 0 : hostChat.busy));
604
630
  const copyTarget = copyHeld.current;
605
- const siteCopy = useSiteCopyProgress(publishTools == null ? void 0 : publishTools.run, build, copyTarget);
631
+ const copyBuild = useMemo(() => {
632
+ if (build) return build;
633
+ if (!copyTarget) return null;
634
+ return {
635
+ key: copyTarget,
636
+ title: "",
637
+ previewUrl: null,
638
+ sandboxId: copyTarget,
639
+ projectId: null,
640
+ liveUrl: null,
641
+ files: null
642
+ };
643
+ }, [build, copyTarget]);
644
+ const siteCopy = useSiteCopyProgress(publishTools == null ? void 0 : publishTools.run, copyBuild, copyTarget);
606
645
  const [draftsOpen, setDraftsOpen] = useState(false);
607
646
  const drafts = useMemo(() => webServices && (publishTools == null ? void 0 : publishTools.run) && activeChannelId ? createDrafts({
608
647
  services: webServices,
@@ -635,7 +674,7 @@ ${restoreTurnNote({
635
674
  live2 = false;
636
675
  };
637
676
  }, [webServices, activeChannelId, publishOpen]);
638
- const retention = useRetention(projectTools == null ? void 0 : projectTools.graphql, activeChannelId, (_v = builds[0]) == null ? void 0 : _v.updatedAt);
677
+ const retention = useRetention(projectTools == null ? void 0 : projectTools.graphql, activeChannelId, (_A = builds[0]) == null ? void 0 : _A.updatedAt);
639
678
  const [roleEpoch, setRoleEpoch] = useState(0);
640
679
  const [projectRole, setProjectRole] = useState(null);
641
680
  useEffect(() => {
@@ -683,8 +722,100 @@ ${secrets.note}` : ""}`, [{
683
722
  }).catch(() => void 0)
684
723
  }]);
685
724
  };
725
+ const [clientSites, setClientSites] = useState([]);
726
+ useEffect(() => {
727
+ const read = webServices == null ? void 0 : webServices.sharing.clientSites;
728
+ if (!read) return void 0;
729
+ let live2 = true;
730
+ read().then((sites) => {
731
+ if (!live2) return;
732
+ setClientSites(sites.map((site) => ({
733
+ channelId: site.channelId,
734
+ title: site.title,
735
+ updatedAt: site.updatedAt ? Date.parse(site.updatedAt) || 0 : 0,
736
+ liveUrl: site.url
737
+ })));
738
+ }).catch(() => void 0);
739
+ return () => {
740
+ live2 = false;
741
+ };
742
+ }, [webServices]);
743
+ const boardProjects = useMemo(() => {
744
+ const own = new Set(projects.map((p) => p.channelId));
745
+ const extra = clientSites.filter((c) => !own.has(c.channelId));
746
+ if (!extra.length) return projects;
747
+ return [...projects, ...extra].sort((a, b) => (b.updatedAt || 0) - (a.updatedAt || 0));
748
+ }, [projects, clientSites]);
749
+ const projectIdsKey = projects.map((p) => p.channelId).join(",");
750
+ const [sharedByOthers, setSharedByOthers] = useState(() => /* @__PURE__ */ new Set());
751
+ useEffect(() => {
752
+ if (!webServices || !projectIdsKey) return void 0;
753
+ let live2 = true;
754
+ webServices.sharing.sharedWithMe(projectIdsKey.split(",")).then((set) => live2 && setSharedByOthers(set)).catch(() => void 0);
755
+ return () => {
756
+ live2 = false;
757
+ };
758
+ }, [webServices, projectIdsKey]);
759
+ const sharedWithMe = useMemo(() => clientSites.length ? /* @__PURE__ */ new Set([...sharedByOthers, ...clientSites.map((c) => c.channelId)]) : sharedByOthers, [sharedByOthers, clientSites]);
686
760
  const codezenAfterPush = useRef(false);
687
761
  const codezenPushStarted = useRef(false);
762
+ const githubConnectService = (_B = webServices == null ? void 0 : webServices.githubConnect) != null ? _B : null;
763
+ const [githubConn, setGithubConn] = useState({
764
+ phase: "unknown",
765
+ login: null
766
+ });
767
+ const [githubConnectReq, setGithubConnectReq] = useState(null);
768
+ const [githubConnectOpen, setGithubConnectOpen] = useState(false);
769
+ useEffect(() => {
770
+ if (!githubConnectService || !activeChannelId) return void 0;
771
+ let live2 = true;
772
+ githubConnectService.githubStatus().then((r) => {
773
+ if (!live2 || !r.ok) return;
774
+ setGithubConn((prev) => {
775
+ var _a2;
776
+ return r.value.connected ? {
777
+ phase: "connected",
778
+ login: (_a2 = r.value.login) != null ? _a2 : prev.phase === "connected" ? prev.login : null
779
+ } : {
780
+ phase: "disconnected",
781
+ login: null
782
+ };
783
+ });
784
+ }).catch(() => void 0);
785
+ return () => {
786
+ live2 = false;
787
+ };
788
+ }, [githubConnectService, activeChannelId]);
789
+ const openGithubConnect = githubConnectService ? (retry) => {
790
+ let req = null;
791
+ if (retry === "codezen") {
792
+ req = {
793
+ continueLabel: "Continue to Codezen",
794
+ onConnected: () => {
795
+ codezenAfterPush.current = true;
796
+ setGithubOpen(true);
797
+ }
798
+ };
799
+ } else if (retry === "push") {
800
+ req = {
801
+ continueLabel: "Push again",
802
+ onConnected: () => setGithubOpen(true)
803
+ };
804
+ } else if (retry === "sync" && githubSync.engine && activeChannelId) {
805
+ const channel = activeChannelId;
806
+ const {
807
+ engine
808
+ } = githubSync;
809
+ req = {
810
+ continueLabel: "Sync now",
811
+ onConnected: () => {
812
+ engine.pushNow(channel).catch(() => void 0);
813
+ }
814
+ };
815
+ }
816
+ setGithubConnectReq(req);
817
+ setGithubConnectOpen(true);
818
+ } : null;
688
819
  const openCodezenRepo = (repoUrl, branch) => {
689
820
  const handoff = codezenRepoHandoff(repoUrl, {
690
821
  branch,
@@ -693,13 +824,20 @@ ${secrets.note}` : ""}`, [{
693
824
  if (!handoff || !onOpenCodezen) return;
694
825
  onOpenCodezen(codezenRepoFragment(handoff));
695
826
  };
696
- const pushedRepo = normalizeGithubRepoUrl((_w = githubSync.settings) == null ? void 0 : _w.repoUrl) || null;
827
+ const pushedRepo = normalizeGithubRepoUrl((_C = githubSync.settings) == null ? void 0 : _C.repoUrl) || null;
697
828
  useEffect(() => {
698
829
  if (!codezenAfterPush.current || !codezenPushStarted.current || !pushedRepo) return;
699
830
  codezenAfterPush.current = false;
700
831
  codezenPushStarted.current = false;
701
832
  if (!isUserOwnedRepo(pushedRepo)) {
702
- Alert.alert("Code in Codezen", CODEZEN_NEEDS_GITHUB);
833
+ const connect = openGithubConnect;
834
+ Alert.alert("Code in Codezen", CODEZEN_NEEDS_GITHUB, connect ? [{
835
+ text: "Not now",
836
+ style: "cancel"
837
+ }, {
838
+ text: "Connect GitHub",
839
+ onPress: () => connect("codezen")
840
+ }] : void 0);
703
841
  return;
704
842
  }
705
843
  Alert.alert("Your code is on GitHub", "Open it in Codezen to keep building by hand.", [{
@@ -898,6 +1036,19 @@ ${secrets.note}` : ""}`, [{
898
1036
  engine
899
1037
  } = githubSync;
900
1038
  const children = [];
1039
+ const githubConnected = githubConn.phase === "connected";
1040
+ const syncNeedsGithub = Boolean(openGithubConnect && needsGithubConnection(githubSync.status.error));
1041
+ let connectHint = "So pushes and Codezen use your own GitHub account";
1042
+ if (githubConnected) connectHint = githubConn.login ? `@${githubConn.login} \xB7 Use a different token` : "Use a different token";
1043
+ const connectItem = openGithubConnect ? {
1044
+ key: "github-connect",
1045
+ icon: "key-variant",
1046
+ label: githubConnected ? "GitHub connected" : "Connect GitHub",
1047
+ hint: connectHint,
1048
+ attention: syncNeedsGithub,
1049
+ run: () => openGithubConnect(syncNeedsGithub ? "sync" : void 0)
1050
+ } : null;
1051
+ if (connectItem && (!githubConnected || syncNeedsGithub)) children.push(connectItem);
901
1052
  if (repoUrl) {
902
1053
  children.push({
903
1054
  key: "github-open",
@@ -994,6 +1145,7 @@ ${secrets.note}` : ""}`, [{
994
1145
  }
995
1146
  });
996
1147
  }
1148
+ if (connectItem && githubConnected && !syncNeedsGithub) children.push(connectItem);
997
1149
  let hint;
998
1150
  if (repoUrl) hint = (gh == null ? void 0 : gh.sync) ? "Keeping in sync" : "Connected";
999
1151
  tools.push({
@@ -1001,7 +1153,7 @@ ${secrets.note}` : ""}`, [{
1001
1153
  icon: "github",
1002
1154
  label: "GitHub",
1003
1155
  hint,
1004
- attention: Boolean(ghStatus.notice) || chip.tone === "error" || chip.tone === "warn",
1156
+ attention: Boolean(ghStatus.notice) || chip.tone === "error" || chip.tone === "warn" || syncNeedsGithub,
1005
1157
  run: () => void 0,
1006
1158
  children
1007
1159
  });
@@ -1118,7 +1270,7 @@ ${secrets.note}` : ""}`, [{
1118
1270
  ] })
1119
1271
  ] })
1120
1272
  ] }),
1121
- mode === "chat" ? /* @__PURE__ */ jsx(ProjectChat, { messages: (_x = hostChat == null ? void 0 : hostChat.messages) != null ? _x : [], streaming: (_y = hostChat == null ? void 0 : hostChat.streaming) != null ? _y : null, busy: Boolean(hostChat == null ? void 0 : hostChat.busy), error: (_z = hostChat == null ? void 0 : hostChat.error) != null ? _z : null, connected: Boolean(hostChat == null ? void 0 : hostChat.connected), building, build, siteTitle: siteTitle || "Your site", onSend: (text, files) => sendToAgent(text, files), codeActions: Boolean(hostChat && (build == null ? void 0 : build.sandboxId)), holdTurn, liveCard: siteCopy ? /* @__PURE__ */ jsx(SiteCopyCard, { view: siteCopy, theme }) : null, code: code != null ? code : void 0, permissionsUrl: approvalsSettingsUrl(projectTools == null ? void 0 : projectTools.appUrl), templates, onStartFromTemplate: (t, brief) => startSite({
1273
+ mode === "chat" ? /* @__PURE__ */ jsx(ProjectChat, { messages: (_D = hostChat == null ? void 0 : hostChat.messages) != null ? _D : [], streaming: (_E = hostChat == null ? void 0 : hostChat.streaming) != null ? _E : null, busy: Boolean(hostChat == null ? void 0 : hostChat.busy), error: (_F = hostChat == null ? void 0 : hostChat.error) != null ? _F : null, connected: Boolean(hostChat == null ? void 0 : hostChat.connected), building, build, siteTitle: siteTitle || "Your site", onSend: (text, files) => sendToAgent(text, files), codeActions: Boolean(hostChat && (build == null ? void 0 : build.sandboxId)), holdTurn, liveCard: siteCopy ? /* @__PURE__ */ jsx(SiteCopyCard, { view: siteCopy, theme }) : null, code: code != null ? code : void 0, permissionsUrl: approvalsSettingsUrl(projectTools == null ? void 0 : projectTools.appUrl), templates, onStartFromTemplate: (t, brief) => startSite({
1122
1274
  brief,
1123
1275
  template: t
1124
1276
  }), banner: /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1127,10 +1279,10 @@ ${secrets.note}` : ""}`, [{
1127
1279
  showToast("Back to the project.");
1128
1280
  }, theme }) : null,
1129
1281
  /* @__PURE__ */ jsx(RetentionBanner, { view: retention, appUrl: projectTools == null ? void 0 : projectTools.appUrl, canExtend: projectRole !== "viewer", onDownload: (build == null ? void 0 : build.sandboxId) && !building ? downloadCode : void 0, theme })
1130
- ] }), costLine: ((_A = credits == null ? void 0 : credits.costLine) == null ? void 0 : _A.channelId) === activeChannelId ? credits.costLine.text : null, creditsCard: (credits == null ? void 0 : credits.cardOpen) ? /* @__PURE__ */ jsx(OutOfCreditsCard, { appUrl: projectTools == null ? void 0 : projectTools.appUrl, onCheckAgain: () => credits.refresh({
1282
+ ] }), costLine: ((_G = credits == null ? void 0 : credits.costLine) == null ? void 0 : _G.channelId) === activeChannelId ? credits.costLine.text : null, creditsCard: (credits == null ? void 0 : credits.cardOpen) ? /* @__PURE__ */ jsx(OutOfCreditsCard, { appUrl: projectTools == null ? void 0 : projectTools.appUrl, onCheckAgain: () => credits.refresh({
1131
1283
  fresh: true
1132
- }), onDismiss: credits.dismissCard, theme }) : null, onOpenPreview: () => setMode("preview"), onPublish: openPublish, onPreviewAsleep: () => wakePreview(), previewDown: Boolean(previewTrouble && previewTrouble.kind !== "restoring"), ask: (_B = hostChat == null ? void 0 : hostChat.ask) != null ? _B : null, onAnswerAsk: (formatted) => hostChat == null ? void 0 : hostChat.send(formatted), loading: historyLoading, steering: hostChat == null ? void 0 : hostChat.steering, renderConnectorCard: hostChat == null ? void 0 : hostChat.renderConnectorCard, onCopyLink: copySiteLink, theme, bottomInset: insets.bottom }) : null,
1133
- mode === "preview" ? /* @__PURE__ */ jsx(PreviewScreen, { build, building, loading: buildsLoading, previewNonce, onReload: () => setPreviewNonce((n) => n + 1), onWake: () => wakePreview(), waking, trouble: previewTrouble, onRetry: () => wakePreview(true), onRestore: restoreFromSavedCopy, onAskAiRestore: hostChat ? askAiToRestore : void 0, agentBusy: Boolean(building) || Boolean(hostChat == null ? void 0 : hostChat.busy), steps: liveSteps, onPublish: openPublish, publishLabel, error: (_C = hostChat == null ? void 0 : hostChat.error) != null ? _C : null, theme, bottomInset: insets.bottom, viewport, unpublished: Boolean(build == null ? void 0 : build.sandboxId) && !(build == null ? void 0 : build.liveUrl), readSourceFile: code && build ? (path) => code.readFile(build, path, false).then((r) => {
1284
+ }), onDismiss: credits.dismissCard, theme }) : null, onOpenPreview: () => setMode("preview"), onPublish: openPublish, onPreviewAsleep: () => wakePreview(), previewDown: Boolean(previewTrouble && previewTrouble.kind !== "restoring"), ask: (_H = hostChat == null ? void 0 : hostChat.ask) != null ? _H : null, onAnswerAsk: (formatted) => hostChat == null ? void 0 : hostChat.send(formatted), loading: historyLoading, steering: hostChat == null ? void 0 : hostChat.steering, renderConnectorCard: hostChat == null ? void 0 : hostChat.renderConnectorCard, onCopyLink: copySiteLink, theme, bottomInset: insets.bottom }) : null,
1285
+ mode === "preview" ? /* @__PURE__ */ jsx(PreviewScreen, { build, building, loading: buildsLoading, previewNonce, onReload: () => setPreviewNonce((n) => n + 1), onWake: () => wakePreview(), waking, trouble: previewTrouble, onRetry: () => wakePreview(true), onRestore: restoreFromSavedCopy, onAskAiRestore: hostChat ? askAiToRestore : void 0, agentBusy: Boolean(building) || Boolean(hostChat == null ? void 0 : hostChat.busy), steps: liveSteps, onPublish: openPublish, publishLabel, error: (_I = hostChat == null ? void 0 : hostChat.error) != null ? _I : null, theme, bottomInset: insets.bottom, viewport, unpublished: Boolean(build == null ? void 0 : build.sandboxId) && !(build == null ? void 0 : build.liveUrl), readSourceFile: code && build ? (path) => code.readFile(build, path, false).then((r) => {
1134
1286
  var _a2;
1135
1287
  return r.ok ? (_a2 = r.content) != null ? _a2 : null : null;
1136
1288
  }) : void 0, onShowCode: canShowCode ? () => setMode("code") : void 0, buildingCover, setupNotice }) : null,
@@ -1148,7 +1300,7 @@ ${secrets.note}` : ""}`, [{
1148
1300
  color: theme.ink
1149
1301
  }], numberOfLines: 1, children: "Code" })
1150
1302
  ] }),
1151
- /* @__PURE__ */ jsx(CodeView, { files: (_D = build == null ? void 0 : build.files) != null ? _D : null, build, code, readImage: (publishTools == null ? void 0 : publishTools.run) && (build == null ? void 0 : build.sandboxId) ? readSiteImage : void 0, onImageEdit: hostChat && roleCan(projectRole, "build") ? (req) => {
1303
+ /* @__PURE__ */ jsx(CodeView, { files: (_J = build == null ? void 0 : build.files) != null ? _J : null, build, code, readImage: (publishTools == null ? void 0 : publishTools.run) && (build == null ? void 0 : build.sandboxId) ? readSiteImage : void 0, onImageEdit: hostChat && roleCan(projectRole, "build") ? (req) => {
1152
1304
  if (!build || hostChat.busy || holdTurn()) return false;
1153
1305
  hostChat.send(inDraft(`${req.text}
1154
1306
 
@@ -1158,7 +1310,7 @@ ${req.note}`), req.attachments, build);
1158
1310
  } : void 0, busy: Boolean(building) || Boolean(hostChat == null ? void 0 : hostChat.busy), onWake: build && onResumePreview ? () => onResumePreview(build).then((outcome) => {
1159
1311
  if (outcome === "ok") setPreviewNonce((n) => n + 1);
1160
1312
  return outcome;
1161
- }) : void 0, githubUrl: normalizeGithubRepoUrl((_E = githubSync.settings) == null ? void 0 : _E.repoUrl) || null, onDownload: (build == null ? void 0 : build.sandboxId) && !building ? downloadCode : void 0, theme, onAsk: openChat })
1313
+ }) : void 0, githubUrl: normalizeGithubRepoUrl((_K = githubSync.settings) == null ? void 0 : _K.repoUrl) || null, onDownload: (build == null ? void 0 : build.sandboxId) && !building ? downloadCode : void 0, theme, onAsk: openChat })
1162
1314
  ] }) : null
1163
1315
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1164
1316
  homeTab === "create" ? /* @__PURE__ */ jsx(View, { style: [styles.header, styles.headerBare, {
@@ -1168,10 +1320,10 @@ ${req.note}`), req.attachments, build);
1168
1320
  /* @__PURE__ */ jsx(View, { style: styles.fill, children: homeTab === "create" ? /* @__PURE__ */ jsx(StudioHome, { draft, onDraft: setDraft, template, onClearTemplate: () => setTemplate(null), onBrowseTemplates: () => setTemplatesOpen(true), templates, onUseTemplate: (t, brief) => {
1169
1321
  pickTemplate(t);
1170
1322
  if (brief) setDraft(brief);
1171
- }, brand, brandOff, onBrandOffChange: setBrandOff, onBrand: () => setBrandOpen(true), onSiteScore: () => setScoreOpen(true), onStart: startSite, connecting: startBlocked, startNotice, theme, bottomInset: BOTTOM_TABS_SPACE + insets.bottom }) : /* @__PURE__ */ jsx(ProjectsScreen, { projects, loading: projectsLoading, error: projectsError, hasMore: projectsHasMore, onRefresh: onRefreshProjects, onLoadMore: onLoadMoreProjects, onOpen: (p) => onOpenProject(p.channelId), onNewProject: () => setHomeTab("create"), topInset: insets.top + 12, bottomInset: BOTTOM_TABS_SPACE + insets.bottom, theme }) }),
1323
+ }, brand, brandOff, onBrandOffChange: setBrandOff, onBrand: () => setBrandOpen(true), onSiteScore: () => setScoreOpen(true), onStart: startSite, connecting: startBlocked, startNotice, theme, bottomInset: BOTTOM_TABS_SPACE + insets.bottom }) : /* @__PURE__ */ jsx(ProjectsScreen, { projects: boardProjects, loading: projectsLoading, loadingMore: projectsLoadingMore, error: projectsError, hasMore: projectsHasMore, onRefresh: onRefreshProjects, onLoadMore: onLoadMoreProjects, onOpen: (p) => onOpenProject(p.channelId), onNewProject: () => setHomeTab("create"), topInset: insets.top + 12, bottomInset: BOTTOM_TABS_SPACE + insets.bottom, sharedWithMe, theme }) }),
1172
1324
  /* @__PURE__ */ jsx(BottomTabs, { tab: homeTab, onTab: setHomeTab, theme, bottomInset: insets.bottom })
1173
1325
  ] }),
1174
- /* @__PURE__ */ jsx(TemplatesSheet, { visible: templatesOpen, onClose: () => setTemplatesOpen(false), templates, loading: templatesLoading, error: templatesError, onReload: onReloadTemplates, selectedId: (_F = template == null ? void 0 : template.id) != null ? _F : null, onPick: pickTemplate, theme }),
1326
+ /* @__PURE__ */ jsx(TemplatesSheet, { visible: templatesOpen, onClose: () => setTemplatesOpen(false), templates, loading: templatesLoading, error: templatesError, onReload: onReloadTemplates, selectedId: (_L = template == null ? void 0 : template.id) != null ? _L : null, onPick: pickTemplate, theme }),
1175
1327
  /* @__PURE__ */ jsx(SiteScoreSheet, { visible: scoreOpen, onClose: () => setScoreOpen(false), blocked: startBlocked, onCheck: (url) => {
1176
1328
  setScoreOpen(false);
1177
1329
  onStartProject({
@@ -1194,19 +1346,41 @@ ${req.note}`), req.attachments, build);
1194
1346
  showToast(message);
1195
1347
  setMode("chat");
1196
1348
  setTimeout(githubSync.reload, 5e3);
1349
+ if (codezenPushStarted.current) {
1350
+ let tries = 0;
1351
+ const poll = setInterval(() => {
1352
+ tries += 1;
1353
+ if (!codezenPushStarted.current || tries > 24) {
1354
+ clearInterval(poll);
1355
+ return;
1356
+ }
1357
+ githubSync.reload();
1358
+ }, 5e3);
1359
+ }
1197
1360
  }, onClose: () => {
1198
1361
  if (!codezenPushStarted.current) codezenAfterPush.current = false;
1199
1362
  setGithubOpen(false);
1200
- }, theme }),
1363
+ }, onConnectGithub: openGithubConnect ? () => {
1364
+ const forCodezen = codezenAfterPush.current;
1365
+ setGithubOpen(false);
1366
+ openGithubConnect(forCodezen ? "codezen" : "push");
1367
+ } : void 0, theme }),
1368
+ githubConnectService ? /* @__PURE__ */ jsx(GithubConnectSheet, { visible: githubConnectOpen, service: githubConnectService, replacing: githubConn.phase === "connected", connectedLogin: githubConn.phase === "connected" ? githubConn.login : null, request: githubConnectReq, onConnected: (login) => setGithubConn({
1369
+ phase: "connected",
1370
+ login
1371
+ }), onClose: () => {
1372
+ setGithubConnectOpen(false);
1373
+ setGithubConnectReq(null);
1374
+ }, theme }) : null,
1201
1375
  webServices ? /* @__PURE__ */ jsx(IntegrationsPanel, { visible: integrationsOpen, channelId: activeChannelId, services: webServices, aiBusy: Boolean(building) || Boolean(hostChat == null ? void 0 : hostChat.busy), onRequest: (text) => askAgent(text), onClose: () => setIntegrationsOpen(false), theme }) : /* @__PURE__ */ jsx(IntegrationsSheet, { visible: integrationsOpen, channelId: activeChannelId, tools: projectTools, aiBusy: Boolean(building) || Boolean(hostChat == null ? void 0 : hostChat.busy), onRequest: (text) => askAgent(text), onClose: () => setIntegrationsOpen(false), theme })
1202
1376
  ] }) : null,
1203
- webServices ? /* @__PURE__ */ jsx(CreditsSheet, { visible: creditsOpen, balance: (_G = credits == null ? void 0 : credits.balance) != null ? _G : null, appUrl: projectTools == null ? void 0 : projectTools.appUrl, onRefresh: () => {
1377
+ webServices ? /* @__PURE__ */ jsx(CreditsSheet, { visible: creditsOpen, balance: (_M = credits == null ? void 0 : credits.balance) != null ? _M : null, appUrl: projectTools == null ? void 0 : projectTools.appUrl, onRefresh: () => {
1204
1378
  var _a2;
1205
1379
  return (_a2 = credits == null ? void 0 : credits.refresh({
1206
1380
  fresh: true
1207
1381
  })) != null ? _a2 : Promise.resolve(null);
1208
1382
  }, onClose: () => setCreditsOpen(false), theme }) : null,
1209
- /* @__PURE__ */ jsx(DraftsSheet, { visible: draftsOpen, project: projectBuild, drafts, openDraftId: (_H = openDraft == null ? void 0 : openDraft.id) != null ? _H : null, canEdit: roleCan(projectRole, "build"), onOpen: (d) => {
1383
+ /* @__PURE__ */ jsx(DraftsSheet, { visible: draftsOpen, project: projectBuild, drafts, openDraftId: (_N = openDraft == null ? void 0 : openDraft.id) != null ? _N : null, canEdit: roleCan(projectRole, "build"), onOpen: (d) => {
1210
1384
  setOpenDraft(d);
1211
1385
  setMode("chat");
1212
1386
  showToast(d ? `In the draft "${d.name}".` : "Back to the project.");
@@ -1229,7 +1403,7 @@ ${req.note}`), req.attachments, build);
1229
1403
  /* @__PURE__ */ jsx(SiteUploadSheet, { visible: Boolean(uploadLink), onClose: () => {
1230
1404
  setUploadPicked(null);
1231
1405
  onUploadLinkDone == null ? void 0 : onUploadLinkDone();
1232
- }, linkState: uploadSite.state, site: uploadSite.site, choices: uploadSite.choices, onPickSite: (p) => setUploadPicked(p), ready: Boolean(uploadSite.site && activeChannelId === uploadSite.site.channelId && hostChat && build), busy: Boolean(hostChat == null ? void 0 : hostChat.busy) || Boolean(building), lastReply: uploadLastReply, messageCount: (_J = (_I = hostChat == null ? void 0 : hostChat.messages) == null ? void 0 : _I.length) != null ? _J : 0, onSend: (text, files) => {
1406
+ }, linkState: uploadSite.state, site: uploadSite.site, choices: uploadSite.choices, onPickSite: (p) => setUploadPicked(p), ready: Boolean(uploadSite.site && activeChannelId === uploadSite.site.channelId && hostChat && build), busy: Boolean(hostChat == null ? void 0 : hostChat.busy) || Boolean(building), lastReply: uploadLastReply, messageCount: (_P = (_O = hostChat == null ? void 0 : hostChat.messages) == null ? void 0 : _O.length) != null ? _P : 0, messages: uploadLink ? hostChat == null ? void 0 : hostChat.messages : void 0, failed: Boolean(hostChat == null ? void 0 : hostChat.error), card: (uploadLink == null ? void 0 : uploadLink.card) ? uploadCard : null, onSend: (text, files) => {
1233
1407
  if (!hostChat || !build) return {
1234
1408
  ok: false,
1235
1409
  reason: "Opening your site. Try again in a moment."
@@ -1269,7 +1443,7 @@ ${req.note}`), req.attachments, build);
1269
1443
  /* @__PURE__ */ jsx(PublishSheet, { visible: publishOpen, build, publishing, onPublish: onPublish ? publish : void 0, onClose: () => setPublishOpen(false), theme, liveUrl: live, aiBusy: Boolean(building) || Boolean(hostChat == null ? void 0 : hostChat.busy), tools: publishTools, onDownloadCode: (build == null ? void 0 : build.sandboxId) && !building ? downloadCode : void 0, onExport: hostChat && !building ? exportTo : void 0, onOwnCloudflare: hostChat && !building ? () => askAgent(ownCloudflareTurn(siteTitle || (build == null ? void 0 : build.title) || "")) : void 0, onFixWithAi: hostChat ? (text) => askAgent(text) : void 0, onUnpublished: () => showToast("The site is offline now."), onSiteStatus: (publishTools == null ? void 0 : publishTools.run) && live ? () => {
1270
1444
  setPublishOpen(false);
1271
1445
  setTimeout(() => setSiteStatusOpen(true), 300);
1272
- } : void 0, progressText: publishing ? (_K = building == null ? void 0 : building.statusText) != null ? _K : null : null, reviewIgnores, appUrl: projectTools == null ? void 0 : projectTools.appUrl, askToPublish: projectRole === "viewer" && (projectTools == null ? void 0 : projectTools.graphql) && activeChannelId ? async (note) => {
1446
+ } : void 0, progressText: publishing ? (_Q = building == null ? void 0 : building.statusText) != null ? _Q : null : null, reviewIgnores, appUrl: projectTools == null ? void 0 : projectTools.appUrl, askToPublish: projectRole === "viewer" && (projectTools == null ? void 0 : projectTools.graphql) && activeChannelId ? async (note) => {
1273
1447
  var _a2, _b2, _c2;
1274
1448
  const r = await projectTools.graphql.mutate(ADD_COMMENT_MUTATION, {
1275
1449
  channelId: activeChannelId,
@@ -1305,9 +1479,9 @@ ${req.note}`), req.attachments, build);
1305
1479
  setSelectedKey(picked.key === (latest == null ? void 0 : latest.key) ? null : picked.key);
1306
1480
  setVersionsOpen(false);
1307
1481
  }, onClose: () => setVersionsOpen(false), theme }),
1308
- /* @__PURE__ */ jsx(Sheet, { visible: menu !== null, title: (_L = menu == null ? void 0 : menu.title) != null ? _L : "", onClose: () => setMenu(null), theme, children: /* @__PURE__ */ jsx(View, { style: [styles.menuList, {
1482
+ /* @__PURE__ */ jsx(Sheet, { visible: menu !== null, title: (_R = menu == null ? void 0 : menu.title) != null ? _R : "", onClose: () => setMenu(null), theme, children: /* @__PURE__ */ jsx(View, { style: [styles.menuList, {
1309
1483
  paddingBottom: insets.bottom + 8
1310
- }], children: ((_M = menu == null ? void 0 : menu.actions) != null ? _M : []).map((action) => /* @__PURE__ */ jsx(Tap, { onPress: () => chooseMenu(action), accessibilityRole: "button", style: [styles.menuRow, {
1484
+ }], children: ((_S = menu == null ? void 0 : menu.actions) != null ? _S : []).map((action) => /* @__PURE__ */ jsx(Tap, { onPress: () => chooseMenu(action), accessibilityRole: "button", style: [styles.menuRow, {
1311
1485
  borderBottomColor: theme.border
1312
1486
  }], pressedStyle: DIM, children: /* @__PURE__ */ jsx(Text, { style: [styles.menuLabel, {
1313
1487
  color: action.destructive ? theme.crit : theme.ink