@nivaro/react 0.2.55 → 0.3.0

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.
Files changed (60) hide show
  1. package/dist/components/slots/TasksSlot.js +31 -29
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +101 -1
  5. package/dist/index.js +538 -525
  6. package/dist/shared/components/ItemEditForm.js +666 -658
  7. package/dist/shared/components/MyWorkView.js +47 -37
  8. package/dist/shared/components/ProfileView.js +163 -144
  9. package/dist/shared/components/ai/AiPlanCard.js +427 -0
  10. package/dist/shared/components/ai/AiPlanChanges.js +117 -0
  11. package/dist/shared/components/ai/TaskDo.js +1022 -0
  12. package/dist/shared/components/chat/ChatAnalyticsView.js +19 -17
  13. package/dist/shared/components/chat/ChatPanel.js +1356 -1317
  14. package/dist/shared/components/chat/HuddleAnalyticsTab.js +198 -0
  15. package/dist/shared/components/chat/RoomHeaderMenu.js +78 -65
  16. package/dist/shared/components/chat/chat-core.js +273 -264
  17. package/dist/shared/components/chat/huddle/HuddleAudioUi.js +397 -0
  18. package/dist/shared/components/chat/huddle/HuddleCallBar.js +296 -0
  19. package/dist/shared/components/chat/huddle/HuddleCallLayer.js +180 -0
  20. package/dist/shared/components/chat/huddle/HuddleCamera.js +124 -0
  21. package/dist/shared/components/chat/huddle/HuddleCollab.js +320 -0
  22. package/dist/shared/components/chat/huddle/HuddleControls.js +82 -121
  23. package/dist/shared/components/chat/huddle/HuddleDraw.js +231 -0
  24. package/dist/shared/components/chat/huddle/HuddleLiveBadge.js +52 -0
  25. package/dist/shared/components/chat/huddle/HuddlePeoplePicker.js +143 -0
  26. package/dist/shared/components/chat/huddle/HuddleScheduleCard.js +190 -0
  27. package/dist/shared/components/chat/huddle/HuddleScheduleForm.js +188 -0
  28. package/dist/shared/components/chat/huddle/HuddleStage.js +184 -89
  29. package/dist/shared/components/chat/huddle/HuddleStageTools.js +197 -0
  30. package/dist/shared/components/chat/huddle/huddle-audio-logic.js +156 -0
  31. package/dist/shared/components/chat/huddle/huddle-audio.js +69 -0
  32. package/dist/shared/components/chat/huddle/huddle-calls.js +129 -0
  33. package/dist/shared/components/chat/huddle/huddle-camera.js +143 -0
  34. package/dist/shared/components/chat/huddle/huddle-collab-store.js +391 -0
  35. package/dist/shared/components/chat/huddle/huddle-device-prefs.js +55 -0
  36. package/dist/shared/components/chat/huddle/huddle-devices.js +99 -0
  37. package/dist/shared/components/chat/huddle/huddle-draw.js +226 -0
  38. package/dist/shared/components/chat/huddle/huddle-follow-bus.js +96 -0
  39. package/dist/shared/components/chat/huddle/huddle-hold.js +62 -0
  40. package/dist/shared/components/chat/huddle/huddle-link-quality.js +159 -0
  41. package/dist/shared/components/chat/huddle/huddle-live.js +82 -0
  42. package/dist/shared/components/chat/huddle/huddle-pip.js +343 -0
  43. package/dist/shared/components/chat/huddle/huddle-quality.js +22 -0
  44. package/dist/shared/components/chat/huddle/huddle-reactions.js +71 -0
  45. package/dist/shared/components/chat/huddle/huddle-ring-refused.js +34 -0
  46. package/dist/shared/components/chat/huddle/huddle-schedule.js +102 -0
  47. package/dist/shared/components/chat/huddle/huddle-sfu.js +176 -0
  48. package/dist/shared/components/chat/huddle/huddle-shortcuts.js +91 -0
  49. package/dist/shared/components/chat/huddle/huddle-speaking.js +100 -0
  50. package/dist/shared/components/chat/huddle/huddle-store.js +431 -157
  51. package/dist/shared/components/chat/huddle/useHuddle.js +46 -38
  52. package/dist/shared/components/chat/huddle/useHuddleAudio.js +35 -0
  53. package/dist/shared/components/item-edit/GroupSection.js +1 -0
  54. package/dist/shared/components/item-edit/RecordChatActions.js +68 -59
  55. package/dist/shared/components/item-edit/UserChip.js +145 -142
  56. package/dist/shared/components/panels/TaskPanel.js +51 -49
  57. package/dist/shared/components/support/TicketDetailSheet.js +57 -42
  58. package/dist/shared/lib/notification-sound.js +25 -16
  59. package/dist/shared/lib/stale-chunk.js +60 -0
  60. package/package.json +2 -1
