@veltdev/react 4.5.0-beta.63 → 4.5.0-beta.64
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 +10 -3
- package/cjs/index.js.map +1 -1
- package/cjs/types/components/Snippyly/Snippyly.d.ts +2 -1
- package/cjs/types/constants.d.ts +1 -1
- package/esm/index.js +10 -3
- package/esm/index.js.map +1 -1
- package/esm/types/components/Snippyly/Snippyly.d.ts +2 -1
- package/esm/types/constants.d.ts +1 -1
- package/index.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Config, Velt, UserDataProvider, VeltDataProvider, VeltAuthProvider } from "@veltdev/types";
|
|
2
|
+
import { Config, Velt, UserDataProvider, VeltDataProvider, VeltAuthProvider, VeltEncryptionProvider } 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
|
+
encryptionProvider?: VeltEncryptionProvider;
|
|
21
22
|
authProvider?: VeltAuthProvider;
|
|
22
23
|
onClientLoad?: (veltClient?: Velt) => any;
|
|
23
24
|
}
|
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.64";
|
|
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.64';
|
|
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.64': 'sha384-A2mLpoSvdDIRMS1KNJssa1+W2227CkbrlKSr0p/rM/3BJ7iEdKY9CB7udKX96NqC',
|
|
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, authProvider = props.authProvider, 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, encryptionProvider = props.encryptionProvider, 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) {
|
|
@@ -186,6 +186,13 @@ var SnippylyProvider = function (props) {
|
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
}, [client, dataProviders]);
|
|
189
|
+
useEffect(function () {
|
|
190
|
+
if (client && encryptionProvider) {
|
|
191
|
+
if (typeof (client === null || client === void 0 ? void 0 : client.setEncryptionProvider) === "function") {
|
|
192
|
+
client === null || client === void 0 ? void 0 : client.setEncryptionProvider(encryptionProvider);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}, [client, encryptionProvider]);
|
|
189
196
|
useEffect(function () {
|
|
190
197
|
if (client && authProvider && authProvider.user) {
|
|
191
198
|
client.setVeltAuthProvider(authProvider);
|