@veltdev/react 4.6.6-beta.1 → 4.6.7-beta.1

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.
Files changed (34) hide show
  1. package/cjs/index.js +46 -6
  2. package/cjs/index.js.map +1 -1
  3. package/cjs/types/components/SnippylyCommentBubble/SnippylyCommentBubble.d.ts +1 -0
  4. package/cjs/types/components/SnippylySidebarButton/SnippylySidebarButton.d.ts +1 -0
  5. package/cjs/types/components/VeltCommentBubble/VeltCommentBubbleUnreadIcon/VeltCommentBubbleUnreadIcon.d.ts +6 -0
  6. package/cjs/types/components/VeltCommentBubble/VeltCommentBubbleUnreadIcon/index.d.ts +1 -0
  7. package/cjs/types/components/VeltCommentBubble/VeltCommentBubbleWireframe.d.ts +2 -0
  8. package/cjs/types/components/VeltCommentsSidebarButtonWireframe/VeltCommentsSidebarButtonUnreadIcon/VeltCommentsSidebarButtonUnreadIcon.d.ts +6 -0
  9. package/cjs/types/components/VeltCommentsSidebarButtonWireframe/VeltCommentsSidebarButtonUnreadIcon/index.d.ts +1 -0
  10. package/cjs/types/components/VeltCommentsSidebarButtonWireframe/VeltCommentsSidebarButtonWireframe.d.ts +2 -0
  11. package/cjs/types/components/VeltSidebarButtonWireframe/VeltSidebarButtonUnreadIcon/VeltSidebarButtonUnreadIcon.d.ts +6 -0
  12. package/cjs/types/components/VeltSidebarButtonWireframe/VeltSidebarButtonUnreadIcon/index.d.ts +1 -0
  13. package/cjs/types/components/VeltSidebarButtonWireframe/VeltSidebarButtonWireframe.d.ts +2 -0
  14. package/cjs/types/constants.d.ts +1 -1
  15. package/cjs/types/hooks/Client.d.ts +2 -1
  16. package/cjs/types/hooks/index.d.ts +1 -1
  17. package/esm/index.js +46 -7
  18. package/esm/index.js.map +1 -1
  19. package/esm/types/components/SnippylyCommentBubble/SnippylyCommentBubble.d.ts +1 -0
  20. package/esm/types/components/SnippylySidebarButton/SnippylySidebarButton.d.ts +1 -0
  21. package/esm/types/components/VeltCommentBubble/VeltCommentBubbleUnreadIcon/VeltCommentBubbleUnreadIcon.d.ts +6 -0
  22. package/esm/types/components/VeltCommentBubble/VeltCommentBubbleUnreadIcon/index.d.ts +1 -0
  23. package/esm/types/components/VeltCommentBubble/VeltCommentBubbleWireframe.d.ts +2 -0
  24. package/esm/types/components/VeltCommentsSidebarButtonWireframe/VeltCommentsSidebarButtonUnreadIcon/VeltCommentsSidebarButtonUnreadIcon.d.ts +6 -0
  25. package/esm/types/components/VeltCommentsSidebarButtonWireframe/VeltCommentsSidebarButtonUnreadIcon/index.d.ts +1 -0
  26. package/esm/types/components/VeltCommentsSidebarButtonWireframe/VeltCommentsSidebarButtonWireframe.d.ts +2 -0
  27. package/esm/types/components/VeltSidebarButtonWireframe/VeltSidebarButtonUnreadIcon/VeltSidebarButtonUnreadIcon.d.ts +6 -0
  28. package/esm/types/components/VeltSidebarButtonWireframe/VeltSidebarButtonUnreadIcon/index.d.ts +1 -0
  29. package/esm/types/components/VeltSidebarButtonWireframe/VeltSidebarButtonWireframe.d.ts +2 -0
  30. package/esm/types/constants.d.ts +1 -1
  31. package/esm/types/hooks/Client.d.ts +2 -1
  32. package/esm/types/hooks/index.d.ts +1 -1
  33. package/index.d.ts +13 -2
  34. package/package.json +1 -1
package/cjs/index.js CHANGED
@@ -145,13 +145,13 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain, integ
145
145
  }
146
146
  };
147
147
 
148
- var VELT_SDK_VERSION = '4.6.6-beta.1';
148
+ var VELT_SDK_VERSION = '4.6.7-beta.1';
149
149
  var VELT_SDK_INIT_EVENT = 'onVeltInit';
150
150
  var VELT_TAB_ID = 'veltTabId';
151
151
  // integrity map for the Velt SDK
152
152
  // Note: generate integrity hashes with: https://www.srihash.org/
