@brightcove/components-embed-code-modal 0.8.1 → 0.8.3

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 (164) hide show
  1. package/.eslintignore +7 -0
  2. package/.eslintrc +23 -0
  3. package/.husky/pre-commit +4 -0
  4. package/.nvmrc +1 -0
  5. package/.prettierignore +7 -0
  6. package/.prettierrc +5 -0
  7. package/.release-it.json +40 -0
  8. package/.whitesource +3 -0
  9. package/CHANGELOG.md +342 -0
  10. package/CODEOWNERS +37 -0
  11. package/PULL_REQUEST_TEMPLATE.md +17 -0
  12. package/__tests__/EmbedCode.test.tsx +51 -0
  13. package/__tests__/InteractivityProject.test.tsx +50 -0
  14. package/__tests__/PlayerPreview.test.tsx +23 -0
  15. package/__tests__/TabsHeader.test.tsx +19 -0
  16. package/__tests__/TabsSection.test.tsx +46 -0
  17. package/__tests__/TitleWithTooltip.test.tsx +45 -0
  18. package/__tests__/VideoPlayer.test.tsx +38 -0
  19. package/__tests__/util.test.ts +89 -0
  20. package/babel.config.json +17 -0
  21. package/etc/wildcard.brightcove.com.key +27 -0
  22. package/etc/wildcard.brightcove.com.pem +96 -0
  23. package/jest/jest.setup.js +62 -0
  24. package/jest/jest.stub.js +4 -0
  25. package/jest.config.js +24 -0
  26. package/package.json +15 -5
  27. package/scripts/create-dist-pkg-prod.js +18 -0
  28. package/src/index.ts +16 -0
  29. package/src/js/EmbedCodeModal.tsx +88 -0
  30. package/src/js/components/CustomSettingsDropdown.tsx +184 -0
  31. package/src/js/components/EmbedCopySection.tsx +130 -0
  32. package/src/js/components/ModalContainer.tsx +274 -0
  33. package/src/js/components/NoPlayerModal.tsx +42 -0
  34. package/src/js/components/PlayerPreview.tsx +116 -0
  35. package/src/js/components/TabsHeader.tsx +31 -0
  36. package/src/js/components/TabsSection.tsx +74 -0
  37. package/src/js/components/TitleWithTooltip.tsx +39 -0
  38. package/src/js/components/VideoLinks.tsx +83 -0
  39. package/src/js/components/VideoPlayer.tsx +303 -0
  40. package/src/js/components/{index.d.ts → index.ts} +0 -1
  41. package/src/js/constants/baseUrls.ts +4 -0
  42. package/src/js/constants/embed.ts +12 -0
  43. package/src/js/constants/player.ts +32 -0
  44. package/src/js/constants/pluginsRegistry.ts +30 -0
  45. package/src/js/hooks/useGetPlayers.ts +12 -0
  46. package/src/js/i18n.ts +43 -0
  47. package/src/js/services/players-api.ts +26 -0
  48. package/src/js/services/url-shortener.ts +10 -0
  49. package/src/js/types/EmbedCodeModalProps.ts +72 -0
  50. package/src/js/types/EmbedCodeProps.ts +13 -0
  51. package/src/js/types/brightcoveEmbedCode.d.ts +18 -0
  52. package/src/js/types/players.ts +64 -0
  53. package/src/js/types/react-i18next.d.ts +8 -0
  54. package/src/js/types/studioModule.ts +7 -0
  55. package/src/js/utils/addPluginsDataToPlayers.ts +59 -0
  56. package/src/js/utils/call.ts +31 -0
  57. package/src/js/utils/dimensions.ts +53 -0
  58. package/src/js/utils/featureSwitches.ts +16 -0
  59. package/src/js/utils/util.ts +153 -0
  60. package/src/module.tsx +246 -0
  61. package/src/styles/CustomSettingsDropdown.sass +42 -0
  62. package/src/styles/EmbedCode.sass +30 -0
  63. package/src/styles/EmbedCodeModal.sass +76 -0
  64. package/src/styles/base.sass +1 -0
  65. package/src/styles/theme.sass +11 -0
  66. package/src/styles/typings.td.ts +9 -0
  67. package/src/translations/en.json +53 -0
  68. package/src/translations/es.json +53 -0
  69. package/src/translations/fr.json +53 -0
  70. package/src/translations/ja.json +53 -0
  71. package/src/translations/ko.json +53 -0
  72. package/src/translations/zh.json +53 -0
  73. package/src/types/studio.ts +197 -0
  74. package/tsconfig.json +34 -0
  75. package/webpack.config.js +97 -0
  76. package/__tests__/EmbedCode.test.d.ts +0 -2
  77. package/__tests__/EmbedCode.test.d.ts.map +0 -1
  78. package/__tests__/InteractivityProject.test.d.ts +0 -2
  79. package/__tests__/InteractivityProject.test.d.ts.map +0 -1
  80. package/__tests__/PlayerPreview.test.d.ts +0 -2
  81. package/__tests__/PlayerPreview.test.d.ts.map +0 -1
  82. package/__tests__/PlayersDropdown.test.d.ts +0 -2
  83. package/__tests__/PlayersDropdown.test.d.ts.map +0 -1
  84. package/__tests__/TabsHeader.test.d.ts +0 -2
  85. package/__tests__/TabsHeader.test.d.ts.map +0 -1
  86. package/__tests__/TabsSection.test.d.ts +0 -2
  87. package/__tests__/TabsSection.test.d.ts.map +0 -1
  88. package/__tests__/TitleWithTooltip.test.d.ts +0 -2
  89. package/__tests__/TitleWithTooltip.test.d.ts.map +0 -1
  90. package/__tests__/VideoPlayer.test.d.ts +0 -2
  91. package/__tests__/VideoPlayer.test.d.ts.map +0 -1
  92. package/__tests__/util.test.d.ts +0 -2
  93. package/__tests__/util.test.d.ts.map +0 -1
  94. package/index.js +0 -56
  95. package/index.js.map +0 -1
  96. package/src/index.d.ts +0 -5
  97. package/src/index.d.ts.map +0 -1
  98. package/src/js/EmbedCodeModal.d.ts +0 -17
  99. package/src/js/EmbedCodeModal.d.ts.map +0 -1
  100. package/src/js/components/ActivateInteractivityModal.d.ts +0 -3
  101. package/src/js/components/ActivateInteractivityModal.d.ts.map +0 -1
  102. package/src/js/components/CustomSettingsDropdown.d.ts +0 -11
  103. package/src/js/components/CustomSettingsDropdown.d.ts.map +0 -1
  104. package/src/js/components/EmbedCopySection.d.ts +0 -4
  105. package/src/js/components/EmbedCopySection.d.ts.map +0 -1
  106. package/src/js/components/ModalContainer.d.ts +0 -17
  107. package/src/js/components/ModalContainer.d.ts.map +0 -1
  108. package/src/js/components/NoPlayerModal.d.ts +0 -8
  109. package/src/js/components/NoPlayerModal.d.ts.map +0 -1
  110. package/src/js/components/PlayerPreview.d.ts +0 -4
  111. package/src/js/components/PlayerPreview.d.ts.map +0 -1
  112. package/src/js/components/PlayersDropdown.d.ts +0 -9
  113. package/src/js/components/PlayersDropdown.d.ts.map +0 -1
  114. package/src/js/components/TabsHeader.d.ts +0 -11
  115. package/src/js/components/TabsHeader.d.ts.map +0 -1
  116. package/src/js/components/TabsSection.d.ts +0 -15
  117. package/src/js/components/TabsSection.d.ts.map +0 -1
  118. package/src/js/components/TitleWithTooltip.d.ts +0 -8
  119. package/src/js/components/TitleWithTooltip.d.ts.map +0 -1
  120. package/src/js/components/VideoLinks.d.ts +0 -9
  121. package/src/js/components/VideoLinks.d.ts.map +0 -1
  122. package/src/js/components/VideoPlayer.d.ts +0 -17
  123. package/src/js/components/VideoPlayer.d.ts.map +0 -1
  124. package/src/js/components/index.d.ts.map +0 -1
  125. package/src/js/constants/baseUrls.d.ts +0 -5
  126. package/src/js/constants/baseUrls.d.ts.map +0 -1
  127. package/src/js/constants/embed.d.ts +0 -9
  128. package/src/js/constants/embed.d.ts.map +0 -1
  129. package/src/js/constants/player.d.ts +0 -27
  130. package/src/js/constants/player.d.ts.map +0 -1
  131. package/src/js/constants/pluginsRegistry.d.ts +0 -7
  132. package/src/js/constants/pluginsRegistry.d.ts.map +0 -1
  133. package/src/js/hooks/useGetPlayers.d.ts +0 -3
  134. package/src/js/hooks/useGetPlayers.d.ts.map +0 -1
  135. package/src/js/i18n.d.ts +0 -330
  136. package/src/js/i18n.d.ts.map +0 -1
  137. package/src/js/services/players-api.d.ts +0 -5
  138. package/src/js/services/players-api.d.ts.map +0 -1
  139. package/src/js/services/url-shortener.d.ts +0 -4
  140. package/src/js/services/url-shortener.d.ts.map +0 -1
  141. package/src/js/types/EmbedCodeModalProps.d.ts +0 -59
  142. package/src/js/types/EmbedCodeModalProps.d.ts.map +0 -1
  143. package/src/js/types/EmbedCodeProps.d.ts +0 -13
  144. package/src/js/types/EmbedCodeProps.d.ts.map +0 -1
  145. package/src/js/types/players.d.ts +0 -58
  146. package/src/js/types/players.d.ts.map +0 -1
  147. package/src/js/types/studioModule.d.ts +0 -8
  148. package/src/js/types/studioModule.d.ts.map +0 -1
  149. package/src/js/utils/addPluginsDataToPlayers.d.ts +0 -6
  150. package/src/js/utils/addPluginsDataToPlayers.d.ts.map +0 -1
  151. package/src/js/utils/call.d.ts +0 -14
  152. package/src/js/utils/call.d.ts.map +0 -1
  153. package/src/js/utils/dimensions.d.ts +0 -9
  154. package/src/js/utils/dimensions.d.ts.map +0 -1
  155. package/src/js/utils/featureSwitches.d.ts +0 -2
  156. package/src/js/utils/featureSwitches.d.ts.map +0 -1
  157. package/src/js/utils/util.d.ts +0 -67
  158. package/src/js/utils/util.d.ts.map +0 -1
  159. package/src/module.d.ts +0 -2
  160. package/src/module.d.ts.map +0 -1
  161. package/src/styles/typings.td.d.ts +0 -13
  162. package/src/styles/typings.td.d.ts.map +0 -1
  163. package/src/types/studio.d.ts +0 -202
  164. package/src/types/studio.d.ts.map +0 -1
