@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.js CHANGED
@@ -1807,18 +1807,6 @@ function StudioBottomSheet({
1807
1807
  });
1808
1808
  return () => sub.remove();
1809
1809
  }, [open, resolvedSheetRef]);
1810
- React9.useEffect(() => {
1811
- if (import_react_native7.Platform.OS !== "ios") return;
1812
- const sub = import_react_native7.Keyboard.addListener("keyboardDidHide", () => {
1813
- const sheet = resolvedSheetRef.current;
1814
- if (!sheet || !open) return;
1815
- const targetIndex = snapPoints.length - 1;
1816
- if (currentIndexRef.current === targetIndex) {
1817
- setTimeout(() => sheet.snapToIndex(targetIndex), 10);
1818
- }
1819
- });
1820
- return () => sub.remove();
1821
- }, [open, resolvedSheetRef, snapPoints.length]);
1822
1810
  React9.useEffect(() => {
1823
1811
  const sheet = resolvedSheetRef.current;
1824
1812
  if (!sheet) return;
@@ -5500,7 +5488,6 @@ var import_react_native49 = require("react-native");
5500
5488
  var React34 = __toESM(require("react"));
5501
5489
  var import_react_native45 = require("react-native");
5502
5490
  var import_react_native_safe_area_context4 = require("react-native-safe-area-context");
5503
- var import_react_native_reanimated2 = __toESM(require("react-native-reanimated"));
5504
5491
 
5505
5492
  // src/components/chat/ChatMessageList.tsx
5506
5493
  var React33 = __toESM(require("react"));
@@ -5667,6 +5654,8 @@ var ChatMessageList = React33.forwardRef(
5667
5654
  ref: listRef,
5668
5655
  data: messages,
5669
5656
  keyExtractor: (m) => m.id,
5657
+ keyboardDismissMode: import_react_native44.Platform.OS === "ios" ? "interactive" : "on-drag",
5658
+ keyboardShouldPersistTaps: "handled",
5670
5659
  onScroll: handleScroll,
5671
5660
  scrollEventThrottle: 16,
5672
5661
  showsVerticalScrollIndicator: false,
@@ -5707,7 +5696,6 @@ function ChatPage({
5707
5696
  const insets = (0, import_react_native_safe_area_context4.useSafeAreaInsets)();
5708
5697
  const [composerHeight, setComposerHeight] = React34.useState(0);
5709
5698
  const [keyboardVisible, setKeyboardVisible] = React34.useState(false);
5710
- const animatedKeyboard = (0, import_react_native_reanimated2.useAnimatedKeyboard)();
5711
5699
  React34.useEffect(() => {
5712
5700
  if (import_react_native45.Platform.OS !== "ios") return;
5713
5701
  const show = import_react_native45.Keyboard.addListener("keyboardWillShow", () => setKeyboardVisible(true));
@@ -5718,10 +5706,6 @@ function ChatPage({
5718
5706
  };
5719
5707
  }, []);
5720
5708
  const footerBottomPadding = import_react_native45.Platform.OS === "ios" ? keyboardVisible ? 0 : insets.bottom : insets.bottom + 10;
5721
- const footerAnimatedStyle = (0, import_react_native_reanimated2.useAnimatedStyle)(() => {
5722
- if (import_react_native45.Platform.OS !== "ios") return { paddingBottom: insets.bottom + 10 };
5723
- return { paddingBottom: animatedKeyboard.height.value > 0 ? 0 : insets.bottom };
5724
- });
5725
5709
  const overlayBottom = composerHeight + footerBottomPadding + theme.spacing.lg;
5726
5710
  const bottomInset = composerHeight + footerBottomPadding + theme.spacing.xl;
5727
5711
  const resolvedOverlay = React34.useMemo(() => {
@@ -5737,32 +5721,38 @@ function ChatPage({
5737
5721
  header ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_native45.View, { children: header }) : null,
5738
5722
  topBanner ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_native45.View, { style: { paddingHorizontal: theme.spacing.lg, paddingTop: theme.spacing.sm }, children: topBanner }) : null,
5739
5723
  /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_react_native45.View, { style: { flex: 1 }, children: [
5740
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
5741
- ChatMessageList,
5724
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
5725
+ import_react_native45.View,
5742
5726
  {
5743
- ref: listRef,
5744
- messages,
5745
- showTypingIndicator,
5746
- renderMessageContent,
5747
- onNearBottomChange,
5748
- bottomInset
5727
+ style: { flex: 1 },
5728
+ children: [
5729
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
5730
+ ChatMessageList,
5731
+ {
5732
+ ref: listRef,
5733
+ messages,
5734
+ showTypingIndicator,
5735
+ renderMessageContent,
5736
+ onNearBottomChange,
5737
+ bottomInset
5738
+ }
5739
+ ),
5740
+ resolvedOverlay
5741
+ ]
5749
5742
  }
5750
5743
  ),
5751
- resolvedOverlay,
5752
5744
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
5753
- import_react_native_reanimated2.default.View,
5745
+ import_react_native45.View,
5754
5746
  {
5755
- style: [
5756
- {
5757
- position: "absolute",
5758
- left: 0,
5759
- right: 0,
5760
- bottom: 0,
5761
- paddingHorizontal: theme.spacing.lg,
5762
- paddingTop: theme.spacing.sm
5763
- },
5764
- footerAnimatedStyle
5765
- ],
5747
+ style: {
5748
+ position: "absolute",
5749
+ left: 0,
5750
+ right: 0,
5751
+ bottom: 0,
5752
+ paddingHorizontal: theme.spacing.lg,
5753
+ paddingTop: theme.spacing.sm,
5754
+ paddingBottom: footerBottomPadding
5755
+ },
5766
5756
  children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
5767
5757
  ChatComposer,
5768
5758
  {
@@ -5780,23 +5770,23 @@ function ChatPage({
5780
5770
  // src/components/chat/ScrollToBottomButton.tsx
5781
5771
  var React35 = __toESM(require("react"));
5782
5772
  var import_react_native46 = require("react-native");
5783
- var import_react_native_reanimated3 = __toESM(require("react-native-reanimated"));
5773
+ var import_react_native_reanimated2 = __toESM(require("react-native-reanimated"));
5784
5774
  var import_jsx_runtime48 = require("react/jsx-runtime");
5785
5775
  function ScrollToBottomButton({ visible, onPress, children, style }) {
5786
5776
  const theme = useTheme();
5787
- const progress = (0, import_react_native_reanimated3.useSharedValue)(visible ? 1 : 0);
5777
+ const progress = (0, import_react_native_reanimated2.useSharedValue)(visible ? 1 : 0);
5788
5778
  const [pressed, setPressed] = React35.useState(false);
5789
5779
  React35.useEffect(() => {
5790
- progress.value = (0, import_react_native_reanimated3.withTiming)(visible ? 1 : 0, { duration: 200, easing: import_react_native_reanimated3.Easing.out(import_react_native_reanimated3.Easing.ease) });
5780
+ progress.value = (0, import_react_native_reanimated2.withTiming)(visible ? 1 : 0, { duration: 200, easing: import_react_native_reanimated2.Easing.out(import_react_native_reanimated2.Easing.ease) });
5791
5781
  }, [progress, visible]);
5792
- const animStyle = (0, import_react_native_reanimated3.useAnimatedStyle)(() => ({
5782
+ const animStyle = (0, import_react_native_reanimated2.useAnimatedStyle)(() => ({
5793
5783
  opacity: progress.value,
5794
5784
  transform: [{ translateY: (1 - progress.value) * 20 }]
5795
5785
  }));
5796
5786
  const bg = theme.scheme === "dark" ? "rgba(39,39,42,0.9)" : "rgba(244,244,245,0.95)";
5797
5787
  const border = theme.scheme === "dark" ? withAlpha("#FFFFFF", 0.12) : withAlpha("#000000", 0.08);
5798
5788
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
5799
- import_react_native_reanimated3.default.View,
5789
+ import_react_native_reanimated2.default.View,
5800
5790
  {
5801
5791
  pointerEvents: visible ? "auto" : "none",
5802
5792
  style: [
@@ -6276,10 +6266,13 @@ function StudioOverlay({
6276
6266
  () => confirmMrId ? incomingMergeRequests.find((m) => m.id === confirmMrId) ?? null : null,
6277
6267
  [confirmMrId, incomingMergeRequests]
6278
6268
  );
6279
- const closeSheet = React38.useCallback(() => {
6280
- setSheetOpen(false);
6281
- import_react_native52.Keyboard.dismiss();
6269
+ const handleSheetOpenChange = React38.useCallback((open) => {
6270
+ setSheetOpen(open);
6271
+ if (!open) import_react_native52.Keyboard.dismiss();
6282
6272
  }, []);
6273
+ const closeSheet = React38.useCallback(() => {
6274
+ handleSheetOpenChange(false);
6275
+ }, [handleSheetOpenChange]);
6283
6276
  const openSheet = React38.useCallback(() => setSheetOpen(true), []);
6284
6277
  const goToChat = React38.useCallback(() => {
6285
6278
  setActivePage("chat");
@@ -6338,7 +6331,7 @@ function StudioOverlay({
6338
6331
  );
6339
6332
  return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
6340
6333
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(EdgeGlowFrame, { visible: isTesting, role: "accent", thickness: 40, intensity: 1 }),
6341
- /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(StudioBottomSheet, { open: sheetOpen, onOpenChange: setSheetOpen, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
6334
+ /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(StudioBottomSheet, { open: sheetOpen, onOpenChange: handleSheetOpenChange, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
6342
6335
  StudioSheetPager,
6343
6336
  {
6344
6337
  activePage,