@veltdev/react 4.6.5 → 4.6.6

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.
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- export declare const VELT_SDK_VERSION = "4.6.5";
2
+ export declare const VELT_SDK_VERSION = "4.6.6";
3
3
  export declare const VELT_SDK_INIT_EVENT = "onVeltInit";
4
4
  export declare const VELT_TAB_ID = "veltTabId";
5
5
  export declare const INTEGRITY_MAP: Record<string, string>;
@@ -1,4 +1,4 @@
1
- import { Location, User, Options, DocumentMetadata, Document, SetDocumentsRequestOptions, SetLocationsRequestOptions, HeartbeatConfig, GetHeartbeatResponse } from "@veltdev/types";
1
+ import { Location, User, Options, DocumentMetadata, Document, SetDocumentsRequestOptions, SetLocationsRequestOptions, HeartbeatConfig, GetHeartbeatResponse, GetUserPermissionsResponse } from "@veltdev/types";
2
2
  export declare function useClient(): any;
3
3
  export declare function useIdentify(user: User, userOptions?: Options): void;
4
4
  export declare function useSetDocument(documentId: string, documentMetadata?: DocumentMetadata): void;
@@ -25,3 +25,4 @@ export declare function useUiState<T extends object = object>(): {
25
25
  };
26
26
  export declare function useHeartbeat(heartbeatConfig?: HeartbeatConfig): GetHeartbeatResponse;
27
27
  export declare function useCurrentUser(): User | null | undefined;
28
+ export declare function useCurrentUserPermissions(): GetUserPermissionsResponse | null | undefined;
@@ -1,4 +1,4 @@
1
- export { useSetLocation, useSetDocument, useSetDocumentId, useSetDocuments, useSetRootDocument, useSetLocations, useSetRootLocation, useUnsetDocumentId, useUnsetDocuments, useIdentify, useClient, useVeltInitState, useUiState, useHeartbeat, useCurrentUser, } from './Client';
1
+ export { useSetLocation, useSetDocument, useSetDocumentId, useSetDocuments, useSetRootDocument, useSetLocations, useSetRootLocation, useUnsetDocumentId, useUnsetDocuments, useIdentify, useClient, useVeltInitState, useUiState, useHeartbeat, useCurrentUser, useCurrentUserPermissions, } from './Client';
2
2
  export { useCommentUtils, useCommentAnnotations, useCommentAddHandler, useCommentModeState, useCommentUpdateHandler, useCommentDialogSidebarClickHandler, useCommentSelectionChangeHandler, useUnreadCommentCountByAnnotationId, useUnreadCommentAnnotationCountOnCurrentDocument, useUnreadCommentCountOnCurrentDocument, useUnreadCommentAnnotationCountByLocationId, useUnreadCommentCountByLocationId, useCommentCopyLinkHandler, useCommentAnnotationById, useCommentSidebarActionButtonClick, useCommentSidebarInit, useCommentSidebarData, } from './CommentElement';
3
3
  export { useAddAttachment, useDeleteAttachment, useGetAttachment, useDeleteRecording, useGetRecording, useAddReaction, useDeleteReaction, useToggleReaction, useAddComment, useUpdateComment, useDeleteComment, useAddCommentAnnotation, useDeleteCommentAnnotation, useApproveCommentAnnotation, useSubscribeCommentAnnotation, useUnsubscribeCommentAnnotation, useAssignUser, useCopyLink, useGetComment, useGetLink, useRejectCommentAnnotation, useResolveCommentAnnotation, useUpdateAccess, useUpdatePriority, useUpdateStatus, useCommentActionCallback, useCommentEventCallback, useGetCommentAnnotations, useCommentAnnotationsCount, } from './CommentActions';
4
4
  export { useVeltEventCallback } from './CoreActions';
package/esm/index.js CHANGED
@@ -137,13 +137,13 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain, integ
137
137
  }
138
138
  };
139
139
 
140
- var VELT_SDK_VERSION = '4.6.5';
140
+ var VELT_SDK_VERSION = '4.6.6';
141
141
  var VELT_SDK_INIT_EVENT = 'onVeltInit';
142
142
  var VELT_TAB_ID = 'veltTabId';
143
143
  // integrity map for the Velt SDK
144
144
  // Note: generate integrity hashes with: https://www.srihash.org/
145
145
  var INTEGRITY_MAP = {
146
- '4.6.5': 'sha384-zyfD7r77uPaeko/F1E1iD04QLd6NifYN5teaNHf1flhCOz98t2wn90wVeZRVPryx',
146
+ '4.6.6': 'sha384-NwjxBARMh0QyZR9MFw1alVnq9kG8FMREeH+x/2yu8PPQ2SjkpwrRJ01JjlfDhPrz',
147
147
  };
148
148
 
149
149
  var validProps = ['veltIf', 'veltClass', 'className', 'variant'];
@@ -6275,6 +6275,31 @@ function useCurrentUser() {
6275
6275
  }, [client === null || client === void 0 ? void 0 : client.getCurrentUser]);
6276
6276
  return data;
6277
6277
  }
