@veltdev/react 4.6.8 → 4.6.10

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 (32) hide show
  1. package/cjs/index.js +66 -4
  2. package/cjs/index.js.map +1 -1
  3. package/cjs/types/components/SnippylyCommentsSidebar/SnippylyCommentsSidebar.d.ts +3 -0
  4. package/cjs/types/components/VeltCommentDialogOptionsDropdownContentWireframe/VeltCommentDialogOptionsDropdownContentMarkAsReadWireframe/VeltCommentDialogOptionsDropdownContentMarkAsReadWireframe.d.ts +6 -0
  5. package/cjs/types/components/VeltCommentDialogOptionsDropdownContentWireframe/VeltCommentDialogOptionsDropdownContentMarkAsReadWireframe/index.d.ts +2 -0
  6. package/cjs/types/components/VeltCommentDialogOptionsDropdownContentWireframe/VeltCommentDialogOptionsDropdownContentWireframe.d.ts +2 -0
  7. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarMinimalFilterDropdown/VeltCommentsSidebarMinimalFilterDropdownContent/VeltCommentsSidebarMinimalFilterDropdownContent.d.ts +4 -0
  8. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarMinimalFilterDropdown/VeltCommentsSidebarMinimalFilterDropdownContent/VeltCommentsSidebarMinimalFilterDropdownContentFilterOpen/VeltCommentsSidebarMinimalFilterDropdownContentFilterOpen.d.ts +8 -0
  9. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarMinimalFilterDropdown/VeltCommentsSidebarMinimalFilterDropdownContent/VeltCommentsSidebarMinimalFilterDropdownContentFilterOpen/index.d.ts +1 -0
  10. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarMinimalFilterDropdown/VeltCommentsSidebarMinimalFilterDropdownContent/VeltCommentsSidebarMinimalFilterDropdownContentFilterReset/VeltCommentsSidebarMinimalFilterDropdownContentFilterReset.d.ts +8 -0
  11. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarMinimalFilterDropdown/VeltCommentsSidebarMinimalFilterDropdownContent/VeltCommentsSidebarMinimalFilterDropdownContentFilterReset/index.d.ts +1 -0
  12. package/cjs/types/constants.d.ts +1 -1
  13. package/cjs/types/hooks/CrdtActions.d.ts +2 -0
  14. package/cjs/types/hooks/CrdtElement.d.ts +2 -0
  15. package/cjs/types/hooks/index.d.ts +2 -0
  16. package/esm/index.js +65 -5
  17. package/esm/index.js.map +1 -1
  18. package/esm/types/components/SnippylyCommentsSidebar/SnippylyCommentsSidebar.d.ts +3 -0
  19. package/esm/types/components/VeltCommentDialogOptionsDropdownContentWireframe/VeltCommentDialogOptionsDropdownContentMarkAsReadWireframe/VeltCommentDialogOptionsDropdownContentMarkAsReadWireframe.d.ts +6 -0
  20. package/esm/types/components/VeltCommentDialogOptionsDropdownContentWireframe/VeltCommentDialogOptionsDropdownContentMarkAsReadWireframe/index.d.ts +2 -0
  21. package/esm/types/components/VeltCommentDialogOptionsDropdownContentWireframe/VeltCommentDialogOptionsDropdownContentWireframe.d.ts +2 -0
  22. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarMinimalFilterDropdown/VeltCommentsSidebarMinimalFilterDropdownContent/VeltCommentsSidebarMinimalFilterDropdownContent.d.ts +4 -0
  23. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarMinimalFilterDropdown/VeltCommentsSidebarMinimalFilterDropdownContent/VeltCommentsSidebarMinimalFilterDropdownContentFilterOpen/VeltCommentsSidebarMinimalFilterDropdownContentFilterOpen.d.ts +8 -0
  24. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarMinimalFilterDropdown/VeltCommentsSidebarMinimalFilterDropdownContent/VeltCommentsSidebarMinimalFilterDropdownContentFilterOpen/index.d.ts +1 -0
  25. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarMinimalFilterDropdown/VeltCommentsSidebarMinimalFilterDropdownContent/VeltCommentsSidebarMinimalFilterDropdownContentFilterReset/VeltCommentsSidebarMinimalFilterDropdownContentFilterReset.d.ts +8 -0
  26. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarMinimalFilterDropdown/VeltCommentsSidebarMinimalFilterDropdownContent/VeltCommentsSidebarMinimalFilterDropdownContentFilterReset/index.d.ts +1 -0
  27. package/esm/types/constants.d.ts +1 -1
  28. package/esm/types/hooks/CrdtActions.d.ts +2 -0
  29. package/esm/types/hooks/CrdtElement.d.ts +2 -0
  30. package/esm/types/hooks/index.d.ts +2 -0
  31. package/index.d.ts +25 -2
  32. 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.8';
