@veltdev/react 4.5.0-beta.11 → 4.5.0-beta.13

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.
Files changed (26) hide show
  1. package/cjs/index.js +46 -3
  2. package/cjs/index.js.map +1 -1
  3. package/cjs/types/components/Snippyly/Snippyly.d.ts +1 -0
  4. package/cjs/types/components/VeltRecorderPlayerWireframe/VeltRecorderPlayerEditButtonWireframe/VeltRecorderPlayerEditButtonWireframe.d.ts +8 -0
  5. package/cjs/types/components/VeltRecorderPlayerWireframe/VeltRecorderPlayerEditButtonWireframe/index.d.ts +1 -0
  6. package/cjs/types/components/VeltRecorderPlayerWireframe/VeltRecorderPlayerVideoContainerWireframe/VeltRecorderPlayerVideoContainerWireframe.d.ts +2 -0
  7. package/cjs/types/components/VeltVideoEditorPlayerWireframe/VeltVideoEditorPlayerDownloadButtonWireframe/VeltVideoEditorPlayerDownloadButtonWireframe.d.ts +8 -0
  8. package/cjs/types/components/VeltVideoEditorPlayerWireframe/VeltVideoEditorPlayerDownloadButtonWireframe/index.d.ts +1 -0
  9. package/cjs/types/components/VeltVideoEditorPlayerWireframe/VeltVideoEditorPlayerWireframe.d.ts +2 -0
  10. package/cjs/types/constants.d.ts +2 -1
  11. package/cjs/types/hooks/PresenceElement.d.ts +3 -0
  12. package/cjs/types/loadSnippyly.d.ts +1 -1
  13. package/esm/index.js +46 -3
  14. package/esm/index.js.map +1 -1
  15. package/esm/types/components/Snippyly/Snippyly.d.ts +1 -0
  16. package/esm/types/components/VeltRecorderPlayerWireframe/VeltRecorderPlayerEditButtonWireframe/VeltRecorderPlayerEditButtonWireframe.d.ts +8 -0
  17. package/esm/types/components/VeltRecorderPlayerWireframe/VeltRecorderPlayerEditButtonWireframe/index.d.ts +1 -0
  18. package/esm/types/components/VeltRecorderPlayerWireframe/VeltRecorderPlayerVideoContainerWireframe/VeltRecorderPlayerVideoContainerWireframe.d.ts +2 -0
  19. package/esm/types/components/VeltVideoEditorPlayerWireframe/VeltVideoEditorPlayerDownloadButtonWireframe/VeltVideoEditorPlayerDownloadButtonWireframe.d.ts +8 -0
  20. package/esm/types/components/VeltVideoEditorPlayerWireframe/VeltVideoEditorPlayerDownloadButtonWireframe/index.d.ts +1 -0
  21. package/esm/types/components/VeltVideoEditorPlayerWireframe/VeltVideoEditorPlayerWireframe.d.ts +2 -0
  22. package/esm/types/constants.d.ts +2 -1
  23. package/esm/types/hooks/PresenceElement.d.ts +3 -0
  24. package/esm/types/loadSnippyly.d.ts +1 -1
  25. package/index.d.ts +16 -0
  26. package/package.json +1 -1
package/cjs/index.js CHANGED
@@ -99,7 +99,7 @@ function useVeltClient() {
99
99
  return React.useContext(VeltContext);
100
100
  }
101
101
 
