@veltdev/react 4.0.0-beta.2 → 4.0.0-beta.4

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 = '4.0.0-beta.2';
143
+ var VELT_SDK_VERSION = '4.0.0-beta.4';
144
144
  var VELT_SDK_INIT_EVENT = 'onVeltInit';
145
145
  var VELT_TAB_ID = 'veltTabId';
146
146
 
@@ -2394,6 +2394,13 @@ var VeltCommentsSidebarFilterVersions = function (props) {
2394
2394
  VeltCommentsSidebarFilterVersions.Name = VeltCommentsSidebarFilterName;
2395
2395
  VeltCommentsSidebarFilterVersions.Item = VeltCommentsSidebarFilterItem;
2396
2396
 
2397
+ var VeltCommentsSidebarFilterStatus = function (props) {
2398
+ var children = props.children, remainingProps = __rest(props, ["children"]);
2399
+ return (React__default["default"].createElement("velt-comments-sidebar-filter-status-wireframe", __assign({}, remainingProps), children));
2400
+ };
2401
+ VeltCommentsSidebarFilterStatus.Name = VeltCommentsSidebarFilterName;
2402
+ VeltCommentsSidebarFilterStatus.Item = VeltCommentsSidebarFilterItem;
2403
+
2397
2404
  var VeltCommentsSidebarFilter = function (props) {
2398
2405
  var children = props.children, remainingProps = __rest(props, ["children"]);
2399
2406
  return (React__default["default"].createElement("velt-comments-sidebar-filter-wireframe", __assign({}, remainingProps), children));
@@ -2409,6 +2416,7 @@ VeltCommentsSidebarFilter.Priority = VeltCommentsSidebarFilterPriority;
2409
2416
  VeltCommentsSidebarFilter.Title = VeltCommentsSidebarFilterTitle;
2410
2417
  VeltCommentsSidebarFilter.Versions = VeltCommentsSidebarFilterVersions;
2411
2418
  VeltCommentsSidebarFilter.Item = VeltCommentsSidebarFilterItem;
2419
+ VeltCommentsSidebarFilter.Status = VeltCommentsSidebarFilterStatus;
2412
2420
 
2413
2421
  var VeltCommentsSidebarFilterButton = function (props) {
2414
2422
  var children = props.children, remainingProps = __rest(props, ["children"]);
@@ -4767,11 +4775,11 @@ function useCommentSidebarData() {
4767
4775
  function useAddCommentAnnotation() {
4768
4776
  var commentElement = useCommentUtils();
4769
4777
  return {
4770
- addCommentAnnotation: function (config) {
4778
+ addCommentAnnotation: function (request) {
4771
4779
  return new Promise(function (resolve, reject) {
4772
4780
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.addCommentAnnotation))
4773
4781
  return reject(new Error('Velt SDK is not initialized.'));
4774
- commentElement.addCommentAnnotation(config).then(resolve).catch(reject);
4782
+ commentElement.addCommentAnnotation(request).then(resolve).catch(reject);
4775
4783
  });
4776
4784
  }
4777
4785
  };
@@ -4779,11 +4787,11 @@ function useAddCommentAnnotation() {
4779
4787
  function useApproveCommentAnnotation() {
4780
4788
  var commentElement = useCommentUtils();
4781
4789
  return {
4782
- approveCommentAnnotation: function (config) {
4790
+ approveCommentAnnotation: function (request) {
4783
4791
  return new Promise(function (resolve, reject) {
4784
4792
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.approveCommentAnnotation))
4785
4793
  return reject(new Error('Velt SDK is not initialized.'));
4786
- commentElement.approveCommentAnnotation(config).then(resolve).catch(reject);
4794
+ commentElement.approveCommentAnnotation(request).then(resolve).catch(reject);
4787
4795
  });
4788
4796
  }
4789
4797
  };
@@ -4791,11 +4799,11 @@ function useApproveCommentAnnotation() {
4791
4799
  function useRejectCommentAnnotation() {
4792
4800
  var commentElement = useCommentUtils();
4793
4801
  return {
4794
- rejectCommentAnnotation: function (config) {
4802
+ rejectCommentAnnotation: function (request) {
4795
4803
  return new Promise(function (resolve, reject) {
4796
4804
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.rejectCommentAnnotation))
4797
4805
  return reject(new Error('Velt SDK is not initialized.'));
4798
- commentElement.rejectCommentAnnotation(config).then(resolve).catch(reject);
4806
+ commentElement.rejectCommentAnnotation(request).then(resolve).catch(reject);
4799
4807
  });
4800
4808
  }
4801
4809
  };
@@ -4803,11 +4811,11 @@ function useRejectCommentAnnotation() {
4803
4811
  function useSubscribeCommentAnnotation() {
4804
4812
  var commentElement = useCommentUtils();
4805
4813
  return {
4806
- subscribeCommentAnnotation: function (config) {
4814
+ subscribeCommentAnnotation: function (request) {
4807
4815
  return new Promise(function (resolve, reject) {
4808
4816
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.subscribeCommentAnnotation))
4809
4817
  return reject(new Error('Velt SDK is not initialized.'));
4810
- commentElement.subscribeCommentAnnotation(config).then(resolve).catch(reject);
4818
+ commentElement.subscribeCommentAnnotation(request).then(resolve).catch(reject);
4811
4819
  });
4812
4820
  }
4813
4821
  };
@@ -4815,11 +4823,11 @@ function useSubscribeCommentAnnotation() {
4815
4823
  function useUnsubscribeCommentAnnotation() {
4816
4824
  var commentElement = useCommentUtils();
4817
4825
  return {
4818
- unsubscribeCommentAnnotation: function (config) {
4826
+ unsubscribeCommentAnnotation: function (request) {
4819
4827
  return new Promise(function (resolve, reject) {
4820
4828
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.unsubscribeCommentAnnotation))
4821
4829
  return reject(new Error('Velt SDK is not initialized.'));
4822
- commentElement.unsubscribeCommentAnnotation(config).then(resolve).catch(reject);
4830
+ commentElement.unsubscribeCommentAnnotation(request).then(resolve).catch(reject);
4823
4831
  });
4824
4832
  }
4825
4833
  };
@@ -4827,23 +4835,23 @@ function useUnsubscribeCommentAnnotation() {
4827
4835
  function useDeleteCommentAnnotation() {
4828
4836
  var commentElement = useCommentUtils();
4829
4837
  return {
4830
- deleteCommentAnnotation: function (config) {
4838
+ deleteCommentAnnotation: function (request) {
4831
4839
  return new Promise(function (resolve, reject) {
4832
4840
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.deleteCommentAnnotation))
4833
4841
  return reject(new Error('Velt SDK is not initialized.'));
4834
- commentElement.deleteCommentAnnotation(config).then(resolve).catch(reject);
4842
+ commentElement.deleteCommentAnnotation(request).then(resolve).catch(reject);
4835
4843
  });
4836
4844
  }
4837
4845
  };
4838
4846
  }
4839
- function useGetCommentAnnotations(getCommentAnnotationsRequest) {
4847
+ function useGetCommentAnnotations(query) {
4840
4848
  var commentElement = useCommentUtils();
4841
- var _a = React.useState(null), data = _a[0], setData = _a[1];
4849
+ var _a = React.useState({ data: null }), data = _a[0], setData = _a[1];
4842
4850
  var subscriptionRef = React.useRef();
4843
4851
  // Memoize the inputs
4844
4852
  var memoizedData = React.useMemo(function () {
4845
- return getCommentAnnotationsRequest;
4846
- }, [JSON.stringify(getCommentAnnotationsRequest)]);
4853
+ return query;
4854
+ }, [JSON.stringify(query)]);
4847
4855
  React.useEffect(function () {
4848
4856
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.getCommentAnnotations))
4849
4857
  return;
@@ -4853,7 +4861,12 @@ function useGetCommentAnnotations(getCommentAnnotationsRequest) {
4853
4861
  }
4854
4862
  var subscription = commentElement.getCommentAnnotations(memoizedData)
4855
4863
  .subscribe(function (res) {
4856
- setData(res);
4864
+ if (res) {
4865
+ setData(res);
4866
+ }
4867
+ else {
4868
+ setData({ data: null });
4869
+ }
4857
4870
  });
4858
4871
  // Store the new subscription
4859
4872
  subscriptionRef.current = subscription;
@@ -4866,14 +4879,14 @@ function useGetCommentAnnotations(getCommentAnnotationsRequest) {
4866
4879
  }, [commentElement === null || commentElement === void 0 ? void 0 : commentElement.getCommentAnnotations, memoizedData]);
4867
4880
  return data;
4868
4881
  }
4869
- function useCommentAnnotationsCount(getCommentAnnotationsCountRequest) {
4882
+ function useCommentAnnotationsCount(query) {
4870
4883
  var commentElement = useCommentUtils();
4871
- var _a = React.useState(null), data = _a[0], setData = _a[1];
4884
+ var _a = React.useState({ data: null }), data = _a[0], setData = _a[1];
4872
4885
  var subscriptionRef = React.useRef();
4873
4886
  // Memoize the inputs
4874
4887
  var memoizedData = React.useMemo(function () {
4875
- return getCommentAnnotationsCountRequest;
4876
- }, [JSON.stringify(getCommentAnnotationsCountRequest)]);
4888
+ return query;
4889
+ }, [JSON.stringify(query)]);
4877
4890
  React.useEffect(function () {
4878
4891
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.getCommentAnnotationsCount))
4879
4892
  return;
@@ -4883,7 +4896,12 @@ function useCommentAnnotationsCount(getCommentAnnotationsCountRequest) {
4883
4896
  }
4884
4897
  var subscription = commentElement.getCommentAnnotationsCount(memoizedData)
4885
4898
  .subscribe(function (res) {
4886
- setData(res);
4899
+ if (res) {
4900
+ setData(res);
4901
+ }
4902
+ else {
4903
+ setData({ data: null });
4904
+ }
4887
4905
  });
4888
4906
  // Store the new subscription
4889
4907
  subscriptionRef.current = subscription;
@@ -4899,11 +4917,11 @@ function useCommentAnnotationsCount(getCommentAnnotationsCountRequest) {
4899
4917
  function useAssignUser() {
4900
4918
  var commentElement = useCommentUtils();
4901
4919
  return {
4902
- assignUser: function (config) {
4920
+ assignUser: function (request) {
4903
4921
  return new Promise(function (resolve, reject) {
4904
4922
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.assignUser))
4905
4923
  return reject(new Error('Velt SDK is not initialized.'));
4906
- commentElement.assignUser(config).then(resolve).catch(reject);
4924
+ commentElement.assignUser(request).then(resolve).catch(reject);
4907
4925
  });
4908
4926
  }
4909
4927
  };
@@ -4911,11 +4929,11 @@ function useAssignUser() {
4911
4929
  function useUpdatePriority() {
4912
4930
  var commentElement = useCommentUtils();
4913
4931
  return {
4914
- updatePriority: function (config) {
4932
+ updatePriority: function (request) {
4915
4933
  return new Promise(function (resolve, reject) {
4916
4934
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.updatePriority))
4917
4935
  return reject(new Error('Velt SDK is not initialized.'));
4918
- commentElement.updatePriority(config).then(resolve).catch(reject);
4936
+ commentElement.updatePriority(request).then(resolve).catch(reject);
4919
4937
  });
4920
4938
  }
4921
4939
  };
@@ -4923,11 +4941,11 @@ function useUpdatePriority() {
4923
4941
  function useUpdateStatus() {
4924
4942
  var commentElement = useCommentUtils();
4925
4943
  return {
4926
- updateStatus: function (config) {
4944
+ updateStatus: function (request) {
4927
4945
  return new Promise(function (resolve, reject) {
4928
4946
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.updateStatus))
4929
4947
  return reject(new Error('Velt SDK is not initialized.'));
4930
- commentElement.updateStatus(config).then(resolve).catch(reject);
4948
+ commentElement.updateStatus(request).then(resolve).catch(reject);
4931
4949
  });
4932
4950
  }
4933
4951
  };
@@ -4935,11 +4953,11 @@ function useUpdateStatus() {
4935
4953
  function useUpdateAccess() {
4936
4954
  var commentElement = useCommentUtils();
4937
4955
  return {
4938
- updateAccess: function (config) {
4956
+ updateAccess: function (request) {
4939
4957
  return new Promise(function (resolve, reject) {
4940
4958
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.updateAccess))
4941
4959
  return reject(new Error('Velt SDK is not initialized.'));
4942
- commentElement.updateAccess(config).then(resolve).catch(reject);
4960
+ commentElement.updateAccess(request).then(resolve).catch(reject);
4943
4961
  });
4944
4962
  }
4945
4963
  };
@@ -4947,11 +4965,11 @@ function useUpdateAccess() {
4947
4965
  function useResolveCommentAnnotation() {
4948
4966
  var commentElement = useCommentUtils();
4949
4967
  return {
4950
- resolveCommentAnnotation: function (config) {
4968
+ resolveCommentAnnotation: function (request) {
4951
4969
  return new Promise(function (resolve, reject) {
4952
4970
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.resolveCommentAnnotation))
4953
4971
  return reject(new Error('Velt SDK is not initialized.'));
4954
- commentElement.resolveCommentAnnotation(config).then(resolve).catch(reject);
4972
+ commentElement.resolveCommentAnnotation(request).then(resolve).catch(reject);
4955
4973
  });
4956
4974
  }
4957
4975
  };
@@ -4959,11 +4977,11 @@ function useResolveCommentAnnotation() {
4959
4977
  function useGetLink() {
4960
4978
  var commentElement = useCommentUtils();
4961
4979
  return {
4962
- getLink: function (config) {
4980
+ getLink: function (request) {
4963
4981
  return new Promise(function (resolve, reject) {
4964
4982
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.getLink))
4965
4983
  return reject(new Error('Velt SDK is not initialized.'));
4966
- commentElement.getLink(config).then(resolve).catch(reject);
4984
+ commentElement.getLink(request).then(resolve).catch(reject);
4967
4985
  });
4968
4986
  }
4969
4987
  };
@@ -4971,11 +4989,11 @@ function useGetLink() {
4971
4989
  function useCopyLink() {
4972
4990
  var commentElement = useCommentUtils();
4973
4991
  return {
4974
- copyLink: function (config) {
4992
+ copyLink: function (request) {
4975
4993
  return new Promise(function (resolve, reject) {
4976
4994
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.copyLink))
4977
4995
  return reject(new Error('Velt SDK is not initialized.'));
4978
- commentElement.copyLink(config).then(resolve).catch(reject);
4996
+ commentElement.copyLink(request).then(resolve).catch(reject);
4979
4997
  });
4980
4998
  }
4981
4999
  };
@@ -4983,11 +5001,11 @@ function useCopyLink() {
4983
5001
  function useAddComment() {
4984
5002
  var commentElement = useCommentUtils();
4985
5003
  return {
4986
- addComment: function (config) {
5004
+ addComment: function (request) {
4987
5005
  return new Promise(function (resolve, reject) {
4988
5006
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.addComment))
4989
5007
  return reject(new Error('Velt SDK is not initialized.'));
4990
- commentElement.addComment(config).then(resolve).catch(reject);
5008
+ commentElement.addComment(request).then(resolve).catch(reject);
4991
5009
  });
4992
5010
  }
4993
5011
  };
@@ -4995,11 +5013,11 @@ function useAddComment() {
4995
5013
  function useUpdateComment() {
4996
5014
  var commentElement = useCommentUtils();
4997
5015
  return {
4998
- updateComment: function (config) {
5016
+ updateComment: function (request) {
4999
5017
  return new Promise(function (resolve, reject) {
5000
5018
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.updateComment))
5001
5019
  return reject(new Error('Velt SDK is not initialized.'));
5002
- commentElement.updateComment(config).then(resolve).catch(reject);
5020
+ commentElement.updateComment(request).then(resolve).catch(reject);
5003
5021
  });
5004
5022
  }
5005
5023
  };
@@ -5007,11 +5025,11 @@ function useUpdateComment() {
5007
5025
  function useDeleteComment() {
5008
5026
  var commentElement = useCommentUtils();
5009
5027
  return {
5010
- deleteComment: function (config) {
5028
+ deleteComment: function (request) {
5011
5029
  return new Promise(function (resolve, reject) {
5012
5030
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.deleteComment))
5013
5031
  return reject(new Error('Velt SDK is not initialized.'));
5014
- commentElement.deleteComment(config).then(resolve).catch(reject);
5032
+ commentElement.deleteComment(request).then(resolve).catch(reject);
5015
5033
  });
5016
5034
  }
5017
5035
  };
@@ -5019,11 +5037,11 @@ function useDeleteComment() {
5019
5037
  function useGetComment() {
5020
5038
  var commentElement = useCommentUtils();
5021
5039
  return {
5022
- getComment: function (config) {
5040
+ getComment: function (request) {
5023
5041
  return new Promise(function (resolve, reject) {
5024
5042
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.getComment))
5025
5043
  return reject(new Error('Velt SDK is not initialized.'));
5026
- commentElement.getComment(config).then(resolve).catch(reject);
5044
+ commentElement.getComment(request).then(resolve).catch(reject);
5027
5045
  });
5028
5046
  }
5029
5047
  };
@@ -5031,11 +5049,11 @@ function useGetComment() {
5031
5049
  function useAddAttachment() {
5032
5050
  var commentElement = useCommentUtils();
5033
5051
  return {
5034
- addAttachment: function (config) {
5052
+ addAttachment: function (request) {
5035
5053
  return new Promise(function (resolve, reject) {
5036
5054
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.addAttachment))
5037
5055
  return reject(new Error('Velt SDK is not initialized.'));
5038
- commentElement.addAttachment(config).then(resolve).catch(reject);
5056
+ commentElement.addAttachment(request).then(resolve).catch(reject);
5039
5057
  });
5040
5058
  }
5041
5059
  };
@@ -5043,11 +5061,11 @@ function useAddAttachment() {
5043
5061
  function useDeleteAttachment() {
5044
5062
  var commentElement = useCommentUtils();
5045
5063
  return {
5046
- deleteAttachment: function (config) {
5064
+ deleteAttachment: function (request) {
5047
5065
  return new Promise(function (resolve, reject) {
5048
5066
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.deleteAttachment))
5049
5067
  return reject(new Error('Velt SDK is not initialized.'));
5050
- commentElement.deleteAttachment(config).then(resolve).catch(reject);
5068
+ commentElement.deleteAttachment(request).then(resolve).catch(reject);
5051
5069
  });
5052
5070
  }
5053
5071
  };
@@ -5055,11 +5073,11 @@ function useDeleteAttachment() {
5055
5073
  function useGetAttachment() {
5056
5074
  var commentElement = useCommentUtils();
5057
5075
  return {
5058
- getAttachment: function (config) {
5076
+ getAttachment: function (request) {
5059
5077
  return new Promise(function (resolve, reject) {
5060
5078
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.getAttachment))
5061
5079
  return reject(new Error('Velt SDK is not initialized.'));
5062
- commentElement.getAttachment(config).then(resolve).catch(reject);
5080
+ commentElement.getAttachment(request).then(resolve).catch(reject);
5063
5081
  });
5064
5082
  }
5065
5083
  };
@@ -5067,11 +5085,11 @@ function useGetAttachment() {
5067
5085
  function useDeleteRecording() {
5068
5086
  var commentElement = useCommentUtils();
5069
5087
  return {
5070
- deleteRecording: function (config) {
5088
+ deleteRecording: function (request) {
5071
5089
  return new Promise(function (resolve, reject) {
5072
5090
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.deleteRecording))
5073
5091
  return reject(new Error('Velt SDK is not initialized.'));
5074
- commentElement.deleteRecording(config).then(resolve).catch(reject);
5092
+ commentElement.deleteRecording(request).then(resolve).catch(reject);
5075
5093
  });
5076
5094
  }
5077
5095
  };
@@ -5079,11 +5097,11 @@ function useDeleteRecording() {
5079
5097
  function useGetRecording() {
5080
5098
  var commentElement = useCommentUtils();
5081
5099
  return {
5082
- getRecording: function (config) {
5100
+ getRecording: function (request) {
5083
5101
  return new Promise(function (resolve, reject) {
5084
5102
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.getRecording))
5085
5103
  return reject(new Error('Velt SDK is not initialized.'));
5086
- commentElement.getRecording(config).then(resolve).catch(reject);
5104
+ commentElement.getRecording(request).then(resolve).catch(reject);
5087
5105
  });
5088
5106
  }
5089
5107
  };
@@ -5091,11 +5109,11 @@ function useGetRecording() {
5091
5109
  function useAddReaction() {
5092
5110
  var commentElement = useCommentUtils();
5093
5111
  return {
5094
- addReaction: function (config) {
5112
+ addReaction: function (request) {
5095
5113
  return new Promise(function (resolve, reject) {
5096
5114
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.addReaction))
5097
5115
  return reject(new Error('Velt SDK is not initialized.'));
5098
- commentElement.addReaction(config).then(resolve).catch(reject);
5116
+ commentElement.addReaction(request).then(resolve).catch(reject);
5099
5117
  });
5100
5118
  }
5101
5119
  };
@@ -5103,11 +5121,11 @@ function useAddReaction() {
5103
5121
  function useDeleteReaction() {
5104
5122
  var commentElement = useCommentUtils();
5105
5123
  return {
5106
- deleteReaction: function (config) {
5124
+ deleteReaction: function (request) {
5107
5125
  return new Promise(function (resolve, reject) {
5108
5126
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.deleteReaction))
5109
5127
  return reject(new Error('Velt SDK is not initialized.'));
5110
- commentElement.deleteReaction(config).then(resolve).catch(reject);
5128
+ commentElement.deleteReaction(request).then(resolve).catch(reject);
5111
5129
  });
5112
5130
  }
5113
5131
  };
@@ -5115,11 +5133,11 @@ function useDeleteReaction() {
5115
5133
  function useToggleReaction() {
5116
5134
  var commentElement = useCommentUtils();
5117
5135
  return {
5118
- toggleReaction: function (config) {
5136
+ toggleReaction: function (request) {
5119
5137
  return new Promise(function (resolve, reject) {
5120
5138
  if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.toggleReaction))
5121
5139
  return reject(new Error('Velt SDK is not initialized.'));
5122
- commentElement.toggleReaction(config).then(resolve).catch(reject);
5140
+ commentElement.toggleReaction(request).then(resolve).catch(reject);
5123
5141
  });
5124
5142
  }
5125
5143
  };