@veltdev/react 4.5.0-beta.7 → 4.5.0-beta.9

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 (38) hide show
  1. package/cjs/index.js +76 -1
  2. package/cjs/index.js.map +1 -1
  3. package/cjs/types/components/SnippylyCommentsSidebar/SnippylyCommentsSidebar.d.ts +5 -0
  4. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarDocumentFilterDropdownWireframe/VeltCommentsSidebarDocumentFilterDropdownContent/VeltCommentsSidebarDocumentFilterDropdownContent.d.ts +8 -0
  5. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarDocumentFilterDropdownWireframe/VeltCommentsSidebarDocumentFilterDropdownContent/index.d.ts +1 -0
  6. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarDocumentFilterDropdownWireframe/VeltCommentsSidebarDocumentFilterDropdownTrigger/VeltCommentsSidebarDocumentFilterDropdownTrigger.d.ts +10 -0
  7. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarDocumentFilterDropdownWireframe/VeltCommentsSidebarDocumentFilterDropdownTrigger/VeltCommentsSidebarDocumentFilterDropdownTriggerLabel/VeltCommentsSidebarDocumentFilterDropdownTriggerLabel.d.ts +8 -0
  8. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarDocumentFilterDropdownWireframe/VeltCommentsSidebarDocumentFilterDropdownTrigger/VeltCommentsSidebarDocumentFilterDropdownTriggerLabel/index.d.ts +1 -0
  9. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarDocumentFilterDropdownWireframe/VeltCommentsSidebarDocumentFilterDropdownTrigger/index.d.ts +1 -0
  10. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarDocumentFilterDropdownWireframe/VeltCommentsSidebarDocumentFilterDropdownWireframe.d.ts +12 -0
  11. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarDocumentFilterDropdownWireframe/index.d.ts +1 -0
  12. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFilter/VeltCommentsSidebarFilter.d.ts +2 -0
  13. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFilter/VeltCommentsSidebarFilterDocument/VeltCommentsSidebarFilterDocument.d.ts +16 -0
  14. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFilter/VeltCommentsSidebarFilterDocument/index.d.ts +1 -0
  15. package/cjs/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarWireframe.d.ts +2 -0
  16. package/cjs/types/constants.d.ts +1 -1
  17. package/cjs/types/hooks/PresenceElement.d.ts +2 -1
  18. package/cjs/types/hooks/index.d.ts +1 -1
  19. package/esm/index.js +76 -2
  20. package/esm/index.js.map +1 -1
  21. package/esm/types/components/SnippylyCommentsSidebar/SnippylyCommentsSidebar.d.ts +5 -0
  22. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarDocumentFilterDropdownWireframe/VeltCommentsSidebarDocumentFilterDropdownContent/VeltCommentsSidebarDocumentFilterDropdownContent.d.ts +8 -0
  23. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarDocumentFilterDropdownWireframe/VeltCommentsSidebarDocumentFilterDropdownContent/index.d.ts +1 -0
  24. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarDocumentFilterDropdownWireframe/VeltCommentsSidebarDocumentFilterDropdownTrigger/VeltCommentsSidebarDocumentFilterDropdownTrigger.d.ts +10 -0
  25. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarDocumentFilterDropdownWireframe/VeltCommentsSidebarDocumentFilterDropdownTrigger/VeltCommentsSidebarDocumentFilterDropdownTriggerLabel/VeltCommentsSidebarDocumentFilterDropdownTriggerLabel.d.ts +8 -0
  26. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarDocumentFilterDropdownWireframe/VeltCommentsSidebarDocumentFilterDropdownTrigger/VeltCommentsSidebarDocumentFilterDropdownTriggerLabel/index.d.ts +1 -0
  27. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarDocumentFilterDropdownWireframe/VeltCommentsSidebarDocumentFilterDropdownTrigger/index.d.ts +1 -0
  28. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarDocumentFilterDropdownWireframe/VeltCommentsSidebarDocumentFilterDropdownWireframe.d.ts +12 -0
  29. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarDocumentFilterDropdownWireframe/index.d.ts +1 -0
  30. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFilter/VeltCommentsSidebarFilter.d.ts +2 -0
  31. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFilter/VeltCommentsSidebarFilterDocument/VeltCommentsSidebarFilterDocument.d.ts +16 -0
  32. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarFilter/VeltCommentsSidebarFilterDocument/index.d.ts +1 -0
  33. package/esm/types/components/VeltCommentsSidebarWireframe/VeltCommentsSidebarWireframe.d.ts +2 -0
  34. package/esm/types/constants.d.ts +1 -1
  35. package/esm/types/hooks/PresenceElement.d.ts +2 -1
  36. package/esm/types/hooks/index.d.ts +1 -1
  37. package/index.d.ts +42 -2
  38. 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.5.0-beta.7';
