@veltdev/react 1.0.94 → 1.0.96
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 +56 -21
- package/cjs/index.js.map +1 -1
- package/cjs/types/components/SnippylyArrowTool/SnippylyArrowTool.d.ts +1 -0
- package/cjs/types/components/SnippylyCommentTool/SnippylyCommentTool.d.ts +1 -0
- package/cjs/types/components/SnippylyHuddleTool/SnippylyHuddleTool.d.ts +1 -0
- package/cjs/types/components/SnippylyRecorderTool/SnippylyRecorderTool.d.ts +1 -0
- package/cjs/types/components/SnippylySidebarButton/SnippylySidebarButton.d.ts +1 -0
- package/cjs/types/components/SnippylyUserInviteTool/SnippylyUserInviteTool.d.ts +1 -0
- package/cjs/types/components/VeltNotificationsHistoryPanel/VeltNotificationsHistoryPanel.d.ts +8 -0
- package/cjs/types/components/VeltNotificationsHistoryPanel/index.d.ts +1 -0
- package/cjs/types/components/VeltNotificationsPanel/VeltNotificationsPanel.d.ts +1 -0
- package/cjs/types/components/VeltNotificationsTool/VeltNotificationsTool.d.ts +1 -0
- package/cjs/types/components/index.d.ts +1 -1
- 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 +54 -21
- package/esm/index.js.map +1 -1
- package/esm/types/components/SnippylyArrowTool/SnippylyArrowTool.d.ts +1 -0
- package/esm/types/components/SnippylyCommentTool/SnippylyCommentTool.d.ts +1 -0
- package/esm/types/components/SnippylyHuddleTool/SnippylyHuddleTool.d.ts +1 -0
- package/esm/types/components/SnippylyRecorderTool/SnippylyRecorderTool.d.ts +1 -0
- package/esm/types/components/SnippylySidebarButton/SnippylySidebarButton.d.ts +1 -0
- package/esm/types/components/SnippylyUserInviteTool/SnippylyUserInviteTool.d.ts +1 -0
- package/esm/types/components/VeltNotificationsHistoryPanel/VeltNotificationsHistoryPanel.d.ts +8 -0
- package/esm/types/components/VeltNotificationsHistoryPanel/index.d.ts +1 -0
- package/esm/types/components/VeltNotificationsPanel/VeltNotificationsPanel.d.ts +1 -0
- package/esm/types/components/VeltNotificationsTool/VeltNotificationsTool.d.ts +1 -0
- package/esm/types/components/index.d.ts +1 -1
- 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 +22 -4
- package/package.json +1 -1
- package/cjs/types/components/VeltNotificationsHistory/VeltNotificationsHistory.d.ts +0 -7
- package/cjs/types/components/VeltNotificationsHistory/index.d.ts +0 -1
- package/esm/types/components/VeltNotificationsHistory/VeltNotificationsHistory.d.ts +0 -7
- package/esm/types/components/VeltNotificationsHistory/index.d.ts +0 -1
package/cjs/index.js
CHANGED
|
@@ -109,7 +109,7 @@ var loadVelt = function (callback, version, staging, develop) {
|
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
111
|
|
|
112
|
-
var VELT_SDK_VERSION = '1.0.
|
|
112
|
+
var VELT_SDK_VERSION = '1.0.111';
|
|
113
113
|
var VELT_SDK_INIT_EVENT = 'onVeltInit';
|
|
114
114
|
|
|
115
115
|
var SnippylyProvider = function (props) {
|
|
@@ -277,7 +277,7 @@ var SnippylyCommentsSidebar = function (props) {
|
|
|
277
277
|
};
|
|
278
278
|
|
|
279
279
|
var SnippylyCommentTool = function (props) {
|
|
280
|
-
var targetCommentElementId = props.targetCommentElementId, onCommentModeChange = props.onCommentModeChange, children = props.children;
|
|
280
|
+
var targetCommentElementId = props.targetCommentElementId, onCommentModeChange = props.onCommentModeChange, children = props.children, darkMode = props.darkMode;
|
|
281
281
|
var ref = React.useRef();
|
|
282
282
|
React.useEffect(function () {
|
|
283
283
|
if (ref.current) {
|
|
@@ -289,7 +289,7 @@ var SnippylyCommentTool = function (props) {
|
|
|
289
289
|
});
|
|
290
290
|
}
|
|
291
291
|
}, []);
|
|
292
|
-
return (React__default["default"].createElement("velt-comment-tool", { ref: ref, "target-comment-element-id": targetCommentElementId }, children));
|
|
292
|
+
return (React__default["default"].createElement("velt-comment-tool", { ref: ref, "target-comment-element-id": targetCommentElementId, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined }, children));
|
|
293
293
|
};
|
|
294
294
|
|
|
295
295
|
var SnippylyCursor = function (props) {
|
|
@@ -316,8 +316,8 @@ var SnippylyHuddle = function (props) {
|
|
|
316
316
|
};
|
|
317
317
|
|
|
318
318
|
var SnippylyHuddleTool = function (props) {
|
|
319
|
-
var type = props.type, children = props.children;
|
|
320
|
-
return (React__default["default"].createElement("velt-huddle-tool", { type: type }, children));
|
|
319
|
+
var type = props.type, children = props.children, darkMode = props.darkMode;
|
|
320
|
+
return (React__default["default"].createElement("velt-huddle-tool", { type: type, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined }, children));
|
|
321
321
|
};
|
|
322
322
|
|
|
323
323
|
var SnippylyPresence = function (props) {
|
|
@@ -386,13 +386,13 @@ var SnippylyRecorderPlayer = function (props) {
|
|
|
386
386
|
};
|
|
387
387
|
|
|
388
388
|
var SnippylyRecorderTool = function (props) {
|
|
389
|
-
var type = props.type, panelId = props.panelId, buttonLabel = props.buttonLabel, children = props.children;
|
|
390
|
-
return (React__default["default"].createElement("velt-recorder-tool", { type: type, "panel-id": panelId, "button-label": buttonLabel }, children));
|
|
389
|
+
var type = props.type, panelId = props.panelId, buttonLabel = props.buttonLabel, children = props.children, darkMode = props.darkMode;
|
|
390
|
+
return (React__default["default"].createElement("velt-recorder-tool", { type: type, "panel-id": panelId, "button-label": buttonLabel, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined }, children));
|
|
391
391
|
};
|
|
392
392
|
|
|
393
393
|
var SnippylySidebarButton = function (props) {
|
|
394
|
-
var tooltipText = props.tooltipText, children = props.children;
|
|
395
|
-
return (React__default["default"].createElement("velt-sidebar-button", { "tooltip-text": tooltipText }, children));
|
|
394
|
+
var tooltipText = props.tooltipText, children = props.children, darkMode = props.darkMode;
|
|
395
|
+
return (React__default["default"].createElement("velt-sidebar-button", { "tooltip-text": tooltipText, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined }, children));
|
|
396
396
|
};
|
|
397
397
|
|
|
398
398
|
var SnippylyTags = function (props) {
|
|
@@ -410,13 +410,13 @@ var SnippylyArrows = function () {
|
|
|
410
410
|
};
|
|
411
411
|
|
|
412
412
|
var SnippylyArrowTool = function (props) {
|
|
413
|
-
var children = props.children;
|
|
414
|
-
return (React__default["default"].createElement("velt-arrow-tool",
|
|
413
|
+
var children = props.children, darkMode = props.darkMode;
|
|
414
|
+
return (React__default["default"].createElement("velt-arrow-tool", { "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined }, children));
|
|
415
415
|
};
|
|
416
416
|
|
|
417
417
|
var SnippylyUserInviteTool = function (props) {
|
|
418
|
-
var type = props.type, source = props.source, title = props.title, placeholder = props.placeholder, inviteUrl = props.inviteUrl, accessControlDropdown = props.accessControlDropdown, documentUserAccessList = props.documentUserAccessList, children = props.children;
|
|
419
|
-
return (React__default["default"].createElement("velt-user-invite-tool", { type: type, source: source, title: title, placeholder: placeholder, "invite-url": inviteUrl, "access-control-dropdown": [true, false].includes(accessControlDropdown) ? accessControlDropdown : undefined, "document-user-access-list": [true, false].includes(documentUserAccessList) ? documentUserAccessList : undefined }, children));
|
|
418
|
+
var type = props.type, source = props.source, title = props.title, placeholder = props.placeholder, inviteUrl = props.inviteUrl, accessControlDropdown = props.accessControlDropdown, documentUserAccessList = props.documentUserAccessList, children = props.children, darkMode = props.darkMode;
|
|
419
|
+
return (React__default["default"].createElement("velt-user-invite-tool", { type: type, source: source, title: title, placeholder: placeholder, "invite-url": inviteUrl, "access-control-dropdown": [true, false].includes(accessControlDropdown) ? accessControlDropdown : undefined, "document-user-access-list": [true, false].includes(documentUserAccessList) ? documentUserAccessList : undefined, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined }, children));
|
|
420
420
|
};
|
|
421
421
|
|
|
422
422
|
var SnippylyUserRequestTool = function (props) {
|
|
@@ -456,7 +456,7 @@ var VeltCommentThread = function (props) {
|
|
|
456
456
|
};
|
|
457
457
|
|
|
458
458
|
var VeltNotificationsTool = function (props) {
|
|
459
|
-
var children = props.children, onNotificationClick = props.onNotificationClick;
|
|
459
|
+
var children = props.children, darkMode = props.darkMode, onNotificationClick = props.onNotificationClick;
|
|
460
460
|
var ref = React.useRef();
|
|
461
461
|
React.useEffect(function () {
|
|
462
462
|
if (ref.current) {
|
|
@@ -468,11 +468,11 @@ var VeltNotificationsTool = function (props) {
|
|
|
468
468
|
});
|
|
469
469
|
}
|
|
470
470
|
}, []);
|
|
471
|
-
return (React__default["default"].createElement("velt-notifications-tool", { ref: ref }, children));
|
|
471
|
+
return (React__default["default"].createElement("velt-notifications-tool", { ref: ref, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined }, children));
|
|
472
472
|
};
|
|
473
473
|
|
|
474
474
|
var VeltNotificationsPanel = function (props) {
|
|
475
|
-
var onNotificationClick = props.onNotificationClick;
|
|
475
|
+
var darkMode = props.darkMode, onNotificationClick = props.onNotificationClick;
|
|
476
476
|
var ref = React.useRef();
|
|
477
477
|
React.useEffect(function () {
|
|
478
478
|
if (ref.current) {
|
|
@@ -484,11 +484,11 @@ var VeltNotificationsPanel = function (props) {
|
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
486
|
}, []);
|
|
487
|
-
return (React__default["default"].createElement("velt-notifications-panel", { ref: ref }));
|
|
487
|
+
return (React__default["default"].createElement("velt-notifications-panel", { ref: ref, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined }));
|
|
488
488
|
};
|
|
489
489
|
|
|
490
|
-
var
|
|
491
|
-
var embedMode = props.embedMode, onNotificationClick = props.onNotificationClick;
|
|
490
|
+
var VeltNotificationsHistoryPanel = function (props) {
|
|
491
|
+
var embedMode = props.embedMode, darkMode = props.darkMode, onNotificationClick = props.onNotificationClick;
|
|
492
492
|
var ref = React.useRef();
|
|
493
493
|
React.useEffect(function () {
|
|
494
494
|
if (ref.current) {
|
|
@@ -500,7 +500,7 @@ var VeltNotificationsHistory = function (props) {
|
|
|
500
500
|
});
|
|
501
501
|
}
|
|
502
502
|
}, []);
|
|
503
|
-
return (React__default["default"].createElement("velt-notifications-history", { ref: ref, "embed-mode": [true, false].includes(embedMode) ? (embedMode ? 'true' : 'false') : undefined }));
|
|
503
|
+
return (React__default["default"].createElement("velt-notifications-history-panel", { ref: ref, "embed-mode": [true, false].includes(embedMode) ? (embedMode ? 'true' : 'false') : undefined, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined }));
|
|
504
504
|
};
|
|
505
505
|
|
|
506
506
|
/**
|
|
@@ -1028,6 +1028,39 @@ function useUniqueViewsByDate(clientLocationId) {
|
|
|
1028
1028
|
return data;
|
|
1029
1029
|
}
|
|
1030
1030
|
|
|
1031
|
+
/**
|
|
1032
|
+
* @beta This hook is in beta
|
|
1033
|
+
*/
|
|
1034
|
+
function useNotificationUtils() {
|
|
1035
|
+
var _a = React__default["default"].useState(), notificationElement = _a[0], setNotificationElement = _a[1];
|
|
1036
|
+
var client = useVeltClient().client;
|
|
1037
|
+
React__default["default"].useEffect(function () {
|
|
1038
|
+
if (!client || notificationElement)
|
|
1039
|
+
return;
|
|
1040
|
+
var loadedNotificationElement = client.getNotificationElement();
|
|
1041
|
+
setNotificationElement(loadedNotificationElement);
|
|
1042
|
+
}, [client, setNotificationElement, notificationElement]);
|
|
1043
|
+
return notificationElement;
|
|
1044
|
+
}
|
|
1045
|
+
/**
|
|
1046
|
+
* @beta This hook is in beta
|
|
1047
|
+
*/
|
|
1048
|
+
function useNotificationsData() {
|
|
1049
|
+
var notificationElement = useNotificationUtils();
|
|
1050
|
+
var _a = React__default["default"].useState([]), data = _a[0], setData = _a[1];
|
|
1051
|
+
React.useEffect(function () {
|
|
1052
|
+
if (!(notificationElement === null || notificationElement === void 0 ? void 0 : notificationElement.getNotificationsData))
|
|
1053
|
+
return;
|
|
1054
|
+
var subscription = notificationElement.getNotificationsData().subscribe(function (res) {
|
|
1055
|
+
setData(res);
|
|
1056
|
+
});
|
|
1057
|
+
return function () {
|
|
1058
|
+
subscription.unsubscribe();
|
|
1059
|
+
};
|
|
1060
|
+
}, [notificationElement === null || notificationElement === void 0 ? void 0 : notificationElement.getNotificationsData]);
|
|
1061
|
+
return data;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1031
1064
|
var sessionId = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
|
|
1032
1065
|
var getSessionId = function () {
|
|
1033
1066
|
return sessionId;
|
|
@@ -1115,7 +1148,7 @@ exports.VeltCommentsSidebar = SnippylyCommentsSidebar;
|
|
|
1115
1148
|
exports.VeltCursor = SnippylyCursor;
|
|
1116
1149
|
exports.VeltHuddle = SnippylyHuddle;
|
|
1117
1150
|
exports.VeltHuddleTool = SnippylyHuddleTool;
|
|
1118
|
-
exports.
|
|
1151
|
+
exports.VeltNotificationsHistoryPanel = VeltNotificationsHistoryPanel;
|
|
1119
1152
|
exports.VeltNotificationsPanel = VeltNotificationsPanel;
|
|
1120
1153
|
exports.VeltNotificationsTool = VeltNotificationsTool;
|
|
1121
1154
|
exports.VeltPresence = SnippylyPresence;
|
|
@@ -1151,6 +1184,8 @@ exports.useLiveSelectionUtils = useLiveSelectionUtils;
|
|
|
1151
1184
|
exports.useLiveState = useLiveState;
|
|
1152
1185
|
exports.useLiveStateData = useLiveStateData;
|
|
1153
1186
|
exports.useLiveStateSyncUtils = useLiveStateSyncUtils;
|
|
1187
|
+
exports.useNotificationUtils = useNotificationUtils;
|
|
1188
|
+
exports.useNotificationsData = useNotificationsData;
|
|
1154
1189
|
exports.usePresenceUsers = usePresenceUsers;
|
|
1155
1190
|
exports.usePresenceUtils = usePresenceUtils;
|
|
1156
1191
|
exports.useRecorderAddHandler = useRecorderAddHandler;
|