@veltdev/react 4.5.0-beta.57 → 4.5.0-beta.59
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 +13 -25
- package/cjs/index.js.map +1 -1
- package/cjs/types/components/Snippyly/Snippyly.d.ts +3 -2
- package/cjs/types/components/index.d.ts +0 -1
- package/cjs/types/constants.d.ts +1 -1
- package/esm/index.js +14 -25
- package/esm/index.js.map +1 -1
- package/esm/types/components/Snippyly/Snippyly.d.ts +3 -2
- package/esm/types/components/index.d.ts +0 -1
- package/esm/types/constants.d.ts +1 -1
- package/index.d.ts +3 -9
- package/package.json +1 -1
- package/cjs/types/components/VeltAuthProvider/VeltAuthProvider.d.ts +0 -9
- package/cjs/types/components/VeltAuthProvider/index.d.ts +0 -1
- package/esm/types/components/VeltAuthProvider/VeltAuthProvider.d.ts +0 -9
- package/esm/types/components/VeltAuthProvider/index.d.ts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { Config, Velt, UserDataProvider, VeltDataProvider } from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Config, Velt, UserDataProvider, VeltDataProvider, VeltAuthProvider } from "@veltdev/types";
|
|
3
3
|
export interface IVeltProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
4
4
|
apiKey: string;
|
|
5
5
|
config?: Config & {
|
|
@@ -18,6 +18,7 @@ export interface IVeltProps extends React.DetailedHTMLProps<React.HTMLAttributes
|
|
|
18
18
|
autoTranslation?: boolean;
|
|
19
19
|
userDataProvider?: UserDataProvider;
|
|
20
20
|
dataProviders?: VeltDataProvider;
|
|
21
|
+
authProvider?: VeltAuthProvider;
|
|
21
22
|
onClientLoad?: (veltClient?: Velt) => any;
|
|
22
23
|
}
|
|
23
24
|
declare const SnippylyProvider: React.FC<IVeltProps>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { default as VeltProvider } from "./Snippyly";
|
|
2
|
-
export { default as VeltAuthProvider } from "./VeltAuthProvider";
|
|
3
2
|
export { default as VeltCommentBubble } from "./SnippylyCommentBubble";
|
|
4
3
|
export { default as VeltComments } from "./SnippylyComments";
|
|
5
4
|
export { default as VeltCommentsSidebar } from "./SnippylyCommentsSidebar";
|
package/cjs/types/constants.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const VELT_SDK_VERSION = "4.5.0-beta.
|
|
2
|
+
export declare const VELT_SDK_VERSION = "4.5.0-beta.59";
|
|
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>;
|
package/esm/index.js
CHANGED
|
@@ -136,17 +136,17 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain, integ
|
|
|
136
136
|
}
|
|
137
137
|
};
|
|
138
138
|
|
|
139
|
-
var VELT_SDK_VERSION = '4.5.0-beta.
|
|
139
|
+
var VELT_SDK_VERSION = '4.5.0-beta.59';
|
|
140
140
|
var VELT_SDK_INIT_EVENT = 'onVeltInit';
|
|
141
141
|
var VELT_TAB_ID = 'veltTabId';
|
|
142
142
|
// integrity map for the Velt SDK
|
|
143
143
|
// Note: generate integrity hashes with: https://www.srihash.org/
|
|
144
144
|
var INTEGRITY_MAP = {
|
|
145
|
-
'4.5.0-beta.
|
|
145
|
+
'4.5.0-beta.59': 'sha384-eWscGajF6BzcUBxoKHK7eISXUIe6nlmpsRIYa7F0GZz9jYMQGI5d4D7hgtfzgF4z',
|
|
146
146
|
};
|
|
147
147
|
|
|
148
148
|
var SnippylyProvider = function (props) {
|
|
149
|
-
var apiKey = props.apiKey, user = props.user, config = props.config, documentId = props.documentId, language = props.language, translations = props.translations, autoTranslation = props.autoTranslation, userDataProvider = props.userDataProvider, dataProviders = props.dataProviders, onClientLoad = props.onClientLoad, children = props.children;
|
|
149
|
+
var apiKey = props.apiKey, user = props.user, config = props.config, documentId = props.documentId, language = props.language, translations = props.translations, autoTranslation = props.autoTranslation, userDataProvider = props.userDataProvider, dataProviders = props.dataProviders, authProvider = props.authProvider, onClientLoad = props.onClientLoad, children = props.children;
|
|
150
150
|
var _a = useState(null), client = _a[0], setClient = _a[1];
|
|
151
151
|
useEffect(function () {
|
|
152
152
|
if (apiKey) {
|
|
@@ -154,7 +154,7 @@ var SnippylyProvider = function (props) {
|
|
|
154
154
|
var develop = config === null || config === void 0 ? void 0 : config.develop;
|
|
155
155
|
var version = (config === null || config === void 0 ? void 0 : config.version) || VELT_SDK_VERSION;
|
|
156
156
|
var integrity = !!(config === null || config === void 0 ? void 0 : config.integrity);
|
|
157
|
-
var integrityValue =
|
|
157
|
+
var integrityValue = "";
|
|
158
158
|
if (integrity) {
|
|
159
159
|
if (develop || staging) {
|
|
160
160
|
if (config === null || config === void 0 ? void 0 : config.sriv) {
|
|
@@ -174,18 +174,23 @@ var SnippylyProvider = function (props) {
|
|
|
174
174
|
}, []);
|
|
175
175
|
useEffect(function () {
|
|
176
176
|
if (client && userDataProvider) {
|
|
177
|
-
if (typeof (client === null || client === void 0 ? void 0 : client.setUserDataProvider) ===
|
|
177
|
+
if (typeof (client === null || client === void 0 ? void 0 : client.setUserDataProvider) === "function") {
|
|
178
178
|
client === null || client === void 0 ? void 0 : client.setUserDataProvider(userDataProvider);
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
}, [client, userDataProvider]);
|
|
182
182
|
useEffect(function () {
|
|
183
183
|
if (client && dataProviders) {
|
|
184
|
-
if (typeof (client === null || client === void 0 ? void 0 : client.setDataProviders) ===
|
|
184
|
+
if (typeof (client === null || client === void 0 ? void 0 : client.setDataProviders) === "function") {
|
|
185
185
|
client === null || client === void 0 ? void 0 : client.setDataProviders(dataProviders);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
}, [client, dataProviders]);
|
|
189
|
+
useEffect(function () {
|
|
190
|
+
if (client && authProvider && authProvider.user) {
|
|
191
|
+
client.setVeltAuthProvider(authProvider);
|
|
192
|
+
}
|
|
193
|
+
}, [client, authProvider]);
|
|
189
194
|
var initVelt = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
190
195
|
var velt, event;
|
|
191
196
|
var _a, _b;
|
|
@@ -220,7 +225,7 @@ var SnippylyProvider = function (props) {
|
|
|
220
225
|
}
|
|
221
226
|
// Set translations
|
|
222
227
|
if (translations && (velt === null || velt === void 0 ? void 0 : velt.setTranslations)) {
|
|
223
|
-
if (typeof translations ===
|
|
228
|
+
if (typeof translations === "object") {
|
|
224
229
|
Object.keys(translations).forEach(function (languageCode) {
|
|
225
230
|
velt === null || velt === void 0 ? void 0 : velt.setTranslations(languageCode, translations[languageCode] || {});
|
|
226
231
|
});
|
|
@@ -235,7 +240,7 @@ var SnippylyProvider = function (props) {
|
|
|
235
240
|
}
|
|
236
241
|
}
|
|
237
242
|
if (velt === null || velt === void 0 ? void 0 : velt.st) {
|
|
238
|
-
velt === null || velt === void 0 ? void 0 : velt.st(
|
|
243
|
+
velt === null || velt === void 0 ? void 0 : velt.st("react");
|
|
239
244
|
}
|
|
240
245
|
setClient(velt);
|
|
241
246
|
if (onClientLoad) {
|
|
@@ -260,22 +265,6 @@ var SnippylyProvider = function (props) {
|
|
|
260
265
|
React.createElement(VeltContext.Provider, { value: { client: client } }, children)));
|
|
261
266
|
};
|
|
262
267
|
|
|
263
|
-
var VeltAuthProvider = function (props) {
|
|
264
|
-
var children = props.children, user = props.user, options = props.options, retryConfig = props.retryConfig;
|
|
265
|
-
var client = useVeltClient().client;
|
|
266
|
-
useEffect(function () {
|
|
267
|
-
if ((client === null || client === void 0 ? void 0 : client.setVeltAuthProvider) && user) {
|
|
268
|
-
var authProviderConfig = {
|
|
269
|
-
user: user,
|
|
270
|
-
options: options,
|
|
271
|
-
retryConfig: retryConfig
|
|
272
|
-
};
|
|
273
|
-
client.setVeltAuthProvider(authProviderConfig);
|
|
274
|
-
}
|
|
275
|
-
}, [client, user, options, retryConfig]);
|
|
276
|
-
return (React.createElement(React.Fragment, null, children));
|
|
277
|
-
};
|
|
278
|
-
|
|
279
268
|
var SnippylyCommentBubble = function (props) {
|
|
280
269
|
var targetCommentElementId = props.targetCommentElementId, targetElementId = props.targetElementId, avatar = props.avatar, showAvatar = props.showAvatar, commentBubbleTargetPinHover = props.commentBubbleTargetPinHover, children = props.children, shadowDom = props.shadowDom, variant = props.variant, darkMode = props.darkMode, commentCountType = props.commentCountType, context = props.context, contextOptions = props.contextOptions, annotationId = props.annotationId, documentId = props.documentId, folderId = props.folderId, locationId = props.locationId;
|
|
281
270
|
return (React.createElement("velt-comment-bubble", { "annotation-id": annotationId, "comment-count-type": commentCountType, "target-comment-element-id": targetCommentElementId, "target-element-id": targetElementId, context: JSON.stringify(context), "context-options": JSON.stringify(contextOptions), "location-id": locationId, "document-id": documentId, "folder-id": folderId, "show-avatar": [true, false].includes(showAvatar) ? (showAvatar ? 'true' : 'false') : undefined, avatar: [true, false].includes(avatar) ? (avatar ? 'true' : 'false') : undefined, "comment-bubble-target-pin-hover": commentBubbleTargetPinHover ? 'true' : undefined, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined, variant: variant }, children));
|
|
@@ -7694,5 +7683,5 @@ var logLiveState = function (action, liveStateDataId) {
|
|
|
7694
7683
|
}
|
|
7695
7684
|
};
|
|
7696
7685
|
|
|
7697
|
-
export { SnippylyArrowTool as VeltArrowTool, SnippylyArrows as VeltArrows,
|
|
7686
|
+
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, 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, 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, useUniqueViewsByDate, useUniqueViewsByUser, useUnreadCommentAnnotationCountByLocationId, useUnreadCommentAnnotationCountOnCurrentDocument, useUnreadCommentCountByAnnotationId, useUnreadCommentCountByLocationId, useUnreadCommentCountOnCurrentDocument, useUnreadNotificationsCount, useUnsetDocumentId, useUnsetDocuments, useUnsubscribeCommentAnnotation, useUpdateAccess, useUpdateComment, useUpdatePriority, useUpdateStatus, useUserEditorState, useVeltClient, useVeltEventCallback, useVeltInitState, useViewsUtils };
|
|
7698
7687
|
//# sourceMappingURL=index.js.map
|