@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
@@ -5,6 +5,7 @@ export interface IVeltProps extends React.DetailedHTMLProps<React.HTMLAttributes
5
5
  config?: Config & {
6
6
  proxyDomain?: string;
7
7
  version?: string;
8
+ integrity?: boolean;
8
9
  };
9
10
  user?: any;
10
11
  documentId?: string;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { IVeltWireframeCommonProps } from '../../../constants';
3
+ export interface IVeltRecorderPlayerEditButtonWireframeProps extends IVeltWireframeCommonProps {
4
+ }
5
+ export interface IVeltRecorderPlayerEditButtonWireframe extends React.FC<IVeltRecorderPlayerEditButtonWireframeProps> {
6
+ }
7
+ declare const VeltRecorderPlayerEditButtonWireframe: IVeltRecorderPlayerEditButtonWireframe;
8
+ export default VeltRecorderPlayerEditButtonWireframe;
@@ -0,0 +1 @@
1
+ export { default } from './VeltRecorderPlayerEditButtonWireframe';
@@ -13,12 +13,14 @@ import { IVeltRecorderPlayerTimeWireframe } from '../VeltRecorderPlayerTimeWiref
13
13
  import { IVeltRecorderPlayerTranscriptionWireframe } from '../VeltRecorderPlayerTranscriptionWireframe/VeltRecorderPlayerTranscriptionWireframe';
14
14
  import { IVeltRecorderPlayerVideoWireframe } from '../VeltRecorderPlayerVideoWireframe/VeltRecorderPlayerVideoWireframe';
15
15
  import { IVeltRecorderPlayerAvatarWireframe } from '../VeltRecorderPlayerAvatarWireframe/VeltRecorderPlayerAvatarWireframe';
16
+ import { IVeltRecorderPlayerEditButtonWireframe } from '../VeltRecorderPlayerEditButtonWireframe/VeltRecorderPlayerEditButtonWireframe';
16
17
  export interface IVeltRecorderPlayerVideoContainerWireframeProps extends IVeltWireframeCommonProps {
17
18
  }
