pptx-react-viewer 2.19.4 → 2.19.6
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 +16 -0
- package/dist/{AiChatPanel-P663354U.mjs → AiChatPanel-2VR6UFFK.mjs} +3 -3
- package/dist/AiChatPanel-2VR6UFFK.mjs.br +0 -0
- package/dist/AiChatPanel-2VR6UFFK.mjs.gz +0 -0
- package/dist/{AiChatPanel-F4X3OZFG.js → AiChatPanel-IWC2BJH4.js} +23 -23
- package/dist/AiChatPanel-IWC2BJH4.js.br +0 -0
- package/dist/AiChatPanel-IWC2BJH4.js.gz +0 -0
- package/dist/{Model3DScene-TGGZF6XI.js → Model3DScene-ATRIORJV.js} +2 -2
- package/dist/Model3DScene-ATRIORJV.js.br +0 -0
- package/dist/Model3DScene-ATRIORJV.js.gz +0 -0
- package/dist/{Model3DScene-F6FAHPW7.mjs → Model3DScene-E4T6KAJF.mjs} +1 -1
- package/dist/Model3DScene-E4T6KAJF.mjs.br +0 -0
- package/dist/Model3DScene-E4T6KAJF.mjs.gz +0 -0
- package/dist/{chunk-V7GPBZKH.js → chunk-2N2Z7WG2.js} +1045 -1064
- package/dist/chunk-2N2Z7WG2.js.br +0 -0
- package/dist/chunk-2N2Z7WG2.js.gz +0 -0
- package/dist/{chunk-IJY5WNZK.js → chunk-3BK53XWF.js} +27 -0
- package/dist/chunk-3BK53XWF.js.br +0 -0
- package/dist/{chunk-IJY5WNZK.js.gz → chunk-3BK53XWF.js.gz} +0 -0
- package/dist/{chunk-2HNIYZ3O.mjs → chunk-667ZAXQN.mjs} +1 -1
- package/dist/chunk-667ZAXQN.mjs.br +0 -0
- package/dist/chunk-667ZAXQN.mjs.gz +0 -0
- package/dist/{chunk-D4LINQVA.js → chunk-FTUGCQVY.js} +146 -146
- package/dist/chunk-FTUGCQVY.js.br +0 -0
- package/dist/chunk-FTUGCQVY.js.gz +0 -0
- package/dist/{chunk-FWX6HUVA.mjs → chunk-IWCBDKPX.mjs} +1 -1
- package/dist/chunk-IWCBDKPX.mjs.br +0 -0
- package/dist/chunk-IWCBDKPX.mjs.gz +0 -0
- package/dist/{chunk-PEGZP2W2.js → chunk-KPNZXUKK.js} +3 -3
- package/dist/chunk-KPNZXUKK.js.br +0 -0
- package/dist/chunk-KPNZXUKK.js.gz +0 -0
- package/dist/{chunk-6GRIVSUK.mjs → chunk-NHN6XKJV.mjs} +31 -50
- package/dist/chunk-NHN6XKJV.mjs.br +0 -0
- package/dist/chunk-NHN6XKJV.mjs.gz +0 -0
- package/dist/{chunk-J3JFXIDN.mjs → chunk-RQWZ7J3Z.mjs} +27 -1
- package/dist/chunk-RQWZ7J3Z.mjs.br +0 -0
- package/dist/{chunk-J3JFXIDN.mjs.gz → chunk-RQWZ7J3Z.mjs.gz} +0 -0
- package/dist/{chunk-PY4526QN.mjs → chunk-VU4RQSTI.mjs} +3 -3
- package/dist/chunk-VU4RQSTI.mjs.br +0 -0
- package/dist/{chunk-PY4526QN.mjs.gz → chunk-VU4RQSTI.mjs.gz} +0 -0
- package/dist/{chunk-FBXLCEK7.js → chunk-YEEOYPFO.js} +374 -374
- package/dist/chunk-YEEOYPFO.js.br +0 -0
- package/dist/chunk-YEEOYPFO.js.gz +0 -0
- package/dist/index.js +45 -45
- 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.js +78 -78
- 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.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-websocket-DCTJ76B7.mjs → y-websocket-HUEA7LH7.mjs} +27 -6
- package/dist/y-websocket-HUEA7LH7.mjs.br +0 -0
- package/dist/y-websocket-HUEA7LH7.mjs.gz +0 -0
- package/dist/{y-websocket-DQLOWGV6.js → y-websocket-YRPS7AFF.js} +27 -6
- package/dist/y-websocket-YRPS7AFF.js.br +0 -0
- package/dist/y-websocket-YRPS7AFF.js.gz +0 -0
- package/package.json +3 -3
- package/dist/AiChatPanel-F4X3OZFG.js.br +0 -0
- package/dist/AiChatPanel-F4X3OZFG.js.gz +0 -0
- package/dist/AiChatPanel-P663354U.mjs.br +0 -0
- package/dist/AiChatPanel-P663354U.mjs.gz +0 -0
- package/dist/Model3DScene-F6FAHPW7.mjs.br +0 -0
- package/dist/Model3DScene-F6FAHPW7.mjs.gz +0 -0
- package/dist/Model3DScene-TGGZF6XI.js.br +0 -0
- package/dist/Model3DScene-TGGZF6XI.js.gz +0 -0
- package/dist/chunk-2HNIYZ3O.mjs.br +0 -0
- package/dist/chunk-2HNIYZ3O.mjs.gz +0 -0
- package/dist/chunk-6GRIVSUK.mjs.br +0 -0
- package/dist/chunk-6GRIVSUK.mjs.gz +0 -0
- package/dist/chunk-D4LINQVA.js.br +0 -0
- package/dist/chunk-D4LINQVA.js.gz +0 -0
- package/dist/chunk-FBXLCEK7.js.br +0 -0
- package/dist/chunk-FBXLCEK7.js.gz +0 -0
- package/dist/chunk-FWX6HUVA.mjs.br +0 -0
- package/dist/chunk-FWX6HUVA.mjs.gz +0 -0
- package/dist/chunk-IJY5WNZK.js.br +0 -0
- package/dist/chunk-J3JFXIDN.mjs.br +0 -0
- package/dist/chunk-PEGZP2W2.js.br +0 -0
- package/dist/chunk-PEGZP2W2.js.gz +0 -0
- package/dist/chunk-PY4526QN.mjs.br +0 -0
- package/dist/chunk-V7GPBZKH.js.br +0 -0
- package/dist/chunk-V7GPBZKH.js.gz +0 -0
- package/dist/y-websocket-DCTJ76B7.mjs.br +0 -0
- package/dist/y-websocket-DCTJ76B7.mjs.gz +0 -0
- package/dist/y-websocket-DQLOWGV6.js.br +0 -0
- package/dist/y-websocket-DQLOWGV6.js.gz +0 -0
package/dist/internals.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { MIN_TOUCH_TARGET, computeToolbarVisibility, useAnimationPlayback, useAnnotationHandlers, useAudienceMode, useAutosave, useBroadcastFollower, useCanvasInteractions, useClipboardHandlers, useCollaborativeHistory, useCollaborativeState, useComments, useContentLifecycle, useDerivedElementState, useDerivedSlideState, useDialogCustomShows, useEditorHistory, useEditorOperations, useElementManipulation, useElementOperations, useExportHandlers, useExportSaveAs, useFindReplace, useFollowMode, useFontInjection, useGroupAlignLayerHandlers, useIOHandlers, useInsertElements, useIsMobile, useKeyboardInsets, useKeyboardShortcutWiring, useKeyboardShortcuts, useLayoutSwitching, useLoadContent, useMergeShapesHandler, useModalDismissDrag, usePointerHandlers, usePresenceTracking, usePresentationAnnotations, usePresentationKeyboard, usePresentationMode, usePresentationSetup, usePresenterWindow, usePrintHandlers, usePropertyHandlers, useRecoveryDetection, useReducedMotion, useRehearsalTimings, useResizablePanels, useSectionOperations, useSerialize, useSheetDismissDrag, useSlideManagement, useSlideNavigation, useSwipeNavigation, useTableOperations, useThemeHandlers, useThemeSwitching, useToolbarVisibility, useTouchGestures, useViewerBuildingBlocks, useViewerCoreState, useViewerDialogs, useViewerIntegration, useViewerOptions, useViewerState, useViewerUIState, useVirtualizedSlides, useYjsDocumentSync, useYjsProvider, useZoomNavigation, useZoomViewport } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { MIN_TOUCH_TARGET, computeToolbarVisibility, useAnimationPlayback, useAnnotationHandlers, useAudienceMode, useAutosave, useBroadcastFollower, useCanvasInteractions, useClipboardHandlers, useCollaborativeHistory, useCollaborativeState, useComments, useContentLifecycle, useDerivedElementState, useDerivedSlideState, useDialogCustomShows, useEditorHistory, useEditorOperations, useElementManipulation, useElementOperations, useExportHandlers, useExportSaveAs, useFindReplace, useFollowMode, useFontInjection, useGroupAlignLayerHandlers, useIOHandlers, useInsertElements, useIsMobile, useKeyboardInsets, useKeyboardShortcutWiring, useKeyboardShortcuts, useLayoutSwitching, useLoadContent, useMergeShapesHandler, useModalDismissDrag, usePointerHandlers, usePresenceTracking, usePresentationAnnotations, usePresentationKeyboard, usePresentationMode, usePresentationSetup, usePresenterWindow, usePrintHandlers, usePropertyHandlers, useRecoveryDetection, useReducedMotion, useRehearsalTimings, useResizablePanels, useSectionOperations, useSerialize, useSheetDismissDrag, useSlideManagement, useSlideNavigation, useSwipeNavigation, useTableOperations, useThemeHandlers, useThemeSwitching, useToolbarVisibility, useTouchGestures, useViewerBuildingBlocks, useViewerCoreState, useViewerDialogs, useViewerIntegration, useViewerOptions, useViewerState, useViewerUIState, useVirtualizedSlides, useYjsDocumentSync, useYjsProvider, useZoomNavigation, useZoomViewport } from './chunk-VU4RQSTI.mjs';
|
|
2
|
+
import './chunk-667ZAXQN.mjs';
|
|
3
3
|
import './chunk-SQJBFMEX.mjs';
|
|
4
|
-
export { MOBILE_BREAKPOINT, TABLET_BREAKPOINT, computeVirtualRange } from './chunk-
|
|
4
|
+
export { MOBILE_BREAKPOINT, TABLET_BREAKPOINT, computeVirtualRange } from './chunk-RQWZ7J3Z.mjs';
|
|
5
5
|
import './chunk-XGB3TDIC.mjs';
|
package/dist/internals.mjs.br
CHANGED
|
Binary file
|
package/dist/internals.mjs.gz
CHANGED
|
Binary file
|
package/dist/viewer/index.js
CHANGED
|
@@ -1,96 +1,96 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var chunk2N2Z7WG2_js = require('../chunk-2N2Z7WG2.js');
|
|
4
|
+
require('../chunk-KPNZXUKK.js');
|
|
5
|
+
var chunkYEEOYPFO_js = require('../chunk-YEEOYPFO.js');
|
|
6
|
+
var chunkFTUGCQVY_js = require('../chunk-FTUGCQVY.js');
|
|
7
7
|
require('../chunk-MVKRI3CZ.js');
|
|
8
|
-
var
|
|
8
|
+
var chunk3BK53XWF_js = require('../chunk-3BK53XWF.js');
|
|
9
9
|
require('../chunk-4VNS5WPM.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
Object.defineProperty(exports, "CollaborationProvider", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunk2N2Z7WG2_js.CollaborationProvider; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "CollaborationStatusIndicator", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunk2N2Z7WG2_js.CollaborationStatusIndicator; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "PowerPointViewer", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunk2N2Z7WG2_js.PowerPointViewer; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "RemoteUserCursors", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunk2N2Z7WG2_js.RemoteUserCursors; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "UserAvatarBar", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunk2N2Z7WG2_js.UserAvatarBar; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "isAudienceTab", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkYEEOYPFO_js.isAudienceTab; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "parseAudienceNonce", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkYEEOYPFO_js.parseAudienceNonce; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "useCollaborativeHistory", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkYEEOYPFO_js.useCollaborativeHistory; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "useCollaborativeState", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunkYEEOYPFO_js.useCollaborativeState; }
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "usePresenceTracking", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunkYEEOYPFO_js.usePresenceTracking; }
|
|
52
52
|
});
|
|
53
53
|
Object.defineProperty(exports, "useThemeSwitching", {
|
|
54
54
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunkYEEOYPFO_js.useThemeSwitching; }
|
|
56
56
|
});
|
|
57
57
|
Object.defineProperty(exports, "useYjsProvider", {
|
|
58
58
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunkYEEOYPFO_js.useYjsProvider; }
|
|
60
60
|
});
|
|
61
61
|
Object.defineProperty(exports, "getAnimationInitialStyle", {
|
|
62
62
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunkFTUGCQVY_js.getAnimationInitialStyle; }
|
|
64
64
|
});
|
|
65
65
|
Object.defineProperty(exports, "clearAudienceContent", {
|
|
66
66
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
67
|
+
get: function () { return chunk3BK53XWF_js.clearAudienceContent; }
|
|
68
68
|
});
|
|
69
69
|
Object.defineProperty(exports, "forgetSessionDeck", {
|
|
70
70
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
71
|
+
get: function () { return chunk3BK53XWF_js.forgetSessionDeck; }
|
|
72
72
|
});
|
|
73
73
|
Object.defineProperty(exports, "getSessionTabId", {
|
|
74
74
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
75
|
+
get: function () { return chunk3BK53XWF_js.getSessionTabId; }
|
|
76
76
|
});
|
|
77
77
|
Object.defineProperty(exports, "loadAudienceContent", {
|
|
78
78
|
enumerable: true,
|
|
79
|
-
get: function () { return
|
|
79
|
+
get: function () { return chunk3BK53XWF_js.loadAudienceContent; }
|
|
80
80
|
});
|
|
81
81
|
Object.defineProperty(exports, "loadSessionDeck", {
|
|
82
82
|
enumerable: true,
|
|
83
|
-
get: function () { return
|
|
83
|
+
get: function () { return chunk3BK53XWF_js.loadSessionDeck; }
|
|
84
84
|
});
|
|
85
85
|
Object.defineProperty(exports, "rememberSessionDeck", {
|
|
86
86
|
enumerable: true,
|
|
87
|
-
get: function () { return
|
|
87
|
+
get: function () { return chunk3BK53XWF_js.rememberSessionDeck; }
|
|
88
88
|
});
|
|
89
89
|
Object.defineProperty(exports, "restoreSessionDeck", {
|
|
90
90
|
enumerable: true,
|
|
91
|
-
get: function () { return
|
|
91
|
+
get: function () { return chunk3BK53XWF_js.restoreSessionDeck; }
|
|
92
92
|
});
|
|
93
93
|
Object.defineProperty(exports, "storeAudienceContent", {
|
|
94
94
|
enumerable: true,
|
|
95
|
-
get: function () { return
|
|
95
|
+
get: function () { return chunk3BK53XWF_js.storeAudienceContent; }
|
|
96
96
|
});
|
package/dist/viewer/index.js.br
CHANGED
|
Binary file
|
package/dist/viewer/index.js.gz
CHANGED
|
Binary file
|
package/dist/viewer/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { CollaborationProvider, CollaborationStatusIndicator, PowerPointViewer, RemoteUserCursors, UserAvatarBar } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
export { isAudienceTab, parseAudienceNonce, useCollaborativeHistory, useCollaborativeState, usePresenceTracking, useThemeSwitching, useYjsProvider } from '../chunk-
|
|
4
|
-
export { getAnimationInitialStyle } from '../chunk-
|
|
1
|
+
export { CollaborationProvider, CollaborationStatusIndicator, PowerPointViewer, RemoteUserCursors, UserAvatarBar } from '../chunk-NHN6XKJV.mjs';
|
|
2
|
+
import '../chunk-IWCBDKPX.mjs';
|
|
3
|
+
export { isAudienceTab, parseAudienceNonce, useCollaborativeHistory, useCollaborativeState, usePresenceTracking, useThemeSwitching, useYjsProvider } from '../chunk-VU4RQSTI.mjs';
|
|
4
|
+
export { getAnimationInitialStyle } from '../chunk-667ZAXQN.mjs';
|
|
5
5
|
import '../chunk-SQJBFMEX.mjs';
|
|
6
|
-
export { clearAudienceContent, forgetSessionDeck, getSessionTabId, loadAudienceContent, loadSessionDeck, rememberSessionDeck, restoreSessionDeck, storeAudienceContent } from '../chunk-
|
|
6
|
+
export { clearAudienceContent, forgetSessionDeck, getSessionTabId, loadAudienceContent, loadSessionDeck, rememberSessionDeck, restoreSessionDeck, storeAudienceContent } from '../chunk-RQWZ7J3Z.mjs';
|
|
7
7
|
import '../chunk-XGB3TDIC.mjs';
|
package/dist/viewer/index.mjs.br
CHANGED
|
Binary file
|
package/dist/viewer/index.mjs.gz
CHANGED
|
Binary file
|
|
@@ -14,7 +14,7 @@ var readAuthMessage = (decoder, y, permissionDeniedHandler2) => {
|
|
|
14
14
|
// ../../node_modules/.bun/lib0@0.2.117/node_modules/lib0/url.js
|
|
15
15
|
var encodeQueryParams = (params) => map(params, (val, key) => `${encodeURIComponent(key)}=${encodeURIComponent(val)}`).join("&");
|
|
16
16
|
|
|
17
|
-
// ../../node_modules/.bun/y-websocket@3.
|
|
17
|
+
// ../../node_modules/.bun/y-websocket@3.1.0+48ebd0cf55a3d4ab/node_modules/y-websocket/src/y-websocket.js
|
|
18
18
|
var messageSync = 0;
|
|
19
19
|
var messageQueryAwareness = 3;
|
|
20
20
|
var messageAwareness = 1;
|
|
@@ -74,10 +74,16 @@ var readMessage = (provider, buf, emitSynced) => {
|
|
|
74
74
|
}
|
|
75
75
|
return encoder;
|
|
76
76
|
};
|
|
77
|
+
var defaultShouldReconnect = (event) => !(event.code >= 4400 && event.code < 4500);
|
|
77
78
|
var closeWebsocketConnection = (provider, ws, event) => {
|
|
78
|
-
if (ws === provider.ws) {
|
|
79
|
+
if (ws !== null && ws === provider.ws) {
|
|
79
80
|
provider.emit("connection-close", [event, provider]);
|
|
80
81
|
provider.ws = null;
|
|
82
|
+
ws.onmessage = null;
|
|
83
|
+
ws.onopen = null;
|
|
84
|
+
ws.onclose = null;
|
|
85
|
+
ws.onerror = () => {
|
|
86
|
+
};
|
|
81
87
|
ws.close();
|
|
82
88
|
provider.wsconnecting = false;
|
|
83
89
|
if (provider.wsconnected) {
|
|
@@ -93,8 +99,12 @@ var closeWebsocketConnection = (provider, ws, event) => {
|
|
|
93
99
|
provider.emit("status", [{
|
|
94
100
|
status: "disconnected"
|
|
95
101
|
}]);
|
|
96
|
-
}
|
|
97
|
-
|
|
102
|
+
}
|
|
103
|
+
provider.wsUnsuccessfulReconnects++;
|
|
104
|
+
let terminalClose = null;
|
|
105
|
+
if (event != null && !provider.shouldReconnect(event, provider)) {
|
|
106
|
+
provider.shouldConnect = false;
|
|
107
|
+
terminalClose = { code: event.code, reason: event.reason };
|
|
98
108
|
}
|
|
99
109
|
setTimeout(
|
|
100
110
|
setupWS,
|
|
@@ -104,6 +114,9 @@ var closeWebsocketConnection = (provider, ws, event) => {
|
|
|
104
114
|
),
|
|
105
115
|
provider
|
|
106
116
|
);
|
|
117
|
+
if (terminalClose !== null) {
|
|
118
|
+
provider.emit("closed", [terminalClose, provider]);
|
|
119
|
+
}
|
|
107
120
|
}
|
|
108
121
|
};
|
|
109
122
|
var setupWS = (provider) => {
|
|
@@ -115,6 +128,7 @@ var setupWS = (provider) => {
|
|
|
115
128
|
provider.wsconnected = false;
|
|
116
129
|
provider.synced = false;
|
|
117
130
|
websocket.onmessage = (event) => {
|
|
131
|
+
if (provider.ws !== websocket) return;
|
|
118
132
|
provider.wsLastMessageReceived = getUnixTime();
|
|
119
133
|
const encoder = readMessage(provider, new Uint8Array(event.data), true);
|
|
120
134
|
if (length(encoder) > 1) {
|
|
@@ -122,16 +136,17 @@ var setupWS = (provider) => {
|
|
|
122
136
|
}
|
|
123
137
|
};
|
|
124
138
|
websocket.onerror = (event) => {
|
|
139
|
+
if (provider.ws !== websocket) return;
|
|
125
140
|
provider.emit("connection-error", [event, provider]);
|
|
126
141
|
};
|
|
127
142
|
websocket.onclose = (event) => {
|
|
128
143
|
closeWebsocketConnection(provider, websocket, event);
|
|
129
144
|
};
|
|
130
145
|
websocket.onopen = () => {
|
|
146
|
+
if (provider.ws !== websocket) return;
|
|
131
147
|
provider.wsLastMessageReceived = getUnixTime();
|
|
132
148
|
provider.wsconnecting = false;
|
|
133
149
|
provider.wsconnected = true;
|
|
134
|
-
provider.wsUnsuccessfulReconnects = 0;
|
|
135
150
|
provider.emit("status", [{
|
|
136
151
|
status: "connected"
|
|
137
152
|
}]);
|
|
@@ -179,6 +194,7 @@ var WebsocketProvider = class extends ObservableV2 {
|
|
|
179
194
|
* @param {number} [opts.resyncInterval] Request server state every `resyncInterval` milliseconds
|
|
180
195
|
* @param {number} [opts.maxBackoffTime] Maximum amount of time to wait before trying to reconnect (we try to reconnect using exponential backoff)
|
|
181
196
|
* @param {boolean} [opts.disableBc] Disable cross-tab BroadcastChannel communication
|
|
197
|
+
* @param {(event: CloseEvent, provider: WebsocketProvider) => boolean} [opts.shouldReconnect] Decide whether to reconnect after the server closed the connection. By default, close codes in the 4400-4499 range are permanent - we stop reconnecting and emit a `closed` event. This is never called for connections that were closed locally (e.g. via `provider.disconnect()`).
|
|
182
198
|
*/
|
|
183
199
|
constructor(serverUrl, roomname, doc, {
|
|
184
200
|
connect = true,
|
|
@@ -188,7 +204,8 @@ var WebsocketProvider = class extends ObservableV2 {
|
|
|
188
204
|
WebSocketPolyfill = WebSocket,
|
|
189
205
|
resyncInterval = -1,
|
|
190
206
|
maxBackoffTime = 2500,
|
|
191
|
-
disableBc = false
|
|
207
|
+
disableBc = false,
|
|
208
|
+
shouldReconnect = defaultShouldReconnect
|
|
192
209
|
} = {}) {
|
|
193
210
|
super();
|
|
194
211
|
while (serverUrl[serverUrl.length - 1] === "/") {
|
|
@@ -197,6 +214,7 @@ var WebsocketProvider = class extends ObservableV2 {
|
|
|
197
214
|
this.serverUrl = serverUrl;
|
|
198
215
|
this.bcChannel = serverUrl + "/" + roomname;
|
|
199
216
|
this.maxBackoffTime = maxBackoffTime;
|
|
217
|
+
this.shouldReconnect = shouldReconnect;
|
|
200
218
|
this.params = params;
|
|
201
219
|
this.protocols = protocols;
|
|
202
220
|
this.roomname = roomname;
|
|
@@ -291,6 +309,9 @@ var WebsocketProvider = class extends ObservableV2 {
|
|
|
291
309
|
set synced(state) {
|
|
292
310
|
if (this._synced !== state) {
|
|
293
311
|
this._synced = state;
|
|
312
|
+
if (state) {
|
|
313
|
+
this.wsUnsuccessfulReconnects = 0;
|
|
314
|
+
}
|
|
294
315
|
this.emit("synced", [state]);
|
|
295
316
|
this.emit("sync", [state]);
|
|
296
317
|
}
|
|
Binary file
|
|
Binary file
|
|
@@ -16,7 +16,7 @@ var readAuthMessage = (decoder, y, permissionDeniedHandler2) => {
|
|
|
16
16
|
// ../../node_modules/.bun/lib0@0.2.117/node_modules/lib0/url.js
|
|
17
17
|
var encodeQueryParams = (params) => chunkZYQT7I5C_js.map(params, (val, key) => `${encodeURIComponent(key)}=${encodeURIComponent(val)}`).join("&");
|
|
18
18
|
|
|
19
|
-
// ../../node_modules/.bun/y-websocket@3.
|
|
19
|
+
// ../../node_modules/.bun/y-websocket@3.1.0+48ebd0cf55a3d4ab/node_modules/y-websocket/src/y-websocket.js
|
|
20
20
|
var messageSync = 0;
|
|
21
21
|
var messageQueryAwareness = 3;
|
|
22
22
|
var messageAwareness = 1;
|
|
@@ -76,10 +76,16 @@ var readMessage = (provider, buf, emitSynced) => {
|
|
|
76
76
|
}
|
|
77
77
|
return encoder;
|
|
78
78
|
};
|
|
79
|
+
var defaultShouldReconnect = (event) => !(event.code >= 4400 && event.code < 4500);
|
|
79
80
|
var closeWebsocketConnection = (provider, ws, event) => {
|
|
80
|
-
if (ws === provider.ws) {
|
|
81
|
+
if (ws !== null && ws === provider.ws) {
|
|
81
82
|
provider.emit("connection-close", [event, provider]);
|
|
82
83
|
provider.ws = null;
|
|
84
|
+
ws.onmessage = null;
|
|
85
|
+
ws.onopen = null;
|
|
86
|
+
ws.onclose = null;
|
|
87
|
+
ws.onerror = () => {
|
|
88
|
+
};
|
|
83
89
|
ws.close();
|
|
84
90
|
provider.wsconnecting = false;
|
|
85
91
|
if (provider.wsconnected) {
|
|
@@ -95,8 +101,12 @@ var closeWebsocketConnection = (provider, ws, event) => {
|
|
|
95
101
|
provider.emit("status", [{
|
|
96
102
|
status: "disconnected"
|
|
97
103
|
}]);
|
|
98
|
-
}
|
|
99
|
-
|
|
104
|
+
}
|
|
105
|
+
provider.wsUnsuccessfulReconnects++;
|
|
106
|
+
let terminalClose = null;
|
|
107
|
+
if (event != null && !provider.shouldReconnect(event, provider)) {
|
|
108
|
+
provider.shouldConnect = false;
|
|
109
|
+
terminalClose = { code: event.code, reason: event.reason };
|
|
100
110
|
}
|
|
101
111
|
setTimeout(
|
|
102
112
|
setupWS,
|
|
@@ -106,6 +116,9 @@ var closeWebsocketConnection = (provider, ws, event) => {
|
|
|
106
116
|
),
|
|
107
117
|
provider
|
|
108
118
|
);
|
|
119
|
+
if (terminalClose !== null) {
|
|
120
|
+
provider.emit("closed", [terminalClose, provider]);
|
|
121
|
+
}
|
|
109
122
|
}
|
|
110
123
|
};
|
|
111
124
|
var setupWS = (provider) => {
|
|
@@ -117,6 +130,7 @@ var setupWS = (provider) => {
|
|
|
117
130
|
provider.wsconnected = false;
|
|
118
131
|
provider.synced = false;
|
|
119
132
|
websocket.onmessage = (event) => {
|
|
133
|
+
if (provider.ws !== websocket) return;
|
|
120
134
|
provider.wsLastMessageReceived = chunkZYQT7I5C_js.getUnixTime();
|
|
121
135
|
const encoder = readMessage(provider, new Uint8Array(event.data), true);
|
|
122
136
|
if (chunkZYQT7I5C_js.length(encoder) > 1) {
|
|
@@ -124,16 +138,17 @@ var setupWS = (provider) => {
|
|
|
124
138
|
}
|
|
125
139
|
};
|
|
126
140
|
websocket.onerror = (event) => {
|
|
141
|
+
if (provider.ws !== websocket) return;
|
|
127
142
|
provider.emit("connection-error", [event, provider]);
|
|
128
143
|
};
|
|
129
144
|
websocket.onclose = (event) => {
|
|
130
145
|
closeWebsocketConnection(provider, websocket, event);
|
|
131
146
|
};
|
|
132
147
|
websocket.onopen = () => {
|
|
148
|
+
if (provider.ws !== websocket) return;
|
|
133
149
|
provider.wsLastMessageReceived = chunkZYQT7I5C_js.getUnixTime();
|
|
134
150
|
provider.wsconnecting = false;
|
|
135
151
|
provider.wsconnected = true;
|
|
136
|
-
provider.wsUnsuccessfulReconnects = 0;
|
|
137
152
|
provider.emit("status", [{
|
|
138
153
|
status: "connected"
|
|
139
154
|
}]);
|
|
@@ -181,6 +196,7 @@ var WebsocketProvider = class extends chunkZYQT7I5C_js.ObservableV2 {
|
|
|
181
196
|
* @param {number} [opts.resyncInterval] Request server state every `resyncInterval` milliseconds
|
|
182
197
|
* @param {number} [opts.maxBackoffTime] Maximum amount of time to wait before trying to reconnect (we try to reconnect using exponential backoff)
|
|
183
198
|
* @param {boolean} [opts.disableBc] Disable cross-tab BroadcastChannel communication
|
|
199
|
+
* @param {(event: CloseEvent, provider: WebsocketProvider) => boolean} [opts.shouldReconnect] Decide whether to reconnect after the server closed the connection. By default, close codes in the 4400-4499 range are permanent - we stop reconnecting and emit a `closed` event. This is never called for connections that were closed locally (e.g. via `provider.disconnect()`).
|
|
184
200
|
*/
|
|
185
201
|
constructor(serverUrl, roomname, doc, {
|
|
186
202
|
connect = true,
|
|
@@ -190,7 +206,8 @@ var WebsocketProvider = class extends chunkZYQT7I5C_js.ObservableV2 {
|
|
|
190
206
|
WebSocketPolyfill = WebSocket,
|
|
191
207
|
resyncInterval = -1,
|
|
192
208
|
maxBackoffTime = 2500,
|
|
193
|
-
disableBc = false
|
|
209
|
+
disableBc = false,
|
|
210
|
+
shouldReconnect = defaultShouldReconnect
|
|
194
211
|
} = {}) {
|
|
195
212
|
super();
|
|
196
213
|
while (serverUrl[serverUrl.length - 1] === "/") {
|
|
@@ -199,6 +216,7 @@ var WebsocketProvider = class extends chunkZYQT7I5C_js.ObservableV2 {
|
|
|
199
216
|
this.serverUrl = serverUrl;
|
|
200
217
|
this.bcChannel = serverUrl + "/" + roomname;
|
|
201
218
|
this.maxBackoffTime = maxBackoffTime;
|
|
219
|
+
this.shouldReconnect = shouldReconnect;
|
|
202
220
|
this.params = params;
|
|
203
221
|
this.protocols = protocols;
|
|
204
222
|
this.roomname = roomname;
|
|
@@ -293,6 +311,9 @@ var WebsocketProvider = class extends chunkZYQT7I5C_js.ObservableV2 {
|
|
|
293
311
|
set synced(state) {
|
|
294
312
|
if (this._synced !== state) {
|
|
295
313
|
this._synced = state;
|
|
314
|
+
if (state) {
|
|
315
|
+
this.wsUnsuccessfulReconnects = 0;
|
|
316
|
+
}
|
|
296
317
|
this.emit("synced", [state]);
|
|
297
318
|
this.emit("sync", [state]);
|
|
298
319
|
}
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pptx-react-viewer",
|
|
3
|
-
"version": "2.19.
|
|
3
|
+
"version": "2.19.6",
|
|
4
4
|
"description": "React PowerPoint viewer and editor component: render, edit, and export PPTX slides in the browser.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"editor",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"typescript": "^7.0.2",
|
|
94
94
|
"vitest": "^4.1.10",
|
|
95
95
|
"y-webrtc": "^10.3.0",
|
|
96
|
-
"y-websocket": "^3.
|
|
96
|
+
"y-websocket": "^3.1.0",
|
|
97
97
|
"yjs": "^13.6.32"
|
|
98
98
|
},
|
|
99
99
|
"peerDependencies": {
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"optionalDependencies": {
|
|
122
122
|
"three": "^0.185.1",
|
|
123
123
|
"y-webrtc": "^10.3.0",
|
|
124
|
-
"y-websocket": "^3.
|
|
124
|
+
"y-websocket": "^3.1.0",
|
|
125
125
|
"yjs": "^13.6.32"
|
|
126
126
|
}
|
|
127
127
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|