@brightcove/components-embed-code-modal 0.1.4 → 0.1.6
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/index.js +15 -10
- package/index.js.map +1 -1
- package/package.json +5 -2
- package/src/index.d.ts +2 -2
- package/src/js/EmbedCode.d.ts +1 -1
- package/src/js/EmbedCodeModalComponent.d.ts +1 -1
- package/src/js/constants/player.d.ts +1 -0
- package/src/js/hooks/useGetPlayers.d.ts +6 -0
- package/src/js/i18n.d.ts +30 -0
- package/src/js/services/players-api.d.ts +2 -0
- package/src/js/types/EmbedCodeModalProps.d.ts +5 -0
- package/src/js/types/EmbedCodeProps.d.ts +1 -0
- package/src/js/types/players.d.ts +27 -0
- package/src/js/utils/call.d.ts +9 -0
- package/src/js/utils/util.d.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightcove/components-embed-code-modal",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal.git"
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"@brightcove/eslint-config-applications": "^0.3.0",
|
|
31
31
|
"@brightcove/kacl": "^0.1.11",
|
|
32
32
|
"@brightcove/notify-change": "^0.1.7",
|
|
33
|
+
"@brightcove/react-player-loader": "^1.4.1",
|
|
33
34
|
"@testing-library/jest-dom": "^5.16.2",
|
|
34
35
|
"@testing-library/react": "^12.1.2",
|
|
35
36
|
"@types/jest": "^27.4.0",
|
|
@@ -64,13 +65,15 @@
|
|
|
64
65
|
},
|
|
65
66
|
"dependencies": {
|
|
66
67
|
"@brightcove/player-embed-code": "1.4.0",
|
|
68
|
+
"@brightcove/studio-api-services": "^6.49.1",
|
|
67
69
|
"@brightcove/studio-components": "^4.4.3",
|
|
68
70
|
"@brightcove/studio-design-tokens": "1.13.0",
|
|
69
71
|
"@brightcove/studio-icons": "8.6.1",
|
|
70
72
|
"i18next": "^21.5.4",
|
|
71
73
|
"react": ">=17.0.2",
|
|
72
74
|
"react-dom": ">=17.0.2",
|
|
73
|
-
"react-i18next": "^11.14.3"
|
|
75
|
+
"react-i18next": "^11.14.3",
|
|
76
|
+
"react-query": "^3.38.0"
|
|
74
77
|
},
|
|
75
78
|
"peerDependencies": {
|
|
76
79
|
"react": ">=17.0.2",
|
package/src/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import EmbedCodeModal from './js/EmbedCodeModal';
|
|
2
|
-
import type { VideoPayload } from './js/types/EmbedCodeModalProps';
|
|
3
|
-
export { EmbedCodeModal, VideoPayload };
|
|
2
|
+
import type { VideoPayload, EmbedCodeModalTypes } from './js/types/EmbedCodeModalProps';
|
|
3
|
+
export { EmbedCodeModal, VideoPayload, EmbedCodeModalTypes };
|
package/src/js/EmbedCode.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { EmbedCodeProps } from 'js/types/EmbedCodeProps';
|
|
3
|
-
export declare const EmbedCode: ({ isIFrame, accountId, videoId }: EmbedCodeProps) => JSX.Element;
|
|
3
|
+
export declare const EmbedCode: ({ isIFrame, accountId, videoId, playerId, }: EmbedCodeProps) => JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { EmbedCodeModalProps } from 'js/types/EmbedCodeModalProps';
|
|
3
|
-
export declare const EmbedCodeModalComponent: ({ video }: EmbedCodeModalProps) => JSX.Element;
|
|
3
|
+
export declare const EmbedCodeModalComponent: ({ video, type, }: EmbedCodeModalProps) => JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DEFAULT_PLAYER_ID = "default";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { EmbedCodeModalTypes } from 'js/types/EmbedCodeModalProps';
|
|
2
|
+
declare const useGetPlayers: (type: EmbedCodeModalTypes, isEmbedTypesEnabled: boolean, isPlayersCallEnabled: boolean) => import("react-query").QueryObserverIdleResult<import("../types/players").GetPlayersPayload, unknown> | import("react-query").QueryObserverLoadingErrorResult<import("../types/players").GetPlayersPayload, unknown> | import("react-query").QueryObserverLoadingResult<import("../types/players").GetPlayersPayload, unknown> | import("react-query").QueryObserverRefetchErrorResult<import("../types/players").GetPlayersPayload, unknown> | import("react-query").QueryObserverSuccessResult<import("../types/players").GetPlayersPayload, unknown> | {
|
|
3
|
+
isLoading: boolean;
|
|
4
|
+
data: null;
|
|
5
|
+
};
|
|
6
|
+
export default useGetPlayers;
|
package/src/js/i18n.d.ts
CHANGED
|
@@ -5,18 +5,23 @@ export declare const resources: {
|
|
|
5
5
|
modalHeader: string;
|
|
6
6
|
mediaNotice: string;
|
|
7
7
|
tooltipText: string;
|
|
8
|
+
tooltipTextNew: string;
|
|
8
9
|
tooltipLink: string;
|
|
9
10
|
previewButton: string;
|
|
11
|
+
player: string;
|
|
10
12
|
tabs: {
|
|
11
13
|
labels: {
|
|
12
14
|
iframe: string;
|
|
13
15
|
javascript: string;
|
|
14
16
|
};
|
|
15
17
|
helperText: string;
|
|
18
|
+
helperTextNew: string;
|
|
16
19
|
};
|
|
17
20
|
closeModal: string;
|
|
18
21
|
toasterTitle: string;
|
|
19
22
|
toasterMessage: string;
|
|
23
|
+
toasterErrorMessage: string;
|
|
24
|
+
customPluginNotice: string;
|
|
20
25
|
};
|
|
21
26
|
};
|
|
22
27
|
es: {
|
|
@@ -24,18 +29,23 @@ export declare const resources: {
|
|
|
24
29
|
modalHeader: string;
|
|
25
30
|
mediaNotice: string;
|
|
26
31
|
tooltipText: string;
|
|
32
|
+
tooltipTextNew: string;
|
|
27
33
|
tooltipLink: string;
|
|
28
34
|
previewButton: string;
|
|
35
|
+
player: string;
|
|
29
36
|
tabs: {
|
|
30
37
|
labels: {
|
|
31
38
|
iframe: string;
|
|
32
39
|
javascript: string;
|
|
33
40
|
};
|
|
34
41
|
helperText: string;
|
|
42
|
+
helperTextNew: string;
|
|
35
43
|
};
|
|
36
44
|
closeModal: string;
|
|
37
45
|
toasterTitle: string;
|
|
38
46
|
toasterMessage: string;
|
|
47
|
+
toasterErrorMessage: string;
|
|
48
|
+
customPluginNotice: string;
|
|
39
49
|
};
|
|
40
50
|
};
|
|
41
51
|
fr: {
|
|
@@ -43,18 +53,23 @@ export declare const resources: {
|
|
|
43
53
|
modalHeader: string;
|
|
44
54
|
mediaNotice: string;
|
|
45
55
|
tooltipText: string;
|
|
56
|
+
tooltipTextNew: string;
|
|
46
57
|
tooltipLink: string;
|
|
47
58
|
previewButton: string;
|
|
59
|
+
player: string;
|
|
48
60
|
tabs: {
|
|
49
61
|
labels: {
|
|
50
62
|
iframe: string;
|
|
51
63
|
javascript: string;
|
|
52
64
|
};
|
|
53
65
|
helperText: string;
|
|
66
|
+
helperTextNew: string;
|
|
54
67
|
};
|
|
55
68
|
closeModal: string;
|
|
56
69
|
toasterTitle: string;
|
|
57
70
|
toasterMessage: string;
|
|
71
|
+
toasterErrorMessage: string;
|
|
72
|
+
customPluginNotice: string;
|
|
58
73
|
};
|
|
59
74
|
};
|
|
60
75
|
ja: {
|
|
@@ -62,18 +77,23 @@ export declare const resources: {
|
|
|
62
77
|
modalHeader: string;
|
|
63
78
|
mediaNotice: string;
|
|
64
79
|
tooltipText: string;
|
|
80
|
+
tooltipTextNew: string;
|
|
65
81
|
tooltipLink: string;
|
|
66
82
|
previewButton: string;
|
|
83
|
+
player: string;
|
|
67
84
|
tabs: {
|
|
68
85
|
labels: {
|
|
69
86
|
iframe: string;
|
|
70
87
|
javascript: string;
|
|
71
88
|
};
|
|
72
89
|
helperText: string;
|
|
90
|
+
helperTextNew: string;
|
|
73
91
|
};
|
|
74
92
|
closeModal: string;
|
|
75
93
|
toasterTitle: string;
|
|
76
94
|
toasterMessage: string;
|
|
95
|
+
toasterErrorMessage: string;
|
|
96
|
+
customPluginNotice: string;
|
|
77
97
|
};
|
|
78
98
|
};
|
|
79
99
|
ko: {
|
|
@@ -81,18 +101,23 @@ export declare const resources: {
|
|
|
81
101
|
modalHeader: string;
|
|
82
102
|
mediaNotice: string;
|
|
83
103
|
tooltipText: string;
|
|
104
|
+
tooltipTextNew: string;
|
|
84
105
|
tooltipLink: string;
|
|
85
106
|
previewButton: string;
|
|
107
|
+
player: string;
|
|
86
108
|
tabs: {
|
|
87
109
|
labels: {
|
|
88
110
|
iframe: string;
|
|
89
111
|
javascript: string;
|
|
90
112
|
};
|
|
91
113
|
helperText: string;
|
|
114
|
+
helperTextNew: string;
|
|
92
115
|
};
|
|
93
116
|
closeModal: string;
|
|
94
117
|
toasterTitle: string;
|
|
95
118
|
toasterMessage: string;
|
|
119
|
+
toasterErrorMessage: string;
|
|
120
|
+
customPluginNotice: string;
|
|
96
121
|
};
|
|
97
122
|
};
|
|
98
123
|
zh: {
|
|
@@ -100,18 +125,23 @@ export declare const resources: {
|
|
|
100
125
|
modalHeader: string;
|
|
101
126
|
mediaNotice: string;
|
|
102
127
|
tooltipText: string;
|
|
128
|
+
tooltipTextNew: string;
|
|
103
129
|
tooltipLink: string;
|
|
104
130
|
previewButton: string;
|
|
131
|
+
player: string;
|
|
105
132
|
tabs: {
|
|
106
133
|
labels: {
|
|
107
134
|
iframe: string;
|
|
108
135
|
javascript: string;
|
|
109
136
|
};
|
|
110
137
|
helperText: string;
|
|
138
|
+
helperTextNew: string;
|
|
111
139
|
};
|
|
112
140
|
closeModal: string;
|
|
113
141
|
toasterTitle: string;
|
|
114
142
|
toasterMessage: string;
|
|
143
|
+
toasterErrorMessage: string;
|
|
144
|
+
customPluginNotice: string;
|
|
115
145
|
};
|
|
116
146
|
};
|
|
117
147
|
};
|
|
@@ -5,7 +5,12 @@ export interface VideoPayload {
|
|
|
5
5
|
posterUrl?: string;
|
|
6
6
|
duration: number;
|
|
7
7
|
}
|
|
8
|
+
export declare enum EmbedCodeModalTypes {
|
|
9
|
+
PLAYER = "player",
|
|
10
|
+
VIDEO = "video"
|
|
11
|
+
}
|
|
8
12
|
export declare type EmbedCodeModalProps = {
|
|
9
13
|
language?: 'en' | 'es' | 'fr' | 'ko' | 'ja' | 'zh';
|
|
10
14
|
video: VideoPayload;
|
|
15
|
+
type?: EmbedCodeModalTypes;
|
|
11
16
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare type PlayerSelectItem = {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
};
|
|
5
|
+
export declare type PlayersObjectItem = {
|
|
6
|
+
label: string;
|
|
7
|
+
id: string;
|
|
8
|
+
hasPlugins: boolean;
|
|
9
|
+
isCampaignPlayer: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare type PlayersObject = {
|
|
12
|
+
[key: string]: PlayersObjectItem;
|
|
13
|
+
};
|
|
14
|
+
export declare type PlayerItem = {
|
|
15
|
+
account_id: string;
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
branches: object;
|
|
20
|
+
created_at: string;
|
|
21
|
+
embed_count: number;
|
|
22
|
+
url: string;
|
|
23
|
+
};
|
|
24
|
+
export declare type GetPlayersPayload = {
|
|
25
|
+
item_count: number;
|
|
26
|
+
items: PlayerItem[];
|
|
27
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const getAccountId: () => any;
|
|
2
|
+
export declare const getConfig: () => {
|
|
3
|
+
apiConfig: {
|
|
4
|
+
publisherId: any;
|
|
5
|
+
api: any;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare const call: <T>(options: any) => Promise<T>;
|
|
9
|
+
export declare const callAPI: <T>(apiEndpoint: any, apiArgs: any) => Promise<T>;
|
package/src/js/utils/util.d.ts
CHANGED
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
* @returns the studio environment
|
|
4
4
|
*/
|
|
5
5
|
export declare function getStudioEnvironment(): string;
|
|
6
|
+
/**
|
|
7
|
+
* Get embed modal types enabled value.
|
|
8
|
+
* @returns the embed modal types enabled value
|
|
9
|
+
*/
|
|
10
|
+
export declare function isEmbedModalTypesEnabled(): boolean;
|
|
6
11
|
/**
|
|
7
12
|
* Is the module running in QA environment?
|
|
8
13
|
*/
|