@livo-tv/sdk 1.2.2 → 1.2.3

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.
@@ -2299,13 +2299,13 @@ function BubbleGroup({ className, ...props }) {
2299
2299
  "div",
2300
2300
  {
2301
2301
  "data-slot": "bubble-group",
2302
- className: cn("flex min-w-0 flex-col gap-2", className),
2302
+ className: cn("flex min-w-min flex-col gap-2", className),
2303
2303
  ...props
2304
2304
  }
2305
2305
  );
2306
2306
  }
2307
2307
  var bubbleVariants = classVarianceAuthority.cva(
2308
- "group/bubble relative flex w-fit min-w-0 max-w-[80%] flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",
2308
+ "group/bubble relative flex w-fit min-w-min max-w-full flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",
2309
2309
  {
2310
2310
  variants: {
2311
2311
  variant: {
@@ -2350,7 +2350,7 @@ function BubbleContent({
2350
2350
  props: mergeProps.mergeProps(
2351
2351
  {
2352
2352
  className: cn(
2353
- "w-auto max-w-full rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed [overflow-wrap:break-word] group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",
2353
+ "w-auto max-w-full whitespace-pre-wrap rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed [overflow-wrap:break-word] group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",
2354
2354
  className
2355
2355
  )
2356
2356
  },
@@ -2534,7 +2534,7 @@ function StudioChatPanel({
2534
2534
  const bubbles = group.rows.map((row) => /* @__PURE__ */ jsxRuntime.jsxs(
2535
2535
  "div",
2536
2536
  {
2537
- className: group.mine ? "ml-auto flex w-fit max-w-full flex-col gap-1" : "flex w-fit max-w-full flex-col gap-1",
2537
+ className: group.mine ? "ml-auto flex max-w-[80%] flex-col gap-1 self-end" : "flex max-w-[80%] flex-col gap-1 self-start",
2538
2538
  children: [
2539
2539
  /* @__PURE__ */ jsxRuntime.jsx(
2540
2540
  Bubble,
@@ -4893,7 +4893,11 @@ function isRecorder(participant) {
4893
4893
  function resolvedName(participant, nameOverrides) {
4894
4894
  return nameOverrides.get(participant.id) ?? (participant.userId ? nameOverrides.get(participant.userId) : void 0) ?? participant.name?.trim() ?? "Guest";
4895
4895
  }
4896
- function tileFrom(participant, selfId, pinnedIds, chatSend, nameOverrides) {
4896
+ function resolveTileStageStatus(participant, stageEnabled, fallback) {
4897
+ if (!stageEnabled) return "ON_STAGE";
4898
+ return participant.stageStatus ?? fallback ?? "OFF_STAGE";
4899
+ }
4900
+ function tileFrom(participant, selfId, pinnedIds, chatSend, nameOverrides, stageStatus) {
4897
4901
  return {
4898
4902
  id: participant.id,
4899
4903
  userId: participant.userId ?? "",
@@ -4903,7 +4907,7 @@ function tileFrom(participant, selfId, pinnedIds, chatSend, nameOverrides) {
4903
4907
  videoEnabled: participant.videoEnabled === true,
4904
4908
  screenShareEnabled: participant.screenShareEnabled === true,
4905
4909
  picture: participant.picture ?? null,
4906
- stageStatus: participant.stageStatus ?? "ON_STAGE",
4910
+ stageStatus,
4907
4911
  pinned: participant.isPinned === true || pinnedIds.has(participant.id),
4908
4912
  chatCanSend: chatSend.get(participant.id) ?? true
4909
4913
  };
@@ -5445,7 +5449,7 @@ function studioMeetingFromRtk(raw) {
5445
5449
  notifyStage();
5446
5450
  },
5447
5451
  async joinStage() {
5448
- if (currentStageStatus() === "ON_STAGE") {
5452
+ if (meeting.self?.stageStatus === "ON_STAGE") {
5449
5453
  notifyStage();
5450
5454
  return;
5451
5455
  }
@@ -5454,14 +5458,15 @@ function studioMeetingFromRtk(raw) {
5454
5458
  notifyStage();
5455
5459
  return;
5456
5460
  }
5461
+ const userId = meeting.self?.userId;
5462
+ if (userId) {
5463
+ await meeting.stage?.grantAccess?.([userId]);
5464
+ }
5457
5465
  try {
5458
5466
  await meeting.stage?.join?.();
5459
- } catch {
5460
- const userId = meeting.self?.userId;
5461
- if (userId) {
5462
- await meeting.stage?.grantAccess?.([userId]);
5463
- }
5464
- await meeting.stage?.join?.();
5467
+ } catch (error) {
5468
+ notifyStage();
5469
+ throw error;
5465
5470
  }
5466
5471
  joinedStageLocally = true;
5467
5472
  await republishCameraIfOn();
@@ -5469,6 +5474,7 @@ function studioMeetingFromRtk(raw) {
5469
5474
  },
5470
5475
  async leaveStage() {
5471
5476
  await meeting.stage?.leave?.();
5477
+ joinedStageLocally = false;
5472
5478
  notifyStage();
5473
5479
  },
5474
5480
  stageStatus() {
@@ -5550,10 +5556,27 @@ function studioMeetingFromRtk(raw) {
5550
5556
  participants() {
5551
5557
  const self = meeting.self;
5552
5558
  const pinned = pinnedIdSet();
5553
- const joinedRows = asList(meeting.participants?.joined).filter((row) => row.id !== self?.id && !isRecorder(row)).map((row) => tileFrom(row, self?.id, pinned, chatSend, nameOverrides));
5559
+ const stageEnabled = self?.permissions?.stageEnabled !== false;
5560
+ const joinedRows = asList(meeting.participants?.joined).filter((row) => row.id !== self?.id && !isRecorder(row)).map(
5561
+ (row) => tileFrom(
5562
+ row,
5563
+ self?.id,
5564
+ pinned,
5565
+ chatSend,
5566
+ nameOverrides,
5567
+ resolveTileStageStatus(row, stageEnabled)
5568
+ )
5569
+ );
5554
5570
  if (self?.id && !isRecorder(self)) {
5555
5571
  joinedRows.unshift(
5556
- tileFrom(self, self.id, pinned, chatSend, nameOverrides)
5572
+ tileFrom(
5573
+ self,
5574
+ self.id,
5575
+ pinned,
5576
+ chatSend,
5577
+ nameOverrides,
5578
+ resolveTileStageStatus(self, stageEnabled, meeting.stage?.status)
5579
+ )
5557
5580
  );
5558
5581
  }
5559
5582
  return joinedRows;