@veltdev/react 4.5.0-beta.1 → 4.5.0-beta.3

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.
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  export interface IVeltPresenceProps {
3
3
  maxUsers?: number;
4
4
  inactivityTime?: number;
5
+ offlineInactivityTime?: number;
5
6
  documentParams?: any;
6
7
  location?: any;
7
8
  locationId?: string;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- export declare const VELT_SDK_VERSION = "4.5.0-beta.1";
2
+ export declare const VELT_SDK_VERSION = "4.5.0-beta.3";
3
3
  export declare const VELT_SDK_INIT_EVENT = "onVeltInit";
4
4
  export declare const VELT_TAB_ID = "veltTabId";
5
5
  export interface IVeltWireframeCommonProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
@@ -0,0 +1,2 @@
1
+ import { LiveStateEventTypesMap } from "@veltdev/types";
2
+ export declare function useLiveStateSyncEventCallback<T extends keyof LiveStateEventTypesMap>(action: T): LiveStateEventTypesMap[T];
@@ -0,0 +1,2 @@
1
+ import { PresenceEventTypesMap } from "@veltdev/types";
2
+ export declare function usePresenceEventCallback<T extends keyof PresenceEventTypesMap>(action: T): PresenceEventTypesMap[T];
@@ -5,7 +5,9 @@ export { useVeltEventCallback } from './CoreActions';
5
5
  export { useCursorUtils, useCursorUsers, } from './CursorElement';
6
6
  export { useHuddleUtils, } from './HuddleElement';
7
7
  export { useLiveStateSyncUtils, useLiveStateData, useSetLiveStateData, useUserEditorState, useEditor, useEditorAccessTimer, useEditorAccessRequestHandler, useServerConnectionStateChangeHandler, useLiveState, } from './LiveStateSyncElement';
8
+ export { useLiveStateSyncEventCallback, } from './LiveStateSyncActions';
8
9
  export { usePresenceUtils, usePresenceUsers, } from './PresenceElement';
10
+ export { usePresenceEventCallback, } from './PresenceActions';
9
11
  export { useRecorderUtils, useRecorderAddHandler, useRecordingDataByRecorderId, useRecordings, } from './RecorderElement';
10
12
  export { useRecorderEventCallback, } from './RecorderActions';
11
13
  export { useAIRewriterUtils, } from './RewriterElement';
package/esm/index.js CHANGED
@@ -132,7 +132,7 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain) {
132
132
  }
133
133
  };
134
134
 
135
- var VELT_SDK_VERSION = '4.5.0-beta.1';
135
+ var VELT_SDK_VERSION = '4.5.0-beta.3';
136
136
  var VELT_SDK_INIT_EVENT = 'onVeltInit';
137
137
  var VELT_TAB_ID = 'veltTabId';
138
138
 
@@ -523,7 +523,7 @@ var SnippylyHuddleTool = function (props) {
523
523
  };
524
524
 
525
525
  var SnippylyPresence = function (props) {
526
- var maxUsers = props.maxUsers, inactivityTime = props.inactivityTime, documentParams = props.documentParams, location = props.location, locationId = props.locationId, self = props.self, onPresenceUserClick = props.onPresenceUserClick, onUsersChanged = props.onUsersChanged, onPresenceUserChange = props.onPresenceUserChange, disableFlockNavigation = props.disableFlockNavigation, defaultFlockNavigation = props.defaultFlockNavigation, onNavigate = props.onNavigate, flockMode = props.flockMode, shadowDom = props.shadowDom;
526
+ var maxUsers = props.maxUsers, inactivityTime = props.inactivityTime, offlineInactivityTime = props.offlineInactivityTime, documentParams = props.documentParams, location = props.location, locationId = props.locationId, self = props.self, onPresenceUserClick = props.onPresenceUserClick, onUsersChanged = props.onUsersChanged, onPresenceUserChange = props.onPresenceUserChange, disableFlockNavigation = props.disableFlockNavigation, defaultFlockNavigation = props.defaultFlockNavigation, onNavigate = props.onNavigate, flockMode = props.flockMode, shadowDom = props.shadowDom;
527
527
  var ref = useRef();
528
528
  var onUsersChangedRef = useRef(onUsersChanged);
529
529
  var onPresenceUserChangeRef = useRef(onPresenceUserChange);
@@ -578,7 +578,7 @@ var SnippylyPresence = function (props) {
578
578
  }
579
579
  };
580
580
  }, []);
