@veltdev/react 4.1.1 → 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.
package/cjs/index.js CHANGED
@@ -140,12 +140,12 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain) {
140
140
  }
141
141
  };
142
142
 
143
- var VELT_SDK_VERSION = '4.1.1';
143
+ var VELT_SDK_VERSION = '4.2.0-beta.1';
144
144
  var VELT_SDK_INIT_EVENT = 'onVeltInit';
145
145
  var VELT_TAB_ID = 'veltTabId';
146
146
 
147
147
  var SnippylyProvider = function (props) {
148
- 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;
148
+ 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
149
  var _a = React.useState(null), client = _a[0], setClient = _a[1];
150
150
  React.useEffect(function () {
151
151
  if (apiKey) {
@@ -161,6 +161,13 @@ var SnippylyProvider = function (props) {
161
161
  }
162
162
  }
163
163
  }, [client, userDataProvider]);
164
+ React.useEffect(function () {
165
+ if (client && dataProviders) {
166
+ if (typeof (client === null || client === void 0 ? void 0 : client.setDataProviders) === 'function') {
167
+ client === null || client === void 0 ? void 0 : client.setDataProviders(dataProviders);
168
+ }
169
+ }
170
+ }, [client, dataProviders]);
164
171
  var initVelt = function () { return __awaiter(void 0, void 0, void 0, function () {
165
172
  var velt, event;
166
173
  var _a, _b;