@veltdev/react 1.0.98 → 1.0.99

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 CHANGED
@@ -109,7 +109,7 @@ var loadVelt = function (callback, version, staging, develop) {
109
109
  }
110
110
  };
111
111
 
112
- var VELT_SDK_VERSION = '1.0.111';
112
+ var VELT_SDK_VERSION = '1.0.112';
113
113
  var VELT_SDK_INIT_EVENT = 'onVeltInit';
114
114
 
115
115
  var SnippylyProvider = function (props) {
@@ -852,6 +852,24 @@ function useEditor() {
852
852
  }, [liveStateSyncElement === null || liveStateSyncElement === void 0 ? void 0 : liveStateSyncElement.getEditor]);
853
853
  return data;
854
854
  }
855
+ /**
856
+ * @beta This hook is in beta
857
+ */
858
+ function useEditorAccessTimer() {
859
+ var liveStateSyncElement = useLiveStateSyncUtils();
860
+ var _a = React__default["default"].useState({ state: 'idle' }), data = _a[0], setData = _a[1];
861
+ React.useEffect(function () {
862
+ if (!(liveStateSyncElement === null || liveStateSyncElement === void 0 ? void 0 : liveStateSyncElement.getEditorAccessTimer))
863
+ return;
864
+ var subscription = liveStateSyncElement.getEditorAccessTimer().subscribe(function (res) {
865
+ setData(res);
866
+ });
867
+ return function () {
868
+ subscription.unsubscribe();
869
+ };
870
+ }, [liveStateSyncElement === null || liveStateSyncElement === void 0 ? void 0 : liveStateSyncElement.getEditorAccessTimer]);
871
+ return data;
872
+ }
855
873
  /**
856
874
  * @beta This hook is in beta
857
875
  */
@@ -1261,6 +1279,7 @@ exports.useCursorUsers = useCursorUsers;
1261
1279
  exports.useCursorUtils = useCursorUtils;
1262
1280
  exports.useEditor = useEditor;
1263
1281
  exports.useEditorAccessRequestHandler = useEditorAccessRequestHandler;
1282
+ exports.useEditorAccessTimer = useEditorAccessTimer;
1264
1283
  exports.useHuddleUtils = useHuddleUtils;
1265
1284
  exports.useIdentify = useIdentify;
1266
1285
  exports.useLiveSelectionUtils = useLiveSelectionUtils;