@veltdev/react 3.0.66 → 3.0.68
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 +315 -1
- package/cjs/index.js.map +1 -1
- package/cjs/types/constants.d.ts +1 -1
- package/cjs/types/hooks/CommentActions.d.ts +68 -0
- package/cjs/types/hooks/index.d.ts +1 -0
- package/esm/index.js +294 -3
- package/esm/index.js.map +1 -1
- package/esm/types/constants.d.ts +1 -1
- package/esm/types/hooks/CommentActions.d.ts +68 -0
- package/esm/types/hooks/index.d.ts +1 -0
- package/index.d.ts +70 -2
- package/package.json +1 -1
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.
|
|
143
|
+
var VELT_SDK_VERSION = '3.0.68';
|
|
144
144
|
var VELT_SDK_INIT_EVENT = 'onVeltInit';
|
|
145
145
|
var VELT_TAB_ID = 'veltTabId';
|
|
146
146
|
|
|
@@ -4715,6 +4715,297 @@ function useCommentSidebarData() {
|
|
|
4715
4715
|
return data;
|
|
4716
4716
|
}
|
|
4717
4717
|
|
|
4718
|
+
function useAddCommentAnnotation() {
|
|
4719
|
+
var commentElement = useCommentUtils();
|
|
4720
|
+
return {
|
|
4721
|
+
addCommentAnnotation: function (config) {
|
|
4722
|
+
return new Promise(function (resolve, reject) {
|
|
4723
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.addCommentAnnotation))
|
|
4724
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4725
|
+
commentElement.addCommentAnnotation(config).then(resolve).catch(reject);
|
|
4726
|
+
});
|
|
4727
|
+
}
|
|
4728
|
+
};
|
|
4729
|
+
}
|
|
4730
|
+
function useApproveCommentAnnotation() {
|
|
4731
|
+
var commentElement = useCommentUtils();
|
|
4732
|
+
return {
|
|
4733
|
+
approveCommentAnnotation: function (config) {
|
|
4734
|
+
return new Promise(function (resolve, reject) {
|
|
4735
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.approveCommentAnnotation))
|
|
4736
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4737
|
+
commentElement.approveCommentAnnotation(config).then(resolve).catch(reject);
|
|
4738
|
+
});
|
|
4739
|
+
}
|
|
4740
|
+
};
|
|
4741
|
+
}
|
|
4742
|
+
function useRejectCommentAnnotation() {
|
|
4743
|
+
var commentElement = useCommentUtils();
|
|
4744
|
+
return {
|
|
4745
|
+
rejectCommentAnnotation: function (config) {
|
|
4746
|
+
return new Promise(function (resolve, reject) {
|
|
4747
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.rejectCommentAnnotation))
|
|
4748
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4749
|
+
commentElement.rejectCommentAnnotation(config).then(resolve).catch(reject);
|
|
4750
|
+
});
|
|
4751
|
+
}
|
|
4752
|
+
};
|
|
4753
|
+
}
|
|
4754
|
+
function useDeleteCommentAnnotation() {
|
|
4755
|
+
var commentElement = useCommentUtils();
|
|
4756
|
+
return {
|
|
4757
|
+
deleteCommentAnnotation: function (config) {
|
|
4758
|
+
return new Promise(function (resolve, reject) {
|
|
4759
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.deleteCommentAnnotation))
|
|
4760
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4761
|
+
commentElement.deleteCommentAnnotation(config).then(resolve).catch(reject);
|
|
4762
|
+
});
|
|
4763
|
+
}
|
|
4764
|
+
};
|
|
4765
|
+
}
|
|
4766
|
+
function useUpdatePriority() {
|
|
4767
|
+
var commentElement = useCommentUtils();
|
|
4768
|
+
return {
|
|
4769
|
+
updatePriority: function (config) {
|
|
4770
|
+
return new Promise(function (resolve, reject) {
|
|
4771
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.updatePriority))
|
|
4772
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4773
|
+
commentElement.updatePriority(config).then(resolve).catch(reject);
|
|
4774
|
+
});
|
|
4775
|
+
}
|
|
4776
|
+
};
|
|
4777
|
+
}
|
|
4778
|
+
function useUpdateStatus() {
|
|
4779
|
+
var commentElement = useCommentUtils();
|
|
4780
|
+
return {
|
|
4781
|
+
updateStatus: function (config) {
|
|
4782
|
+
return new Promise(function (resolve, reject) {
|
|
4783
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.updateStatus))
|
|
4784
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4785
|
+
commentElement.updateStatus(config).then(resolve).catch(reject);
|
|
4786
|
+
});
|
|
4787
|
+
}
|
|
4788
|
+
};
|
|
4789
|
+
}
|
|
4790
|
+
function useUpdateAccess() {
|
|
4791
|
+
var commentElement = useCommentUtils();
|
|
4792
|
+
return {
|
|
4793
|
+
updateAccess: function (config) {
|
|
4794
|
+
return new Promise(function (resolve, reject) {
|
|
4795
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.updateAccess))
|
|
4796
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4797
|
+
commentElement.updateAccess(config).then(resolve).catch(reject);
|
|
4798
|
+
});
|
|
4799
|
+
}
|
|
4800
|
+
};
|
|
4801
|
+
}
|
|
4802
|
+
function useResolveCommentAnnotation() {
|
|
4803
|
+
var commentElement = useCommentUtils();
|
|
4804
|
+
return {
|
|
4805
|
+
resolveCommentAnnotation: function (config) {
|
|
4806
|
+
return new Promise(function (resolve, reject) {
|
|
4807
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.resolveCommentAnnotation))
|
|
4808
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4809
|
+
commentElement.resolveCommentAnnotation(config).then(resolve).catch(reject);
|
|
4810
|
+
});
|
|
4811
|
+
}
|
|
4812
|
+
};
|
|
4813
|
+
}
|
|
4814
|
+
function useGetLink() {
|
|
4815
|
+
var commentElement = useCommentUtils();
|
|
4816
|
+
return {
|
|
4817
|
+
getLink: function (config) {
|
|
4818
|
+
return new Promise(function (resolve, reject) {
|
|
4819
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.getLink))
|
|
4820
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4821
|
+
commentElement.getLink(config).then(resolve).catch(reject);
|
|
4822
|
+
});
|
|
4823
|
+
}
|
|
4824
|
+
};
|
|
4825
|
+
}
|
|
4826
|
+
function useCopyLink() {
|
|
4827
|
+
var commentElement = useCommentUtils();
|
|
4828
|
+
return {
|
|
4829
|
+
copyLink: function (config) {
|
|
4830
|
+
return new Promise(function (resolve, reject) {
|
|
4831
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.copyLink))
|
|
4832
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4833
|
+
commentElement.copyLink(config).then(resolve).catch(reject);
|
|
4834
|
+
});
|
|
4835
|
+
}
|
|
4836
|
+
};
|
|
4837
|
+
}
|
|
4838
|
+
function useAddComment() {
|
|
4839
|
+
var commentElement = useCommentUtils();
|
|
4840
|
+
return {
|
|
4841
|
+
addComment: function (config) {
|
|
4842
|
+
return new Promise(function (resolve, reject) {
|
|
4843
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.addComment))
|
|
4844
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4845
|
+
commentElement.addComment(config).then(resolve).catch(reject);
|
|
4846
|
+
});
|
|
4847
|
+
}
|
|
4848
|
+
};
|
|
4849
|
+
}
|
|
4850
|
+
function useUpdateComment() {
|
|
4851
|
+
var commentElement = useCommentUtils();
|
|
4852
|
+
return {
|
|
4853
|
+
updateComment: function (config) {
|
|
4854
|
+
return new Promise(function (resolve, reject) {
|
|
4855
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.updateComment))
|
|
4856
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4857
|
+
commentElement.updateComment(config).then(resolve).catch(reject);
|
|
4858
|
+
});
|
|
4859
|
+
}
|
|
4860
|
+
};
|
|
4861
|
+
}
|
|
4862
|
+
function useDeleteComment() {
|
|
4863
|
+
var commentElement = useCommentUtils();
|
|
4864
|
+
return {
|
|
4865
|
+
deleteComment: function (config) {
|
|
4866
|
+
return new Promise(function (resolve, reject) {
|
|
4867
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.deleteComment))
|
|
4868
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4869
|
+
commentElement.deleteComment(config).then(resolve).catch(reject);
|
|
4870
|
+
});
|
|
4871
|
+
}
|
|
4872
|
+
};
|
|
4873
|
+
}
|
|
4874
|
+
function useGetComment() {
|
|
4875
|
+
var commentElement = useCommentUtils();
|
|
4876
|
+
return {
|
|
4877
|
+
getComment: function (config) {
|
|
4878
|
+
return new Promise(function (resolve, reject) {
|
|
4879
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.getComment))
|
|
4880
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4881
|
+
commentElement.getComment(config).then(resolve).catch(reject);
|
|
4882
|
+
});
|
|
4883
|
+
}
|
|
4884
|
+
};
|
|
4885
|
+
}
|
|
4886
|
+
function useAddAttachment() {
|
|
4887
|
+
var commentElement = useCommentUtils();
|
|
4888
|
+
return {
|
|
4889
|
+
addAttachment: function (config) {
|
|
4890
|
+
return new Promise(function (resolve, reject) {
|
|
4891
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.addAttachment))
|
|
4892
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4893
|
+
commentElement.addAttachment(config).then(resolve).catch(reject);
|
|
4894
|
+
});
|
|
4895
|
+
}
|
|
4896
|
+
};
|
|
4897
|
+
}
|
|
4898
|
+
function useDeleteAttachment() {
|
|
4899
|
+
var commentElement = useCommentUtils();
|
|
4900
|
+
return {
|
|
4901
|
+
deleteAttachment: function (config) {
|
|
4902
|
+
return new Promise(function (resolve, reject) {
|
|
4903
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.deleteAttachment))
|
|
4904
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4905
|
+
commentElement.deleteAttachment(config).then(resolve).catch(reject);
|
|
4906
|
+
});
|
|
4907
|
+
}
|
|
4908
|
+
};
|
|
4909
|
+
}
|
|
4910
|
+
function useGetAttachment() {
|
|
4911
|
+
var commentElement = useCommentUtils();
|
|
4912
|
+
return {
|
|
4913
|
+
getAttachment: function (config) {
|
|
4914
|
+
return new Promise(function (resolve, reject) {
|
|
4915
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.getAttachment))
|
|
4916
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4917
|
+
commentElement.getAttachment(config).then(resolve).catch(reject);
|
|
4918
|
+
});
|
|
4919
|
+
}
|
|
4920
|
+
};
|
|
4921
|
+
}
|
|
4922
|
+
function useDeleteRecording() {
|
|
4923
|
+
var commentElement = useCommentUtils();
|
|
4924
|
+
return {
|
|
4925
|
+
deleteRecording: function (config) {
|
|
4926
|
+
return new Promise(function (resolve, reject) {
|
|
4927
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.deleteRecording))
|
|
4928
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4929
|
+
commentElement.deleteRecording(config).then(resolve).catch(reject);
|
|
4930
|
+
});
|
|
4931
|
+
}
|
|
4932
|
+
};
|
|
4933
|
+
}
|
|
4934
|
+
function useGetRecording() {
|
|
4935
|
+
var commentElement = useCommentUtils();
|
|
4936
|
+
return {
|
|
4937
|
+
getRecording: function (config) {
|
|
4938
|
+
return new Promise(function (resolve, reject) {
|
|
4939
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.getRecording))
|
|
4940
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4941
|
+
commentElement.getRecording(config).then(resolve).catch(reject);
|
|
4942
|
+
});
|
|
4943
|
+
}
|
|
4944
|
+
};
|
|
4945
|
+
}
|
|
4946
|
+
function useAddReaction() {
|
|
4947
|
+
var commentElement = useCommentUtils();
|
|
4948
|
+
return {
|
|
4949
|
+
addReaction: function (config) {
|
|
4950
|
+
return new Promise(function (resolve, reject) {
|
|
4951
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.addReaction))
|
|
4952
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4953
|
+
commentElement.addReaction(config).then(resolve).catch(reject);
|
|
4954
|
+
});
|
|
4955
|
+
}
|
|
4956
|
+
};
|
|
4957
|
+
}
|
|
4958
|
+
function useDeleteReaction() {
|
|
4959
|
+
var commentElement = useCommentUtils();
|
|
4960
|
+
return {
|
|
4961
|
+
deleteReaction: function (config) {
|
|
4962
|
+
return new Promise(function (resolve, reject) {
|
|
4963
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.deleteReaction))
|
|
4964
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4965
|
+
commentElement.deleteReaction(config).then(resolve).catch(reject);
|
|
4966
|
+
});
|
|
4967
|
+
}
|
|
4968
|
+
};
|
|
4969
|
+
}
|
|
4970
|
+
function useToggleReaction() {
|
|
4971
|
+
var commentElement = useCommentUtils();
|
|
4972
|
+
return {
|
|
4973
|
+
toggleReaction: function (config) {
|
|
4974
|
+
return new Promise(function (resolve, reject) {
|
|
4975
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.toggleReaction))
|
|
4976
|
+
return reject(new Error('Velt SDK is not initialized.'));
|
|
4977
|
+
commentElement.toggleReaction(config).then(resolve).catch(reject);
|
|
4978
|
+
});
|
|
4979
|
+
}
|
|
4980
|
+
};
|
|
4981
|
+
}
|
|
4982
|
+
function useCommentActionCallback(action) {
|
|
4983
|
+
var commentElement = useCommentUtils();
|
|
4984
|
+
var _a = React.useState(null), data = _a[0], setData = _a[1];
|
|
4985
|
+
var subscriptionRef = React.useRef(null);
|
|
4986
|
+
var memoizedAction = React.useMemo(function () { return action; }, [action]);
|
|
4987
|
+
React.useEffect(function () {
|
|
4988
|
+
var _a;
|
|
4989
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.on))
|
|
4990
|
+
return;
|
|
4991
|
+
if (subscriptionRef.current) {
|
|
4992
|
+
subscriptionRef.current.unsubscribe();
|
|
4993
|
+
}
|
|
4994
|
+
var subscription = (_a = commentElement === null || commentElement === void 0 ? void 0 : commentElement.on(memoizedAction)) === null || _a === void 0 ? void 0 : _a.subscribe(function (data) {
|
|
4995
|
+
setData(data);
|
|
4996
|
+
});
|
|
4997
|
+
// Store the new subscription
|
|
4998
|
+
subscriptionRef.current = subscription;
|
|
4999
|
+
// Cleanup function
|
|
5000
|
+
return function () {
|
|
5001
|
+
if (subscriptionRef.current) {
|
|
5002
|
+
subscriptionRef.current.unsubscribe();
|
|
5003
|
+
}
|
|
5004
|
+
};
|
|
5005
|
+
}, [commentElement === null || commentElement === void 0 ? void 0 : commentElement.on, memoizedAction]);
|
|
5006
|
+
return data;
|
|
5007
|
+
}
|
|
5008
|
+
|
|
4718
5009
|
function useCursorUtils() {
|
|
4719
5010
|
var _a = React__default["default"].useState(), cursorElement = _a[0], setCursorElement = _a[1];
|
|
4720
5011
|
var client = useVeltClient().client;
|
|
@@ -5425,9 +5716,15 @@ exports.VeltViewAnalytics = VeltViewAnalytics;
|
|
|
5425
5716
|
exports.VeltWireframe = VeltWireframe;
|
|
5426
5717
|
exports.createLiveStateMiddleware = createLiveStateMiddleware;
|
|
5427
5718
|
exports.useAIRewriterUtils = useAIRewriterUtils;
|
|
5719
|
+
exports.useAddAttachment = useAddAttachment;
|
|
5720
|
+
exports.useAddComment = useAddComment;
|
|
5721
|
+
exports.useAddCommentAnnotation = useAddCommentAnnotation;
|
|
5722
|
+
exports.useAddReaction = useAddReaction;
|
|
5723
|
+
exports.useApproveCommentAnnotation = useApproveCommentAnnotation;
|
|
5428
5724
|
exports.useAutocompleteChipClick = useAutocompleteChipClick;
|
|
5429
5725
|
exports.useAutocompleteUtils = useAutocompleteUtils;
|
|
5430
5726
|
exports.useClient = useClient;
|
|
5727
|
+
exports.useCommentActionCallback = useCommentActionCallback;
|
|
5431
5728
|
exports.useCommentAddHandler = useCommentAddHandler;
|
|
5432
5729
|
exports.useCommentAnnotationById = useCommentAnnotationById;
|
|
5433
5730
|
exports.useCommentAnnotations = useCommentAnnotations;
|
|
@@ -5442,11 +5739,21 @@ exports.useCommentUpdateHandler = useCommentUpdateHandler;
|
|
|
5442
5739
|
exports.useCommentUtils = useCommentUtils;
|
|
5443
5740
|
exports.useContactSelected = useContactSelected;
|
|
5444
5741
|
exports.useContactUtils = useContactUtils;
|
|
5742
|
+
exports.useCopyLink = useCopyLink;
|
|
5445
5743
|
exports.useCursorUsers = useCursorUsers;
|
|
5446
5744
|
exports.useCursorUtils = useCursorUtils;
|
|
5745
|
+
exports.useDeleteAttachment = useDeleteAttachment;
|
|
5746
|
+
exports.useDeleteComment = useDeleteComment;
|
|
5747
|
+
exports.useDeleteCommentAnnotation = useDeleteCommentAnnotation;
|
|
5748
|
+
exports.useDeleteReaction = useDeleteReaction;
|
|
5749
|
+
exports.useDeleteRecording = useDeleteRecording;
|
|
5447
5750
|
exports.useEditor = useEditor;
|
|
5448
5751
|
exports.useEditorAccessRequestHandler = useEditorAccessRequestHandler;
|
|
5449
5752
|
exports.useEditorAccessTimer = useEditorAccessTimer;
|
|
5753
|
+
exports.useGetAttachment = useGetAttachment;
|
|
5754
|
+
exports.useGetComment = useGetComment;
|
|
5755
|
+
exports.useGetLink = useGetLink;
|
|
5756
|
+
exports.useGetRecording = useGetRecording;
|
|
5450
5757
|
exports.useHuddleUtils = useHuddleUtils;
|
|
5451
5758
|
exports.useIdentify = useIdentify;
|
|
5452
5759
|
exports.useLiveSelectionDataHandler = useLiveSelectionDataHandler;
|
|
@@ -5461,6 +5768,8 @@ exports.usePresenceUtils = usePresenceUtils;
|
|
|
5461
5768
|
exports.useRecorderAddHandler = useRecorderAddHandler;
|
|
5462
5769
|
exports.useRecorderUtils = useRecorderUtils;
|
|
5463
5770
|
exports.useRecordingDataByRecorderId = useRecordingDataByRecorderId;
|
|
5771
|
+
exports.useRejectCommentAnnotation = useRejectCommentAnnotation;
|
|
5772
|
+
exports.useResolveCommentAnnotation = useResolveCommentAnnotation;
|
|
5464
5773
|
exports.useServerConnectionStateChangeHandler = useServerConnectionStateChangeHandler;
|
|
5465
5774
|
exports.useSetDocument = useSetDocument;
|
|
5466
5775
|
exports.useSetDocumentId = useSetDocumentId;
|
|
@@ -5468,6 +5777,7 @@ exports.useSetLiveStateData = useSetLiveStateData;
|
|
|
5468
5777
|
exports.useSetLocation = useSetLocation;
|
|
5469
5778
|
exports.useTagAnnotations = useTagAnnotations;
|
|
5470
5779
|
exports.useTagUtils = useTagUtils;
|
|
5780
|
+
exports.useToggleReaction = useToggleReaction;
|
|
5471
5781
|
exports.useUniqueViewsByDate = useUniqueViewsByDate;
|
|
5472
5782
|
exports.useUniqueViewsByUser = useUniqueViewsByUser;
|
|
5473
5783
|
exports.useUnreadCommentAnnotationCountByLocationId = useUnreadCommentAnnotationCountByLocationId;
|
|
@@ -5477,6 +5787,10 @@ exports.useUnreadCommentCountByLocationId = useUnreadCommentCountByLocationId;
|
|
|
5477
5787
|
exports.useUnreadCommentCountOnCurrentDocument = useUnreadCommentCountOnCurrentDocument;
|
|
5478
5788
|
exports.useUnreadNotificationsCount = useUnreadNotificationsCount;
|
|
5479
5789
|
exports.useUnsetDocumentId = useUnsetDocumentId;
|
|
5790
|
+
exports.useUpdateAccess = useUpdateAccess;
|
|
5791
|
+
exports.useUpdateComment = useUpdateComment;
|
|
5792
|
+
exports.useUpdatePriority = useUpdatePriority;
|
|
5793
|
+
exports.useUpdateStatus = useUpdateStatus;
|
|
5480
5794
|
exports.useUserEditorState = useUserEditorState;
|
|
5481
5795
|
exports.useVeltClient = useVeltClient;
|
|
5482
5796
|
exports.useVeltInitState = useVeltInitState;
|