@comergehq/studio 0.1.8 → 0.1.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/dist/index.mjs CHANGED
@@ -1682,11 +1682,11 @@ function RuntimeRenderer({ appKey, bundlePath, renderToken, style }) {
1682
1682
 
1683
1683
  // src/studio/ui/StudioOverlay.tsx
1684
1684
  import * as React38 from "react";
1685
- import { Keyboard as Keyboard5, Platform as Platform7, View as View44, useWindowDimensions as useWindowDimensions4 } from "react-native";
1685
+ import { Keyboard as Keyboard5, Platform as Platform8, View as View44, useWindowDimensions as useWindowDimensions4 } from "react-native";
1686
1686
 
1687
1687
  // src/components/studio-sheet/StudioBottomSheet.tsx
1688
1688
  import * as React9 from "react";
1689
- import { AppState as AppState2, Keyboard, Platform as Platform2, View as View4 } from "react-native";
1689
+ import { AppState as AppState2, Keyboard, View as View4 } from "react-native";
1690
1690
  import BottomSheet from "@gorhom/bottom-sheet";
1691
1691
  import { useSafeAreaInsets } from "react-native-safe-area-context";
1692
1692
 
@@ -1777,18 +1777,6 @@ function StudioBottomSheet({
1777
1777
  });
1778
1778
  return () => sub.remove();
1779
1779
  }, [open, resolvedSheetRef]);