102
- var loadVelt = function (callback, version, staging, develop, proxyDomain) {
102
+ var loadVelt = function (callback, version, staging, develop, proxyDomain, integrity, integrityValue) {
103
103
  if (version === void 0) { version = 'latest'; }
104
104
  if (staging === void 0) { staging = false; }
105
105
  if (develop === void 0) { develop = false; }
@@ -126,6 +126,10 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain) {
126
126
  }
127
127
  script.id = 'veltScript';
128
128
  script.type = 'module';
129
+ if (integrity && integrityValue) {
130
+ script.integrity = integrityValue;
131
+ script.crossOrigin = 'anonymous';
132
+ }
129
133
  document.body.appendChild(script);
130
134
  script.onload = function () {
131
135
  if (callback) {
@@ -140,18 +144,40 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain) {
140
144
  }
141
145
  };
142
146
 
143
- var VELT_SDK_VERSION = '4.5.0-beta.11';
147
+ var VELT_SDK_VERSION = '4.5.0-beta.13';
144
148
  var VELT_SDK_INIT_EVENT = 'onVeltInit';
145
149
  var VELT_TAB_ID = 'veltTabId';
150
+ // integrity map for the Velt SDK
151
+ // Note: generate integrity hashes with: https://www.srihash.org/
152
+ var INTEGRITY_MAP = {
153
+ '4.5.0-beta.13': 'sha384-Mu1jdD223jLItSpbJev0mw5PyMUf+5UlS+qPrM/1P2JMejbTZvnwa8roDWwhP/In',
154
+ };
146
155
 
147
156
  var SnippylyProvider = function (props) {
148
157
  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
158
  var _a = React.useState(null), client = _a[0], setClient = _a[1];
150
159
  React.useEffect(function () {
151
160
  if (apiKey) {
161
+ var staging = config === null || config === void 0 ? void 0 : config.staging;
162
+ var develop = config === null || config === void 0 ? void 0 : config.develop;
163
+ var version = (config === null || config === void 0 ? void 0 : config.version) || VELT_SDK_VERSION;
164
+ var integrity = !!(config === null || config === void 0 ? void 0 : config.integrity);
165
+ var integrityValue = '';
166
+ if (integrity) {
167
+ if (develop || staging) {
168
+ if (config === null || config === void 0 ? void 0 : config.sriv) {
169
+ integrityValue = config === null || config === void 0 ? void 0 : config.sriv;
170
+ }
171
+ }
172
+ else {
173
+ if (INTEGRITY_MAP[version]) {
174
+ integrityValue = INTEGRITY_MAP[version];
175
+ }
176
+ }
177
+ }
152
178
  loadVelt(function () {
153
179
  initVelt();
154
- }, (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);
180
+ }, version, staging, develop, config === null || config === void 0 ? void 0 : config.proxyDomain, integrity, integrityValue);
155
181
  }
156
182
  }, []);
157
183
  React.useEffect(function () {
@@ -4729,6 +4755,12 @@ var VeltRecorderPlayerVideoWireframe = function (props) {
4729
4755
  return (React__default["default"].createElement("velt-recorder-player-video-wireframe", __assign({}, transformedProps), children));
4730
4756
  };
4731
4757
 
4758
+ var VeltRecorderPlayerEditButtonWireframe = function (props) {
4759
+ var children = props.children, remainingProps = __rest(props, ["children"]);
4760
+ var transformedProps = transformWireframeProps(remainingProps);
4761
+ return (React__default["default"].createElement("velt-recorder-player-edit-button-wireframe", __assign({}, transformedProps), children));
4762
+ };
4763
+
4732
4764
  var VeltRecorderPlayerVideoContainerWireframe = function (props) {
4733
4765
  var children = props.children, remainingProps = __rest(props, ["children"]);
4734
4766
  var transformedProps = transformWireframeProps(remainingProps);
@@ -4747,6 +4779,7 @@ VeltRecorderPlayerVideoContainerWireframe.Transcription = VeltRecorderPlayerTran
4747
4779
  VeltRecorderPlayerVideoContainerWireframe.CopyLink = VeltRecorderPlayerCopyLinkWireframe;
4748
4780
  VeltRecorderPlayerVideoContainerWireframe.Delete = VeltRecorderPlayerDeleteWireframe;
4749
4781
  VeltRecorderPlayerVideoContainerWireframe.Avatar = VeltRecorderPlayerAvatarWireframe;
4782
+ VeltRecorderPlayerVideoContainerWireframe.EditButton = VeltRecorderPlayerEditButtonWireframe;
4750
4783
 
4751
4784
  var VeltRecorderPlayerWireframe = function (props) {
4752
4785
  var children = props.children, remainingProps = __rest(props, ["children"]);
@@ -5087,6 +5120,12 @@ VeltVideoEditorPlayerTimelineWireframe.Trim = VeltVideoEditorPlayerTimelineTrimW
5087
5120
  VeltVideoEditorPlayerTimelineWireframe.Container = VeltVideoEditorPlayerTimelineContainerWireframe;
5088
5121
  VeltVideoEditorPlayerTimelineWireframe.Playhead = VeltVideoEditorPlayerTimelinePlayheadWireframe;
5089
5122
 
5123
+ var VeltVideoEditorPlayerDownloadButtonWireframe = function (props) {
5124
+ var children = props.children, remainingProps = __rest(props, ["children"]);
5125
+ var transformedProps = transformWireframeProps(remainingProps);
5126
+ return (React__default["default"].createElement("velt-video-editor-player-download-button-wireframe", __assign({}, transformedProps), children));
5127
+ };
5128
+
5090
5129
  var VeltVideoEditorPlayerWireframe = function (props) {
5091
5130
  var children = props.children, remainingProps = __rest(props, ["children"]);
5092
5131
  var transformedProps = transformWireframeProps(remainingProps);
@@ -5103,6 +5142,7 @@ VeltVideoEditorPlayerWireframe.TotalTime = VeltVideoEditorPlayerTotalTimeWirefra
5103
5142
  VeltVideoEditorPlayerWireframe.SplitButton = VeltVideoEditorPlayerSplitButtonWireframe;
5104
5143
  VeltVideoEditorPlayerWireframe.DeleteButton = VeltVideoEditorPlayerDeleteButtonWireframe;
5105
5144
  VeltVideoEditorPlayerWireframe.Timeline = VeltVideoEditorPlayerTimelineWireframe;
5145
+ VeltVideoEditorPlayerWireframe.DownloadButton = VeltVideoEditorPlayerDownloadButtonWireframe;
5106
5146
 
5107
5147
  var VeltSubtitlesTextWireframe = function (props) {
5108
5148
  var children = props.children, remainingProps = __rest(props, ["children"]);
@@ -6531,6 +6571,9 @@ function usePresenceUtils() {
6531
6571
  }, [client, setPresenceElement, presenceElement]);
6532
6572
  return presenceElement;
6533
6573
  }
6574
+ /**
6575
+ * @deprecated Use `usePresenceData` hook instead.
6576
+ */
6534
6577
  function usePresenceUsers() {
6535
6578
  var presenceElement = usePresenceUtils();
6536
6579
  var _a = React__default["default"].useState(null), data = _a[0], setData = _a[1];