@veltdev/react 3.0.29 → 3.0.31

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 CHANGED
@@ -140,7 +140,7 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain) {
140
140
  }
141
141
  };
142
142
 
143
- var VELT_SDK_VERSION = '3.0.29';
143
+ var VELT_SDK_VERSION = '3.0.31';
144
144
  var VELT_SDK_INIT_EVENT = 'onVeltInit';
145
145
  var VELT_TAB_ID = 'veltTabId';
146
146
 
@@ -4045,7 +4045,7 @@ function useNotificationUtils() {
4045
4045
  }
4046
4046
  function useNotificationsData() {
4047
4047
  var notificationElement = useNotificationUtils();
4048
- var _a = React__default["default"].useState([]), data = _a[0], setData = _a[1];
4048
+ var _a = React__default["default"].useState(null), data = _a[0], setData = _a[1];
4049
4049
  React.useEffect(function () {
4050
4050
  if (!(notificationElement === null || notificationElement === void 0 ? void 0 : notificationElement.getNotificationsData))
4051
4051
  return;
@@ -4058,6 +4058,21 @@ function useNotificationsData() {
4058
4058
  }, [notificationElement === null || notificationElement === void 0 ? void 0 : notificationElement.getNotificationsData]);
4059
4059
  return data;
4060
4060
  }
4061
+ function useUnreadNotificationsCount() {
4062
+ var notificationElement = useNotificationUtils();
4063
+ var _a = React__default["default"].useState({ forYou: null, all: null }), data = _a[0], setData = _a[1];
4064
+ React.useEffect(function () {
4065
+ if (!(notificationElement === null || notificationElement === void 0 ? void 0 : notificationElement.getUnreadNotificationsCount))
4066
+ return;
4067
+ var subscription = notificationElement.getUnreadNotificationsCount().subscribe(function (res) {
4068
+ setData(res);
4069
+ });
4070
+ return function () {
4071
+ subscription.unsubscribe();
4072
+ };
4073
+ }, [notificationElement === null || notificationElement === void 0 ? void 0 : notificationElement.getUnreadNotificationsCount]);
4074
+ return data;
4075
+ }
4061
4076
 
4062
4077
  function useAutocompleteUtils() {
4063
4078
  var _a = React__default["default"].useState(), autocompleteElement = _a[0], setAutocompleteElement = _a[1];
@@ -4323,6 +4338,7 @@ exports.useUnreadCommentAnnotationCountOnCurrentDocument = useUnreadCommentAnnot
4323
4338
  exports.useUnreadCommentCountByAnnotationId = useUnreadCommentCountByAnnotationId;
4324
4339
  exports.useUnreadCommentCountByLocationId = useUnreadCommentCountByLocationId;
4325
4340
  exports.useUnreadCommentCountOnCurrentDocument = useUnreadCommentCountOnCurrentDocument;
4341
+ exports.useUnreadNotificationsCount = useUnreadNotificationsCount;
4326
4342
  exports.useUnsetDocumentId = useUnsetDocumentId;
4327
4343
  exports.useUserEditorState = useUserEditorState;
4328
4344
  exports.useVeltClient = useVeltClient;