@veltdev/react 4.1.0 → 4.2.0-beta.1

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
  import React from 'react';
2
- import { Config, Velt, UserDataProvider } from '@veltdev/types';
2
+ import { Config, Velt, UserDataProvider, IVeltDataProvider } from '@veltdev/types';
3
3
  export interface IVeltProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
4
4
  apiKey: string;
5
5
  config?: Config & {
@@ -16,6 +16,7 @@ export interface IVeltProps extends React.DetailedHTMLProps<React.HTMLAttributes
16
16
  };
17
17
  autoTranslation?: boolean;
18
18
  userDataProvider?: UserDataProvider;
19
+ dataProviders?: IVeltDataProvider;
19
20
  onClientLoad?: (veltClient?: Velt) => any;
20
21
  }
21
22
  declare const SnippylyProvider: React.FC<IVeltProps>;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- export declare const VELT_SDK_VERSION = "4.1.0";
2
+ export declare const VELT_SDK_VERSION = "4.2.0-beta.1";
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> {
package/esm/index.js CHANGED
@@ -132,12 +132,12 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain) {
132
132
  }
133
133
  };
134
134
 
135
- var VELT_SDK_VERSION = '4.1.0';
135
+ var VELT_SDK_VERSION = '4.2.0-beta.1';
136
136
  var VELT_SDK_INIT_EVENT = 'onVeltInit';
137
137
  var VELT_TAB_ID = 'veltTabId';
138
138
 
139
139
  var SnippylyProvider = function (props) {
140
- 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, onClientLoad = props.onClientLoad, children = props.children;
140
+ 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;
141
141
  var _a = useState(null), client = _a[0], setClient = _a[1];
142
142
  useEffect(function () {
143
143
  if (apiKey) {
@@ -153,6 +153,13 @@ var SnippylyProvider = function (props) {
153
153
  }
154
154
  }
155
155
  }, [client, userDataProvider]);
156
+ useEffect(function () {
157
+ if (client && dataProviders) {
158
+ if (typeof (client === null || client === void 0 ? void 0 : client.setDataProviders) === 'function') {
159
+ client === null || client === void 0 ? void 0 : client.setDataProviders(dataProviders);
160
+ }
161
+ }
162
+ }, [client, dataProviders]);
156
163
  var initVelt = function () { return __awaiter(void 0, void 0, void 0, function () {
157
164
  var velt, event;
158
165
  var _a, _b;