143
+ var VELT_SDK_VERSION = '4.5.0-beta.9';
144
144
  var VELT_SDK_INIT_EVENT = 'onVeltInit';
145
145
  var VELT_TAB_ID = 'veltTabId';
146
146
 
@@ -2686,6 +2686,16 @@ VeltCommentsSidebarFilterTagged.Name = VeltCommentsSidebarFilterName;
2686
2686
  VeltCommentsSidebarFilterTagged.Item = VeltCommentsSidebarFilterItem;
2687
2687
  VeltCommentsSidebarFilterTagged.Search = VeltCommentsSidebarFilterSearch;
2688
2688
 
2689
+ var VeltCommentsSidebarFilterDocument = function (props) {
2690
+ var children = props.children, remainingProps = __rest(props, ["children"]);
2691
+ var transformedProps = transformWireframeProps(remainingProps);
2692
+ return (React__default["default"].createElement("velt-comments-sidebar-filter-document-wireframe", __assign({}, transformedProps), children));
2693
+ };
2694
+ VeltCommentsSidebarFilterDocument.Name = VeltCommentsSidebarFilterName;
2695
+ VeltCommentsSidebarFilterDocument.Item = VeltCommentsSidebarFilterItem;
2696
+ VeltCommentsSidebarFilterDocument.ViewAll = VeltCommentsSidebarFilterViewAll;
2697
+ VeltCommentsSidebarFilterDocument.Search = VeltCommentsSidebarFilterSearch;
2698
+
2689
2699
  var VeltCommentsSidebarFilter = function (props) {
2690
2700
  var children = props.children, remainingProps = __rest(props, ["children"]);
2691
2701
  var transformedProps = transformWireframeProps(remainingProps);
@@ -2707,6 +2717,7 @@ VeltCommentsSidebarFilter.Item = VeltCommentsSidebarFilterItem;
2707
2717
  VeltCommentsSidebarFilter.Status = VeltCommentsSidebarFilterStatus;
2708
2718
  VeltCommentsSidebarFilter.ResetButton = VeltCommentsSidebarFilterResetButton;
2709
2719
  VeltCommentsSidebarFilter.Search = VeltCommentsSidebarFilterSearch;
2720
+ VeltCommentsSidebarFilter.Document = VeltCommentsSidebarFilterDocument;
2710
2721
 
2711
2722
  var VeltCommentsSidebarFilterButton = function (props) {
2712
2723
  var children = props.children, remainingProps = __rest(props, ["children"]);
@@ -2795,6 +2806,33 @@ var VeltCommentsSidebarLocationFilterDropdown = function (props) {
2795
2806
  VeltCommentsSidebarLocationFilterDropdown.Trigger = VeltCommentsSidebarLocationFilterDropdownTrigger;
2796
2807
  VeltCommentsSidebarLocationFilterDropdown.Content = VeltCommentsSidebarLocationFilterDropdownContent;
2797
2808
 
2809
+ var VeltCommentsSidebarDocumentFilterDropdownContent = function (props) {
2810
+ var children = props.children, remainingProps = __rest(props, ["children"]);
2811
+ var transformedProps = transformWireframeProps(remainingProps);
2812
+ return (React__default["default"].createElement("velt-comments-sidebar-document-filter-dropdown-content-wireframe", __assign({}, transformedProps), children));
2813
+ };
2814
+
2815
+ var VeltCommentsSidebarDocumentFilterDropdownTriggerLabel = function (props) {
2816
+ var children = props.children, remainingProps = __rest(props, ["children"]);
2817
+ var transformedProps = transformWireframeProps(remainingProps);
2818
+ return (React__default["default"].createElement("velt-comments-sidebar-document-filter-dropdown-trigger-label-wireframe", __assign({}, transformedProps), children));
2819
+ };
2820
+
2821
+ var VeltCommentsSidebarDocumentFilterDropdownTrigger = function (props) {
2822
+ var children = props.children, remainingProps = __rest(props, ["children"]);
2823
+ var transformedProps = transformWireframeProps(remainingProps);
2824
+ return (React__default["default"].createElement("velt-comments-sidebar-document-filter-dropdown-trigger-wireframe", __assign({}, transformedProps), children));
2825
+ };
2826
+ VeltCommentsSidebarDocumentFilterDropdownTrigger.Label = VeltCommentsSidebarDocumentFilterDropdownTriggerLabel;
2827
+
2828
+ var VeltCommentsSidebarDocumentFilterDropdownWireframe = function (props) {
2829
+ var children = props.children, remainingProps = __rest(props, ["children"]);
2830
+ var transformedProps = transformWireframeProps(remainingProps);
2831
+ return (React__default["default"].createElement("velt-comments-sidebar-document-filter-dropdown-wireframe", __assign({}, transformedProps), children));
2832
+ };
2833
+ VeltCommentsSidebarDocumentFilterDropdownWireframe.Trigger = VeltCommentsSidebarDocumentFilterDropdownTrigger;
2834
+ VeltCommentsSidebarDocumentFilterDropdownWireframe.Content = VeltCommentsSidebarDocumentFilterDropdownContent;
2835
+
2798
2836
  var VeltCommentsSidebarMinimalActionsDropdownContentMarkAllReadWireframe = function (props) {
2799
2837
  var children = props.children, remainingProps = __rest(props, ["children"]);
2800
2838
  var transformedProps = transformWireframeProps(remainingProps);
@@ -3062,6 +3100,7 @@ VeltCommentsSidebarWireframe.Skeleton = VeltCommentsSidebarSkeleton;
3062
3100
  VeltCommentsSidebarWireframe.Panel = VeltCommentsSidebarPanel;
3063
3101
  VeltCommentsSidebarWireframe.MinimalFilterDropdown = VeltCommentsSidebarMinimalFilterDropdown;
3064
3102
  VeltCommentsSidebarWireframe.LocationFilterDropdown = VeltCommentsSidebarLocationFilterDropdown;
3103
+ VeltCommentsSidebarWireframe.DocumentFilterDropdown = VeltCommentsSidebarDocumentFilterDropdownWireframe;
3065
3104
  VeltCommentsSidebarWireframe.MinimalActionsDropdown = VeltCommentsSidebarMinimalActionsDropdownWireframe;
3066
3105
  VeltCommentsSidebarWireframe.ResetFilterButton = VeltCommentsSidebarResetFilterButtonWireframe;
3067
3106
  VeltCommentsSidebarWireframe.ActionButton = VeltCommentsSidebarActionButton;
@@ -6507,6 +6546,41 @@ function usePresenceUsers() {
6507
6546
  }, [presenceElement]);
6508
6547
  return data;
6509
6548
  }
6549
+ function usePresenceData(query) {
6550
+ var presenceElement = usePresenceUtils();
6551
+ var _a = React.useState({ data: null }), data = _a[0], setData = _a[1];
6552
+ var subscriptionRef = React.useRef();
6553
+ // Memoize the inputs
6554
+ var memoizedData = React.useMemo(function () {
6555
+ return query;
6556
+ }, [JSON.stringify(query)]);
6557
+ React.useEffect(function () {
6558
+ if (!(presenceElement === null || presenceElement === void 0 ? void 0 : presenceElement.getData))
6559
+ return;
6560
+ // Unsubscribe from the previous subscription if it exists
6561
+ if (subscriptionRef.current) {
6562
+ subscriptionRef.current.unsubscribe();
6563
+ }
6564
+ var subscription = presenceElement.getData(memoizedData)
6565
+ .subscribe(function (res) {
6566
+ if (res) {
6567
+ setData(res);
6568
+ }
6569
+ else {
6570
+ setData({ data: null });
6571
+ }
6572
+ });
6573
+ // Store the new subscription
6574
+ subscriptionRef.current = subscription;
6575
+ // Cleanup function
6576
+ return function () {
6577
+ if (subscriptionRef.current) {
6578
+ subscriptionRef.current.unsubscribe();
6579
+ }
6580
+ };
6581
+ }, [presenceElement === null || presenceElement === void 0 ? void 0 : presenceElement.getData, memoizedData]);
6582
+ return data;
6583
+ }
6510
6584
 
6511
6585
  function usePresenceEventCallback(action) {
6512
6586
  var presenceElement = usePresenceUtils();
@@ -7176,6 +7250,7 @@ exports.useLiveStateSyncEventCallback = useLiveStateSyncEventCallback;
7176
7250
  exports.useLiveStateSyncUtils = useLiveStateSyncUtils;
7177
7251
  exports.useNotificationUtils = useNotificationUtils;
7178
7252
  exports.useNotificationsData = useNotificationsData;
7253
+ exports.usePresenceData = usePresenceData;
7179
7254
  exports.usePresenceEventCallback = usePresenceEventCallback;
7180
7255
  exports.usePresenceUsers = usePresenceUsers;
7181
7256
  exports.usePresenceUtils = usePresenceUtils;