153
153
  var INTEGRITY_MAP = {
154
- '4.6.6-beta.1': 'sha384-NI8wMCE1+kHbHcBudzIDxWHljA/Gl1+np16v6fEwjU1iwmgqELj2Jpzyn19O6peM',
154
+ '4.6.7-beta.1': 'sha384-2SAH5flmczIVYXtRDgIpTuJje1yHUcqAa85clH0l6/hin1JLZ/d51ydhsYIN6O2V',
155
155
  };
156
156
 
157
157
  var validProps = ['veltIf', 'veltClass', 'className', 'variant'];
@@ -389,8 +389,8 @@ var SnippylyProvider = function (props) {
389
389
  };
390
390
 
391
391
  var SnippylyCommentBubble = function (props) {
392
- var targetCommentElementId = props.targetCommentElementId, targetElementId = props.targetElementId, avatar = props.avatar, showAvatar = props.showAvatar, commentBubbleTargetPinHover = props.commentBubbleTargetPinHover, children = props.children, shadowDom = props.shadowDom, variant = props.variant, darkMode = props.darkMode, commentCountType = props.commentCountType, context = props.context, contextOptions = props.contextOptions, annotationId = props.annotationId, documentId = props.documentId, folderId = props.folderId, locationId = props.locationId, readOnly = props.readOnly;
393
- return (React__default["default"].createElement("velt-comment-bubble", { "annotation-id": annotationId, "comment-count-type": commentCountType, "target-comment-element-id": targetCommentElementId, "target-element-id": targetElementId, context: JSON.stringify(context), "context-options": JSON.stringify(contextOptions), "location-id": locationId, "document-id": documentId, "folder-id": folderId, "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, "read-only": [true, false].includes(readOnly) ? (readOnly ? 'true' : 'false') : undefined, variant: variant }, children));
392
+ var targetCommentElementId = props.targetCommentElementId, targetElementId = props.targetElementId, avatar = props.avatar, showAvatar = props.showAvatar, commentBubbleTargetPinHover = props.commentBubbleTargetPinHover, children = props.children, shadowDom = props.shadowDom, variant = props.variant, darkMode = props.darkMode, commentCountType = props.commentCountType, context = props.context, contextOptions = props.contextOptions, annotationId = props.annotationId, documentId = props.documentId, folderId = props.folderId, locationId = props.locationId, readOnly = props.readOnly, openDialog = props.openDialog;
393
+ return (React__default["default"].createElement("velt-comment-bubble", { "annotation-id": annotationId, "comment-count-type": commentCountType, "target-comment-element-id": targetCommentElementId, "target-element-id": targetElementId, context: JSON.stringify(context), "context-options": JSON.stringify(contextOptions), "location-id": locationId, "document-id": documentId, "folder-id": folderId, "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, "read-only": [true, false].includes(readOnly) ? (readOnly ? 'true' : 'false') : undefined, "open-dialog": [true, false].includes(openDialog) ? (openDialog ? 'true' : 'false') : undefined, variant: variant }, children));
394
394
  };
395
395
 
396
396
  var SnippylyComments = function (props) {
@@ -806,7 +806,7 @@ var SnippylyRecorderTool = function (props) {
806
806
  };
807
807
 
808
808
  var SnippylySidebarButton = function (props) {
809
- var tooltipText = props.tooltipText, children = props.children, darkMode = props.darkMode, shadowDom = props.shadowDom, floatingMode = props.floatingMode, pageMode = props.pageMode, sortData = props.sortData, urlNavigation = props.urlNavigation, currentLocationSuffix = props.currentLocationSuffix, filterConfig = props.filterConfig, groupConfig = props.groupConfig, filters = props.filters, excludeLocationIds = props.excludeLocationIds, dialogVariant = props.dialogVariant, pageModeComposerVariant = props.pageModeComposerVariant, sidebarShadowDom = props.sidebarShadowDom, sidebarVariant = props.sidebarVariant, position = props.position, onCommentClick = props.onCommentClick, onSidebarOpen = props.onSidebarOpen, filterPanelLayout = props.filterPanelLayout, sidebarButtonCountType = props.sidebarButtonCountType, filterGhostCommentsInSidebar = props.filterGhostCommentsInSidebar;
809
+ var tooltipText = props.tooltipText, children = props.children, darkMode = props.darkMode, shadowDom = props.shadowDom, floatingMode = props.floatingMode, pageMode = props.pageMode, sortData = props.sortData, urlNavigation = props.urlNavigation, currentLocationSuffix = props.currentLocationSuffix, filterConfig = props.filterConfig, groupConfig = props.groupConfig, filters = props.filters, excludeLocationIds = props.excludeLocationIds, dialogVariant = props.dialogVariant, pageModeComposerVariant = props.pageModeComposerVariant, sidebarShadowDom = props.sidebarShadowDom, sidebarVariant = props.sidebarVariant, position = props.position, onCommentClick = props.onCommentClick, onSidebarOpen = props.onSidebarOpen, filterPanelLayout = props.filterPanelLayout, sidebarButtonCountType = props.sidebarButtonCountType, filterGhostCommentsInSidebar = props.filterGhostCommentsInSidebar, commentCountType = props.commentCountType;
810
810
  var ref = React.useRef();
811
811
  var onSidebarOpenRef = React.useRef(onSidebarOpen);
812
812
  var onCommentClickRef = React.useRef(onCommentClick);
@@ -842,7 +842,7 @@ var SnippylySidebarButton = function (props) {
842
842
  }
843
843
  };
844
844
  });
845
- return (React__default["default"].createElement("velt-sidebar-button", { "tooltip-text": tooltipText, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined, "floating-mode": [true, false].includes(floatingMode) ? (floatingMode ? 'true' : 'false') : undefined, ref: ref, "page-mode": [true, false].includes(pageMode) ? (pageMode ? 'true' : 'false') : undefined, "sort-data": sortData, "url-navigation": [true, false].includes(urlNavigation) ? (urlNavigation ? 'true' : 'false') : undefined, "current-location-suffix": [true, false].includes(currentLocationSuffix) ? (currentLocationSuffix ? 'true' : 'false') : undefined, "filter-config": filterConfig ? JSON.stringify(filterConfig) : undefined, "group-config": groupConfig ? JSON.stringify(groupConfig) : undefined, filters: filters ? JSON.stringify(filters) : undefined, "exclude-location-ids": excludeLocationIds ? JSON.stringify(excludeLocationIds) : undefined, "dialog-variant": dialogVariant, "page-mode-composer-variant": pageModeComposerVariant, "sidebar-shadow-dom": [true, false].includes(sidebarShadowDom) ? (sidebarShadowDom ? 'true' : 'false') : undefined, "sidebar-variant": sidebarVariant, position: position, "filter-panel-layout": filterPanelLayout, "sidebar-button-count-type": sidebarButtonCountType, "filter-ghost-comments-in-sidebar": [true, false].includes(filterGhostCommentsInSidebar) ? (filterGhostCommentsInSidebar ? 'true' : 'false') : undefined }, children));
845
+ return (React__default["default"].createElement("velt-sidebar-button", { "tooltip-text": tooltipText, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined, "floating-mode": [true, false].includes(floatingMode) ? (floatingMode ? 'true' : 'false') : undefined, ref: ref, "page-mode": [true, false].includes(pageMode) ? (pageMode ? 'true' : 'false') : undefined, "sort-data": sortData, "url-navigation": [true, false].includes(urlNavigation) ? (urlNavigation ? 'true' : 'false') : undefined, "current-location-suffix": [true, false].includes(currentLocationSuffix) ? (currentLocationSuffix ? 'true' : 'false') : undefined, "filter-config": filterConfig ? JSON.stringify(filterConfig) : undefined, "group-config": groupConfig ? JSON.stringify(groupConfig) : undefined, filters: filters ? JSON.stringify(filters) : undefined, "exclude-location-ids": excludeLocationIds ? JSON.stringify(excludeLocationIds) : undefined, "dialog-variant": dialogVariant, "page-mode-composer-variant": pageModeComposerVariant, "sidebar-shadow-dom": [true, false].includes(sidebarShadowDom) ? (sidebarShadowDom ? 'true' : 'false') : undefined, "sidebar-variant": sidebarVariant, position: position, "filter-panel-layout": filterPanelLayout, "sidebar-button-count-type": sidebarButtonCountType, "filter-ghost-comments-in-sidebar": [true, false].includes(filterGhostCommentsInSidebar) ? (filterGhostCommentsInSidebar ? 'true' : 'false') : undefined, "comment-count-type": commentCountType }, children));
846
846
  };
847
847
 
848
848
  var VeltCommentsSidebarButton = function (props) {
@@ -3375,6 +3375,12 @@ var VeltSidebarButtonIcon = function (props) {
3375
3375
  return (React__default["default"].createElement("velt-sidebar-button-icon-wireframe", __assign({}, transformedProps), children));
3376
3376
  };
3377
3377
 
3378
+ var VeltSidebarButtonUnreadIcon = function (props) {
3379
+ var children = props.children, remainingProps = __rest(props, ["children"]);
3380
+ var transformedProps = transformWireframeProps(remainingProps);
3381
+ return (React__default["default"].createElement("velt-sidebar-button-unread-icon-wireframe", __assign({}, transformedProps), children));
3382
+ };
3383
+
3378
3384
  var VeltSidebarButtonWireframe = function (props) {
3379
3385
  var children = props.children, remainingProps = __rest(props, ["children"]);
3380
3386
  var transformedProps = transformWireframeProps(remainingProps);
@@ -3382,6 +3388,7 @@ var VeltSidebarButtonWireframe = function (props) {
3382
3388
  };
3383
3389
  VeltSidebarButtonWireframe.CommentsCount = VeltSidebarButtonCommentsCount;
3384
3390
  VeltSidebarButtonWireframe.Icon = VeltSidebarButtonIcon;
3391
+ VeltSidebarButtonWireframe.UnreadIcon = VeltSidebarButtonUnreadIcon;
3385
3392
 
3386
3393
  var VeltCommentToolWireframe = function (props) {
3387
3394
  var children = props.children, remainingProps = __rest(props, ["children"]);
@@ -3540,12 +3547,19 @@ var VeltCommentBubbleCommentsCount = function (props) {
3540
3547
  return (React__default["default"].createElement("velt-comment-bubble-comments-count-wireframe", null, children));
3541
3548
  };
3542
3549
 
3550
+ var VeltCommentBubbleUnreadIcon = function (props) {
3551
+ var children = props.children, remainingProps = __rest(props, ["children"]);
3552
+ var transformedProps = transformWireframeProps(remainingProps);
3553
+ return (React__default["default"].createElement("velt-comment-bubble-unread-icon-wireframe", __assign({}, transformedProps), children));
3554
+ };
3555
+
3543
3556
  var VeltCommentBubbleWireframe = function (props) {
3544
3557
  var children = props.children, remainingProp = __rest(props, ["children"]);
3545
3558
  return (React__default["default"].createElement("velt-comment-bubble-wireframe", __assign({}, remainingProp), children));
3546
3559
  };
3547
3560
  VeltCommentBubbleWireframe.Avatar = VeltCommentBubbleAvatar;
3548
3561
  VeltCommentBubbleWireframe.CommentsCount = VeltCommentBubbleCommentsCount;
3562
+ VeltCommentBubbleWireframe.UnreadIcon = VeltCommentBubbleUnreadIcon;
3549
3563
 
3550
3564
  var VeltCommentsSidebarStatusDropdownWireframe = function (props) {
3551
3565
  var children = props.children, remainingProps = __rest(props, ["children"]);
@@ -6283,6 +6297,31 @@ function useCurrentUser() {
6283
6297
  }, [client === null || client === void 0 ? void 0 : client.getCurrentUser]);
6284
6298
  return data;
6285
6299
  }
6300
+ function useCurrentUserPermissions() {
6301
+ var client = useVeltClient().client;
6302
+ var _a = React__default["default"].useState(), data = _a[0], setData = _a[1];
6303
+ var subscriptionRef = React__default["default"].useRef();
6304
+ React__default["default"].useEffect(function () {
6305
+ if (!(client === null || client === void 0 ? void 0 : client.getCurrentUserPermissions))
6306
+ return;
6307
+ // Unsubscribe from the previous subscription if it exists
6308
+ if (subscriptionRef.current) {
6309
+ subscriptionRef.current.unsubscribe();
6310
+ }
6311
+ var subscription = client.getCurrentUserPermissions().subscribe(function (res) {
6312
+ setData(res);
6313
+ });
6314
+ // Store the new subscription
6315
+ subscriptionRef.current = subscription;
6316
+ // Cleanup function.
6317
+ return function () {
6318
+ if (subscriptionRef.current) {
6319
+ subscriptionRef.current.unsubscribe();
6320
+ }
6321
+ };
6322
+ }, [client === null || client === void 0 ? void 0 : client.getCurrentUserPermissions]);
6323
+ return data;
6324
+ }
6286
6325
 
6287
6326
  function useCommentUtils() {
6288
6327
  var _a = React__default["default"].useState(), commentElement = _a[0], setCommentElement = _a[1];
@@ -8129,6 +8168,7 @@ exports.useContactSelected = useContactSelected;
8129
8168
  exports.useContactUtils = useContactUtils;
8130
8169
  exports.useCopyLink = useCopyLink;
8131
8170
  exports.useCurrentUser = useCurrentUser;
8171
+ exports.useCurrentUserPermissions = useCurrentUserPermissions;
8132
8172
  exports.useCursorUsers = useCursorUsers;
8133
8173
  exports.useCursorUtils = useCursorUtils;
8134
8174
  exports.useDeleteAttachment = useDeleteAttachment;