@poolse/react-native 3.2.0-dev.0 → 3.2.0-dev.2

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.d.cts CHANGED
@@ -880,6 +880,14 @@ declare const ICONS: {
880
880
  readonly vb: "0 0 24 24";
881
881
  readonly d: "<path d=\"M9 7 4 12l5 5\"/><path d=\"M4 12h9.5a6.5 6.5 0 0 1 6.5 6.5V20\"/>";
882
882
  };
883
+ readonly 'screen-share': {
884
+ readonly vb: "0 0 24 24";
885
+ readonly d: "<rect x=\"2.6\" y=\"4\" width=\"18.8\" height=\"12.6\" rx=\"2\"/><path d=\"M8.4 20.4h7.2\"/><path d=\"M12 16.6v3.8\"/><path d=\"M12 13V7.4\"/><path d=\"M9.4 9.8 12 7.2l2.6 2.6\"/>";
886
+ };
887
+ readonly 'screen-share-off': {
888
+ readonly vb: "0 0 24 24";
889
+ readonly d: "<rect x=\"2.6\" y=\"4\" width=\"18.8\" height=\"12.6\" rx=\"2\"/><path d=\"M8.4 20.4h7.2\"/><path d=\"M12 16.6v3.8\"/><path d=\"M9.6 8 14.4 12.6\"/><path d=\"M14.4 8 9.6 12.6\"/>";
890
+ };
883
891
  readonly search: {
884
892
  readonly vb: "0 0 24 24";
885
893
  readonly d: "<circle cx=\"11\" cy=\"11\" r=\"6.8\"/><path d=\"M20.8 20.8 16 16\"/>";
package/dist/index.d.ts CHANGED
@@ -880,6 +880,14 @@ declare const ICONS: {
880
880
  readonly vb: "0 0 24 24";
881
881
  readonly d: "<path d=\"M9 7 4 12l5 5\"/><path d=\"M4 12h9.5a6.5 6.5 0 0 1 6.5 6.5V20\"/>";
882
882
  };
883
+ readonly 'screen-share': {
884
+ readonly vb: "0 0 24 24";
885
+ readonly d: "<rect x=\"2.6\" y=\"4\" width=\"18.8\" height=\"12.6\" rx=\"2\"/><path d=\"M8.4 20.4h7.2\"/><path d=\"M12 16.6v3.8\"/><path d=\"M12 13V7.4\"/><path d=\"M9.4 9.8 12 7.2l2.6 2.6\"/>";
886
+ };
887
+ readonly 'screen-share-off': {
888
+ readonly vb: "0 0 24 24";
889
+ readonly d: "<rect x=\"2.6\" y=\"4\" width=\"18.8\" height=\"12.6\" rx=\"2\"/><path d=\"M8.4 20.4h7.2\"/><path d=\"M12 16.6v3.8\"/><path d=\"M9.6 8 14.4 12.6\"/><path d=\"M14.4 8 9.6 12.6\"/>";
890
+ };
883
891
  readonly search: {
884
892
  readonly vb: "0 0 24 24";
885
893
  readonly d: "<circle cx=\"11\" cy=\"11\" r=\"6.8\"/><path d=\"M20.8 20.8 16 16\"/>";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { useUser, useMe, useConversations, formatCallLogPreview, useAttachmentUpload, useConversation, useMembers, usePresence, receiptsOf, useMessages, useTyping, useRealtimeStatus, isMessageVisibleTo, computeGroupPosition, canEditOwnMessage, formatDayLabel, callLogDisplayFor, useLiveCall, sameDay, useReactions, useThread, useAttachmentUrl, usePoolse } from '@poolse/react';
1
+ import { useUser, useMe, useConversations, formatCallLogPreview, useAttachmentUpload, useConversation, useMembers, usePresence, receiptsOf, useMessages, useTyping, useMessageStreams, useRealtimeStatus, isMessageVisibleTo, computeGroupPosition, canEditOwnMessage, formatDayLabel, callLogDisplayFor, useLiveCall, sameDay, useReactions, useThread, useAttachmentUrl, usePoolse } from '@poolse/react';
2
2
  import { createContext, forwardRef, useRef, useState, useImperativeHandle, useEffect, useMemo, useCallback, useContext, createElement } from 'react';
3
3
  import { StyleSheet, View, Pressable, TextInput, Text, useWindowDimensions, Animated, Easing, PanResponder, Image, Keyboard, Platform, ScrollView, ActivityIndicator, FlatList, AppState, KeyboardAvoidingView, Modal, Linking } from 'react-native';
4
4
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
@@ -431,6 +431,14 @@ var ICONS = {
431
431
  vb: "0 0 24 24",
432
432
  d: '<path d="M9 7 4 12l5 5"/><path d="M4 12h9.5a6.5 6.5 0 0 1 6.5 6.5V20"/>'
433
433
  },
434
+ "screen-share": {
435
+ vb: "0 0 24 24",
436
+ d: '<rect x="2.6" y="4" width="18.8" height="12.6" rx="2"/><path d="M8.4 20.4h7.2"/><path d="M12 16.6v3.8"/><path d="M12 13V7.4"/><path d="M9.4 9.8 12 7.2l2.6 2.6"/>'
437
+ },
438
+ "screen-share-off": {
439
+ vb: "0 0 24 24",
440
+ d: '<rect x="2.6" y="4" width="18.8" height="12.6" rx="2"/><path d="M8.4 20.4h7.2"/><path d="M12 16.6v3.8"/><path d="M9.6 8 14.4 12.6"/><path d="M14.4 8 9.6 12.6"/>'
441
+ },
434
442
  search: {
435
443
  vb: "0 0 24 24",
436
444
  d: '<circle cx="11" cy="11" r="6.8"/><path d="M20.8 20.8 16 16"/>'
@@ -4252,7 +4260,16 @@ function ConversationView({
4252
4260
  markReadUpTo,
4253
4261
  refetch
4254
4262
  } = useMessages(conversationId);
4255
- const { typing, signalTyping } = useTyping(conversationId);
4263
+ const { typing: typingPeople, signalTyping } = useTyping(conversationId);
4264
+ const streams = useMessageStreams(conversationId);
4265
+ const typing = useMemo(() => {
4266
+ const thinking = streams.filter((s) => s.status === "streaming" && !s.text);
4267
+ if (thinking.length === 0) return typingPeople;
4268
+ const next = new Set(typingPeople);
4269
+ for (const s of thinking) if (s.sender_external_id) next.add(s.sender_external_id);
4270
+ return next;
4271
+ }, [typingPeople, streams]);
4272
+ const visibleStreams = streams.filter((s) => s.text || s.status === "failed");
4256
4273
  const realtimeStatus = useRealtimeStatus();
4257
4274
  useEffect(() => {
4258
4275
  const sub = AppState.addEventListener("change", (next) => {
@@ -4476,7 +4493,37 @@ function ConversationView({
4476
4493
  hasMore,
4477
4494
  onLoadMore: loadMore,
4478
4495
  renderItem,
4479
- ListHeader: /* @__PURE__ */ jsx(TypingIndicator, { typing, ...labelFor ? { labelFor } : {} }),
4496
+ ListHeader: /* @__PURE__ */ jsxs(View, { children: [
4497
+ visibleStreams.map(
4498
+ (stream) => stream.status === "failed" ? /* @__PURE__ */ jsx(
4499
+ Text,
4500
+ {
4501
+ style: [styles22.streamFailed, { color: theme.colors.ink3 }],
4502
+ accessibilityRole: "alert",
4503
+ children: stream.error ? `The agent couldn't reply: ${stream.error}` : "The agent couldn't reply."
4504
+ },
4505
+ stream.id
4506
+ ) : /* @__PURE__ */ jsx(
4507
+ MessageRow,
4508
+ {
4509
+ msg: streamingMessage(stream),
4510
+ meId,
4511
+ reactions: false,
4512
+ attachments: false,
4513
+ actions: false,
4514
+ threads: false,
4515
+ quotations: false,
4516
+ ...labelFor ? { labelFor } : {},
4517
+ ...avatarFor ? { avatarFor } : {},
4518
+ showSenderName: showSenderLabels,
4519
+ showAvatar: showAvatars,
4520
+ markdown
4521
+ },
4522
+ stream.id
4523
+ )
4524
+ ),
4525
+ /* @__PURE__ */ jsx(TypingIndicator, { typing, ...labelFor ? { labelFor } : {} })
4526
+ ] }),
4480
4527
  ...emptyState !== void 0 ? { emptyState } : {}
4481
4528
  }
4482
4529
  ),
@@ -4533,6 +4580,11 @@ var styles22 = StyleSheet.create({
4533
4580
  root: {
4534
4581
  flex: 1
4535
4582
  },
4583
+ streamFailed: {
4584
+ fontSize: 12,
4585
+ marginHorizontal: 16,
4586
+ marginVertical: 4
4587
+ },
4536
4588
  listWrap: {
4537
4589
  flex: 1
4538
4590
  },
@@ -4545,6 +4597,27 @@ var styles22 = StyleSheet.create({
4545
4597
  zIndex: 5
4546
4598
  }
4547
4599
  });
4600
+ function streamingMessage(stream) {
4601
+ const now = (/* @__PURE__ */ new Date()).toISOString();
4602
+ return {
4603
+ id: stream.id,
4604
+ tenant_id: "",
4605
+ conversation_id: stream.conversation_id,
4606
+ sender_id: stream.sender_id,
4607
+ sender_external_id: stream.sender_external_id,
4608
+ type: "text",
4609
+ body: `${stream.text} \u258D`,
4610
+ reply_to_id: null,
4611
+ thread_root_id: null,
4612
+ mentions: [],
4613
+ reactions: {},
4614
+ edited_at: null,
4615
+ deleted_at: null,
4616
+ sequence: Number.MAX_SAFE_INTEGER,
4617
+ inserted_at: now,
4618
+ updated_at: now
4619
+ };
4620
+ }
4548
4621
  function UserPickerSheet({
4549
4622
  visible,
4550
4623
  onClose,