@brightcove/components-embed-code-modal 1.1.1 → 1.1.2
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/__tests__/PrismPlayerControls.test.d.ts +2 -0
- package/__tests__/PrismPlayerControls.test.d.ts.map +1 -0
- package/{build/index.js → index.js} +1 -1
- package/index.js.map +1 -0
- package/package.json +6 -16
- package/{build/src → src}/js/components/prism/PrismPlayerControls.d.ts.map +1 -1
- package/.eslintignore +0 -7
- package/.eslintrc +0 -23
- package/.github/workflows/ci.yml +0 -23
- package/.husky/pre-commit +0 -4
- package/.nvmrc +0 -1
- package/.prettierignore +0 -7
- package/.prettierrc +0 -5
- package/.release-it.json +0 -40
- package/.whitesource +0 -3
- package/CHANGELOG.md +0 -403
- package/CODEOWNERS +0 -37
- package/PULL_REQUEST_TEMPLATE.md +0 -17
- package/__tests__/EmbedCode.test.tsx +0 -51
- package/__tests__/InteractivityProject.test.tsx +0 -50
- package/__tests__/PlayerPreview.test.tsx +0 -23
- package/__tests__/PrismPlayerPreview.test.tsx +0 -168
- package/__tests__/TabsHeader.test.tsx +0 -19
- package/__tests__/TabsSection.test.tsx +0 -46
- package/__tests__/TitleWithTooltip.test.tsx +0 -45
- package/__tests__/VideoPlayer.test.tsx +0 -38
- package/__tests__/embedCodeGenerator.test.ts +0 -111
- package/__tests__/util.test.ts +0 -89
- package/babel.config.json +0 -17
- package/build/README.md +0 -109
- package/build/index.js.map +0 -1
- package/build/package.json +0 -100
- package/etc/wildcard.brightcove.com.key +0 -27
- package/etc/wildcard.brightcove.com.pem +0 -96
- package/jest/jest.setup.js +0 -90
- package/jest/jest.stub.js +0 -4
- package/jest.config.js +0 -24
- package/scripts/create-dist-pkg-prod.js +0 -19
- package/src/index.ts +0 -17
- package/src/js/EmbedCodeModal.tsx +0 -105
- package/src/js/components/CustomSettingsDropdown.tsx +0 -184
- package/src/js/components/EmbedCopySection.tsx +0 -130
- package/src/js/components/ModalContainer.tsx +0 -367
- package/src/js/components/NoPlayerModal.tsx +0 -42
- package/src/js/components/PlayerPreview.tsx +0 -116
- package/src/js/components/TabsHeader.tsx +0 -31
- package/src/js/components/TabsSection.tsx +0 -74
- package/src/js/components/TitleWithTooltip.tsx +0 -39
- package/src/js/components/VideoLinks.tsx +0 -83
- package/src/js/components/VideoPlayer.tsx +0 -324
- package/src/js/components/index.ts +0 -9
- package/src/js/components/prism/PrismLiveModal.tsx +0 -162
- package/src/js/components/prism/PrismPlayerControls.tsx +0 -343
- package/src/js/components/prism/PrismPlayerPreview.tsx +0 -188
- package/src/js/components/prism/index.ts +0 -3
- package/src/js/constants/baseUrls.ts +0 -4
- package/src/js/constants/embed.ts +0 -12
- package/src/js/constants/player.ts +0 -32
- package/src/js/constants/pluginsRegistry.ts +0 -30
- package/src/js/hooks/useGetPlayers.ts +0 -12
- package/src/js/i18n.ts +0 -43
- package/src/js/services/players-api.ts +0 -26
- package/src/js/services/url-shortener.ts +0 -10
- package/src/js/types/EmbedCodeModalProps.ts +0 -72
- package/src/js/types/EmbedCodeProps.ts +0 -13
- package/src/js/types/brightcoveEmbedCode.d.ts +0 -18
- package/src/js/types/players.ts +0 -64
- package/src/js/types/react-i18next.d.ts +0 -8
- package/src/js/types/studioModule.ts +0 -7
- package/src/js/utils/addPluginsDataToPlayers.ts +0 -59
- package/src/js/utils/call.ts +0 -31
- package/src/js/utils/dimensions.ts +0 -53
- package/src/js/utils/embedCodeGenerator.ts +0 -120
- package/src/js/utils/featureSwitches.ts +0 -16
- package/src/js/utils/util.ts +0 -153
- package/src/module.tsx +0 -280
- package/src/styles/CustomSettingsDropdown.sass +0 -42
- package/src/styles/EmbedCode.sass +0 -30
- package/src/styles/EmbedCodeModal.sass +0 -76
- package/src/styles/base.sass +0 -1
- package/src/styles/prism/PrismLiveModal.sass +0 -155
- package/src/styles/theme.sass +0 -11
- package/src/styles/typings.td.ts +0 -9
- package/src/translations/en.json +0 -65
- package/src/translations/es.json +0 -65
- package/src/translations/fr.json +0 -65
- package/src/translations/ja.json +0 -65
- package/src/translations/ko.json +0 -65
- package/src/translations/zh.json +0 -65
- package/src/types/studio.ts +0 -197
- package/tsconfig.json +0 -34
- package/webpack.config.js +0 -117
- /package/{build/__tests__ → __tests__}/EmbedCode.test.d.ts +0 -0
- /package/{build/__tests__ → __tests__}/EmbedCode.test.d.ts.map +0 -0
- /package/{build/__tests__ → __tests__}/InteractivityProject.test.d.ts +0 -0
- /package/{build/__tests__ → __tests__}/InteractivityProject.test.d.ts.map +0 -0
- /package/{build/__tests__ → __tests__}/PlayerPreview.test.d.ts +0 -0
- /package/{build/__tests__ → __tests__}/PlayerPreview.test.d.ts.map +0 -0
- /package/{build/__tests__ → __tests__}/PrismPlayerPreview.test.d.ts +0 -0
- /package/{build/__tests__ → __tests__}/PrismPlayerPreview.test.d.ts.map +0 -0
- /package/{build/__tests__ → __tests__}/TabsHeader.test.d.ts +0 -0
- /package/{build/__tests__ → __tests__}/TabsHeader.test.d.ts.map +0 -0
- /package/{build/__tests__ → __tests__}/TabsSection.test.d.ts +0 -0
- /package/{build/__tests__ → __tests__}/TabsSection.test.d.ts.map +0 -0
- /package/{build/__tests__ → __tests__}/TitleWithTooltip.test.d.ts +0 -0
- /package/{build/__tests__ → __tests__}/TitleWithTooltip.test.d.ts.map +0 -0
- /package/{build/__tests__ → __tests__}/VideoPlayer.test.d.ts +0 -0
- /package/{build/__tests__ → __tests__}/VideoPlayer.test.d.ts.map +0 -0
- /package/{build/__tests__ → __tests__}/embedCodeGenerator.test.d.ts +0 -0
- /package/{build/__tests__ → __tests__}/embedCodeGenerator.test.d.ts.map +0 -0
- /package/{build/__tests__ → __tests__}/util.test.d.ts +0 -0
- /package/{build/__tests__ → __tests__}/util.test.d.ts.map +0 -0
- /package/{build/src → src}/index.d.ts +0 -0
- /package/{build/src → src}/index.d.ts.map +0 -0
- /package/{build/src → src}/js/EmbedCodeModal.d.ts +0 -0
- /package/{build/src → src}/js/EmbedCodeModal.d.ts.map +0 -0
- /package/{build/src → src}/js/components/CustomSettingsDropdown.d.ts +0 -0
- /package/{build/src → src}/js/components/CustomSettingsDropdown.d.ts.map +0 -0
- /package/{build/src → src}/js/components/EmbedCopySection.d.ts +0 -0
- /package/{build/src → src}/js/components/EmbedCopySection.d.ts.map +0 -0
- /package/{build/src → src}/js/components/ModalContainer.d.ts +0 -0
- /package/{build/src → src}/js/components/ModalContainer.d.ts.map +0 -0
- /package/{build/src → src}/js/components/NoPlayerModal.d.ts +0 -0
- /package/{build/src → src}/js/components/NoPlayerModal.d.ts.map +0 -0
- /package/{build/src → src}/js/components/PlayerPreview.d.ts +0 -0
- /package/{build/src → src}/js/components/PlayerPreview.d.ts.map +0 -0
- /package/{build/src → src}/js/components/TabsHeader.d.ts +0 -0
- /package/{build/src → src}/js/components/TabsHeader.d.ts.map +0 -0
- /package/{build/src → src}/js/components/TabsSection.d.ts +0 -0
- /package/{build/src → src}/js/components/TabsSection.d.ts.map +0 -0
- /package/{build/src → src}/js/components/TitleWithTooltip.d.ts +0 -0
- /package/{build/src → src}/js/components/TitleWithTooltip.d.ts.map +0 -0
- /package/{build/src → src}/js/components/VideoLinks.d.ts +0 -0
- /package/{build/src → src}/js/components/VideoLinks.d.ts.map +0 -0
- /package/{build/src → src}/js/components/VideoPlayer.d.ts +0 -0
- /package/{build/src → src}/js/components/VideoPlayer.d.ts.map +0 -0
- /package/{build/src → src}/js/components/index.d.ts +0 -0
- /package/{build/src → src}/js/components/index.d.ts.map +0 -0
- /package/{build/src → src}/js/components/prism/PrismLiveModal.d.ts +0 -0
- /package/{build/src → src}/js/components/prism/PrismLiveModal.d.ts.map +0 -0
- /package/{build/src → src}/js/components/prism/PrismPlayerControls.d.ts +0 -0
- /package/{build/src → src}/js/components/prism/PrismPlayerPreview.d.ts +0 -0
- /package/{build/src → src}/js/components/prism/PrismPlayerPreview.d.ts.map +0 -0
- /package/{build/src → src}/js/components/prism/index.d.ts +0 -0
- /package/{build/src → src}/js/components/prism/index.d.ts.map +0 -0
- /package/{build/src → src}/js/constants/baseUrls.d.ts +0 -0
- /package/{build/src → src}/js/constants/baseUrls.d.ts.map +0 -0
- /package/{build/src → src}/js/constants/embed.d.ts +0 -0
- /package/{build/src → src}/js/constants/embed.d.ts.map +0 -0
- /package/{build/src → src}/js/constants/player.d.ts +0 -0
- /package/{build/src → src}/js/constants/player.d.ts.map +0 -0
- /package/{build/src → src}/js/constants/pluginsRegistry.d.ts +0 -0
- /package/{build/src → src}/js/constants/pluginsRegistry.d.ts.map +0 -0
- /package/{build/src → src}/js/hooks/useGetPlayers.d.ts +0 -0
- /package/{build/src → src}/js/hooks/useGetPlayers.d.ts.map +0 -0
- /package/{build/src → src}/js/i18n.d.ts +0 -0
- /package/{build/src → src}/js/i18n.d.ts.map +0 -0
- /package/{build/src → src}/js/services/players-api.d.ts +0 -0
- /package/{build/src → src}/js/services/players-api.d.ts.map +0 -0
- /package/{build/src → src}/js/services/url-shortener.d.ts +0 -0
- /package/{build/src → src}/js/services/url-shortener.d.ts.map +0 -0
- /package/{build/src → src}/js/types/EmbedCodeModalProps.d.ts +0 -0
- /package/{build/src → src}/js/types/EmbedCodeModalProps.d.ts.map +0 -0
- /package/{build/src → src}/js/types/EmbedCodeProps.d.ts +0 -0
- /package/{build/src → src}/js/types/EmbedCodeProps.d.ts.map +0 -0
- /package/{build/src → src}/js/types/players.d.ts +0 -0
- /package/{build/src → src}/js/types/players.d.ts.map +0 -0
- /package/{build/src → src}/js/types/studioModule.d.ts +0 -0
- /package/{build/src → src}/js/types/studioModule.d.ts.map +0 -0
- /package/{build/src → src}/js/utils/addPluginsDataToPlayers.d.ts +0 -0
- /package/{build/src → src}/js/utils/addPluginsDataToPlayers.d.ts.map +0 -0
- /package/{build/src → src}/js/utils/call.d.ts +0 -0
- /package/{build/src → src}/js/utils/call.d.ts.map +0 -0
- /package/{build/src → src}/js/utils/dimensions.d.ts +0 -0
- /package/{build/src → src}/js/utils/dimensions.d.ts.map +0 -0
- /package/{build/src → src}/js/utils/embedCodeGenerator.d.ts +0 -0
- /package/{build/src → src}/js/utils/embedCodeGenerator.d.ts.map +0 -0
- /package/{build/src → src}/js/utils/featureSwitches.d.ts +0 -0
- /package/{build/src → src}/js/utils/featureSwitches.d.ts.map +0 -0
- /package/{build/src → src}/js/utils/util.d.ts +0 -0
- /package/{build/src → src}/js/utils/util.d.ts.map +0 -0
- /package/{build/src → src}/module.d.ts +0 -0
- /package/{build/src → src}/module.d.ts.map +0 -0
- /package/{build/src → src}/styles/typings.td.d.ts +0 -0
- /package/{build/src → src}/styles/typings.td.d.ts.map +0 -0
- /package/{build/src → src}/types/studio.d.ts +0 -0
- /package/{build/src → src}/types/studio.d.ts.map +0 -0
package/build/README.md
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
# studio-components-embed-code-modal
|
|
2
|
-
|
|
3
|
-
## Usage
|
|
4
|
-
|
|
5
|
-
### To build
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm run build
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
### Development
|
|
12
|
-
|
|
13
|
-
To run this module for development clone the repo and run
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install
|
|
17
|
-
npm run demo
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Sign in to Studio with a Studio UI (Marketing Studio) enabled account. If necessary, click the Profile icon and then the Switch to Studio link.
|
|
21
|
-
|
|
22
|
-
Navigate to [https://studio.brightcove.com/products/videocloud/media/dev/sdk:remote](https://studio.brightcove.com/products/videocloud/media/dev/sdk:remote).
|
|
23
|
-
|
|
24
|
-
The App runs at [https://localhost.brightcove.com:12345/js/app.js](https://localhost.brightcove.com:12345/js/app.js) as described in [Creating a Module](https://brightcove.atlassian.net/wiki/spaces/APPS/pages/2287471973/Creating+A+Module#How-does-that-dev%2Fsdk%3Aremote-URL-work%3F)
|
|
25
|
-
|
|
26
|
-
The results of the API call to retrieve players will depend on sign in permissions.
|
|
27
|
-
|
|
28
|
-
## Integrating with modules
|
|
29
|
-
|
|
30
|
-
This component was built for Marketing Studio modules, such as: [studio-media-module-four](https://bithub.brightcove.com/studio/studio-module-media-four).
|
|
31
|
-
|
|
32
|
-
Below you will find instructions on how to use the component inside of these modules.
|
|
33
|
-
|
|
34
|
-
#### Install the package
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
npm i @brightcove/components-embed-code-modal
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
#### Import the component and required types
|
|
41
|
-
|
|
42
|
-
```ts
|
|
43
|
-
import {
|
|
44
|
-
EmbedCodeModal,
|
|
45
|
-
VideoPayload,
|
|
46
|
-
} from '@brightcove/components-embed-code-modal';
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
`VideoPayload` is a TypeScript interface which describes an Object that will be accepted as a prop for your `<EmbedCodeModal>` component.
|
|
50
|
-
|
|
51
|
-
Here is an overview of the `VideoPayload` interface:
|
|
52
|
-
|
|
53
|
-
```ts
|
|
54
|
-
videoId: string; // Video id, required
|
|
55
|
-
videoName: string; // Video title, required
|
|
56
|
-
accountId: string; // BC account id, required
|
|
57
|
-
posterUrl?: string; // Video poster url, not required
|
|
58
|
-
duration: number; // Video duration in seconds, required
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
#### Component Props
|
|
62
|
-
|
|
63
|
-
The component currently takes in two props:
|
|
64
|
-
|
|
65
|
-
```ts
|
|
66
|
-
language?: 'en' | 'es' | 'fr' | 'ko' | 'ja' | 'zh';
|
|
67
|
-
video: VideoPayload;
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
- The `VideoPayload` interface is exported by the component.
|
|
71
|
-
- The `language` prop is optional, if not passed, the component will get the language from `StudioModule.config.lang`. Currently, we use this for testing in our local sandbox.
|
|
72
|
-
|
|
73
|
-
#### Wiring Up Through the Module
|
|
74
|
-
|
|
75
|
-
The modal will only render once the `video` prop has been passed into the `EmbedCodeModal` component.
|
|
76
|
-
|
|
77
|
-
In order to keep our components fully decoupled, we look to our parent module's for wiring up our components together.
|
|
78
|
-
|
|
79
|
-
Here's an example of how the the Media Module's VideoLibrary is wiring up two separate components in order to open the EmbedCodeModal:
|
|
80
|
-
|
|
81
|
-
```ts
|
|
82
|
-
const [embedVideo, setEmbedVideo] = useState<VideoPayload>(null);
|
|
83
|
-
|
|
84
|
-
const handleAction = (event: DataGridAction) => {
|
|
85
|
-
if (event.type === DataGridEvents.GetCode) {
|
|
86
|
-
// build VideoPayload for EmbedCodeModal component here
|
|
87
|
-
// this way we are completely de-coupling the EmbedCodeModal from the module
|
|
88
|
-
const { payload: video } = event;
|
|
89
|
-
setEmbedVideo({
|
|
90
|
-
videoId: video.id,
|
|
91
|
-
videoName: video.name,
|
|
92
|
-
accountId: video.account_id,
|
|
93
|
-
posterUrl: video?.images?.poster?.src,
|
|
94
|
-
duration: video.duration,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
1. The Media Module imports both the `DataGrid` & `EmbedCodeModal` components. Neither component are coded to be aware of the other.
|
|
101
|
-
2. The `DataGrid` component dispatches the `GetCode` action to tell its parent module: _I would like to retrieve some code, go and do that, however your module handles this action_.
|
|
102
|
-
3. The Media Module handles this action by creating a new payload with the video information handed off by the DataGrid. It knows that it wants to open the EmbedCodeModal, so it will look to the `VideoPayload` interface to create what it needs.
|
|
103
|
-
4. This video object is set to the module's local state.
|
|
104
|
-
5. Within our JSX, our EmbedCodeModal should be passing this video object to the component: `<EmbedCodeModal video={embedVideo} />`
|
|
105
|
-
6. Anytime that `embedVideo` updates in the module - it triggers the Embed Code Modal to open.
|
|
106
|
-
|
|
107
|
-
The reasons we have wired things up this way has been to achieve our goals of keeping micro-frontends decoupled. The EmbedCodeModal & the DataGrid are not interacting directly with each other. The DataGrid is providing video data that is being used, but when it triggers a `Get Code` event, it can just send an entire Video Object along with it. It doesn't need to know exactly what information the Embed Code Modal needs in order to successfully operate.
|
|
108
|
-
|
|
109
|
-
Likewise, the Embed Code Modal could be triggered by any other number of interfaces, and this abstraction helps us better prepare for the integrations coming in our future.
|