@veltdev/react 1.0.150 → 1.0.152
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 +85 -5
- package/cjs/index.js.map +1 -1
- package/cjs/types/components/SnippylyCommentBubble/SnippylyCommentBubble.d.ts +1 -0
- package/cjs/types/components/VeltInlineCommentsSection/VeltInlineCommentsSection.d.ts +1 -0
- package/cjs/types/constants.d.ts +1 -1
- package/cjs/types/hooks/CommentElement.d.ts +15 -0
- package/cjs/types/hooks/index.d.ts +1 -1
- package/esm/index.js +81 -6
- package/esm/index.js.map +1 -1
- package/esm/types/components/SnippylyCommentBubble/SnippylyCommentBubble.d.ts +1 -0
- package/esm/types/components/VeltInlineCommentsSection/VeltInlineCommentsSection.d.ts +1 -0
- package/esm/types/constants.d.ts +1 -1
- package/esm/types/hooks/CommentElement.d.ts +15 -0
- package/esm/types/hooks/index.d.ts +1 -1
- package/index.d.ts +18 -1
- 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 = '1.0.
|
|
143
|
+
var VELT_SDK_VERSION = '1.0.169';
|
|
144
144
|
var VELT_SDK_INIT_EVENT = 'onVeltInit';
|
|
145
145
|
var VELT_TAB_ID = 'veltTabId';
|
|
146
146
|
|
|
@@ -229,8 +229,8 @@ var SnippylyProvider = function (props) {
|
|
|
229
229
|
};
|
|
230
230
|
|
|
231
231
|
var SnippylyCommentBubble = function (props) {
|
|
232
|
-
var targetCommentElementId = props.targetCommentElementId, avatar = props.avatar, showAvatar = props.showAvatar, commentBubbleTargetPinHover = props.commentBubbleTargetPinHover, children = props.children, shadowDom = props.shadowDom, variant = props.variant, darkMode = props.darkMode;
|
|
233
|
-
return (React__default["default"].createElement("velt-comment-bubble", { "target-comment-element-id": targetCommentElementId, "show-avatar": [true, false].includes(showAvatar) ? (showAvatar ? 'true' : 'false') : undefined, avatar: [true, false].includes(avatar) ? (avatar ? 'true' : 'false') : undefined, "comment-bubble-target-pin-hover": commentBubbleTargetPinHover ? 'true' : undefined, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined, variant: variant }, children));
|
|
232
|
+
var targetCommentElementId = props.targetCommentElementId, avatar = props.avatar, showAvatar = props.showAvatar, commentBubbleTargetPinHover = props.commentBubbleTargetPinHover, children = props.children, shadowDom = props.shadowDom, variant = props.variant, darkMode = props.darkMode, commentCountType = props.commentCountType;
|
|
233
|
+
return (React__default["default"].createElement("velt-comment-bubble", { "comment-count-type": commentCountType, "target-comment-element-id": targetCommentElementId, "show-avatar": [true, false].includes(showAvatar) ? (showAvatar ? 'true' : 'false') : undefined, avatar: [true, false].includes(avatar) ? (avatar ? 'true' : 'false') : undefined, "comment-bubble-target-pin-hover": commentBubbleTargetPinHover ? 'true' : undefined, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined, variant: variant }, children));
|
|
234
234
|
};
|
|
235
235
|
|
|
236
236
|
var SnippylyComments = function (props) {
|
|
@@ -1129,8 +1129,8 @@ var VeltAutocomplete = function (props) {
|
|
|
1129
1129
|
};
|
|
1130
1130
|
|
|
1131
1131
|
var VeltInlineCommentsSection = function (props) {
|
|
1132
|
-
var config = props.config, children = props.children, darkMode = props.darkMode, variant = props.variant, shadowDom = props.shadowDom, dialogVariant = props.dialogVariant;
|
|
1133
|
-
return (React__default["default"].createElement("velt-inline-comments-section", { config: JSON.stringify(config), variant: variant, "dialog-variant": dialogVariant, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined }, children));
|
|
1132
|
+
var config = props.config, children = props.children, darkMode = props.darkMode, variant = props.variant, shadowDom = props.shadowDom, dialogVariant = props.dialogVariant, targetInlineCommentElementId = props.targetInlineCommentElementId;
|
|
1133
|
+
return (React__default["default"].createElement("velt-inline-comments-section", { "target-inline-comment-element-id": targetInlineCommentElementId, config: JSON.stringify(config), variant: variant, "dialog-variant": dialogVariant, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined }, children));
|
|
1134
1134
|
};
|
|
1135
1135
|
|
|
1136
1136
|
var VeltWireframe = function (props) {
|
|
@@ -2422,6 +2422,81 @@ function useCommentAnnotations(documentId, location) {
|
|
|
2422
2422
|
}, [commentElement === null || commentElement === void 0 ? void 0 : commentElement.getAllCommentAnnotations]);
|
|
2423
2423
|
return data;
|
|
2424
2424
|
}
|
|
2425
|
+
function useUnreadCommentCountByAnnotationId(annotationId) {
|
|
2426
|
+
var commentElement = useCommentUtils();
|
|
2427
|
+
var _a = React__default["default"].useState({ count: 0 }), data = _a[0], setData = _a[1];
|
|
2428
|
+
React.useEffect(function () {
|
|
2429
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.getUnreadCommentCountByAnnotationId))
|
|
2430
|
+
return;
|
|
2431
|
+
var subscription = commentElement.getUnreadCommentCountByAnnotationId(annotationId).subscribe(function (res) {
|
|
2432
|
+
setData(res);
|
|
2433
|
+
});
|
|
2434
|
+
return function () {
|
|
2435
|
+
subscription.unsubscribe();
|
|
2436
|
+
};
|
|
2437
|
+
}, [commentElement === null || commentElement === void 0 ? void 0 : commentElement.getUnreadCommentCountByAnnotationId]);
|
|
2438
|
+
return data;
|
|
2439
|
+
}
|
|
2440
|
+
function useUnreadCommentAnnotationCountOnCurrentDocument() {
|
|
2441
|
+
var commentElement = useCommentUtils();
|
|
2442
|
+
var _a = React__default["default"].useState({ count: 0 }), data = _a[0], setData = _a[1];
|
|
2443
|
+
React.useEffect(function () {
|
|
2444
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.getUnreadCommentAnnotationCountOnCurrentDocument))
|
|
2445
|
+
return;
|
|
2446
|
+
var subscription = commentElement.getUnreadCommentAnnotationCountOnCurrentDocument().subscribe(function (res) {
|
|
2447
|
+
setData(res);
|
|
2448
|
+
});
|
|
2449
|
+
return function () {
|
|
2450
|
+
subscription.unsubscribe();
|
|
2451
|
+
};
|
|
2452
|
+
}, [commentElement === null || commentElement === void 0 ? void 0 : commentElement.getUnreadCommentAnnotationCountOnCurrentDocument]);
|
|
2453
|
+
return data;
|
|
2454
|
+
}
|
|
2455
|
+
function useUnreadCommentCountOnCurrentDocument() {
|
|
2456
|
+
var commentElement = useCommentUtils();
|
|
2457
|
+
var _a = React__default["default"].useState({ count: 0 }), data = _a[0], setData = _a[1];
|
|
2458
|
+
React.useEffect(function () {
|
|
2459
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.getUnreadCommentCountOnCurrentDocument))
|
|
2460
|
+
return;
|
|
2461
|
+
var subscription = commentElement.getUnreadCommentCountOnCurrentDocument().subscribe(function (res) {
|
|
2462
|
+
setData(res);
|
|
2463
|
+
});
|
|
2464
|
+
return function () {
|
|
2465
|
+
subscription.unsubscribe();
|
|
2466
|
+
};
|
|
2467
|
+
}, [commentElement === null || commentElement === void 0 ? void 0 : commentElement.getUnreadCommentCountOnCurrentDocument]);
|
|
2468
|
+
return data;
|
|
2469
|
+
}
|
|
2470
|
+
function useUnreadCommentCountByLocationId(locationId) {
|
|
2471
|
+
var commentElement = useCommentUtils();
|
|
2472
|
+
var _a = React__default["default"].useState({ count: 0 }), data = _a[0], setData = _a[1];
|
|
2473
|
+
React.useEffect(function () {
|
|
2474
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.getUnreadCommentCountByLocationId))
|
|
2475
|
+
return;
|
|
2476
|
+
var subscription = commentElement.getUnreadCommentCountByLocationId(locationId).subscribe(function (res) {
|
|
2477
|
+
setData(res);
|
|
2478
|
+
});
|
|
2479
|
+
return function () {
|
|
2480
|
+
subscription.unsubscribe();
|
|
2481
|
+
};
|
|
2482
|
+
}, [commentElement === null || commentElement === void 0 ? void 0 : commentElement.getUnreadCommentCountByLocationId]);
|
|
2483
|
+
return data;
|
|
2484
|
+
}
|
|
2485
|
+
function useUnreadCommentAnnotationCountByLocationId(locationId) {
|
|
2486
|
+
var commentElement = useCommentUtils();
|
|
2487
|
+
var _a = React__default["default"].useState({ count: 0 }), data = _a[0], setData = _a[1];
|
|
2488
|
+
React.useEffect(function () {
|
|
2489
|
+
if (!(commentElement === null || commentElement === void 0 ? void 0 : commentElement.getUnreadCommentAnnotationCountByLocationId))
|
|
2490
|
+
return;
|
|
2491
|
+
var subscription = commentElement.getUnreadCommentAnnotationCountByLocationId(locationId).subscribe(function (res) {
|
|
2492
|
+
setData(res);
|
|
2493
|
+
});
|
|
2494
|
+
return function () {
|
|
2495
|
+
subscription.unsubscribe();
|
|
2496
|
+
};
|
|
2497
|
+
}, [commentElement === null || commentElement === void 0 ? void 0 : commentElement.getUnreadCommentAnnotationCountByLocationId]);
|
|
2498
|
+
return data;
|
|
2499
|
+
}
|
|
2425
2500
|
function useCommentModeState() {
|
|
2426
2501
|
var commentElement = useCommentUtils();
|
|
2427
2502
|
var _a = React__default["default"].useState(), data = _a[0], setData = _a[1];
|
|
@@ -3101,6 +3176,11 @@ exports.useTagAnnotations = useTagAnnotations;
|
|
|
3101
3176
|
exports.useTagUtils = useTagUtils;
|
|
3102
3177
|
exports.useUniqueViewsByDate = useUniqueViewsByDate;
|
|
3103
3178
|
exports.useUniqueViewsByUser = useUniqueViewsByUser;
|
|
3179
|
+
exports.useUnreadCommentAnnotationCountByLocationId = useUnreadCommentAnnotationCountByLocationId;
|
|
3180
|
+
exports.useUnreadCommentAnnotationCountOnCurrentDocument = useUnreadCommentAnnotationCountOnCurrentDocument;
|
|
3181
|
+
exports.useUnreadCommentCountByAnnotationId = useUnreadCommentCountByAnnotationId;
|
|
3182
|
+
exports.useUnreadCommentCountByLocationId = useUnreadCommentCountByLocationId;
|
|
3183
|
+
exports.useUnreadCommentCountOnCurrentDocument = useUnreadCommentCountOnCurrentDocument;
|
|
3104
3184
|
exports.useUnsetDocumentId = useUnsetDocumentId;
|
|
3105
3185
|
exports.useUserEditorState = useUserEditorState;
|
|
3106
3186
|
exports.useVeltClient = useVeltClient;
|