@veltdev/react 1.0.49 → 1.0.51
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/cjs/index.js +427 -7
- package/cjs/index.js.map +1 -1
- package/cjs/types/comments/index.d.ts +1 -0
- package/cjs/types/components/SnippylyComments/SnippylyComments.d.ts +1 -0
- package/cjs/types/components/SnippylyCommentsSidebar/SnippylyCommentsSidebar.d.ts +1 -0
- package/cjs/types/components/SnippylyUserInviteTool/SnippylyUserInviteTool.d.ts +1 -0
- package/cjs/types/constants.d.ts +1 -1
- package/cjs/types/hooks/Client.d.ts +21 -0
- package/cjs/types/hooks/CommentElement.d.ts +25 -0
- package/cjs/types/hooks/CursorElement.d.ts +8 -0
- package/cjs/types/hooks/HuddleElement.d.ts +4 -0
- package/cjs/types/hooks/LiveStateSyncElement.d.ts +16 -0
- package/cjs/types/hooks/PresenceElement.d.ts +8 -0
- package/cjs/types/hooks/RecorderElement.d.ts +8 -0
- package/cjs/types/hooks/RewriterElement.d.ts +4 -0
- package/cjs/types/hooks/SelectionElement.d.ts +4 -0
- package/cjs/types/hooks/TagElement.d.ts +9 -0
- package/cjs/types/hooks/index.d.ts +10 -0
- package/cjs/types/index.d.ts +1 -0
- package/esm/index.js +402 -8
- package/esm/index.js.map +1 -1
- package/esm/types/comments/index.d.ts +1 -0
- package/esm/types/components/SnippylyComments/SnippylyComments.d.ts +1 -0
- package/esm/types/components/SnippylyCommentsSidebar/SnippylyCommentsSidebar.d.ts +1 -0
- package/esm/types/components/SnippylyUserInviteTool/SnippylyUserInviteTool.d.ts +1 -0
- package/esm/types/constants.d.ts +1 -1
- package/esm/types/hooks/Client.d.ts +21 -0
- package/esm/types/hooks/CommentElement.d.ts +25 -0
- package/esm/types/hooks/CursorElement.d.ts +8 -0
- package/esm/types/hooks/HuddleElement.d.ts +4 -0
- package/esm/types/hooks/LiveStateSyncElement.d.ts +16 -0
- package/esm/types/hooks/PresenceElement.d.ts +8 -0
- package/esm/types/hooks/RecorderElement.d.ts +8 -0
- package/esm/types/hooks/RewriterElement.d.ts +4 -0
- package/esm/types/hooks/SelectionElement.d.ts +4 -0
- package/esm/types/hooks/TagElement.d.ts +9 -0
- package/esm/types/hooks/index.d.ts +10 -0
- package/esm/types/index.d.ts +1 -0
- package/index.d.ts +119 -2
- package/package.json +1 -1
package/cjs/index.js
CHANGED
|
@@ -94,7 +94,7 @@ var loadVelt = function (callback, version, staging) {
|
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
-
var VELT_SDK_VERSION = '1.0.
|
|
97
|
+
var VELT_SDK_VERSION = '1.0.60';
|
|
98
98
|
|
|
99
99
|
var SnippylyProvider = function (props) {
|
|
100
100
|
var apiKey = props.apiKey, user = props.user, config = props.config, documentId = props.documentId, language = props.language, translations = props.translations, autoTranslation = props.autoTranslation, onClientLoad = props.onClientLoad, children = props.children;
|
|
@@ -178,7 +178,7 @@ var SnippylyCommentBubble = function (props) {
|
|
|
178
178
|
};
|
|
179
179
|
|
|
180
180
|
var SnippylyComments = function (props) {
|
|
181
|
-
var autoCategorize = props.autoCategorize, streamViewContainerId = props.streamViewContainerId, pinHighlighterClass = props.pinHighlighterClass, textHighlighterClass = props.textHighlighterClass, signIn = props.signIn, onSignIn = props.onSignIn, onUpgrade = props.onUpgrade, textMode = props.textMode, popoverMode = props.popoverMode, popoverTriangleComponent = props.popoverTriangleComponent, floatingCommentsMode = props.floatingCommentsMode, floatingCommentDialog = props.floatingCommentDialog, moderatorMode = props.moderatorMode, streamMode = props.streamMode, signInButton = props.signInButton, upgradeButton = props.upgradeButton, allowAttachments = props.allowAttachments, attachments = props.attachments, recordings = props.recordings, reactions = props.reactions, showDeviceInfo = props.showDeviceInfo, deviceInfo = props.deviceInfo, showCommentIndex = props.showCommentIndex, commentIndex = props.commentIndex, dialogOnHover = props.dialogOnHover, dialogOnTargetElementClick = props.dialogOnTargetElementClick, showPriority = props.showPriority, priority = props.priority, inboxMode = props.inboxMode, suggestionMode = props.suggestionMode, mobileMode = props.mobileMode, inlineCommentMode = props.inlineCommentMode, privateCommentMode = props.privateCommentMode, minimap = props.minimap, persistentCommentMode = props.persistentCommentMode, ghostComments = props.ghostComments, ghostCommentsMessage = props.ghostCommentsMessage, ghostCommentsIndicator = props.ghostCommentsIndicator, commentsOnDom = props.commentsOnDom, commentTool = props.commentTool, sidebarButtonOnCommentDialog = props.sidebarButtonOnCommentDialog, allowedElementIds = props.allowedElementIds, commentAdded = props.commentAdded, onCommentAdd = props.onCommentAdd, onCommentUpdate = props.onCommentUpdate, commentAccepted = props.commentAccepted, onCommentAccept = props.onCommentAccept, commentRejected = props.commentRejected, onCommentReject = props.onCommentReject, onSidebarButtonOnCommentDialogClick = props.onSidebarButtonOnCommentDialogClick, customStatuses = props.customStatuses, customStatus = props.customStatus, customPriorities = props.customPriorities, customPriority = props.customPriority, customCategories = props.customCategories, customCategory = props.customCategory, showStatus = props.showStatus, status = props.status, showResolveButton = props.showResolveButton, resolveButton = props.resolveButton, darkMode = props.darkMode, onCustomPinInject = props.onCustomPinInject, children = props.children;
|
|
181
|
+
var autoCategorize = props.autoCategorize, streamViewContainerId = props.streamViewContainerId, pinHighlighterClass = props.pinHighlighterClass, textHighlighterClass = props.textHighlighterClass, signIn = props.signIn, onSignIn = props.onSignIn, onUpgrade = props.onUpgrade, textMode = props.textMode, popoverMode = props.popoverMode, popoverTriangleComponent = props.popoverTriangleComponent, floatingCommentsMode = props.floatingCommentsMode, floatingCommentDialog = props.floatingCommentDialog, moderatorMode = props.moderatorMode, streamMode = props.streamMode, signInButton = props.signInButton, upgradeButton = props.upgradeButton, allowAttachments = props.allowAttachments, attachments = props.attachments, recordings = props.recordings, reactions = props.reactions, showDeviceInfo = props.showDeviceInfo, deviceInfo = props.deviceInfo, showCommentIndex = props.showCommentIndex, commentIndex = props.commentIndex, dialogOnHover = props.dialogOnHover, dialogOnTargetElementClick = props.dialogOnTargetElementClick, showPriority = props.showPriority, priority = props.priority, inboxMode = props.inboxMode, suggestionMode = props.suggestionMode, mobileMode = props.mobileMode, inlineCommentMode = props.inlineCommentMode, privateCommentMode = props.privateCommentMode, minimap = props.minimap, persistentCommentMode = props.persistentCommentMode, ghostComments = props.ghostComments, ghostCommentsMessage = props.ghostCommentsMessage, ghostCommentsIndicator = props.ghostCommentsIndicator, commentsOnDom = props.commentsOnDom, commentTool = props.commentTool, sidebarButtonOnCommentDialog = props.sidebarButtonOnCommentDialog, scrollToComponent = props.scrollToComponent, allowedElementIds = props.allowedElementIds, commentAdded = props.commentAdded, onCommentAdd = props.onCommentAdd, onCommentUpdate = props.onCommentUpdate, commentAccepted = props.commentAccepted, onCommentAccept = props.onCommentAccept, commentRejected = props.commentRejected, onCommentReject = props.onCommentReject, onSidebarButtonOnCommentDialogClick = props.onSidebarButtonOnCommentDialogClick, customStatuses = props.customStatuses, customStatus = props.customStatus, customPriorities = props.customPriorities, customPriority = props.customPriority, customCategories = props.customCategories, customCategory = props.customCategory, showStatus = props.showStatus, status = props.status, showResolveButton = props.showResolveButton, resolveButton = props.resolveButton, darkMode = props.darkMode, onCustomPinInject = props.onCustomPinInject, children = props.children;
|
|
182
182
|
var ref = React.useRef();
|
|
183
183
|
React.useEffect(function () {
|
|
184
184
|
if (ref.current) {
|
|
@@ -237,11 +237,11 @@ var SnippylyComments = function (props) {
|
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
239
|
}, []);
|
|
240
|
-
return (React__default["default"].createElement("velt-comments", { ref: ref, "auto-categorize": [true, false].includes(autoCategorize) ? (autoCategorize ? 'true' : 'false') : undefined, "data-stream-view-container-id": streamViewContainerId, "pin-highlighter-class": pinHighlighterClass, "text-highlighter-class": textHighlighterClass, "text-mode": [true, false].includes(textMode) ? (textMode ? 'true' : 'false') : undefined, "popover-mode": [true, false].includes(popoverMode) ? (popoverMode ? 'true' : 'false') : undefined, "popover-triangle-component": [true, false].includes(popoverTriangleComponent) ? (popoverTriangleComponent ? 'true' : 'false') : undefined, "floating-comments-mode": [true, false].includes(floatingCommentsMode) ? (floatingCommentsMode ? 'true' : 'false') : undefined, "floating-comment-dialog": [true, false].includes(floatingCommentDialog) ? (floatingCommentDialog ? 'true' : 'false') : undefined, "moderator-mode": [true, false].includes(moderatorMode) ? (moderatorMode ? 'true' : 'false') : undefined, "stream-mode": [true, false].includes(streamMode) ? (streamMode ? 'true' : 'false') : undefined, "sign-in-button": [true, false].includes(signInButton) ? (signInButton ? 'true' : 'false') : undefined, "upgrade-button": [true, false].includes(upgradeButton) ? (upgradeButton ? 'true' : 'false') : undefined, "allow-attachments": [true, false].includes(allowAttachments) ? (allowAttachments ? 'true' : 'false') : undefined, attachments: [true, false].includes(attachments) ? (attachments ? 'true' : 'false') : undefined, recordings: recordings, reactions: [true, false].includes(reactions) ? (reactions ? 'true' : 'false') : undefined, "show-device-info": [true, false].includes(showDeviceInfo) ? (showDeviceInfo ? 'true' : 'false') : undefined, "device-info": [true, false].includes(deviceInfo) ? (deviceInfo ? 'true' : 'false') : undefined, "show-comment-index": [true, false].includes(showCommentIndex) ? (showCommentIndex ? 'true' : 'false') : undefined, "comment-index": [true, false].includes(commentIndex) ? (commentIndex ? 'true' : 'false') : undefined, "dialog-on-hover": [true, false].includes(dialogOnHover) ? (dialogOnHover ? 'true' : 'false') : undefined, "dialog-on-target-element-click": [true, false].includes(dialogOnTargetElementClick) ? (dialogOnTargetElementClick ? 'true' : 'false') : undefined, "show-priority": [true, false].includes(showPriority) ? (showPriority ? 'true' : 'false') : undefined, priority: [true, false].includes(priority) ? (priority ? 'true' : 'false') : undefined, "show-status": [true, false].includes(showStatus) ? (showStatus ? 'true' : 'false') : undefined, status: [true, false].includes(status) ? (status ? 'true' : 'false') : undefined, "show-resolve-button": [true, false].includes(showResolveButton) ? (showResolveButton ? 'true' : 'false') : undefined, "resolve-button": [true, false].includes(resolveButton) ? (resolveButton ? 'true' : 'false') : undefined, "inbox-mode": [true, false].includes(inboxMode) ? (inboxMode ? 'true' : 'false') : undefined, "suggestion-mode": [true, false].includes(suggestionMode) ? (suggestionMode ? 'true' : 'false') : undefined, "mobile-mode": [true, false].includes(mobileMode) ? (mobileMode ? 'true' : 'false') : undefined, "inline-comment-mode": [true, false].includes(inlineCommentMode) ? (inlineCommentMode ? 'true' : 'false') : undefined, "private-comment-mode": [true, false].includes(privateCommentMode) ? (privateCommentMode ? 'true' : 'false') : undefined, minimap: [true, false].includes(minimap) ? (minimap ? 'true' : 'false') : undefined, "persistent-comment-mode": [true, false].includes(persistentCommentMode) ? (persistentCommentMode ? 'true' : 'false') : undefined, "ghost-comments": [true, false].includes(ghostComments) ? (ghostComments ? 'true' : 'false') : undefined, "ghost-comments-message": [true, false].includes(ghostCommentsMessage) ? (ghostCommentsMessage ? 'true' : 'false') : undefined, "ghost-comments-indicator": [true, false].includes(ghostCommentsIndicator) ? (ghostCommentsIndicator ? 'true' : 'false') : undefined, "comments-on-dom": [true, false].includes(commentsOnDom) ? (commentsOnDom ? 'true' : 'false') : undefined, "comment-tool": [true, false].includes(commentTool) ? (commentTool ? 'true' : 'false') : undefined, "sidebar-button-on-comment-dialog": [true, false].includes(sidebarButtonOnCommentDialog) ? (sidebarButtonOnCommentDialog ? 'true' : 'false') : undefined, "allowed-element-ids": JSON.stringify(allowedElementIds), "custom-statuses": JSON.stringify(customStatuses), "custom-status": JSON.stringify(customStatus), "custom-priorities": JSON.stringify(customPriorities), "custom-priority": JSON.stringify(customPriority), "custom-categories": JSON.stringify(customCategories), "custom-category": JSON.stringify(customCategory), "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined }, children));
|
|
240
|
+
return (React__default["default"].createElement("velt-comments", { ref: ref, "auto-categorize": [true, false].includes(autoCategorize) ? (autoCategorize ? 'true' : 'false') : undefined, "data-stream-view-container-id": streamViewContainerId, "pin-highlighter-class": pinHighlighterClass, "text-highlighter-class": textHighlighterClass, "text-mode": [true, false].includes(textMode) ? (textMode ? 'true' : 'false') : undefined, "popover-mode": [true, false].includes(popoverMode) ? (popoverMode ? 'true' : 'false') : undefined, "popover-triangle-component": [true, false].includes(popoverTriangleComponent) ? (popoverTriangleComponent ? 'true' : 'false') : undefined, "floating-comments-mode": [true, false].includes(floatingCommentsMode) ? (floatingCommentsMode ? 'true' : 'false') : undefined, "floating-comment-dialog": [true, false].includes(floatingCommentDialog) ? (floatingCommentDialog ? 'true' : 'false') : undefined, "moderator-mode": [true, false].includes(moderatorMode) ? (moderatorMode ? 'true' : 'false') : undefined, "stream-mode": [true, false].includes(streamMode) ? (streamMode ? 'true' : 'false') : undefined, "sign-in-button": [true, false].includes(signInButton) ? (signInButton ? 'true' : 'false') : undefined, "upgrade-button": [true, false].includes(upgradeButton) ? (upgradeButton ? 'true' : 'false') : undefined, "allow-attachments": [true, false].includes(allowAttachments) ? (allowAttachments ? 'true' : 'false') : undefined, attachments: [true, false].includes(attachments) ? (attachments ? 'true' : 'false') : undefined, recordings: recordings, reactions: [true, false].includes(reactions) ? (reactions ? 'true' : 'false') : undefined, "show-device-info": [true, false].includes(showDeviceInfo) ? (showDeviceInfo ? 'true' : 'false') : undefined, "device-info": [true, false].includes(deviceInfo) ? (deviceInfo ? 'true' : 'false') : undefined, "show-comment-index": [true, false].includes(showCommentIndex) ? (showCommentIndex ? 'true' : 'false') : undefined, "comment-index": [true, false].includes(commentIndex) ? (commentIndex ? 'true' : 'false') : undefined, "dialog-on-hover": [true, false].includes(dialogOnHover) ? (dialogOnHover ? 'true' : 'false') : undefined, "dialog-on-target-element-click": [true, false].includes(dialogOnTargetElementClick) ? (dialogOnTargetElementClick ? 'true' : 'false') : undefined, "show-priority": [true, false].includes(showPriority) ? (showPriority ? 'true' : 'false') : undefined, priority: [true, false].includes(priority) ? (priority ? 'true' : 'false') : undefined, "show-status": [true, false].includes(showStatus) ? (showStatus ? 'true' : 'false') : undefined, status: [true, false].includes(status) ? (status ? 'true' : 'false') : undefined, "show-resolve-button": [true, false].includes(showResolveButton) ? (showResolveButton ? 'true' : 'false') : undefined, "resolve-button": [true, false].includes(resolveButton) ? (resolveButton ? 'true' : 'false') : undefined, "inbox-mode": [true, false].includes(inboxMode) ? (inboxMode ? 'true' : 'false') : undefined, "suggestion-mode": [true, false].includes(suggestionMode) ? (suggestionMode ? 'true' : 'false') : undefined, "mobile-mode": [true, false].includes(mobileMode) ? (mobileMode ? 'true' : 'false') : undefined, "inline-comment-mode": [true, false].includes(inlineCommentMode) ? (inlineCommentMode ? 'true' : 'false') : undefined, "private-comment-mode": [true, false].includes(privateCommentMode) ? (privateCommentMode ? 'true' : 'false') : undefined, minimap: [true, false].includes(minimap) ? (minimap ? 'true' : 'false') : undefined, "persistent-comment-mode": [true, false].includes(persistentCommentMode) ? (persistentCommentMode ? 'true' : 'false') : undefined, "ghost-comments": [true, false].includes(ghostComments) ? (ghostComments ? 'true' : 'false') : undefined, "ghost-comments-message": [true, false].includes(ghostCommentsMessage) ? (ghostCommentsMessage ? 'true' : 'false') : undefined, "ghost-comments-indicator": [true, false].includes(ghostCommentsIndicator) ? (ghostCommentsIndicator ? 'true' : 'false') : undefined, "comments-on-dom": [true, false].includes(commentsOnDom) ? (commentsOnDom ? 'true' : 'false') : undefined, "comment-tool": [true, false].includes(commentTool) ? (commentTool ? 'true' : 'false') : undefined, "sidebar-button-on-comment-dialog": [true, false].includes(sidebarButtonOnCommentDialog) ? (sidebarButtonOnCommentDialog ? 'true' : 'false') : undefined, "scroll-to-component": [true, false].includes(scrollToComponent) ? (scrollToComponent ? 'true' : 'false') : undefined, "allowed-element-ids": JSON.stringify(allowedElementIds), "custom-statuses": JSON.stringify(customStatuses), "custom-status": JSON.stringify(customStatus), "custom-priorities": JSON.stringify(customPriorities), "custom-priority": JSON.stringify(customPriority), "custom-categories": JSON.stringify(customCategories), "custom-category": JSON.stringify(customCategory), "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined }, children));
|
|
241
241
|
};
|
|
242
242
|
|
|
243
243
|
var SnippylyCommentsSidebar = function (props) {
|
|
244
|
-
var embedMode = props.embedMode, enableUrlNavigation = props.enableUrlNavigation, urlNavigation = props.urlNavigation, openSidebar = props.openSidebar, onSidebarOpen = props.onSidebarOpen, onSidebarCommentClick = props.onSidebarCommentClick, onCommentClick = props.onCommentClick;
|
|
244
|
+
var embedMode = props.embedMode, enableUrlNavigation = props.enableUrlNavigation, urlNavigation = props.urlNavigation, pageMode = props.pageMode, openSidebar = props.openSidebar, onSidebarOpen = props.onSidebarOpen, onSidebarCommentClick = props.onSidebarCommentClick, onCommentClick = props.onCommentClick;
|
|
245
245
|
var ref = React.useRef();
|
|
246
246
|
React.useEffect(function () {
|
|
247
247
|
if (ref.current) {
|
|
@@ -264,7 +264,7 @@ var SnippylyCommentsSidebar = function (props) {
|
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
266
|
}, []);
|
|
267
|
-
return (React__default["default"].createElement("velt-comments-sidebar", { ref: ref, "embed-mode": [true, false].includes(embedMode) ? (embedMode ? 'true' : 'false') : undefined, "enable-url-navigation": [true, false].includes(enableUrlNavigation) ? (enableUrlNavigation ? 'true' : 'false') : undefined, "url-navigation": [true, false].includes(urlNavigation) ? (urlNavigation ? 'true' : 'false') : undefined }));
|
|
267
|
+
return (React__default["default"].createElement("velt-comments-sidebar", { ref: ref, "embed-mode": [true, false].includes(embedMode) ? (embedMode ? 'true' : 'false') : undefined, "enable-url-navigation": [true, false].includes(enableUrlNavigation) ? (enableUrlNavigation ? 'true' : 'false') : undefined, "url-navigation": [true, false].includes(urlNavigation) ? (urlNavigation ? 'true' : 'false') : undefined, "page-mode": [true, false].includes(pageMode) ? (pageMode ? 'true' : 'false') : undefined }));
|
|
268
268
|
};
|
|
269
269
|
|
|
270
270
|
var SnippylyCommentTool = function (props) {
|
|
@@ -401,8 +401,8 @@ var SnippylyArrowTool = function (props) {
|
|
|
401
401
|
};
|
|
402
402
|
|
|
403
403
|
var SnippylyUserInviteTool = function (props) {
|
|
404
|
-
var type = props.type, source = props.source, title = props.title, placeholder = props.placeholder, accessControlDropdown = props.accessControlDropdown;
|
|
405
|
-
return (React__default["default"].createElement("velt-user-invite-tool", { type: type, source: source, title: title, placeholder: placeholder, "access-control-dropdown": [true, false].includes(accessControlDropdown) ? accessControlDropdown : undefined }));
|
|
404
|
+
var type = props.type, source = props.source, title = props.title, placeholder = props.placeholder, accessControlDropdown = props.accessControlDropdown, documentUserAccessList = props.documentUserAccessList;
|
|
405
|
+
return (React__default["default"].createElement("velt-user-invite-tool", { type: type, source: source, title: title, placeholder: placeholder, "access-control-dropdown": [true, false].includes(accessControlDropdown) ? accessControlDropdown : undefined, "document-user-access-list": [true, false].includes(documentUserAccessList) ? documentUserAccessList : undefined }));
|
|
406
406
|
};
|
|
407
407
|
|
|
408
408
|
var SnippylyUserRequestTool = function (props) {
|
|
@@ -431,6 +431,400 @@ var VeltVideoPlayer = function (props) {
|
|
|
431
431
|
return (React__default["default"].createElement("velt-video-player", { src: src, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined, sync: [true, false].includes(sync) ? (sync ? 'true' : 'false') : undefined }));
|
|
432
432
|
};
|
|
433
433
|
|
|
434
|
+
/**
|
|
435
|
+
* @beta This hook is in beta
|
|
436
|
+
*/
|
|
437
|
+
function useClient() {
|
|
438
|
+
var client = useVeltClient().client;
|
|
439
|
+
var _a = React__default["default"].useState(), veltClient = _a[0], setVeltClient = _a[1];
|
|
440
|
+
React__default["default"].useEffect(function () {
|
|
441
|
+
if (!client || veltClient)
|
|
442
|
+
return;
|
|
443
|
+
setVeltClient(client);
|
|
444
|
+
}, [client, setVeltClient, veltClient]);
|
|
445
|
+
return veltClient;
|
|
446
|
+
}
|
|
447
|
+
/**
|
|
448
|
+
* @beta This hook is in beta
|
|
449
|
+
*/
|
|
450
|
+
function useIdentify(user, userOptions) {
|
|
451
|
+
var client = useVeltClient().client;
|
|
452
|
+
React__default["default"].useEffect(function () {
|
|
453
|
+
client && client.identify(user, userOptions);
|
|
454
|
+
}, [client]);
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* @beta This hook is in beta
|
|
458
|
+
*/
|
|
459
|
+
function useSetDocumentId(documentId) {
|
|
460
|
+
var client = useVeltClient().client;
|
|
461
|
+
React__default["default"].useEffect(function () {
|
|
462
|
+
client && client.setDocumentId(documentId);
|
|
463
|
+
}, [client]);
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* @beta This hook is in beta
|
|
467
|
+
*/
|
|
468
|
+
function useSetLocation(location) {
|
|
469
|
+
var client = useVeltClient().client;
|
|
470
|
+
React__default["default"].useEffect(function () {
|
|
471
|
+
client && client.setLocation(location);
|
|
472
|
+
}, [client]);
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* @beta This hook is in beta
|
|
476
|
+
*/
|
|
477
|
+
function useAddLocation(location) {
|
|
478
|
+
var client = useVeltClient().client;
|
|
479
|
+
React__default["default"].useEffect(function () {
|
|
480
|
+
client && client.addLocation(location);
|
|
481
|
+
}, [client]);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* @beta This hook is in beta
|
|
486
|
+
*/
|
|
487
|
+
function useCommentUtils() {
|
|
488
|
+
var _a = React__default["default"].useState(), commentElement = _a[0], setCommentElement = _a[1];
|
|
489
|
+
var client = useVeltClient().client;
|
|
490
|
+
React__default["default"].useEffect(function () {
|
|
491
|
+
if (!client || commentElement)
|
|
492
|
+
return;
|
|
493
|
+
var loadedCommentElement = client.getCommentElement();
|
|
494
|
+
setCommentElement(loadedCommentElement);
|
|
495
|
+
}, [client, setCommentElement, commentElement]);
|
|
496
|
+
return commentElement;
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* @beta This hook is in beta
|
|
500
|
+
*/
|
|
501
|
+
function useCommentAnnotations(documentId, location) {
|
|
502
|
+
var commentElement = useCommentUtils();
|
|
503
|
+
var _a = React__default["default"].useState([]), data = _a[0], setData = _a[1];
|
|
504
|
+
React.useEffect(function () {
|
|
505
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.getAllCommentAnnotations))
|
|
506
|
+
return;
|
|
507
|
+
var subscription = commentElement.getAllCommentAnnotations(documentId, location).subscribe(function (res) {
|
|
508
|
+
setData(res);
|
|
509
|
+
});
|
|
510
|
+
return function () {
|
|
511
|
+
subscription.unsubscribe();
|
|
512
|
+
};
|
|
513
|
+
}, [commentElement === null || commentElement === void 0 ? void 0 : commentElement.getAllCommentAnnotations]);
|
|
514
|
+
return data;
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* @beta This hook is in beta
|
|
518
|
+
*/
|
|
519
|
+
function useCommentModeState() {
|
|
520
|
+
var commentElement = useCommentUtils();
|
|
521
|
+
var _a = React__default["default"].useState(), data = _a[0], setData = _a[1];
|
|
522
|
+
React.useEffect(function () {
|
|
523
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.onCommentModeChange))
|
|
524
|
+
return;
|
|
525
|
+
var subscription = commentElement.onCommentModeChange().subscribe(function (res) {
|
|
526
|
+
setData(res);
|
|
527
|
+
});
|
|
528
|
+
return function () {
|
|
529
|
+
subscription.unsubscribe();
|
|
530
|
+
};
|
|
531
|
+
}, [commentElement === null || commentElement === void 0 ? void 0 : commentElement.onCommentModeChange]);
|
|
532
|
+
return data;
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* @beta This hook is in beta
|
|
536
|
+
*/
|
|
537
|
+
function useCommentAddHandler() {
|
|
538
|
+
var commentElement = useCommentUtils();
|
|
539
|
+
var _a = React__default["default"].useState(), data = _a[0], setData = _a[1];
|
|
540
|
+
React.useEffect(function () {
|
|
541
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.onCommentAdd))
|
|
542
|
+
return;
|
|
543
|
+
var subscription = commentElement.onCommentAdd().subscribe(function (res) {
|
|
544
|
+
setData(res);
|
|
545
|
+
});
|
|
546
|
+
return function () {
|
|
547
|
+
subscription.unsubscribe();
|
|
548
|
+
};
|
|
549
|
+
}, [commentElement === null || commentElement === void 0 ? void 0 : commentElement.onCommentAdd]);
|
|
550
|
+
return data;
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* @beta This hook is in beta
|
|
554
|
+
*/
|
|
555
|
+
function useCommentUpdateHandler() {
|
|
556
|
+
var commentElement = useCommentUtils();
|
|
557
|
+
var _a = React__default["default"].useState(), data = _a[0], setData = _a[1];
|
|
558
|
+
React.useEffect(function () {
|
|
559
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.onCommentUpdate))
|
|
560
|
+
return;
|
|
561
|
+
var subscription = commentElement.onCommentUpdate().subscribe(function (res) {
|
|
562
|
+
setData(res);
|
|
563
|
+
});
|
|
564
|
+
return function () {
|
|
565
|
+
subscription.unsubscribe();
|
|
566
|
+
};
|
|
567
|
+
}, [commentElement === null || commentElement === void 0 ? void 0 : commentElement.onCommentUpdate]);
|
|
568
|
+
return data;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* @beta This hook is in beta
|
|
572
|
+
*/
|
|
573
|
+
function useCommentDialogSidebarClickHandler() {
|
|
574
|
+
var commentElement = useCommentUtils();
|
|
575
|
+
var _a = React__default["default"].useState(), data = _a[0], setData = _a[1];
|
|
576
|
+
React.useEffect(function () {
|
|
577
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.onSidebarButtonOnCommentDialogClick))
|
|
578
|
+
return;
|
|
579
|
+
var subscription = commentElement.onSidebarButtonOnCommentDialogClick().subscribe(function (res) {
|
|
580
|
+
setData(res === undefined ? new Date().getTime() : res);
|
|
581
|
+
});
|
|
582
|
+
return function () {
|
|
583
|
+
subscription.unsubscribe();
|
|
584
|
+
};
|
|
585
|
+
}, [commentElement === null || commentElement === void 0 ? void 0 : commentElement.onSidebarButtonOnCommentDialogClick]);
|
|
586
|
+
return data;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* @beta This hook is in beta
|
|
591
|
+
*/
|
|
592
|
+
function useCursorUtils() {
|
|
593
|
+
var _a = React__default["default"].useState(), cursorElement = _a[0], setCursorElement = _a[1];
|
|
594
|
+
var client = useVeltClient().client;
|
|
595
|
+
React__default["default"].useEffect(function () {
|
|
596
|
+
if (!client || cursorElement)
|
|
597
|
+
return;
|
|
598
|
+
var loadedCursorElement = client.getCursorElement();
|
|
599
|
+
setCursorElement(loadedCursorElement);
|
|
600
|
+
}, [client, setCursorElement, cursorElement]);
|
|
601
|
+
return cursorElement;
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* @beta This hook is in beta
|
|
605
|
+
*/
|
|
606
|
+
function useCursorUsers() {
|
|
607
|
+
var cursorElement = useCursorUtils();
|
|
608
|
+
var _a = React__default["default"].useState(), data = _a[0], setData = _a[1];
|
|
609
|
+
React.useEffect(function () {
|
|
610
|
+
if (!cursorElement)
|
|
611
|
+
return;
|
|
612
|
+
var subscription = cursorElement.getOnlineUsersOnCurrentDocument().subscribe(function (res) {
|
|
613
|
+
setData(res);
|
|
614
|
+
});
|
|
615
|
+
return function () {
|
|
616
|
+
subscription.unsubscribe();
|
|
617
|
+
};
|
|
618
|
+
}, [cursorElement]);
|
|
619
|
+
return data;
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* @beta This hook is in beta
|
|
624
|
+
*/
|
|
625
|
+
function useHuddleUtils() {
|
|
626
|
+
var _a = React__default["default"].useState(), huddleElement = _a[0], setHuddleElement = _a[1];
|
|
627
|
+
var client = useVeltClient().client;
|
|
628
|
+
React__default["default"].useEffect(function () {
|
|
629
|
+
if (!client || huddleElement)
|
|
630
|
+
return;
|
|
631
|
+
var loadedHuddleElement = client.getHuddleElement();
|
|
632
|
+
setHuddleElement(loadedHuddleElement);
|
|
633
|
+
}, [client, setHuddleElement, huddleElement]);
|
|
634
|
+
return huddleElement;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* @beta This hook is in beta
|
|
639
|
+
*/
|
|
640
|
+
function useLiveStateSyncUtils() {
|
|
641
|
+
var _a = React__default["default"].useState(), liveStateSyncElement = _a[0], setLiveStateSyncElement = _a[1];
|
|
642
|
+
var client = useVeltClient().client;
|
|
643
|
+
React__default["default"].useEffect(function () {
|
|
644
|
+
if (!client || liveStateSyncElement)
|
|
645
|
+
return;
|
|
646
|
+
var loadedLiveStateSyncElement = client.getLiveStateSyncElement();
|
|
647
|
+
setLiveStateSyncElement(loadedLiveStateSyncElement);
|
|
648
|
+
}, [client, setLiveStateSyncElement, liveStateSyncElement]);
|
|
649
|
+
return liveStateSyncElement;
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* @beta This hook is in beta
|
|
653
|
+
*/
|
|
654
|
+
function useLiveStateData(liveStateDataId) {
|
|
655
|
+
var liveStateSyncElement = useLiveStateSyncUtils();
|
|
656
|
+
var _a = React__default["default"].useState(), data = _a[0], setData = _a[1];
|
|
657
|
+
React.useEffect(function () {
|
|
658
|
+
if (!(liveStateSyncElement === null || liveStateSyncElement === void 0 ? void 0 : liveStateSyncElement.getLiveStateData))
|
|
659
|
+
return;
|
|
660
|
+
var subscription = liveStateSyncElement.getLiveStateData(liveStateDataId).subscribe(function (res) {
|
|
661
|
+
setData(res);
|
|
662
|
+
});
|
|
663
|
+
return function () {
|
|
664
|
+
subscription.unsubscribe();
|
|
665
|
+
};
|
|
666
|
+
}, [liveStateSyncElement === null || liveStateSyncElement === void 0 ? void 0 : liveStateSyncElement.getLiveStateData]);
|
|
667
|
+
return data;
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* @beta This hook is in beta
|
|
671
|
+
*/
|
|
672
|
+
function useSetLiveStateData(liveStateDataId, liveStateData) {
|
|
673
|
+
var liveStateSyncElement = useLiveStateSyncUtils();
|
|
674
|
+
React__default["default"].useEffect(function () {
|
|
675
|
+
if (liveStateSyncElement && liveStateDataId && liveStateData) {
|
|
676
|
+
liveStateSyncElement === null || liveStateSyncElement === void 0 ? void 0 : liveStateSyncElement.setLiveStateData(liveStateDataId, liveStateData);
|
|
677
|
+
}
|
|
678
|
+
}, [liveStateSyncElement === null || liveStateSyncElement === void 0 ? void 0 : liveStateSyncElement.setLiveStateData]);
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* @beta This hook is in beta
|
|
682
|
+
*/
|
|
683
|
+
function useUserEditorState() {
|
|
684
|
+
var liveStateSyncElement = useLiveStateSyncUtils();
|
|
685
|
+
var _a = React__default["default"].useState(), data = _a[0], setData = _a[1];
|
|
686
|
+
React.useEffect(function () {
|
|
687
|
+
if (!(liveStateSyncElement === null || liveStateSyncElement === void 0 ? void 0 : liveStateSyncElement.isUserEditor))
|
|
688
|
+
return;
|
|
689
|
+
var subscription = liveStateSyncElement.isUserEditor().subscribe(function (res) {
|
|
690
|
+
setData(res);
|
|
691
|
+
});
|
|
692
|
+
return function () {
|
|
693
|
+
subscription.unsubscribe();
|
|
694
|
+
};
|
|
695
|
+
}, [liveStateSyncElement === null || liveStateSyncElement === void 0 ? void 0 : liveStateSyncElement.isUserEditor]);
|
|
696
|
+
return data;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* @beta This hook is in beta
|
|
701
|
+
*/
|
|
702
|
+
function usePresenceUtils() {
|
|
703
|
+
var _a = React__default["default"].useState(), presenceElement = _a[0], setPresenceElement = _a[1];
|
|
704
|
+
var client = useVeltClient().client;
|
|
705
|
+
React__default["default"].useEffect(function () {
|
|
706
|
+
if (!client || presenceElement)
|
|
707
|
+
return;
|
|
708
|
+
var loadedPresenceElement = client.getPresenceElement();
|
|
709
|
+
setPresenceElement(loadedPresenceElement);
|
|
710
|
+
}, [client, setPresenceElement, presenceElement]);
|
|
711
|
+
return presenceElement;
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* @beta This hook is in beta
|
|
715
|
+
*/
|
|
716
|
+
function usePresenceUsers() {
|
|
717
|
+
var presenceElement = usePresenceUtils();
|
|
718
|
+
var _a = React__default["default"].useState(), data = _a[0], setData = _a[1];
|
|
719
|
+
React.useEffect(function () {
|
|
720
|
+
if (!presenceElement)
|
|
721
|
+
return;
|
|
722
|
+
var subscription = presenceElement.getOnlineUsersOnCurrentDocument().subscribe(function (res) {
|
|
723
|
+
setData(res);
|
|
724
|
+
});
|
|
725
|
+
return function () {
|
|
726
|
+
subscription.unsubscribe();
|
|
727
|
+
};
|
|
728
|
+
}, [presenceElement]);
|
|
729
|
+
return data;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
/**
|
|
733
|
+
* @beta This hook is in beta
|
|
734
|
+
*/
|
|
735
|
+
function useRecorderUtils() {
|
|
736
|
+
var _a = React__default["default"].useState(), recorderElement = _a[0], setRecorderElement = _a[1];
|
|
737
|
+
var client = useVeltClient().client;
|
|
738
|
+
React__default["default"].useEffect(function () {
|
|
739
|
+
if (!client || recorderElement)
|
|
740
|
+
return;
|
|
741
|
+
var loadedRecorderElement = client.getRecorderElement();
|
|
742
|
+
setRecorderElement(loadedRecorderElement);
|
|
743
|
+
}, [client, setRecorderElement, recorderElement]);
|
|
744
|
+
return recorderElement;
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* @beta This hook is in beta
|
|
748
|
+
*/
|
|
749
|
+
function useRecorderAddHandler() {
|
|
750
|
+
var recorderElement = useRecorderUtils();
|
|
751
|
+
var _a = React__default["default"].useState(), data = _a[0], setData = _a[1];
|
|
752
|
+
React.useEffect(function () {
|
|
753
|
+
if (!recorderElement)
|
|
754
|
+
return;
|
|
755
|
+
var subscription = recorderElement.onRecordedData().subscribe(function (res) {
|
|
756
|
+
setData(res);
|
|
757
|
+
});
|
|
758
|
+
return function () {
|
|
759
|
+
subscription.unsubscribe();
|
|
760
|
+
};
|
|
761
|
+
}, [recorderElement]);
|
|
762
|
+
return data;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
/**
|
|
766
|
+
* @beta This hook is in beta
|
|
767
|
+
*/
|
|
768
|
+
function useAIRewriterUtils() {
|
|
769
|
+
var _a = React__default["default"].useState(), rewriterElement = _a[0], setRewriterElement = _a[1];
|
|
770
|
+
var client = useVeltClient().client;
|
|
771
|
+
React__default["default"].useEffect(function () {
|
|
772
|
+
if (!client || rewriterElement)
|
|
773
|
+
return;
|
|
774
|
+
var loadedRewriterElement = client.getRewriterElement();
|
|
775
|
+
setRewriterElement(loadedRewriterElement);
|
|
776
|
+
}, [client, setRewriterElement, rewriterElement]);
|
|
777
|
+
return rewriterElement;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
/**
|
|
781
|
+
* @beta This hook is in beta
|
|
782
|
+
*/
|
|
783
|
+
function useLiveSelectionUtils() {
|
|
784
|
+
var _a = React__default["default"].useState(), selectionElement = _a[0], setSelectionElement = _a[1];
|
|
785
|
+
var client = useVeltClient().client;
|
|
786
|
+
React__default["default"].useEffect(function () {
|
|
787
|
+
if (!client || selectionElement)
|
|
788
|
+
return;
|
|
789
|
+
var loadedSelectionElement = client.getSelectionElement();
|
|
790
|
+
setSelectionElement(loadedSelectionElement);
|
|
791
|
+
}, [client, setSelectionElement, selectionElement]);
|
|
792
|
+
return selectionElement;
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
/**
|
|
796
|
+
* @beta This hook is in beta
|
|
797
|
+
*/
|
|
798
|
+
function useTagUtils() {
|
|
799
|
+
var _a = React__default["default"].useState(), tagElement = _a[0], setTagElement = _a[1];
|
|
800
|
+
var client = useVeltClient().client;
|
|
801
|
+
React__default["default"].useEffect(function () {
|
|
802
|
+
if (!client || tagElement)
|
|
803
|
+
return;
|
|
804
|
+
var loadedTagElement = client.getTagElement();
|
|
805
|
+
setTagElement(loadedTagElement);
|
|
806
|
+
}, [client, setTagElement, tagElement]);
|
|
807
|
+
return tagElement;
|
|
808
|
+
}
|
|
809
|
+
/**
|
|
810
|
+
* @beta This hook is in beta
|
|
811
|
+
*/
|
|
812
|
+
function useTagAnnotations(documentId, location) {
|
|
813
|
+
var tagElement = useTagUtils();
|
|
814
|
+
var _a = React__default["default"].useState(), data = _a[0], setData = _a[1];
|
|
815
|
+
React.useEffect(function () {
|
|
816
|
+
if (!tagElement)
|
|
817
|
+
return;
|
|
818
|
+
var subscription = tagElement.getAllTagAnnotations(documentId, location).subscribe(function (res) {
|
|
819
|
+
setData(res);
|
|
820
|
+
});
|
|
821
|
+
return function () {
|
|
822
|
+
subscription.unsubscribe();
|
|
823
|
+
};
|
|
824
|
+
}, [tagElement]);
|
|
825
|
+
return data;
|
|
826
|
+
}
|
|
827
|
+
|
|
434
828
|
exports.VeltArrowTool = SnippylyArrowTool;
|
|
435
829
|
exports.VeltArrows = SnippylyArrows;
|
|
436
830
|
exports.VeltCommentBubble = SnippylyCommentBubble;
|
|
@@ -453,5 +847,31 @@ exports.VeltTags = SnippylyTags;
|
|
|
453
847
|
exports.VeltUserInviteTool = SnippylyUserInviteTool;
|
|
454
848
|
exports.VeltUserRequestTool = SnippylyUserRequestTool;
|
|
455
849
|
exports.VeltVideoPlayer = VeltVideoPlayer;
|
|
850
|
+
exports.useAIRewriterUtils = useAIRewriterUtils;
|
|
851
|
+
exports.useAddLocation = useAddLocation;
|
|
852
|
+
exports.useClient = useClient;
|
|
853
|
+
exports.useCommentAddHandler = useCommentAddHandler;
|
|
854
|
+
exports.useCommentAnnotations = useCommentAnnotations;
|
|
855
|
+
exports.useCommentDialogSidebarClickHandler = useCommentDialogSidebarClickHandler;
|
|
856
|
+
exports.useCommentModeState = useCommentModeState;
|
|
857
|
+
exports.useCommentUpdateHandler = useCommentUpdateHandler;
|
|
858
|
+
exports.useCommentUtils = useCommentUtils;
|
|
859
|
+
exports.useCursorUsers = useCursorUsers;
|
|
860
|
+
exports.useCursorUtils = useCursorUtils;
|
|
861
|
+
exports.useHuddleUtils = useHuddleUtils;
|
|
862
|
+
exports.useIdentify = useIdentify;
|
|
863
|
+
exports.useLiveSelectionUtils = useLiveSelectionUtils;
|
|
864
|
+
exports.useLiveStateData = useLiveStateData;
|
|
865
|
+
exports.useLiveStateSyncUtils = useLiveStateSyncUtils;
|
|
866
|
+
exports.usePresenceUsers = usePresenceUsers;
|
|
867
|
+
exports.usePresenceUtils = usePresenceUtils;
|
|
868
|
+
exports.useRecorderAddHandler = useRecorderAddHandler;
|
|
869
|
+
exports.useRecorderUtils = useRecorderUtils;
|
|
870
|
+
exports.useSetDocumentId = useSetDocumentId;
|
|
871
|
+
exports.useSetLiveStateData = useSetLiveStateData;
|
|
872
|
+
exports.useSetLocation = useSetLocation;
|
|
873
|
+
exports.useTagAnnotations = useTagAnnotations;
|
|
874
|
+
exports.useTagUtils = useTagUtils;
|
|
875
|
+
exports.useUserEditorState = useUserEditorState;
|
|
456
876
|
exports.useVeltClient = useVeltClient;
|
|
457
877
|
//# sourceMappingURL=index.js.map
|