148
+ var VELT_SDK_VERSION = '4.6.10';
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.8': 'sha384-wkAFXOQHMr4n4x9qQY/F9pqgA2wWVXxBLWqf/upyYkBe8Pcz+I4wMS4VbZGBRJCb',
154
+ '4.6.10': 'sha384-2OwSjccVDnJkLSKYOVgo0X8koTm/k5Cq7b2aRAihFBGCIDZOJEyvEiYFPhYkODdY',
155
155
  };
156
156
 
157
157
  var validProps = ['veltIf', 'veltClass', 'className', 'variant'];
@@ -523,7 +523,7 @@ var SnippylyComments = function (props) {
523
523
  };
524
524
 
525
525
  var SnippylyCommentsSidebar = function (props) {
526
- var embedMode = props.embedMode, floatingMode = props.floatingMode, enableUrlNavigation = props.enableUrlNavigation, urlNavigation = props.urlNavigation, queryParamsComments = props.queryParamsComments, pageMode = props.pageMode, currentLocationSuffix = props.currentLocationSuffix, sortData = props.sortData, filterConfig = props.filterConfig, groupConfig = props.groupConfig, filters = props.filters, excludeLocationIds = props.excludeLocationIds, variant = props.variant, pageModeComposerVariant = props.pageModeComposerVariant, dialogVariant = props.dialogVariant, shadowDom = props.shadowDom, searchPlaceholder = props.searchPlaceholder, openSidebar = props.openSidebar, onSidebarOpen = props.onSidebarOpen, onSidebarCommentClick = props.onSidebarCommentClick, onCommentClick = props.onCommentClick, onSidebarClose = props.onSidebarClose, darkMode = props.darkMode, position = props.position, filterPanelLayout = props.filterPanelLayout, customActions = props.customActions, focusedThreadDialogVariant = props.focusedThreadDialogVariant, focusedThreadMode = props.focusedThreadMode, onCommentNavigationButtonClick = props.onCommentNavigationButtonClick, filterOptionLayout = props.filterOptionLayout, filterCount = props.filterCount, fullExpanded = props.fullExpanded, systemFiltersOperator = props.systemFiltersOperator, sidebarButtonCountType = props.sidebarButtonCountType, filterGhostCommentsInSidebar = props.filterGhostCommentsInSidebar, fullScreen = props.fullScreen, readOnly = props.readOnly, dialogSelection = props.dialogSelection, expandOnSelection = props.expandOnSelection;
526
+ var embedMode = props.embedMode, floatingMode = props.floatingMode, enableUrlNavigation = props.enableUrlNavigation, urlNavigation = props.urlNavigation, queryParamsComments = props.queryParamsComments, pageMode = props.pageMode, currentLocationSuffix = props.currentLocationSuffix, sortData = props.sortData, filterConfig = props.filterConfig, groupConfig = props.groupConfig, filters = props.filters, excludeLocationIds = props.excludeLocationIds, variant = props.variant, pageModeComposerVariant = props.pageModeComposerVariant, dialogVariant = props.dialogVariant, shadowDom = props.shadowDom, searchPlaceholder = props.searchPlaceholder, openSidebar = props.openSidebar, onSidebarOpen = props.onSidebarOpen, onSidebarCommentClick = props.onSidebarCommentClick, onCommentClick = props.onCommentClick, onSidebarClose = props.onSidebarClose, darkMode = props.darkMode, position = props.position, filterPanelLayout = props.filterPanelLayout, customActions = props.customActions, focusedThreadDialogVariant = props.focusedThreadDialogVariant, focusedThreadMode = props.focusedThreadMode, onCommentNavigationButtonClick = props.onCommentNavigationButtonClick, filterOptionLayout = props.filterOptionLayout, filterCount = props.filterCount, fullExpanded = props.fullExpanded, systemFiltersOperator = props.systemFiltersOperator, sidebarButtonCountType = props.sidebarButtonCountType, filterGhostCommentsInSidebar = props.filterGhostCommentsInSidebar, fullScreen = props.fullScreen, readOnly = props.readOnly, dialogSelection = props.dialogSelection, expandOnSelection = props.expandOnSelection, context = props.context;
527
527
  var ref = React.useRef();
528
528
  var openSidebarRef = React.useRef(openSidebar);
529
529
  var onSidebarOpenRef = React.useRef(onSidebarOpen);
@@ -596,7 +596,7 @@ var SnippylyCommentsSidebar = function (props) {
596
596
  }
597
597
  };
