@brightcove/components-embed-code-modal 1.1.0 → 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.
Files changed (187) hide show
  1. package/__tests__/PrismPlayerControls.test.d.ts +2 -0
  2. package/__tests__/PrismPlayerControls.test.d.ts.map +1 -0
  3. package/{build/index.js → index.js} +1 -1
  4. package/index.js.map +1 -0
  5. package/package.json +5 -15
  6. package/{build/src → src}/js/components/prism/PrismPlayerControls.d.ts.map +1 -1
  7. package/.eslintignore +0 -7
  8. package/.eslintrc +0 -23
  9. package/.github/workflows/ci.yml +0 -23
  10. package/.husky/pre-commit +0 -4
  11. package/.nvmrc +0 -1
  12. package/.prettierignore +0 -7
  13. package/.prettierrc +0 -5
  14. package/.release-it.json +0 -40
  15. package/.whitesource +0 -3
  16. package/CHANGELOG.md +0 -398
  17. package/CODEOWNERS +0 -37
  18. package/PULL_REQUEST_TEMPLATE.md +0 -17
  19. package/__tests__/EmbedCode.test.tsx +0 -51
  20. package/__tests__/InteractivityProject.test.tsx +0 -50
  21. package/__tests__/PlayerPreview.test.tsx +0 -23
  22. package/__tests__/PrismPlayerPreview.test.tsx +0 -168
  23. package/__tests__/TabsHeader.test.tsx +0 -19
  24. package/__tests__/TabsSection.test.tsx +0 -46
  25. package/__tests__/TitleWithTooltip.test.tsx +0 -45
  26. package/__tests__/VideoPlayer.test.tsx +0 -38
  27. package/__tests__/embedCodeGenerator.test.ts +0 -111
  28. package/__tests__/util.test.ts +0 -89
  29. package/babel.config.json +0 -17
  30. package/build/README.md +0 -109
  31. package/build/index.js.map +0 -1
  32. package/build/package.json +0 -100
  33. package/etc/wildcard.brightcove.com.key +0 -27
  34. package/etc/wildcard.brightcove.com.pem +0 -96
  35. package/jest/jest.setup.js +0 -90
  36. package/jest/jest.stub.js +0 -4
  37. package/jest.config.js +0 -24
  38. package/scripts/create-dist-pkg-prod.js +0 -18
  39. package/src/index.ts +0 -17
  40. package/src/js/EmbedCodeModal.tsx +0 -105
  41. package/src/js/components/CustomSettingsDropdown.tsx +0 -184
  42. package/src/js/components/EmbedCopySection.tsx +0 -130
  43. package/src/js/components/ModalContainer.tsx +0 -367
  44. package/src/js/components/NoPlayerModal.tsx +0 -42
  45. package/src/js/components/PlayerPreview.tsx +0 -116
  46. package/src/js/components/TabsHeader.tsx +0 -31
  47. package/src/js/components/TabsSection.tsx +0 -74
  48. package/src/js/components/TitleWithTooltip.tsx +0 -39
  49. package/src/js/components/VideoLinks.tsx +0 -83
  50. package/src/js/components/VideoPlayer.tsx +0 -324
  51. package/src/js/components/index.ts +0 -9
  52. package/src/js/components/prism/PrismLiveModal.tsx +0 -162
  53. package/src/js/components/prism/PrismPlayerControls.tsx +0 -343
  54. package/src/js/components/prism/PrismPlayerPreview.tsx +0 -188
  55. package/src/js/components/prism/index.ts +0 -3
  56. package/src/js/constants/baseUrls.ts +0 -4
  57. package/src/js/constants/embed.ts +0 -12
  58. package/src/js/constants/player.ts +0 -32
  59. package/src/js/constants/pluginsRegistry.ts +0 -30
  60. package/src/js/hooks/useGetPlayers.ts +0 -12
  61. package/src/js/i18n.ts +0 -43
  62. package/src/js/services/players-api.ts +0 -26
  63. package/src/js/services/url-shortener.ts +0 -10
  64. package/src/js/types/EmbedCodeModalProps.ts +0 -72
  65. package/src/js/types/EmbedCodeProps.ts +0 -13
  66. package/src/js/types/brightcoveEmbedCode.d.ts +0 -18
  67. package/src/js/types/players.ts +0 -64
  68. package/src/js/types/react-i18next.d.ts +0 -8
  69. package/src/js/types/studioModule.ts +0 -7
  70. package/src/js/utils/addPluginsDataToPlayers.ts +0 -59
  71. package/src/js/utils/call.ts +0 -31
  72. package/src/js/utils/dimensions.ts +0 -53
  73. package/src/js/utils/embedCodeGenerator.ts +0 -120
  74. package/src/js/utils/featureSwitches.ts +0 -16
  75. package/src/js/utils/util.ts +0 -153
  76. package/src/module.tsx +0 -280
  77. package/src/styles/CustomSettingsDropdown.sass +0 -42
  78. package/src/styles/EmbedCode.sass +0 -30
  79. package/src/styles/EmbedCodeModal.sass +0 -76
  80. package/src/styles/base.sass +0 -1
  81. package/src/styles/prism/PrismLiveModal.sass +0 -155
  82. package/src/styles/theme.sass +0 -11
  83. package/src/styles/typings.td.ts +0 -9
  84. package/src/translations/en.json +0 -65
  85. package/src/translations/es.json +0 -65
  86. package/src/translations/fr.json +0 -65
  87. package/src/translations/ja.json +0 -65
  88. package/src/translations/ko.json +0 -65
  89. package/src/translations/zh.json +0 -65
  90. package/src/types/studio.ts +0 -197
  91. package/tsconfig.json +0 -34
  92. package/webpack.config.js +0 -117
  93. /package/{build/__tests__ → __tests__}/EmbedCode.test.d.ts +0 -0
  94. /package/{build/__tests__ → __tests__}/EmbedCode.test.d.ts.map +0 -0
  95. /package/{build/__tests__ → __tests__}/InteractivityProject.test.d.ts +0 -0
  96. /package/{build/__tests__ → __tests__}/InteractivityProject.test.d.ts.map +0 -0
  97. /package/{build/__tests__ → __tests__}/PlayerPreview.test.d.ts +0 -0
  98. /package/{build/__tests__ → __tests__}/PlayerPreview.test.d.ts.map +0 -0
  99. /package/{build/__tests__ → __tests__}/PrismPlayerPreview.test.d.ts +0 -0
  100. /package/{build/__tests__ → __tests__}/PrismPlayerPreview.test.d.ts.map +0 -0
  101. /package/{build/__tests__ → __tests__}/TabsHeader.test.d.ts +0 -0
  102. /package/{build/__tests__ → __tests__}/TabsHeader.test.d.ts.map +0 -0
  103. /package/{build/__tests__ → __tests__}/TabsSection.test.d.ts +0 -0
  104. /package/{build/__tests__ → __tests__}/TabsSection.test.d.ts.map +0 -0
  105. /package/{build/__tests__ → __tests__}/TitleWithTooltip.test.d.ts +0 -0
  106. /package/{build/__tests__ → __tests__}/TitleWithTooltip.test.d.ts.map +0 -0
  107. /package/{build/__tests__ → __tests__}/VideoPlayer.test.d.ts +0 -0
  108. /package/{build/__tests__ → __tests__}/VideoPlayer.test.d.ts.map +0 -0
  109. /package/{build/__tests__ → __tests__}/embedCodeGenerator.test.d.ts +0 -0
  110. /package/{build/__tests__ → __tests__}/embedCodeGenerator.test.d.ts.map +0 -0
  111. /package/{build/__tests__ → __tests__}/util.test.d.ts +0 -0
  112. /package/{build/__tests__ → __tests__}/util.test.d.ts.map +0 -0
  113. /package/{build/src → src}/index.d.ts +0 -0
  114. /package/{build/src → src}/index.d.ts.map +0 -0
  115. /package/{build/src → src}/js/EmbedCodeModal.d.ts +0 -0
  116. /package/{build/src → src}/js/EmbedCodeModal.d.ts.map +0 -0
  117. /package/{build/src → src}/js/components/CustomSettingsDropdown.d.ts +0 -0
  118. /package/{build/src → src}/js/components/CustomSettingsDropdown.d.ts.map +0 -0
  119. /package/{build/src → src}/js/components/EmbedCopySection.d.ts +0 -0
  120. /package/{build/src → src}/js/components/EmbedCopySection.d.ts.map +0 -0
  121. /package/{build/src → src}/js/components/ModalContainer.d.ts +0 -0
  122. /package/{build/src → src}/js/components/ModalContainer.d.ts.map +0 -0
  123. /package/{build/src → src}/js/components/NoPlayerModal.d.ts +0 -0
  124. /package/{build/src → src}/js/components/NoPlayerModal.d.ts.map +0 -0
  125. /package/{build/src → src}/js/components/PlayerPreview.d.ts +0 -0
  126. /package/{build/src → src}/js/components/PlayerPreview.d.ts.map +0 -0
  127. /package/{build/src → src}/js/components/TabsHeader.d.ts +0 -0
  128. /package/{build/src → src}/js/components/TabsHeader.d.ts.map +0 -0
  129. /package/{build/src → src}/js/components/TabsSection.d.ts +0 -0
  130. /package/{build/src → src}/js/components/TabsSection.d.ts.map +0 -0
  131. /package/{build/src → src}/js/components/TitleWithTooltip.d.ts +0 -0
  132. /package/{build/src → src}/js/components/TitleWithTooltip.d.ts.map +0 -0
  133. /package/{build/src → src}/js/components/VideoLinks.d.ts +0 -0
  134. /package/{build/src → src}/js/components/VideoLinks.d.ts.map +0 -0
  135. /package/{build/src → src}/js/components/VideoPlayer.d.ts +0 -0
  136. /package/{build/src → src}/js/components/VideoPlayer.d.ts.map +0 -0
  137. /package/{build/src → src}/js/components/index.d.ts +0 -0
  138. /package/{build/src → src}/js/components/index.d.ts.map +0 -0
  139. /package/{build/src → src}/js/components/prism/PrismLiveModal.d.ts +0 -0
  140. /package/{build/src → src}/js/components/prism/PrismLiveModal.d.ts.map +0 -0
  141. /package/{build/src → src}/js/components/prism/PrismPlayerControls.d.ts +0 -0
  142. /package/{build/src → src}/js/components/prism/PrismPlayerPreview.d.ts +0 -0
  143. /package/{build/src → src}/js/components/prism/PrismPlayerPreview.d.ts.map +0 -0
  144. /package/{build/src → src}/js/components/prism/index.d.ts +0 -0
  145. /package/{build/src → src}/js/components/prism/index.d.ts.map +0 -0
  146. /package/{build/src → src}/js/constants/baseUrls.d.ts +0 -0
  147. /package/{build/src → src}/js/constants/baseUrls.d.ts.map +0 -0
  148. /package/{build/src → src}/js/constants/embed.d.ts +0 -0
  149. /package/{build/src → src}/js/constants/embed.d.ts.map +0 -0
  150. /package/{build/src → src}/js/constants/player.d.ts +0 -0
  151. /package/{build/src → src}/js/constants/player.d.ts.map +0 -0
  152. /package/{build/src → src}/js/constants/pluginsRegistry.d.ts +0 -0
  153. /package/{build/src → src}/js/constants/pluginsRegistry.d.ts.map +0 -0
  154. /package/{build/src → src}/js/hooks/useGetPlayers.d.ts +0 -0
  155. /package/{build/src → src}/js/hooks/useGetPlayers.d.ts.map +0 -0
  156. /package/{build/src → src}/js/i18n.d.ts +0 -0
  157. /package/{build/src → src}/js/i18n.d.ts.map +0 -0
  158. /package/{build/src → src}/js/services/players-api.d.ts +0 -0
  159. /package/{build/src → src}/js/services/players-api.d.ts.map +0 -0
  160. /package/{build/src → src}/js/services/url-shortener.d.ts +0 -0
  161. /package/{build/src → src}/js/services/url-shortener.d.ts.map +0 -0
  162. /package/{build/src → src}/js/types/EmbedCodeModalProps.d.ts +0 -0
  163. /package/{build/src → src}/js/types/EmbedCodeModalProps.d.ts.map +0 -0
  164. /package/{build/src → src}/js/types/EmbedCodeProps.d.ts +0 -0
  165. /package/{build/src → src}/js/types/EmbedCodeProps.d.ts.map +0 -0
  166. /package/{build/src → src}/js/types/players.d.ts +0 -0
  167. /package/{build/src → src}/js/types/players.d.ts.map +0 -0
  168. /package/{build/src → src}/js/types/studioModule.d.ts +0 -0
  169. /package/{build/src → src}/js/types/studioModule.d.ts.map +0 -0
  170. /package/{build/src → src}/js/utils/addPluginsDataToPlayers.d.ts +0 -0
  171. /package/{build/src → src}/js/utils/addPluginsDataToPlayers.d.ts.map +0 -0
  172. /package/{build/src → src}/js/utils/call.d.ts +0 -0
  173. /package/{build/src → src}/js/utils/call.d.ts.map +0 -0
  174. /package/{build/src → src}/js/utils/dimensions.d.ts +0 -0
  175. /package/{build/src → src}/js/utils/dimensions.d.ts.map +0 -0
  176. /package/{build/src → src}/js/utils/embedCodeGenerator.d.ts +0 -0
  177. /package/{build/src → src}/js/utils/embedCodeGenerator.d.ts.map +0 -0
  178. /package/{build/src → src}/js/utils/featureSwitches.d.ts +0 -0
  179. /package/{build/src → src}/js/utils/featureSwitches.d.ts.map +0 -0
  180. /package/{build/src → src}/js/utils/util.d.ts +0 -0
  181. /package/{build/src → src}/js/utils/util.d.ts.map +0 -0
  182. /package/{build/src → src}/module.d.ts +0 -0
  183. /package/{build/src → src}/module.d.ts.map +0 -0
  184. /package/{build/src → src}/styles/typings.td.d.ts +0 -0
  185. /package/{build/src → src}/styles/typings.td.d.ts.map +0 -0
  186. /package/{build/src → src}/types/studio.d.ts +0 -0
  187. /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.