6278
+ function useCurrentUserPermissions() {
6279
+ var client = useVeltClient().client;
6280
+ var _a = React.useState(), data = _a[0], setData = _a[1];
6281
+ var subscriptionRef = React.useRef();
6282
+ React.useEffect(function () {
6283
+ if (!(client === null || client === void 0 ? void 0 : client.getCurrentUserPermissions))
6284
+ return;
6285
+ // Unsubscribe from the previous subscription if it exists
6286
+ if (subscriptionRef.current) {
6287
+ subscriptionRef.current.unsubscribe();
6288
+ }
6289
+ var subscription = client.getCurrentUserPermissions().subscribe(function (res) {
6290
+ setData(res);
6291
+ });
6292
+ // Store the new subscription
6293
+ subscriptionRef.current = subscription;
6294
+ // Cleanup function.
6295
+ return function () {
6296
+ if (subscriptionRef.current) {
6297
+ subscriptionRef.current.unsubscribe();
6298
+ }
6299
+ };
6300
+ }, [client === null || client === void 0 ? void 0 : client.getCurrentUserPermissions]);
6301
+ return data;
6302
+ }
6278
6303
 
6279
6304
  function useCommentUtils() {
6280
6305
  var _a = React.useState(), commentElement = _a[0], setCommentElement = _a[1];
@@ -7995,5 +8020,5 @@ var logLiveState = function (action, liveStateDataId) {
7995
8020
  }
7996
8021
  };
7997
8022
 
7998
- 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, VeltCursorPointerWireframe, 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, VeltPresenceTooltipWireframe, VeltPresenceWireframe, 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, VeltVideoEditor, 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, useCurrentUser, useCursorUsers, useCursorUtils, useDeleteAttachment, useDeleteComment, useDeleteCommentAnnotation, useDeleteReaction, useDeleteRecording, useEditor, useEditorAccessRequestHandler, useEditorAccessTimer, useGetAttachment, useGetComment, useGetCommentAnnotations, useGetLink, useGetRecording, useHeartbeat, useHuddleUtils, useIdentify, useLiveSelectionDataHandler, useLiveSelectionUtils, useLiveState, useLiveStateData, useLiveStateSyncEventCallback, useLiveStateSyncUtils, useNotificationEventCallback, useNotificationSettings, useNotificationUtils, useNotificationsData, usePresenceData, usePresenceEventCallback, usePresenceUsers, usePresenceUtils, useRecorderAddHandler, useRecorderEventCallback, useRecorderUtils, useRecordingDataByRecorderId, useRecordings, useRejectCommentAnnotation, useResolveCommentAnnotation, useServerConnectionStateChangeHandler, useSetDocument, useSetDocumentId, useSetDocuments, useSetLiveStateData, useSetLocation, useSetLocations, useSetRootDocument, useSetRootLocation, useSubscribeCommentAnnotation, useTagAnnotations, useTagUtils, useToggleReaction, useUiState, useUniqueViewsByDate, useUniqueViewsByUser, useUnreadCommentAnnotationCountByLocationId, useUnreadCommentAnnotationCountOnCurrentDocument, useUnreadCommentCountByAnnotationId, useUnreadCommentCountByLocationId, useUnreadCommentCountOnCurrentDocument, useUnreadNotificationsCount, useUnsetDocumentId, useUnsetDocuments, useUnsubscribeCommentAnnotation, useUpdateAccess, useUpdateComment, useUpdatePriority, useUpdateStatus, useUserEditorState, useVeltClient, useVeltEventCallback, useVeltInitState, useViewsUtils };
8023
+ 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, VeltCursorPointerWireframe, 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, VeltPresenceTooltipWireframe, VeltPresenceWireframe, 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, VeltVideoEditor, 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, useCurrentUser, useCurrentUserPermissions, useCursorUsers, useCursorUtils, useDeleteAttachment, useDeleteComment, useDeleteCommentAnnotation, useDeleteReaction, useDeleteRecording, useEditor, useEditorAccessRequestHandler, useEditorAccessTimer, useGetAttachment, useGetComment, useGetCommentAnnotations, useGetLink, useGetRecording, useHeartbeat, useHuddleUtils, useIdentify, useLiveSelectionDataHandler, useLiveSelectionUtils, useLiveState, useLiveStateData, useLiveStateSyncEventCallback, useLiveStateSyncUtils, useNotificationEventCallback, useNotificationSettings, useNotificationUtils, useNotificationsData, usePresenceData, usePresenceEventCallback, usePresenceUsers, usePresenceUtils, useRecorderAddHandler, useRecorderEventCallback, useRecorderUtils, useRecordingDataByRecorderId, useRecordings, useRejectCommentAnnotation, useResolveCommentAnnotation, useServerConnectionStateChangeHandler, useSetDocument, useSetDocumentId, useSetDocuments, useSetLiveStateData, useSetLocation, useSetLocations, useSetRootDocument, useSetRootLocation, useSubscribeCommentAnnotation, useTagAnnotations, useTagUtils, useToggleReaction, useUiState, useUniqueViewsByDate, useUniqueViewsByUser, useUnreadCommentAnnotationCountByLocationId, useUnreadCommentAnnotationCountOnCurrentDocument, useUnreadCommentCountByAnnotationId, useUnreadCommentCountByLocationId, useUnreadCommentCountOnCurrentDocument, useUnreadNotificationsCount, useUnsetDocumentId, useUnsetDocuments, useUnsubscribeCommentAnnotation, useUpdateAccess, useUpdateComment, useUpdatePriority, useUpdateStatus, useUserEditorState, useVeltClient, useVeltEventCallback, useVeltInitState, useViewsUtils };
7999
8024
  //# sourceMappingURL=index.js.map