581
- return (React.createElement("velt-presence", { ref: ref, "flock-mode": [true, false].includes(flockMode) ? (flockMode ? 'true' : 'false') : undefined, "max-users": maxUsers, "inactivity-time": inactivityTime, "document-params": (typeof documentParams === 'object') ? JSON.stringify(documentParams) : (documentParams ? documentParams : undefined), "disable-flock-navigation": [true, false].includes(disableFlockNavigation) ? (disableFlockNavigation ? 'true' : 'false') : undefined, "default-flock-navigation": [true, false].includes(defaultFlockNavigation) ? (defaultFlockNavigation ? 'true' : 'false') : undefined, self: [true, false].includes(self) ? (self ? 'true' : 'false') : undefined, location: (typeof location === 'object') ? JSON.stringify(location) : (location ? location : undefined), "location-id": locationId, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined }));
581
+ return (React.createElement("velt-presence", { ref: ref, "flock-mode": [true, false].includes(flockMode) ? (flockMode ? 'true' : 'false') : undefined, "max-users": maxUsers, "inactivity-time": inactivityTime, "offline-inactivity-time": offlineInactivityTime, "document-params": (typeof documentParams === 'object') ? JSON.stringify(documentParams) : (documentParams ? documentParams : undefined), "disable-flock-navigation": [true, false].includes(disableFlockNavigation) ? (disableFlockNavigation ? 'true' : 'false') : undefined, "default-flock-navigation": [true, false].includes(defaultFlockNavigation) ? (defaultFlockNavigation ? 'true' : 'false') : undefined, self: [true, false].includes(self) ? (self ? 'true' : 'false') : undefined, location: (typeof location === 'object') ? JSON.stringify(location) : (location ? location : undefined), "location-id": locationId, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined }));
582
582
  };
583
583
 
