@veltdev/react 1.0.93 → 1.0.95
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 +87 -1
- package/cjs/index.js.map +1 -1
- package/cjs/types/components/VeltNotificationsHistoryPanel/VeltNotificationsHistoryPanel.d.ts +7 -0
- package/cjs/types/components/VeltNotificationsHistoryPanel/index.d.ts +1 -0
- package/cjs/types/components/VeltNotificationsPanel/VeltNotificationsPanel.d.ts +6 -0
- package/cjs/types/components/VeltNotificationsPanel/index.d.ts +1 -0
- package/cjs/types/components/VeltNotificationsTool/VeltNotificationsTool.d.ts +6 -0
- package/cjs/types/components/VeltNotificationsTool/index.d.ts +1 -0
- package/cjs/types/components/index.d.ts +3 -0
- package/cjs/types/constants.d.ts +1 -1
- package/cjs/types/hooks/NotificationElement.d.ts +9 -0
- package/cjs/types/hooks/index.d.ts +1 -0
- package/esm/index.js +83 -2
- package/esm/index.js.map +1 -1
- package/esm/types/components/VeltNotificationsHistoryPanel/VeltNotificationsHistoryPanel.d.ts +7 -0
- package/esm/types/components/VeltNotificationsHistoryPanel/index.d.ts +1 -0
- package/esm/types/components/VeltNotificationsPanel/VeltNotificationsPanel.d.ts +6 -0
- package/esm/types/components/VeltNotificationsPanel/index.d.ts +1 -0
- package/esm/types/components/VeltNotificationsTool/VeltNotificationsTool.d.ts +6 -0
- package/esm/types/components/VeltNotificationsTool/index.d.ts +1 -0
- package/esm/types/components/index.d.ts +3 -0
- package/esm/types/constants.d.ts +1 -1
- package/esm/types/hooks/NotificationElement.d.ts +9 -0
- package/esm/types/hooks/index.d.ts +1 -0
- package/index.d.ts +27 -2
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface IVeltNotificationsHistoryPanelProps {
|
|
3
|
+
embedMode?: boolean;
|
|
4
|
+
onNotificationClick?: Function;
|
|
5
|
+
}
|
|
6
|
+
declare const VeltNotificationsHistoryPanel: React.FC<IVeltNotificationsHistoryPanelProps>;
|
|
7
|
+
export default VeltNotificationsHistoryPanel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./VeltNotificationsHistoryPanel";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./VeltNotificationsPanel";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface IVeltNotificationsToolProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
3
|
+
onNotificationClick?: Function;
|
|
4
|
+
}
|
|
5
|
+
declare const VeltNotificationsTool: React.FC<IVeltNotificationsToolProps>;
|
|
6
|
+
export default VeltNotificationsTool;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./VeltNotificationsTool";
|
|
@@ -22,3 +22,6 @@ export { default as VeltCommentPlayerTimeline } from "./VeltCommentPlayerTimelin
|
|
|
22
22
|
export { default as VeltVideoPlayer } from "./VeltVideoPlayer";
|
|
23
23
|
export { default as VeltViewAnalytics } from "./VeltViewAnalytics";
|
|
24
24
|
export { default as VeltCommentThread } from "./VeltCommentThread";
|
|
25
|
+
export { default as VeltNotificationsTool } from "./VeltNotificationsTool";
|
|
26
|
+
export { default as VeltNotificationsPanel } from "./VeltNotificationsPanel";
|
|
27
|
+
export { default as VeltNotificationsHistoryPanel } from "./VeltNotificationsHistoryPanel";
|
package/cjs/types/constants.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VELT_SDK_VERSION = "1.0.
|
|
1
|
+
export declare const VELT_SDK_VERSION = "1.0.110";
|
|
2
2
|
export declare const VELT_SDK_INIT_EVENT = "onVeltInit";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Notification, NotificationElement } from "@veltdev/types";
|
|
2
|
+
/**
|
|
3
|
+
* @beta This hook is in beta
|
|
4
|
+
*/
|
|
5
|
+
export declare function useNotificationUtils(): NotificationElement | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* @beta This hook is in beta
|
|
8
|
+
*/
|
|
9
|
+
export declare function useNotificationsData(): Notification[] | null;
|
|
@@ -9,3 +9,4 @@ export { useAIRewriterUtils, } from './RewriterElement';
|
|
|
9
9
|
export { useLiveSelectionUtils, } from './SelectionElement';
|
|
10
10
|
export { useTagUtils, useTagAnnotations, } from './TagElement';
|
|
11
11
|
export { useViewsUtils, useUniqueViewsByDate, useUniqueViewsByUser, } from './ViewsElement';
|
|
12
|
+
export { useNotificationUtils, useNotificationsData, } from './NotificationElement';
|
package/esm/index.js
CHANGED
|
@@ -101,7 +101,7 @@ var loadVelt = function (callback, version, staging, develop) {
|
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
var VELT_SDK_VERSION = '1.0.
|
|
104
|
+
var VELT_SDK_VERSION = '1.0.110';
|
|
105
105
|
var VELT_SDK_INIT_EVENT = 'onVeltInit';
|
|
106
106
|
|
|
107
107
|
var SnippylyProvider = function (props) {
|
|
@@ -447,6 +447,54 @@ var VeltCommentThread = function (props) {
|
|
|
447
447
|
return (React.createElement("velt-comment-thread", { "annotation-id": annotationId }));
|
|
448
448
|
};
|
|
449
449
|
|
|
450
|
+
var VeltNotificationsTool = function (props) {
|
|
451
|
+
var children = props.children, onNotificationClick = props.onNotificationClick;
|
|
452
|
+
var ref = useRef();
|
|
453
|
+
useEffect(function () {
|
|
454
|
+
if (ref.current) {
|
|
455
|
+
var element = ref.current;
|
|
456
|
+
element.addEventListener('onNotificationClick', function (event) {
|
|
457
|
+
if (onNotificationClick) {
|
|
458
|
+
onNotificationClick(event === null || event === void 0 ? void 0 : event.detail);
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
}, []);
|
|
463
|
+
return (React.createElement("velt-notifications-tool", { ref: ref }, children));
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
var VeltNotificationsPanel = function (props) {
|
|
467
|
+
var onNotificationClick = props.onNotificationClick;
|
|
468
|
+
var ref = useRef();
|
|
469
|
+
useEffect(function () {
|
|
470
|
+
if (ref.current) {
|
|
471
|
+
var element = ref.current;
|
|
472
|
+
element.addEventListener('onNotificationClick', function (event) {
|
|
473
|
+
if (onNotificationClick) {
|
|
474
|
+
onNotificationClick(event === null || event === void 0 ? void 0 : event.detail);
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
}, []);
|
|
479
|
+
return (React.createElement("velt-notifications-panel", { ref: ref }));
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
var VeltNotificationsHistoryPanel = function (props) {
|
|
483
|
+
var embedMode = props.embedMode, onNotificationClick = props.onNotificationClick;
|
|
484
|
+
var ref = useRef();
|
|
485
|
+
useEffect(function () {
|
|
486
|
+
if (ref.current) {
|
|
487
|
+
var element = ref.current;
|
|
488
|
+
element.addEventListener('onNotificationClick', function (event) {
|
|
489
|
+
if (onNotificationClick) {
|
|
490
|
+
onNotificationClick(event === null || event === void 0 ? void 0 : event.detail);
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
}, []);
|
|
495
|
+
return (React.createElement("velt-notifications-history-panel", { ref: ref, "embed-mode": [true, false].includes(embedMode) ? (embedMode ? 'true' : 'false') : undefined }));
|
|
496
|
+
};
|
|
497
|
+
|
|
450
498
|
/**
|
|
451
499
|
* @beta This hook is in beta
|
|
452
500
|
*/
|
|
@@ -972,6 +1020,39 @@ function useUniqueViewsByDate(clientLocationId) {
|
|
|
972
1020
|
return data;
|
|
973
1021
|
}
|
|
974
1022
|
|
|
1023
|
+
/**
|
|
1024
|
+
* @beta This hook is in beta
|
|
1025
|
+
*/
|
|
1026
|
+
function useNotificationUtils() {
|
|
1027
|
+
var _a = React.useState(), notificationElement = _a[0], setNotificationElement = _a[1];
|
|
1028
|
+
var client = useVeltClient().client;
|
|
1029
|
+
React.useEffect(function () {
|
|
1030
|
+
if (!client || notificationElement)
|
|
1031
|
+
return;
|
|
1032
|
+
var loadedNotificationElement = client.getNotificationElement();
|
|
1033
|
+
setNotificationElement(loadedNotificationElement);
|
|
1034
|
+
}, [client, setNotificationElement, notificationElement]);
|
|
1035
|
+
return notificationElement;
|
|
1036
|
+
}
|
|
1037
|
+
/**
|
|
1038
|
+
* @beta This hook is in beta
|
|
1039
|
+
*/
|
|
1040
|
+
function useNotificationsData() {
|
|
1041
|
+
var notificationElement = useNotificationUtils();
|
|
1042
|
+
var _a = React.useState([]), data = _a[0], setData = _a[1];
|
|
1043
|
+
useEffect(function () {
|
|
1044
|
+
if (!(notificationElement === null || notificationElement === void 0 ? void 0 : notificationElement.getNotificationsData))
|
|
1045
|
+
return;
|
|
1046
|
+
var subscription = notificationElement.getNotificationsData().subscribe(function (res) {
|
|
1047
|
+
setData(res);
|
|
1048
|
+
});
|
|
1049
|
+
return function () {
|
|
1050
|
+
subscription.unsubscribe();
|
|
1051
|
+
};
|
|
1052
|
+
}, [notificationElement === null || notificationElement === void 0 ? void 0 : notificationElement.getNotificationsData]);
|
|
1053
|
+
return data;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
975
1056
|
var sessionId = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
|
|
976
1057
|
var getSessionId = function () {
|
|
977
1058
|
return sessionId;
|
|
@@ -1048,5 +1129,5 @@ var logLiveState = function (action, liveStateDataId) {
|
|
|
1048
1129
|
}
|
|
1049
1130
|
};
|
|
1050
1131
|
|
|
1051
|
-
export { SnippylyArrowTool as VeltArrowTool, SnippylyArrows as VeltArrows, SnippylyCommentBubble as VeltCommentBubble, VeltCommentPlayerTimeline, VeltCommentThread, SnippylyCommentTool as VeltCommentTool, SnippylyComments as VeltComments, SnippylyCommentsSidebar as VeltCommentsSidebar, SnippylyCursor as VeltCursor, SnippylyHuddle as VeltHuddle, SnippylyHuddleTool as VeltHuddleTool, SnippylyPresence as VeltPresence, SnippylyProvider as VeltProvider, SnippylyRecorderControlPanel as VeltRecorderControlPanel, SnippylyRecorderNotes as VeltRecorderNotes, SnippylyRecorderPlayer as VeltRecorderPlayer, SnippylyRecorderTool as VeltRecorderTool, SnippylySidebarButton as VeltSidebarButton, SnippylyTagTool as VeltTagTool, SnippylyTags as VeltTags, SnippylyUserInviteTool as VeltUserInviteTool, SnippylyUserRequestTool as VeltUserRequestTool, VeltVideoPlayer, VeltViewAnalytics, createLiveStateMiddleware, useAIRewriterUtils, useAddLocation, useClient, useCommentAddHandler, useCommentAnnotations, useCommentDialogSidebarClickHandler, useCommentModeState, useCommentUpdateHandler, useCommentUtils, useCursorUsers, useCursorUtils, useEditor, useEditorAccessRequestHandler, useHuddleUtils, useIdentify, useLiveSelectionUtils, useLiveState, useLiveStateData, useLiveStateSyncUtils, usePresenceUsers, usePresenceUtils, useRecorderAddHandler, useRecorderUtils, useSetDocumentId, useSetLiveStateData, useSetLocation, useTagAnnotations, useTagUtils, useUniqueViewsByDate, useUniqueViewsByUser, useUserEditorState, useVeltClient, useViewsUtils };
|
|
1132
|
+
export { SnippylyArrowTool as VeltArrowTool, SnippylyArrows as VeltArrows, SnippylyCommentBubble as VeltCommentBubble, VeltCommentPlayerTimeline, VeltCommentThread, SnippylyCommentTool as VeltCommentTool, SnippylyComments as VeltComments, SnippylyCommentsSidebar as VeltCommentsSidebar, SnippylyCursor as VeltCursor, SnippylyHuddle as VeltHuddle, SnippylyHuddleTool as VeltHuddleTool, VeltNotificationsHistoryPanel, VeltNotificationsPanel, VeltNotificationsTool, SnippylyPresence as VeltPresence, SnippylyProvider as VeltProvider, SnippylyRecorderControlPanel as VeltRecorderControlPanel, SnippylyRecorderNotes as VeltRecorderNotes, SnippylyRecorderPlayer as VeltRecorderPlayer, SnippylyRecorderTool as VeltRecorderTool, SnippylySidebarButton as VeltSidebarButton, SnippylyTagTool as VeltTagTool, SnippylyTags as VeltTags, SnippylyUserInviteTool as VeltUserInviteTool, SnippylyUserRequestTool as VeltUserRequestTool, VeltVideoPlayer, VeltViewAnalytics, createLiveStateMiddleware, useAIRewriterUtils, useAddLocation, useClient, useCommentAddHandler, useCommentAnnotations, useCommentDialogSidebarClickHandler, useCommentModeState, useCommentUpdateHandler, useCommentUtils, useCursorUsers, useCursorUtils, useEditor, useEditorAccessRequestHandler, useHuddleUtils, useIdentify, useLiveSelectionUtils, useLiveState, useLiveStateData, useLiveStateSyncUtils, useNotificationUtils, useNotificationsData, usePresenceUsers, usePresenceUtils, useRecorderAddHandler, useRecorderUtils, useSetDocumentId, useSetLiveStateData, useSetLocation, useTagAnnotations, useTagUtils, useUniqueViewsByDate, useUniqueViewsByUser, useUserEditorState, useVeltClient, useViewsUtils };
|
|
1052
1133
|
//# sourceMappingURL=index.js.map
|