18
19
  export interface IVeltRecorderPlayerVideoContainerWireframe extends React.FC<IVeltRecorderPlayerVideoContainerWireframeProps> {
19
20
  Video: IVeltRecorderPlayerVideoWireframe;
20
21
  Timeline: IVeltRecorderPlayerTimelineWireframe;
21
22
  PlayButton: IVeltRecorderPlayerPlayButtonWireframe;
23
+ EditButton: IVeltRecorderPlayerEditButtonWireframe;
22
24
  FullScreenButton: IVeltRecorderPlayerFullScreenButtonWireframe;
23
25
  Overlay: IVeltRecorderPlayerOverlayWireframe;
24
26
  Time: IVeltRecorderPlayerTimeWireframe;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { IVeltWireframeCommonProps } from '../../../constants';
3
+ export interface IVeltVideoEditorPlayerDownloadButtonWireframeProps extends IVeltWireframeCommonProps {
4
+ }
5
+ export interface IVeltVideoEditorPlayerDownloadButtonWireframe extends React.FC<IVeltVideoEditorPlayerDownloadButtonWireframeProps> {
6
+ }
7
+ declare const VeltVideoEditorPlayerDownloadButtonWireframe: IVeltVideoEditorPlayerDownloadButtonWireframe;
8
+ export default VeltVideoEditorPlayerDownloadButtonWireframe;
@@ -0,0 +1 @@
1
+ export { default } from './VeltVideoEditorPlayerDownloadButtonWireframe';
@@ -11,12 +11,14 @@ import { IVeltVideoEditorPlayerTotalTimeWireframe } from './VeltVideoEditorPlaye
11
11
  import { IVeltVideoEditorPlayerSplitButtonWireframe } from './VeltVideoEditorPlayerSplitButtonWireframe/VeltVideoEditorPlayerSplitButtonWireframe';
12
12
  import { IVeltVideoEditorPlayerDeleteButtonWireframe } from './VeltVideoEditorPlayerDeleteButtonWireframe/VeltVideoEditorPlayerDeleteButtonWireframe';
13
13
  import { IVeltVideoEditorPlayerTimelineWireframe } from './VeltVideoEditorPlayerTimelineWireframe/VeltVideoEditorPlayerTimelineWireframe';
14
+ import { IVeltVideoEditorPlayerDownloadButtonWireframe } from './VeltVideoEditorPlayerDownloadButtonWireframe/VeltVideoEditorPlayerDownloadButtonWireframe';
14
15
  export interface IVeltVideoEditorPlayerWireframeProps extends IVeltWireframeCommonProps {
15
16
  }
16
17
  export interface IVeltVideoEditorPlayerWireframe extends React.FC<IVeltVideoEditorPlayerWireframeProps> {
17
18
  Title: IVeltVideoEditorPlayerTitleWireframe;
18
19
  ApplyButton: IVeltVideoEditorPlayerApplyButtonWireframe;
19
20
  CloseButton: IVeltVideoEditorPlayerCloseButtonWireframe;
21
+ DownloadButton: IVeltVideoEditorPlayerDownloadButtonWireframe;
20
22
  Preview: IVeltVideoEditorPlayerPreviewWireframe;
21
23
  ToggleButton: IVeltVideoEditorPlayerToggleButtonWireframe;
22
24
  Time: IVeltVideoEditorPlayerTimeWireframe;
@@ -1,7 +1,8 @@
1
1
  /// <reference types="react" />
2
- export declare const VELT_SDK_VERSION = "4.5.0-beta.11";
2
+ export declare const VELT_SDK_VERSION = "4.5.0-beta.13";
3
3
  export declare const VELT_SDK_INIT_EVENT = "onVeltInit";
4
4
  export declare const VELT_TAB_ID = "veltTabId";
5
+ export declare const INTEGRITY_MAP: Record<string, string>;
5
6
  export interface IVeltWireframeCommonProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement> {
6
7
  veltIf?: string;
7
8
  veltClass?: string;
@@ -1,4 +1,7 @@
1
1
  import { GetPresenceDataResponse, PresenceElement, PresenceRequestQuery, PresenceUser } from "@veltdev/types";
2
2
  export declare function usePresenceUtils(): PresenceElement | undefined;
3
+ /**
4
+ * @deprecated Use `usePresenceData` hook instead.
5
+ */
3
6
  export declare function usePresenceUsers(): PresenceUser[] | null;
4
7
  export declare function usePresenceData(query?: PresenceRequestQuery): GetPresenceDataResponse;
@@ -1,2 +1,2 @@
1
- declare const loadVelt: (callback: Function, version?: string, staging?: boolean, develop?: boolean, proxyDomain?: string) => void;
1
+ declare const loadVelt: (callback: Function, version?: string, staging?: boolean, develop?: boolean, proxyDomain?: string, integrity?: boolean, integrityValue?: string) => void;
2
2
  export default loadVelt;
package/esm/index.js CHANGED
@@ -91,7 +91,7 @@ function useVeltClient() {
91
91
  return useContext(VeltContext);
92
92
  }
93
93
 
94
- var loadVelt = function (callback, version, staging, develop, proxyDomain) {
94
+ var loadVelt = function (callback, version, staging, develop, proxyDomain, integrity, integrityValue) {
95
95
  if (version === void 0) { version = 'latest'; }
96
96
  if (staging === void 0) { staging = false; }
97
97
  if (develop === void 0) { develop = false; }
@@ -118,6 +118,10 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain) {
118
118
  }
119
119
  script.id = 'veltScript';
120
120
  script.type = 'module';
121
+ if (integrity && integrityValue) {
122
+ script.integrity = integrityValue;
123
+ script.crossOrigin = 'anonymous';
124
+ }
121
125
  document.body.appendChild(script);
122
126
  script.onload = function () {
123
127
  if (callback) {
@@ -132,18 +136,40 @@ var loadVelt = function (callback, version, staging, develop, proxyDomain) {
132
136
  }
133
137
  };
134
138
 
135
- var VELT_SDK_VERSION = '4.5.0-beta.11';
139
+ var VELT_SDK_VERSION = '4.5.0-beta.13';
136
140
  var VELT_SDK_INIT_EVENT = 'onVeltInit';
137
141
  var VELT_TAB_ID = 'veltTabId';
142
+ // integrity map for the Velt SDK
143
+ // Note: generate integrity hashes with: https://www.srihash.org/
144
+ var INTEGRITY_MAP = {
145
+ '4.5.0-beta.13': 'sha384-Mu1jdD223jLItSpbJev0mw5PyMUf+5UlS+qPrM/1P2JMejbTZvnwa8roDWwhP/In',
146
+ };
138
147
 
139
148
  var SnippylyProvider = function (props) {
140
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, onClientLoad = props.onClientLoad, children = props.children;
141
150
  var _a = useState(null), client = _a[0], setClient = _a[1];
142
151
  useEffect(function () {
143
152
  if (apiKey) {
153
+ var staging = config === null || config === void 0 ? void 0 : config.staging;
154
+ var develop = config === null || config === void 0 ? void 0 : config.develop;
155
+ var version = (config === null || config === void 0 ? void 0 : config.version) || VELT_SDK_VERSION;
156
+ var integrity = !!(config === null || config === void 0 ? void 0 : config.integrity);
157
+ var integrityValue = '';
158
+ if (integrity) {
159
+ if (develop || staging) {
160
+ if (config === null || config === void 0 ? void 0 : config.sriv) {
161
+ integrityValue = config === null || config === void 0 ? void 0 : config.sriv;
162
+ }
163
+ }
164
+ else {
165
+ if (INTEGRITY_MAP[version]) {
166
+ integrityValue = INTEGRITY_MAP[version];
167
+ }
168
+ }
169
+ }
144
170
  loadVelt(function () {
145
171
  initVelt();
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);
172
+ }, version, staging, develop, config === null || config === void 0 ? void 0 : config.proxyDomain, integrity, integrityValue);
147
173
  }
148
174
  }, []);
149
175
  useEffect(function () {
@@ -4721,6 +4747,12 @@ var VeltRecorderPlayerVideoWireframe = function (props) {
4721
4747
  return (React.createElement("velt-recorder-player-video-wireframe", __assign({}, transformedProps), children));
4722
4748
  };
4723
4749
 
4750
+ var VeltRecorderPlayerEditButtonWireframe = function (props) {
4751
+ var children = props.children, remainingProps = __rest(props, ["children"]);
4752
+ var transformedProps = transformWireframeProps(remainingProps);
4753
+ return (React.createElement("velt-recorder-player-edit-button-wireframe", __assign({}, transformedProps), children));
4754
+ };
4755
+
4724
4756
  var VeltRecorderPlayerVideoContainerWireframe = function (props) {
4725
4757
  var children = props.children, remainingProps = __rest(props, ["children"]);
4726
4758
  var transformedProps = transformWireframeProps(remainingProps);
@@ -4739,6 +4771,7 @@ VeltRecorderPlayerVideoContainerWireframe.Transcription = VeltRecorderPlayerTran
4739
4771
  VeltRecorderPlayerVideoContainerWireframe.CopyLink = VeltRecorderPlayerCopyLinkWireframe;
4740
4772
  VeltRecorderPlayerVideoContainerWireframe.Delete = VeltRecorderPlayerDeleteWireframe;
4741
4773
  VeltRecorderPlayerVideoContainerWireframe.Avatar = VeltRecorderPlayerAvatarWireframe;
4774
+ VeltRecorderPlayerVideoContainerWireframe.EditButton = VeltRecorderPlayerEditButtonWireframe;
4742
4775
 
4743
4776
  var VeltRecorderPlayerWireframe = function (props) {
4744
4777
  var children = props.children, remainingProps = __rest(props, ["children"]);
@@ -5079,6 +5112,12 @@ VeltVideoEditorPlayerTimelineWireframe.Trim = VeltVideoEditorPlayerTimelineTrimW
5079
5112
  VeltVideoEditorPlayerTimelineWireframe.Container = VeltVideoEditorPlayerTimelineContainerWireframe;
5080
5113
  VeltVideoEditorPlayerTimelineWireframe.Playhead = VeltVideoEditorPlayerTimelinePlayheadWireframe;
5081
5114
 
5115
+ var VeltVideoEditorPlayerDownloadButtonWireframe = function (props) {
5116
+ var children = props.children, remainingProps = __rest(props, ["children"]);
5117
+ var transformedProps = transformWireframeProps(remainingProps);
5118
+ return (React.createElement("velt-video-editor-player-download-button-wireframe", __assign({}, transformedProps), children));
5119
+ };
5120
+
5082
5121
  var VeltVideoEditorPlayerWireframe = function (props) {
5083
5122
  var children = props.children, remainingProps = __rest(props, ["children"]);
5084
5123
  var transformedProps = transformWireframeProps(remainingProps);
@@ -5095,6 +5134,7 @@ VeltVideoEditorPlayerWireframe.TotalTime = VeltVideoEditorPlayerTotalTimeWirefra
5095
5134
  VeltVideoEditorPlayerWireframe.SplitButton = VeltVideoEditorPlayerSplitButtonWireframe;
5096
5135
  VeltVideoEditorPlayerWireframe.DeleteButton = VeltVideoEditorPlayerDeleteButtonWireframe;
5097
5136
  VeltVideoEditorPlayerWireframe.Timeline = VeltVideoEditorPlayerTimelineWireframe;
5137
+ VeltVideoEditorPlayerWireframe.DownloadButton = VeltVideoEditorPlayerDownloadButtonWireframe;
5098
5138
 
5099
5139
  var VeltSubtitlesTextWireframe = function (props) {
5100
5140
  var children = props.children, remainingProps = __rest(props, ["children"]);
@@ -6523,6 +6563,9 @@ function usePresenceUtils() {
6523
6563
  }, [client, setPresenceElement, presenceElement]);
6524
6564
  return presenceElement;
6525
6565
  }
6566
+ /**
6567
+ * @deprecated Use `usePresenceData` hook instead.
6568
+ */
6526
6569
  function usePresenceUsers() {
6527
6570
  var presenceElement = usePresenceUtils();
6528
6571
  var _a = React.useState(null), data = _a[0], setData = _a[1];