1780
- React9.useEffect(() => {
1781
- if (Platform2.OS !== "ios") return;
1782
- const sub = Keyboard.addListener("keyboardDidHide", () => {
1783
- const sheet = resolvedSheetRef.current;
1784
- if (!sheet || !open) return;
1785
- const targetIndex = snapPoints.length - 1;
1786
- if (currentIndexRef.current === targetIndex) {
1787
- setTimeout(() => sheet.snapToIndex(targetIndex), 10);
1788
- }
1789
- });
1790
- return () => sub.remove();
1791
- }, [open, resolvedSheetRef, snapPoints.length]);
1792
1780
  React9.useEffect(() => {
1793
1781
  const sheet = resolvedSheetRef.current;
1794
1782
  if (!sheet) return;
@@ -5524,13 +5512,12 @@ import { ActivityIndicator as ActivityIndicator8, View as View41 } from "react-n
5524
5512
 
5525
5513
  // src/components/chat/ChatPage.tsx
5526
5514
  import * as React34 from "react";
5527
- import { Keyboard as Keyboard4, Platform as Platform6, View as View37 } from "react-native";
5515
+ import { Keyboard as Keyboard4, Platform as Platform7, View as View37 } from "react-native";
5528
5516
  import { useSafeAreaInsets as useSafeAreaInsets4 } from "react-native-safe-area-context";
5529
- import Animated11, { useAnimatedKeyboard, useAnimatedStyle as useAnimatedStyle2 } from "react-native-reanimated";
5530
5517
 
5531
5518
  // src/components/chat/ChatMessageList.tsx
5532
5519
  import * as React33 from "react";
5533
- import { View as View36 } from "react-native";
5520
+ import { Platform as Platform6, View as View36 } from "react-native";
5534
5521
  import { BottomSheetFlatList } from "@gorhom/bottom-sheet";
5535
5522
 
5536
5523
  // src/components/chat/ChatMessageBubble.tsx
@@ -5693,6 +5680,8 @@ var ChatMessageList = React33.forwardRef(
5693
5680
  ref: listRef,
5694
5681
  data: messages,
5695
5682
  keyExtractor: (m) => m.id,
5683
+ keyboardDismissMode: Platform6.OS === "ios" ? "interactive" : "on-drag",
5684
+ keyboardShouldPersistTaps: "handled",
5696
5685
  onScroll: handleScroll,
5697
5686
  scrollEventThrottle: 16,
5698
5687
  showsVerticalScrollIndicator: false,
@@ -5733,9 +5722,8 @@ function ChatPage({
5733
5722
  const insets = useSafeAreaInsets4();
5734
5723
  const [composerHeight, setComposerHeight] = React34.useState(0);
5735
5724
  const [keyboardVisible, setKeyboardVisible] = React34.useState(false);
5736
- const animatedKeyboard = useAnimatedKeyboard();
5737
5725
  React34.useEffect(() => {
5738
- if (Platform6.OS !== "ios") return;
5726
+ if (Platform7.OS !== "ios") return;
5739
5727
  const show = Keyboard4.addListener("keyboardWillShow", () => setKeyboardVisible(true));
5740
5728
  const hide = Keyboard4.addListener("keyboardWillHide", () => setKeyboardVisible(false));
5741
5729
  return () => {
@@ -5743,11 +5731,7 @@ function ChatPage({
5743
5731
  hide.remove();
5744
5732
  };
5745
5733
  }, []);
5746
- const footerBottomPadding = Platform6.OS === "ios" ? keyboardVisible ? 0 : insets.bottom : insets.bottom + 10;
5747
- const footerAnimatedStyle = useAnimatedStyle2(() => {
5748
- if (Platform6.OS !== "ios") return { paddingBottom: insets.bottom + 10 };
5749
- return { paddingBottom: animatedKeyboard.height.value > 0 ? 0 : insets.bottom };
5750
- });
5734
+ const footerBottomPadding = Platform7.OS === "ios" ? keyboardVisible ? 0 : insets.bottom : insets.bottom + 10;
5751
5735
  const overlayBottom = composerHeight + footerBottomPadding + theme.spacing.lg;
5752
5736
  const bottomInset = composerHeight + footerBottomPadding + theme.spacing.xl;
5753
5737
  const resolvedOverlay = React34.useMemo(() => {
@@ -5763,32 +5747,38 @@ function ChatPage({
5763
5747
  header ? /* @__PURE__ */ jsx47(View37, { children: header }) : null,
5764
5748
  topBanner ? /* @__PURE__ */ jsx47(View37, { style: { paddingHorizontal: theme.spacing.lg, paddingTop: theme.spacing.sm }, children: topBanner }) : null,
5765
5749
  /* @__PURE__ */ jsxs29(View37, { style: { flex: 1 }, children: [
5766
- /* @__PURE__ */ jsx47(
5767
- ChatMessageList,
5750
+ /* @__PURE__ */ jsxs29(
5751
+ View37,
5768
5752
  {
5769
- ref: listRef,
5770
- messages,
5771
- showTypingIndicator,
5772
- renderMessageContent,
5773
- onNearBottomChange,
5774
- bottomInset
5753
+ style: { flex: 1 },
5754
+ children: [
5755
+ /* @__PURE__ */ jsx47(
5756
+ ChatMessageList,
5757
+ {
5758
+ ref: listRef,
5759
+ messages,
5760
+ showTypingIndicator,
5761
+ renderMessageContent,
5762
+ onNearBottomChange,
5763
+ bottomInset
5764
+ }
5765
+ ),
5766
+ resolvedOverlay
5767
+ ]
5775
5768
  }
5776
5769
  ),
5777
- resolvedOverlay,
5778
5770
  /* @__PURE__ */ jsx47(
5779
- Animated11.View,
5771
+ View37,
5780
5772
  {
5781
- style: [
5782
- {
5783
- position: "absolute",
5784
- left: 0,
5785
- right: 0,
5786
- bottom: 0,
5787
- paddingHorizontal: theme.spacing.lg,
5788
- paddingTop: theme.spacing.sm
5789
- },
5790
- footerAnimatedStyle
5791
- ],
5773
+ style: {
5774
+ position: "absolute",
5775
+ left: 0,
5776
+ right: 0,
5777
+ bottom: 0,
5778
+ paddingHorizontal: theme.spacing.lg,
5779
+ paddingTop: theme.spacing.sm,
5780
+ paddingBottom: footerBottomPadding
5781
+ },
5792
5782
  children: /* @__PURE__ */ jsx47(
5793
5783
  ChatComposer,
5794
5784
  {
@@ -5806,7 +5796,7 @@ function ChatPage({
5806
5796
  // src/components/chat/ScrollToBottomButton.tsx
5807
5797
  import * as React35 from "react";
5808
5798
  import { Pressable as Pressable12, View as View38 } from "react-native";
5809
- import Animated12, { Easing as Easing2, useAnimatedStyle as useAnimatedStyle3, useSharedValue as useSharedValue2, withTiming as withTiming2 } from "react-native-reanimated";
5799
+ import Animated11, { Easing as Easing2, useAnimatedStyle as useAnimatedStyle2, useSharedValue as useSharedValue2, withTiming as withTiming2 } from "react-native-reanimated";
5810
5800
  import { jsx as jsx48 } from "react/jsx-runtime";
5811
5801
  function ScrollToBottomButton({ visible, onPress, children, style }) {
5812
5802
  const theme = useTheme();
@@ -5815,14 +5805,14 @@ function ScrollToBottomButton({ visible, onPress, children, style }) {
5815
5805
  React35.useEffect(() => {
5816
5806
  progress.value = withTiming2(visible ? 1 : 0, { duration: 200, easing: Easing2.out(Easing2.ease) });
5817
5807
  }, [progress, visible]);
5818
- const animStyle = useAnimatedStyle3(() => ({
5808
+ const animStyle = useAnimatedStyle2(() => ({
5819
5809
  opacity: progress.value,
5820
5810
  transform: [{ translateY: (1 - progress.value) * 20 }]
5821
5811
  }));
5822
5812
  const bg = theme.scheme === "dark" ? "rgba(39,39,42,0.9)" : "rgba(244,244,245,0.95)";
5823
5813
  const border = theme.scheme === "dark" ? withAlpha("#FFFFFF", 0.12) : withAlpha("#000000", 0.08);
5824
5814
  return /* @__PURE__ */ jsx48(
5825
- Animated12.View,
5815
+ Animated11.View,
5826
5816
  {
5827
5817
  pointerEvents: visible ? "auto" : "none",
5828
5818
  style: [
@@ -6306,17 +6296,20 @@ function StudioOverlay({
6306
6296
  () => confirmMrId ? incomingMergeRequests.find((m) => m.id === confirmMrId) ?? null : null,
6307
6297
  [confirmMrId, incomingMergeRequests]
6308
6298
  );
6309
- const closeSheet = React38.useCallback(() => {
6310
- setSheetOpen(false);
6311
- Keyboard5.dismiss();
6299
+ const handleSheetOpenChange = React38.useCallback((open) => {
6300
+ setSheetOpen(open);
6301
+ if (!open) Keyboard5.dismiss();
6312
6302
  }, []);
6303
+ const closeSheet = React38.useCallback(() => {
6304
+ handleSheetOpenChange(false);
6305
+ }, [handleSheetOpenChange]);
6313
6306
  const openSheet = React38.useCallback(() => setSheetOpen(true), []);
6314
6307
  const goToChat = React38.useCallback(() => {
6315
6308
  setActivePage("chat");
6316
6309
  openSheet();
6317
6310
  }, [openSheet]);
6318
6311
  const backToPreview = React38.useCallback(() => {
6319
- if (Platform7.OS !== "ios") {
6312
+ if (Platform8.OS !== "ios") {
6320
6313
  Keyboard5.dismiss();
6321
6314
  setActivePage("preview");
6322
6315
  return;
@@ -6368,7 +6361,7 @@ function StudioOverlay({
6368
6361
  );
6369
6362
  return /* @__PURE__ */ jsxs34(Fragment6, { children: [
6370
6363
  /* @__PURE__ */ jsx55(EdgeGlowFrame, { visible: isTesting, role: "accent", thickness: 40, intensity: 1 }),
6371
- /* @__PURE__ */ jsx55(StudioBottomSheet, { open: sheetOpen, onOpenChange: setSheetOpen, children: /* @__PURE__ */ jsx55(
6364
+ /* @__PURE__ */ jsx55(StudioBottomSheet, { open: sheetOpen, onOpenChange: handleSheetOpenChange, children: /* @__PURE__ */ jsx55(
6372
6365
  StudioSheetPager,
6373
6366
  {
6374
6367
  activePage,