@@ -8,7 +8,7 @@ import { normalizeReplaySampling as x, replaySampleDraw as Ae, currentReplayRout
8
8
  import { emitReplayTap as Ce, setReplayRecorderMode as N, registerReplayCapture as Ie, clipEndOffset as _e, withClipKind as De } from "../shared/lib/replay-capture.js";
9
9
  import { instrumentConsole as qe, instrumentRequests as Le, redactSecrets as Te } from "../shared/lib/replay-context.js";
10
10
  import { instrumentSocket as Pe } from "../shared/lib/replay-socket.js";
11
- const Ne = "nivaro-react@0.2.55", j = 1e4, Me = 150, Oe = 3e3, Ue = 600, We = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
11
+ const Ne = "nivaro-react@0.3.0", j = 1e4, Me = 150, Oe = 3e3, Ue = 600, We = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
12
12
  function Fe(n) {
13
13
  return typeof n.url != "string" || typeof fetch != "function" ? null : (f, a) => {
14
14
  const l = typeof n.getToken == "function" ? n.getToken() : void 0, d = { "Content-Type": "application/json" };
package/dist/index.d.ts CHANGED
@@ -163,6 +163,8 @@ export declare function AiMemorySuggestions({ suggestions, className }: {
163
163
  className?: string;
164
164
  }): JSX.Element | null;
165
165
 
166
+ declare type AiPlanSubscribe = (event: 'ai:plan', handler: (payload: Record<string, unknown>) => void) => () => void;
167
+
166
168
  export declare function AiReviewCard({ templateId }: {
167
169
  templateId: string;
168
170
  }): React_2.JSX.Element;
@@ -1165,7 +1167,7 @@ export declare function ChatPanel({ open, onClose, renderMessageBody, requestedD
1165
1167
  label?: string;
1166
1168
  nonce: number;
1167
1169
  } | null;
1168
- }): JSX.Element | null;
1170
+ }): JSX.Element;
1169
1171
 
1170
1172
  /** A poll posted into a room (#2337); counts are server-side, anonymous polls carry no voters. */
