@veltdev/react 4.0.0-beta.1 → 4.0.0-beta.3
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 +101 -1
- package/cjs/index.js.map +1 -1
- package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFilter/VeltCommentsSidebarFilter.d.ts +2 -0
- package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFilter/VeltCommentsSidebarFilterStatus/VeltCommentsSidebarFilterStatus.d.ts +12 -0
- package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFilter/VeltCommentsSidebarFilterStatus/index.d.ts +1 -0
- package/cjs/types/constants.d.ts +1 -1
- package/cjs/types/hooks/Client.d.ts +4 -1
- package/cjs/types/hooks/CommentActions.d.ts +3 -1
- package/cjs/types/hooks/index.d.ts +2 -2
- package/esm/index.js +99 -2
- package/esm/index.js.map +1 -1
- package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFilter/VeltCommentsSidebarFilter.d.ts +2 -0
- package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFilter/VeltCommentsSidebarFilterStatus/VeltCommentsSidebarFilterStatus.d.ts +12 -0
- package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFilter/VeltCommentsSidebarFilterStatus/index.d.ts +1 -0
- package/esm/types/constants.d.ts +1 -1
- package/esm/types/hooks/Client.d.ts +4 -1
- package/esm/types/hooks/CommentActions.d.ts +3 -1
- package/esm/types/hooks/index.d.ts +2 -2
- package/index.d.ts +16 -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 = '4.0.0-beta.
|
|
143
|
+
var VELT_SDK_VERSION = '4.0.0-beta.3';
|
|
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"]);
|
|
@@ -4384,6 +4392,25 @@ function useSetDocumentId(documentId) {
|
|
|
4384
4392
|
}
|
|
4385
4393
|
}, [client, memoizedDocumentId]);
|
|
4386
4394
|
}
|
|
4395
|
+
function useSetDocuments() {
|
|
4396
|
+
var client = useVeltClient().client;
|
|
4397
|
+
var _a = React__default["default"].useState(undefined), data = _a[0], setData = _a[1];
|
|
4398
|
+
// Memoize the setDocuments call
|
|
4399
|
+
var memoizedData = React__default["default"].useMemo(function () {
|
|
4400
|
+
return data;
|
|
4401
|
+
}, [JSON.stringify(data === null || data === void 0 ? void 0 : data.documents), JSON.stringify(data === null || data === void 0 ? void 0 : data.options)]);
|
|
4402
|
+
React__default["default"].useEffect(function () {
|
|
4403
|
+
var _a;
|
|
4404
|
+
if (client && ((_a = memoizedData === null || memoizedData === void 0 ? void 0 : memoizedData.documents) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
4405
|
+
client.setDocuments(memoizedData.documents, memoizedData.options);
|
|
4406
|
+
}
|
|
4407
|
+
}, [client === null || client === void 0 ? void 0 : client.setDocuments, memoizedData]);
|
|
4408
|
+
return {
|
|
4409
|
+
setDocuments: function (documents, options) {
|
|
4410
|
+
setData({ documents: documents, options: options });
|
|
4411
|
+
}
|
|
4412
|
+
};
|
|
4413
|
+
}
|
|
4387
4414
|
function useUnsetDocumentId() {
|
|
4388
4415
|
var client = useVeltClient().client;
|
|
4389
4416
|
React__default["default"].useEffect(function () {
|
|
@@ -4817,6 +4844,76 @@ function useDeleteCommentAnnotation() {
|
|
|
4817
4844
|
}
|
|
4818
4845
|
};
|
|
4819
4846
|
}
|
|
4847
|
+
function useGetCommentAnnotations(getCommentAnnotationsRequest) {
|
|
4848
|
+
var commentElement = useCommentUtils();
|
|
4849
|
+
var _a = React.useState({ data: null }), data = _a[0], setData = _a[1];
|
|
4850
|
+
var subscriptionRef = React.useRef();
|
|
4851
|
+
// Memoize the inputs
|
|
4852
|
+
var memoizedData = React.useMemo(function () {
|
|
4853
|
+
return getCommentAnnotationsRequest;
|
|
4854
|
+
}, [JSON.stringify(getCommentAnnotationsRequest)]);
|
|
4855
|
+
React.useEffect(function () {
|
|
4856
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.getCommentAnnotations))
|
|
4857
|
+
return;
|
|
4858
|
+
// Unsubscribe from the previous subscription if it exists
|
|
4859
|
+
if (subscriptionRef.current) {
|
|
4860
|
+
subscriptionRef.current.unsubscribe();
|
|
4861
|
+
}
|
|
4862
|
+
var subscription = commentElement.getCommentAnnotations(memoizedData)
|
|
4863
|
+
.subscribe(function (res) {
|
|
4864
|
+
if (res) {
|
|
4865
|
+
setData(res);
|
|
4866
|
+
}
|
|
4867
|
+
else {
|
|
4868
|
+
setData({ data: null });
|
|
4869
|
+
}
|
|
4870
|
+
});
|
|
4871
|
+
// Store the new subscription
|
|
4872
|
+
subscriptionRef.current = subscription;
|
|
4873
|
+
// Cleanup function
|
|
4874
|
+
return function () {
|
|
4875
|
+
if (subscriptionRef.current) {
|
|
4876
|
+
subscriptionRef.current.unsubscribe();
|
|
4877
|
+
}
|
|
4878
|
+
};
|
|
4879
|
+
}, [commentElement === null || commentElement === void 0 ? void 0 : commentElement.getCommentAnnotations, memoizedData]);
|
|
4880
|
+
return data;
|
|
4881
|
+
}
|
|
4882
|
+
function useCommentAnnotationsCount(getCommentAnnotationsCountRequest) {
|
|
4883
|
+
var commentElement = useCommentUtils();
|
|
4884
|
+
var _a = React.useState({ data: null }), data = _a[0], setData = _a[1];
|
|
4885
|
+
var subscriptionRef = React.useRef();
|
|
4886
|
+
// Memoize the inputs
|
|
4887
|
+
var memoizedData = React.useMemo(function () {
|
|
4888
|
+
return getCommentAnnotationsCountRequest;
|
|
4889
|
+
}, [JSON.stringify(getCommentAnnotationsCountRequest)]);
|
|
4890
|
+
React.useEffect(function () {
|
|
4891
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.getCommentAnnotationsCount))
|
|
4892
|
+
return;
|
|
4893
|
+
// Unsubscribe from the previous subscription if it exists
|
|
4894
|
+
if (subscriptionRef.current) {
|
|
4895
|
+
subscriptionRef.current.unsubscribe();
|
|
4896
|
+
}
|
|
4897
|
+
var subscription = commentElement.getCommentAnnotationsCount(memoizedData)
|
|
4898
|
+
.subscribe(function (res) {
|
|
4899
|
+
if (res) {
|
|
4900
|
+
setData(res);
|
|
4901
|
+
}
|
|
4902
|
+
else {
|
|
4903
|
+
setData({ data: null });
|
|
4904
|
+
}
|
|
4905
|
+
});
|
|
4906
|
+
// Store the new subscription
|
|
4907
|
+
subscriptionRef.current = subscription;
|
|
4908
|
+
// Cleanup function
|
|
4909
|
+
return function () {
|
|
4910
|
+
if (subscriptionRef.current) {
|
|
4911
|
+
subscriptionRef.current.unsubscribe();
|
|
4912
|
+
}
|
|
4913
|
+
};
|
|
4914
|
+
}, [commentElement === null || commentElement === void 0 ? void 0 : commentElement.getCommentAnnotationsCount, memoizedData]);
|
|
4915
|
+
return data;
|
|
4916
|
+
}
|
|
4820
4917
|
function useAssignUser() {
|
|
4821
4918
|
var commentElement = useCommentUtils();
|
|
4822
4919
|
return {
|
|
@@ -5852,6 +5949,7 @@ exports.useCommentActionCallback = useCommentActionCallback;
|
|
|
5852
5949
|
exports.useCommentAddHandler = useCommentAddHandler;
|
|
5853
5950
|
exports.useCommentAnnotationById = useCommentAnnotationById;
|
|
5854
5951
|
exports.useCommentAnnotations = useCommentAnnotations;
|
|
5952
|
+
exports.useCommentAnnotationsCount = useCommentAnnotationsCount;
|
|
5855
5953
|
exports.useCommentCopyLinkHandler = useCommentCopyLinkHandler;
|
|
5856
5954
|
exports.useCommentDialogSidebarClickHandler = useCommentDialogSidebarClickHandler;
|
|
5857
5955
|
exports.useCommentEventCallback = useCommentEventCallback;
|
|
@@ -5877,6 +5975,7 @@ exports.useEditorAccessRequestHandler = useEditorAccessRequestHandler;
|
|
|
5877
5975
|
exports.useEditorAccessTimer = useEditorAccessTimer;
|
|
5878
5976
|
exports.useGetAttachment = useGetAttachment;
|
|
5879
5977
|
exports.useGetComment = useGetComment;
|
|
5978
|
+
exports.useGetCommentAnnotations = useGetCommentAnnotations;
|
|
5880
5979
|
exports.useGetLink = useGetLink;
|
|
5881
5980
|
exports.useGetRecording = useGetRecording;
|
|
5882
5981
|
exports.useHuddleUtils = useHuddleUtils;
|
|
@@ -5898,6 +5997,7 @@ exports.useResolveCommentAnnotation = useResolveCommentAnnotation;
|
|
|
5898
5997
|
exports.useServerConnectionStateChangeHandler = useServerConnectionStateChangeHandler;
|
|
5899
5998
|
exports.useSetDocument = useSetDocument;
|
|
5900
5999
|
exports.useSetDocumentId = useSetDocumentId;
|
|
6000
|
+
exports.useSetDocuments = useSetDocuments;
|
|
5901
6001
|
exports.useSetLiveStateData = useSetLiveStateData;
|
|
5902
6002
|
exports.useSetLocation = useSetLocation;
|
|
5903
6003
|
exports.useSubscribeCommentAnnotation = useSubscribeCommentAnnotation;
|