584
584
  var SnippylyRecorderControlPanel = function (props) {
@@ -6369,6 +6369,33 @@ function useLiveState(liveStateDataId, initialValue, options) {
6369
6369
  return [data, setDataFunction, serverConnectionState];
6370
6370
  }
6371
6371
 
6372
+ function useLiveStateSyncEventCallback(action) {
6373
+ var liveStateSyncElement = useLiveStateSyncUtils();
6374
+ var _a = useState(null), data = _a[0], setData = _a[1];
6375
+ var subscriptionRef = useRef(null);
6376
+ var memoizedAction = useMemo(function () { return action; }, [action]);
6377
+ useEffect(function () {
6378
+ var _a;
6379
+ if (!(liveStateSyncElement === null || liveStateSyncElement === void 0 ? void 0 : liveStateSyncElement.on))
6380
+ return;
6381
+ if (subscriptionRef.current) {
6382
+ subscriptionRef.current.unsubscribe();
6383
+ }
6384
+ var subscription = (_a = liveStateSyncElement === null || liveStateSyncElement === void 0 ? void 0 : liveStateSyncElement.on(memoizedAction)) === null || _a === void 0 ? void 0 : _a.subscribe(function (data) {
6385
+ setData(data);
6386
+ });
6387
+ // Store the new subscription
6388
+ subscriptionRef.current = subscription;
6389
+ // Cleanup function
6390
+ return function () {
6391
+ if (subscriptionRef.current) {
6392
+ subscriptionRef.current.unsubscribe();
6393
+ }
6394
+ };
6395
+ }, [liveStateSyncElement === null || liveStateSyncElement === void 0 ? void 0 : liveStateSyncElement.on, memoizedAction]);
6396
+ return data;
6397
+ }
6398
+
6372
6399
  function usePresenceUtils() {
6373
6400
  var _a = React.useState(), presenceElement = _a[0], setPresenceElement = _a[1];
6374
6401
  var client = useVeltClient().client;
@@ -6396,6 +6423,33 @@ function usePresenceUsers() {
6396
6423
  return data;
6397
6424
  }
6398
6425
 
6426
+ function usePresenceEventCallback(action) {
6427
+ var presenceElement = usePresenceUtils();
6428
+ var _a = useState(null), data = _a[0], setData = _a[1];
6429
+ var subscriptionRef = useRef(null);
6430
+ var memoizedAction = useMemo(function () { return action; }, [action]);
6431
+ useEffect(function () {
6432
+ var _a;
6433
+ if (!(presenceElement === null || presenceElement === void 0 ? void 0 : presenceElement.on))
6434
+ return;
6435
+ if (subscriptionRef.current) {
6436
+ subscriptionRef.current.unsubscribe();
6437
+ }
6438
+ var subscription = (_a = presenceElement === null || presenceElement === void 0 ? void 0 : presenceElement.on(memoizedAction)) === null || _a === void 0 ? void 0 : _a.subscribe(function (data) {
6439
+ setData(data);
6440
+ });
6441
+ // Store the new subscription
6442
+ subscriptionRef.current = subscription;
6443
+ // Cleanup function
6444
+ return function () {
6445
+ if (subscriptionRef.current) {
6446
+ subscriptionRef.current.unsubscribe();
6447
+ }
6448
+ };
6449
+ }, [presenceElement === null || presenceElement === void 0 ? void 0 : presenceElement.on, memoizedAction]);
6450
+ return data;
6451
+ }
6452
+
6399
6453
  function useRecorderUtils() {
6400
6454
  var _a = React.useState(), recorderElement = _a[0], setRecorderElement = _a[1];
6401
6455
  var client = useVeltClient().client;
@@ -6891,5 +6945,5 @@ var logLiveState = function (action, liveStateDataId) {
6891
6945
  }
6892
6946
  };
6893
6947
 
6894
- export { SnippylyArrowTool as VeltArrowTool, SnippylyArrows as VeltArrows, VeltAutocomplete, VeltAutocompleteChipTooltipWireframe, VeltAutocompleteGroupOptionWireframe, VeltAutocompleteOptionWireframe, VeltButtonWireframe, VeltCanvasComment, VeltChartComment, SnippylyCommentBubble as VeltCommentBubble, VeltCommentBubbleWireframe, VeltCommentComposer, VeltCommentComposerWireframe, VeltCommentDialogOptionsDropdownContentWireframe, VeltCommentDialogOptionsDropdownTriggerWireframe, VeltCommentDialogPriorityDropdownContentWireframe, VeltCommentDialogPriorityDropdownTriggerWireframe, VeltCommentDialogStatusDropdownContentWireframe, VeltCommentDialogStatusDropdownTriggerWireframe, VeltCommentDialogWireframe, VeltCommentPin, VeltCommentPinWireframe, VeltCommentPlayerTimeline, VeltCommentText, VeltCommentThread, VeltCommentThreadWireframe, SnippylyCommentTool as VeltCommentTool, VeltCommentToolWireframe, SnippylyComments as VeltComments, VeltCommentsMinimap, SnippylyCommentsSidebar as VeltCommentsSidebar, VeltCommentsSidebarButton, VeltCommentsSidebarStatusDropdownWireframe, VeltCommentsSidebarWireframe, VeltConfirmDialogWireframe, SnippylyCursor as VeltCursor, VeltData, VeltHighChartComments, SnippylyHuddle as VeltHuddle, SnippylyHuddleTool as VeltHuddleTool, VeltIf, VeltInlineCommentsSection, VeltInlineCommentsSectionWireframe, VeltInlineReactionsSection, VeltInlineReactionsSectionWireframe, VeltMediaSourceSettingsWireframe, VeltMultiThreadCommentDialogWireframe, VeltNivoChartComments, VeltNotificationsHistoryPanel, VeltNotificationsPanel, VeltNotificationsPanelWireframe, VeltNotificationsTool, VeltNotificationsToolWireframe, VeltPersistentCommentModeWireframe, SnippylyPresence as VeltPresence, SnippylyProvider as VeltProvider, VeltReactionPinTooltipWireframe, VeltReactionPinWireframe, VeltReactionTool, VeltReactionToolWireframe, VeltReactionsPanelWireframe, VeltRecorderAllToolMenuWireframe, VeltRecorderAllToolWireframe, VeltRecorderAudioToolWireframe, SnippylyRecorderControlPanel as VeltRecorderControlPanel, VeltRecorderControlPanelWireframe, SnippylyRecorderNotes as VeltRecorderNotes, SnippylyRecorderPlayer as VeltRecorderPlayer, VeltRecorderPlayerExpandedWireframe, VeltRecorderPlayerWireframe, VeltRecorderScreenToolWireframe, SnippylyRecorderTool as VeltRecorderTool, VeltRecorderVideoToolWireframe, VeltRecordingPreviewStepsDialogWireframe, SnippylySidebarButton as VeltSidebarButton, VeltSidebarButtonWireframe, VeltSingleEditorModePanel, VeltSingleEditorModePanelWireframe, VeltSubtitlesWireframe, SnippylyTagTool as VeltTagTool, SnippylyTags as VeltTags, VeltTextCommentToolWireframe, VeltTextCommentToolbar as VeltTextCommentToolbarWireframe, VeltTranscriptionWireframe, SnippylyUserInviteTool as VeltUserInviteTool, SnippylyUserRequestTool as VeltUserRequestTool, VeltUserSelectorDropdown as VeltUserSelectorDropdownWireframe, VeltVideoEditorPlayerWireframe, VeltVideoPlayer, VeltViewAnalytics, VeltWireframe, createLiveStateMiddleware, useAIRewriterUtils, useAddAttachment, useAddComment, useAddCommentAnnotation, useAddReaction, useApproveCommentAnnotation, useAssignUser, useAutocompleteChipClick, useAutocompleteUtils, useClient, useCommentActionCallback, useCommentAddHandler, useCommentAnnotationById, useCommentAnnotations, useCommentAnnotationsCount, useCommentCopyLinkHandler, useCommentDialogSidebarClickHandler, useCommentEventCallback, useCommentModeState, useCommentSelectionChangeHandler, useCommentSidebarActionButtonClick, useCommentSidebarData, useCommentSidebarInit, useCommentUpdateHandler, useCommentUtils, useContactList, useContactSelected, useContactUtils, useCopyLink, useCursorUsers, useCursorUtils, useDeleteAttachment, useDeleteComment, useDeleteCommentAnnotation, useDeleteReaction, useDeleteRecording, useEditor, useEditorAccessRequestHandler, useEditorAccessTimer, useGetAttachment, useGetComment, useGetCommentAnnotations, useGetLink, useGetRecording, useHuddleUtils, useIdentify, useLiveSelectionDataHandler, useLiveSelectionUtils, useLiveState, useLiveStateData, useLiveStateSyncUtils, useNotificationUtils, useNotificationsData, usePresenceUsers, usePresenceUtils, useRecorderAddHandler, useRecorderEventCallback, useRecorderUtils, useRecordingDataByRecorderId, useRecordings, useRejectCommentAnnotation, useResolveCommentAnnotation, useServerConnectionStateChangeHandler, useSetDocument, useSetDocumentId, useSetDocuments, useSetLiveStateData, useSetLocation, useSubscribeCommentAnnotation, useTagAnnotations, useTagUtils, useToggleReaction, useUniqueViewsByDate, useUniqueViewsByUser, useUnreadCommentAnnotationCountByLocationId, useUnreadCommentAnnotationCountOnCurrentDocument, useUnreadCommentCountByAnnotationId, useUnreadCommentCountByLocationId, useUnreadCommentCountOnCurrentDocument, useUnreadNotificationsCount, useUnsetDocumentId, useUnsetDocuments, useUnsubscribeCommentAnnotation, useUpdateAccess, useUpdateComment, useUpdatePriority, useUpdateStatus, useUserEditorState, useVeltClient, useVeltEventCallback, useVeltInitState, useViewsUtils };
6948
+ export { SnippylyArrowTool as VeltArrowTool, SnippylyArrows as VeltArrows, VeltAutocomplete, VeltAutocompleteChipTooltipWireframe, VeltAutocompleteGroupOptionWireframe, VeltAutocompleteOptionWireframe, VeltButtonWireframe, VeltCanvasComment, VeltChartComment, SnippylyCommentBubble as VeltCommentBubble, VeltCommentBubbleWireframe, VeltCommentComposer, VeltCommentComposerWireframe, VeltCommentDialogOptionsDropdownContentWireframe, VeltCommentDialogOptionsDropdownTriggerWireframe, VeltCommentDialogPriorityDropdownContentWireframe, VeltCommentDialogPriorityDropdownTriggerWireframe, VeltCommentDialogStatusDropdownContentWireframe, VeltCommentDialogStatusDropdownTriggerWireframe, VeltCommentDialogWireframe, VeltCommentPin, VeltCommentPinWireframe, VeltCommentPlayerTimeline, VeltCommentText, VeltCommentThread, VeltCommentThreadWireframe, SnippylyCommentTool as VeltCommentTool, VeltCommentToolWireframe, SnippylyComments as VeltComments, VeltCommentsMinimap, SnippylyCommentsSidebar as VeltCommentsSidebar, VeltCommentsSidebarButton, VeltCommentsSidebarStatusDropdownWireframe, VeltCommentsSidebarWireframe, VeltConfirmDialogWireframe, SnippylyCursor as VeltCursor, VeltData, VeltHighChartComments, SnippylyHuddle as VeltHuddle, SnippylyHuddleTool as VeltHuddleTool, VeltIf, VeltInlineCommentsSection, VeltInlineCommentsSectionWireframe, VeltInlineReactionsSection, VeltInlineReactionsSectionWireframe, VeltMediaSourceSettingsWireframe, VeltMultiThreadCommentDialogWireframe, VeltNivoChartComments, VeltNotificationsHistoryPanel, VeltNotificationsPanel, VeltNotificationsPanelWireframe, VeltNotificationsTool, VeltNotificationsToolWireframe, VeltPersistentCommentModeWireframe, SnippylyPresence as VeltPresence, SnippylyProvider as VeltProvider, VeltReactionPinTooltipWireframe, VeltReactionPinWireframe, VeltReactionTool, VeltReactionToolWireframe, VeltReactionsPanelWireframe, VeltRecorderAllToolMenuWireframe, VeltRecorderAllToolWireframe, VeltRecorderAudioToolWireframe, SnippylyRecorderControlPanel as VeltRecorderControlPanel, VeltRecorderControlPanelWireframe, SnippylyRecorderNotes as VeltRecorderNotes, SnippylyRecorderPlayer as VeltRecorderPlayer, VeltRecorderPlayerExpandedWireframe, VeltRecorderPlayerWireframe, VeltRecorderScreenToolWireframe, SnippylyRecorderTool as VeltRecorderTool, VeltRecorderVideoToolWireframe, VeltRecordingPreviewStepsDialogWireframe, SnippylySidebarButton as VeltSidebarButton, VeltSidebarButtonWireframe, VeltSingleEditorModePanel, VeltSingleEditorModePanelWireframe, VeltSubtitlesWireframe, SnippylyTagTool as VeltTagTool, SnippylyTags as VeltTags, VeltTextCommentToolWireframe, VeltTextCommentToolbar as VeltTextCommentToolbarWireframe, VeltTranscriptionWireframe, SnippylyUserInviteTool as VeltUserInviteTool, SnippylyUserRequestTool as VeltUserRequestTool, VeltUserSelectorDropdown as VeltUserSelectorDropdownWireframe, VeltVideoEditorPlayerWireframe, VeltVideoPlayer, VeltViewAnalytics, VeltWireframe, createLiveStateMiddleware, useAIRewriterUtils, useAddAttachment, useAddComment, useAddCommentAnnotation, useAddReaction, useApproveCommentAnnotation, useAssignUser, useAutocompleteChipClick, useAutocompleteUtils, useClient, useCommentActionCallback, useCommentAddHandler, useCommentAnnotationById, useCommentAnnotations, useCommentAnnotationsCount, useCommentCopyLinkHandler, useCommentDialogSidebarClickHandler, useCommentEventCallback, useCommentModeState, useCommentSelectionChangeHandler, useCommentSidebarActionButtonClick, useCommentSidebarData, useCommentSidebarInit, useCommentUpdateHandler, useCommentUtils, useContactList, useContactSelected, useContactUtils, useCopyLink, useCursorUsers, useCursorUtils, useDeleteAttachment, useDeleteComment, useDeleteCommentAnnotation, useDeleteReaction, useDeleteRecording, useEditor, useEditorAccessRequestHandler, useEditorAccessTimer, useGetAttachment, useGetComment, useGetCommentAnnotations, useGetLink, useGetRecording, useHuddleUtils, useIdentify, useLiveSelectionDataHandler, useLiveSelectionUtils, useLiveState, useLiveStateData, useLiveStateSyncEventCallback, useLiveStateSyncUtils, useNotificationUtils, useNotificationsData, usePresenceEventCallback, usePresenceUsers, usePresenceUtils, useRecorderAddHandler, useRecorderEventCallback, useRecorderUtils, useRecordingDataByRecorderId, useRecordings, useRejectCommentAnnotation, useResolveCommentAnnotation, useServerConnectionStateChangeHandler, useSetDocument, useSetDocumentId, useSetDocuments, useSetLiveStateData, useSetLocation, useSubscribeCommentAnnotation, useTagAnnotations, useTagUtils, useToggleReaction, useUniqueViewsByDate, useUniqueViewsByUser, useUnreadCommentAnnotationCountByLocationId, useUnreadCommentAnnotationCountOnCurrentDocument, useUnreadCommentCountByAnnotationId, useUnreadCommentCountByLocationId, useUnreadCommentCountOnCurrentDocument, useUnreadNotificationsCount, useUnsetDocumentId, useUnsetDocuments, useUnsubscribeCommentAnnotation, useUpdateAccess, useUpdateComment, useUpdatePriority, useUpdateStatus, useUserEditorState, useVeltClient, useVeltEventCallback, useVeltInitState, useViewsUtils };
6895
6949
  //# sourceMappingURL=index.js.map