@veltdev/react 4.0.0-beta.10 → 4.0.0-beta.11
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 -5
- package/cjs/index.js.map +1 -1
- package/cjs/types/components/Snippyly/Snippyly.d.ts +2 -1
- package/cjs/types/components/SnippylyRecorderNotes/SnippylyRecorderNotes.d.ts +2 -1
- package/cjs/types/components/SnippylyRecorderTool/SnippylyRecorderTool.d.ts +1 -0
- package/cjs/types/constants.d.ts +1 -1
- package/esm/index.js +13 -5
- package/esm/index.js.map +1 -1
- package/esm/types/components/Snippyly/Snippyly.d.ts +2 -1
- package/esm/types/components/SnippylyRecorderNotes/SnippylyRecorderNotes.d.ts +2 -1
- package/esm/types/components/SnippylyRecorderTool/SnippylyRecorderTool.d.ts +1 -0
- package/esm/types/constants.d.ts +1 -1
- package/index.d.ts +5 -2
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Config, Velt } from '@veltdev/types';
|
|
2
|
+
import { Config, Velt, UserDataProvider } from '@veltdev/types';
|
|
3
3
|
export interface IVeltProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
4
4
|
apiKey: string;
|
|
5
5
|
config?: Config & {
|
|
@@ -15,6 +15,7 @@ export interface IVeltProps extends React.DetailedHTMLProps<React.HTMLAttributes
|
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
autoTranslation?: boolean;
|
|
18
|
+
userDataProvider?: UserDataProvider;
|
|
18
19
|
onClientLoad?: (veltClient?: Velt) => any;
|
|
19
20
|
}
|
|
20
21
|
declare const SnippylyProvider: React.FC<IVeltProps>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export interface IVeltRecorderNotesProps {
|
|
2
|
+
export interface IVeltRecorderNotesProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
|
|
3
|
+
shadowDom?: boolean;
|
|
3
4
|
}
|
|
4
5
|
declare const SnippylyRecorderNotes: React.FC<IVeltRecorderNotesProps>;
|
|
5
6
|
export default SnippylyRecorderNotes;
|
|
@@ -4,6 +4,7 @@ export interface IVeltRecorderToolProps extends React.DetailedHTMLProps<React.HT
|
|
|
4
4
|
panelId?: string;
|
|
5
5
|
buttonLabel?: string;
|
|
6
6
|
darkMode?: boolean;
|
|
7
|
+
shadowDom?: boolean;
|
|
7
8
|
}
|
|
8
9
|
declare const SnippylyRecorderTool: React.FC<IVeltRecorderToolProps>;
|
|
9
10
|
export default SnippylyRecorderTool;
|
package/cjs/types/constants.d.ts
CHANGED
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.0.0-beta.
|
|
135
|
+
var VELT_SDK_VERSION = '4.0.0-beta.11';
|
|
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, 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, 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) {
|
|
@@ -146,6 +146,13 @@ var SnippylyProvider = function (props) {
|
|
|
146
146
|
}, (config === null || config === void 0 ? void 0 : config.version) || VELT_SDK_VERSION, config === null || config === void 0 ? void 0 : config.staging, config === null || config === void 0 ? void 0 : config.develop, config === null || config === void 0 ? void 0 : config.proxyDomain);
|
|
147
147
|
}
|
|
148
148
|
}, []);
|
|
149
|
+
useEffect(function () {
|
|
150
|
+
if (client && userDataProvider) {
|
|
151
|
+
if (typeof (client === null || client === void 0 ? void 0 : client.setUserDataProvider) === 'function') {
|
|
152
|
+
client === null || client === void 0 ? void 0 : client.setUserDataProvider(userDataProvider);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}, [client, userDataProvider]);
|
|
149
156
|
var initVelt = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
150
157
|
var velt, event;
|
|
151
158
|
var _a, _b;
|
|
@@ -598,7 +605,8 @@ var SnippylyRecorderControlPanel = function (props) {
|
|
|
598
605
|
};
|
|
599
606
|
|
|
600
607
|
var SnippylyRecorderNotes = function (props) {
|
|
601
|
-
|
|
608
|
+
var shadowDom = props.shadowDom, children = props.children;
|
|
609
|
+
return (React.createElement("velt-recorder-notes", { "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined }, children));
|
|
602
610
|
};
|
|
603
611
|
|
|
604
612
|
var SnippylyRecorderPlayer = function (props) {
|
|
@@ -632,8 +640,8 @@ var SnippylyRecorderPlayer = function (props) {
|
|
|
632
640
|
};
|
|
633
641
|
|
|
634
642
|
var SnippylyRecorderTool = function (props) {
|
|
635
|
-
var type = props.type, panelId = props.panelId, buttonLabel = props.buttonLabel, children = props.children, darkMode = props.darkMode;
|
|
636
|
-
return (React.createElement("velt-recorder-tool", { type: type, "panel-id": panelId, "button-label": buttonLabel, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined }, children));
|
|
643
|
+
var type = props.type, panelId = props.panelId, buttonLabel = props.buttonLabel, children = props.children, darkMode = props.darkMode, shadowDom = props.shadowDom;
|
|
644
|
+
return (React.createElement("velt-recorder-tool", { type: type, "panel-id": panelId, "button-label": buttonLabel, "dark-mode": [true, false].includes(darkMode) ? (darkMode ? 'true' : 'false') : undefined, "shadow-dom": [true, false].includes(shadowDom) ? (shadowDom ? 'true' : 'false') : undefined }, children));
|
|
637
645
|
};
|
|
638
646
|
|
|
639
647
|
var SnippylySidebarButton = function (props) {
|