1171
1173
  declare interface ChatPoll {
@@ -3197,6 +3199,20 @@ export declare interface HeaderWidgetInfo {
3197
3199
  inputBindings: InputBinding[];
3198
3200
  }
3199
3201
 
3202
+ /**
3203
+ * Hold notifications during a huddle (#2852). While I am in a huddle (and
3204
+ * `preferences.huddle_hold_notifications` is not false) the toasts and sounds
3205
+ * for new notifications and chat messages are held: the inbox and the badges
3206
+ * still move, the stage shows a count, and on leaving the held ones are
3207
+ * released as one summary toast and one sound. Critical notifications are
3208
+ * never held (same rule as do not disturb).
3209
+ */
3210
+ declare interface HeldItem {
3211
+ kind: 'notification' | 'chat';
3212
+ title: string;
3213
+ at: number;
3214
+ }
3215
+
3200
3216
  /** GET /help-videos/:id/analytics (authors). */
3201
3217
  declare interface HelpVideoAnalytics {
3202
3218
  views: number;
@@ -3678,6 +3694,9 @@ declare interface Hold {
3678
3694
  hold_ms: number;
3679
3695
  }
3680
3696
 
3697
+ /** Queue one toast-worthy thing; returns true when it was held (caller shows nothing). */
3698
+ export declare function holdNotification(item: Omit<HeldItem, 'at'>): boolean;
3699
+
3681
3700
  /** The house style (#1551): defaults every new help video starts from.
3682
3701
  * Administrators only. */
3683
3702
  export declare function HouseStyleButton(): JSX.Element | null;
@@ -3689,6 +3708,14 @@ export declare function HScrollProxy({ scrollerRef }: {
3689
3708
  scrollerRef: React_2.RefObject<HTMLDivElement | null>;
3690
3709
  }): React_2.JSX.Element | null;
3691
3710
 
3711
+ export declare function HuddleCallLayer(): ReactPortal | null;
3712
+
3713
+ /** Hosts whose own bell toasts `notification:new` skip category `huddle` while this is mounted. */
3714
+ export declare function huddleCallLayerMounted(): boolean;
3715
+
3716
+ /** Am I in a live huddle, with holding on? Read at the moment a toast would fire. */
3717
+ export declare function huddleHolds(prefs: Record<string, unknown> | null | undefined): boolean;
3718
+
3692
3719
  /** Time without real input before someone counts as idle. */
3693
3720
  export declare const IDLE_AFTER_MS: number;
3694
3721
 
@@ -4181,6 +4208,9 @@ export declare function installIntentPrefetch(opts: IntentPrefetchOptions): () =
4181
4208
  /** Idempotent; a no-op outside a browser. Watches for the rest of the page's life. */
4182
4209
  export declare function installReplayTail(): void;
4183
4210
 
4211
+ /** Listen for chunk-load failures (Vite's preload error and unhandled import rejections). */
4212
+ export declare function installStaleChunkRecovery(opts?: StaleChunkRecoveryOptions): () => void;
4213
+
4184
4214
  export declare type IntegrationActionResult = {
4185
4215
  key: string;
4186
4216
  ok: boolean;
@@ -4547,6 +4577,21 @@ export declare function isChatPanelPinned(): boolean;
4547
4577
 
4548
4578
  export declare function isCleanRecording(): boolean;
4549
4579
 
4580
+ /**
4581
+ * Stale code chunks after a deploy. Screens load lazily by hashed file names, and a new
4582
+ * release no longer serves the previous build's files — so a tab opened before the deploy
4583
+ * failed to open any screen it had not visited yet ("Failed to fetch dynamically imported
4584
+ * module") until someone reloaded. During a rolling deploy one replica briefly serves the new
4585
+ * build while another still serves the old one, which makes it likelier.
4586
+ *
4587
+ * `installStaleChunkRecovery()` reloads the tab onto the current build when a chunk fails to
4588
+ * load. A second failure within the window means a reload does not help (the server really
4589
+ * is missing the file, or the network is down): it stops reloading and calls `onGiveUp`, so
4590
+ * the host can say so instead of looping.
4591
+ */
4592
+ /** Whether an error (or a rejection reason) is a code chunk that could not be loaded. */
4593
+ export declare function isStaleChunkError(reason: unknown): boolean;
4594
+
4550
4595
  export declare function ItemActionButtons({ collection, itemId }: {
4551
4596
  collection: string;
4552
4597
  itemId: string;
@@ -7880,6 +7925,8 @@ export declare type RelationOption = {
7880
7925
  raw: Record<string, unknown>;
7881
7926
  };
7882
7927
 
7928
+ export declare function releaseHeld(): HeldItem[];
7929
+
7883
7930
  export declare type RenderFieldProps = {
7884
7931
  field: any;
7885
7932
  value: unknown;
@@ -8851,6 +8898,16 @@ declare interface SpriteSheet {
8851
8898
  interval_ms: number;
8852
8899
  }
8853
8900
 
8901
+ declare interface StaleChunkRecoveryOptions {
8902
+ /** Called instead of a second reload inside the window. */
8903
+ onGiveUp?: () => void;
8904
+ /** Test seams. */
8905
+ storage?: Pick<Storage, 'getItem' | 'setItem'> | null;
8906
+ reload?: () => void;
8907
+ now?: () => number;
8908
+ target?: Pick<Window, 'addEventListener' | 'removeEventListener'>;
8909
+ }
8910
+
8854
8911
  /**
8855
8912
  * Idempotent; safe from an effect that runs more than once, and safe to call
8856
8913
  * from several components — only the first call arms the timer.
@@ -9149,6 +9206,49 @@ declare interface TailRequest {
9149
9206
  /** Feed the bus from a socket.io-style client. Returns the undo. */
9150
9207
  export declare function tapReplaySocket(socket: SocketLike_2): () => void;
9151
9208
 
9209
+ /**
9210
+ * The button + its anchored panel. Renders nothing unless this person may
9211
+ * ask (the server re-checks everything, delegates included).
9212
+ */
9213
+ export declare function TaskDoButton({ task, isAssignee, subscribe, compact, onTaskChanged, className }: {
9214
+ task: TaskDoTask;
9215
+ /** The host already knows (My Work lists only this person's tasks). */
9216
+ isAssignee?: boolean;
9217
+ subscribe?: AiPlanSubscribe;
9218
+ /** Icon-only (list rows). */
9219
+ compact?: boolean;
9220
+ /** The task was completed / a reply was sent from the panel. */
9221
+ onTaskChanged?: () => void;
9222
+ className?: string;
9223
+ }): JSX.Element | null;
9224
+
9225
+ /** The panel body — also usable on its own (a page that already has room). */
9226
+ export declare function TaskDoPanel({ task, subscribe, onTaskChanged }: {
9227
+ task: TaskDoTask;
9228
+ subscribe?: AiPlanSubscribe;
9229
+ onTaskChanged?: () => void;
9230
+ }): JSX.Element;
9231
+
9232
+ /**
9233
+ * "Let AI do this" on a task or a support ticket (#2862–#2866). The button
9234
+ * shows for the person the work is assigned to when an administrator turned
9235
+ * the feature on for that kind; the panel beside it asks the model for a
9236
+ * plan (built and previewed as them by the plan engine), shows the review
9237
+ * figures — run time, hands-on time saved, what each step touches, the risk
9238
+ * and what cannot be rolled back — and then hands over to the plan card
9239
+ * (approve now / later, live progress, retry). After it ran: mark the task
9240
+ * done, draft a reply to the requester (tickets), or undo what AI did.
9241
+ */
9242
+ declare interface TaskDoTask {
9243
+ id: number;
9244
+ /** 'support' = a ticket; anything else = a task. */
9245
+ kind?: string | null;
9246
+ status: string;
9247
+ assignee?: string | null;
9248
+ category_id?: number | null;
9249
+ title?: string;
9250
+ }
9251
+
9152
9252
  export declare function TaskPanel({ collection, item, title, defaultExpanded, queuedTasks, onQueueTask, onRemoveQueuedTask }: {
9153
9253
  collection: string;
9154
9254
  item: string;