@10play/expo-air 0.12.8 → 0.12.9
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/android/src/main/assets/widget.android.bundle +1 -1
- package/android/src/main/java/expo/modules/expoair/WidgetBridge.kt +13 -0
- package/ios/WidgetBridge.mm +7 -0
- package/ios/widget.jsbundle +1 -1
- package/package.json +1 -1
- package/widget/BubbleContent.tsx +1 -1
- package/widget/components/Header.tsx +28 -3
|
@@ -540,7 +540,7 @@ __d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule'
|
|
|
540
540
|
__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.FormattedText=function(e){var i=e.content,h=e.isStreaming,c=i.split('\n'),S=[],x=0;for(;x<c.length;){var u=c[x],P=u.trim();if(P.startsWith('```')){var f=[],G=P.slice(3).trim();for(x++;x<c.length&&!c[x].trim().startsWith('```');)f.push(c[x]),x++;S.push((0,o.jsxs)(l.View,{style:T.codeBlock,children:[G&&(0,o.jsx)(l.Text,{style:T.codeLang,children:G}),(0,o.jsx)(l.Text,{style:T.codeText,selectable:!0,children:f.join('\n')})]},`code-${x}`)),x++}else{var I=P.match(/^(#{1,6})\s+(.+)$/);if(I){var O=I[1].length,p=O<=2?T.heading1:O<=4?T.heading2:T.heading3;S.push((0,o.jsx)(l.Text,{style:p,selectable:!0,children:s(I[2])},x)),x++}else if(P.startsWith('> ')||'>'===P){for(var A=[];x<c.length&&(c[x].trim().startsWith('> ')||'>'===c[x].trim());){var C=c[x].trim().startsWith('> ')?c[x].trim().slice(2):'';A.push(C),x++}S.push((0,o.jsx)(l.View,{style:T.blockquote,children:(0,o.jsx)(l.Text,{style:T.blockquoteText,selectable:!0,children:s(A.join('\n'))})},`quote-${x}`))}else{var R=P.match(/^[-*]\s+\[([ xX])\]\s+(.+)$/);if(R){var L=' '!==R[1];S.push((0,o.jsxs)(l.View,{style:T.listItem,children:[(0,o.jsx)(l.Text,{style:T.listBullet,children:L?'\u2611':'\u2610'}),(0,o.jsx)(l.Text,{style:T.listText,selectable:!0,children:s(R[2])})]},x)),x++}else{var Y=u.match(/^(\s*)(\d+)\.\s+(.+)$/);if(Y){var E=Math.floor(Y[1].length/2),b=(0,t.default)(Y,4),y=b[2],M=b[3];S.push((0,o.jsxs)(l.View,{style:[T.listItem,E>0&&{paddingLeft:n.SPACING.SM+E*n.SPACING.LG}],children:[(0,o.jsxs)(l.Text,{style:T.listNumber,children:[y,"."]}),(0,o.jsx)(l.Text,{style:T.listText,selectable:!0,children:s(M)})]},x)),x++}else{var _=u.match(/^(\s*)[-*]\s+(.+)$/);if(_){var H=Math.floor(_[1].length/2),j=0===H?'\u2022':1===H?'\u25e6':'\u25aa';S.push((0,o.jsxs)(l.View,{style:[T.listItem,H>0&&{paddingLeft:n.SPACING.SM+H*n.SPACING.LG}],children:[(0,o.jsx)(l.Text,{style:T.listBullet,children:j}),(0,o.jsx)(l.Text,{style:T.listText,selectable:!0,children:s(_[2])})]},x)),x++}else/^[-*_]{3,}$/.test(P)?(S.push((0,o.jsx)(l.View,{style:T.horizontalRule},x)),x++):P?(S.push((0,o.jsx)(l.Text,{style:T.responseText,selectable:!0,children:s(u)},x)),x++):(S.push((0,o.jsx)(l.View,{style:T.paragraphBreak},x)),x++)}}}}}return(0,o.jsxs)(l.View,{style:T.formattedContainer,children:[S,h&&(0,o.jsx)(l.View,{style:T.cursor})]})};var t=e(r(d[0])),i=e(r(d[1])),l=r(d[2]),n=r(d[3]),o=r(d[4]);function s(e){var t=e.split(/(`[^`]+`)/g);return 1===t.length?h(e):t.map((e,t)=>e.startsWith('`')&&e.endsWith('`')?(0,o.jsx)(l.Text,{style:T.inlineCode,children:e.slice(1,-1)},t):(0,o.jsx)(i.default.Fragment,{children:h(e)},t))}function h(e){var t=e.split(/(\[[^\]]+\]\([^)]+\))/g);return 1===t.length?c(e):t.map((e,t)=>{var n=e.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return n?(0,o.jsx)(l.Text,{style:T.linkText,onPress:()=>l.Linking.openURL(n[2]),children:n[1]},t):(0,o.jsx)(i.default.Fragment,{children:c(e)},t)})}function c(e){var t=e.split(/(\*\*[^*]+\*\*|~~[^~]+~~|\*[^*]+\*)/g);return 1===t.length?e:t.map((e,t)=>e.startsWith('**')&&e.endsWith('**')?(0,o.jsx)(l.Text,{style:T.boldText,children:e.slice(2,-2)},t):e.startsWith('~~')&&e.endsWith('~~')?(0,o.jsx)(l.Text,{style:T.strikethroughText,children:e.slice(2,-2)},t):e.startsWith('*')&&e.endsWith('*')?(0,o.jsx)(l.Text,{style:T.italicText,children:e.slice(1,-1)},t):e)}var T=l.StyleSheet.create({formattedContainer:{flexDirection:"column"},responseText:{color:"rgba(255,255,255,0.95)",fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22},cursor:{width:2,height:18,backgroundColor:n.COLORS.TEXT_PRIMARY,marginLeft:2,opacity:.7},listItem:{flexDirection:"row",marginVertical:n.SPACING.XS/2,paddingLeft:n.SPACING.SM},listNumber:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22,width:24,fontWeight:n.TYPOGRAPHY.WEIGHT_MEDIUM},listBullet:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22,width:18},listText:{flex:1,color:"rgba(255,255,255,0.95)",fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22},codeBlock:{backgroundColor:"rgba(255,255,255,0.06)",borderRadius:n.SPACING.SM,padding:n.SPACING.MD,marginVertical:n.SPACING.SM},codeLang:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_XS,fontFamily:"monospace",marginBottom:n.SPACING.XS,textTransform:"uppercase"},codeText:{color:"rgba(255,255,255,0.85)",fontSize:n.TYPOGRAPHY.SIZE_SM,fontFamily:"monospace",lineHeight:18},inlineCode:{backgroundColor:"rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.9)",fontFamily:"monospace",fontSize:n.TYPOGRAPHY.SIZE_MD,paddingHorizontal:4,borderRadius:3},heading1:{color:n.COLORS.TEXT_PRIMARY,fontSize:n.TYPOGRAPHY.SIZE_XL,fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD,lineHeight:24,marginTop:n.SPACING.MD,marginBottom:n.SPACING.XS},heading2:{color:"rgba(255,255,255,0.9)",fontSize:n.TYPOGRAPHY.SIZE_LG,fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD,lineHeight:22,marginTop:n.SPACING.SM,marginBottom:n.SPACING.XS},heading3:{color:"rgba(255,255,255,0.85)",fontSize:n.TYPOGRAPHY.SIZE_LG,fontWeight:n.TYPOGRAPHY.WEIGHT_MEDIUM,lineHeight:22,marginTop:n.SPACING.SM,marginBottom:n.SPACING.XS},boldText:{fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD,color:n.COLORS.TEXT_PRIMARY},italicText:{fontStyle:"italic",color:"rgba(255,255,255,0.85)"},strikethroughText:{textDecorationLine:"line-through",color:n.COLORS.TEXT_MUTED},linkText:{color:n.COLORS.STATUS_INFO,textDecorationLine:"underline"},blockquote:{borderLeftWidth:3,borderLeftColor:"rgba(255,255,255,0.15)",paddingLeft:n.SPACING.MD,marginVertical:n.SPACING.XS},blockquoteText:{color:n.COLORS.TEXT_SECONDARY,fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22,fontStyle:"italic"},horizontalRule:{height:1,backgroundColor:n.COLORS.BORDER,marginVertical:n.SPACING.MD},paragraphBreak:{height:n.SPACING.SM}})},488,[29,63,258,485,248]);
|
|
541
541
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.GitChangesTab=function(c){var f=c.changes,x=c.onDiscard;if(!(f.length>0))return(0,n.jsxs)(t.View,{style:s.emptyContainer,children:[(0,n.jsx)(t.Text,{style:s.emptyTitle,children:"No uncommitted changes"}),(0,n.jsx)(t.Text,{style:s.emptySubtext,children:"Your working directory is clean"})]});return(0,n.jsxs)(t.View,{style:s.container,children:[(0,n.jsx)(t.ScrollView,{style:s.fileList,contentContainerStyle:s.fileListContent,children:f.map((c,f)=>(0,n.jsxs)(t.View,{style:s.fileRow,children:[(0,n.jsx)(t.Text,{style:[s.statusIcon,{color:l[c.status]}],children:o[c.status]}),(0,n.jsx)(t.Text,{style:s.fileName,numberOfLines:1,children:c.file})]},`${c.file}-${f}`))}),(0,n.jsxs)(t.View,{style:s.footer,children:[(0,n.jsx)(t.TouchableOpacity,{style:s.discardButton,onPress:x,children:(0,n.jsx)(t.Text,{style:s.discardText,children:"Discard All Changes"})}),(0,n.jsx)(t.Text,{style:s.warningText,children:"Note: Discarding won't reset memory"})]})]})},r(d[0]);var t=r(d[1]),n=r(d[2]),o={added:"A",modified:"M",deleted:"D",renamed:"R",untracked:"?"},l={added:"#30D158",modified:"#FFD60A",deleted:"#FF453A",renamed:"#BF5AF2",untracked:"#8E8E93"};var s=t.StyleSheet.create({container:{flex:1,backgroundColor:"#000"},emptyContainer:{flex:1,backgroundColor:"#000",alignItems:"center",justifyContent:"center",padding:24},emptyTitle:{color:"rgba(255,255,255,0.6)",fontSize:16,fontWeight:"500",marginBottom:8},emptySubtext:{color:"rgba(255,255,255,0.4)",fontSize:14},fileList:{flex:1},fileListContent:{padding:16},fileRow:{flexDirection:"row",alignItems:"center",paddingVertical:8,borderBottomWidth:1,borderBottomColor:"rgba(255,255,255,0.06)"},statusIcon:{width:20,fontSize:13,fontWeight:"600",fontFamily:"Menlo"},fileName:{flex:1,color:"rgba(255,255,255,0.8)",fontSize:14,fontFamily:"Menlo"},footer:{padding:16,borderTopWidth:1,borderTopColor:"rgba(255,255,255,0.08)",alignItems:"center"},discardButton:{backgroundColor:"rgba(255,59,48,0.15)",borderRadius:12,paddingVertical:12,paddingHorizontal:24,marginBottom:8},discardText:{color:"#FF3B30",fontSize:15,fontWeight:"500"},warningText:{color:"rgba(255,255,255,0.3)",fontSize:12}})},489,[63,258,248]);
|
|
542
542
|
__d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BranchSwitcher=function(e){var t=e.branches,s=e.currentBranch,S=e.loading,b=e.onSelect,C=e.onCreate,p=e.onClose,I=e.error,P=(0,o.useState)(!1),x=(0,n.default)(P,2),f=x[0],A=x[1],O=(0,o.useState)(""),R=(0,n.default)(O,2),G=R[0],y=R[1],M=u(t,""),E=()=>{var e=G.trim();e&&(C(e),y(""),A(!1))},H=(e,t)=>{var n=e.name===s;return(0,c.jsxs)(i.TouchableOpacity,{style:[T.branchItem,n&&T.branchItemCurrent,t&&T.branchItemFirst],onPress:()=>{n||b(e.name)},activeOpacity:n?1:.6,children:[(0,c.jsxs)(i.View,{style:T.branchInfo,children:[(0,c.jsx)(i.Text,{style:[T.branchName,n&&T.branchNameCurrent],numberOfLines:1,children:e.name}),e.prNumber&&(0,c.jsx)(i.View,{style:T.prBadge,children:(0,c.jsxs)(i.Text,{style:T.prBadgeText,children:["#",e.prNumber]})}),e.isRemote&&(0,c.jsx)(i.View,{style:T.remoteBadge,children:(0,c.jsx)(i.Text,{style:T.remoteBadgeText,children:"remote"})})]}),n&&(0,c.jsx)(i.Text,{style:T.currentIndicator,children:"\u2713"})]},e.name)};return(0,c.jsxs)(i.View,{style:T.overlay,children:[(0,c.jsx)(i.TouchableOpacity,{style:T.backdrop,onPress:p,activeOpacity:1}),(0,c.jsxs)(i.View,{style:T.dropdown,children:[I&&(0,c.jsx)(i.View,{style:T.errorBanner,children:(0,c.jsx)(i.Text,{style:T.errorText,numberOfLines:2,children:I})}),S&&0===t.length?(0,c.jsx)(i.View,{style:T.loadingContainer,children:(0,c.jsx)(h,{})}):(0,c.jsx)(i.ScrollView,{style:T.branchList,bounces:!1,children:M.map(e=>(0,c.jsxs)(i.View,{children:[(0,c.jsx)(i.View,{style:T.sectionHeader,children:(0,c.jsx)(i.Text,{style:T.sectionHeaderText,children:e.title})}),e.branches.map((e,t)=>H(e,0===t))]},e.title))}),(0,c.jsx)(i.View,{style:T.createSection,children:f?(0,c.jsxs)(i.View,{style:T.createInputRow,children:[(0,c.jsx)(i.TextInput,{style:T.createInput,value:G,onChangeText:y,placeholder:"branch-name",placeholderTextColor:l.COLORS.TEXT_MUTED,autoFocus:!0,autoCapitalize:"none",autoCorrect:!1,onSubmitEditing:E,returnKeyType:"done"}),(0,c.jsx)(i.TouchableOpacity,{style:[T.createConfirmButton,!G.trim()&&T.createConfirmDisabled],onPress:E,disabled:!G.trim(),children:(0,c.jsx)(i.Text,{style:T.createConfirmText,children:"Create"})})]}):(0,c.jsx)(i.TouchableOpacity,{style:T.createButton,onPress:()=>A(!0),children:(0,c.jsx)(i.Text,{style:T.createButtonText,children:"+ New branch from main"})})})]})]})};var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},o=r(d[1]),i=r(d[2]),l=r(d[3]),c=r(d[4]),s=["main","master"],S=5;function u(e,t){var n=t.toLowerCase().trim(),o=n?e.filter(e=>e.name.toLowerCase().includes(n)):e,i=o.filter(e=>s.includes(e.name)),l=o.filter(e=>!s.includes(e.name)),c=l.filter(e=>!e.isRemote).slice(0,S),u=new Set(c.map(e=>e.name)),h=l.filter(e=>!u.has(e.name)),T=[];return i.length>0&&T.push({title:"Default",branches:i}),c.length>0&&T.push({title:"Recent",branches:c}),h.length>0&&T.push({title:"Other",branches:h}),T}function h(){var e=(0,o.useRef)(new i.Animated.Value(.3)).current,t=(0,o.useRef)(new i.Animated.Value(.3)).current,n=(0,o.useRef)(new i.Animated.Value(.3)).current;return(0,o.useEffect)(()=>{var o=(e,t)=>i.Animated.loop(i.Animated.sequence([i.Animated.delay(t),i.Animated.timing(e,{toValue:1,duration:300,easing:i.Easing.inOut(i.Easing.ease),useNativeDriver:!0}),i.Animated.timing(e,{toValue:.3,duration:300,easing:i.Easing.inOut(i.Easing.ease),useNativeDriver:!0})])),l=o(e,0),c=o(t,150),s=o(n,300);return l.start(),c.start(),s.start(),()=>{l.stop(),c.stop(),s.stop()}},[e,t,n]),(0,c.jsx)(i.View,{style:T.loadingDots,children:[e,t,n].map((e,t)=>(0,c.jsx)(i.Animated.View,{style:[T.loadingDot,{opacity:e}]},t))})}var T=i.StyleSheet.create({overlay:{...i.StyleSheet.absoluteFillObject,zIndex:100},backdrop:{...i.StyleSheet.absoluteFillObject,backgroundColor:"rgba(0,0,0,0.3)"},dropdown:{position:"absolute",top:49,left:l.SPACING.SM,right:l.SPACING.SM,maxHeight:"60%",backgroundColor:"#1C1C1E",borderRadius:l.LAYOUT.BORDER_RADIUS_SM,borderWidth:1,borderColor:"rgba(255,255,255,0.12)",overflow:"hidden"},loadingContainer:{paddingVertical:l.SPACING.XL,alignItems:"center",justifyContent:"center"},loadingDots:{flexDirection:"row",gap:6},loadingDot:{width:6,height:6,borderRadius:3,backgroundColor:"rgba(255,255,255,0.5)"},branchList:{maxHeight:300},sectionHeader:{paddingHorizontal:l.SPACING.LG,paddingTop:l.SPACING.MD,paddingBottom:l.SPACING.XS},sectionHeaderText:{color:l.COLORS.TEXT_MUTED,fontSize:l.TYPOGRAPHY.SIZE_XS,fontWeight:l.TYPOGRAPHY.WEIGHT_SEMIBOLD,textTransform:"uppercase",letterSpacing:.5},branchItem:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:l.SPACING.LG,paddingVertical:l.SPACING.MD+2,borderBottomWidth:i.StyleSheet.hairlineWidth,borderBottomColor:"rgba(255,255,255,0.06)"},branchItemFirst:{paddingTop:l.SPACING.MD+2},branchItemCurrent:{backgroundColor:"rgba(255,255,255,0.06)"},branchInfo:{flex:1,flexDirection:"row",alignItems:"center",gap:l.SPACING.SM},branchName:{color:"rgba(255,255,255,0.85)",fontSize:l.TYPOGRAPHY.SIZE_MD,fontWeight:l.TYPOGRAPHY.WEIGHT_NORMAL,flexShrink:1},branchNameCurrent:{color:l.COLORS.TEXT_PRIMARY,fontWeight:l.TYPOGRAPHY.WEIGHT_MEDIUM},prBadge:{backgroundColor:"rgba(0,122,255,0.15)",paddingHorizontal:l.SPACING.SM,paddingVertical:2,borderRadius:8},prBadgeText:{color:l.COLORS.STATUS_INFO,fontSize:l.TYPOGRAPHY.SIZE_XS,fontWeight:l.TYPOGRAPHY.WEIGHT_MEDIUM},remoteBadge:{backgroundColor:"rgba(255,255,255,0.06)",paddingHorizontal:l.SPACING.SM,paddingVertical:2,borderRadius:8},remoteBadgeText:{color:l.COLORS.TEXT_MUTED,fontSize:l.TYPOGRAPHY.SIZE_XS,fontWeight:l.TYPOGRAPHY.WEIGHT_NORMAL},currentIndicator:{color:l.COLORS.STATUS_SUCCESS,fontSize:l.TYPOGRAPHY.SIZE_SM,marginLeft:l.SPACING.SM},createSection:{paddingHorizontal:l.SPACING.LG,paddingVertical:l.SPACING.MD,borderTopWidth:i.StyleSheet.hairlineWidth,borderTopColor:"rgba(255,255,255,0.08)"},createButton:{paddingVertical:l.SPACING.XS},createButtonText:{color:l.COLORS.STATUS_INFO,fontSize:l.TYPOGRAPHY.SIZE_MD,fontWeight:l.TYPOGRAPHY.WEIGHT_MEDIUM},createInputRow:{flexDirection:"row",alignItems:"center",gap:l.SPACING.SM},createInput:{flex:1,backgroundColor:"rgba(255,255,255,0.08)",color:l.COLORS.TEXT_PRIMARY,fontSize:l.TYPOGRAPHY.SIZE_MD,paddingHorizontal:l.SPACING.MD,paddingVertical:l.SPACING.SM,borderRadius:10},createConfirmButton:{backgroundColor:l.COLORS.STATUS_INFO,paddingHorizontal:l.SPACING.MD,paddingVertical:l.SPACING.SM,borderRadius:10},createConfirmDisabled:{opacity:.4},createConfirmText:{color:l.COLORS.TEXT_PRIMARY,fontSize:l.TYPOGRAPHY.SIZE_SM,fontWeight:l.TYPOGRAPHY.WEIGHT_SEMIBOLD},errorBanner:{backgroundColor:"rgba(255,59,48,0.15)",paddingHorizontal:l.SPACING.LG,paddingVertical:l.SPACING.SM,borderBottomWidth:i.StyleSheet.hairlineWidth,borderBottomColor:"rgba(255,59,48,0.3)"},errorText:{color:"#FF6B6B",fontSize:l.TYPOGRAPHY.SIZE_SM}})},490,[29,63,258,485,248]);
|
|
543
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Header=function(e){var s=e.status,
|
|
543
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Header=function(e){var s=e.status,l=e.branchName,c=e.onBranchPress,O={disconnected:n.COLORS.STATUS_ERROR,connecting:n.COLORS.STATUS_INFO,connected:n.COLORS.STATUS_SUCCESS,sending:n.COLORS.STATUS_INFO,processing:n.COLORS.STATUS_INFO};return(0,o.jsxs)(t.View,{style:T.header,children:[(0,o.jsx)(t.TouchableOpacity,{onPress:u,onLongPress:S,delayLongPress:500,style:T.closeButton,children:(0,o.jsx)(t.Text,{style:T.closeButtonText,children:"\u2715"})}),(0,o.jsx)(t.TouchableOpacity,{style:T.branchButton,onPress:c,disabled:!l,children:l?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.Text,{style:T.branchName,numberOfLines:1,children:l}),(0,o.jsx)(t.Text,{style:T.branchChevron,children:"\u25be"})]}):(0,o.jsx)(t.View,{style:T.branchLoadingBar})}),(0,o.jsx)(t.TouchableOpacity,{onLongPress:S,delayLongPress:500,activeOpacity:.6,hitSlop:{top:10,bottom:10,left:10,right:10},style:T.statusDotTouchable,children:(0,o.jsx)(t.View,{style:[T.statusDot,{backgroundColor:O[s]}]})})]})},_e.PulsingIndicator=function(l){var c=l.status,S={disconnected:n.COLORS.STATUS_ERROR,connecting:n.COLORS.STATUS_INFO,connected:n.COLORS.STATUS_SUCCESS,sending:n.COLORS.STATUS_INFO,processing:n.COLORS.STATUS_INFO},u="processing"===c||"connecting"===c||"sending"===c,O=(0,e.useRef)(new t.Animated.Value(1)).current,h=(0,e.useRef)(new t.Animated.Value(.4)).current;return(0,e.useEffect)(()=>{if(u){var e=t.Animated.loop(t.Animated.sequence([t.Animated.parallel([t.Animated.timing(O,{toValue:1.3,duration:1200,easing:t.Easing.inOut(t.Easing.ease),useNativeDriver:!0}),t.Animated.timing(h,{toValue:0,duration:1200,easing:t.Easing.inOut(t.Easing.ease),useNativeDriver:!0})]),t.Animated.parallel([t.Animated.timing(O,{toValue:1,duration:0,useNativeDriver:!0}),t.Animated.timing(h,{toValue:.4,duration:0,useNativeDriver:!0})])]));return e.start(),()=>e.stop()}O.setValue(1),h.setValue(.4)},[u,O,h]),(0,o.jsxs)(t.View,{style:T.indicatorContainer,children:[(0,o.jsx)(t.View,{style:[T.indicator,{backgroundColor:S[c]}]}),u&&(0,o.jsx)(s,{style:[T.indicatorRing,{borderColor:S[c],transform:[{scale:O}],opacity:h}]})]})};var e=r(d[0]),t=r(d[1]),n=r(d[2]),o=r(d[3]),s=t.Animated.View,l=t.NativeModules.WidgetBridge,c=t.NativeModules.ExpoAir;function S(){try{l?.reloadMainApp?(console.log("[expo-air] Triggering main app reload"),l.reloadMainApp()):console.warn("[expo-air] No reloadMainApp method available")}catch(e){console.warn("[expo-air] Failed to reload main app:",e)}}function u(){try{l?.collapse?l.collapse():c?.collapse?c.collapse():console.warn("[expo-air] No collapse method available")}catch(e){console.warn("[expo-air] Failed to collapse:",e)}}var T=t.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",paddingHorizontal:n.LAYOUT.CONTENT_PADDING_H,paddingVertical:n.SPACING.MD+2,borderBottomWidth:1,borderBottomColor:n.COLORS.BORDER},closeButton:{width:n.SIZES.CLOSE_BUTTON,height:n.SIZES.CLOSE_BUTTON,borderRadius:n.SIZES.CLOSE_BUTTON/2,backgroundColor:"transparent",alignItems:"center",justifyContent:"center",marginRight:n.SPACING.MD},closeButtonText:{color:"transparent",fontSize:n.TYPOGRAPHY.SIZE_MD,fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD},branchButton:{flex:1,flexDirection:"row",alignItems:"center"},branchName:{flexShrink:1,color:n.COLORS.TEXT_SECONDARY,fontSize:n.TYPOGRAPHY.SIZE_MD,fontWeight:n.TYPOGRAPHY.WEIGHT_MEDIUM},branchChevron:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_SM,marginLeft:n.SPACING.XS},branchLoadingBar:{width:80,height:12,borderRadius:6,backgroundColor:"rgba(255,255,255,0.08)"},statusDot:{width:n.SIZES.STATUS_DOT,height:n.SIZES.STATUS_DOT,borderRadius:n.SIZES.STATUS_DOT/2,marginLeft:n.SPACING.MD},statusDotTouchable:{marginLeft:n.SPACING.MD,padding:10},collapsedPill:{width:100,height:32,backgroundColor:"transparent",alignItems:"center",justifyContent:"center"},indicatorContainer:{width:20,height:20,alignItems:"center",justifyContent:"center"},indicator:{width:n.SIZES.STATUS_DOT,height:n.SIZES.STATUS_DOT,borderRadius:n.SIZES.STATUS_DOT/2},indicatorRing:{position:"absolute",width:16,height:16,borderRadius:8,borderWidth:1.5,opacity:.4}})},491,[63,258,485,248]);
|
|
544
544
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.TabBar=function(t){var s=t.activeTab,c=t.onTabChange,u=t.onNewSession,h=t.canStartNew,x=t.hasPR,b=t.hasChanges,O=t.prNumber,P=t.onCreatePR,A=t.onCommit,R=t.onViewPR;return(0,o.jsxs)(n.View,{style:T.tabBar,children:[(0,o.jsxs)(n.View,{style:T.tabButtons,children:[(0,o.jsx)(n.TouchableOpacity,{onPress:()=>c("chat"),children:(0,o.jsx)(n.Text,{style:[T.tabText,"chat"===s?T.tabTextActive:T.tabTextInactive],children:"Chat"})}),(0,o.jsx)(n.TouchableOpacity,{onPress:()=>c("changes"),children:(0,o.jsx)(n.Text,{style:[T.tabText,"changes"===s?T.tabTextActive:T.tabTextInactive],children:"Changes"})})]}),"chat"===s?(0,o.jsx)(n.TouchableOpacity,{onPress:u,style:[T.ctaButton,!h&&T.ctaButtonDisabled],disabled:!h,children:(0,o.jsx)(n.Text,{style:[T.ctaText,!h&&T.ctaTextDisabled],children:"New"})}):!x&&b?(0,o.jsx)(l,{onPress:P,children:"Create PR"}):x&&b?(0,o.jsx)(l,{onPress:A,children:"Commit"}):x&&!b&&O?(0,o.jsxs)(l,{onPress:R,children:["#",O]}):null]})};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),c=n.Animated.Text;function l(s){var l=s.children,u=s.onPress,h=(0,t.useRef)(new n.Animated.Value(.6)).current;return(0,t.useEffect)(()=>{var t=n.Animated.loop(n.Animated.sequence([n.Animated.timing(h,{toValue:.9,duration:1500,easing:n.Easing.inOut(n.Easing.ease),useNativeDriver:!0}),n.Animated.timing(h,{toValue:.6,duration:1500,easing:n.Easing.inOut(n.Easing.ease),useNativeDriver:!0})]));return t.start(),()=>t.stop()},[h]),(0,o.jsx)(n.TouchableOpacity,{onPress:u,style:T.ctaButton,activeOpacity:.7,children:(0,o.jsx)(c,{style:[T.ctaText,{opacity:h}],children:l})})}var T=n.StyleSheet.create({tabBar:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:s.LAYOUT.CONTENT_PADDING_H,paddingVertical:s.SPACING.SM+2,borderBottomWidth:1,borderBottomColor:s.COLORS.BORDER},tabButtons:{flexDirection:"row",gap:s.SPACING.XL},tabText:{fontSize:s.TYPOGRAPHY.SIZE_LG,fontWeight:s.TYPOGRAPHY.WEIGHT_MEDIUM},tabTextActive:{color:s.COLORS.TEXT_PRIMARY},tabTextInactive:{color:s.COLORS.TEXT_MUTED},ctaButton:{paddingHorizontal:s.SIZES.CTA_PADDING_H,paddingVertical:s.SIZES.CTA_PADDING_V,borderRadius:s.LAYOUT.BORDER_RADIUS_SM,backgroundColor:s.COLORS.BACKGROUND_INTERACTIVE},ctaButtonDisabled:{opacity:.4},ctaText:{color:s.COLORS.TEXT_PRIMARY,fontSize:s.TYPOGRAPHY.SIZE_SM,fontWeight:s.TYPOGRAPHY.WEIGHT_SEMIBOLD},ctaTextDisabled:{opacity:.6}})},492,[63,258,485,248]);
|
|
545
545
|
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.useWebSocketMessages=function(e){var o=e.serverUrl,p=e.onGitMessage,l=(0,n.useState)("disconnected"),f=(0,s.default)(l,2),v=f[0],h=f[1],b=(0,n.useState)([]),k=(0,s.default)(b,2),y=k[0],_=k[1],C=(0,n.useState)([]),S=(0,s.default)(C,2),w=S[0],M=S[1],P=(0,n.useRef)([]),W=(0,n.useRef)(null),I=(0,n.useRef)(0),N=(0,n.useRef)(!1),x=(0,n.useRef)(p);(0,n.useEffect)(()=>{x.current=p},[p]);var R=(0,n.useCallback)((e,t)=>{var s=P.current;if(s.length>0){var n={type:"assistant_parts",promptId:e,parts:s,isComplete:t,timestamp:Date.now()};_(e=>[...e,n])}P.current=[],W.current=null,M([])},[]),E=(0,n.useCallback)(e=>{switch(e.type){case"stream":if(e.promptId!==W.current&&(P.current.length>0&&W.current&&R(W.current,!1),W.current=e.promptId),!e.done&&e.chunk){var t=P.current,s=t[t.length-1];"text"===s?.type?(s.content+=e.chunk,P.current=[...t]):P.current=[...t,{type:"text",id:"text-"+I.current++,content:e.chunk}],M([...P.current])}break;case"tool":if("started"!==e.status){var n={type:"tool",id:"tool-"+I.current++,toolName:e.toolName,status:e.status,input:e.input,output:e.output,timestamp:e.timestamp};P.current=[...P.current,n],M([...P.current])}break;case"result":if(P.current.length>0){var u={type:"assistant_parts",promptId:e.promptId,parts:P.current,isComplete:!0,timestamp:e.timestamp};if(void 0!==e.costUsd||void 0!==e.durationMs||!e.success&&e.error){var c={...e,result:void 0};_(e=>[...e,u,c])}else _(e=>[...e,u])}else(void 0!==e.costUsd||void 0!==e.durationMs||!e.success&&e.error)&&_(t=>[...t,e]);P.current=[],W.current=null,M([]);break;case"error":if(P.current.length>0&&W.current){var o={type:"assistant_parts",promptId:W.current,parts:P.current,isComplete:!1,timestamp:Date.now()};_(t=>[...t,o,e])}else _(t=>[...t,e]);P.current=[],W.current=null,M([]);break;case"status":"processing"===e.status&&_(e=>{var t=e[e.length-1];return"user_prompt"===t?.type&&t.pending?[...e.slice(0,-1),{...t,pending:!1}]:e});break;case"session_cleared":_([]),P.current=[],W.current=null,I.current=0,M([]);break;case"stopped":P.current.length>0&&W.current?R(W.current,!1):(P.current=[],W.current=null,M([]));break;case"history":var p=e.entries.flatMap(e=>{if("user"===e.role){var t=e.imagePaths&&e.imagePaths.length>0?e.imagePaths.map(e=>({uri:e})):void 0;return[{type:"user_prompt",content:e.content,images:t,timestamp:e.timestamp}]}return"assistant"===e.role?[{type:"history_result",content:e.content,timestamp:e.timestamp}]:"tool"===e.role?[{type:"tool",promptId:"",toolName:e.toolName,status:e.status,input:e.input,output:e.output,timestamp:e.timestamp}]:"system"===e.role?[{type:"system_message",messageType:e.type,content:e.content,timestamp:e.timestamp}]:[]});_(p);break;case"git_status":case"branches_list":case"branch_switched":case"branch_created":x.current(e)}},[R]);(0,n.useEffect)(()=>{console.log("[expo-air] Connecting to:",o?.replace(/([?&])secret=[^&]+/,"$1secret=***"));var e=(0,u.createWebSocketClient)({url:o,onStatusChange:h,onMessage:E,onError:e=>{console.warn("[expo-air] WebSocket error:",e)}});return e.connect(),()=>{e.disconnect()}},[o]),(0,n.useEffect)(()=>(0,c.setupTapHandler)((e,t)=>{var s=(0,u.getWebSocketClient)();s&&!s.isConnected()&&s.connect()}),[]);var T=(0,n.useCallback)((function(){var e=(0,t.default)(function*(e,t){_(s=>[...s,{type:"user_prompt",content:e,images:t,pending:!0,timestamp:Date.now()}]),P.current=[],W.current=null,M([]);var s=t&&t.length>0?t.map(e=>e.uri):void 0,n=(0,u.getWebSocketClient)();if(n&&n.sendPrompt(e,s),!N.current){var o=yield(0,c.requestPushToken)();if(o){var p=(0,u.getWebSocketClient)();p?.isConnected()&&(p.sendPushToken(o),N.current=!0)}}});return function(t,s){return e.apply(this,arguments)}})(),[]),q=(0,n.useCallback)(()=>{var e=(0,u.getWebSocketClient)();e&&e.requestNewSession()},[]),D=(0,n.useCallback)(()=>{var e=(0,u.getWebSocketClient)();e&&e.requestStop()},[]);return{status:v,messages:y,currentParts:w,handleSubmit:T,handleNewSession:q,handleStop:D}};var t=e(r(d[0])),s=e(r(d[1])),n=r(d[2]),u=r(d[3]),c=r(d[4])},493,[347,29,63,494,495]);
|
|
546
546
|
__d(function(g,r,i,a,m,_e,d){"use strict";function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"WebSocketClient",{enumerable:!0,get:function(){return n}}),_e.getWebSocketClient=function(){return o},_e.createWebSocketClient=function(t){o&&o.disconnect();return o=new n(t)};var e=t(r(d[0])),s=t(r(d[1])),n=(function(){return(0,s.default)(function t(s){(0,e.default)(this,t),this.ws=null,this.reconnectAttempts=0,this.reconnectTimeout=null,this._status="disconnected",this.shouldReconnect=!0,this.options={reconnectInterval:3e3,maxReconnectAttempts:10,onConnect:()=>{},onDisconnect:()=>{},onMessage:()=>{},onError:()=>{},onStatusChange:()=>{},...s}},[{key:"status",get:function(){return this._status}},{key:"setStatus",value:function(t){this._status=t,this.options.onStatusChange(t)}},{key:"connect",value:function(){if(this.ws?.readyState!==WebSocket.OPEN){this.shouldReconnect=!0,this.setStatus("connecting");try{this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.reconnectAttempts=0,this.setStatus("connected"),this.options.onConnect()},this.ws.onclose=()=>{this.setStatus("disconnected"),this.options.onDisconnect(),this.attemptReconnect()},this.ws.onerror=()=>{var t=new Error("WebSocket error");this.options.onError(t)},this.ws.onmessage=t=>{try{var e=JSON.parse(t.data);this.handleMessage(e)}catch(t){console.warn("[expo-air] Failed to parse message:",t)}}}catch(t){this.options.onError(t),this.attemptReconnect()}}}},{key:"handleMessage",value:function(t){"status"===t.type?"processing"===t.status?this.setStatus("processing"):"idle"!==t.status&&"connected"!==t.status||this.setStatus("connected"):"result"===t.type||"error"===t.type?this.setStatus("connected"):"stopped"!==t.type&&"session_cleared"!==t.type||this.setStatus("connected"),this.options.onMessage(t)}},{key:"attemptReconnect",value:function(){this.shouldReconnect&&(this.reconnectAttempts>=this.options.maxReconnectAttempts?console.log("[expo-air] Max reconnect attempts reached"):(this.reconnectTimeout&&clearTimeout(this.reconnectTimeout),this.reconnectAttempts++,console.log(`[expo-air] Reconnecting... (attempt ${this.reconnectAttempts}/${this.options.maxReconnectAttempts})`),this.reconnectTimeout=setTimeout(()=>{this.connect()},this.options.reconnectInterval)))}},{key:"disconnect",value:function(){this.shouldReconnect=!1,this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.ws&&(this.ws.close(),this.ws=null),this.setStatus("disconnected")}},{key:"sendPrompt",value:function(t,e){if(this.ws&&this.ws.readyState===WebSocket.OPEN){var s={type:"prompt",content:t,id:Math.random().toString(36).substring(2,15)};e&&e.length>0&&(s.imagePaths=e),this.ws.send(JSON.stringify(s)),this.setStatus("sending")}else this.options.onError(new Error("Not connected"))}},{key:"requestNewSession",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"new_session"})):this.options.onError(new Error("Not connected"))}},{key:"requestStop",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"stop"})):this.options.onError(new Error("Not connected"))}},{key:"requestDiscardChanges",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"discard_changes"})):this.options.onError(new Error("Not connected"))}},{key:"sendPushToken",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"register_push_token",token:t}))}},{key:"requestBranches",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"list_branches"}))}},{key:"requestSwitchBranch",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"switch_branch",branchName:t})):this.options.onError(new Error("Not connected"))}},{key:"requestCreateBranch",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"create_branch",branchName:t})):this.options.onError(new Error("Not connected"))}},{key:"isConnected",value:function(){return this.ws?.readyState===WebSocket.OPEN}}])})();var o=null},494,[8,9]);
|
|
@@ -16,6 +16,7 @@ import com.facebook.react.bridge.ReactApplicationContext
|
|
|
16
16
|
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
17
17
|
import com.facebook.react.bridge.ReactMethod
|
|
18
18
|
import com.facebook.react.modules.core.DeviceEventManagerModule
|
|
19
|
+
import com.facebook.react.ReactApplication
|
|
19
20
|
import java.io.File
|
|
20
21
|
import java.io.FileOutputStream
|
|
21
22
|
|
|
@@ -43,6 +44,18 @@ class WidgetBridge(private val reactContext: ReactApplicationContext) : ReactCon
|
|
|
43
44
|
@ReactMethod
|
|
44
45
|
fun removeListeners(@Suppress("UNUSED_PARAMETER") count: Int) {}
|
|
45
46
|
|
|
47
|
+
@ReactMethod
|
|
48
|
+
fun reloadMainApp() {
|
|
49
|
+
try {
|
|
50
|
+
val app = reactContext.applicationContext as? ReactApplication
|
|
51
|
+
val host = app?.reactHost
|
|
52
|
+
host?.reload("expo-air force reload")
|
|
53
|
+
Log.d(TAG, "Main app reload triggered")
|
|
54
|
+
} catch (e: Exception) {
|
|
55
|
+
Log.e(TAG, "Failed to reload main app", e)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
46
59
|
/**
|
|
47
60
|
* Attach image paste listener to all EditText views found in the given view hierarchy.
|
|
48
61
|
* Called by WidgetRuntime after the surface view is created.
|
package/ios/WidgetBridge.mm
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
#import <UIKit/UIKit.h>
|
|
4
4
|
#import <PhotosUI/PhotosUI.h>
|
|
5
5
|
#import <objc/runtime.h>
|
|
6
|
+
#import <React/RCTReloadCommand.h>
|
|
6
7
|
|
|
7
8
|
static NSString *saveImageToTemp(UIImage *image, CGFloat quality) {
|
|
8
9
|
NSData *data = UIImageJPEGRepresentation(image, quality);
|
|
@@ -111,6 +112,12 @@ RCT_EXPORT_METHOD(collapse) {
|
|
|
111
112
|
});
|
|
112
113
|
}
|
|
113
114
|
|
|
115
|
+
RCT_EXPORT_METHOD(reloadMainApp) {
|
|
116
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
117
|
+
RCTTriggerReloadCommandListeners(@"expo-air force reload");
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
114
121
|
RCT_EXPORT_METHOD(expand) {
|
|
115
122
|
NSLog(@"[WidgetBridge] expand called");
|
|
116
123
|
dispatch_async(dispatch_get_main_queue(), ^{
|
package/ios/widget.jsbundle
CHANGED
|
@@ -542,7 +542,7 @@ __d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule'
|
|
|
542
542
|
__d(function(g,r,_i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.FormattedText=function(e){var i=e.content,h=e.isStreaming,c=i.split('\n'),S=[],x=0;for(;x<c.length;){var u=c[x],P=u.trim();if(P.startsWith('```')){var f=[],G=P.slice(3).trim();for(x++;x<c.length&&!c[x].trim().startsWith('```');)f.push(c[x]),x++;S.push((0,o.jsxs)(l.View,{style:T.codeBlock,children:[G&&(0,o.jsx)(l.Text,{style:T.codeLang,children:G}),(0,o.jsx)(l.Text,{style:T.codeText,selectable:!0,children:f.join('\n')})]},`code-${x}`)),x++}else{var I=P.match(/^(#{1,6})\s+(.+)$/);if(I){var O=I[1].length,A=O<=2?T.heading1:O<=4?T.heading2:T.heading3;S.push((0,o.jsx)(l.Text,{style:A,selectable:!0,children:s(I[2])},x)),x++}else if(P.startsWith('> ')||'>'===P){for(var C=[];x<c.length&&(c[x].trim().startsWith('> ')||'>'===c[x].trim());){var R=c[x].trim().startsWith('> ')?c[x].trim().slice(2):'';C.push(R),x++}S.push((0,o.jsx)(l.View,{style:T.blockquote,children:(0,o.jsx)(l.Text,{style:T.blockquoteText,selectable:!0,children:s(C.join('\n'))})},`quote-${x}`))}else{var p=P.match(/^[-*]\s+\[([ xX])\]\s+(.+)$/);if(p){var L=' '!==p[1];S.push((0,o.jsxs)(l.View,{style:T.listItem,children:[(0,o.jsx)(l.Text,{style:T.listBullet,children:L?'\u2611':'\u2610'}),(0,o.jsx)(l.Text,{style:T.listText,selectable:!0,children:s(p[2])})]},x)),x++}else{var Y=u.match(/^(\s*)(\d+)\.\s+(.+)$/);if(Y){var E=Math.floor(Y[1].length/2),M=(0,t.default)(Y,4),b=M[2],y=M[3];S.push((0,o.jsxs)(l.View,{style:[T.listItem,E>0&&{paddingLeft:n.SPACING.SM+E*n.SPACING.LG}],children:[(0,o.jsxs)(l.Text,{style:T.listNumber,children:[b,"."]}),(0,o.jsx)(l.Text,{style:T.listText,selectable:!0,children:s(y)})]},x)),x++}else{var _=u.match(/^(\s*)[-*]\s+(.+)$/);if(_){var H=Math.floor(_[1].length/2),j=0===H?'\u2022':1===H?'\u25e6':'\u25aa';S.push((0,o.jsxs)(l.View,{style:[T.listItem,H>0&&{paddingLeft:n.SPACING.SM+H*n.SPACING.LG}],children:[(0,o.jsx)(l.Text,{style:T.listBullet,children:j}),(0,o.jsx)(l.Text,{style:T.listText,selectable:!0,children:s(_[2])})]},x)),x++}else/^[-*_]{3,}$/.test(P)?(S.push((0,o.jsx)(l.View,{style:T.horizontalRule},x)),x++):P?(S.push((0,o.jsx)(l.Text,{style:T.responseText,selectable:!0,children:s(u)},x)),x++):(S.push((0,o.jsx)(l.View,{style:T.paragraphBreak},x)),x++)}}}}}return(0,o.jsxs)(l.View,{style:T.formattedContainer,children:[S,h&&(0,o.jsx)(l.View,{style:T.cursor})]})};var t=e(r(d[0])),i=e(r(d[1])),l=r(d[2]),n=r(d[3]),o=r(d[4]);function s(e){var t=e.split(/(`[^`]+`)/g);return 1===t.length?h(e):t.map((e,t)=>e.startsWith('`')&&e.endsWith('`')?(0,o.jsx)(l.Text,{style:T.inlineCode,children:e.slice(1,-1)},t):(0,o.jsx)(i.default.Fragment,{children:h(e)},t))}function h(e){var t=e.split(/(\[[^\]]+\]\([^)]+\))/g);return 1===t.length?c(e):t.map((e,t)=>{var n=e.match(/^\[([^\]]+)\]\(([^)]+)\)$/);return n?(0,o.jsx)(l.Text,{style:T.linkText,onPress:()=>l.Linking.openURL(n[2]),children:n[1]},t):(0,o.jsx)(i.default.Fragment,{children:c(e)},t)})}function c(e){var t=e.split(/(\*\*[^*]+\*\*|~~[^~]+~~|\*[^*]+\*)/g);return 1===t.length?e:t.map((e,t)=>e.startsWith('**')&&e.endsWith('**')?(0,o.jsx)(l.Text,{style:T.boldText,children:e.slice(2,-2)},t):e.startsWith('~~')&&e.endsWith('~~')?(0,o.jsx)(l.Text,{style:T.strikethroughText,children:e.slice(2,-2)},t):e.startsWith('*')&&e.endsWith('*')?(0,o.jsx)(l.Text,{style:T.italicText,children:e.slice(1,-1)},t):e)}var T=l.StyleSheet.create({formattedContainer:{flexDirection:"column"},responseText:{color:"rgba(255,255,255,0.95)",fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22},cursor:{width:2,height:18,backgroundColor:n.COLORS.TEXT_PRIMARY,marginLeft:2,opacity:.7},listItem:{flexDirection:"row",marginVertical:n.SPACING.XS/2,paddingLeft:n.SPACING.SM},listNumber:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22,width:24,fontWeight:n.TYPOGRAPHY.WEIGHT_MEDIUM},listBullet:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22,width:18},listText:{flex:1,color:"rgba(255,255,255,0.95)",fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22},codeBlock:{backgroundColor:"rgba(255,255,255,0.06)",borderRadius:n.SPACING.SM,padding:n.SPACING.MD,marginVertical:n.SPACING.SM},codeLang:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_XS,fontFamily:"Menlo",marginBottom:n.SPACING.XS,textTransform:"uppercase"},codeText:{color:"rgba(255,255,255,0.85)",fontSize:n.TYPOGRAPHY.SIZE_SM,fontFamily:"Menlo",lineHeight:18},inlineCode:{backgroundColor:"rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.9)",fontFamily:"Menlo",fontSize:n.TYPOGRAPHY.SIZE_MD,paddingHorizontal:4,borderRadius:3},heading1:{color:n.COLORS.TEXT_PRIMARY,fontSize:n.TYPOGRAPHY.SIZE_XL,fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD,lineHeight:24,marginTop:n.SPACING.MD,marginBottom:n.SPACING.XS},heading2:{color:"rgba(255,255,255,0.9)",fontSize:n.TYPOGRAPHY.SIZE_LG,fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD,lineHeight:22,marginTop:n.SPACING.SM,marginBottom:n.SPACING.XS},heading3:{color:"rgba(255,255,255,0.85)",fontSize:n.TYPOGRAPHY.SIZE_LG,fontWeight:n.TYPOGRAPHY.WEIGHT_MEDIUM,lineHeight:22,marginTop:n.SPACING.SM,marginBottom:n.SPACING.XS},boldText:{fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD,color:n.COLORS.TEXT_PRIMARY},italicText:{fontStyle:"italic",color:"rgba(255,255,255,0.85)"},strikethroughText:{textDecorationLine:"line-through",color:n.COLORS.TEXT_MUTED},linkText:{color:n.COLORS.STATUS_INFO,textDecorationLine:"underline"},blockquote:{borderLeftWidth:3,borderLeftColor:"rgba(255,255,255,0.15)",paddingLeft:n.SPACING.MD,marginVertical:n.SPACING.XS},blockquoteText:{color:n.COLORS.TEXT_SECONDARY,fontSize:n.TYPOGRAPHY.SIZE_LG,lineHeight:22,fontStyle:"italic"},horizontalRule:{height:1,backgroundColor:n.COLORS.BORDER,marginVertical:n.SPACING.MD},paragraphBreak:{height:n.SPACING.SM}})},490,[29,63,258,487,250]);
|
|
543
543
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.GitChangesTab=function(c){var f=c.changes,x=c.onDiscard;if(!(f.length>0))return(0,n.jsxs)(t.View,{style:s.emptyContainer,children:[(0,n.jsx)(t.Text,{style:s.emptyTitle,children:"No uncommitted changes"}),(0,n.jsx)(t.Text,{style:s.emptySubtext,children:"Your working directory is clean"})]});return(0,n.jsxs)(t.View,{style:s.container,children:[(0,n.jsx)(t.ScrollView,{style:s.fileList,contentContainerStyle:s.fileListContent,children:f.map((c,f)=>(0,n.jsxs)(t.View,{style:s.fileRow,children:[(0,n.jsx)(t.Text,{style:[s.statusIcon,{color:l[c.status]}],children:o[c.status]}),(0,n.jsx)(t.Text,{style:s.fileName,numberOfLines:1,children:c.file})]},`${c.file}-${f}`))}),(0,n.jsxs)(t.View,{style:s.footer,children:[(0,n.jsx)(t.TouchableOpacity,{style:s.discardButton,onPress:x,children:(0,n.jsx)(t.Text,{style:s.discardText,children:"Discard All Changes"})}),(0,n.jsx)(t.Text,{style:s.warningText,children:"Note: Discarding won't reset memory"})]})]})},r(d[0]);var t=r(d[1]),n=r(d[2]),o={added:"A",modified:"M",deleted:"D",renamed:"R",untracked:"?"},l={added:"#30D158",modified:"#FFD60A",deleted:"#FF453A",renamed:"#BF5AF2",untracked:"#8E8E93"};var s=t.StyleSheet.create({container:{flex:1,backgroundColor:"#000"},emptyContainer:{flex:1,backgroundColor:"#000",alignItems:"center",justifyContent:"center",padding:24},emptyTitle:{color:"rgba(255,255,255,0.6)",fontSize:16,fontWeight:"500",marginBottom:8},emptySubtext:{color:"rgba(255,255,255,0.4)",fontSize:14},fileList:{flex:1},fileListContent:{padding:16},fileRow:{flexDirection:"row",alignItems:"center",paddingVertical:8,borderBottomWidth:1,borderBottomColor:"rgba(255,255,255,0.06)"},statusIcon:{width:20,fontSize:13,fontWeight:"600",fontFamily:"Menlo"},fileName:{flex:1,color:"rgba(255,255,255,0.8)",fontSize:14,fontFamily:"Menlo"},footer:{padding:16,borderTopWidth:1,borderTopColor:"rgba(255,255,255,0.08)",alignItems:"center"},discardButton:{backgroundColor:"rgba(255,59,48,0.15)",borderRadius:12,paddingVertical:12,paddingHorizontal:24,marginBottom:8},discardText:{color:"#FF3B30",fontSize:15,fontWeight:"500"},warningText:{color:"rgba(255,255,255,0.3)",fontSize:12}})},491,[63,258,250]);
|
|
544
544
|
__d(function(g,r,_i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.BranchSwitcher=function(e){var t=e.branches,s=e.currentBranch,S=e.loading,b=e.onSelect,C=e.onCreate,p=e.onClose,I=e.error,P=(0,o.useState)(!1),x=(0,n.default)(P,2),f=x[0],A=x[1],O=(0,o.useState)(""),R=(0,n.default)(O,2),G=R[0],y=R[1],M=u(t,""),E=()=>{var e=G.trim();e&&(C(e),y(""),A(!1))},H=(e,t)=>{var n=e.name===s;return(0,c.jsxs)(i.TouchableOpacity,{style:[T.branchItem,n&&T.branchItemCurrent,t&&T.branchItemFirst],onPress:()=>{n||b(e.name)},activeOpacity:n?1:.6,children:[(0,c.jsxs)(i.View,{style:T.branchInfo,children:[(0,c.jsx)(i.Text,{style:[T.branchName,n&&T.branchNameCurrent],numberOfLines:1,children:e.name}),e.prNumber&&(0,c.jsx)(i.View,{style:T.prBadge,children:(0,c.jsxs)(i.Text,{style:T.prBadgeText,children:["#",e.prNumber]})}),e.isRemote&&(0,c.jsx)(i.View,{style:T.remoteBadge,children:(0,c.jsx)(i.Text,{style:T.remoteBadgeText,children:"remote"})})]}),n&&(0,c.jsx)(i.Text,{style:T.currentIndicator,children:"\u2713"})]},e.name)};return(0,c.jsxs)(i.View,{style:T.overlay,children:[(0,c.jsx)(i.TouchableOpacity,{style:T.backdrop,onPress:p,activeOpacity:1}),(0,c.jsxs)(i.View,{style:T.dropdown,children:[I&&(0,c.jsx)(i.View,{style:T.errorBanner,children:(0,c.jsx)(i.Text,{style:T.errorText,numberOfLines:2,children:I})}),S&&0===t.length?(0,c.jsx)(i.View,{style:T.loadingContainer,children:(0,c.jsx)(h,{})}):(0,c.jsx)(i.ScrollView,{style:T.branchList,bounces:!1,children:M.map(e=>(0,c.jsxs)(i.View,{children:[(0,c.jsx)(i.View,{style:T.sectionHeader,children:(0,c.jsx)(i.Text,{style:T.sectionHeaderText,children:e.title})}),e.branches.map((e,t)=>H(e,0===t))]},e.title))}),(0,c.jsx)(i.View,{style:T.createSection,children:f?(0,c.jsxs)(i.View,{style:T.createInputRow,children:[(0,c.jsx)(i.TextInput,{style:T.createInput,value:G,onChangeText:y,placeholder:"branch-name",placeholderTextColor:l.COLORS.TEXT_MUTED,autoFocus:!0,autoCapitalize:"none",autoCorrect:!1,onSubmitEditing:E,returnKeyType:"done"}),(0,c.jsx)(i.TouchableOpacity,{style:[T.createConfirmButton,!G.trim()&&T.createConfirmDisabled],onPress:E,disabled:!G.trim(),children:(0,c.jsx)(i.Text,{style:T.createConfirmText,children:"Create"})})]}):(0,c.jsx)(i.TouchableOpacity,{style:T.createButton,onPress:()=>A(!0),children:(0,c.jsx)(i.Text,{style:T.createButtonText,children:"+ New branch from main"})})})]})]})};var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e},o=r(d[1]),i=r(d[2]),l=r(d[3]),c=r(d[4]),s=["main","master"],S=5;function u(e,t){var n=t.toLowerCase().trim(),o=n?e.filter(e=>e.name.toLowerCase().includes(n)):e,i=o.filter(e=>s.includes(e.name)),l=o.filter(e=>!s.includes(e.name)),c=l.filter(e=>!e.isRemote).slice(0,S),u=new Set(c.map(e=>e.name)),h=l.filter(e=>!u.has(e.name)),T=[];return i.length>0&&T.push({title:"Default",branches:i}),c.length>0&&T.push({title:"Recent",branches:c}),h.length>0&&T.push({title:"Other",branches:h}),T}function h(){var e=(0,o.useRef)(new i.Animated.Value(.3)).current,t=(0,o.useRef)(new i.Animated.Value(.3)).current,n=(0,o.useRef)(new i.Animated.Value(.3)).current;return(0,o.useEffect)(()=>{var o=(e,t)=>i.Animated.loop(i.Animated.sequence([i.Animated.delay(t),i.Animated.timing(e,{toValue:1,duration:300,easing:i.Easing.inOut(i.Easing.ease),useNativeDriver:!0}),i.Animated.timing(e,{toValue:.3,duration:300,easing:i.Easing.inOut(i.Easing.ease),useNativeDriver:!0})])),l=o(e,0),c=o(t,150),s=o(n,300);return l.start(),c.start(),s.start(),()=>{l.stop(),c.stop(),s.stop()}},[e,t,n]),(0,c.jsx)(i.View,{style:T.loadingDots,children:[e,t,n].map((e,t)=>(0,c.jsx)(i.Animated.View,{style:[T.loadingDot,{opacity:e}]},t))})}var T=i.StyleSheet.create({overlay:{...i.StyleSheet.absoluteFillObject,zIndex:100},backdrop:{...i.StyleSheet.absoluteFillObject,backgroundColor:"rgba(0,0,0,0.3)"},dropdown:{position:"absolute",top:49,left:l.SPACING.SM,right:l.SPACING.SM,maxHeight:"60%",backgroundColor:"#1C1C1E",borderRadius:l.LAYOUT.BORDER_RADIUS_SM,borderWidth:1,borderColor:"rgba(255,255,255,0.12)",overflow:"hidden"},loadingContainer:{paddingVertical:l.SPACING.XL,alignItems:"center",justifyContent:"center"},loadingDots:{flexDirection:"row",gap:6},loadingDot:{width:6,height:6,borderRadius:3,backgroundColor:"rgba(255,255,255,0.5)"},branchList:{maxHeight:300},sectionHeader:{paddingHorizontal:l.SPACING.LG,paddingTop:l.SPACING.MD,paddingBottom:l.SPACING.XS},sectionHeaderText:{color:l.COLORS.TEXT_MUTED,fontSize:l.TYPOGRAPHY.SIZE_XS,fontWeight:l.TYPOGRAPHY.WEIGHT_SEMIBOLD,textTransform:"uppercase",letterSpacing:.5},branchItem:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:l.SPACING.LG,paddingVertical:l.SPACING.MD+2,borderBottomWidth:i.StyleSheet.hairlineWidth,borderBottomColor:"rgba(255,255,255,0.06)"},branchItemFirst:{paddingTop:l.SPACING.MD+2},branchItemCurrent:{backgroundColor:"rgba(255,255,255,0.06)"},branchInfo:{flex:1,flexDirection:"row",alignItems:"center",gap:l.SPACING.SM},branchName:{color:"rgba(255,255,255,0.85)",fontSize:l.TYPOGRAPHY.SIZE_MD,fontWeight:l.TYPOGRAPHY.WEIGHT_NORMAL,flexShrink:1},branchNameCurrent:{color:l.COLORS.TEXT_PRIMARY,fontWeight:l.TYPOGRAPHY.WEIGHT_MEDIUM},prBadge:{backgroundColor:"rgba(0,122,255,0.15)",paddingHorizontal:l.SPACING.SM,paddingVertical:2,borderRadius:8},prBadgeText:{color:l.COLORS.STATUS_INFO,fontSize:l.TYPOGRAPHY.SIZE_XS,fontWeight:l.TYPOGRAPHY.WEIGHT_MEDIUM},remoteBadge:{backgroundColor:"rgba(255,255,255,0.06)",paddingHorizontal:l.SPACING.SM,paddingVertical:2,borderRadius:8},remoteBadgeText:{color:l.COLORS.TEXT_MUTED,fontSize:l.TYPOGRAPHY.SIZE_XS,fontWeight:l.TYPOGRAPHY.WEIGHT_NORMAL},currentIndicator:{color:l.COLORS.STATUS_SUCCESS,fontSize:l.TYPOGRAPHY.SIZE_SM,marginLeft:l.SPACING.SM},createSection:{paddingHorizontal:l.SPACING.LG,paddingVertical:l.SPACING.MD,borderTopWidth:i.StyleSheet.hairlineWidth,borderTopColor:"rgba(255,255,255,0.08)"},createButton:{paddingVertical:l.SPACING.XS},createButtonText:{color:l.COLORS.STATUS_INFO,fontSize:l.TYPOGRAPHY.SIZE_MD,fontWeight:l.TYPOGRAPHY.WEIGHT_MEDIUM},createInputRow:{flexDirection:"row",alignItems:"center",gap:l.SPACING.SM},createInput:{flex:1,backgroundColor:"rgba(255,255,255,0.08)",color:l.COLORS.TEXT_PRIMARY,fontSize:l.TYPOGRAPHY.SIZE_MD,paddingHorizontal:l.SPACING.MD,paddingVertical:l.SPACING.SM,borderRadius:10},createConfirmButton:{backgroundColor:l.COLORS.STATUS_INFO,paddingHorizontal:l.SPACING.MD,paddingVertical:l.SPACING.SM,borderRadius:10},createConfirmDisabled:{opacity:.4},createConfirmText:{color:l.COLORS.TEXT_PRIMARY,fontSize:l.TYPOGRAPHY.SIZE_SM,fontWeight:l.TYPOGRAPHY.WEIGHT_SEMIBOLD},errorBanner:{backgroundColor:"rgba(255,59,48,0.15)",paddingHorizontal:l.SPACING.LG,paddingVertical:l.SPACING.SM,borderBottomWidth:i.StyleSheet.hairlineWidth,borderBottomColor:"rgba(255,59,48,0.3)"},errorText:{color:"#FF6B6B",fontSize:l.TYPOGRAPHY.SIZE_SM}})},492,[29,63,258,487,250]);
|
|
545
|
-
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Header=function(e){var s=e.status,
|
|
545
|
+
__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),_e.Header=function(e){var s=e.status,l=e.branchName,c=e.onBranchPress,O={disconnected:n.COLORS.STATUS_ERROR,connecting:n.COLORS.STATUS_INFO,connected:n.COLORS.STATUS_SUCCESS,sending:n.COLORS.STATUS_INFO,processing:n.COLORS.STATUS_INFO};return(0,o.jsxs)(t.View,{style:T.header,children:[(0,o.jsx)(t.TouchableOpacity,{onPress:u,onLongPress:S,delayLongPress:500,style:T.closeButton,children:(0,o.jsx)(t.Text,{style:T.closeButtonText,children:"\u2715"})}),(0,o.jsx)(t.TouchableOpacity,{style:T.branchButton,onPress:c,disabled:!l,children:l?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.Text,{style:T.branchName,numberOfLines:1,children:l}),(0,o.jsx)(t.Text,{style:T.branchChevron,children:"\u25be"})]}):(0,o.jsx)(t.View,{style:T.branchLoadingBar})}),(0,o.jsx)(t.TouchableOpacity,{onLongPress:S,delayLongPress:500,activeOpacity:.6,hitSlop:{top:10,bottom:10,left:10,right:10},style:T.statusDotTouchable,children:(0,o.jsx)(t.View,{style:[T.statusDot,{backgroundColor:O[s]}]})})]})},_e.PulsingIndicator=function(l){var c=l.status,S={disconnected:n.COLORS.STATUS_ERROR,connecting:n.COLORS.STATUS_INFO,connected:n.COLORS.STATUS_SUCCESS,sending:n.COLORS.STATUS_INFO,processing:n.COLORS.STATUS_INFO},u="processing"===c||"connecting"===c||"sending"===c,O=(0,e.useRef)(new t.Animated.Value(1)).current,h=(0,e.useRef)(new t.Animated.Value(.4)).current;return(0,e.useEffect)(()=>{if(u){var e=t.Animated.loop(t.Animated.sequence([t.Animated.parallel([t.Animated.timing(O,{toValue:1.3,duration:1200,easing:t.Easing.inOut(t.Easing.ease),useNativeDriver:!0}),t.Animated.timing(h,{toValue:0,duration:1200,easing:t.Easing.inOut(t.Easing.ease),useNativeDriver:!0})]),t.Animated.parallel([t.Animated.timing(O,{toValue:1,duration:0,useNativeDriver:!0}),t.Animated.timing(h,{toValue:.4,duration:0,useNativeDriver:!0})])]));return e.start(),()=>e.stop()}O.setValue(1),h.setValue(.4)},[u,O,h]),(0,o.jsxs)(t.View,{style:T.indicatorContainer,children:[(0,o.jsx)(t.View,{style:[T.indicator,{backgroundColor:S[c]}]}),u&&(0,o.jsx)(s,{style:[T.indicatorRing,{borderColor:S[c],transform:[{scale:O}],opacity:h}]})]})};var e=r(d[0]),t=r(d[1]),n=r(d[2]),o=r(d[3]),s=t.Animated.View,l=t.NativeModules.WidgetBridge,c=t.NativeModules.ExpoAir;function S(){try{l?.reloadMainApp?(console.log("[expo-air] Triggering main app reload"),l.reloadMainApp()):console.warn("[expo-air] No reloadMainApp method available")}catch(e){console.warn("[expo-air] Failed to reload main app:",e)}}function u(){try{l?.collapse?l.collapse():c?.collapse?c.collapse():console.warn("[expo-air] No collapse method available")}catch(e){console.warn("[expo-air] Failed to collapse:",e)}}var T=t.StyleSheet.create({header:{flexDirection:"row",alignItems:"center",paddingHorizontal:n.LAYOUT.CONTENT_PADDING_H,paddingVertical:n.SPACING.MD+2,borderBottomWidth:1,borderBottomColor:n.COLORS.BORDER},closeButton:{width:n.SIZES.CLOSE_BUTTON,height:n.SIZES.CLOSE_BUTTON,borderRadius:n.SIZES.CLOSE_BUTTON/2,backgroundColor:"transparent",alignItems:"center",justifyContent:"center",marginRight:n.SPACING.MD},closeButtonText:{color:"transparent",fontSize:n.TYPOGRAPHY.SIZE_MD,fontWeight:n.TYPOGRAPHY.WEIGHT_SEMIBOLD},branchButton:{flex:1,flexDirection:"row",alignItems:"center"},branchName:{flexShrink:1,color:n.COLORS.TEXT_SECONDARY,fontSize:n.TYPOGRAPHY.SIZE_MD,fontWeight:n.TYPOGRAPHY.WEIGHT_MEDIUM},branchChevron:{color:n.COLORS.TEXT_MUTED,fontSize:n.TYPOGRAPHY.SIZE_SM,marginLeft:n.SPACING.XS},branchLoadingBar:{width:80,height:12,borderRadius:6,backgroundColor:"rgba(255,255,255,0.08)"},statusDot:{width:n.SIZES.STATUS_DOT,height:n.SIZES.STATUS_DOT,borderRadius:n.SIZES.STATUS_DOT/2,marginLeft:n.SPACING.MD},statusDotTouchable:{marginLeft:n.SPACING.MD,padding:10},collapsedPill:{width:100,height:32,backgroundColor:"transparent",alignItems:"center",justifyContent:"center"},indicatorContainer:{width:20,height:20,alignItems:"center",justifyContent:"center"},indicator:{width:n.SIZES.STATUS_DOT,height:n.SIZES.STATUS_DOT,borderRadius:n.SIZES.STATUS_DOT/2},indicatorRing:{position:"absolute",width:16,height:16,borderRadius:8,borderWidth:1.5,opacity:.4}})},493,[63,258,487,250]);
|
|
546
546
|
__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),e.TabBar=function(t){var s=t.activeTab,c=t.onTabChange,u=t.onNewSession,h=t.canStartNew,x=t.hasPR,b=t.hasChanges,O=t.prNumber,P=t.onCreatePR,A=t.onCommit,R=t.onViewPR;return(0,o.jsxs)(n.View,{style:T.tabBar,children:[(0,o.jsxs)(n.View,{style:T.tabButtons,children:[(0,o.jsx)(n.TouchableOpacity,{onPress:()=>c("chat"),children:(0,o.jsx)(n.Text,{style:[T.tabText,"chat"===s?T.tabTextActive:T.tabTextInactive],children:"Chat"})}),(0,o.jsx)(n.TouchableOpacity,{onPress:()=>c("changes"),children:(0,o.jsx)(n.Text,{style:[T.tabText,"changes"===s?T.tabTextActive:T.tabTextInactive],children:"Changes"})})]}),"chat"===s?(0,o.jsx)(n.TouchableOpacity,{onPress:u,style:[T.ctaButton,!h&&T.ctaButtonDisabled],disabled:!h,children:(0,o.jsx)(n.Text,{style:[T.ctaText,!h&&T.ctaTextDisabled],children:"New"})}):!x&&b?(0,o.jsx)(l,{onPress:P,children:"Create PR"}):x&&b?(0,o.jsx)(l,{onPress:A,children:"Commit"}):x&&!b&&O?(0,o.jsxs)(l,{onPress:R,children:["#",O]}):null]})};var t=r(d[0]),n=r(d[1]),s=r(d[2]),o=r(d[3]),c=n.Animated.Text;function l(s){var l=s.children,u=s.onPress,h=(0,t.useRef)(new n.Animated.Value(.6)).current;return(0,t.useEffect)(()=>{var t=n.Animated.loop(n.Animated.sequence([n.Animated.timing(h,{toValue:.9,duration:1500,easing:n.Easing.inOut(n.Easing.ease),useNativeDriver:!0}),n.Animated.timing(h,{toValue:.6,duration:1500,easing:n.Easing.inOut(n.Easing.ease),useNativeDriver:!0})]));return t.start(),()=>t.stop()},[h]),(0,o.jsx)(n.TouchableOpacity,{onPress:u,style:T.ctaButton,activeOpacity:.7,children:(0,o.jsx)(c,{style:[T.ctaText,{opacity:h}],children:l})})}var T=n.StyleSheet.create({tabBar:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:s.LAYOUT.CONTENT_PADDING_H,paddingVertical:s.SPACING.SM+2,borderBottomWidth:1,borderBottomColor:s.COLORS.BORDER},tabButtons:{flexDirection:"row",gap:s.SPACING.XL},tabText:{fontSize:s.TYPOGRAPHY.SIZE_LG,fontWeight:s.TYPOGRAPHY.WEIGHT_MEDIUM},tabTextActive:{color:s.COLORS.TEXT_PRIMARY},tabTextInactive:{color:s.COLORS.TEXT_MUTED},ctaButton:{paddingHorizontal:s.SIZES.CTA_PADDING_H,paddingVertical:s.SIZES.CTA_PADDING_V,borderRadius:s.LAYOUT.BORDER_RADIUS_SM,backgroundColor:s.COLORS.BACKGROUND_INTERACTIVE},ctaButtonDisabled:{opacity:.4},ctaText:{color:s.COLORS.TEXT_PRIMARY,fontSize:s.TYPOGRAPHY.SIZE_SM,fontWeight:s.TYPOGRAPHY.WEIGHT_SEMIBOLD},ctaTextDisabled:{opacity:.6}})},494,[63,258,487,250]);
|
|
547
547
|
__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.useWebSocketMessages=function(e){var o=e.serverUrl,p=e.onGitMessage,l=(0,n.useState)("disconnected"),f=(0,s.default)(l,2),v=f[0],h=f[1],b=(0,n.useState)([]),k=(0,s.default)(b,2),y=k[0],_=k[1],C=(0,n.useState)([]),S=(0,s.default)(C,2),w=S[0],M=S[1],P=(0,n.useRef)([]),W=(0,n.useRef)(null),I=(0,n.useRef)(0),N=(0,n.useRef)(!1),x=(0,n.useRef)(p);(0,n.useEffect)(()=>{x.current=p},[p]);var R=(0,n.useCallback)((e,t)=>{var s=P.current;if(s.length>0){var n={type:"assistant_parts",promptId:e,parts:s,isComplete:t,timestamp:Date.now()};_(e=>[...e,n])}P.current=[],W.current=null,M([])},[]),E=(0,n.useCallback)(e=>{switch(e.type){case"stream":if(e.promptId!==W.current&&(P.current.length>0&&W.current&&R(W.current,!1),W.current=e.promptId),!e.done&&e.chunk){var t=P.current,s=t[t.length-1];"text"===s?.type?(s.content+=e.chunk,P.current=[...t]):P.current=[...t,{type:"text",id:"text-"+I.current++,content:e.chunk}],M([...P.current])}break;case"tool":if("started"!==e.status){var n={type:"tool",id:"tool-"+I.current++,toolName:e.toolName,status:e.status,input:e.input,output:e.output,timestamp:e.timestamp};P.current=[...P.current,n],M([...P.current])}break;case"result":if(P.current.length>0){var u={type:"assistant_parts",promptId:e.promptId,parts:P.current,isComplete:!0,timestamp:e.timestamp};if(void 0!==e.costUsd||void 0!==e.durationMs||!e.success&&e.error){var c={...e,result:void 0};_(e=>[...e,u,c])}else _(e=>[...e,u])}else(void 0!==e.costUsd||void 0!==e.durationMs||!e.success&&e.error)&&_(t=>[...t,e]);P.current=[],W.current=null,M([]);break;case"error":if(P.current.length>0&&W.current){var o={type:"assistant_parts",promptId:W.current,parts:P.current,isComplete:!1,timestamp:Date.now()};_(t=>[...t,o,e])}else _(t=>[...t,e]);P.current=[],W.current=null,M([]);break;case"status":"processing"===e.status&&_(e=>{var t=e[e.length-1];return"user_prompt"===t?.type&&t.pending?[...e.slice(0,-1),{...t,pending:!1}]:e});break;case"session_cleared":_([]),P.current=[],W.current=null,I.current=0,M([]);break;case"stopped":P.current.length>0&&W.current?R(W.current,!1):(P.current=[],W.current=null,M([]));break;case"history":var p=e.entries.flatMap(e=>{if("user"===e.role){var t=e.imagePaths&&e.imagePaths.length>0?e.imagePaths.map(e=>({uri:e})):void 0;return[{type:"user_prompt",content:e.content,images:t,timestamp:e.timestamp}]}return"assistant"===e.role?[{type:"history_result",content:e.content,timestamp:e.timestamp}]:"tool"===e.role?[{type:"tool",promptId:"",toolName:e.toolName,status:e.status,input:e.input,output:e.output,timestamp:e.timestamp}]:"system"===e.role?[{type:"system_message",messageType:e.type,content:e.content,timestamp:e.timestamp}]:[]});_(p);break;case"git_status":case"branches_list":case"branch_switched":case"branch_created":x.current(e)}},[R]);(0,n.useEffect)(()=>{console.log("[expo-air] Connecting to:",o?.replace(/([?&])secret=[^&]+/,"$1secret=***"));var e=(0,u.createWebSocketClient)({url:o,onStatusChange:h,onMessage:E,onError:e=>{console.warn("[expo-air] WebSocket error:",e)}});return e.connect(),()=>{e.disconnect()}},[o]),(0,n.useEffect)(()=>(0,c.setupTapHandler)((e,t)=>{var s=(0,u.getWebSocketClient)();s&&!s.isConnected()&&s.connect()}),[]);var T=(0,n.useCallback)((function(){var e=(0,t.default)(function*(e,t){_(s=>[...s,{type:"user_prompt",content:e,images:t,pending:!0,timestamp:Date.now()}]),P.current=[],W.current=null,M([]);var s=t&&t.length>0?t.map(e=>e.uri):void 0,n=(0,u.getWebSocketClient)();if(n&&n.sendPrompt(e,s),!N.current){var o=yield(0,c.requestPushToken)();if(o){var p=(0,u.getWebSocketClient)();p?.isConnected()&&(p.sendPushToken(o),N.current=!0)}}});return function(t,s){return e.apply(this,arguments)}})(),[]),q=(0,n.useCallback)(()=>{var e=(0,u.getWebSocketClient)();e&&e.requestNewSession()},[]),D=(0,n.useCallback)(()=>{var e=(0,u.getWebSocketClient)();e&&e.requestStop()},[]);return{status:v,messages:y,currentParts:w,handleSubmit:T,handleNewSession:q,handleStop:D}};var t=e(r(d[0])),s=e(r(d[1])),n=r(d[2]),u=r(d[3]),c=r(d[4])},495,[346,29,63,496,497]);
|
|
548
548
|
__d(function(g,r,i,a,m,_e,d){"use strict";function t(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"WebSocketClient",{enumerable:!0,get:function(){return n}}),_e.getWebSocketClient=function(){return o},_e.createWebSocketClient=function(t){o&&o.disconnect();return o=new n(t)};var e=t(r(d[0])),s=t(r(d[1])),n=(function(){return(0,s.default)(function t(s){(0,e.default)(this,t),this.ws=null,this.reconnectAttempts=0,this.reconnectTimeout=null,this._status="disconnected",this.shouldReconnect=!0,this.options={reconnectInterval:3e3,maxReconnectAttempts:10,onConnect:()=>{},onDisconnect:()=>{},onMessage:()=>{},onError:()=>{},onStatusChange:()=>{},...s}},[{key:"status",get:function(){return this._status}},{key:"setStatus",value:function(t){this._status=t,this.options.onStatusChange(t)}},{key:"connect",value:function(){if(this.ws?.readyState!==WebSocket.OPEN){this.shouldReconnect=!0,this.setStatus("connecting");try{this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.reconnectAttempts=0,this.setStatus("connected"),this.options.onConnect()},this.ws.onclose=()=>{this.setStatus("disconnected"),this.options.onDisconnect(),this.attemptReconnect()},this.ws.onerror=()=>{var t=new Error("WebSocket error");this.options.onError(t)},this.ws.onmessage=t=>{try{var e=JSON.parse(t.data);this.handleMessage(e)}catch(t){console.warn("[expo-air] Failed to parse message:",t)}}}catch(t){this.options.onError(t),this.attemptReconnect()}}}},{key:"handleMessage",value:function(t){"status"===t.type?"processing"===t.status?this.setStatus("processing"):"idle"!==t.status&&"connected"!==t.status||this.setStatus("connected"):"result"===t.type||"error"===t.type?this.setStatus("connected"):"stopped"!==t.type&&"session_cleared"!==t.type||this.setStatus("connected"),this.options.onMessage(t)}},{key:"attemptReconnect",value:function(){this.shouldReconnect&&(this.reconnectAttempts>=this.options.maxReconnectAttempts?console.log("[expo-air] Max reconnect attempts reached"):(this.reconnectTimeout&&clearTimeout(this.reconnectTimeout),this.reconnectAttempts++,console.log(`[expo-air] Reconnecting... (attempt ${this.reconnectAttempts}/${this.options.maxReconnectAttempts})`),this.reconnectTimeout=setTimeout(()=>{this.connect()},this.options.reconnectInterval)))}},{key:"disconnect",value:function(){this.shouldReconnect=!1,this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.ws&&(this.ws.close(),this.ws=null),this.setStatus("disconnected")}},{key:"sendPrompt",value:function(t,e){if(this.ws&&this.ws.readyState===WebSocket.OPEN){var s={type:"prompt",content:t,id:Math.random().toString(36).substring(2,15)};e&&e.length>0&&(s.imagePaths=e),this.ws.send(JSON.stringify(s)),this.setStatus("sending")}else this.options.onError(new Error("Not connected"))}},{key:"requestNewSession",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"new_session"})):this.options.onError(new Error("Not connected"))}},{key:"requestStop",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"stop"})):this.options.onError(new Error("Not connected"))}},{key:"requestDiscardChanges",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"discard_changes"})):this.options.onError(new Error("Not connected"))}},{key:"sendPushToken",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"register_push_token",token:t}))}},{key:"requestBranches",value:function(){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"list_branches"}))}},{key:"requestSwitchBranch",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"switch_branch",branchName:t})):this.options.onError(new Error("Not connected"))}},{key:"requestCreateBranch",value:function(t){this.ws&&this.ws.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify({type:"create_branch",branchName:t})):this.options.onError(new Error("Not connected"))}},{key:"isConnected",value:function(){return this.ws?.readyState===WebSocket.OPEN}}])})();var o=null},496,[8,9]);
|
package/package.json
CHANGED
package/widget/BubbleContent.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect, useCallback, useRef } from "react";
|
|
2
|
-
import { View, Text, StyleSheet, NativeModules, NativeEventEmitter, Platform } from "react-native";
|
|
2
|
+
import { View, Text, StyleSheet, NativeModules, NativeEventEmitter, Platform, TouchableOpacity } from "react-native";
|
|
3
3
|
|
|
4
4
|
import { PromptInput, type PromptInputHandle } from "./components/PromptInput";
|
|
5
5
|
import { ResponseArea } from "./components/ResponseArea";
|
|
@@ -10,6 +10,19 @@ const AnimatedView = Animated.View as React.ComponentClass<Animated.AnimatedProp
|
|
|
10
10
|
// ExpoAir is the main app's module (fallback)
|
|
11
11
|
const { WidgetBridge, ExpoAir } = NativeModules;
|
|
12
12
|
|
|
13
|
+
function handleReload() {
|
|
14
|
+
try {
|
|
15
|
+
if (WidgetBridge?.reloadMainApp) {
|
|
16
|
+
console.log("[expo-air] Triggering main app reload");
|
|
17
|
+
WidgetBridge.reloadMainApp();
|
|
18
|
+
} else {
|
|
19
|
+
console.warn("[expo-air] No reloadMainApp method available");
|
|
20
|
+
}
|
|
21
|
+
} catch (e) {
|
|
22
|
+
console.warn("[expo-air] Failed to reload main app:", e);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
13
26
|
function handleCollapse() {
|
|
14
27
|
try {
|
|
15
28
|
// Try WidgetBridge first (widget runtime), then ExpoAir (main app)
|
|
@@ -42,7 +55,7 @@ export function Header({ status, branchName, onBranchPress }: HeaderProps) {
|
|
|
42
55
|
|
|
43
56
|
return (
|
|
44
57
|
<View style={styles.header}>
|
|
45
|
-
<TouchableOpacity onPress={handleCollapse} style={styles.closeButton}>
|
|
58
|
+
<TouchableOpacity onPress={handleCollapse} onLongPress={handleReload} delayLongPress={500} style={styles.closeButton}>
|
|
46
59
|
<Text style={styles.closeButtonText}>✕</Text>
|
|
47
60
|
</TouchableOpacity>
|
|
48
61
|
|
|
@@ -59,7 +72,15 @@ export function Header({ status, branchName, onBranchPress }: HeaderProps) {
|
|
|
59
72
|
)}
|
|
60
73
|
</TouchableOpacity>
|
|
61
74
|
|
|
62
|
-
<
|
|
75
|
+
<TouchableOpacity
|
|
76
|
+
onLongPress={handleReload}
|
|
77
|
+
delayLongPress={500}
|
|
78
|
+
activeOpacity={0.6}
|
|
79
|
+
hitSlop={{ top: 10, bottom: 10, left: 10, right: 10 }}
|
|
80
|
+
style={styles.statusDotTouchable}
|
|
81
|
+
>
|
|
82
|
+
<View style={[styles.statusDot, { backgroundColor: statusColors[status] }]} />
|
|
83
|
+
</TouchableOpacity>
|
|
63
84
|
</View>
|
|
64
85
|
);
|
|
65
86
|
}
|
|
@@ -196,7 +217,11 @@ const styles = StyleSheet.create({
|
|
|
196
217
|
width: SIZES.STATUS_DOT,
|
|
197
218
|
height: SIZES.STATUS_DOT,
|
|
198
219
|
borderRadius: SIZES.STATUS_DOT / 2,
|
|
199
|
-
marginLeft: SPACING.MD,
|
|
220
|
+
marginLeft: SPACING.MD,
|
|
221
|
+
},
|
|
222
|
+
statusDotTouchable: {
|
|
223
|
+
marginLeft: SPACING.MD,
|
|
224
|
+
padding: 10,
|
|
200
225
|
},
|
|
201
226
|
collapsedPill: {
|
|
202
227
|
width: 100,
|