package/.eslintignore ADDED
@@ -0,0 +1,7 @@
1
+ # node_modules, root dot file and folders are always ignored
2
+ build/*
3
+ scripts/*
4
+ *.config.*
5
+ package.json
6
+ package-lock.json
7
+ .*
package/.eslintrc ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "extends": [
3
+ "@brightcove/eslint-config-applications",
4
+ "@brightcove/eslint-config-applications/react",
5
+ "plugin:@typescript-eslint/recommended",
6
+ "plugin:import/typescript",
7
+ "plugin:react-hooks/recommended",
8
+ "prettier"
9
+ ],
10
+ "rules": {
11
+ "react-hooks/rules-of-hooks": "warn",
12
+ "react-hooks/exhaustive-deps": "warn"
13
+ },
14
+ "parser": "@typescript-eslint/parser",
15
+ "parserOptions": {
16
+ "ecmaVersion": 2020
17
+ } ,
18
+ "settings": {
19
+ "react": {
20
+ "version": "detect"
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ npm run pre-commit
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ v22.9.0
@@ -0,0 +1,7 @@
1
+ build/*
2
+ scripts/*
3
+ node_modules/*
4
+ *.config.*
5
+ package.json
6
+ package-lock.json
7
+ CODEOWNERS
package/.prettierrc ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "singleQuote": true,
3
+ "jsxSingleQuote": true,
4
+ "trailingComma": "all"
5
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "hooks": {
3
+ "before:init": ["npm run lint", "npm install --legacy-peer-deps", "kacl prerelease"],
4
+ "after:bump": ["kacl release", "npm run build"],
5
+ "after:release": ["npm run notify", "echo Successfully released ${name} v${version} to ${repo.repository}."]
6
+ },
7
+ "git": {
8
+ "changelog": "git log --pretty=format:\"* %s (%h)\" ${latestTag}...HEAD",
9
+ "requireCleanWorkingDir": false,
10
+ "requireUpstream": false,
11
+ "requireCommits": true,
12
+ "addUntrackedFiles": false,
13
+ "commit": true,
14
+ "commitMessage": "Release v${version}",
15
+ "commitArgs": "",
16
+ "tag": true,
17
+ "tagName": "v${version}",
18
+ "tagAnnotation": "Release v${version}",
19
+ "tagArgs": "",
20
+ "push": true,
21
+ "pushArgs": "--follow-tags",
22
+ "pushRepo": "origin"
23
+ },
24
+ "github": {
25
+ "release": true,
26
+ "releaseName": "v${version}",
27
+ "releaseNotes": null,
28
+ "preRelease": false,
29
+ "draft": false,
30
+ "tokenRef": "GITHUB_TOKEN",
31
+ "assets": [],
32
+ "host": null,
33
+ "timeout": 0,
34
+ "proxy": null
35
+ },
36
+ "npm": {
37
+ "publish": true,
38
+ "publishPath": "./build"
39
+ }
40
+ }
package/.whitesource ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "settingsInheritedFrom": "whitesource-config/whitesource-config@master"
3
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,342 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+ ### Changed
10
+ - [PLAYCUST-3043](https://brightcove.atlassian.net/browse/PLAYCUST-3043) Update to node v22.9.0
11
+
12
+ ## [0.8.2] - 2024-10-31
13
+ ### Added
14
+ - [PLAYCUST-2953](https://brightcove.atlassian.net/browse/PLAYCUST-2953) Add translations
15
+
16
+ ## [0.8.1] - 2024-10-22
17
+ ### Fixed
18
+ - [PLAYCUST-3157](https://brightcove.atlassian.net/browse/PLAYCUST-3157) Fix dvr default state and render logic
19
+
20
+ ## [0.8.0] - 2024-10-21
21
+ ### Added
22
+ - [PLAYCUST-3157](https://brightcove.atlassian.net/browse/PLAYCUST-3157) Add support for low latency
23
+
24
+ ## [0.7.2] - 2024-10-03
25
+ ### Added
26
+ - [PLAYCUST-3082](https://brightcove.atlassian.net/browse/PLAYCUST-3082) Update Embed Code Modal Library in Live 2.0
27
+
28
+ ## [0.7.1] - 2024-09-24
29
+ ### Fixed
30
+ - [PLAYCUST-2882](https://brightcove.atlassian.net/browse/PLAYCUST-2882) Fix iframe embed code aspect ratio padding
31
+
32
+ ## [0.7.1] - 2024-09-24
33
+ ### Fixed
34
+ - [PLAYCUST-2937](https://brightcove.atlassian.net/browse/PLAYCUST-2937) playerListForSelection breaking the module when being an empty array
35
+
36
+ ## [0.7.0] - 2024-09-23
37
+ ### Added
38
+ - [PLAYCUST-2938](https://brightcove.atlassian.net/browse/PLAYCUST-2938) Add DVR livePlaybackToken option
39
+
40
+ ## [0.6.0] - 2024-08-14
41
+ ### Added
42
+ - [PLAYCUST-2595](https://brightcove.atlassian.net/browse/PLAYCUST-2595) Display custom settings for Project type
43
+
44
+ ### Fixed
45
+ - [PLAYCUST-2595](https://brightcove.atlassian.net/browse/PLAYCUST-2595) Horizontal scroll getting displayed when expanding custom settings section
46
+ - [PLAYCUST-2584](https://brightcove.atlassian.net/browse/PLAYCUST-2584) Use correct aspect ratio class
47
+
48
+ ## [0.5.1] - 2024-07-22
49
+ ### Fixed
50
+ - [PLAYCUST-2799](https://brightcove.atlassian.net/browse/PLAYCUST-2799) Disable iframe for MAPs enabled player
51
+
52
+ ## [0.5.0] - 2024-04-17
53
+ ### Changed
54
+ - [PLAYCUST-2449](https://brightcove.atlassian.net/browse/PLAYCUST-2449) Remove Player Preview and links when player is of type outstream
55
+
56
+ ### Fixed
57
+ - [PLAYCUST-2455](https://brightcove.atlassian.net/browse/PLAYCUST-2455) Fix viewer ID tracking validation
58
+
59
+ ## [0.4.4] - 2024-03-29
60
+ ### Added
61
+ - [PLAYCUST-2249](https://brightcove.atlassian.net/browse/PLAYCUST-2249) Support for interactivityProjectId
62
+
63
+ ## [0.4.3] - 2024-03-29
64
+ ### Added
65
+ - [PLAYCUST-2368](https://brightcove.atlassian.net/browse/PLAYCUST-2368) Disable iframe publish for Viewer ID Tracking
66
+ - [PLAYCUST-2249](https://brightcove.atlassian.net/browse/PLAYCUST-2249) Player select component
67
+
68
+ ## [0.4.2] - 2023-12-29
69
+ ### Fixed
70
+ - [PLAYCUST-2002](https://brightcove.atlassian.net/browse/PLAYCUST-2002) Demo site not working
71
+
72
+ ## [0.4.1] - 2023-11-24
73
+ ### Fixed
74
+ - [PLAYCUST-2050](https://brightcove.atlassian.net/browse/PLAYCUST-2050) Fix Javascript tab crash
75
+
76
+ ## [0.4.0] - 2023-11-02
77
+ ### Added
78
+ - [PLAYCUST-1941](https://brightcove.atlassian.net/browse/PLAYCUST-1941) Preselect favorite player in Video Embed
79
+ - [PLAYCUST-1946](https://brightcove.atlassian.net/browse/PLAYCUST-1946) Custom settings dropdown for TYPE VIDEO
80
+
81
+ ### Changed
82
+ - [PLAYCUST-1469](https://brightcove.atlassian.net/browse/PLAYCUST-1469) `preview` link from Player Type now redirects to preview-players.brightcove.net
83
+
84
+ ## [0.3.7] - 2023-09-18
85
+ ### Added
86
+ - [PLAYCUST-1947](https://brightcove.atlassian.net/browse/PLAYCUST-1947)`embedCodeProperties` prop for the Embed Code generation
87
+
88
+ ## [0.3.6] - 2023-07-19
89
+ ### Fixed
90
+ - [PLAYCUST-1720](https://brightcove.atlassian.net/browse/PLAYCUST-1720) Fix typography for iframe text from `iFrame` to `iframe`
91
+ - [PLAYCUST-1899](https://brightcove.atlassian.net/browse/PLAYCUST-1899) Create player with v2 interactivity plugin
92
+
93
+ ## [0.3.5] - 2023-04-19
94
+ ### Changed
95
+ - [PLAYCUST-1618](https://brightcove.atlassian.net/browse/PLAYCUST-1618) [BREAKING] Change prop name from `playerPayload` to `data`
96
+
97
+ ## [0.3.4] - 2023-03-23
98
+ ### Fixed
99
+ - Internal: Updated peerDependencies
100
+
101
+ ## [0.3.3] - 2023-03-23
102
+ ### Fixed
103
+ - [PLAYCUST-1648](https://brightcove.atlassian.net/browse/PLAYCUST-1648) Project Player Preview when player has been created
104
+
105
+ ## [0.3.2] - 2023-03-07
106
+ ### Fixed
107
+ - [PLAYCUST-1637](https://brightcove.atlassian.net/browse/PLAYCUST-1637) Fixed Project Player Preview
108
+ - [PLAYCUST-1624](https://brightcove.atlassian.net/browse/PLAYCUST-1624) Update no player modal text to reference players module
109
+
110
+ ## [0.3.1] - 2023-03-02
111
+ ### Fixed
112
+ - [PLAYCUST-1625](https://brightcove.atlassian.net/browse/PLAYCUST-1625) Check for Interactivity Plugin using Registry ID OR Name
113
+
114
+ ## [0.3.0] - 2023-03-01
115
+ ### Changed
116
+ - [PLAYCUST-1625](https://brightcove.atlassian.net/browse/PLAYCUST-1625) Check for Interactivity Plugin using Registry ID
117
+
118
+ ## [0.2.2] - 2023-02-21
119
+ ### Changed
120
+ - [LIVE-2447](https://brightcove.atlassian.net/browse/LIVE-2447) Default playerID to be the first in the list
121
+
122
+ ## [0.2.1] - 2023-02-15
123
+ ### Fixed
124
+ - [LIVE-2447](https://brightcove.atlassian.net/browse/LIVE-2447) Update peerDependencies and dependencies
125
+
126
+ ## [0.2.0] - 2023-02-08
127
+ ### Fixed
128
+ - [LIVE-2447](https://brightcove.atlassian.net/browse/LIVE-2447) Interactivity params for preview, player and embed code
129
+
130
+ ## [0.1.28] - 2023-02-01
131
+ ### Added
132
+ - [LIVE-2455](https://brightcove.atlassian.net/browse/LIVE-2455) Create Player if no Interactivity-enabled Player is found
133
+ - [LIVE-2533](https://brightcove.atlassian.net/browse/LIVE-2533) Embed Code Modal Translations
134
+
135
+ ## [0.1.27] - 2022-12-21
136
+ ### Added
137
+ - [LIVE-2448](https://brightcove.atlassian.net/browse/LIVE-2448) Interactivity attribute to react player loader when using the interactivity modal
138
+
139
+ ## [0.1.26] - 2022-11-18
140
+ ### Added
141
+ - Support for Interactivity player
142
+
143
+ ## [0.1.25] - 2022-10-06
144
+ ### Added
145
+ - Campaign Plugin and Plugins notice for Player embed
146
+
147
+ ### Changed
148
+ - VideoPayload type
149
+
150
+ ## [0.1.24] - 2022-09-29
151
+ ### Changed
152
+ - Export for payload types
153
+
154
+ ## [0.1.23] - 2022-09-28
155
+ ### Added
156
+ - Export for `PlayerPayload`
157
+
158
+ ### Fixed
159
+ - Typings in `package.json`
160
+
161
+ ## [0.1.22] - 2022-09-27
162
+ ### Fixed
163
+ - Type exports for build
164
+
165
+ ## [0.1.21] - 2022-09-01
166
+ ### Added
167
+ - Player type context
168
+
169
+ ### Changed
170
+ - **BREAKING CHANGE** `video` prop to `data`
171
+
172
+ ## [0.1.20] - 2022-08-11
173
+ ### Fixed
174
+ - Video title truncation small fix
175
+
176
+ ## [0.1.19] - 2022-08-09
177
+ ### Fixed
178
+ - PLAYCUST-1254 add support for safari clipboard
179
+ - PLAYCUST-1254 make sure peerDep for @brightcove/react-player-loader matches with media-four module
180
+ - remove unused variables
181
+ - Long video titles are now truncated
182
+
183
+ ## [0.1.18] - 2022-08-03
184
+ ### Changed
185
+ - upgrade `@brightcove/studio-components` to 7.0.0
186
+ - remove deprecated props
187
+
188
+ ## [0.1.17] - 2022-07-26
189
+ ### Changed
190
+ - Add `@brightcove/react-player-loader` as peerDependency so its handled by parent module
191
+
192
+ ## [0.1.16] - 2022-07-22
193
+ ### Changed
194
+ - Removed older design
195
+
196
+ ### Fixed
197
+ - Translation strings when copying url
198
+ - Support custom css on player configuration by using iframes
199
+ - Translation string when Campaign player is selected
200
+
201
+ ## [0.1.15] - 2022-07-13
202
+ ### Added
203
+ - Sort players dropdown
204
+
205
+ ### Fixed
206
+ - Trigger Toast notifications up to parent module
207
+
208
+ ## [0.1.14] - 2022-07-05
209
+ ### Fixed
210
+ - Hide iFrame embed code for Campaign-enabled players
211
+
212
+ ## [0.1.13] - 2022-06-29
213
+ ### Added
214
+ - Shorten url on preview button click
215
+
216
+ ### Fixed
217
+ - Show Config Message only for players with non-bc plugins
218
+
219
+ ## [0.1.12] - 2022-06-24
220
+ ### Fixed
221
+ - Remove extra preview button
222
+
223
+ ## [0.1.11] - 2022-06-20
224
+ ### Added
225
+ - Add Copy URL and Preview button
226
+
227
+ ## [0.1.10] - 2022-06-01
228
+ ### Changed
229
+ - update custom copy field
230
+
231
+ ## [0.1.9] - 2022-05-26
232
+ ### Changed
233
+ - `CopyField` to use latest `studio-components` version
234
+
235
+ ### Fixed
236
+ - Keep Javascript enabled for campaign players
237
+
238
+ ## [0.1.8] - 2022-05-26
239
+ ### Added
240
+ - Prevent iFrame from being copied when the selected player is campaign
241
+
242
+ ## [0.1.7] - 2022-05-23
243
+ ### Fixed
244
+ - `EmbedCodeModalTypes` export change to value instead of type
245
+
246
+ ## [0.1.6] - 2022-05-18
247
+ ### Added
248
+ - Notice when player selected has plugins
249
+ - Update iFrame/Javascript code snippet when selected player changes
250
+ - Player preview using ReactPlayerLoader
251
+ - Player preview link updates with player selected
252
+
253
+ ### Fixed
254
+ - Only fetch list of players when modal is open
255
+
256
+ ## [0.1.5] - 2022-05-10
257
+ ### Added
258
+ - Feature switch for new enhancements
259
+ - Component now receives a `type` prop
260
+ - Fetch list of players
261
+
262
+ ### Changed
263
+ - Design updates
264
+
265
+ ## [0.1.4] - 2022-04-28
266
+ ### Added
267
+ - KACL validation
268
+
269
+ ### Fixed
270
+ - Missing docs link in tooltip
271
+
272
+ ## [0.1.3] - 2022-04-12
273
+ ### Changed
274
+ - Toaster moved to be inside modal content
275
+
276
+ ## [0.1.2] - 2022-02-23
277
+ ### Changed
278
+ - Style tweaks for the modal
279
+
280
+ ## [0.1.1] - 2021-12-21
281
+ ### Added
282
+ - Trigger open when video object gets passed into props
283
+
284
+ ## 0.1.0 - 2021-11-26
285
+ ### Added
286
+ - Initial commit of embed code modal component
287
+
288
+ [Unreleased]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.8.2...HEAD
289
+ [0.8.2]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.8.1...v0.8.2
290
+ [0.8.1]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.8.0...v0.8.1
291
+ [0.8.0]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.7.2...v0.8.0
292
+ [0.7.2]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.7.1...v0.7.2
293
+ [0.7.1]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.7.1...v0.7.1
294
+ [0.7.1]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.7.0...v0.7.1
295
+ [0.7.0]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.6.0...v0.7.0
296
+ [0.6.0]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.5.1...v0.6.0
297
+ [0.5.1]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.5.0...v0.5.1
298
+ [0.5.0]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.4.4...v0.5.0
299
+ [0.4.4]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.4.3...v0.4.4
300
+ [0.4.3]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.4.2...v0.4.3
301
+ [0.4.2]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.4.1...v0.4.2
302
+ [0.4.1]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.4.0...v0.4.1
303
+ [0.4.0]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.3.7...v0.4.0
304
+ [0.3.7]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.3.6...v0.3.7
305
+ [0.3.6]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.3.5...v0.3.6
306
+ [0.3.5]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.3.4...v0.3.5
307
+ [0.3.4]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.3.3...v0.3.4
308
+ [0.3.3]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.3.2...v0.3.3
309
+ [0.3.2]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.3.1...v0.3.2
310
+ [0.3.1]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.3.0...v0.3.1
311
+ [0.3.0]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.2.2...v0.3.0
312
+ [0.2.2]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.2.1...v0.2.2
313
+ [0.2.1]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.2.0...v0.2.1
314
+ [0.2.0]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.28...v0.2.0
315
+ [0.1.28]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.27...v0.1.28
316
+ [0.1.27]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.26...v0.1.27
317
+ [0.1.26]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.25...v0.1.26
318
+ [0.1.25]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.24...v0.1.25
319
+ [0.1.24]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.23...v0.1.24
320
+ [0.1.23]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.22...v0.1.23
321
+ [0.1.22]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.21...v0.1.22
322
+ [0.1.21]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.20...v0.1.21
323
+ [0.1.20]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.19...v0.1.20
324
+ [0.1.19]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.18...v0.1.19
325
+ [0.1.18]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.17...v0.1.18
326
+ [0.1.17]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.16...v0.1.17
327
+ [0.1.16]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.15...v0.1.16
328
+ [0.1.15]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.14...v0.1.15
329
+ [0.1.14]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.13...v0.1.14
330
+ [0.1.13]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.12...v0.1.13
331
+ [0.1.12]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.11...v0.1.12
332
+ [0.1.11]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.10...v0.1.11
333
+ [0.1.10]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.9...v0.1.10
334
+ [0.1.9]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.8...v0.1.9
335
+ [0.1.8]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.7...v0.1.8
336
+ [0.1.7]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.6...v0.1.7
337
+ [0.1.6]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.5...v0.1.6
338
+ [0.1.5]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.4...v0.1.5
339
+ [0.1.4]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.3...v0.1.4
340
+ [0.1.3]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.2...v0.1.3
341
+ [0.1.2]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.1...v0.1.2
342
+ [0.1.1]: https://bithub.brightcove.com/studio-ui-kit/studio-components-embed-code-modal/compare/v0.1.0...v0.1.1
package/CODEOWNERS ADDED
@@ -0,0 +1,37 @@
1
+ # This is a comment.
2
+ # Each line is a file pattern followed by one or more owners.
3
+
4
+ # These owners will be the default owners for everything in
5
+ # the repo. Unless a later match takes precedence,
6
+ # @global-owner1 and @global-owner2 will be requested for
7
+ # review when someone opens a pull request.
8
+ * @studio-ui-kit/player-customization-team
9
+
10
+ # Order is important; the last matching pattern takes the most
11
+ # precedence. When someone opens a pull request that only
12
+ # modifies JS files, only @js-owner and not the global
13
+ # owner(s) will be requested for a review.
14
+ # *.js @js-owner
15
+
16
+ # You can also use email addresses if you prefer. They'll be
17
+ # used to look up users just like we do for commit author
18
+ # emails.
19
+ # *.go docs@example.com
20
+
21
+ # In this example, @doctocat owns any files in the build/logs
22
+ # directory at the root of the repository and any of its
23
+ # subdirectories.
24
+ # /build/logs/ @doctocat
25
+
26
+ # The `docs/*` pattern will match files like
27
+ # `docs/getting-started.md` but not further nested files like
28
+ # `docs/build-app/troubleshooting.md`.
29
+ # docs/* docs@example.com
30
+
31
+ # In this example, @octocat owns any file in an apps directory
32
+ # anywhere in your repository.
33
+ # apps/ @octocat
34
+
35
+ # In this example, @doctocat owns any file in the `/docs`
36
+ # directory in the root of your repository.
37
+ # /docs/ @doctocat
@@ -0,0 +1,17 @@
1
+ ## Description
2
+
3
+ Give context for the issue/feature you worked on and a brief explanation on how you solved it.
4
+
5
+ ## Screenshots _[Optional]_
6
+
7
+ If applicable, attach images of the before and after of the changes
8
+
9
+ ## PR Checklist
10
+
11
+ - [ ] New components have `testName` or `data-test-name` props
12
+
13
+ _Checklist items are optional if you do not need to make any changes to them_
14
+
15
+ ## Link to issue
16
+
17
+ Link to Jira ticket
@@ -0,0 +1,51 @@
1
+ import React from 'react';
2
+ import { render } from '@testing-library/react';
3
+ import { ModalContainer } from '../src/js/components';
4
+ import { EmbedCodeModalTypes } from '../src';
5
+ import { QueryClientProvider, QueryClient } from 'react-query';
6
+
7
+ const DEFAULT_MODAL_COMP = {
8
+ videoId: '123',
9
+ videoName: 'test video',
10
+ accountId: '456',
11
+ duration: 10,
12
+ };
13
+
14
+ const wrappedComponent = (children: React.ReactElement) => (
15
+ <QueryClientProvider client={new QueryClient()}>
16
+ {children}
17
+ </QueryClientProvider>
18
+ );
19
+
20
+ const handleSetComponentKey = jest.fn;
21
+ const handleSetHasCreatedPlayer = jest.fn;
22
+
23
+ test('does not render player with wrong information but right type', () => {
24
+ const { container } = render(
25
+ wrappedComponent(
26
+ <ModalContainer
27
+ handleSetComponentKey={handleSetComponentKey}
28
+ data={DEFAULT_MODAL_COMP}
29
+ hasCreatedPlayer={false}
30
+ handleSetHasCreatedPlayer={handleSetHasCreatedPlayer}
31
+ embedCodeModalType={EmbedCodeModalTypes.PLAYER}
32
+ />,
33
+ ),
34
+ );
35
+ expect(container.innerHTML).toBe('');
36
+ });
37
+
38
+ test('does not render project with wrong information but right type', () => {
39
+ const { container } = render(
40
+ wrappedComponent(
41
+ <ModalContainer
42
+ handleSetComponentKey={handleSetComponentKey}
43
+ data={DEFAULT_MODAL_COMP}
44
+ hasCreatedPlayer={false}
45
+ handleSetHasCreatedPlayer={handleSetHasCreatedPlayer}
46
+ embedCodeModalType={EmbedCodeModalTypes.PROJECT}
47
+ />,
48
+ ),
49
+ );
50
+ expect(container.innerHTML).toBe('');
51
+ });
@@ -0,0 +1,50 @@
1
+ import React from 'react';
2
+ import { QueryClientProvider, QueryClient } from 'react-query';
3
+ import { render, screen } from '@testing-library/react';
4
+ import { VideoPlayer } from 'js/components';
5
+ import { EmbedCodeModalTypes } from 'js/types/EmbedCodeModalProps';
6
+ import { PLAYER_LIST_FOR_SELECTION, PLAYERS } from 'js/constants/player';
7
+
8
+ jest.mock('../src/js/utils/featureSwitches');
9
+
10
+ const wrappedComponent = (children: React.ReactElement) => (
11
+ <QueryClientProvider client={new QueryClient()}>
12
+ {children}
13
+ </QueryClientProvider>
14
+ );
15
+
16
+ const DEFAULT_MODAL_COMP = {
17
+ videoId: '123',
18
+ videoName: 'test video',
19
+ interactivityProjectId: '9876',
20
+ interactivityProjectName: 'test project',
21
+ accountId: '456',
22
+ duration: 10,
23
+ };
24
+
25
+ test('renders EmbedCodeModal component with right information', () => {
26
+ render(
27
+ wrappedComponent(
28
+ <VideoPlayer
29
+ video={DEFAULT_MODAL_COMP}
30
+ embedCodeModalType={EmbedCodeModalTypes.PROJECT}
31
+ playerListForSelection={PLAYER_LIST_FOR_SELECTION}
32
+ players={PLAYERS}
33
+ />,
34
+ ),
35
+ );
36
+ expect(
37
+ screen.getByText(DEFAULT_MODAL_COMP.interactivityProjectId),
38
+ ).toBeInTheDocument();
39
+ expect(
40
+ screen.getByText(DEFAULT_MODAL_COMP.interactivityProjectName),
41
+ ).toBeInTheDocument();
42
+ expect(
43
+ screen.queryByText(DEFAULT_MODAL_COMP.videoId),
44
+ ).not.toBeInTheDocument();
45
+ expect(
46
+ screen.queryByText(DEFAULT_MODAL_COMP.videoName),
47
+ ).not.toBeInTheDocument();
48
+ expect(screen.getByRole('tab', { name: /javascript/i })).toBeInTheDocument();
49
+ expect(screen.getByRole('tab', { name: /IFrame/i })).toBeInTheDocument();
50
+ });
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { render, screen } from '@testing-library/react';
3
+ import { PlayerPreview } from '../src/js/components';
4
+ import { QueryClientProvider, QueryClient } from 'react-query';
5
+
6
+ const DEFAULT_MODAL_COMP = {
7
+ id: 'default',
8
+ accountId: '456',
9
+ };
10
+
11
+ const wrappedComponent = (children: React.ReactElement) => (
12
+ <QueryClientProvider client={new QueryClient()}>
13
+ {children}
14
+ </QueryClientProvider>
15
+ );
16
+
17
+ test('renders PlayerPreview component with right information', () => {
18
+ render(wrappedComponent(<PlayerPreview {...DEFAULT_MODAL_COMP} />));
19
+ expect(screen.getByText('getURL')).toBeInTheDocument();
20
+ expect(screen.getByText('previewButton')).toBeInTheDocument();
21
+ expect(screen.getByRole('tab', { name: /javascript/i })).toBeInTheDocument();
22
+ expect(screen.getByRole('tab', { name: /IFrame/i })).toBeInTheDocument();
23
+ });
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { act, fireEvent, render } from '@testing-library/react';
3
+ import { TabsHeader } from '../src/js/components';
4
+
5
+ const DEFAULT_MODAL_COMP = {
6
+ currentTab: 'iframe',
7
+ handleTabChange: jest.fn(),
8
+ iframeLabel: 'iframe',
9
+ jsLabel: 'js',
10
+ };
11
+
12
+ test('renders TabsHeader clickeable tabs', async () => {
13
+ const { getByRole } = render(<TabsHeader {...DEFAULT_MODAL_COMP} />);
14
+ const jsBtn = getByRole('tab', { name: DEFAULT_MODAL_COMP.jsLabel });
15
+ act(() => {
16
+ fireEvent.click(jsBtn);
17
+ });
18
+ expect(DEFAULT_MODAL_COMP.handleTabChange).toBeCalled();
19
+ });