@ai-matrx/office 0.8.42 → 0.8.44

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.
@@ -497,6 +497,8 @@ interface DocumentOtFactoryOptions {
497
497
  /** One per open tab; never reused. */
498
498
  clientId: string;
499
499
  displayName?: string;
500
+ /** The signed-in person's picture, shown on their chip for the other seats. */
501
+ avatarUrl?: string | null;
500
502
  readAntiEntropyIntervalMs?: () => Promise<number>;
501
503
  onNotice?: (n: DocsOtNotice) => void;
502
504
  onIncident?: (i: OpSessionIncident) => void;
@@ -901,6 +903,8 @@ interface WorkbookOtRoomOptions {
901
903
  /** One per open tab; never reused. */
902
904
  clientId: string;
903
905
  displayName?: string;
906
+ /** The signed-in person's picture, shown on their chip for the other seats. */
907
+ avatarUrl?: string | null;
904
908
  readAntiEntropyIntervalMs?: () => Promise<number>;
905
909
  onAwareness?: (states: Map<number, AwarenessState>) => void;
906
910
  onNotice?: (n: SheetsOtNotice) => void;
@@ -497,6 +497,8 @@ interface DocumentOtFactoryOptions {
497
497
  /** One per open tab; never reused. */
498
498
  clientId: string;
499
499
  displayName?: string;
500
+ /** The signed-in person's picture, shown on their chip for the other seats. */
501
+ avatarUrl?: string | null;
500
502
  readAntiEntropyIntervalMs?: () => Promise<number>;
501
503
  onNotice?: (n: DocsOtNotice) => void;
502
504
  onIncident?: (i: OpSessionIncident) => void;
@@ -901,6 +903,8 @@ interface WorkbookOtRoomOptions {
901
903
  /** One per open tab; never reused. */
902
904
  clientId: string;
903
905
  displayName?: string;
906
+ /** The signed-in person's picture, shown on their chip for the other seats. */
907
+ avatarUrl?: string | null;
904
908
  readAntiEntropyIntervalMs?: () => Promise<number>;
905
909
  onAwareness?: (states: Map<number, AwarenessState>) => void;
906
910
  onNotice?: (n: SheetsOtNotice) => void;
@@ -1567,7 +1567,7 @@ function documentOtFactory(o) {
1567
1567
  }
1568
1568
  const doc = new Y2.Doc();
1569
1569
  const awareness = new Awareness2(doc);
1570
- awareness.setLocalState({ uid: o.uid, clientId: o.clientId, name: o.displayName ?? o.uid.slice(0, 8), ts: Date.now() });
1570
+ awareness.setLocalState({ uid: o.uid, clientId: o.clientId, name: o.displayName || "Someone", ...o.avatarUrl ? { avatarUrl: o.avatarUrl } : {}, ts: Date.now() });
1571
1571
  const stopColor = claimCollaboratorColor2(awareness, { uid: o.uid, clientId: o.clientId });
1572
1572
  const carets = new RemoteCaretBook(awareness.clientID);
1573
1573
  const emit = () => onAwareness({ states: new Map(awareness.getStates()), selfUid: o.uid, carets: carets.list() });
@@ -4786,7 +4786,8 @@ async function startWorkbookOtRoom(port, o) {
4786
4786
  awareness.setLocalState({
4787
4787
  uid: o.uid,
4788
4788
  clientId: o.clientId,
4789
- name: o.displayName ?? o.uid.slice(0, 8),
4789
+ name: o.displayName || "Someone",
4790
+ ...o.avatarUrl ? { avatarUrl: o.avatarUrl } : {},
4790
4791
  sheetId: null,
4791
4792
  row: null,
4792
4793
  col: null,