598
598
  }, []);
599
- return (React__default["default"].createElement("velt-comments-sidebar", { ref: ref, position: position, "filter-panel-layout": filterPanelLayout, "focused-thread-mode": [true, false].includes(focusedThreadMode) ? (focusedThreadMode ? 'true' : 'false') : undefined, "focused-thread-dialog-variant": focusedThreadDialogVariant, "custom-actions": [true, false].includes(customActions) ? (customActions ? 'true' : 'false') : undefined, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined, "embed-mode": [true, false].includes(embedMode) ? (embedMode ? 'true' : 'false') : undefined, "enable-url-navigation": [true, false].includes(enableUrlNavigation) ? (enableUrlNavigation ? 'true' : 'false') : undefined, "url-navigation": [true, false].includes(urlNavigation) ? (urlNavigation ? 'true' : 'false') : undefined, "query-params-comments": [true, false].includes(queryParamsComments) ? (queryParamsComments ? 'true' : 'false') : undefined, "page-mode": [true, false].includes(pageMode) ? (pageMode ? '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, variant: variant, "page-mode-composer-variant": pageModeComposerVariant, "dialog-variant": dialogVariant, "sort-data": sortData, "search-placeholder": searchPlaceholder, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined, "floating-mode": [true, false].includes(floatingMode) ? (floatingMode ? 'true' : 'false') : undefined, "filter-option-layout": filterOptionLayout, "filter-count": [true, false].includes(filterCount) ? (filterCount ? 'true' : 'false') : undefined, "full-expanded": [true, false].includes(fullExpanded) ? (fullExpanded ? 'true' : 'false') : undefined, "system-filters-operator": systemFiltersOperator, "sidebar-button-count-type": sidebarButtonCountType, "filter-ghost-comments-in-sidebar": [true, false].includes(filterGhostCommentsInSidebar) ? (filterGhostCommentsInSidebar ? 'true' : 'false') : undefined, "full-screen": [true, false].includes(fullScreen) ? (fullScreen ? 'true' : 'false') : undefined, "read-only": [true, false].includes(readOnly) ? (readOnly ? 'true' : 'false') : undefined, "dialog-selection": [true, false].includes(dialogSelection) ? (dialogSelection ? 'true' : 'false') : undefined, "expand-on-selection": [true, false].includes(expandOnSelection) ? (expandOnSelection ? 'true' : 'false') : undefined }));
599
+ return (React__default["default"].createElement("velt-comments-sidebar", { ref: ref, position: position, "filter-panel-layout": filterPanelLayout, "focused-thread-mode": [true, false].includes(focusedThreadMode) ? (focusedThreadMode ? 'true' : 'false') : undefined, "focused-thread-dialog-variant": focusedThreadDialogVariant, "custom-actions": [true, false].includes(customActions) ? (customActions ? 'true' : 'false') : undefined, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined, "embed-mode": [true, false].includes(embedMode) ? (embedMode ? 'true' : 'false') : undefined, "enable-url-navigation": [true, false].includes(enableUrlNavigation) ? (enableUrlNavigation ? 'true' : 'false') : undefined, "url-navigation": [true, false].includes(urlNavigation) ? (urlNavigation ? 'true' : 'false') : undefined, "query-params-comments": [true, false].includes(queryParamsComments) ? (queryParamsComments ? 'true' : 'false') : undefined, "page-mode": [true, false].includes(pageMode) ? (pageMode ? '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, variant: variant, "page-mode-composer-variant": pageModeComposerVariant, "dialog-variant": dialogVariant, "sort-data": sortData, "search-placeholder": searchPlaceholder, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined, "floating-mode": [true, false].includes(floatingMode) ? (floatingMode ? 'true' : 'false') : undefined, "filter-option-layout": filterOptionLayout, "filter-count": [true, false].includes(filterCount) ? (filterCount ? 'true' : 'false') : undefined, "full-expanded": [true, false].includes(fullExpanded) ? (fullExpanded ? 'true' : 'false') : undefined, "system-filters-operator": systemFiltersOperator, "sidebar-button-count-type": sidebarButtonCountType, "filter-ghost-comments-in-sidebar": [true, false].includes(filterGhostCommentsInSidebar) ? (filterGhostCommentsInSidebar ? 'true' : 'false') : undefined, "full-screen": [true, false].includes(fullScreen) ? (fullScreen ? 'true' : 'false') : undefined, "read-only": [true, false].includes(readOnly) ? (readOnly ? 'true' : 'false') : undefined, "dialog-selection": [true, false].includes(dialogSelection) ? (dialogSelection ? 'true' : 'false') : undefined, "expand-on-selection": [true, false].includes(expandOnSelection) ? (expandOnSelection ? 'true' : 'false') : undefined, context: context ? JSON.stringify(context) : undefined }));
600
600
  };
601
601
 
602
602
  var SnippylyCommentTool = function (props) {
@@ -1984,6 +1984,12 @@ var VeltCommentDialogOptionsDropdownContentNotificationWireframe = function (pro
1984
1984
  VeltCommentDialogOptionsDropdownContentNotificationWireframe.Subscribe = VeltCommentDialogOptionsDropdownContentNotificationSubscribeWireframe;
1985
1985
  VeltCommentDialogOptionsDropdownContentNotificationWireframe.Unsubscribe = VeltCommentDialogOptionsDropdownContentNotificationUnsubscribeWireframe;
1986
1986
 
1987
+ var VeltCommentDialogOptionsDropdownContentMarkAsReadWireframe = function (props) {
1988
+ var children = props.children, remainingProps = __rest(props, ["children"]);
1989
+ var transformedProps = transformWireframeProps(remainingProps);
1990
+ return (React__default["default"].createElement("velt-comment-dialog-options-dropdown-content-mark-as-read-wireframe", __assign({}, transformedProps), children));
1991
+ };
1992
+
1987
1993
  var VeltCommentDialogOptionsDropdownContentWireframe = function (props) {
1988
1994
  var children = props.children, remainingProps = __rest(props, ["children"]);
1989
1995
  var transformedProps = transformWireframeProps(remainingProps);
@@ -1994,6 +2000,7 @@ VeltCommentDialogOptionsDropdownContentWireframe.MakePrivate = VeltCommentDialog
1994
2000
  VeltCommentDialogOptionsDropdownContentWireframe.Edit = VeltCommentDialogOptionsDropdownContentEditWireframe;
1995
2001
  VeltCommentDialogOptionsDropdownContentWireframe.Delete = VeltCommentDialogOptionsDropdownContentDeleteWireframe;
1996
2002
  VeltCommentDialogOptionsDropdownContentWireframe.Notification = VeltCommentDialogOptionsDropdownContentNotificationWireframe;
2003
+ VeltCommentDialogOptionsDropdownContentWireframe.MarkAsRead = VeltCommentDialogOptionsDropdownContentMarkAsReadWireframe;
1997
2004
 
1998
2005
  var VeltCommentDialogOptionsDropdownTriggerWireframe = function (props) {
1999
2006
  var children = props.children, remainingProps = __rest(props, ["children"]);
@@ -3093,6 +3100,18 @@ var VeltCommentsSidebarMinimalFilterDropdownContentFilterUnread = function (prop
3093
3100
  return (React__default["default"].createElement("velt-comments-sidebar-minimal-filter-dropdown-content-filter-unread-wireframe", __assign({}, transformedProps), children));
3094
3101
  };
3095
3102
 
3103
+ var VeltCommentsSidebarMinimalFilterDropdownContentFilterOpen = function (props) {
3104
+ var children = props.children, remainingProps = __rest(props, ["children"]);
3105
+ var transformedProps = transformWireframeProps(remainingProps);
3106
+ return (React__default["default"].createElement("velt-comments-sidebar-minimal-filter-dropdown-content-filter-open-wireframe", __assign({}, transformedProps), children));
3107
+ };
3108
+
3109
+ var VeltCommentsSidebarMinimalFilterDropdownContentFilterReset = function (props) {
3110
+ var children = props.children, remainingProps = __rest(props, ["children"]);
3111
+ var transformedProps = transformWireframeProps(remainingProps);
3112
+ return (React__default["default"].createElement("velt-comments-sidebar-minimal-filter-dropdown-content-filter-reset-wireframe", __assign({}, transformedProps), children));
3113
+ };
3114
+
3096
3115
  var VeltCommentsSidebarMinimalFilterDropdownContentSelectedIcon = function (props) {
3097
3116
  var children = props.children, remainingProps = __rest(props, ["children"]);
3098
3117
  var transformedProps = transformWireframeProps(remainingProps);
@@ -3120,6 +3139,8 @@ VeltCommentsSidebarMinimalFilterDropdownContent.FilterAll = VeltCommentsSidebarM
3120
3139
  VeltCommentsSidebarMinimalFilterDropdownContent.FilterUnread = VeltCommentsSidebarMinimalFilterDropdownContentFilterUnread;
3121
3140
  VeltCommentsSidebarMinimalFilterDropdownContent.FilterRead = VeltCommentsSidebarMinimalFilterDropdownContentFilterRead;
3122
3141
  VeltCommentsSidebarMinimalFilterDropdownContent.FilterResolved = VeltCommentsSidebarMinimalFilterDropdownContentFilterResolved;
3142
+ VeltCommentsSidebarMinimalFilterDropdownContent.FilterOpen = VeltCommentsSidebarMinimalFilterDropdownContentFilterOpen;
3143
+ VeltCommentsSidebarMinimalFilterDropdownContent.FilterReset = VeltCommentsSidebarMinimalFilterDropdownContentFilterReset;
3123
3144
  VeltCommentsSidebarMinimalFilterDropdownContent.SelectedIcon = VeltCommentsSidebarMinimalFilterDropdownContentSelectedIcon;
3124
3145
  VeltCommentsSidebarMinimalFilterDropdownContent.SortDate = VeltCommentsSidebarMinimalFilterDropdownContentSortDate;
3125
3146
  VeltCommentsSidebarMinimalFilterDropdownContent.SortUnread = VeltCommentsSidebarMinimalFilterDropdownContentSortUnread;
@@ -7906,6 +7927,45 @@ function useContactList() {
7906
7927
  return data;
7907
7928
  }
7908
7929
 
7930
+ function useCrdtUtils() {
7931
+ var _a = React__default["default"].useState(), crdtElement = _a[0], setCrdtElement = _a[1];
7932
+ var client = useVeltClient().client;
7933
+ React__default["default"].useEffect(function () {
7934
+ if (!client || crdtElement)
7935
+ return;
7936
+ var loadedCrdtElement = client.getCrdtElement();
7937
+ setCrdtElement(loadedCrdtElement);
7938
+ }, [client, setCrdtElement, crdtElement]);
7939
+ return crdtElement;
7940
+ }
7941
+
7942
+ function useCrdtEventCallback(action) {
7943
+ var crdtElement = useCrdtUtils();
7944
+ var _a = React.useState(null), data = _a[0], setData = _a[1];
7945
+ var subscriptionRef = React.useRef(null);
7946
+ var memoizedAction = React.useMemo(function () { return action; }, [action]);
7947
+ React.useEffect(function () {
7948
+ var _a;
7949
+ if (!(crdtElement === null || crdtElement === void 0 ? void 0 : crdtElement.on))
7950
+ return;
7951
+ if (subscriptionRef.current) {
7952
+ subscriptionRef.current.unsubscribe();
7953
+ }
7954
+ var subscription = (_a = crdtElement === null || crdtElement === void 0 ? void 0 : crdtElement.on(memoizedAction)) === null || _a === void 0 ? void 0 : _a.subscribe(function (data) {
7955
+ setData(data);
7956
+ });
7957
+ // Store the new subscription
7958
+ subscriptionRef.current = subscription;
7959
+ // Cleanup function
7960
+ return function () {
7961
+ if (subscriptionRef.current) {
7962
+ subscriptionRef.current.unsubscribe();
7963
+ }
7964
+ };
7965
+ }, [crdtElement === null || crdtElement === void 0 ? void 0 : crdtElement.on, memoizedAction]);
7966
+ return data;
7967
+ }
7968
+
7909
7969
  var sessionId = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
7910
7970
  var getSessionId = function () {
7911
7971
  return (sessionStorage === null || sessionStorage === void 0 ? void 0 : sessionStorage.getItem(VELT_TAB_ID)) || sessionId;
@@ -8167,6 +8227,8 @@ exports.useContactList = useContactList;
8167
8227
  exports.useContactSelected = useContactSelected;
8168
8228
  exports.useContactUtils = useContactUtils;
8169
8229
  exports.useCopyLink = useCopyLink;
8230
+ exports.useCrdtEventCallback = useCrdtEventCallback;
8231
+ exports.useCrdtUtils = useCrdtUtils;
8170
8232
  exports.useCurrentUser = useCurrentUser;
8171
8233
  exports.useCurrentUserPermissions = useCurrentUserPermissions;
8172
8234
  exports.useCursorUsers = useCursorUsers;