pptx-react-viewer 3.20.1 → 3.21.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.
- package/CHANGELOG.md +13 -0
- package/dist/{AiChatPanel-FIUTFT55.js → AiChatPanel-B3QM7MIC.js} +24 -24
- package/dist/AiChatPanel-B3QM7MIC.js.br +0 -0
- package/dist/AiChatPanel-B3QM7MIC.js.gz +0 -0
- package/dist/{AiChatPanel-7AU4A3A7.mjs → AiChatPanel-UD756KAU.mjs} +3 -3
- package/dist/AiChatPanel-UD756KAU.mjs.br +0 -0
- package/dist/AiChatPanel-UD756KAU.mjs.gz +0 -0
- package/dist/{Area3DChartScene-ZGVLTYDW.js → Area3DChartScene-435BFPLY.js} +2 -2
- package/dist/{Area3DChartScene-ZGVLTYDW.js.br → Area3DChartScene-435BFPLY.js.br} +0 -0
- package/dist/Area3DChartScene-435BFPLY.js.gz +0 -0
- package/dist/{Area3DChartScene-SPRHDMNQ.mjs → Area3DChartScene-MQKUWVMS.mjs} +1 -1
- package/dist/Area3DChartScene-MQKUWVMS.mjs.br +0 -0
- package/dist/Area3DChartScene-MQKUWVMS.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-FJCRJCZV.mjs → Bar3DChartScene-D4GMQGPN.mjs} +1 -1
- package/dist/Bar3DChartScene-D4GMQGPN.mjs.br +0 -0
- package/dist/Bar3DChartScene-D4GMQGPN.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-GVIX7ENI.js → Bar3DChartScene-KEYLVYJA.js} +2 -2
- package/dist/Bar3DChartScene-KEYLVYJA.js.br +0 -0
- package/dist/Bar3DChartScene-KEYLVYJA.js.gz +0 -0
- package/dist/{Line3DChartScene-KP4RMVAQ.mjs → Line3DChartScene-B3AWFXE4.mjs} +1 -1
- package/dist/Line3DChartScene-B3AWFXE4.mjs.br +0 -0
- package/dist/Line3DChartScene-B3AWFXE4.mjs.gz +0 -0
- package/dist/{Line3DChartScene-6C3WDA42.js → Line3DChartScene-JYGXLE56.js} +2 -2
- package/dist/Line3DChartScene-JYGXLE56.js.br +0 -0
- package/dist/Line3DChartScene-JYGXLE56.js.gz +0 -0
- package/dist/{Model3DScene-SH6ZLOXE.mjs → Model3DScene-4TG4YRVM.mjs} +1 -1
- package/dist/Model3DScene-4TG4YRVM.mjs.br +0 -0
- package/dist/Model3DScene-4TG4YRVM.mjs.gz +0 -0
- package/dist/{Model3DScene-SXZYGMN6.js → Model3DScene-JF5J6N6W.js} +2 -2
- package/dist/Model3DScene-JF5J6N6W.js.br +0 -0
- package/dist/Model3DScene-JF5J6N6W.js.gz +0 -0
- package/dist/{PieChart3DScene-F4IE7565.mjs → PieChart3DScene-4BQ6PR7P.mjs} +1 -1
- package/dist/PieChart3DScene-4BQ6PR7P.mjs.br +0 -0
- package/dist/PieChart3DScene-4BQ6PR7P.mjs.gz +0 -0
- package/dist/{PieChart3DScene-V2Q73UEQ.js → PieChart3DScene-CCQWSH3W.js} +2 -2
- package/dist/{PieChart3DScene-V2Q73UEQ.js.br → PieChart3DScene-CCQWSH3W.js.br} +0 -0
- package/dist/PieChart3DScene-CCQWSH3W.js.gz +0 -0
- package/dist/{SurfaceChart3DScene-AXLDY5BB.mjs → SurfaceChart3DScene-FRQC5HBG.mjs} +1 -1
- package/dist/SurfaceChart3DScene-FRQC5HBG.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-FRQC5HBG.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-XUGVYHD2.js → SurfaceChart3DScene-UVZPT6OD.js} +2 -2
- package/dist/{SurfaceChart3DScene-XUGVYHD2.js.br → SurfaceChart3DScene-UVZPT6OD.js.br} +0 -0
- package/dist/SurfaceChart3DScene-UVZPT6OD.js.gz +0 -0
- package/dist/{chunk-ML4MTTPV.js → chunk-BFPIMU6Q.js} +1217 -1022
- package/dist/chunk-BFPIMU6Q.js.br +0 -0
- package/dist/chunk-BFPIMU6Q.js.gz +0 -0
- package/dist/{chunk-JIP6BCRV.mjs → chunk-BXMPXKV5.mjs} +452 -257
- package/dist/chunk-BXMPXKV5.mjs.br +0 -0
- package/dist/chunk-BXMPXKV5.mjs.gz +0 -0
- package/dist/{chunk-GV6LVDBE.mjs → chunk-EJMDD4VV.mjs} +58 -36
- package/dist/chunk-EJMDD4VV.mjs.br +0 -0
- package/dist/{chunk-GV6LVDBE.mjs.gz → chunk-EJMDD4VV.mjs.gz} +0 -0
- package/dist/{chunk-K7TAGREH.js → chunk-H7QPQ4OR.js} +5 -5
- package/dist/chunk-H7QPQ4OR.js.br +0 -0
- package/dist/chunk-H7QPQ4OR.js.gz +0 -0
- package/dist/{chunk-F65J67TW.mjs → chunk-HZEOZUUH.mjs} +1 -1
- package/dist/chunk-HZEOZUUH.mjs.br +0 -0
- package/dist/chunk-HZEOZUUH.mjs.gz +0 -0
- package/dist/{chunk-2BQKGTIF.js → chunk-M6QJKPU2.js} +1101 -1079
- package/dist/chunk-M6QJKPU2.js.br +0 -0
- package/dist/chunk-M6QJKPU2.js.gz +0 -0
- package/dist/chunk-MRWGWKA2.mjs +1076 -0
- package/dist/chunk-MRWGWKA2.mjs.br +0 -0
- package/dist/chunk-MRWGWKA2.mjs.gz +0 -0
- package/dist/{chunk-U46O2NL5.js → chunk-SUZIFHXI.js} +173 -173
- package/dist/chunk-SUZIFHXI.js.br +0 -0
- package/dist/chunk-SUZIFHXI.js.gz +0 -0
- package/dist/{chunk-HN5QJSVB.js → chunk-T6V342NP.js} +404 -100
- package/dist/chunk-T6V342NP.js.br +0 -0
- package/dist/{chunk-HN5QJSVB.js.gz → chunk-T6V342NP.js.gz} +0 -0
- package/dist/{chunk-MWNB4BX5.mjs → chunk-TMTQJAGK.mjs} +401 -101
- package/dist/chunk-TMTQJAGK.mjs.br +0 -0
- package/dist/{chunk-MWNB4BX5.mjs.gz → chunk-TMTQJAGK.mjs.gz} +0 -0
- package/dist/{chunk-OKIHMWGI.mjs → chunk-TOOKJUPG.mjs} +1 -1
- package/dist/chunk-TOOKJUPG.mjs.br +0 -0
- package/dist/{chunk-OKIHMWGI.mjs.gz → chunk-TOOKJUPG.mjs.gz} +0 -0
- package/dist/chunk-YQQXFRZT.js +1160 -0
- package/dist/chunk-YQQXFRZT.js.br +0 -0
- package/dist/chunk-YQQXFRZT.js.gz +0 -0
- package/dist/index.d.ts +60 -2
- package/dist/index.js +46 -46
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +75 -43
- package/dist/internals.js +104 -104
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/viewer/index.d.ts +70 -6
- package/dist/viewer/index.js +26 -26
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +5 -5
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/dist/{y-webrtc-TAJBJIKH.js → y-webrtc-6H3ROPRC.js} +1079 -128
- package/dist/y-webrtc-6H3ROPRC.js.br +0 -0
- package/dist/y-webrtc-6H3ROPRC.js.gz +0 -0
- package/dist/{y-webrtc-7DLWG3LJ.mjs → y-webrtc-XJDH2YTR.mjs} +984 -33
- package/dist/y-webrtc-XJDH2YTR.mjs.br +0 -0
- package/dist/y-webrtc-XJDH2YTR.mjs.gz +0 -0
- package/dist/{y-websocket-YRPS7AFF.js → y-websocket-6ISNPON7.js} +79 -80
- package/dist/y-websocket-6ISNPON7.js.br +0 -0
- package/dist/y-websocket-6ISNPON7.js.gz +0 -0
- package/dist/{y-websocket-HUEA7LH7.mjs → y-websocket-SJ3NCLBZ.mjs} +3 -4
- package/dist/y-websocket-SJ3NCLBZ.mjs.br +0 -0
- package/dist/y-websocket-SJ3NCLBZ.mjs.gz +0 -0
- package/package.json +7 -4
- package/dist/AiChatPanel-7AU4A3A7.mjs.br +0 -0
- package/dist/AiChatPanel-7AU4A3A7.mjs.gz +0 -0
- package/dist/AiChatPanel-FIUTFT55.js.br +0 -0
- package/dist/AiChatPanel-FIUTFT55.js.gz +0 -0
- package/dist/Area3DChartScene-SPRHDMNQ.mjs.br +0 -0
- package/dist/Area3DChartScene-SPRHDMNQ.mjs.gz +0 -0
- package/dist/Area3DChartScene-ZGVLTYDW.js.gz +0 -0
- package/dist/Bar3DChartScene-FJCRJCZV.mjs.br +0 -0
- package/dist/Bar3DChartScene-FJCRJCZV.mjs.gz +0 -0
- package/dist/Bar3DChartScene-GVIX7ENI.js.br +0 -0
- package/dist/Bar3DChartScene-GVIX7ENI.js.gz +0 -0
- package/dist/Line3DChartScene-6C3WDA42.js.br +0 -0
- package/dist/Line3DChartScene-6C3WDA42.js.gz +0 -0
- package/dist/Line3DChartScene-KP4RMVAQ.mjs.br +0 -0
- package/dist/Line3DChartScene-KP4RMVAQ.mjs.gz +0 -0
- package/dist/Model3DScene-SH6ZLOXE.mjs.br +0 -0
- package/dist/Model3DScene-SH6ZLOXE.mjs.gz +0 -0
- package/dist/Model3DScene-SXZYGMN6.js.br +0 -0
- package/dist/Model3DScene-SXZYGMN6.js.gz +0 -0
- package/dist/PieChart3DScene-F4IE7565.mjs.br +0 -0
- package/dist/PieChart3DScene-F4IE7565.mjs.gz +0 -0
- package/dist/PieChart3DScene-V2Q73UEQ.js.gz +0 -0
- package/dist/SurfaceChart3DScene-AXLDY5BB.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-AXLDY5BB.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-XUGVYHD2.js.gz +0 -0
- package/dist/chunk-2BQKGTIF.js.br +0 -0
- package/dist/chunk-2BQKGTIF.js.gz +0 -0
- package/dist/chunk-DWIIYEOG.mjs +0 -9596
- package/dist/chunk-DWIIYEOG.mjs.br +0 -0
- package/dist/chunk-DWIIYEOG.mjs.gz +0 -0
- package/dist/chunk-F65J67TW.mjs.br +0 -0
- package/dist/chunk-F65J67TW.mjs.gz +0 -0
- package/dist/chunk-FXGO5KLU.mjs +0 -304
- package/dist/chunk-FXGO5KLU.mjs.br +0 -0
- package/dist/chunk-FXGO5KLU.mjs.gz +0 -0
- package/dist/chunk-GV6LVDBE.mjs.br +0 -0
- package/dist/chunk-HN5QJSVB.js.br +0 -0
- package/dist/chunk-JIP6BCRV.mjs.br +0 -0
- package/dist/chunk-JIP6BCRV.mjs.gz +0 -0
- package/dist/chunk-K7TAGREH.js.br +0 -0
- package/dist/chunk-K7TAGREH.js.gz +0 -0
- package/dist/chunk-ML4MTTPV.js.br +0 -0
- package/dist/chunk-ML4MTTPV.js.gz +0 -0
- package/dist/chunk-MWNB4BX5.mjs.br +0 -0
- package/dist/chunk-NB7M4XBG.js +0 -318
- package/dist/chunk-NB7M4XBG.js.br +0 -0
- package/dist/chunk-NB7M4XBG.js.gz +0 -0
- package/dist/chunk-OKIHMWGI.mjs.br +0 -0
- package/dist/chunk-U46O2NL5.js.br +0 -0
- package/dist/chunk-U46O2NL5.js.gz +0 -0
- package/dist/chunk-ZYQT7I5C.js +0 -9743
- package/dist/chunk-ZYQT7I5C.js.br +0 -0
- package/dist/chunk-ZYQT7I5C.js.gz +0 -0
- package/dist/y-webrtc-7DLWG3LJ.mjs.br +0 -0
- package/dist/y-webrtc-7DLWG3LJ.mjs.gz +0 -0
- package/dist/y-webrtc-TAJBJIKH.js.br +0 -0
- package/dist/y-webrtc-TAJBJIKH.js.gz +0 -0
- package/dist/y-websocket-HUEA7LH7.mjs.br +0 -0
- package/dist/y-websocket-HUEA7LH7.mjs.gz +0 -0
- package/dist/y-websocket-YRPS7AFF.js.br +0 -0
- package/dist/y-websocket-YRPS7AFF.js.gz +0 -0
- package/dist/yjs-4ED7E5CZ.mjs +0 -2
- package/dist/yjs-4ED7E5CZ.mjs.br +0 -0
- package/dist/yjs-4ED7E5CZ.mjs.gz +0 -0
- package/dist/yjs-OWUA3UHD.js +0 -419
- package/dist/yjs-OWUA3UHD.js.br +0 -0
- package/dist/yjs-OWUA3UHD.js.gz +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -185735,105 +185735,90 @@ function presenceToCursors(presence, activeSlideIndex) {
|
|
|
185735
185735
|
}
|
|
185736
185736
|
return cursors;
|
|
185737
185737
|
}
|
|
185738
|
-
function
|
|
185739
|
-
|
|
185740
|
-
|
|
185741
|
-
|
|
185742
|
-
|
|
185743
|
-
|
|
185744
|
-
|
|
185745
|
-
|
|
185746
|
-
}
|
|
185747
|
-
|
|
185748
|
-
|
|
185749
|
-
|
|
185750
|
-
|
|
185751
|
-
|
|
185752
|
-
|
|
185753
|
-
}
|
|
185754
|
-
|
|
185755
|
-
|
|
185756
|
-
|
|
185757
|
-
|
|
185758
|
-
|
|
185759
|
-
|
|
185760
|
-
|
|
185761
|
-
|
|
185762
|
-
|
|
185763
|
-
|
|
185764
|
-
|
|
185765
|
-
}
|
|
185766
|
-
|
|
185767
|
-
|
|
185768
|
-
function presenceListsEqual(a, b) {
|
|
185769
|
-
if (a === b) {
|
|
185770
|
-
return true;
|
|
185771
|
-
}
|
|
185772
|
-
if (a.length !== b.length) {
|
|
185773
|
-
return false;
|
|
185738
|
+
function observeExternalCollaborationSession(session, onSnapshot) {
|
|
185739
|
+
let active2 = true;
|
|
185740
|
+
let subscribing = true;
|
|
185741
|
+
let previous;
|
|
185742
|
+
let unsubscribe;
|
|
185743
|
+
const notify = () => {
|
|
185744
|
+
if (!active2 || subscribing) {
|
|
185745
|
+
return;
|
|
185746
|
+
}
|
|
185747
|
+
const snapshot = session.getSnapshot();
|
|
185748
|
+
if (previous?.status === snapshot.status && previous.synced === snapshot.synced) {
|
|
185749
|
+
return;
|
|
185750
|
+
}
|
|
185751
|
+
previous = { status: snapshot.status, synced: snapshot.synced };
|
|
185752
|
+
onSnapshot(previous);
|
|
185753
|
+
};
|
|
185754
|
+
const dispose = () => {
|
|
185755
|
+
if (!active2) {
|
|
185756
|
+
return;
|
|
185757
|
+
}
|
|
185758
|
+
active2 = false;
|
|
185759
|
+
unsubscribe?.();
|
|
185760
|
+
};
|
|
185761
|
+
try {
|
|
185762
|
+
unsubscribe = session.subscribe(notify);
|
|
185763
|
+
subscribing = false;
|
|
185764
|
+
notify();
|
|
185765
|
+
} catch (error) {
|
|
185766
|
+
dispose();
|
|
185767
|
+
throw error;
|
|
185774
185768
|
}
|
|
185775
|
-
return
|
|
185776
|
-
const other = b[index];
|
|
185777
|
-
return other !== void 0 && presenceEntriesEqual(entry2, other);
|
|
185778
|
-
});
|
|
185769
|
+
return dispose;
|
|
185779
185770
|
}
|
|
185780
|
-
function
|
|
185781
|
-
let
|
|
185782
|
-
let
|
|
185783
|
-
let
|
|
185784
|
-
let
|
|
185771
|
+
function borrowExternalCollaborationAwareness(host) {
|
|
185772
|
+
let disposed = false;
|
|
185773
|
+
let ownsPresence = false;
|
|
185774
|
+
let hadPresence = false;
|
|
185775
|
+
let previousPresence;
|
|
185776
|
+
let lastPresence;
|
|
185777
|
+
const awareness = {
|
|
185778
|
+
clientID: host.clientID,
|
|
185779
|
+
getStates: () => host.getStates(),
|
|
185780
|
+
on: (event, callback) => host.on(event, callback),
|
|
185781
|
+
off: (event, callback) => host.off(event, callback),
|
|
185782
|
+
setLocalStateField: (field, value) => {
|
|
185783
|
+
if (disposed) {
|
|
185784
|
+
return;
|
|
185785
|
+
}
|
|
185786
|
+
const state = host.getLocalState();
|
|
185787
|
+
if (state === null) {
|
|
185788
|
+
return;
|
|
185789
|
+
}
|
|
185790
|
+
if (field === "presence") {
|
|
185791
|
+
if (!ownsPresence || state.presence !== lastPresence) {
|
|
185792
|
+
hadPresence = Object.hasOwn(state, "presence");
|
|
185793
|
+
previousPresence = state.presence;
|
|
185794
|
+
}
|
|
185795
|
+
lastPresence = value;
|
|
185796
|
+
ownsPresence = true;
|
|
185797
|
+
}
|
|
185798
|
+
host.setLocalStateField(field, value);
|
|
185799
|
+
}
|
|
185800
|
+
};
|
|
185785
185801
|
return {
|
|
185786
|
-
|
|
185787
|
-
|
|
185788
|
-
|
|
185789
|
-
|
|
185790
|
-
canvasWidth,
|
|
185791
|
-
canvasHeight,
|
|
185792
|
-
now ?? Date.now()
|
|
185793
|
-
);
|
|
185794
|
-
if (primed && localActiveSlideIndex === lastActiveSlideIndex && presenceListsEqual(lastList, list)) {
|
|
185795
|
-
return { list: lastList, cursors: lastCursors, changed: false };
|
|
185802
|
+
awareness,
|
|
185803
|
+
dispose: () => {
|
|
185804
|
+
if (disposed) {
|
|
185805
|
+
return;
|
|
185796
185806
|
}
|
|
185797
|
-
|
|
185798
|
-
|
|
185799
|
-
|
|
185800
|
-
|
|
185801
|
-
|
|
185802
|
-
|
|
185803
|
-
|
|
185804
|
-
|
|
185805
|
-
|
|
185806
|
-
|
|
185807
|
-
|
|
185807
|
+
disposed = true;
|
|
185808
|
+
const current = host.getLocalState();
|
|
185809
|
+
if (!ownsPresence || current === null || current.presence !== lastPresence) {
|
|
185810
|
+
return;
|
|
185811
|
+
}
|
|
185812
|
+
const restored = { ...current };
|
|
185813
|
+
if (hadPresence) {
|
|
185814
|
+
restored.presence = previousPresence;
|
|
185815
|
+
} else {
|
|
185816
|
+
delete restored.presence;
|
|
185817
|
+
}
|
|
185818
|
+
host.setLocalState(restored);
|
|
185808
185819
|
}
|
|
185809
185820
|
};
|
|
185810
185821
|
}
|
|
185811
|
-
var DEFAULT_LOCAL_COLOR = "#6366f1";
|
|
185812
|
-
function getUserInitials(name) {
|
|
185813
|
-
const trimmed = name.trim(), parts = trimmed.split(/\s+/u).filter(Boolean), first = parts[0], last = parts[parts.length - 1];
|
|
185814
|
-
if (parts.length >= 2 && first && last) {
|
|
185815
|
-
return (first[0] + last[0]).toUpperCase();
|
|
185816
|
-
}
|
|
185817
|
-
return trimmed.slice(0, 2).toUpperCase();
|
|
185818
|
-
}
|
|
185819
|
-
function buildActiveSessionUsers(params) {
|
|
185820
|
-
const local = {
|
|
185821
|
-
id: "local",
|
|
185822
|
-
name: params.localUserName,
|
|
185823
|
-
initials: params.localUserInitials?.trim() ? params.localUserInitials.trim().slice(0, 2).toUpperCase() : getUserInitials(params.localUserName),
|
|
185824
|
-
color: params.localUserColor ?? DEFAULT_LOCAL_COLOR,
|
|
185825
|
-
isLocal: true
|
|
185826
|
-
}, remote = params.remoteUsers.map((user) => ({
|
|
185827
|
-
id: String(user.clientId),
|
|
185828
|
-
name: user.userName,
|
|
185829
|
-
initials: getUserInitials(user.userName),
|
|
185830
|
-
color: user.userColor,
|
|
185831
|
-
avatarUrl: user.userAvatar,
|
|
185832
|
-
isLocal: false,
|
|
185833
|
-
slideNumber: user.activeSlideIndex + 1
|
|
185834
|
-
}));
|
|
185835
|
-
return [local, ...remote];
|
|
185836
|
-
}
|
|
185837
185822
|
var YDOC_ASSETS_KEY = "pptx:assets";
|
|
185838
185823
|
var ASSET_ELEMENT_FIELDS = /* @__PURE__ */ new Set([
|
|
185839
185824
|
"mediaData",
|
|
@@ -186102,8 +186087,14 @@ function decodeDelta(delta) {
|
|
|
186102
186087
|
} catch {
|
|
186103
186088
|
}
|
|
186104
186089
|
}
|
|
186105
|
-
const isBreakMarker = op2.insert
|
|
186106
|
-
if (
|
|
186090
|
+
const isBreakMarker = /^\n+$/u.test(op2.insert) && (a.pb === "1" || a.lb === "1");
|
|
186091
|
+
if (isBreakMarker) {
|
|
186092
|
+
for (let index = 0; index < op2.insert.length; index++) {
|
|
186093
|
+
segments.push(structuredClone(seg));
|
|
186094
|
+
}
|
|
186095
|
+
continue;
|
|
186096
|
+
}
|
|
186097
|
+
if (op2.insert !== "\u200B") {
|
|
186107
186098
|
seg.text = op2.insert;
|
|
186108
186099
|
}
|
|
186109
186100
|
segments.push(seg);
|
|
@@ -186429,9 +186420,6 @@ function observeYDocSlides(ydoc, onChange) {
|
|
|
186429
186420
|
arr.observeDeep(onChange);
|
|
186430
186421
|
return () => arr.unobserveDeep(onChange);
|
|
186431
186422
|
}
|
|
186432
|
-
function shouldAutoFollowBroadcaster(input) {
|
|
186433
|
-
return input.localRole === "viewer" && input.broadcasterRole === "owner";
|
|
186434
|
-
}
|
|
186435
186423
|
function isYTextEditable(value) {
|
|
186436
186424
|
return isYTextLike(value) && typeof value.delete === "function" && typeof value.format === "function";
|
|
186437
186425
|
}
|
|
@@ -186704,6 +186692,231 @@ function reconcileSlidesInYDoc(slides, ydoc, factories, origin = LOCAL_SYNC_ORIG
|
|
|
186704
186692
|
});
|
|
186705
186693
|
}, origin);
|
|
186706
186694
|
}
|
|
186695
|
+
function observeExternalCollaborationReadiness(session, options) {
|
|
186696
|
+
let active2 = true;
|
|
186697
|
+
let established = false;
|
|
186698
|
+
let awaitingJoin = options.sessionIntent === "join";
|
|
186699
|
+
let lastAdopted;
|
|
186700
|
+
let lastReadOnly;
|
|
186701
|
+
let unsubscribe;
|
|
186702
|
+
const canWrite = () => active2 && options.gate.isOpen() && session.getSnapshot().synced && options.role !== "viewer";
|
|
186703
|
+
const notifyReadOnly = () => {
|
|
186704
|
+
const readOnly = !canWrite();
|
|
186705
|
+
if (lastReadOnly !== readOnly) {
|
|
186706
|
+
lastReadOnly = readOnly;
|
|
186707
|
+
options.onReadOnlyChange?.(readOnly);
|
|
186708
|
+
}
|
|
186709
|
+
};
|
|
186710
|
+
const suspend = () => {
|
|
186711
|
+
options.gate.reset();
|
|
186712
|
+
options.livePatcher?.configure(null, null);
|
|
186713
|
+
options.onSuspend?.();
|
|
186714
|
+
notifyReadOnly();
|
|
186715
|
+
};
|
|
186716
|
+
const adopt = (slides) => {
|
|
186717
|
+
const serialized = JSON.stringify(slides);
|
|
186718
|
+
if (serialized !== lastAdopted) {
|
|
186719
|
+
lastAdopted = serialized;
|
|
186720
|
+
options.adoptSlides(slides);
|
|
186721
|
+
}
|
|
186722
|
+
};
|
|
186723
|
+
const refresh = () => {
|
|
186724
|
+
if (!active2) {
|
|
186725
|
+
return;
|
|
186726
|
+
}
|
|
186727
|
+
const snapshot = session.getSnapshot();
|
|
186728
|
+
options.onStatus(snapshot.status);
|
|
186729
|
+
if (!snapshot.synced) {
|
|
186730
|
+
suspend();
|
|
186731
|
+
return;
|
|
186732
|
+
}
|
|
186733
|
+
if (options.gate.isOpen()) {
|
|
186734
|
+
return;
|
|
186735
|
+
}
|
|
186736
|
+
lastAdopted = void 0;
|
|
186737
|
+
const slides = readSlidesFromYDoc(session.doc);
|
|
186738
|
+
if (slides.length > 0) {
|
|
186739
|
+
established = true;
|
|
186740
|
+
awaitingJoin = false;
|
|
186741
|
+
adopt(slides);
|
|
186742
|
+
} else if (established) {
|
|
186743
|
+
adopt(slides);
|
|
186744
|
+
} else if (awaitingJoin) {
|
|
186745
|
+
suspend();
|
|
186746
|
+
return;
|
|
186747
|
+
}
|
|
186748
|
+
options.livePatcher?.configure(
|
|
186749
|
+
options.role === "viewer" ? null : session.doc,
|
|
186750
|
+
options.role === "viewer" ? null : options.factories,
|
|
186751
|
+
// The host owns readiness, so accepted edits cannot wait in our timer.
|
|
186752
|
+
true
|
|
186753
|
+
);
|
|
186754
|
+
options.gate.open();
|
|
186755
|
+
notifyReadOnly();
|
|
186756
|
+
options.onReady?.({ seedEmptyRoom: slides.length === 0 && !established });
|
|
186757
|
+
};
|
|
186758
|
+
const unobserve = observeYDocSlides(session.doc, (_events, transaction) => {
|
|
186759
|
+
if (!active2 || !session.getSnapshot().synced) {
|
|
186760
|
+
return;
|
|
186761
|
+
}
|
|
186762
|
+
const slides = readSlidesFromYDoc(session.doc);
|
|
186763
|
+
if (slides.length > 0) {
|
|
186764
|
+
established = true;
|
|
186765
|
+
awaitingJoin = false;
|
|
186766
|
+
}
|
|
186767
|
+
if (transaction?.origin === LOCAL_SYNC_ORIGIN) {
|
|
186768
|
+
lastAdopted = JSON.stringify(slides);
|
|
186769
|
+
return;
|
|
186770
|
+
}
|
|
186771
|
+
if (!options.gate.isOpen()) {
|
|
186772
|
+
refresh();
|
|
186773
|
+
} else if (slides.length > 0 || established) {
|
|
186774
|
+
adopt(slides);
|
|
186775
|
+
}
|
|
186776
|
+
});
|
|
186777
|
+
const dispose = () => {
|
|
186778
|
+
if (!active2) {
|
|
186779
|
+
return;
|
|
186780
|
+
}
|
|
186781
|
+
active2 = false;
|
|
186782
|
+
unsubscribe?.();
|
|
186783
|
+
unobserve();
|
|
186784
|
+
suspend();
|
|
186785
|
+
};
|
|
186786
|
+
try {
|
|
186787
|
+
unsubscribe = observeExternalCollaborationSession(session, refresh);
|
|
186788
|
+
} catch (error) {
|
|
186789
|
+
dispose();
|
|
186790
|
+
throw error;
|
|
186791
|
+
}
|
|
186792
|
+
return Object.assign(dispose, {
|
|
186793
|
+
refresh,
|
|
186794
|
+
canWrite,
|
|
186795
|
+
handleLoad: (origin) => {
|
|
186796
|
+
if (!active2) {
|
|
186797
|
+
return false;
|
|
186798
|
+
}
|
|
186799
|
+
if (origin === "user") {
|
|
186800
|
+
awaitingJoin = false;
|
|
186801
|
+
refresh();
|
|
186802
|
+
} else if (session.getSnapshot().synced) {
|
|
186803
|
+
const slides = readSlidesFromYDoc(session.doc);
|
|
186804
|
+
if (slides.length > 0) {
|
|
186805
|
+
lastAdopted = void 0;
|
|
186806
|
+
adopt(slides);
|
|
186807
|
+
return true;
|
|
186808
|
+
}
|
|
186809
|
+
}
|
|
186810
|
+
return false;
|
|
186811
|
+
},
|
|
186812
|
+
allowLocalLoad: () => {
|
|
186813
|
+
awaitingJoin = false;
|
|
186814
|
+
refresh();
|
|
186815
|
+
}
|
|
186816
|
+
});
|
|
186817
|
+
}
|
|
186818
|
+
function zoomEqual(a, b) {
|
|
186819
|
+
if (a === b) {
|
|
186820
|
+
return true;
|
|
186821
|
+
}
|
|
186822
|
+
if (!a || !b) {
|
|
186823
|
+
return false;
|
|
186824
|
+
}
|
|
186825
|
+
return a.scale === b.scale && a.originX === b.originX && a.originY === b.originY;
|
|
186826
|
+
}
|
|
186827
|
+
function pointerEqual(a, b) {
|
|
186828
|
+
if (a === b) {
|
|
186829
|
+
return true;
|
|
186830
|
+
}
|
|
186831
|
+
if (!a || !b) {
|
|
186832
|
+
return false;
|
|
186833
|
+
}
|
|
186834
|
+
return a.tool === b.tool && a.x === b.x && a.y === b.y && a.color === b.color;
|
|
186835
|
+
}
|
|
186836
|
+
function presentationSnapshotsEqual(a, b) {
|
|
186837
|
+
if (a === b) {
|
|
186838
|
+
return true;
|
|
186839
|
+
}
|
|
186840
|
+
return a.slideIndex === b.slideIndex && a.buildStep === b.buildStep && a.blackout === b.blackout && a.paused === b.paused && a.elapsedMs === b.elapsedMs && a.caption === b.caption && a.subtitlesVisible === b.subtitlesVisible && a.inkMarkupVisible === b.inkMarkupVisible && a.inkStrokes === b.inkStrokes && zoomEqual(a.zoom, b.zoom) && pointerEqual(a.pointer, b.pointer);
|
|
186841
|
+
}
|
|
186842
|
+
function presenceEntriesEqual(a, b) {
|
|
186843
|
+
if (a === b) {
|
|
186844
|
+
return true;
|
|
186845
|
+
}
|
|
186846
|
+
return a.clientId === b.clientId && a.userName === b.userName && a.userColor === b.userColor && a.userAvatar === b.userAvatar && a.role === b.role && a.activeSlideIndex === b.activeSlideIndex && a.cursorX === b.cursorX && a.cursorY === b.cursorY && a.selectedElementId === b.selectedElementId;
|
|
186847
|
+
}
|
|
186848
|
+
function presenceListsEqual(a, b) {
|
|
186849
|
+
if (a === b) {
|
|
186850
|
+
return true;
|
|
186851
|
+
}
|
|
186852
|
+
if (a.length !== b.length) {
|
|
186853
|
+
return false;
|
|
186854
|
+
}
|
|
186855
|
+
return a.every((entry2, index) => {
|
|
186856
|
+
const other = b[index];
|
|
186857
|
+
return other !== void 0 && presenceEntriesEqual(entry2, other);
|
|
186858
|
+
});
|
|
186859
|
+
}
|
|
186860
|
+
function createPresenceProjector() {
|
|
186861
|
+
let lastList = [];
|
|
186862
|
+
let lastCursors = [];
|
|
186863
|
+
let lastActiveSlideIndex;
|
|
186864
|
+
let primed = false;
|
|
186865
|
+
return {
|
|
186866
|
+
project(states, localClientId, canvasWidth, canvasHeight, localActiveSlideIndex, now) {
|
|
186867
|
+
const list = derivePresenceList(
|
|
186868
|
+
states,
|
|
186869
|
+
localClientId,
|
|
186870
|
+
canvasWidth,
|
|
186871
|
+
canvasHeight,
|
|
186872
|
+
now ?? Date.now()
|
|
186873
|
+
);
|
|
186874
|
+
if (primed && localActiveSlideIndex === lastActiveSlideIndex && presenceListsEqual(lastList, list)) {
|
|
186875
|
+
return { list: lastList, cursors: lastCursors, changed: false };
|
|
186876
|
+
}
|
|
186877
|
+
lastList = list;
|
|
186878
|
+
lastCursors = presenceToCursors(list, localActiveSlideIndex);
|
|
186879
|
+
lastActiveSlideIndex = localActiveSlideIndex;
|
|
186880
|
+
primed = true;
|
|
186881
|
+
return { list, cursors: lastCursors, changed: true };
|
|
186882
|
+
},
|
|
186883
|
+
reset() {
|
|
186884
|
+
lastList = [];
|
|
186885
|
+
lastCursors = [];
|
|
186886
|
+
lastActiveSlideIndex = void 0;
|
|
186887
|
+
primed = false;
|
|
186888
|
+
}
|
|
186889
|
+
};
|
|
186890
|
+
}
|
|
186891
|
+
var DEFAULT_LOCAL_COLOR = "#6366f1";
|
|
186892
|
+
function getUserInitials(name) {
|
|
186893
|
+
const trimmed = name.trim(), parts = trimmed.split(/\s+/u).filter(Boolean), first = parts[0], last = parts[parts.length - 1];
|
|
186894
|
+
if (parts.length >= 2 && first && last) {
|
|
186895
|
+
return (first[0] + last[0]).toUpperCase();
|
|
186896
|
+
}
|
|
186897
|
+
return trimmed.slice(0, 2).toUpperCase();
|
|
186898
|
+
}
|
|
186899
|
+
function buildActiveSessionUsers(params) {
|
|
186900
|
+
const local = {
|
|
186901
|
+
id: "local",
|
|
186902
|
+
name: params.localUserName,
|
|
186903
|
+
initials: params.localUserInitials?.trim() ? params.localUserInitials.trim().slice(0, 2).toUpperCase() : getUserInitials(params.localUserName),
|
|
186904
|
+
color: params.localUserColor ?? DEFAULT_LOCAL_COLOR,
|
|
186905
|
+
isLocal: true
|
|
186906
|
+
}, remote = params.remoteUsers.map((user) => ({
|
|
186907
|
+
id: String(user.clientId),
|
|
186908
|
+
name: user.userName,
|
|
186909
|
+
initials: getUserInitials(user.userName),
|
|
186910
|
+
color: user.userColor,
|
|
186911
|
+
avatarUrl: user.userAvatar,
|
|
186912
|
+
isLocal: false,
|
|
186913
|
+
slideNumber: user.activeSlideIndex + 1
|
|
186914
|
+
}));
|
|
186915
|
+
return [local, ...remote];
|
|
186916
|
+
}
|
|
186917
|
+
function shouldAutoFollowBroadcaster(input) {
|
|
186918
|
+
return input.localRole === "viewer" && input.broadcasterRole === "owner";
|
|
186919
|
+
}
|
|
186707
186920
|
var GEOMETRY_KEYS = ["x", "y", "width", "height", "rotation"];
|
|
186708
186921
|
var MAX_LIVE_TEXT_LENGTH = 1e5;
|
|
186709
186922
|
var asMap = (value) => typeof value === "object" && value !== null && typeof value.get === "function" ? value : void 0;
|
|
@@ -186761,6 +186974,7 @@ function createCollaborationLivePatcher(options = {}) {
|
|
|
186761
186974
|
let factories = null;
|
|
186762
186975
|
let timer = null;
|
|
186763
186976
|
let lastWriteAt = Number.NEGATIVE_INFINITY;
|
|
186977
|
+
let immediate = false;
|
|
186764
186978
|
const cancelTimer = () => {
|
|
186765
186979
|
if (timer !== null) {
|
|
186766
186980
|
clearTimeout(timer);
|
|
@@ -186787,6 +187001,10 @@ function createCollaborationLivePatcher(options = {}) {
|
|
|
186787
187001
|
}
|
|
186788
187002
|
};
|
|
186789
187003
|
const schedule = () => {
|
|
187004
|
+
if (immediate) {
|
|
187005
|
+
writePending();
|
|
187006
|
+
return;
|
|
187007
|
+
}
|
|
186790
187008
|
if (timer !== null) {
|
|
186791
187009
|
return;
|
|
186792
187010
|
}
|
|
@@ -186813,14 +187031,15 @@ function createCollaborationLivePatcher(options = {}) {
|
|
|
186813
187031
|
return entry2;
|
|
186814
187032
|
};
|
|
186815
187033
|
return {
|
|
186816
|
-
configure(nextDoc, nextFactories) {
|
|
186817
|
-
if (nextDoc === doc && nextFactories === factories) {
|
|
187034
|
+
configure(nextDoc, nextFactories, nextImmediate = false) {
|
|
187035
|
+
if (nextDoc === doc && nextFactories === factories && nextImmediate === immediate) {
|
|
186818
187036
|
return;
|
|
186819
187037
|
}
|
|
186820
187038
|
cancelTimer();
|
|
186821
187039
|
pending.clear();
|
|
186822
187040
|
doc = nextDoc;
|
|
186823
187041
|
factories = nextFactories;
|
|
187042
|
+
immediate = nextImmediate;
|
|
186824
187043
|
lastWriteAt = Number.NEGATIVE_INFINITY;
|
|
186825
187044
|
},
|
|
186826
187045
|
isActive() {
|
|
@@ -186947,7 +187166,10 @@ function registerCollaborationTeardown(options) {
|
|
|
186947
187166
|
doLeave();
|
|
186948
187167
|
};
|
|
186949
187168
|
const onBeforeUnload = () => {
|
|
186950
|
-
|
|
187169
|
+
const allowed = typeof options.leaveOnBeforeUnload === "function" ? options.leaveOnBeforeUnload() : options.leaveOnBeforeUnload !== false;
|
|
187170
|
+
if (allowed) {
|
|
187171
|
+
doLeave();
|
|
187172
|
+
}
|
|
186951
187173
|
};
|
|
186952
187174
|
const onPageShow = (event) => {
|
|
186953
187175
|
if (event.persisted !== true || !left || !rejoin) {
|
|
@@ -187046,6 +187268,84 @@ function createDepartureChannel(roomId, awareness, factory) {
|
|
|
187046
187268
|
}
|
|
187047
187269
|
};
|
|
187048
187270
|
}
|
|
187271
|
+
var DEFAULT_DEBOUNCE_MS = 5e3;
|
|
187272
|
+
function createWriteBackScheduler(deps) {
|
|
187273
|
+
let timer = null;
|
|
187274
|
+
let generation = 0;
|
|
187275
|
+
let unsubscribe = null;
|
|
187276
|
+
function cancel() {
|
|
187277
|
+
generation++;
|
|
187278
|
+
unsubscribe?.();
|
|
187279
|
+
unsubscribe = null;
|
|
187280
|
+
if (timer !== null) {
|
|
187281
|
+
clearTimeout(timer);
|
|
187282
|
+
timer = null;
|
|
187283
|
+
}
|
|
187284
|
+
}
|
|
187285
|
+
function schedule(config) {
|
|
187286
|
+
const isReady = () => config.externalSession?.getSnapshot().synced ?? true;
|
|
187287
|
+
if (!config.onWriteBack || config.role !== "owner" || !deps.getYDoc()) {
|
|
187288
|
+
return;
|
|
187289
|
+
}
|
|
187290
|
+
cancel();
|
|
187291
|
+
if (!isReady()) {
|
|
187292
|
+
return;
|
|
187293
|
+
}
|
|
187294
|
+
const token2 = generation;
|
|
187295
|
+
if (config.externalSession) {
|
|
187296
|
+
const detach2 = config.externalSession.subscribe(() => {
|
|
187297
|
+
if (!isReady()) {
|
|
187298
|
+
cancel();
|
|
187299
|
+
}
|
|
187300
|
+
});
|
|
187301
|
+
if (token2 !== generation || !isReady()) {
|
|
187302
|
+
detach2();
|
|
187303
|
+
return;
|
|
187304
|
+
}
|
|
187305
|
+
unsubscribe = detach2;
|
|
187306
|
+
}
|
|
187307
|
+
const debounceMs = config.writeBackDebounceMs ?? DEFAULT_DEBOUNCE_MS;
|
|
187308
|
+
timer = setTimeout(async () => {
|
|
187309
|
+
timer = null;
|
|
187310
|
+
const ydoc = deps.getYDoc();
|
|
187311
|
+
const isCurrent = () => token2 === generation && isReady() && deps.getYDoc() === ydoc;
|
|
187312
|
+
try {
|
|
187313
|
+
if (!ydoc || !config.onWriteBack || !isReady()) {
|
|
187314
|
+
return;
|
|
187315
|
+
}
|
|
187316
|
+
if (deps.serialize) {
|
|
187317
|
+
const bytes2 = await deps.serialize(isCurrent);
|
|
187318
|
+
if (bytes2 && isCurrent()) {
|
|
187319
|
+
await config.onWriteBack(bytes2);
|
|
187320
|
+
}
|
|
187321
|
+
return;
|
|
187322
|
+
}
|
|
187323
|
+
const sourceBytes = deps.getSourceBytes?.();
|
|
187324
|
+
if (!sourceBytes) {
|
|
187325
|
+
return;
|
|
187326
|
+
}
|
|
187327
|
+
const handler = new exports.PptxHandler();
|
|
187328
|
+
await handler.load(sourceBytes.buffer);
|
|
187329
|
+
if (!isCurrent()) {
|
|
187330
|
+
return;
|
|
187331
|
+
}
|
|
187332
|
+
const slides = readSlidesFromYDoc(ydoc);
|
|
187333
|
+
const merged = deps.mergeTemplateElements ? deps.mergeTemplateElements(slides, deps.getTemplateElements?.() ?? {}) : slides;
|
|
187334
|
+
const bytes = await handler.save(merged, deps.getSaveOptions?.());
|
|
187335
|
+
if (isCurrent()) {
|
|
187336
|
+
await config.onWriteBack(bytes);
|
|
187337
|
+
}
|
|
187338
|
+
} catch {
|
|
187339
|
+
} finally {
|
|
187340
|
+
if (token2 === generation) {
|
|
187341
|
+
unsubscribe?.();
|
|
187342
|
+
unsubscribe = null;
|
|
187343
|
+
}
|
|
187344
|
+
}
|
|
187345
|
+
}, debounceMs);
|
|
187346
|
+
}
|
|
187347
|
+
return { schedule, cancel };
|
|
187348
|
+
}
|
|
187049
187349
|
var POSITION_THRESHOLD = 2;
|
|
187050
187350
|
var SIZE_THRESHOLD = 2;
|
|
187051
187351
|
function getElementText(element) {
|
|
@@ -208002,6 +208302,7 @@ exports.beginChartValueDrag = beginChartValueDrag;
|
|
|
208002
208302
|
exports.beginShapeAdjustment = beginShapeAdjustment;
|
|
208003
208303
|
exports.bindInlineListParagraph = bindInlineListParagraph;
|
|
208004
208304
|
exports.bindInlineListRun = bindInlineListRun;
|
|
208305
|
+
exports.borrowExternalCollaborationAwareness = borrowExternalCollaborationAwareness;
|
|
208005
208306
|
exports.bringForward = bringForward;
|
|
208006
208307
|
exports.bringToFront = bringToFront;
|
|
208007
208308
|
exports.build3DExtrusionData = build3DExtrusionData;
|
|
@@ -208204,6 +208505,7 @@ exports.createTouchGestureRecognizer = createTouchGestureRecognizer;
|
|
|
208204
208505
|
exports.createViewerOptionsStore = createViewerOptionsStore;
|
|
208205
208506
|
exports.createViewerZoomStore = createViewerZoomStore;
|
|
208206
208507
|
exports.createWheelStepBuffer = createWheelStepBuffer;
|
|
208508
|
+
exports.createWriteBackScheduler = createWriteBackScheduler;
|
|
208207
208509
|
exports.cursorForTool = cursorForTool;
|
|
208208
208510
|
exports.customGeometryPathsToSvgSubpaths = customGeometryPathsToSvgSubpaths;
|
|
208209
208511
|
exports.defaultCssVars = defaultCssVars;
|
|
@@ -208482,6 +208784,8 @@ exports.normalizeHexColor = normalizeHexColor2;
|
|
|
208482
208784
|
exports.normalizeStrokeDashType = normalizeStrokeDashType;
|
|
208483
208785
|
exports.normalizeTableStyleGuid = normalizeTableStyleGuid;
|
|
208484
208786
|
exports.notesSegmentsToSpans = notesSegmentsToSpans;
|
|
208787
|
+
exports.observeExternalCollaborationReadiness = observeExternalCollaborationReadiness;
|
|
208788
|
+
exports.observeExternalCollaborationSession = observeExternalCollaborationSession;
|
|
208485
208789
|
exports.observeYDocSlides = observeYDocSlides;
|
|
208486
208790
|
exports.ooxmlGradientAngleToCssDegrees = ooxmlGradientAngleToCssDegrees;
|
|
208487
208791
|
exports.openNativeEyeDropper = openNativeEyeDropper;
|
|
Binary file
|
|
Binary file
|